From 78873e720599434f4dd347939a0f7184228fee2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Sat, 28 Jan 2023 23:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=8E=A7=E6=8F=90=E7=A4=BA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SlitTwoManipulatorDeviceDriver.java | 276 +++++++++++++----- 1 file changed, 207 insertions(+), 69 deletions(-) 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 bed1501d9..6f170f7fe 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 @@ -306,16 +306,32 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.setNow_steps_type3(3); } } else { - log.warn("前工位取货位无货,取货位:{},mode:{},move:{}", start_device_code, mode, move); + 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,此时读取到mode = " + mode + "move = " + move; + feedMessage = "后工位未取货原因-->"; + if (mode != 2) { + feedMessage += "后工位取货位工作模式不为待机(mode != 2),"; + } else if (move != 1) { + feedMessage += "后工位取货位无货(move != 1)"; + } } } } } else { if (this.getNow_steps_type2() == 2 || this.getNow_steps_type3() == 2) { - feedMessage = "请检查:mode == 3 && action2 == 1 && move2 == 0 && task2 > 0,此时读取到mode = " + mode - + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2; + feedMessage = "后工位未取货原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action2 != 1) { + feedMessage += "后工位动作信号不为取货中(action2 != 1),"; + } + if (move2 != 0) { + feedMessage += "后工位光电信号不为空(move2 != 0),"; + } + if (task2 == 0) { + feedMessage += "后工位没有任务(task2 == 0)"; + } } } @@ -330,8 +346,19 @@ 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,此时读取到mode = " + mode - + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2; + feedMessage = "后工位取货完成后未反馈原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action2 != 2) { + feedMessage += "后工位未取货完成(action2 != 2),"; + } + if (move2 == 0) { + feedMessage += "后工位光电信号为空(move2 == 0),"; + } + if (task2 == 0) { + feedMessage += "后工位没有任务(task2 == 0)"; + } } } @@ -345,8 +372,19 @@ 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,此时读取到mode = " + mode - + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1; + feedMessage = "前工位未取货原因"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action1 != 1) { + feedMessage += "前工位动作信号不为取货中(action2 != 1),"; + } + if (move1 != 0) { + feedMessage += "前工位光电信号不为空(move2 != 0),"; + } + if (task1 == 0) { + feedMessage += "前工位没有任务(task2 == 0)"; + } } } @@ -361,8 +399,19 @@ 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,此时读取到mode = " + mode - + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1; + feedMessage = "前工位取货完成后未反馈原因"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action1 != 2) { + feedMessage += "前工位未取货完成(action2 != 2),"; + } + if (move1 == 0) { + feedMessage += "前工位光电信号为空(move2 == 0),"; + } + if (task1 == 0) { + feedMessage += "前工位没有任务(task2 == 0)"; + } } } @@ -377,8 +426,19 @@ 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,此时读取到mode = " + mode - + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2; + feedMessage = "后工位未放货原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action2 != 3) { + feedMessage += "后工位动作信号不为放货中(action2 != 3),"; + } + if (move2 == 0) { + feedMessage += "后工位光电信号为空(move2 == 0),"; + } + if (task2 == 0) { + feedMessage += "后工位没有任务(task2 == 0)"; + } } } @@ -408,8 +468,22 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type2() == 5) { - feedMessage = "请检查:mode == 3 && action2 == 4 && move2 == 0 && task2 > 0 && type == 2,此时读取到 " + - "mode =" + mode + "action2 = " + action2 + "move2 = " + move2 + "task2 = " + task2 + "type = " + type; + feedMessage = "单任务后工位放货完成后未反馈原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action2 != 4) { + feedMessage += "后工位未放货完成(action2 != 4),"; + } + if (move2 != 0) { + feedMessage += "后工位光电信号为有货(move2 != 0),"; + } + if (task2 == 0) { + feedMessage += "后工位没有任务(task2 == 0),"; + } + if (type != 2) { + feedMessage += "不是后工位单任务(type != 2)"; + } } } @@ -419,8 +493,25 @@ 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,此时读取到mode = " + mode - + "action2 = " + action2 + "move2 = " + move2 + "task1 = " + task1 + "task2 = " + task2 + "type = " + type; + feedMessage = "双任务后工位放货完成后未反馈原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action2 != 4) { + feedMessage += "后工位未放货完成(action2 != 4),"; + } + if (move2 != 0) { + feedMessage += "后工位光电信号为有货(move2 != 0),"; + } + if (task1 == 0) { + feedMessage += "前工位没有任务(task1 == 0),"; + } + if (task2 == 0) { + feedMessage += "后工位没有任务(task2 == 0),"; + } + if (type != 3) { + feedMessage += "不是双任务(type != 3)"; + } } } @@ -453,14 +544,30 @@ 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,此时读取到mode = " + mode + "move = " + move; + feedMessage = "前工位未放货原因-->"; + if (mode != 2) { + feedMessage += "前工位放货位工作模式不为待机(mode != 2),"; + } else if (move == 0) { + feedMessage += "前工位放货位无货(move == 0)"; + } } } } } else { if (this.getNow_steps_type1() == 4 || this.getNow_steps_type3() == 8) { - feedMessage = "请检查:mode == 3 && action1 == 3 && move1 == 1 && task1 > 0,此时读取到mode = " + mode + "action1 = " - + action1 + "move1 = " + move1 + "task1 = " + task1; + feedMessage = "前工位未放货原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action1 != 3) { + feedMessage += "前工位动作信号不为放货中(action1 != 3),"; + } + if (move1 == 0) { + feedMessage += "前工位光电信号为空(move1 == 0),"; + } + if (task1 == 0) { + feedMessage += "前工位没有任务(task1 == 0),"; + } } } @@ -491,8 +598,22 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } } else { if (this.getNow_steps_type1() == 5) { - feedMessage = "请检查:mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && type == 1,此时读取到 mode = " + - mode + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1 + "type = " + type; + feedMessage = "单任务前工位放货完成后未反馈原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action1 != 4) { + feedMessage += "前工位未放货完成(action1 != 4),"; + } + if (move1 != 0) { + feedMessage += "前工位光电信号为有货(move1 != 0),"; + } + if (task1 == 0) { + feedMessage += "前工位没有任务(task1 == 0),"; + } + if (type != 1) { + feedMessage += "不为前工位单任务(type != 1)"; + } } } @@ -523,8 +644,25 @@ 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,此时读取到mode = " + mode - + "action1 = " + action1 + "move1 = " + move1 + "task1 = " + task1 + "task2 = " + task2 + "type = " + type; + feedMessage = "双任务前工位放货完成后未反馈原因-->"; + if (mode != 3) { + feedMessage += "行架工作模式不为运行中(mode != 3),"; + } + if (action1 != 4) { + feedMessage += "前工位未放货完成(action1 != 4),"; + } + if (move1 != 0) { + feedMessage += "前工位光电信号为有货(move1 != 0),"; + } + if (task1 == 0) { + feedMessage += "前工位没有任务(task1 == 0),"; + } + if (task2 == 0) { + feedMessage += "后工位没有任务(task2 == 0),"; + } + if (type != 3) { + feedMessage += "不是双任务(type != 3)"; + } } } @@ -592,25 +730,25 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (!requireSucess) { String remark = ""; if (mode != 2) { - remark = remark + "mode不为2,"; + remark = remark + "行架工作模式不为待机(mode != 2),"; } if (move1 != 0) { - remark = remark + "move1不为0,"; + remark = remark + "前工位有货(move1 != 0),"; } if (move2 != 0) { - remark = remark + "move2不为0,"; + remark = remark + "后工位有货(move2 != 0),"; } if (action1 != 0) { - remark = remark + "action1不为0,"; + remark = remark + "前工位动作信号不为0(action1 != 0),"; } if (action2 != 0) { - remark = remark + "action2不为0,"; + remark = remark + "后工位动作信号不为0(action2 != 0),"; } if (task1 != 0) { - remark = remark + "task1不为0,"; + remark = remark + "前工位存在任务(task1 != 0),"; } if (task2 != 0) { - remark = remark + "task2不为0,"; + remark = remark + "后工位存在任务(task2 != 0),"; } this.setNotCreateTaskMessage(remark); } @@ -973,24 +1111,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl List list = new ArrayList(); if (StrUtil.equals(type, "1")) { Map map1 = new HashMap(); - map1.put("code","to_onset1"); - map1.put("value",start_addr); + map1.put("code", "to_onset1"); + map1.put("value", start_addr); list.add(map1); Map map2 = new HashMap(); - map2.put("code","to_target1"); - map2.put("value",next_addr); + map2.put("code", "to_target1"); + map2.put("value", next_addr); list.add(map2); Map map3 = new HashMap(); - map3.put("code","to_task1"); - map3.put("value",dto.getInstruction_code()); + map3.put("code", "to_task1"); + map3.put("value", dto.getInstruction_code()); list.add(map3); Map map4 = new HashMap(); - map4.put("code","to_type"); - map4.put("value","1"); + map4.put("code", "to_type"); + map4.put("value", "1"); list.add(map4); Map map5 = new HashMap(); - map5.put("code","to_command1"); - map5.put("value","1"); + map5.put("code", "to_command1"); + map5.put("value", "1"); list.add(map5); this.writing(list); logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发前工位任务"); @@ -1003,24 +1141,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.setNow_steps_type1(2); } else if (StrUtil.equals(type, "2")) { Map map1 = new HashMap(); - map1.put("code","to_onset2"); - map1.put("value",start_addr); + map1.put("code", "to_onset2"); + map1.put("value", start_addr); list.add(map1); Map map2 = new HashMap(); - map2.put("code","to_target2"); - map2.put("value",next_addr); + map2.put("code", "to_target2"); + map2.put("value", next_addr); list.add(map2); Map map3 = new HashMap(); - map3.put("code","to_task2"); - map3.put("value",dto.getInstruction_code()); + map3.put("code", "to_task2"); + map3.put("value", dto.getInstruction_code()); list.add(map3); Map map4 = new HashMap(); - map4.put("code","to_type"); - map4.put("value","2"); + map4.put("code", "to_type"); + map4.put("value", "2"); list.add(map4); Map map5 = new HashMap(); - map5.put("code","to_command2"); - map5.put("value","1"); + map5.put("code", "to_command2"); + map5.put("value", "1"); list.add(map5); this.writing(list); logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发后工位任务"); @@ -1041,40 +1179,40 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl Map map1 = new HashMap(); - map1.put("code","to_onset1"); - map1.put("value",start_addr2); + map1.put("code", "to_onset1"); + map1.put("value", start_addr2); list.add(map1); Map map2 = new HashMap(); - map2.put("code","to_target1"); - map2.put("value",next_addr2); + map2.put("code", "to_target1"); + map2.put("value", next_addr2); list.add(map2); Map map3 = new HashMap(); - map3.put("code","to_task1"); - map3.put("value",dto.getInstruction_code()); + map3.put("code", "to_task1"); + map3.put("value", dto.getInstruction_code()); list.add(map3); Map map4 = new HashMap(); - map4.put("code","to_onset2"); - map4.put("value",start_addr); + map4.put("code", "to_onset2"); + map4.put("value", start_addr); list.add(map4); Map map5 = new HashMap(); - map5.put("code","to_target2"); - map5.put("value",next_addr); + map5.put("code", "to_target2"); + map5.put("value", next_addr); list.add(map5); Map map6 = new HashMap(); - map6.put("code","to_task2"); - map6.put("value",dto.getInstruction_code()); + map6.put("code", "to_task2"); + map6.put("value", dto.getInstruction_code()); list.add(map6); Map map7 = new HashMap(); - map7.put("code","to_type"); - map7.put("value","3"); + map7.put("code", "to_type"); + map7.put("value", "3"); list.add(map7); Map map8 = new HashMap(); - map8.put("code","to_command1"); - map8.put("value","1"); + map8.put("code", "to_command1"); + map8.put("value", "1"); list.add(map8); Map map9 = new HashMap(); - map9.put("code","to_command2"); - map9.put("value","1"); + map9.put("code", "to_command2"); + map9.put("value", "1"); list.add(map9); this.writing(list); logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发双工位任务"); @@ -1092,7 +1230,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.setNow_steps_type3(2); } - if(task1 != Integer.parseInt(dto.getInstruction_code()) || task2 != Integer.parseInt(dto.getInstruction_code()) ){ + if (task1 != Integer.parseInt(dto.getInstruction_code()) || task2 != Integer.parseInt(dto.getInstruction_code())) { this.writing(list); logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "再次下发电气信号"); }