diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index f7a668f..eafa4ab 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/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; StandardAutodoorDeviceDriver autodoor; + StandardAutodoorSmartDeviceDriver standardAutodoorSmartDeviceDriver; if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); mes = autodoor.getStatus(); } + if (doordevice.getDeviceDriver() instanceof StandardAutodoorSmartDeviceDriver) { + standardAutodoorSmartDeviceDriver = (StandardAutodoorSmartDeviceDriver) doordevice.getDeviceDriver(); + mes = standardAutodoorSmartDeviceDriver.getStatus(); + } JSONObject jo = JSONObject.fromObject(mes); ja.add(jo); } @@ -1491,10 +1496,15 @@ public class AgvServiceImpl implements AgvService { } String mes = null; StandardAutodoorDeviceDriver autodoor; + StandardAutodoorSmartDeviceDriver standardAutodoorSmartDeviceDriver; if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); mes = autodoor.getStatus(); } + if (doordevice.getDeviceDriver() instanceof StandardAutodoorSmartDeviceDriver) { + standardAutodoorSmartDeviceDriver = (StandardAutodoorSmartDeviceDriver) doordevice.getDeviceDriver(); + mes = standardAutodoorSmartDeviceDriver.getStatus(); + } LampThreecolorDeviceDriver lampThreecolorDeviceDriver; if (doordevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) doordevice.getDeviceDriver(); @@ -1519,10 +1529,15 @@ public class AgvServiceImpl implements AgvService { } String mes = null; StandardAutodoorDeviceDriver autodoor; + StandardAutodoorSmartDeviceDriver standardAutodoorSmartDeviceDriver; if (doordevice.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { autodoor = (StandardAutodoorDeviceDriver) doordevice.getDeviceDriver(); mes = autodoor.getStatus(); } + if (doordevice.getDeviceDriver() instanceof StandardAutodoorSmartDeviceDriver) { + standardAutodoorSmartDeviceDriver = (StandardAutodoorSmartDeviceDriver) doordevice.getDeviceDriver(); + mes = standardAutodoorSmartDeviceDriver.getStatus(); + } JSONObject jo = JSONObject.fromObject(mes); ja.add(jo); } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart200/StandardAutodoorSmartDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart200/StandardAutodoorSmartDeviceDriver.java index f24f882..fd12b05 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart200/StandardAutodoorSmartDeviceDriver.java +++ b/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() { JSONObject jo = new JSONObject(); - if (action == 1 && mode == 2) { + if (action == 1 && mode != 0) { jo.put("name", this.getDevice().getDevice_code()); 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("status", "CLOSE"); } else {