更新RGV申请任务逻辑

This commit is contained in:
张江玮
2023-03-02 08:43:25 +08:00
parent 9419f61e20
commit f8b18fdfae
2 changed files with 11 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.device_driver.hongfeng.hf_two_rgv.HfTwoRGVDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
@@ -254,7 +255,7 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
logServer.deviceExecuteLog(this.device_code, "", "", "信号order" + last_order + "->" + order);
}
if (barcode != last_barcode) {
this.setUpdateBarcodeRequireSucess(false);
this.setUpdateBarcodeRequireSucess(false);
logServer.deviceItemValue(this.device_code, "barcode", String.valueOf(barcode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号barcode" + last_barcode + "->" + barcode);
}

View File

@@ -374,28 +374,25 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
return;
case 2:
//后工位申请任务
if (mode == 2 && move2 == 0 && action2 == 0 && !requireBackSucess) {
if (mode == 2 && move2 == 0 && action2 == 0 && !requireBackSucess && task2 == 0) {
logServer.queryTask("RGV申请后工位任务", this.getDevice_code(), "RGV开始申请后工位任务满足信号->mode == 2 && move2 == 0 && action2 == 0");
instruction_require2();
} else {
if (!requireBackSucess)
logServer.queryTask("RGV申请后工位任务", this.getDevice_code(), "RGV不满足申请后工位任务此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "requireBackSucess = " + requireBackSucess);
}
//前工位申请任务
if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && !requireHeadSucess) {
if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && !requireHeadSucess && !requireBackSucess && task1 == 0) {
logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV开始申请前工位任务满足信号->mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0");
instruction_require();
} else {
if (!requireHeadSucess)
logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV不满足申请前工位任务此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "task2 = " + task2 + "move1 = " + move1 + "requireHeadSucess = " + requireHeadSucess);
}
break;
case 3:
//前工位申请任务
if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && !requireHeadSucess) {
if (mode == 3 && action2 == 1 && move1 == 0 && !requireHeadSucess && task1 == 0) {
logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV开始申请前工位任务满足信号->mode == 3 && move2 == 1 && action2 == 1 && move1 == 0");
instruction_require();
} else {
if (!requireHeadSucess)
logServer.queryTask("RGV申请前工位任务", this.getDevice_code(), "RGV不满足申请前工位任务此时:mode = " + mode + "move2 = " + move2 + "action2 = " + action2 + "move1 = " + move1 + "requireHeadSucess = " + requireHeadSucess);
}
@@ -432,6 +429,12 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
//前工位重复关联设备放货设备
List<String> repeatPutDeviceCodeList = this.getExtraDeviceCodes("head_repeat_put_device_code");
TaskDto task = null;
if (mode == 3) {
Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
getDeviceCodeList = new ArrayList<String>() {{
add(inst2.getNext_device_code());
}};
}
for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);