opt: NDC双工位AGV优化

This commit is contained in:
yanps
2023-11-15 14:13:59 +08:00
parent 47ac9d9ec9
commit f826b0ba77
2 changed files with 23 additions and 23 deletions

View File

@@ -278,7 +278,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("当前phase"+ phase +"未找到对应设备"); log.info("当前phase"+ phase +"未找到对应设备");
} }
} catch (Exception e){ } catch (Exception e){
log.info("processSocket出错:" + e.getMessage()); log.info("processSocket出错:{},{}" ,e, e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@@ -208,7 +208,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到指令号{}对应的指令", ikey); log.info("未找到指令号{}对应的指令", ikey);
return; return;
} }
if(ObjectUtil.isEmpty(inst.getCarno())){ if (ObjectUtil.isEmpty(inst.getCarno())) {
inst.setCarno(String.valueOf(carno)); inst.setCarno(String.valueOf(carno));
instructionService.update(inst); instructionService.update(inst);
} }
@@ -218,14 +218,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait")) if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait"))
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString()) && StrUtil.equals("true", device.getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(), "1")) { && StrUtil.equals(task.getTask_type(), "1")) {
//
if (standardOrdinarySiteDeviceDriver.getOption() == 1) { if (standardOrdinarySiteDeviceDriver.getOption() == 1) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); String task_code = standardOrdinarySiteDeviceDriver.getTask_code();
if(!task_code.equals(task.getTask_code())){ log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code);
log.info("等待LMS系统进行确认允许取货设备号{},指令号{},任务号{}", device_code, ikey,task.getTask_code()); if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) {
log.info("等待LMS系统进行确认允许取货设备号{},指令号{},任务号{}", device_code, ikey, task.getTask_code());
message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey;
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
} else { } else {
log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code, ikey); log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code, ikey);
@@ -235,8 +236,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else { } else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
} else if (device.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) { } else if (device.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) device.getDeviceDriver(); photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) device.getDeviceDriver();
if (photoelectricInspectionSiteDeviceDriver.getMove() == 1) if (photoelectricInspectionSiteDeviceDriver.getMove() == 1)
@@ -248,17 +247,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1) || standardInspectSiteDeviceDriver.getIs_force() == 1) {
if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 )|| standardInspectSiteDeviceDriver.getIs_force()==1 ) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else { } else {
message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + ",指令号:" + ikey +"不满足取货条件"; message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
log.info("设备{}当前光电信号{},动作信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction(), ikey); log.info("设备{}当前光电信号{},动作信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction(), ikey);
} }
standardInspectSiteDeviceDriver.setIs_force(0);
} else { } else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
standardInspectSiteDeviceDriver.setIs_force(0);
} }
// 取货完毕 // 取货完毕
//(Itype=1/2/3,需要WCS反馈Phase) //(Itype=1/2/3,需要WCS反馈Phase)
@@ -294,7 +293,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到指令号{}对应的指令", ikey); log.info("未找到指令号{}对应的指令", ikey);
return; return;
} }
if(ObjectUtil.isEmpty(inst.getCarno())){ if (ObjectUtil.isEmpty(inst.getCarno())) {
inst.setCarno(String.valueOf(carno)); inst.setCarno(String.valueOf(carno));
instructionService.update(inst); instructionService.update(inst);
} }
@@ -316,7 +315,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing("to_command", "0"); standardInspectSiteDeviceDriver.writing("to_command", "0");
if (standardInspectSiteDeviceDriver.getMove() == 0|| standardInspectSiteDeviceDriver.getIs_force()==1) { if (standardInspectSiteDeviceDriver.getMove() == 0 || standardInspectSiteDeviceDriver.getIs_force() == 1) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else { } else {
message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件";
@@ -358,7 +357,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到指令号{}对应的指令", ikey); log.info("未找到指令号{}对应的指令", ikey);
return; return;
} }
if(ObjectUtil.isEmpty(inst.getCarno())){ if (ObjectUtil.isEmpty(inst.getCarno())) {
inst.setCarno(String.valueOf(carno)); inst.setCarno(String.valueOf(carno));
instructionService.update(inst); instructionService.update(inst);
} }
@@ -368,15 +367,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(), "1")) { && StrUtil.equals(task.getTask_type(), "1")) {
//
if (standardOrdinarySiteDeviceDriver.getOption() == 1) { if (standardOrdinarySiteDeviceDriver.getOption() == 1) {
standardOrdinarySiteDeviceDriver.setAgvphase(0); standardOrdinarySiteDeviceDriver.setAgvphase(0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); String task_code = standardOrdinarySiteDeviceDriver.getTask_code();
if(!task_code.equals(task.getTask_code())){ log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code);
log.info("等待LMS系统进行确认允许取货设备号{},指令号{},任务号{}", device_code, ikey,task.getTask_code()); if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) {
log.info("等待LMS系统进行确认允许取货设备号{},指令号{},任务号{}", device_code, ikey, task.getTask_code());
message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey;
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
} else { } else {
log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code, ikey); log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code, ikey);
@@ -518,13 +518,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing("to_command", "1"); standardInspectSiteDeviceDriver.writing("to_command", "1");
if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1)||standardInspectSiteDeviceDriver.getIs_force()==1) { if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1) || standardInspectSiteDeviceDriver.getIs_force() == 1) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
standardInspectSiteDeviceDriver.setIs_force(0);
} else { } else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
standardInspectSiteDeviceDriver.setIs_force(0);
} }
//放货完成 //放货完成
//(Itype=1/2/3,需要WCS反馈) //(Itype=1/2/3,需要WCS反馈)
@@ -580,13 +580,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing("to_command", "0"); standardInspectSiteDeviceDriver.writing("to_command", "0");
if ((standardInspectSiteDeviceDriver.getMove() == 1)||standardInspectSiteDeviceDriver.getIs_force()==1) { if ((standardInspectSiteDeviceDriver.getMove() == 1) || standardInspectSiteDeviceDriver.getIs_force() == 1) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
standardInspectSiteDeviceDriver.setIs_force(0);
} else { } else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} }
standardInspectSiteDeviceDriver.setIs_force(0);
} }
//到达放货点 //到达放货点
//Itype=1、3,需要WCS反馈 //Itype=1、3,需要WCS反馈