From 52c6c43e539a2da248974d2d1c6ade7da9a0586e Mon Sep 17 00:00:00 2001 From: loujf Date: Mon, 5 Dec 2022 17:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=97=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/acs/agv/server/impl/AgvServiceImpl.java | 15 +++++++++++++++ .../StandardAutodoorSmartDeviceDriver.java | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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 {