From f2fb475e2e1d91e9c209154cc1bb8142995388df Mon Sep 17 00:00:00 2001 From: yanps Date: Wed, 24 Jan 2024 13:38:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=83=98=E7=AE=B1?= =?UTF-8?q?=E8=A1=8C=E6=9E=B6=E4=B8=8D=E7=BB=992=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HongXiangConveyorDeviceDriver.java | 29 +++++++++-- .../OvenGantryManipulatorDeviceDriver.java | 52 +++++++++++++++---- .../SiemensConveyorDeviceDriver.java | 2 +- .../src/views/system/monitor/device/index.vue | 3 ++ acs2/nladmin-ui/src/views/lucene/time.vue | 6 +-- 5 files changed, 76 insertions(+), 16 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java index d24676f2e..8e1740ffa 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -340,6 +340,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("finish", finish); jo.put("isOnline", this.getIsonline()); jo.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError()))); + jo.put("error1", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError1()))); jo.put("isError", this.getIserror()); jo.put("countdown_house", countdown_house); jo.put("countdown_min", countdown_min); @@ -348,9 +349,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("mode", mode); jo.put("move", move); jo.put("action", action); -// jo.put("isOnline", this.getIsonline()); -// jo.put("error", this.getError()); -// jo.put("isError", this.getIserror()); jo.put("task", this.getTask()); return jo; } @@ -402,4 +400,29 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple } } + public void writing(List list) { + Map itemMap = new HashMap(); + for (int i = 0; i < list.size(); i++) { + Object ob = list.get(i); + JSONObject json = (JSONObject) JSONObject.toJSON(ob); + if (!StrUtil.isEmpty(json.getString("value"))) { + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + json.getString("code"); + itemMap.put(to_param, json.getString("value")); + } + } + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); + try { + this.checkcontrol(itemMap); + } catch (Exception e) { + e.printStackTrace(); + try { + this.checkcontrol(itemMap); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + } + } 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 ed46b3468..6fbc82193 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 @@ -457,11 +457,29 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i this.writing("to_command", "1"); if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); - hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_open_door"); + map.put("value", "1"); + list.add(map); + try { + hongXiangConveyorDeviceDriver.writing(list); + } catch (Exception e) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type); + } } if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); - hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_open_door"); + map.put("value", "1"); + list.add(map); + try { + hongXiangConveyorDeviceDriver.writing(list); + } catch (Exception e) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type); + } } this.setNow_steps_type(2); this.setRequireSucess(true); @@ -605,13 +623,29 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i //HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); - hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); - hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_open_door"); + map.put("value", "1"); + list.add(map); + try { + hongXiangConveyorDeviceDriver.writing(list); + } catch (Exception e) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type); + } } if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver(); - hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); - hongXiangConveyorDeviceDriver.writing("to_open_door", "1"); + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code", "to_open_door"); + map.put("value", "1"); + list.add(map); + try { + hongXiangConveyorDeviceDriver.writing(list); + } catch (Exception e) { + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type); + } } this.setNow_steps_type(2); this.setRequireSucess(true); @@ -800,11 +834,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i steps_type = "更新指令状态"; } else if (now_steps_type == 2) { steps_type = "下发电气信号"; - }else if(now_steps_type == 3){ + } else if (now_steps_type == 3) { steps_type = "允许取货"; - }else if (now_steps_type ==4 ){ + } else if (now_steps_type == 4) { steps_type += "允许放货"; - }else if (now_steps_type == 5){ + } else if (now_steps_type == 5) { steps_type += "放货完成"; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 8dd8baaf5..1d4486e82 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -476,7 +476,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme break; } else { message = "task变化请求LMS失败: " + response.getMessage(); - Thread.sleep(5000); + Thread.sleep(15000); } } } catch (Exception e) { 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 7533172be..0aa5a9538 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -470,6 +470,9 @@ export default { } else if (val === 'error') { const obj = { name: '报警', value: data[val] } this.arr.push(obj) + } else if (val === 'error1') { + const obj = { name: '报警2', value: data[val] } + this.arr.push(obj) } else if (val === 'ip') { const obj = { name: 'IP地址', value: data[val] } this.arr.push(obj) diff --git a/acs2/nladmin-ui/src/views/lucene/time.vue b/acs2/nladmin-ui/src/views/lucene/time.vue index 37b160175..7d3a98c68 100644 --- a/acs2/nladmin-ui/src/views/lucene/time.vue +++ b/acs2/nladmin-ui/src/views/lucene/time.vue @@ -7,9 +7,9 @@ v-model="query.createTime" type="datetimerange" :picker-options="pickerOptions" - range-separator="至" - start-placeholder="开始日期" - end-placeholder="结束日期" + :range-separator="$t('monitor.lucence.until')" + :start-placeholder="$t('auto.common.startDate')" + :end-placeholder="$t('auto.common.endDate')" align="right" />