From b98beff8ceec65c61fac9d1b0bec2c824a4004d8 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Wed, 13 Dec 2023 14:59:06 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndoorManipulatorDeviceDriver.java | 73 ++++++++++++++++++- ...PluggingUnpluggingMachineDeviceDriver.java | 4 +- .../basedriver/rgv/RgvDeviceDriver.java | 7 ++ .../src/views/system/monitor/device/index.vue | 9 +++ 4 files changed, 91 insertions(+), 2 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 6b9c6bae0..c56ffb902 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -27,6 +27,7 @@ import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -49,7 +50,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected org.nl.acs.device_driver.basedriver.indoor_manipulator.ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); @@ -647,6 +648,76 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple return taskDtos; } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String action = ""; + if (this.getMode() == 0) { + mode = "脱机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "待机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } + + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); + if (this.getAction() == 2) { + action = "反馈气胀轴尺寸"; + } else if (this.getAction() == 3) { + action = "申请放货点"; + } else if (this.getAction() == 4) { + action = "申请新取货点"; + } else if (this.getAction() == 5) { + action = "申请二次放货点"; + } else if (this.getAction() == 6) { + action = "缓存库取货完成"; + } else if (this.getAction() == 7) { + action = "缓存线放货完成"; + } else if (this.getAction() == 8) { + action = "任务完成"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("task", task); + jo.put("walk_y", String.valueOf(this.walk_y)); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("is_click", true); + jo.put("x", x_position); + jo.put("y", y_position); + jo.put("inflatable_shaft_size", this.inflatable_shaft_size); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + String requestSucess = data.getString("requireSucess"); + if (StrUtil.equals(requestSucess, "0")) { + this.requireSucess = false; + } else if (StrUtil.equals(requestSucess, "1")) { + this.requireSucess = true; + } + } + public void writing(String param, String value) { String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java index 7427772ce..255072c29 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java @@ -308,7 +308,6 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv public JSONObject getDeviceStatusName() { JSONObject jo = new JSONObject(); String mode = ""; - String action = ""; String move = ""; if (this.getMode() == 0) { mode = "未联机"; @@ -318,6 +317,8 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv mode = "联机"; } else if (this.getMode() == 3) { mode = "运行中"; + } else if (this.getMode() == 4) { + mode = "套轴申请"; } if (this.getMove() == 0) { @@ -335,6 +336,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv jo.put("move", move); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java index 61c5667b4..77239aa69 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java @@ -96,6 +96,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr return this.device; } + @Override public void execute() { String message = null; try { @@ -108,6 +109,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr qty2 = this.itemProtocol.getQty2(); task = this.itemProtocol.getTask(); + if (mode != last_mode) { this.requireSucess = false; logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记"); @@ -259,6 +261,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr mode = "联机"; } else if (this.getMode() == 3) { mode = "运行中"; + } else if (this.getMode() == 4) { + mode = "反馈重量"; } if (this.getMove1() == 0 && this.getMove2() == 0) { @@ -274,6 +278,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr jo.put("move2", move2); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); + jo.put("qty1", this.getQty1()); + jo.put("qty2", this.getQty2()); + jo.put("message", this.getMessage()); return jo; } diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index 87abda158..d731d4a42 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -634,6 +634,15 @@ export default { } else if (val === 'task_id') { const obj = { name: '任务号', value: data[val] } this.arr.push(obj) + } else if (val === 'inflatable_shaft_size') { + const obj = { name: '任务号', value: data[val] } + this.arr.push(obj) + } else if (val === 'qty1') { + const obj = { name: '任务号', value: data[val] } + this.arr.push(obj) + } else if (val === 'qty2') { + const obj = { name: '任务号', value: data[val] } + this.arr.push(obj) } } }