shjung 10 月之前
父節點
當前提交
a602d732eb

+ 3 - 3
src/main/java/com/ggits/comm/server/dao/mapper/batch/SigIntDao.java

@@ -24,8 +24,8 @@ public class SigIntDao extends BatchDaoService {
         req.forEach(obj -> {
             HashMap<String, Object> param = new HashMap<>();
 
-            param.put("REGION_CD",                  obj.REGION_CD);
-            param.put("INT_NO",                     obj.INT_NO);
+            param.put("REGION_CD",                  obj.regionCd);
+            param.put("INT_NO",                     obj.intNo);
             param.put("COLLCT_DTIME",               obj.COLLCT_DTIME);
             param.put("SYS_COLLCT_DTIME",           obj.SYS_COLLCT_DTIME);
             param.put("COMM_ON_OFF_FLAG",           obj.COMM_ON_OFF_FLAG);
@@ -36,7 +36,7 @@ public class SigIntDao extends BatchDaoService {
             param.put("SIGLIGHT_BLINK_FLAG",        obj.SIGLIGHT_BLINK_FLAG);
             param.put("CONTRLR_MANUAL_FLAG",        obj.CONTRLR_MANUAL_FLAG);
             param.put("CONTRLR_TMDIFF_CONTRL_FLAG", obj.CONTRLR_TMDIFF_CONTRL_FLAG);
-            param.put("MAP_NO",                     obj.MAP_NO);
+            param.put("MAP_NO",                     obj.mapNo);
             param.put("INT_SIG_CYCLE_CNT",          obj.INT_SIG_CYCLE_CNT);
             param.put("INT_SIG_CYCLE_LEN",          obj.INT_SIG_CYCLE_LEN);
             param.put("A_RING_1_PHASE_VAL",         obj.A_RING_1_PHASE_VAL);

+ 6 - 6
src/main/java/com/ggits/comm/server/dto/IntStatusDto.java

@@ -14,8 +14,8 @@ import java.io.Serializable;
 public class IntStatusDto implements Serializable {
     public static final long serialVersionUID = 1L;
 
-    public String REGION_CD;                   	//	N	VARCHAR2(3)	N
-    public int    INT_NO;                       //	N	NUMBER(6)	N
+    public String regionCd;                   	//	N	VARCHAR2(3)	N
+    public int intNo;                       //	N	NUMBER(6)	N
     public String COLLCT_DTIME;                	//	N	DATE	Y
     public String SYS_COLLCT_DTIME;            	//	N	DATE Y
     public String COMM_ON_OFF_FLAG;            	//	N	CHAR(1)	Y
@@ -26,7 +26,7 @@ public class IntStatusDto implements Serializable {
     public String SIGLIGHT_BLINK_FLAG;         	//	N	CHAR(1)	Y
     public String CONTRLR_MANUAL_FLAG;         	//	N	CHAR(1)	Y
     public String CONTRLR_TMDIFF_CONTRL_FLAG;  	//	N	CHAR(1)	Y
-    public int    MAP_NO;                       //	N	NUMBER(1)	Y
+    public int    mapNo;                       //	N	NUMBER(1)	Y
     public int    INT_SIG_CYCLE_CNT;            //	N	NUMBER(3)	Y
     public int    INT_SIG_CYCLE_LEN;            //	N	NUMBER(3)	Y
     public int    A_RING_1_PHASE_VAL;           //	N	NUMBER(3)	Y
@@ -49,9 +49,9 @@ public class IntStatusDto implements Serializable {
     public int    GROUP_NO;                     //	N	NUMBER(6)	Y
     public String PPC_CONTRL_FLAG;              //	N	CHAR(1)	Y
 
-    public IntStatusDto(String REGION_CD, int INT_NO) {
-        this.REGION_CD = REGION_CD;
-        this.INT_NO = INT_NO;
+    public IntStatusDto(String regionCd, int intNo) {
+        this.regionCd = regionCd;
+        this.intNo = intNo;
 
         this.CONTRLR_MANUAL_FLAG = "0";
         this.CONTRLR_TMDIFF_CONTRL_FLAG = "0";

+ 57 - 52
src/main/java/com/ggits/comm/server/process/work/GgitsPacketWorker.java

@@ -122,29 +122,35 @@ public class GgitsPacketWorker extends AbstractAppWorker implements Runnable {
             }
             center.setRecvSeqNo(sequence);
 
-            int intLcNo;
-            int ringAP;
-            //int ringAS;
-            int ringBP;
-            //int ringBS;
-            int comm;
-            int mapNo;
-            //int crs;
-            int mode;
-//            int pnlManCont;
-//            int pnlMan;
-//            int pnlBlink;
-//            int pnlOut;
-//            int pnlAS;
-            int turnOff;
-            int blink;
-//            int pnlDb;
-//            byte ppc;
-//            byte omit;
-            byte flags1;
-            byte flags2;
-            byte flags3;
-            byte flags4;
+            int intLcNo;            // 교차로 번호 = (지자체 번호) * 10000 + (지자체 교차로 순번)
+            int aRingCode;          // 현시코드-RING A
+                int aRingPhase;     //7-5   RING A의 PHASE (0 ~ 7)
+                int aRingStep;      //4-0   RING A의 STEP (0 ~ 31)
+            int bRingCode;          // 현시코드-RING B
+                int bRingPhase;     //7-5   RING B의 PHASE (0 ~ 7)
+                int bRingStep;      //4-0   RING B의 STEP (0 ~ 31)
+            int operStts;           // 제어기 운영 상태
+                int centerComm;     //7       센터와 통신 FAIL 상태  0 : 정상, 1 : 통신 FAIL
+                int operMapNo;      //6...4   현재 운영중인 맵 번호 ( 0 : 일반제, 1~5: 시차제, 6 : 전용맵)
+                int addNode;        //3       교차로 연등  0 : 일반교차로,  1 : 연등교차로
+                int operMode;       //2...0   교통신호기 운영 모드
+                                    //          0 : SCU 고정주기 모드
+                                    //          1 : 감응하지 않는 OFFLINE 제어모드
+                                    //          2 : 감응되는 OFFLINE 제어모드
+                                    //          4 : 감응되는 온라인 제어모드
+                                    //          5 : 감응하지 않는 온라인 제어모드
+
+            int lcStts;                 // 제어기 상태
+                int policeManProg;      //7   POLICE PANEL 수동 진행S/W상태,  1 : ON,  0 : OFF
+                int policeMan;          //6   POLICE PANEL 수동 S/W 상태,    1 : ON,  0 : OFF
+                int policeBlink;        //5   POLICE PANEL 점멸 S/W 상태,    1 : ON,  0 : OFF
+                int policeTurnOff;      //4   POLICE PANEL 소등 S/W 상태,    1 : ON,  0 : OFF
+                int contration;         //3   모순 상태,                     1 : 모순, 0 : 정상
+                int turnOff;            //2   소등 상태,                     1 : 소등, 0 : 정상
+                int blink;              //1   점멸 상태,                     1 : 점멸, 0 : 정상
+                int dbError;            //0   데이터베이스 상태,             1 : 이상, 0 : 정상
+            int holdPhase;      // PHASE HOLD 명령 또는 PPC에 의해 고정된 현시번호 (1-8)
+            int omitPhase;      // PHASE OMIT 명령을 받은 현시번호 또는 감응제어에 의해 생략 중인 현시번호(1-8)
 
             for (int ii = 0; ii < count; ii++) {
                 intLcNo = ((data.buffer[idx++] & 0xFF) << 24) |
@@ -152,14 +158,13 @@ public class GgitsPacketWorker extends AbstractAppWorker implements Runnable {
                           ((data.buffer[idx++] & 0xFF) << 8)  |
                            (data.buffer[idx++] & 0xFF);
 
-                flags1 = data.buffer[idx++];
-                flags2 = data.buffer[idx++];
-                flags3 = data.buffer[idx++];
-                flags4 = data.buffer[idx++];
-//                ppc    = data.buffer[idx++];
-//                omit   = data.buffer[idx++];
-                idx++;
-                idx++;
+                aRingCode = data.buffer[idx++] & 0xFF;
+                bRingCode = data.buffer[idx++] & 0xFF;
+                operStts  = data.buffer[idx++] & 0xFF;
+                lcStts    = data.buffer[idx++] & 0xFF;
+                holdPhase = data.buffer[idx++] & 0xFF;
+                omitPhase = data.buffer[idx++] & 0xFF;
+
                 IntDto intDto = this.repo.getIntMap().get(intLcNo);
                 if (intDto == null) {
                     UnknownIntDto unknownDto = this.repo.getUnknownIntMap().get(intLcNo);
@@ -171,25 +176,25 @@ public class GgitsPacketWorker extends AbstractAppWorker implements Runnable {
                     continue;
                 }
 
-                ringAP = (flags1 >> 5) & 0x07;
-                //ringAS = flags1 & 0x1F;
+                aRingPhase = (aRingCode >> 5) & 0x07;   // 0x7 = 0000 0111
+                aRingStep =  (aRingCode     ) & 0x1F;   // 0x1F == 0001 1111
 
-                ringBP = (flags2 >> 5) & 0x07;
-                //ringBS = flags2 & 0x1F;
+                bRingPhase = (bRingCode >> 5) & 0x07;
+                bRingStep   =(bRingCode     ) & 0x1F;
 
-                comm = (flags3 >> 7 & 0x01);
-                mapNo = (flags3 >> 4) & 0x07;
-                //crs = (flags3 & 0x08);
-                mode = (flags3) & 0x07;
+                centerComm = (operStts >> 7) & 0x01;
+                operMapNo  = (operStts >> 4) & 0x07;
+                addNode    = (operStts >> 2) & 0x01;
+                operMode   = (operStts     ) & 0x07;
 
-//                pnlManCont = (flags4 >> 7 & 0x01);
-//                pnlMan     = (flags4 >> 6 & 0x01);
-//                pnlBlink   = (flags4 >> 5 & 0x01);
-//                pnlOut     = (flags4 >> 4 & 0x01);
-//                pnlAS      = (flags4 >> 3 & 0x01);
-                turnOff    = (flags4 >> 2 & 0x01);
-                blink      = (flags4 >> 1 & 0x01);
-//                pnlDb      = (flags4 >> 0 & 0x01);
+                policeManProg = (lcStts >> 7) & 0x01;
+                policeMan     = (lcStts >> 6) & 0x01;
+                policeBlink   = (lcStts >> 5) & 0x01;
+                policeTurnOff = (lcStts >> 4) & 0x01;
+                contration    = (lcStts >> 3) & 0x01;
+                turnOff       = (lcStts >> 2) & 0x01;
+                blink         = (lcStts >> 1) & 0x01;
+                dbError       = (lcStts     ) & 0x01;
 
                 // 교차로 상태
 //                constants.LC_STATE_COMM_ERROR = 0; // 통신이상
@@ -230,11 +235,11 @@ public class GgitsPacketWorker extends AbstractAppWorker implements Runnable {
 
                 IntStatusDto status = intDto.getStatus();
                 status.COLLCT_DTIME          = COLLCT_DTIME;
-                status.A_RING_PHASE_VAL      = ringAP;
-                status.B_RING_PHASE_VAL      = ringBP;
-                status.COMM_ON_OFF_FLAG      = String.valueOf(comm);
-                status.MAP_NO                = mapNo;
-                status.CONTRLR_OPER_MODE_CD  = String.valueOf(mode);
+                status.A_RING_PHASE_VAL      = aRingPhase;
+                status.B_RING_PHASE_VAL      = bRingPhase;
+                status.COMM_ON_OFF_FLAG      = String.valueOf(centerComm);
+                status.mapNo = operMapNo;
+                status.CONTRLR_OPER_MODE_CD  = String.valueOf(operMode);
                 status.SIGLIGHT_TURNOFF_FLAG = String.valueOf(turnOff);
                 status.SIGLIGHT_BLINK_FLAG   = String.valueOf(blink);