From 00d823ccd3805f82105b78d3bd57f0aa5170eb07 Mon Sep 17 00:00:00 2001 From: yanps Date: Tue, 14 May 2024 19:56:50 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E7=9B=91=E6=8E=A7=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HongXiangConveyorDeviceDriver.java | 67 +++++++++++-------- .../hongxiang_device/ItemProtocol.java | 2 +- .../OvenGantryManipulatorDeviceDriver.java | 55 +++++++-------- .../PlugPullDeviceSiteDeviceDriver.java | 22 +++++- .../PullHeadManipulatorDeviceDriver.java | 46 +++++++------ .../PullTailManipulatorDeviceDriver.java | 57 ++++++++-------- .../src/views/system/monitor/device/index.vue | 13 ++-- 7 files changed, 150 insertions(+), 112 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java index 7b73cfa32..dece6df6e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -360,53 +360,66 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + String mode = ""; String action = ""; String move = ""; if (this.getMode() == 0) { mode = LangProcess.msg("universal_off-line"); - } else if (this.getMode() == 1) { + }/* else if (this.getMode() == 1) { mode = LangProcess.msg("universal_stand-alone"); - } else if (this.getMode() == 2) { + } */else if (this.getMode() == 1) { mode = LangProcess.msg("universal_standby"); - } else if (this.getMode() == 3) { + }/* else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); - } - String requireSucess = "0"; + }*/ + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getMove() == 0) { move = LangProcess.msg("universal_no"); - jo.put("hasGoods", false); + map.put("hasGoods", false); } else if (this.getMove() == 1) { move = LangProcess.msg("universal_yes"); - jo.put("hasGoods", true); + map.put("hasGoods", true); } else if (this.getMove() == 2) { move = LangProcess.msg("universal_two_yes"); - jo.put("hasGoods", true); + map.put("hasGoods", true); } if(error == 0 && iserror){ - message = "universal_message11"; + message = LangProcess.msg("universal_message11"); } - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("temperature", temperature); - jo.put("finish", finish); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("countdown_house", countdown_house); - jo.put("countdown_min", countdown_min); - jo.put("countdown_sec", countdown_sec); - jo.put("door", door); - jo.put("mode", mode); - jo.put("move", move); - jo.put("action", action); - jo.put("message", message); - jo.put("task", this.getTask()); + String door = "关门状态"; + if(this.door == 1){ + door = "开门状态"; + }else if(this.door == 0){ + door = "门执行中"; + } + String finish = "未完成"; + if(this.finish == 1){ + finish = "已完成"; + } + map.put("device_name", this.getDevice().getDevice_name()); + map.put("finish", finish); + map.put("isOnline", this.getIsonline()); + + map.put("isError", this.getIserror()); + map.put("door", door); + map.put("mode", mode); + map.put("move", move); + /*map.put("action", action); + map.put("message", message);*/ + /*map.put("task", this.getTask());*/ + map.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError()))); + map.put("temperature", temperature); + map.put("countdown_house", countdown_house); + map.put("countdown_min", countdown_min); + map.put("countdown_sec", countdown_sec); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java index 0daa2b19b..f75e44103 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/ItemProtocol.java @@ -124,7 +124,7 @@ public class ItemProtocol { } ; Boolean isonline; - Boolean isError; + Boolean isError = false; public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index e46782819..4385083f6 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -192,7 +192,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i requireActionSucess = false; } - if (!requireActionSucess) { + if (mode == 3 && !requireActionSucess) { update_instruction_status(); } @@ -200,7 +200,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i var17.printStackTrace(); feedMessage = var17.getMessage(); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); - } if (mode == 0) { @@ -1082,7 +1081,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + String mode = ""; String move = ""; String action = ""; @@ -1103,11 +1103,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i move = LangProcess.msg("universal_yes"); } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { @@ -1118,30 +1118,31 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i action = LangProcess.msg("universal_releasing_completed"); } if (error == 0 && iserror) { - this.setMessage(LangProcess.msg("universal_message4")); + this.setMessage(LangProcess.msg("universal_message11")); } - String requireActionSucess = LangProcess.msg("universal_actionMessage4"); + String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4"); if(this.requireActionSucess){ - requireActionSucess = LangProcess.msg("universal_actionMessage5"); + requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage5"); } - 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", walk_y); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("message", message); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", notCreateInstMessage); - jo.put("feedMessage", feedMessage); - jo.put("requireActionSucess", requireActionSucess); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); - jo.put("x", x_position); - jo.put("y", y_position); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("action", action); + map.put("task", task); + map.put("walk_y", this.walk_y); + map.put("isOnline", this.getIsonline()); + map.put("requireActionSucess", requireActionSucess); + map.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", message); + map.put("feedMessage", feedMessage); + map.put("notCreateTaskMessage", notCreateTaskMessage); + map.put("notCreateInstMessage", notCreateInstMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); + /*jo.put("x", x_position); + jo.put("y", y_position);*/ return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 0f3d9cbf2..3c065bf39 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -221,6 +221,9 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.setIsonline(true); this.setIserror(false); message = ""; + if(requireSucess){ + message = LangProcess.msg("universal_actionMessage5"); + } //插拔轴机工位申请任务 switch (mode) { case 1: @@ -588,8 +591,19 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { mode = LangProcess.msg("universal_operation"); + } else if(this.mode == 4) { + mode = "请求套轴轴"; + } else if(this.mode == 5){ + mode = "套轴完成反馈"; + } else if(this.mode == 6){ + mode = "请求拔轴"; + } else if(this.mode == 7){ + mode = "拔轴完成反馈"; + } else if(this.mode == 8){ + mode = "缓存库已满,申请行架任务"; } + if (this.getMove() == 0) { move = LangProcess.msg("universal_no"); jo.put("hasGoods", false); @@ -600,6 +614,10 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl move = LangProcess.msg("universal_two_yes"); jo.put("hasGoods", true); } + String requireSucess = LangProcess.msg("universal_actionMessage4"); + if (this.requireSucess) { + requireSucess = LangProcess.msg("universal_actionMessage5"); + } jo.put("requireSucess", requireSucess); if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); @@ -613,11 +631,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); - jo.put("action", action); + /*jo.put("action", action);*/ jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); - jo.put("message", LangProcess.msg(message)); + jo.put("message", message); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 221acfd67..037f15b01 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -617,11 +617,10 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); String mode = ""; String move = ""; String action = ""; - String walkY = ""; if (this.getMode() == 0) { mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { @@ -638,11 +637,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp move = LangProcess.msg("universal_yes"); } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { @@ -651,29 +650,32 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { action = LangProcess.msg("universal_releasing_completed"); + }else { + action = "无动作"; } if(error == 0 && this.itemProtocol.isError){ iserror = true; }else if(error == 0 && !this.itemProtocol.isError){ iserror = false; } - 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", walkY); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("message", message); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", notCreateInstMessage); - jo.put("feedMessage", feedMessage); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); - jo.put("x", xPosition); - jo.put("y", yPosition); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("action", action); + map.put("task", task); + map.put("walk_y", walkY); + map.put("isOnline", this.getIsonline()); + map.put("isError", this.getIserror()); + map.put("feedMessage", feedMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + map.put("message", message); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("notCreateTaskMessage", notCreateTaskMessage); + map.put("notCreateInstMessage", notCreateInstMessage); + /*jo.put("x", xPosition); + jo.put("y", yPosition);*/ + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java index f930a6196..d68e74c0b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java @@ -232,21 +232,25 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp .content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage()) .build(); logDto.setLog_level(4); + message = "反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage(); luceneExecuteLogService.deviceExecuteLog(logDto); } - } else { + } else if(mode == 3){ feedMessage = "行架机械手:"; - if (mode != 3) { + /*if (mode != 3) { feedMessage = feedMessage + "mode不为运行中状态,"; - } + }*/ if (action != 5) { feedMessage = feedMessage + "action不为反馈重量状态,"; } if (move != 1) { feedMessage = feedMessage + "move不为有货状态,"; } - if (task == 0) { - feedMessage = feedMessage + "task为0。"; + if(StrUtil.isEmpty(sub_volume_no)){ + feedMessage = feedMessage + "子卷号为空,"; + } + if(requireSucess){ + feedMessage = feedMessage + "请求动作未复位!"; } } @@ -573,7 +577,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); String mode = ""; String move = ""; String action = ""; @@ -595,11 +599,11 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } - String requireSucess = "0"; + String requireSucess = LangProcess.msg("universal_actionMessage4"); if (this.requireSucess) { - requireSucess = "1"; + requireSucess = LangProcess.msg("universal_actionMessage5"); } - jo.put("requireSucess", requireSucess); + map.put("requireSucess", requireSucess); if (this.getAction() == 1) { action = LangProcess.msg("universal_delivery"); } else if (this.getAction() == 2) { @@ -608,29 +612,28 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp action = LangProcess.msg("universal_releasing"); } else if (this.getAction() == 4) { action = LangProcess.msg("universal_releasing_completed"); + }else if (this.getAction() == 5){ + action = "反馈子卷重量"; + }else if (this.getAction() == 0){ + action = "无动作"; } if(error == 0 && this.itemProtocol.isError){ iserror = true; - }else if(error == 0 && !this.itemProtocol.isError){ + }else if(error == 0 && !(this.itemProtocol.isError)){ iserror = false; } - 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", walk_y); - jo.put("isOnline", this.getIsonline()); - jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); - jo.put("isError", this.getIserror()); - jo.put("message", LangProcess.msg(message)); - jo.put("notCreateTaskMessage", notCreateTaskMessage); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); - jo.put("feedMessage",feedMessage); - jo.put("driver_type", "siemens_conveyor"); - jo.put("is_click", true); - jo.put("x", x_position); - jo.put("y", y_position); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + map.put("action", action); + map.put("isOnline", this.getIsonline()); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", message); + map.put("feedMessage", feedMessage); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue index 15b5d14ad..c9b68ee7a 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -505,7 +505,7 @@ export default { this.arr = [] // 清空 if (item.device_code && item.data) { console.log('item', item) - let tempDeviceName = '' + /* let tempDeviceName = '' if (this.language === 'zh') { tempDeviceName = item.data.zh_device_name } @@ -514,12 +514,10 @@ export default { } if (this.language === 'in') { tempDeviceName = item.data.in_device_name - } + } */ this.arr = [ { name: i18n.t('monitor.click.equipment_number'), value: item.device_code }, - // { name: tempDeviceName, value: item.device_name } - { name: i18n.t('monitor.click.device_name'), value: tempDeviceName } - // { name: i18n.t('monitor.click.device_name'), value: item.device_name } + { name: i18n.t('monitor.click.device_name'), value: item.device_name } ] const data = item.data for (const val in data) { @@ -689,6 +687,9 @@ export default { } else if (val === 'requireSucess') { const obj = { name: i18n.t('monitor.click.request_success_flag'), value: data[val] } this.arr.push(obj) + } else if (val === 'requireActionSucess') { + const obj = { name: '信号成功标记', value: data[val] } + this.arr.push(obj) } else if (val === 'applySucess') { const obj = { name: 'applySucess', value: data[val] } this.arr.push(obj) @@ -699,7 +700,7 @@ export default { const obj = { name: i18n.t('monitor.click.inventory_quantity'), value: data[val] } this.arr.push(obj) } else if (val === 'hand_barcode') { - const obj = { name: 'hand_barcode', value: data[val] } + const obj = { name: '子卷编号', value: data[val] } this.arr.push(obj) } else if (val === 'x') { const obj = { name: 'X', value: data[val] }