|
@ -86,6 +86,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
int last_error = 0; |
|
|
int last_error = 0; |
|
|
String error_message = ""; |
|
|
String error_message = ""; |
|
|
boolean flag = false; |
|
|
boolean flag = false; |
|
|
|
|
|
|
|
|
|
|
|
String agv_message =""; |
|
|
private synchronized void setErrorInfo(int error, String error_code, String error_message) { |
|
|
private synchronized void setErrorInfo(int error, String error_code, String error_message) { |
|
|
this.error = error; |
|
|
this.error = error; |
|
|
this.error_code = error_code; |
|
|
this.error_code = error_code; |
|
@ -208,6 +210,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
//校验agv上报站点编号与指令起始点相同
|
|
|
//校验agv上报站点编号与指令起始点相同
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
log.info("未找到编号{}对应的指令", ikey); |
|
|
log.info("未找到编号{}对应的指令", ikey); |
|
|
|
|
|
agv_message = "未找到编号"+ikey +"对应的指令"; |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "未找到关联编号对应的指令" + ikey); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -241,6 +244,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货。"; |
|
|
message += "不允许AGV取货。"; |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -274,6 +278,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货。"; |
|
|
message += "不允许AGV取货。"; |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -305,6 +310,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货。"; |
|
|
message += "不允许AGV取货。"; |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -332,8 +338,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
conveyorBarcodeDeviceDriver.writing(3); |
|
|
conveyorBarcodeDeviceDriver.writing(3); |
|
|
if (conveyorBarcodeDeviceDriver.getMode() != 0 |
|
|
if (conveyorBarcodeDeviceDriver.getMode() != 0 |
|
|
&& conveyorBarcodeDeviceDriver.getMove() != 0 |
|
|
&& conveyorBarcodeDeviceDriver.getMove() != 0 |
|
|
&& (conveyorBarcodeDeviceDriver.getIo_action() == 3 || conveyorBarcodeDeviceDriver.getIo_action() == 1) |
|
|
) { |
|
|
&& (conveyorBarcodeDeviceDriver.getAction() == 3 || conveyorBarcodeDeviceDriver.getAction() == 1)) { |
|
|
|
|
|
inst.setExecute_status("1"); |
|
|
inst.setExecute_status("1"); |
|
|
instructionService.update(inst); |
|
|
instructionService.update(inst); |
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
@ -347,15 +352,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
if (conveyorBarcodeDeviceDriver.getMove() == 0) { |
|
|
if (conveyorBarcodeDeviceDriver.getMove() == 0) { |
|
|
message += "站点无货,"; |
|
|
message += "站点无货,"; |
|
|
} |
|
|
} |
|
|
if (conveyorBarcodeDeviceDriver.getIo_action() != 3 && conveyorBarcodeDeviceDriver.getIo_action() != 1) { |
|
|
|
|
|
message += "站点不允许进入,"; |
|
|
|
|
|
} |
|
|
|
|
|
if (conveyorBarcodeDeviceDriver.getAction() != 3 && conveyorBarcodeDeviceDriver.getAction() != 1) { |
|
|
|
|
|
message += "站点不允许取货,"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货。"; |
|
|
message += "不允许AGV取货。"; |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -388,6 +388,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
// }
|
|
|
// }
|
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货。"; |
|
|
message += "不允许AGV取货。"; |
|
|
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
@ -476,6 +477,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货后离开。"; |
|
|
message += "不允许AGV取货后离开。"; |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -506,6 +508,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货后离开。"; |
|
|
message += "不允许AGV取货后离开。"; |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -536,6 +539,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货后离开。"; |
|
|
message += "不允许AGV取货后离开。"; |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -559,10 +563,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){ |
|
|
if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){ |
|
|
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver(); |
|
|
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver(); |
|
|
conveyorBarcodeDeviceDriver.writing(5); |
|
|
conveyorBarcodeDeviceDriver.writing(5); |
|
|
if (conveyorBarcodeDeviceDriver.getMode() != 0 |
|
|
if (conveyorBarcodeDeviceDriver.getMode() != 0) { |
|
|
&& conveyorBarcodeDeviceDriver.getMove() != 0 |
|
|
|
|
|
&& (conveyorBarcodeDeviceDriver.getIo_action() == 3 || conveyorBarcodeDeviceDriver.getIo_action() == 2) |
|
|
|
|
|
) { |
|
|
|
|
|
inst.setExecute_status("5"); |
|
|
inst.setExecute_status("5"); |
|
|
instructionService.update(inst); |
|
|
instructionService.update(inst); |
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
|
data = AgvService.sendAgvOneModeInst(phase, index, 0); |
|
@ -582,6 +583,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货后离开。"; |
|
|
message += "不允许AGV取货后离开。"; |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -612,6 +614,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV取货后离开。"; |
|
|
message += "不允许AGV取货后离开。"; |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -633,22 +636,22 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
if (ObjectUtil.isNotEmpty(data)) { |
|
|
if (ObjectUtil.isNotEmpty(data)) { |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); |
|
|
} |
|
|
} |
|
|
if (flag) { |
|
|
// if (flag) {
|
|
|
String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); |
|
|
// String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue();
|
|
|
if (!StrUtil.startWith(inst.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { |
|
|
// if (!StrUtil.startWith(inst.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
|
|
try { |
|
|
// try {
|
|
|
JSONArray ar = new JSONArray(); |
|
|
// JSONArray ar = new JSONArray();
|
|
|
JSONObject param = new JSONObject(); |
|
|
// JSONObject param = new JSONObject();
|
|
|
param.put("task_code", inst.getTask_code()); |
|
|
// param.put("task_code", inst.getTask_code());
|
|
|
param.put("task_status", "4"); |
|
|
// param.put("task_status", "4");
|
|
|
ar.add(param); |
|
|
// ar.add(param);
|
|
|
acsToWmsService.feedbackTaskStatusToWms(ar); |
|
|
// acsToWmsService.feedbackTaskStatusToWms(ar);
|
|
|
} catch (Exception e) { |
|
|
// } catch (Exception e) {
|
|
|
logServer.deviceExecuteLog(device_code, "", "", "AGV取货完成离开后,反馈上位系统失败!"); |
|
|
// logServer.deviceExecuteLog(device_code, "", "", "AGV取货完成离开后,反馈上位系统失败!");
|
|
|
e.printStackTrace(); |
|
|
// e.printStackTrace();
|
|
|
} |
|
|
// }
|
|
|
} |
|
|
// }
|
|
|
} |
|
|
// }
|
|
|
if (flag) { |
|
|
if (flag) { |
|
|
log.info("================允许AGV取货后离开================="); |
|
|
log.info("================允许AGV取货后离开================="); |
|
|
logServer.deviceExecuteLog(device_code, "", "", "允许AGV取货后离开。"); |
|
|
logServer.deviceExecuteLog(device_code, "", "", "允许AGV取货后离开。"); |
|
@ -721,6 +724,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货。"; |
|
|
message += "不允许AGV放货。"; |
|
|
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
@ -755,6 +759,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货。"; |
|
|
message += "不允许AGV放货。"; |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -788,6 +793,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货。"; |
|
|
message += "不允许AGV放货。"; |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -829,6 +835,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货。"; |
|
|
message += "不允许AGV放货。"; |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -863,6 +870,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货。"; |
|
|
message += "不允许AGV放货。"; |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -950,6 +958,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货后离开。"; |
|
|
message += "不允许AGV放货后离开。"; |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
lnshPalletizingManipulatorSiteDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshPalletizingManipulatorSiteDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -979,6 +988,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货后离开。"; |
|
|
message += "不允许AGV放货后离开。"; |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
lnshStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -1023,6 +1033,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货后离开。"; |
|
|
message += "不允许AGV放货后离开。"; |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
conveyorPressStationDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = conveyorPressStationDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -1064,11 +1075,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
if (conveyorBarcodeDeviceDriver.getMove() == 0) { |
|
|
if (conveyorBarcodeDeviceDriver.getMove() == 0) { |
|
|
message += "站点无货,"; |
|
|
message += "站点无货,"; |
|
|
} |
|
|
} |
|
|
if (conveyorBarcodeDeviceDriver.getIo_action() != 2 && conveyorBarcodeDeviceDriver.getIo_action() != 3) { |
|
|
|
|
|
message += "站点不允许离开,"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货后离开。"; |
|
|
message += "不允许AGV放货后离开。"; |
|
|
|
|
|
agv_message = conveyorBarcodeDeviceDriver.getDevice_code() + message; |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
conveyorBarcodeDeviceDriver.setMessage(message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
@ -1100,6 +1109,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic |
|
|
} |
|
|
} |
|
|
message += "不允许AGV放货后离开。"; |
|
|
message += "不允许AGV放货后离开。"; |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
lnshFoldDiscSiteDeviceDriver.setMessage(message); |
|
|
|
|
|
agv_message = lnshFoldDiscSiteDeviceDriver.getDevice_code() + message; |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
logServer.deviceExecuteLog(device_code, "", "", message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|