From b4e31c71a20185cda67758c9fe2033d30dbdc667 Mon Sep 17 00:00:00 2001 From: yanps Date: Fri, 29 Mar 2024 18:55:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=83=98=E7=AE=B1=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=8C=87=E4=BB=A4=E9=94=99=E8=AF=AF=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OvenGantryManipulatorDeviceDriver.java | 12 +++++++----- .../acs/auto/run/TwoNDCSocketConnectionAutoRun.java | 2 +- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 3 ++- .../OvenGantryManipulatorDeviceDriver.java | 12 ++++++++---- 4 files changed, 18 insertions(+), 11 deletions(-) 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 7ddac7db0..d9ac003bc 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 @@ -440,9 +440,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); return false; } - instruction.setInstruction_status("1"); - instruction.setUpdate_time(DateUtil.now()); - instructionService.update(instruction); Device startDevice = deviceAppService.findDeviceByCode(start_device_code); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { @@ -454,7 +451,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i String start_addr = startDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString(); logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" - + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() + + instruction.getInstruction_code() + "任务号="+ taskDto.getTask_code() + ",指令起点:" + instruction.getStart_device_code() + ",指令终点:" + instruction.getNext_device_code()); this.writing("to_onset", start_addr); this.writing("to_target", next_addr); @@ -622,10 +619,15 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); } + Instruction byInsructionCode = instructionService.findByInsructionCode(instdto.getInstruction_code()); + if(ObjectUtil.isEmpty(byInsructionCode)){ + logServer.deviceExecuteLog(this.getDevice_code(), "", "", "未找到指令号: "+instdto.getInstruction_code()); + return false; + } String start_addr = startDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString(); logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" - + instdto.getInstruction_code() +";指令号: "+ CodeUtil.getNewCode("INSTRUCT_NO") + ",指令起点:" + instdto.getStart_device_code() + + instdto.getInstruction_code()+ "任务号: "+ task.getTask_code() + ",指令起点:" + instdto.getStart_device_code() + ",指令终点:" + instdto.getNext_device_code()); this.writing("to_onset", start_addr); this.writing("to_target", next_addr); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 102900aaf..068c6efed 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -117,7 +117,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } int[] arr = new int[count]; - StringBuffer bs = new StringBuffer(); + StringBuffer bs = new StringBuffer(); for (int i = 0; i < count; i++) { int temp = b[i]; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index f1ffe5a51..848bfedf6 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -230,7 +230,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { + if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 + && standardInspectSiteDeviceDriver.getError() == 0)) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; 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 1d695130d..a0da6c362 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 @@ -707,7 +707,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (linkDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) linkDevice.getDeviceDriver(); //判断关联设备是否开门 - if (hongXiangConveyorDeviceDriver.getDoor() == 1) { + if (hongXiangConveyorDeviceDriver.getDoor() == 1 || hongXiangConveyorDeviceDriver.getError1() != 0 + || hongXiangConveyorDeviceDriver.getError() != 0) { isClose = true; notCreateInstMessage = start_device_code + "关联设备->" + deviceCode + "烘箱门未关闭!"; break; @@ -732,7 +733,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (linkDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) linkDevice.getDeviceDriver(); //判断关联设备是否开门 - if (hongXiangConveyorDeviceDriver.getDoor() == 1) { + if (hongXiangConveyorDeviceDriver.getDoor() == 1 || hongXiangConveyorDeviceDriver.getError1() != 0 + || hongXiangConveyorDeviceDriver.getError() != 0) { isClose = true; notCreateInstMessage = next_device_code + "关联设备->" + deviceCode + "烘箱门未关闭!"; break; @@ -812,8 +814,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int door = hongXiangConveyorDeviceDriver.getDoor(); int action = hongXiangConveyorDeviceDriver.getAction(); int error1 = hongXiangConveyorDeviceDriver.getError1(); + int error = hongXiangConveyorDeviceDriver.getError(); int move = hongXiangConveyorDeviceDriver.getMove(); - if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 1) { + if (mode == 1 && door == 1 && action == 1 && error == 0 && error1 == 0 && move == 1) { if (this.getNow_steps_type() == 2) { map.put("code", "to_command"); map.put("value", "2"); @@ -920,8 +923,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i int door = hongXiangConveyorDeviceDriver.getDoor(); int action = hongXiangConveyorDeviceDriver.getAction(); int error1 = hongXiangConveyorDeviceDriver.getError1(); + int error = hongXiangConveyorDeviceDriver.getError(); int move = hongXiangConveyorDeviceDriver.getMove(); - if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 0) { + if (mode == 1 && door == 1 && action == 1 && error == 0 && error1 == 0 && move == 0) { if (this.getNow_steps_type() == 4) { map.put("code", "to_command"); map.put("value", "4");