Browse Source

自动门更新

master
loujf 2 years ago
parent
commit
52c6c43e53
  1. 15
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 4
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart200/StandardAutodoorSmartDeviceDriver.java

15
hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

@ -1458,10 +1458,15 @@ public class AgvServiceImpl implements AgvService {
} }
String mes = null; String mes = null;
StandardAutodoorDeviceDriver autodoor; StandardAutodoorDeviceDriver autodoor;
StandardAutodoorSmartDeviceDriver standardAutodoorSmartDeviceDriver;
if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver();
mes = autodoor.getStatus(); mes = autodoor.getStatus();
} }
if (doordevice.getDeviceDriver() instanceof StandardAutodoorSmartDeviceDriver) {
standardAutodoorSmartDeviceDriver = (StandardAutodoorSmartDeviceDriver) doordevice.getDeviceDriver();
mes = standardAutodoorSmartDeviceDriver.getStatus();
}
JSONObject jo = JSONObject.fromObject(mes); JSONObject jo = JSONObject.fromObject(mes);
ja.add(jo); ja.add(jo);
} }
@ -1491,10 +1496,15 @@ public class AgvServiceImpl implements AgvService {
} }
String mes = null; String mes = null;
StandardAutodoorDeviceDriver autodoor; StandardAutodoorDeviceDriver autodoor;
StandardAutodoorSmartDeviceDriver standardAutodoorSmartDeviceDriver;
if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver();
mes = autodoor.getStatus(); mes = autodoor.getStatus();
} }
if (doordevice.getDeviceDriver() instanceof StandardAutodoorSmartDeviceDriver) {
standardAutodoorSmartDeviceDriver = (StandardAutodoorSmartDeviceDriver) doordevice.getDeviceDriver();
mes = standardAutodoorSmartDeviceDriver.getStatus();
}
LampThreecolorDeviceDriver lampThreecolorDeviceDriver; LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
if (doordevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { if (doordevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) doordevice.getDeviceDriver(); lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) doordevice.getDeviceDriver();
@ -1519,10 +1529,15 @@ public class AgvServiceImpl implements AgvService {
} }
String mes = null; String mes = null;
StandardAutodoorDeviceDriver autodoor; StandardAutodoorDeviceDriver autodoor;
StandardAutodoorSmartDeviceDriver standardAutodoorSmartDeviceDriver;
if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver();
mes = autodoor.getStatus(); mes = autodoor.getStatus();
} }
if (doordevice.getDeviceDriver() instanceof StandardAutodoorSmartDeviceDriver) {
standardAutodoorSmartDeviceDriver = (StandardAutodoorSmartDeviceDriver) doordevice.getDeviceDriver();
mes = standardAutodoorSmartDeviceDriver.getStatus();
}
JSONObject jo = JSONObject.fromObject(mes); JSONObject jo = JSONObject.fromObject(mes);
ja.add(jo); ja.add(jo);
} }

4
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart200/StandardAutodoorSmartDeviceDriver.java

@ -122,10 +122,10 @@ public class StandardAutodoorSmartDeviceDriver extends AbstractOpcDeviceDriver i
public synchronized String getStatus() { public synchronized String getStatus() {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
if (action == 1 && mode == 2) { if (action == 1 && mode != 0) {
jo.put("name", this.getDevice().getDevice_code()); jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "OPEN"); jo.put("status", "OPEN");
} else if (action == 2 && mode == 2) { } else if (action == 2 && mode != 0) {
jo.put("name", this.getDevice().getDevice_code()); jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "CLOSE"); jo.put("status", "CLOSE");
} else { } else {

Loading…
Cancel
Save