|
@@ -1,6 +1,5 @@
|
|
|
package com.sig.comm.server.xnet.server.process.response;
|
|
|
|
|
|
-import com.sig.app.common.utils.SysUtils;
|
|
|
import com.sig.comm.server.dto.IntDto;
|
|
|
import com.sig.comm.server.process.dbms.DbmsData;
|
|
|
import com.sig.comm.server.process.dbms.DbmsDataProcess;
|
|
@@ -21,8 +20,8 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
this.dbmsDataProcess = dbmsDataProcess;
|
|
|
}
|
|
|
|
|
|
- //@Override
|
|
|
- public boolean responseB(RecvPacketDto packet) {
|
|
|
+ @Override
|
|
|
+ public boolean response(RecvPacketDto packet) {
|
|
|
boolean result = true;
|
|
|
try {
|
|
|
MDC.put("id", packet.getCenter().getLogKey());
|
|
@@ -47,14 +46,15 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
// } pkt_signalmap, *pkt_signalmapp; /* 2 + 1+1+1+1+1 + 255 bytes = 262 */
|
|
|
|
|
|
int res;
|
|
|
-// SigMapData mapData = new SigMapData();
|
|
|
+ SigMapData mapData = new SigMapData();
|
|
|
List<HashMap<String, Object>> typeLists = new ArrayList<>();
|
|
|
List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
String regionCd = packet.getCenter().getRegionCd();
|
|
|
-// String commDt = packet.getPacket().getCommDate();
|
|
|
- int idx = SigProtocolConst.SIG_HEAD_SIZE;
|
|
|
+ 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링) */
|
|
@@ -62,24 +62,20 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
int planTp = (buffer[idx++] & 0xFF); /* map 계획구분, 0:일반제, 1~5:시차제, 6:보행맵 */
|
|
|
int compSize = (buffer[idx++] & 0xFF);
|
|
|
|
|
|
- byte[] compData = new byte[SigMapData.MAX_COMPRESS_DATA_SIZE];
|
|
|
- byte[] deCompData = new byte[SigMapData.MAX_DECOMPRESS_DATA_SIZE];
|
|
|
- System.arraycopy(buffer, idx, compData, 0, compData.length);
|
|
|
-
|
|
|
-// mapData.init();
|
|
|
+ mapData.init();
|
|
|
|
|
|
if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
- res = SigMapData.signalMapDecompress(compData, idx, compSize, deCompData);
|
|
|
+ log.info("INT_NO: {}, RING_NO: {}, PLAN_TP: {}", intNo, ringNo, planTp);
|
|
|
+ res = SigMapData.signalMapDecompress(buffer, idx, compSize, mapData);
|
|
|
}
|
|
|
else {
|
|
|
-// res = SigMapData.signalMapDecompress2010(compData, idx, compSize, deCompData);
|
|
|
+ res = SigMapData.signalMapDecompress2010(buffer, idx, compSize, mapData);
|
|
|
}
|
|
|
- idx = idx + SigMapData.MAX_COMPRESS_DATA_SIZE;
|
|
|
|
|
|
-// if (res == 0) {
|
|
|
-// log.error("[{}], SigSignalMap.response: Decompress Error. INT_NO: {}, LC_TYPE: {}", packet.getCenter().getLogKey(), intNo, lcType);
|
|
|
-// continue;
|
|
|
-// }
|
|
|
+ if (res == 0) {
|
|
|
+ log.error("[{}], SigSignalMap.response: Decompress Error. INT_NO: {}, LC_TYPE: {}", packet.getCenter().getLogKey(), intNo, lcType);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
IntDto intDto = packet.getCenter().getIntMap().get(intNo);
|
|
|
if (intDto != null) {
|
|
@@ -93,7 +89,6 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int spIdx = 0;
|
|
|
for (int jj = 0; jj < SigMapData.MAX_SIGMAP_STEP; jj++) {
|
|
|
HashMap<String, Object> param = new HashMap<>();
|
|
|
|
|
@@ -103,51 +98,32 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
param.put("PLAN_TP", planTp); /*계획구분(0:일반제, 1:시차제, 2:시차제, 3:시차제, 4:시차제, 5:시차제, 6:보행맵) */
|
|
|
param.put("STEP_NO", jj+1); /*스텝번호(1~32) */
|
|
|
|
|
|
- param.put("CAR1", deCompData[spIdx++] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
- param.put("PED1", deCompData[spIdx++] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
- param.put("CAR2", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED2", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR3", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED3", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR4", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED4", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR5", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED5", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR6", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED6", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR7", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED7", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR8", deCompData[spIdx++] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
- param.put("PED8", deCompData[spIdx++] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
- param.put("MIN_TM", deCompData[spIdx++] & 0xFF); /*최소시간 */
|
|
|
- param.put("MAX_TM", deCompData[spIdx++] & 0xFF); /*최대시간 */
|
|
|
- param.put("EOP", deCompData[spIdx++] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
-
|
|
|
-// SigMapData.SigMapInfo mapInfo = mapData.getStep()[jj];
|
|
|
-// param.put("CAR1", mapData.step[jj][ 0] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
-// param.put("PED1", mapData.step[jj][ 1] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
-// param.put("CAR2", mapData.step[jj][ 2] & 0xFF);
|
|
|
-// param.put("PED2", mapData.step[jj][ 3] & 0xFF);
|
|
|
-// param.put("CAR3", mapData.step[jj][ 4] & 0xFF);
|
|
|
-// param.put("PED3", mapData.step[jj][ 5] & 0xFF);
|
|
|
-// param.put("CAR4", mapData.step[jj][ 6] & 0xFF);
|
|
|
-// param.put("PED4", mapData.step[jj][ 7] & 0xFF);
|
|
|
-// param.put("CAR5", mapData.step[jj][ 8] & 0xFF);
|
|
|
-// param.put("PED5", mapData.step[jj][ 9] & 0xFF);
|
|
|
-// param.put("CAR6", mapData.step[jj][10] & 0xFF);
|
|
|
-// param.put("PED6", mapData.step[jj][11] & 0xFF);
|
|
|
-// param.put("CAR7", mapData.step[jj][12] & 0xFF);
|
|
|
-// param.put("PED7", mapData.step[jj][13] & 0xFF);
|
|
|
-// param.put("CAR8", mapData.step[jj][14] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
-// param.put("PED8", mapData.step[jj][15] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
-// param.put("MIN_TM", mapInfo.getMinTm() & 0xFF); /*최소시간 */
|
|
|
-// param.put("MAX_TM", mapInfo.getMaxTm() & 0xFF); /*최대시간 */
|
|
|
-// param.put("EOP", mapInfo.getEop() & 0xFF); /*현시종료여부(1:종료) */
|
|
|
+ param.put("CAR1", mapData.step[jj].code[ 0] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
+ param.put("PED1", mapData.step[jj].code[ 1] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
+ param.put("CAR2", mapData.step[jj].code[ 2] & 0xFF);
|
|
|
+ param.put("PED2", mapData.step[jj].code[ 3] & 0xFF);
|
|
|
+ param.put("CAR3", mapData.step[jj].code[ 4] & 0xFF);
|
|
|
+ param.put("PED3", mapData.step[jj].code[ 5] & 0xFF);
|
|
|
+ param.put("CAR4", mapData.step[jj].code[ 6] & 0xFF);
|
|
|
+ param.put("PED4", mapData.step[jj].code[ 7] & 0xFF);
|
|
|
+ param.put("CAR5", mapData.step[jj].code[ 8] & 0xFF);
|
|
|
+ param.put("PED5", mapData.step[jj].code[ 9] & 0xFF);
|
|
|
+ param.put("CAR6", mapData.step[jj].code[10] & 0xFF);
|
|
|
+ param.put("PED6", mapData.step[jj].code[11] & 0xFF);
|
|
|
+ param.put("CAR7", mapData.step[jj].code[12] & 0xFF);
|
|
|
+ param.put("PED7", mapData.step[jj].code[13] & 0xFF);
|
|
|
+ param.put("CAR8", mapData.step[jj].code[14] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
+ param.put("PED8", mapData.step[jj].code[15] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
+ param.put("MIN_TM", mapData.step[jj].code[16] & 0xFF); /*최소시간 */
|
|
|
+ param.put("MAX_TM", mapData.step[jj].code[17] & 0xFF); /*최대시간 */
|
|
|
+ param.put("EOP", mapData.step[jj].code[18] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
|
|
|
lists.add(param);
|
|
|
}
|
|
|
}
|
|
|
- this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INT_SIGNALMAP, packet.getCenter(), false, lists));
|
|
|
+ if (!lists.isEmpty()) {
|
|
|
+ this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INT_SIGNALMAP, packet.getCenter(), false, lists));
|
|
|
+ }
|
|
|
if (!typeLists.isEmpty()) {
|
|
|
this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INT_TYPE, packet.getCenter(), false, typeLists));
|
|
|
}
|
|
@@ -163,35 +139,18 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean response(RecvPacketDto packet) {
|
|
|
+ public boolean responseTEST(RecvPacketDto packet) {
|
|
|
boolean result = true;
|
|
|
try {
|
|
|
- MDC.put("id", packet.getCenter().getLogKey());
|
|
|
- log.info("[{}], SigSignalMap.response.", packet.getCenter().getLogKey());
|
|
|
-
|
|
|
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;
|
|
|
}
|
|
|
-// #define MAX_COMPRESSDATA_SIZE 255
|
|
|
-// typedef struct _pktSignalMap
|
|
|
-// {
|
|
|
-// byte int_no [2]; /* 교차로 번호 */
|
|
|
-// byte lcType [1]; /* SIGNAL Controller protocol type, ESIGMAP_LC_TYPE_2004 or ESIGMAP_LC_TYPE_2010 */
|
|
|
-// byte ringNo [1]; /* ring no, 0: Aring, 1: Bring */
|
|
|
-// byte lampTp [1]; /* 등화기 유형 */
|
|
|
-// byte planTp [1]; /* map 계획구분, 0:일반제, 1~5:시차제, 6:보행맵 */
|
|
|
-// byte compSize[1]; /* 압축된 signal map data size */
|
|
|
-// byte compData[MAX_COMPRESSDATA_SIZE]; /* 압축된 signal map data */
|
|
|
-// } pkt_signalmap, *pkt_signalmapp; /* 2 + 1+1+1+1+1 + 255 bytes = 262 */
|
|
|
|
|
|
int res;
|
|
|
SigMapData mapData = new SigMapData();
|
|
|
- List<HashMap<String, Object>> typeLists = new ArrayList<>();
|
|
|
- List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
String regionCd = packet.getCenter().getRegionCd();
|
|
|
int idx;
|
|
|
byte[] buffer = packet.getPacket().getBuffer();
|
|
@@ -205,179 +164,100 @@ public class SigSignalMap implements SigCommResponse {
|
|
|
int planTp = (buffer[idx++] & 0xFF); /* map 계획구분, 0:일반제, 1~5:시차제, 6:보행맵 */
|
|
|
int compSize = (buffer[idx++] & 0xFF);
|
|
|
|
|
|
-// byte[] compData = new byte[SigMapData.MAX_COMPRESS_DATA_SIZE];
|
|
|
- byte[] deCompData = new byte[SigMapData.MAX_DECOMPRESS_DATA_SIZE];
|
|
|
-// System.arraycopy(buffer, idx, compData, 0, compData.length);
|
|
|
-
|
|
|
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, deCompData);
|
|
|
+ res = SigMapData.signalMapDecompress(buffer, idx, compSize, mapData);
|
|
|
}
|
|
|
else {
|
|
|
- continue;
|
|
|
-// res = SigMapData.signalMapDecompress2010(buffer, idx, compSize, mapData);
|
|
|
+ res = SigMapData.signalMapDecompress2010(buffer, idx, compSize, mapData);
|
|
|
}
|
|
|
|
|
|
- if (res == 0 && res == -999) {
|
|
|
+ if (res == 0) {
|
|
|
log.error("[{}], SigSignalMap.response: Decompress Error. INT_NO: {}, LC_TYPE: {}", packet.getCenter().getLogKey(), intNo, lcType);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- IntDto intDto = packet.getCenter().getIntMap().get(intNo);
|
|
|
- if (intDto != null) {
|
|
|
- if (intDto.getIntLcType() != lcType || intDto.getIntLampType() != lampTp) {
|
|
|
- HashMap<String, Object> intParam = new HashMap<>();
|
|
|
- intParam.put("REGION_CD", regionCd);
|
|
|
- intParam.put("INT_NO", intNo);
|
|
|
- intParam.put("INT_LCTYPE", lcType);
|
|
|
- intParam.put("INT_LAMP-TYPE", lampTp);
|
|
|
- typeLists.add(intParam);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- int spIdx = 0;
|
|
|
for (int jj = 0; jj < SigMapData.MAX_SIGMAP_STEP; jj++) {
|
|
|
- HashMap<String, Object> param = new HashMap<>();
|
|
|
-
|
|
|
- param.put("REGION_CD", regionCd); /*지역센터코드 */
|
|
|
- param.put("INT_NO", intNo); /*교차로 번호 */
|
|
|
- param.put("RING_NO", ringNo); /*링번호(0:A링,1:B링) */
|
|
|
- param.put("PLAN_TP", planTp); /*계획구분(0:일반제, 1:시차제, 2:시차제, 3:시차제, 4:시차제, 5:시차제, 6:보행맵) */
|
|
|
- param.put("STEP_NO", jj+1); /*스텝번호(1~32) */
|
|
|
-
|
|
|
- if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
- param.put("CAR1", deCompData[spIdx++] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
- param.put("PED1", deCompData[spIdx++] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
- param.put("CAR2", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED2", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR3", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED3", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR4", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED4", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR5", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED5", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR6", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED6", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR7", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("PED7", deCompData[spIdx++] & 0xFF);
|
|
|
- param.put("CAR8", deCompData[spIdx++] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
- param.put("PED8", deCompData[spIdx++] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
- param.put("MIN_TM", deCompData[spIdx++] & 0xFF); /*최소시간 */
|
|
|
- param.put("MAX_TM", deCompData[spIdx++] & 0xFF); /*최대시간 */
|
|
|
- param.put("EOP", deCompData[spIdx++] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
- }
|
|
|
- else {
|
|
|
- param.put("CAR1", mapData.step[jj].code[0] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
- param.put("PED1", mapData.step[jj].code[1] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
- param.put("CAR2", mapData.step[jj].code[2] & 0xFF);
|
|
|
- param.put("PED2", mapData.step[jj].code[3] & 0xFF);
|
|
|
- param.put("CAR3", mapData.step[jj].code[4] & 0xFF);
|
|
|
- param.put("PED3", mapData.step[jj].code[5] & 0xFF);
|
|
|
- param.put("CAR4", mapData.step[jj].code[6] & 0xFF);
|
|
|
- param.put("PED4", mapData.step[jj].code[7] & 0xFF);
|
|
|
- param.put("CAR5", mapData.step[jj].code[8] & 0xFF);
|
|
|
- param.put("PED5", mapData.step[jj].code[9] & 0xFF);
|
|
|
- param.put("CAR6", mapData.step[jj].code[10] & 0xFF);
|
|
|
- param.put("PED6", mapData.step[jj].code[11] & 0xFF);
|
|
|
- param.put("CAR7", mapData.step[jj].code[12] & 0xFF);
|
|
|
- param.put("PED7", mapData.step[jj].code[13] & 0xFF);
|
|
|
- param.put("CAR8", mapData.step[jj].code[14] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
- param.put("PED8", mapData.step[jj].code[15] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
- param.put("MIN_TM", mapData.step[jj].code[16] & 0xFF); /*최소시간 */
|
|
|
- param.put("MAX_TM", mapData.step[jj].code[17] & 0xFF); /*최대시간 */
|
|
|
- param.put("EOP", mapData.step[jj].code[18] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
- }
|
|
|
- lists.add(param);
|
|
|
+ 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:종료) */
|
|
|
}
|
|
|
}
|
|
|
- if (!lists.isEmpty()) {
|
|
|
- this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INT_SIGNALMAP, packet.getCenter(), false, lists));
|
|
|
- }
|
|
|
- if (!typeLists.isEmpty()) {
|
|
|
- this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INT_TYPE, packet.getCenter(), false, typeLists));
|
|
|
- }
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
log.error("[{}], SigSignalMap.response: Exception. will be closed. {}", packet.getCenter().getLogKey(), e.getMessage());
|
|
|
result = false;
|
|
|
}
|
|
|
- finally {
|
|
|
- MDC.remove(packet.getCenter().getLogKey());
|
|
|
- MDC.clear();
|
|
|
- }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public void responseTEST(RecvPacketDto packet) {
|
|
|
- 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;
|
|
|
- }
|
|
|
-
|
|
|
- int res;
|
|
|
- List<HashMap<String, Object>> typeLists = new ArrayList<>();
|
|
|
- List<HashMap<String, Object>> lists = new ArrayList<>();
|
|
|
- String regionCd = packet.getCenter().getRegionCd();
|
|
|
- int idx = SigProtocolConst.SIG_HEAD_SIZE;
|
|
|
- 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);
|
|
|
-
|
|
|
- log.info("{}, {}, {}, {}, {}, {}", intNo, lcType, ringNo, lampTp, planTp, compSize);
|
|
|
-
|
|
|
- byte[] compData = new byte[SigMapData.MAX_COMPRESS_DATA_SIZE];
|
|
|
- byte[] deCompData = new byte[SigMapData.MAX_DECOMPRESS_DATA_SIZE];
|
|
|
- System.arraycopy(buffer, idx, compData, 0, compData.length);
|
|
|
-
|
|
|
- log.info("{} Bytes. {}", deCompData.length, SysUtils.byteArrayToHex(compData));
|
|
|
- if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
- //res = SigMapData.signalMapDecompress(compData, idx, compSize, deCompData);
|
|
|
- }
|
|
|
- else {
|
|
|
-// res = SigMapData.signalMapDecompress2010(compData, idx, compSize, deCompData);
|
|
|
- }
|
|
|
- idx = idx + SigMapData.MAX_COMPRESS_DATA_SIZE;
|
|
|
-
|
|
|
-// if (res == 0) {
|
|
|
-// log.error("[{}], SigSignalMap.response: Decompress Error. INT_NO: {}, LC_TYPE: {}", packet.getCenter().getLogKey(), intNo, lcType);
|
|
|
-// }
|
|
|
-
|
|
|
-// param.put("CAR1", deCompData[spIdx++] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
-// param.put("PED1", deCompData[spIdx++] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
-// param.put("CAR2", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("PED2", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("CAR3", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("PED3", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("CAR4", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("PED4", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("CAR5", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("PED5", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("CAR6", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("PED6", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("CAR7", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("PED7", deCompData[spIdx++] & 0xFF);
|
|
|
-// param.put("CAR8", deCompData[spIdx++] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
-// param.put("PED8", deCompData[spIdx++] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
-// param.put("MIN_TM", deCompData[spIdx++] & 0xFF); /*최소시간 */
|
|
|
-// param.put("MAX_TM", deCompData[spIdx++] & 0xFF); /*최대시간 */
|
|
|
-// param.put("EOP", deCompData[spIdx++] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
- log.error("[{}], SigSignalMap.response: Exception. will be closed. {}", packet.getCenter().getLogKey(), e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+// {
|
|
|
+// if (lcType == SigMapData.ESIGMAP_LC_TYPE_2004) {
|
|
|
+// param.put("CAR1", deCompData[spIdx++] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
+// param.put("PED1", deCompData[spIdx++] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
+// param.put("CAR2", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("PED2", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("CAR3", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("PED3", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("CAR4", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("PED4", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("CAR5", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("PED5", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("CAR6", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("PED6", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("CAR7", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("PED7", deCompData[spIdx++] & 0xFF);
|
|
|
+// param.put("CAR8", deCompData[spIdx++] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
+// param.put("PED8", deCompData[spIdx++] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
+// param.put("MIN_TM", deCompData[spIdx++] & 0xFF); /*최소시간 */
|
|
|
+// param.put("MAX_TM", deCompData[spIdx++] & 0xFF); /*최대시간 */
|
|
|
+// param.put("EOP", deCompData[spIdx++] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// param.put("CAR1", mapData.step[jj].code[0] & 0xFF); /*차량등 1 (2004-LSU1) */
|
|
|
+// param.put("PED1", mapData.step[jj].code[1] & 0xFF); /*보행등 1 (2004-LSU2) */
|
|
|
+// param.put("CAR2", mapData.step[jj].code[2] & 0xFF);
|
|
|
+// param.put("PED2", mapData.step[jj].code[3] & 0xFF);
|
|
|
+// param.put("CAR3", mapData.step[jj].code[4] & 0xFF);
|
|
|
+// param.put("PED3", mapData.step[jj].code[5] & 0xFF);
|
|
|
+// param.put("CAR4", mapData.step[jj].code[6] & 0xFF);
|
|
|
+// param.put("PED4", mapData.step[jj].code[7] & 0xFF);
|
|
|
+// param.put("CAR5", mapData.step[jj].code[8] & 0xFF);
|
|
|
+// param.put("PED5", mapData.step[jj].code[9] & 0xFF);
|
|
|
+// param.put("CAR6", mapData.step[jj].code[10] & 0xFF);
|
|
|
+// param.put("PED6", mapData.step[jj].code[11] & 0xFF);
|
|
|
+// param.put("CAR7", mapData.step[jj].code[12] & 0xFF);
|
|
|
+// param.put("PED7", mapData.step[jj].code[13] & 0xFF);
|
|
|
+// param.put("CAR8", mapData.step[jj].code[14] & 0xFF); /*차량등 8 (2004-LSU15) */
|
|
|
+// param.put("PED8", mapData.step[jj].code[15] & 0xFF); /*보행등 8 (2004-LSU16) */
|
|
|
+// param.put("MIN_TM", mapData.step[jj].code[16] & 0xFF); /*최소시간 */
|
|
|
+// param.put("MAX_TM", mapData.step[jj].code[17] & 0xFF); /*최대시간 */
|
|
|
+// param.put("EOP", mapData.step[jj].code[18] & 0xFF); /*현시종료여부(1:종료) */
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|