diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 156526af2..dcd858f01 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -284,13 +284,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl //双任务/单任务 后工位取空时判断动作信号,并反馈 if (mode == 3 && action2 == 1 && move2 == 0 && task2 > 0) { Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); - String start_device_code = ""; - if (type == 2) { - start_device_code = inst1.getStart_device_code(); - } - if (type == 3) { - start_device_code = inst1.getStart_device_code2(); - } + String start_device_code = inst1.getStart_device_code(); Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); if (ObjectUtil.isEmpty(startDevice)) { feedMessage = "后工位取货位:" + start_device_code + "为空!"; @@ -311,13 +305,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } else { log.warn("前工位取货位无货,取货位:{},mode:{},move:{}", start_device_code, mode, move); if (this.getNow_steps_type2() == 2 || this.getNow_steps_type3() == 2) { - feedMessage = "请检查输送线:mode == 2 && move == 1"; + feedMessage = "请检查输送线:mode == 2 && move == 1,此时读取到mode = " + mode + "move = " + move; } } } } else { if (this.getNow_steps_type2() == 2 || this.getNow_steps_type3() == 2) { - feedMessage = "请检查:mode == 3 && action2 == 1 && move2 == 0 && task2 > 0"; + feedMessage = "请检查:mode == 3 && action2 == 1 && move2 == 0 && task2 > 0,此时读取到mode = " + mode + + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2; } } @@ -332,7 +327,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type2() == 3 || this.getNow_steps_type3() == 3) { - feedMessage = "请检查:mode == 3 && action2 == 2 && move2 == 1 && task2 > 0"; + feedMessage = "请检查:mode == 3 && action2 == 2 && move2 == 1 && task2 > 0,此时读取到mode = " + mode + + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2; } } @@ -346,7 +342,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type1() == 2 || this.getNow_steps_type3() == 4) { - feedMessage = "请检查mode == 3 && action1 == 1 && move1 == 0 && task1 > 0"; + feedMessage = "请检查mode == 3 && action1 == 1 && move1 == 0 && task1 > 0,此时读取到mode = " + mode + + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1; } } @@ -361,7 +358,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type1() == 3 || this.getNow_steps_type3() == 5) { - feedMessage = "请检查:mode == 3 && action1 == 2 && move1 == 1 && task1 > 0"; + feedMessage = "请检查:mode == 3 && action1 == 2 && move1 == 1 && task1 > 0,此时读取到mode = " + mode + + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1; } } @@ -376,7 +374,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type2() == 4 || this.getNow_steps_type3() == 6) { - feedMessage = "请检查:mode == 3 && action2 == 3 && move2 == 1 && task2 > 0"; + feedMessage = "请检查:mode == 3 && action2 == 3 && move2 == 1 && task2 > 0,此时读取到mode = " + mode + + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2; } } @@ -406,7 +405,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type2() == 5) { - feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2"; + feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2,此时读取到 " + + "mode =" + mode + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2 + "type = " + type; } } @@ -416,7 +416,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.setNow_steps_type3(8); } else { if (this.getNow_steps_type3() == 7) { - feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task1 > 0 && task2 > 0 && type == 3"; + feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task1 > 0 && task2 > 0 && type == 3,此时读取到mode = " + mode + + "action2 = " + action2 + "move2 = " + move2 + "task1 = " + task1 + "task2 = " + task2 + "type = " + type; } } @@ -449,13 +450,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } else { log.warn("后工位放货位有货,放货位:{},mode:{},move:{}", next_device_code, mode, move); if (this.getNow_steps_type1() == 4 || this.getNow_steps_type3() == 8) { - feedMessage = "请检查输送线:move == 1 && mode == 2"; + feedMessage = "请检查输送线:move == 1 && mode == 2,此时读取到mode = " + mode + "move = " + move; } } } } else { if (this.getNow_steps_type1() == 4 || this.getNow_steps_type3() == 8) { - feedMessage = "请检查:mode == 3 && action1 == 3 && move1 == 1 && task1 > 0"; + feedMessage = "请检查:mode == 3 && action1 == 3 && move1 == 1 && task1 > 0,此时读取到mode = " + mode + "action1 = " + + action1 + "move1 = " + move1 + "task1 = " + task1; } } @@ -486,7 +488,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type1() == 5) { - feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1"; + feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1,此时读取到 mode = " + + mode + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1 + "type = " + type; } } @@ -517,7 +520,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type3() == 9) { - feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3"; + feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3,此时读取到mode = " + mode + + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1 + "task2 = " + task2 + "type = " + type; } } @@ -858,9 +862,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code); Device startDevice2 = deviceAppservice.findDeviceByCode(start_device_code2); Device nextDevice2 = deviceAppservice.findDeviceByCode(next_device_code2); + logServer.deviceExecuteLog(this.getDeviceCode(), "", "", "" + + "执行就绪状态下的任务生成指令时:起点1为:" + start_device_code + "起点2为:" + start_device_code2 + ",任务信息为:" + taskDto.toString()); //如果指令表中的取货点1和取货点2 都不为空 则说明时下双工位任务 if (StrUtil.isNotEmpty(start_device_code2) && StrUtil.isNotEmpty(start_device_code)) { type = "3"; + logServer.deviceExecuteLog(this.getDeviceCode(), "", "", "" + + "执行就绪状态下的任务生成指令时:起点1为:" + start_device_code + "起点2为:" + start_device_code2 + + "type值为:" + type + ",任务信息为:" + taskDto.toString()); //判断四个点位是否都设置电气值 this.isSetAddress(startDevice); this.isSetAddress(nextDevice); @@ -875,6 +884,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } else if (backGetIndex != -1) { type = "2"; //后工位 } + logServer.deviceExecuteLog(this.getDeviceCode(), "", "", "" + + "执行就绪状态下的任务生成指令时:起点1为:" + start_device_code + "起点2为:" + start_device_code2 + + "type值为:" + type + ",任务信息为:" + taskDto.toString()); //判断单任务下的两个点位是否都设置电气值 this.isSetAddress(startDevice); this.isSetAddress(nextDevice); @@ -918,6 +930,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl instdto.setNext_point_code2(next_point_code2); try { + logServer.deviceExecuteLog(this.getDeviceCode(), "", "", "" + + "执行就绪状态下的任务生成指令时:起点1为:" + start_device_code + "起点2为:" + start_device_code2 + + "type值为:" + type + ",创建指令信息为:" + instdto.toString()); instructionService.create(instdto); flag = true; } catch (Exception e) { @@ -940,6 +955,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl //下发电气信号 public synchronized void sendSignalType(Instruction dto, String type) { + logServer.deviceExecuteLog(this.getDeviceCode(), "", "", "开始下发电气信号,即下发电气指令信息为:" + + dto.toString() + ",type = " + type); String start_device_code = dto.getStart_device_code(); String next_device_code = dto.getNext_device_code(); Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);