From 42cd7d125855a5c0802283c076919dcba4d246b0 Mon Sep 17 00:00:00 2001 From: yanps Date: Wed, 17 Jan 2024 18:57:02 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E6=8F=92=E6=8B=94?= =?UTF-8?q?=E6=9C=BA=E5=8F=96=E8=B4=A7=E5=AE=8C=E6=88=90=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndoorManipulatorDeviceDriver.java | 7 ++++- ...PluggingUnpluggingMachineDeviceDriver.java | 27 +++++++++++++++++++ .../basedriver/rgv/RgvDeviceDriver.java | 20 +++++++------- acs/nladmin-ui/src/views/acs/task/index.vue | 8 +----- 4 files changed, 44 insertions(+), 18 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 e410abc8e..b338c56ca 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 @@ -397,7 +397,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple try { this.checkcontrol(itemMap); } catch (Exception e) { - throw new RuntimeException(e); + try { + Thread.sleep(1000); + this.checkcontrol(itemMap); + } catch (Exception ex) { + throw new RuntimeException(ex); + } } logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); } 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 95f1b9aed..e89644ebd 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 @@ -161,6 +161,11 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv pullingSucess(); } break; + case 7: + if (task1 > 0 && !requireSucess) { + deliveryCompleted(); + } + break; default: break; @@ -174,6 +179,28 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv last_to_command = to_command; } + /** + * 取货完成 + */ + private void deliveryCompleted() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + applyManipulatorActionRequest.setAction("1"); + applyManipulatorActionRequest.setTask_code1(String.valueOf(task1)); + ApplyManipulatorActionResponse applyManipulatorActionResponse = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse.getstatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求成功响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + Map map = new LinkedHashMap<>(); + map.put("to_command", 7); + this.writing(map); + requireSucess = true; + message = "缓存库放货成功"; + } else { + requireSucess = false; + logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求失败响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "缓存库放货失败"; + } + } + private synchronized void pullingSucess() { List list = new ArrayList(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); 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 58985a5d7..993fa5c68 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 @@ -65,10 +65,10 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr int last_move1 = 0; Integer move2 = 0; Integer last_move2 = 0; - float qty1 = 0f; - float last_qty1 = 0f; - float qty2 = 0f; - float last_qty2 = 0f; + Float qty1 = 0f; + Float last_qty1 = 0f; + Float qty2 = 0f; + Float last_qty2 = 0f; int task = 0; int last_task = 0; @@ -117,14 +117,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr if(!move2.equals(last_move2)){ logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_move2 + "->" + move2); } - if(qty1 != last_qty1){ - logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty1 + "->" + qty1); + if(!qty1.equals(last_qty1)){ + logServer.deviceExecuteLog(this.device_code, "", "", "信号qty1:" + last_qty1 + "->" + qty1); } - if(qty2 != last_qty2){ - logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty2 + "->" + qty2); + if(!qty2.equals(last_qty2)){ + logServer.deviceExecuteLog(this.device_code, "", "", "信号qty2:" + last_qty2 + "->" + qty2); } if(task != last_task){ - logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_task + "->" + task); + logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); } @@ -162,7 +162,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr } break; case 5: - if (task > 0 && !requireSucess && (qty1 > 0 || qty2 > 0)) { + if (task > 0 && !requireSucess) { manualFeedbackQty(); } break; diff --git a/acs/nladmin-ui/src/views/acs/task/index.vue b/acs/nladmin-ui/src/views/acs/task/index.vue index e97158864..20a170eb3 100644 --- a/acs/nladmin-ui/src/views/acs/task/index.vue +++ b/acs/nladmin-ui/src/views/acs/task/index.vue @@ -599,13 +599,7 @@ export default { device_code: '', material_code: '', qty: '' - }/* , - { - device_code: '', - material_code: '', - qty: '' - } */ - ] + }] }, rules: { start_height: [