From 1ccd021f83c05673c77c162d5ccca178989602f6 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Sun, 29 Jan 2023 21:01:49 +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 --- .../OvenGantryManipulatorDeviceDriver.java | 9 +++- .../SlitTwoManipulatorDeviceDriver.java | 42 ++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 20160ad0b..23517ed3b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -126,8 +126,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i task = this.itemProtocol.getTask(); if (mode != last_mode) { if (mode == 2) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号复位前requireSuccess:" + requireSucess); this.setRequireSucess(false); message = null; + logServer.deviceExecuteLog(this.device_code, "", "", "信号复位后requireSuccess:" + requireSucess); + } logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); @@ -559,7 +562,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i instructionService.create(instdto); } catch (Exception e) { notCreateInstMessage = e.getMessage(); - e.printStackTrace(); + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage()); return false; } //创建指令后修改任务状态 @@ -571,10 +574,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code()); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { notCreateInstMessage = "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); } if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) { notCreateInstMessage = "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } String start_addr = startDevice.getExtraValue().get("address").toString(); @@ -692,6 +697,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } catch (Exception e) { isClose = true; + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "检查烘箱是否关门时出现异常:" + e.getMessage()); notCreateInstMessage = "检查烘箱是否关门时出现异常:" + e.getMessage(); } return isClose; @@ -761,6 +767,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } else if (this.getMove() == 1) { move = "有货"; } + String requireSucess = "0"; if (this.requireSucess) { requireSucess = "1"; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 6f170f7fe..e4b19a71f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -1470,7 +1470,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("isError", this.getIserror()); jo.put("is_disable1", this.getIs_disable()); jo.put("is_disable", is_disable); - jo.put("message", "此时,type = 1时," + this.getNow_steps_type1() + ",type = 2时," + this.getNow_steps_type2() + ",type = 3时," + this.getNow_steps_type3()); + jo.put("message", this.messageInfo(type)); jo.put("is_click", true); jo.put("driver_type", "slit_two_manipulator"); jo.put("notCreateTaskMessage", notCreateTaskMessage); @@ -1479,6 +1479,46 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl return jo; } + public String messageInfo(int type) { + String set_type = ""; + JSONObject map = new JSONObject(); + if (type == 1) { + set_type = String.valueOf(now_steps_type1); + map.put("0", "前工位单任务未执行"); + map.put("1", "前工位单任务改变指令状态"); + map.put("2", "前工位单任务下发电气任务信息"); + map.put("3", "单任务前工位允许取货"); + map.put("4", "单任务前工位取货完成"); + map.put("5", "单任务前工位允许放货"); + map.put("6", "单任务前工位放货完成"); + } else if (type == 2) { + set_type = String.valueOf(now_steps_type2); + map.put("0", "后工位单任务未执行"); + map.put("1", "后工位单任务改变指令状态"); + map.put("2", "后工位单任务下发电气任务信息"); + map.put("3", "单任务后工位允许取货"); + map.put("4", "单任务后工位取货完成"); + map.put("5", "单任务后工位允许放货"); + map.put("6", "单任务后工位放货完成"); + } else if (type == 3) { + set_type = String.valueOf(now_steps_type3); + map.put("0", "双任务未执行"); + map.put("1", "双任务改变指令状态"); + map.put("2", "双任务下发电气任务信息"); + map.put("3", "双任务后工位允许取货"); + map.put("4", "双任务后工位取货完成"); + map.put("5", "双任务前工位允许取货"); + map.put("6", "双任务前工位取货完成"); + map.put("7", "双任务后工位允许放货"); + map.put("8", "双任务后工位放货完成"); + map.put("9", "双任务前工位允许放货"); + map.put("10", "双任务前工位放货完成"); + } else { + return "未执行任务"; + } + return map.getString(set_type); + } + @Override public void setDeviceStatus(JSONObject data) { String is_disable = data.getString("is_disable");