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