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 @@ + + + + + + + + + + +