From 5fee172f7dda91da79d9e23d4456d15cb2f8efd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BF=8A=E6=9D=B0?= <9463626+zhou-junjiezjj@user.noreply.gitee.com> Date: Wed, 30 Aug 2023 13:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 41 ++++++++----------- .../resources/log/AgvNdcOneDeviceDriver.xml | 14 +++++++ 2 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index b27e193..f5efc05 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -171,10 +171,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //(需要WCS反馈) } else if (phase == 0x03) { log.info("==================AGV请求取货=================="); - if (ObjectUtil.isEmpty(device)) { - log.info("未找到 address = " + agvaddr + " 的设备"); - return; - } + if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logServer.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); @@ -283,19 +280,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //标准版-压制对接位 if(device.getDeviceDriver() instanceof ConveyorPressStationDeviceDriver){ conveyorPressStationDeviceDriver = (ConveyorPressStationDeviceDriver) device.getDeviceDriver(); - TaskDto task=taskService.findByCode(inst.getTask_code()); - String direction=task.getDirection(); - Integer direction1=Integer.parseInt(direction); - //困料位写入方向 - conveyorPressStationDeviceDriver.writing(2,direction1); - conveyorPressStationDeviceDriver.writing(2); + if (conveyorPressStationDeviceDriver.getMode() != 0 && conveyorPressStationDeviceDriver.getMove() != 0 && (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 1) && (conveyorPressStationDeviceDriver.getAction() == 3 || conveyorPressStationDeviceDriver.getAction() == 1)) { - inst.setExecute_status("1"); - instructionService.update(inst); - data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; @@ -422,10 +411,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //(需要WCS反馈) } else if (phase == 0x05) { log.info("================AGV取货完成请求离开================"); - if (ObjectUtil.isEmpty(device)) { - log.info("未找到 address = " + ikey + " 的设备"); - return; - } if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logServer.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); @@ -672,10 +657,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //(需要WCS反馈) } else if (phase == 0x07) { log.info("==================AGV请求放货=================="); - if (ObjectUtil.isEmpty(device)) { - log.info("未找到 address = " + ikey + " 的设备"); - return; - } if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logServer.deviceExecuteLog(device_code, "", "", "未找到指令 [" + ikey + "]"); @@ -915,10 +896,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //(需要WCS反馈) } else if (phase == 0x09) { log.info("================AGV放货完成请求离开================"); - if (ObjectUtil.isEmpty(device)) { - log.info("未找到 address = " + ikey + " 的设备"); - return; - } if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令:" + ikey); logServer.deviceExecuteLog("未找到指令号对应的指令:", "", "", String.valueOf(ikey)); @@ -1022,6 +999,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic inst.setExecute_status("6"); instructionService.update(inst); conveyorPressStationDeviceDriver.writing(3); + TaskDto task=taskService.findByCode(inst.getTask_code()); + if(ObjectUtil.isNotEmpty(task)){ + String direction=task.getDirection(); + if(ObjectUtil.isNotEmpty(direction)){ + Integer direction1=Integer.parseInt(direction); + //困料位写入方向 + conveyorPressStationDeviceDriver.writing(2,direction1); + }else{ + log.info("未输入方向"); + } + }else{ + log.info("任务号为空"); + } + data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); diff --git a/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml b/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml new file mode 100644 index 0000000..76e6024 --- /dev/null +++ b/acs/nladmin-system/src/main/resources/log/AgvNdcOneDeviceDriver.xml @@ -0,0 +1,14 @@ + + + + + + + + + + +