From 95819b550da2ed857339c873ff74216ddf399ce5 Mon Sep 17 00:00:00 2001 From: zhengxuming Date: Tue, 26 Aug 2025 20:33:46 +0800 Subject: [PATCH] =?UTF-8?q?add:=E4=BA=A7=E7=BA=BF=E6=8E=A5=E9=A9=B3?= =?UTF-8?q?=E5=8F=B0=E3=80=81=E6=8B=86=E5=B0=81=E7=9B=96=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E4=BD=8D=E9=A9=B1=E5=8A=A8=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 391 ++++++++++++++++++ 1 file changed, 391 insertions(+) diff --git a/acs/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndcone/AgvNdcOneDeviceDriver.java index 774f05f..f03dd8f 100644 --- a/acs/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -16,6 +16,8 @@ import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.agv.utils.OneAgvPhase; import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.driver.AbstractDeviceDriver; +import org.nl.acs.device_driver.zz_driver.production_line_docking_station.ProductionLineDockingStationDeviceDriver; +import org.nl.acs.device_driver.zz_driver.remove_seal_cover_position.RemoveSealCoverPositionDriver; import org.nl.acs.device_driver.zz_driver.unpacking_conveyor.UnpackingConveyorDeviceDriver; import org.nl.acs.device_driver.zz_driver.unpacking_machine.UnpackingMachineDeviceDriver; import org.nl.acs.ext.wms.data.ApplyPlugPullSitResponse; @@ -157,6 +159,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; UnpackingMachineDeviceDriver unpackingMachineDeviceDriver; UnpackingConveyorDeviceDriver unpackingConveyorDeviceDriver; + ProductionLineDockingStationDeviceDriver productionLineDockingStationDeviceDriver; + RemoveSealCoverPositionDriver removeSealCoverPositionDriver; //分配 车id //(不需要WCS反馈) @@ -269,6 +273,66 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } } + //产线接驳台 + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 1); + try { + productionLineDockingStationDeviceDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (productionLineDockingStationDeviceDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 1); + try { + removeSealCoverPositionDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (removeSealCoverPositionDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + + //取货完毕 //(需要WCS反馈) @@ -356,6 +420,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } } + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 2); + try { + productionLineDockingStationDeviceDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 2); + try { + removeSealCoverPositionDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + } if (ObjectUtil.isNotEmpty(data)) { logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); @@ -459,6 +561,64 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } } + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 3); + try { + productionLineDockingStationDeviceDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (productionLineDockingStationDeviceDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 3); + try { + removeSealCoverPositionDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (removeSealCoverPositionDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } //放货完毕 //(需要WCS反馈) @@ -540,6 +700,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } } + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 4); + try { + productionLineDockingStationDeviceDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 4); + try { + removeSealCoverPositionDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + } } // 到达取货2 @@ -638,6 +836,64 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } } + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 1); + try { + productionLineDockingStationDeviceDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (productionLineDockingStationDeviceDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 1); + try { + removeSealCoverPositionDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (removeSealCoverPositionDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } // 取货完毕2 else if (phase == 0x0E) { @@ -720,6 +976,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } } + + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 2); + try { + productionLineDockingStationDeviceDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 2); + try { + removeSealCoverPositionDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } } // 到达放货2 else if (phase == 0x10) { @@ -817,6 +1111,65 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } + + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 3); + try { + productionLineDockingStationDeviceDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (productionLineDockingStationDeviceDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + productionLineDockingStationDeviceDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 请求进入 + Map map = new HashMap<>(); + map.put("to_command", 3); + try { + removeSealCoverPositionDriver.writing(map); + } catch (Exception e) { + e.printStackTrace(); + } + if (removeSealCoverPositionDriver.getAction() == 1) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + removeSealCoverPositionDriver.getAction() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } // 放货完毕2 else if (phase == 0x12) { @@ -888,6 +1241,44 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } } + if (device.getDeviceDriver() instanceof ProductionLineDockingStationDeviceDriver) { + productionLineDockingStationDeviceDriver = (ProductionLineDockingStationDeviceDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 4); + try { + productionLineDockingStationDeviceDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (device.getDeviceDriver() instanceof RemoveSealCoverPositionDriver) { + removeSealCoverPositionDriver = (RemoveSealCoverPositionDriver) device.getDeviceDriver(); + // 取货完毕 + Map map = new HashMap<>(); + map.put("to_command", 4); + try { + removeSealCoverPositionDriver.writing(map); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } catch (Exception e) { + e.printStackTrace(); + } + } + } }