This commit is contained in:
USER-20220102CG\noblelift
2023-03-06 19:53:04 +08:00
parent 0342025afa
commit 4f4b94e611
3 changed files with 20 additions and 8 deletions

View File

@@ -256,8 +256,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
System.out.println("TwoAgv链接异常");
log.info("TwoAgv链接异常");
log.error("agv连接出现异常:{}", e);
// logServer.deviceExecuteLog("1","","","agv异常"+e.getMessage());
// logServer.deviceExecuteLog("1","","","agv异常" + e);
if(ObjectUtil.isNotEmpty(s)){
s.close();
}

View File

@@ -86,7 +86,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
TaskDto task = null;
if (ikey != 0) {
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
if(ObjectUtil.isEmpty(inst)){
log.info("该指令号未找到对应指令:"+ikey);
logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应指令:"+ikey);
return;
}
task = taskService.findByTaskCode(inst.getTask_code());
if(ObjectUtil.isEmpty(task)){
log.info("该指令号未找到对应任务:"+ikey);
logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应任务:"+ikey);
return;
}
}
@@ -176,9 +186,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if(standardOrdinarySiteDeviceDriver.getOption() == 1){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("等待LMS系统进行确认允许取货设备号{}", device_code);
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code());
log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code,ikey);
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code()+",指令号"+ikey);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -195,7 +204,10 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
standardInspectSiteDeviceDriver.writing("to_command","1");
if(standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("设备{}当前光电信号{},动作信号{},不满足取货条件,指令号{}", device_code,standardInspectSiteDeviceDriver.getMove(),standardInspectSiteDeviceDriver.getAction(),ikey);
}
}
else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -257,6 +269,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
standardInspectSiteDeviceDriver.writing("to_command","0");
if(standardInspectSiteDeviceDriver.getMove() == 0 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("设备{}当前光电信号{},动作信号{},不满足取货条件", device_code,standardInspectSiteDeviceDriver.getMove());
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -303,7 +317,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if(standardOrdinarySiteDeviceDriver.getOption() == 1 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("等待LMS系统进行确认允许取货设备号{}", device_code);
log.info("等待LMS系统进行确认允许取货设备号{},指令号{}", device_code,ikey);
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code());
}

View File

@@ -401,7 +401,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
// hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
if(StrUtil.startWith(taskDto.getTask_code(), "-")){
if(!StrUtil.startWith(taskDto.getTask_code(), "-")){
if(ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("link_three_lamp"))){
String lamp = nextDevice.getExtraValue().get("link_three_lamp").toString();
Device lampDevice = deviceAppService.findDeviceByCode(lamp);
@@ -410,7 +410,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
if (lampDevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lampDevice.getDeviceDriver();
logServer.deviceExecuteLog(this.device_code, "", "", "下发报警灯"+ lamp +"报警信号");
logServer.deviceExecuteLog(lampDevice.getDeviceDriver().getDeviceCode(), "", "", "下发报警灯"+ lamp +"报警信号");
lampThreecolorDeviceDriver.writing("to_command","1");
}
}