RGV驱动更新 判断逻辑更新
This commit is contained in:
@@ -260,6 +260,15 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
instructionService.update(inst1);
|
||||
}
|
||||
}
|
||||
if (action_1 == 0) {
|
||||
if (task2 > 0) {
|
||||
if (action_2 == 2) {
|
||||
writing("to_command1", "1");
|
||||
}
|
||||
} else {
|
||||
writing("to_command1", "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (action_1 == 4 && move_1 == 0 && task1 > 0) {
|
||||
//inst_message
|
||||
@@ -274,6 +283,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
|
||||
}
|
||||
}
|
||||
this.requireSucess1 = false;
|
||||
}
|
||||
|
||||
if (task2 > 0) {
|
||||
@@ -285,6 +295,9 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
instructionService.update(inst2);
|
||||
}
|
||||
}
|
||||
if (action_2 == 0) {
|
||||
writing("to_command2", "1");
|
||||
}
|
||||
}
|
||||
if (action_2 == 4 && move_2 == 0 && task2 > 0) {
|
||||
//inst_message
|
||||
@@ -299,6 +312,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
|
||||
}
|
||||
}
|
||||
this.requireSucess2 = false;
|
||||
}
|
||||
|
||||
//执行双任务下的业务逻辑
|
||||
@@ -353,17 +367,17 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
return;
|
||||
case 2:
|
||||
//后工位申请任务
|
||||
if (mode == 2 && move_2 == 0 && action_2 == 0 && !requireSucess2) {
|
||||
if (move_2 == 0 && action_2 == 0 && !requireSucess2 && task2 == 0) {
|
||||
instruction_require2();
|
||||
}
|
||||
//前工位申请任务
|
||||
else if (mode == 2 && move_2 == 0 && action_2 == 0 && move_1 == 0 && task2 == 0 && !requireSucess1) {
|
||||
if (move_2 == 0 && action_2 == 0 && task2 == 0 && move_1 == 0 && task1 == 0 && action_1 == 0 && !requireSucess1 && !requireSucess2) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
//前工位申请任务
|
||||
if (mode == 3 && move_2 == 1 && action_2 == 1 && move_1 == 0 && !requireSucess1) {
|
||||
if (move_1 == 0 && action_1 == 0 && task1 == 0 && action_2 == 1 && !requireSucess1) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
@@ -417,6 +431,12 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
String demoArray[] = demosub.split(",");
|
||||
List<String> device_code_list = Arrays.asList(demoArray);
|
||||
TaskDto task = null;
|
||||
if (mode == 3) {
|
||||
Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
|
||||
device_code_list = new ArrayList<String>() {{
|
||||
add(inst2.getNext_device_code());
|
||||
}};
|
||||
}
|
||||
for (int i = 0; i < device_code_list.size(); i++) {
|
||||
if (ObjectUtil.isNotEmpty(taskserver.queryTaskByDeviceCode(device_code_list.get(i).replace("\"", "")))) {
|
||||
task = taskserver.queryTaskByDeviceCode(device_code_list.get(i).replace("\"", "")).get(0);
|
||||
@@ -474,7 +494,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
String start_addr = startdevice.getExtraValue().get("OPCServer").toString();
|
||||
String next_addr = nextdevice.getExtraValue().get("OPCServer").toString();
|
||||
|
||||
writing("to_command1", "1");
|
||||
// writing("to_command1", "1");
|
||||
writing("to_onset1", start_addr);
|
||||
writing("to_target1", next_addr);
|
||||
writing("to_task1", instdto.getInstruction_code());
|
||||
@@ -554,7 +574,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
String start_addr = startdevice.getExtraValue().get("OPCServer").toString();
|
||||
String next_addr = nextdevice.getExtraValue().get("OPCServer").toString();
|
||||
|
||||
writing("to_command2", "1");
|
||||
// writing("to_command2", "1");
|
||||
writing("to_onset2", start_addr);
|
||||
writing("to_target2", next_addr);
|
||||
writing("to_task2", instdto.getInstruction_code());
|
||||
|
||||
@@ -430,7 +430,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if ((StrUtil.equals(device_code, "FJJXSXLW201") ||
|
||||
StrUtil.equals(device_code, "FJJXSXLW202") ||
|
||||
StrUtil.equals(device_code, "FJJXSXLW301") ||
|
||||
StrUtil.equals(device_code, "FJJXSXLW302")) && StrUtil.isEmpty(vehicle_code)
|
||||
StrUtil.equals(device_code, "FJJXSXLW302")) && (StrUtil.isEmpty(vehicle_code) || "0000".equals(vehicle_code) || "0".equals(vehicle_code))
|
||||
) {
|
||||
PointService pointService = SpringContextHolder.getBean(PointService.class);
|
||||
PointDto startPoint = pointService.findByCode(device_code);
|
||||
|
||||
Reference in New Issue
Block a user