This commit is contained in:
2022-12-09 14:29:54 +08:00
parent 79d0312d71
commit f8a597136e

View File

@@ -124,7 +124,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
if (mode != last_mode) {
if (mode == 1) {
if (mode == 2) {
this.setRequireSucess(false);
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
@@ -175,7 +175,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
//申请取货
if (mode == 1 && action == 1 && move == 0 && task > 0) {
if (mode == 3 && action == 1 && move == 0 && task > 0) {
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
if (ObjectUtil.isNotEmpty(inst2)) {
String start_device_code = inst2.getStart_device_code();
@@ -184,7 +184,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
if (hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
if (hongXiangConveyorDeviceDriver.getMode() == 1 && hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
this.writing("to_command", "2");
this.setNow_steps_type(3);
} else {
@@ -199,12 +199,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 2) {
feedMessage = "请检查mode == 1 && action == 1 && move == 0 && task > 0";
feedMessage = "请检查mode == 3 && action == 1 && move == 0 && task > 0";
}
}
//取货完成关闭烘箱门
if (mode == 1 && action == 2 && move == 1 && task > 0) {
if (mode == 3 && action == 2 && move == 1 && task > 0) {
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
if (ObjectUtil.isNotEmpty(inst2)) {
String start_device_code = inst2.getStart_device_code();
@@ -219,12 +219,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 3) {
feedMessage = "请检查mode == 1 && action == 2 && move == 1 && task > 0";
feedMessage = "请检查mode == 3 && action == 2 && move == 1 && task > 0";
}
}
//申请放货
if (mode == 1 && action == 3 && move == 1 && task > 0) {
if (mode == 3 && action == 3 && move == 1 && task > 0) {
Instruction instructionDto = instructionService.findByCode(String.valueOf(task));
String next_device_code = instructionDto.getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
@@ -232,7 +232,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
if (hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
if (hongXiangConveyorDeviceDriver.getMode() == 1 && hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
this.writing("to_command", "4");
this.setNow_steps_type(5);
} else {
@@ -244,12 +244,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 4) {
feedMessage = "请检查mode == 1 && action == 3 && move == 1 && task > 0";
feedMessage = "请检查mode == 3 && action == 3 && move == 1 && task > 0";
}
}
//放货完成
if (mode == 1 && action == 4 && move == 0 && task > 0) {
if (mode == 3 && action == 4 && move == 0 && task > 0) {
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
if (inst2 != null) {
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
@@ -293,7 +293,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 5) {
feedMessage = "请检查mode == 1 && action == 4 && move == 0 && task > 0";
feedMessage = "请检查mode == 3 && action == 4 && move == 0 && task > 0";
}
}
@@ -324,7 +324,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
List toInstructions;
//行架机械手申请任务
if (mode == 1 && move == 0 && task == 0 && !requireSucess) {
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
applyTask();
} else {
if (!requireSucess) {