From d76a4422a53e61f784db86a2b64c16fe293546a9 Mon Sep 17 00:00:00 2001 From: loujf Date: Tue, 27 Sep 2022 10:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardAutodoorDeviceDriver.java | 40 +++++++++++++------ ...ardManipulatorInspectSiteDeviceDriver.java | 16 ++++---- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java index e4d9475..ad2b9f1 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/StandardAutodoorDeviceDriver.java @@ -107,29 +107,45 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem } +// public synchronized String getStatus() { +// JSONObject jo = new JSONObject(); +// +// if (action == 1) { +// jo.put("name", this.getDevice().getDevice_code()); +// jo.put("status", "OPEN"); +// jo.put("action", action); +// jo.put("mode", mode); +// +// } else if (action == 2) { +// jo.put("name", this.getDevice().getDevice_code()); +// jo.put("status", "CLOSE"); +// jo.put("action", action); +// jo.put("mode", mode); +// +// } else { +// jo.put("name", this.getDevice().getDevice_code()); +// jo.put("status", "ERROR"); +// jo.put("action", action); +// jo.put("mode", mode); +// } +// System.out.println("查询自动门状态,device_code:"+this.getDevice().getDevice_code() +",action:" + action +",mode:"+mode+",param:"+jo); +// +// return jo.toString(); +// } + public synchronized String getStatus() { JSONObject jo = new JSONObject(); - if (action == 1) { + if (action == 1 && mode == 2) { jo.put("name", this.getDevice().getDevice_code()); jo.put("status", "OPEN"); - jo.put("action", action); - jo.put("mode", mode); - - } else if (action == 2) { + } else if (action == 2 && mode == 2) { jo.put("name", this.getDevice().getDevice_code()); jo.put("status", "CLOSE"); - jo.put("action", action); - jo.put("mode", mode); - } else { jo.put("name", this.getDevice().getDevice_code()); jo.put("status", "ERROR"); - jo.put("action", action); - jo.put("mode", mode); } - System.out.println("查询自动门状态,device_code:"+this.getDevice().getDevice_code() +",action:" + action +",mode:"+mode+",param:"+jo); - return jo.toString(); } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_inspect_site/StandardManipulatorInspectSiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_inspect_site/StandardManipulatorInspectSiteDeviceDriver.java index 1833dd6..9c5806f 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_inspect_site/StandardManipulatorInspectSiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_inspect_site/StandardManipulatorInspectSiteDeviceDriver.java @@ -190,16 +190,16 @@ public class StandardManipulatorInspectSiteDeviceDriver extends AbstractOpcDevic break; case 3: //申请空盘 - if (!requireSucess && this.move == 0) { - applyEmpty(); - } - break; +// if (!requireSucess && this.move == 0) { +// applyEmpty(); +// } +// break; case 4: //申请搬运任务 - if (!requireSucess && this.move != 0) { - autoCreateTask(); - } - break; +// if (!requireSucess && this.move != 0) { +// autoCreateTask(); +// } +// break; case 5: break; }