|
@@ -65,7 +65,6 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
mapData.init();
|
|
|
|
|
|
if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
- log.info("INT_NO: {}, RING_NO: {}, PLAN_TP: {}", intNo, ringNo, planTp);
|
|
|
res = SigMapData.signalMapDecompress(buffer, idx, compSize, mapData);
|
|
|
}
|
|
|
else {
|
|
@@ -139,82 +138,82 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public boolean responseTEST(RecvPacketDto packet) {
|
|
|
- boolean result = true;
|
|
|
- try {
|
|
|
- final int recordSize = 262; // 2 + 1+1+1+1+1 + 255 = 262
|
|
|
- if (!packet.getPacket().checkDataLength(recordSize)) {
|
|
|
- log.error("[{}], SigPhaseChange.response: Data Length Error: Req({}), Cur({}). will be closed.",
|
|
|
- packet.getCenter().getLogKey(), packet.getPacket().getReqDataLength(recordSize), packet.getPacket().getCurDataLength());
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- int res;
|
|
|
- SigMapData mapData = new SigMapData();
|
|
|
- String regionCd = packet.getCenter().getRegionCd();
|
|
|
- int idx;
|
|
|
- byte[] buffer = packet.getPacket().getBuffer();
|
|
|
- for (int ii = 0; ii < packet.getPacket().getCount(); ii++) {
|
|
|
- idx = SigProtocolConst.SIG_HEAD_SIZE + (ii * (7 + SigMapData.MAX_COMPRESS_DATA_SIZE));
|
|
|
-
|
|
|
- int intNo = ((buffer[idx++] & 0xFF) << 8) | (buffer[idx++] & 0xFF);
|
|
|
- int lcType = (buffer[idx++] & 0xFF); /* 제어기유형(1:2004년형, 2:2010년형) */
|
|
|
- int ringNo = (buffer[idx++] & 0xFF); /* 링번호(0:A링,1:B링) */
|
|
|
- int lampTp = (buffer[idx++] & 0xFF); /* 등화기유형(3:3색등화기, 4:4색등화기) */
|
|
|
- int planTp = (buffer[idx++] & 0xFF); /* map 계획구분, 0:일반제, 1~5:시차제, 6:보행맵 */
|
|
|
- int compSize = (buffer[idx++] & 0xFF);
|
|
|
-
|
|
|
- mapData.init();
|
|
|
-
|
|
|
- if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
- log.info("INT_NO: {}, RING_NO: {}, PLAN_TP: {}", intNo, ringNo, planTp);
|
|
|
- res = SigMapData.signalMapDecompress(buffer, idx, compSize, mapData);
|
|
|
- }
|
|
|
- else {
|
|
|
- res = SigMapData.signalMapDecompress2010(buffer, idx, compSize, mapData);
|
|
|
- }
|
|
|
-
|
|
|
- if (res == 0) {
|
|
|
- log.error("[{}], SigSignalMap.response: Decompress Error. INT_NO: {}, LC_TYPE: {}", packet.getCenter().getLogKey(), intNo, lcType);
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- for (int jj = 0; jj < SigMapData.MAX_SIGMAP_STEP; jj++) {
|
|
|
- log.info("{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}",
|
|
|
- regionCd,
|
|
|
- intNo,
|
|
|
- ringNo,
|
|
|
- planTp,
|
|
|
- String.format("%2d", jj+1),
|
|
|
-
|
|
|
- String.format("%3d", mapData.step[jj].code[0] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[1] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[2] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[3] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[4] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[5] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[6] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[7] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[8] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[9] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[10] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[11] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[12] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[13] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[14] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[15] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[16] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[17] & 0xFF),
|
|
|
- String.format("%3d", mapData.step[jj].code[18] & 0xFF)); /*현시종료여부(1:종료) */
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
- log.error("[{}], SigSignalMap.response: Exception. will be closed. {}", packet.getCenter().getLogKey(), e.getMessage());
|
|
|
- result = false;
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
+// public boolean responseTEST(RecvPacketDto packet) {
|
|
|
+// boolean result = true;
|
|
|
+// try {
|
|
|
+// final int recordSize = 262; // 2 + 1+1+1+1+1 + 255 = 262
|
|
|
+// if (!packet.getPacket().checkDataLength(recordSize)) {
|
|
|
+// log.error("[{}], SigPhaseChange.response: Data Length Error: Req({}), Cur({}). will be closed.",
|
|
|
+// packet.getCenter().getLogKey(), packet.getPacket().getReqDataLength(recordSize), packet.getPacket().getCurDataLength());
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// int res;
|
|
|
+// SigMapData mapData = new SigMapData();
|
|
|
+// String regionCd = packet.getCenter().getRegionCd();
|
|
|
+// int idx;
|
|
|
+// byte[] buffer = packet.getPacket().getBuffer();
|
|
|
+// for (int ii = 0; ii < packet.getPacket().getCount(); ii++) {
|
|
|
+// idx = SigProtocolConst.SIG_HEAD_SIZE + (ii * (7 + SigMapData.MAX_COMPRESS_DATA_SIZE));
|
|
|
+//
|
|
|
+// int intNo = ((buffer[idx++] & 0xFF) << 8) | (buffer[idx++] & 0xFF);
|
|
|
+// int lcType = (buffer[idx++] & 0xFF); /* 제어기유형(1:2004년형, 2:2010년형) */
|
|
|
+// int ringNo = (buffer[idx++] & 0xFF); /* 링번호(0:A링,1:B링) */
|
|
|
+// int lampTp = (buffer[idx++] & 0xFF); /* 등화기유형(3:3색등화기, 4:4색등화기) */
|
|
|
+// int planTp = (buffer[idx++] & 0xFF); /* map 계획구분, 0:일반제, 1~5:시차제, 6:보행맵 */
|
|
|
+// int compSize = (buffer[idx++] & 0xFF);
|
|
|
+//
|
|
|
+// mapData.init();
|
|
|
+//
|
|
|
+// if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
+// log.info("INT_NO: {}, RING_NO: {}, PLAN_TP: {}", intNo, ringNo, planTp);
|
|
|
+// res = SigMapData.signalMapDecompress(buffer, idx, compSize, mapData);
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// res = SigMapData.signalMapDecompress2010(buffer, idx, compSize, mapData);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (res == 0) {
|
|
|
+// log.error("[{}], SigSignalMap.response: Decompress Error. INT_NO: {}, LC_TYPE: {}", packet.getCenter().getLogKey(), intNo, lcType);
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+//
|
|
|
+// for (int jj = 0; jj < SigMapData.MAX_SIGMAP_STEP; jj++) {
|
|
|
+// log.info("{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}",
|
|
|
+// regionCd,
|
|
|
+// intNo,
|
|
|
+// ringNo,
|
|
|
+// planTp,
|
|
|
+// String.format("%2d", jj+1),
|
|
|
+//
|
|
|
+// String.format("%3d", mapData.step[jj].code[0] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[1] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[2] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[3] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[4] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[5] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[6] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[7] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[8] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[9] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[10] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[11] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[12] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[13] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[14] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[15] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[16] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[17] & 0xFF),
|
|
|
+// String.format("%3d", mapData.step[jj].code[18] & 0xFF)); /*현시종료여부(1:종료) */
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// catch (Exception e) {
|
|
|
+// log.error("[{}], SigSignalMap.response: Exception. will be closed. {}", packet.getCenter().getLogKey(), e.getMessage());
|
|
|
+// result = false;
|
|
|
+// }
|
|
|
+// return result;
|
|
|
+// }
|
|
|
|
|
|
// {
|
|
|
// if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|