|
@@ -8,34 +8,38 @@ import com.its.vms.xnettcp.vms.process.response.VmsResponse;
|
|
|
import com.its.vms.xnettcp.vms.protocol.VmsFramePacket;
|
|
|
import com.its.vms.xnettcp.vms.protocol.enums.eVmsOpCode;
|
|
|
import com.its.vms.xnettcp.vms.protocol.impl.dle.VmsDleFramePacket;
|
|
|
+import lombok.Getter;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
|
|
@Slf4j
|
|
|
+@Getter
|
|
|
@RequiredArgsConstructor
|
|
|
public class VmsResStatus implements VmsResponse {
|
|
|
|
|
|
private final TbVmsCtlrDto vmsObj;
|
|
|
private final VmsFramePacket resFramePacket;
|
|
|
- private int door; // Door Open/Close 상태, 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
- private int power; // 전원의 ON/OFF 상태, 0x00: On, 0x01: Off, 0x09: Unknown (Sign Board)
|
|
|
- private int fan; // VMS Fan 동작 상태, 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
- private int heater; // VMS Heater 동작 상태, 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
- private int formNo; // 표출 폼 번호, 현재 표출중인 폼 번호 : 0~9999
|
|
|
- private int reboot; // 표출 폼 번호, 0x00: 정상, 0x01: 재실행
|
|
|
- private int cboxTemp; // 함체온도, 127 ~ -127, -128 : Unknown
|
|
|
- private int brightMode; // 화면의 밝기 - 휘도 모드, 0x00:주간, 0x01:야간, 0x02:Auto, 0x03:수동
|
|
|
- private int brightCurr; // 화면의 밝기 - 현재 휘도값, 0~100
|
|
|
- private int brightWeek; // 화면의 밝기 - 주간 휘도값, 0~100
|
|
|
- private int brightNght; // 화면의 밝기 - 야간 휘도값, 0~100
|
|
|
- private int dpTemp; // 외부온도, -127 ~ 127, -128: Unknown
|
|
|
- private int dpHum; // 외부습도, 0 ~ 100, 101: Unknown
|
|
|
- private int powerModuleStts = 0x02; // 0x00: 정상, 0x01: 에러, 0x02: Unknown
|
|
|
- private int moduleStts = 0x02; // 0x00: 정상, 0x01: 불량, 0x02: Unknown
|
|
|
- private int cboxFan = 0x09; // 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
- private int cboxHeather = 0x09; // 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+
|
|
|
+ private int formNo; //표출 폼 번호, 현재 표출중인 폼 번호 : 0~9999
|
|
|
+ private int reboot; //재실행 여부, 0x00: 정상, 0x01: 재실행
|
|
|
+ private int cboxTmpr; //온도 1 N 127 ~ -127, -128 : Unknown
|
|
|
+ private int cboxHum; //습도 1 N 0 ~ 100, 101: Unknown
|
|
|
+ private int cboxDoor; //Door 상태 1 N 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
+ private int cboxFan; //Fan 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ private int cboxHetr; //Heater 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ private int tmpr; //온도 1 N 127 ~ -127, -128 : Unknown
|
|
|
+ private int hum; //습도 1 N 0 ~ 100, 101: Unknown
|
|
|
+ private int door; //Door 상태 1 N 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
+ private int fan; //Fan 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ private int power; //전원 ON/OFF 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ private int brghMode; //화면의 밝기 휘도 모드 1 N 0x00:주간, 0x01:야간, 0x02:Auto, 0x03:수동
|
|
|
+ private int brghCurr; //현재 휘도값 1 N 0~100
|
|
|
+ private int brghWeek; //주간 휘도값 1 N 0~100
|
|
|
+ private int brghNght; //야간 휘도값 1 N 0~100
|
|
|
+ private int powerSupply; //전원공급장치 상태 1 N 0x00: 정상, 0x01: 에러, 0x02: Unknown
|
|
|
+ private int ledModl; //LED 모듈 상태 1 N 0x00: 정상, 0x01: 불량, 0x02: Unknown
|
|
|
|
|
|
@Override
|
|
|
public boolean process() {
|
|
@@ -54,56 +58,39 @@ public class VmsResStatus implements VmsResponse {
|
|
|
|
|
|
byte[] body = this.resFramePacket.getBody();
|
|
|
log.info("VmsResStatus.process: VMS {}, body length: {}.", this.vmsObj.getVmsCtlrNmbr(), body != null ? body.length : 0);
|
|
|
- if (body == null || body.length < 14) {
|
|
|
+ if (body == null || body.length < 19) {
|
|
|
log.error("VmsResStatus.process: VMS {}, body length error: {}.", this.vmsObj.getVmsCtlrNmbr(), body != null ? body.length : 0);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- // Byte.toUnsignedInt(
|
|
|
ByteBuffer byteBuffer = ByteBuffer.wrap(body);
|
|
|
byteBuffer.order(VmsDleFramePacket.BYTE_ORDER);
|
|
|
- this.door = byteBuffer.get() & 0xFF; // Door Open/Close 상태, 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
- this.power = byteBuffer.get() & 0xFF; // 전원의 ON/OFF 상태, 0x00: On, 0x01: Off, 0x09: Unknown (Sign Board)
|
|
|
- this.fan = byteBuffer.get() & 0xFF; // VMS Fan 동작 상태, 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
- this.heater = byteBuffer.get() & 0xFF; // VMS Heater 동작 상태, 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+
|
|
|
this.formNo = byteBuffer.getShort() & 0xFFFF; // 표출 폼 번호, 현재 표출중인 폼 번호 : 0~9999
|
|
|
this.reboot = byteBuffer.get() & 0xFF; // 표출 폼 번호, 0x00: 정상, 0x01: 재실행
|
|
|
- this.cboxTemp = byteBuffer.get() & 0xFF; // 함체온도, 127 ~ -127, -128 : Unknown
|
|
|
- this.brightMode = byteBuffer.get() & 0xFF; // 화면의 밝기 - 휘도 모드, 0x00:주간, 0x01:야간, 0x02:Auto, 0x03:수동
|
|
|
- this.brightCurr = byteBuffer.get() & 0xFF; // 화면의 밝기 - 현재 휘도값, 0~100
|
|
|
- this.brightWeek = byteBuffer.get() & 0xFF; // 화면의 밝기 - 주간 휘도값, 0~100
|
|
|
- this.brightNght = byteBuffer.get() & 0xFF; // 화면의 밝기 - 야간 휘도값, 0~100
|
|
|
- this.dpTemp = byteBuffer.get() & 0xFF; // 외부온도, -127 ~ 127, -128: Unknown
|
|
|
- this.dpHum = byteBuffer.get() & 0xFF; // 외부습도, 0 ~ 100, 101: Unknown
|
|
|
-
|
|
|
- this.cboxFan = 0x09;
|
|
|
- this.cboxHeather = 0x09;
|
|
|
- if (body.length >= 16) {
|
|
|
- this.powerModuleStts = byteBuffer.get() & 0xFF; // 전원 모듈 상태, 0x00: 정상, 0x01: 에러, 0x02: Unknown
|
|
|
- this.moduleStts = byteBuffer.get() & 0xFF; // 모듈 상태, 0x00: 정상, 0x01: 불량, 0x02: Unknown
|
|
|
- this.cboxFan = byteBuffer.get() & 0xFF; // 함체 Fan 동작 상태, 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
- this.cboxHeather = byteBuffer.get() & 0xFF; // 함체 Heater 동작 상태, 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
- }
|
|
|
- else {
|
|
|
- int tmpFan1 = (this.fan & 0x0F);
|
|
|
- int tmpFan2 = (this.fan & 0xF0) >> 4;
|
|
|
- int tmpHtr1 = (this.heater & 0x0F);
|
|
|
- int tmpHtr2 = (this.heater & 0xF0) >> 4;
|
|
|
- this.fan = tmpFan1;
|
|
|
- this.cboxFan = tmpFan2;
|
|
|
- this.heater = tmpHtr1;
|
|
|
- this.cboxHeather = tmpHtr2;
|
|
|
- this.powerModuleStts = this.power; // 전원 모듈 상태, 0x00: 정상, 0x01: 에러, 0x02: Unknown
|
|
|
- this.moduleStts = this.power; // 모듈 상태, 0x00: 정상, 0x01: 불량, 0x02: Unknown
|
|
|
- }
|
|
|
+
|
|
|
+ this.cboxTmpr = byteBuffer.get() & 0xFF; //온도 1 N 127 ~ -127, -128 : Unknown
|
|
|
+ this.cboxHum = byteBuffer.get() & 0xFF; //습도 1 N 0 ~ 100, 101: Unknown
|
|
|
+ this.cboxDoor = byteBuffer.get() & 0xFF; //Door 상태 1 N 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
+ this.cboxFan = byteBuffer.get() & 0xFF; //Fan 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ this.cboxHetr = byteBuffer.get() & 0xFF; //Heater 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ this.tmpr = byteBuffer.get() & 0xFF; //온도 1 N 127 ~ -127, -128 : Unknown
|
|
|
+ this.hum = byteBuffer.get() & 0xFF; //습도 1 N 0 ~ 100, 101: Unknown
|
|
|
+ this.door = byteBuffer.get() & 0xFF; //Door 상태 1 N 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
+ this.fan = byteBuffer.get() & 0xFF; //Fan 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ this.power = byteBuffer.get() & 0xFF; //전원 ON/OFF 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ this.brghMode = byteBuffer.get() & 0xFF; //화면의 밝기 휘도 모드 1 N 0x00:주간, 0x01:야간, 0x02:Auto, 0x03:수동
|
|
|
+ this.brghCurr = byteBuffer.get() & 0xFF; //현재 휘도값 1 N 0~100
|
|
|
+ this.brghWeek = byteBuffer.get() & 0xFF; //주간 휘도값 1 N 0~100
|
|
|
+ this.brghNght = byteBuffer.get() & 0xFF; //야간 휘도값 1 N 0~100
|
|
|
+ this.powerSupply = byteBuffer.get() & 0xFF; //전원공급장치 상태 1 N 0x00: 정상, 0x01: 에러, 0x02: Unknown
|
|
|
+ this.ledModl = byteBuffer.get() & 0xFF; //LED 모듈 상태 1 N 0x00: 정상, 0x01: 불량, 0x02: Unknown
|
|
|
|
|
|
if (this.vmsObj.getDebug().isDebug()) {
|
|
|
log.info("{}", toString());
|
|
|
}
|
|
|
|
|
|
- if (this.vmsObj.getStts().updateStatus(door, power, fan, heater, formNo, reboot, cboxTemp,
|
|
|
- brightMode, brightCurr, brightWeek, brightNght, dpTemp, dpHum,
|
|
|
- powerModuleStts, moduleStts, cboxFan, cboxHeather)) {
|
|
|
+ if (this.vmsObj.getStts().updateStatus(this)) {
|
|
|
// 상태정보가 변경되었으므로 상태정보 업데이트 하도록 한다.
|
|
|
}
|
|
|
|
|
@@ -115,23 +102,26 @@ public class VmsResStatus implements VmsResponse {
|
|
|
StringBuilder data = new StringBuilder();
|
|
|
data.append(String.format("RESPONSE-%s. VMS %d", eVmsOpCode.OP_VMS_STATUS_REQ, this.vmsObj.getVmsCtlrNmbr()));
|
|
|
data.append(System.getProperty("line.separator"));
|
|
|
- data.append(String.format("Door(0x%02X), ", this.door));
|
|
|
- data.append(String.format("Power(0x%02X), ", this.power));
|
|
|
- data.append(String.format("Fan(0x%02X), ", this.fan));
|
|
|
- data.append(String.format("Heater(0x%02X), ", this.heater));
|
|
|
- data.append(String.format("FormNo(%d), ", this.formNo));
|
|
|
- data.append(String.format("ReBoot(0x%02X), ", this.reboot));
|
|
|
- data.append(String.format("CboxTemp(%d), ", this.cboxTemp));
|
|
|
- data.append(String.format("B-Mode(0x%02X), ", this.brightMode));
|
|
|
- data.append(String.format("B-Curr(%d), ", this.brightCurr));
|
|
|
- data.append(String.format("B-Week(%d), ", this.brightWeek));
|
|
|
- data.append(String.format("B-Nght(%d), ", this.brightNght));
|
|
|
- data.append(String.format("DpTemp(%d), ", this.dpTemp));
|
|
|
- data.append(String.format("DpHum(%d), ", this.dpHum));
|
|
|
- data.append(String.format("PowerModuleStts(0x%02X), ", this.powerModuleStts));
|
|
|
- data.append(String.format("ModuleStts(0x%02X), ", this.moduleStts));
|
|
|
- data.append(String.format("CboxFan(0x%02X), ", this.cboxFan));
|
|
|
- data.append(String.format("CboxHeater(0x%02X)", this.cboxHeather));
|
|
|
+
|
|
|
+ data.append(String.format("표출 폼 번호(0x%02X), ", this.formNo)); //표출 폼 번호, 현재 표출중인 폼 번호 : 0~9999
|
|
|
+ data.append(String.format("재실행 여부(0x%02X), ", this.reboot)); //재실행 여부, 0x00: 정상, 0x01: 재실행
|
|
|
+
|
|
|
+ data.append(String.format("제어기 - 온도(%d), ", this.cboxTmpr)); //온도 1 N 127 ~ -127, -128 : Unknown
|
|
|
+ data.append(String.format("제어기 - 습도(%d), ", this.cboxHum)); //습도 1 N 0 ~ 100, 101: Unknown
|
|
|
+ data.append(String.format("제어기 - Door 상태(0x%02X), ", this.cboxDoor)); //Door 상태 1 N 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
+ data.append(String.format("제어기 - Fan 동작 상태(0x%02X), ", this.cboxFan)); //Fan 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ data.append(String.format("제어기 - Heater 동작 상태(0x%02X), ", this.cboxHetr)); //Heater 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ data.append(String.format("표출부 - 온도(%d), ", this.tmpr)); //온도 1 N 127 ~ -127, -128 : Unknown
|
|
|
+ data.append(String.format("표출부 - 습도(%d), ", this.hum)); //습도 1 N 0 ~ 100, 101: Unknown
|
|
|
+ data.append(String.format("표출부 - Door 상태(0x%02X), ", this.door)); //Door 상태 1 N 0x00: Open, 0x01: Close, 0x09: Unknown
|
|
|
+ data.append(String.format("표출부 - Fan 동작 상태(0x%02X), ", this.fan)); //Fan 동작 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ data.append(String.format("표출부 - 전원 ON/OFF 상태(0x%02X), ", this.power)); //전원 ON/OFF 상태 1 N 0x00: On, 0x01: Off, 0x09: Unknown
|
|
|
+ data.append(String.format("표출부 - 휘도 모드(%d), ", this.brghMode)); //화면의 밝기 휘도 모드 1 N 0x00:주간, 0x01:야간, 0x02:Auto, 0x03:수동
|
|
|
+ data.append(String.format("표출부 - 현재 휘도값(%d), ", this.brghCurr)); //현재 휘도값 1 N 0~100
|
|
|
+ data.append(String.format("표출부 - 주간 휘도값(%d), ", this.brghWeek)); //주간 휘도값 1 N 0~100
|
|
|
+ data.append(String.format("표출부 - 야간 휘도값(%d), ", this.brghNght)); //야간 휘도값 1 N 0~100
|
|
|
+ data.append(String.format("표출부 - 전원공급장치 상태(0x%02X), ", this.powerSupply)); //전원공급장치 상태 1 N 0x00: 정상, 0x01: 에러, 0x02: Unknown
|
|
|
+ data.append(String.format("표출부 - LED 모듈 상태(0x%02X), ", this.ledModl)); //LED 모듈 상태 1 N 0x00: 정상, 0x01: 불량, 0x02: Unknown
|
|
|
return data.toString();
|
|
|
}
|
|
|
|