From 947cc3b45bdf22ab33479aa9f8618423c4c0c6b9 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Fri, 6 Jan 2023 17:05:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 130 +++++++++++++----- .../ItemProtocol.java | 8 +- .../StandardInspectSiteSmartDeviceDriver.java | 2 +- 3 files changed, 100 insertions(+), 40 deletions(-) diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index 7c7f625..ab8f152 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -929,13 +929,15 @@ public class AgvServiceImpl implements AgvService { //请求取货 if ("Load".equals(action)) { if(standardInspectSiteSmartDeviceDriver.getMode()>0 - && standardInspectSiteSmartDeviceDriver.getAction() == 3 && standardInspectSiteSmartDeviceDriver.getError()==0){ + && ( standardInspectSiteSmartDeviceDriver.getAction() == 3 || standardInspectSiteSmartDeviceDriver.getAction() == 1 ) + && standardInspectSiteSmartDeviceDriver.getError()==0){ is_feedback = true; } //请求放货 } else if ("Unload".equals(action)) { if(standardInspectSiteSmartDeviceDriver.getMode()>0 - && standardInspectSiteSmartDeviceDriver.getAction() == 3 && standardInspectSiteSmartDeviceDriver.getError()==0){ + && (standardInspectSiteSmartDeviceDriver.getAction() == 3 || standardInspectSiteSmartDeviceDriver.getAction() == 2 ) + && standardInspectSiteSmartDeviceDriver.getError()==0){ is_feedback = true; } } @@ -981,46 +983,51 @@ public class AgvServiceImpl implements AgvService { String apply_task = addressdevice.getExtraValue().get("apply_task").toString(); //取货完成 if ("Load".equals(action)) { + standardInspectSiteSmartDeviceDriver.setFlag(2); + is_feedback = true; + //如果开启呼叫按钮,那么就需要判断进出动作信号 - if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) { - if (standardInspectSiteSmartDeviceDriver.getMode() != 0 - //&& standardInspectSiteSmartDeviceDriver.getMove() == 0 - && standardInspectSiteSmartDeviceDriver.getAction() == 3 - && standardInspectSiteSmartDeviceDriver.getIo_action() == 3) { - inst.setExecute_device_code(processingVehicle); - inst.setExecute_status("2"); - standardInspectSiteSmartDeviceDriver.writing(2); - is_feedback = true; - } - } else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 - // && standardInspectSiteSmartDeviceDriver.getMove() == 0 - ) { - inst.setExecute_device_code(processingVehicle); - inst.setExecute_status("2"); - standardInspectSiteSmartDeviceDriver.writing(2); - is_feedback = true; - } +// if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) { +// if (standardInspectSiteSmartDeviceDriver.getMode() != 0 +// //&& standardInspectSiteSmartDeviceDriver.getMove() == 0 +// && standardInspectSiteSmartDeviceDriver.getAction() == 3 +// && standardInspectSiteSmartDeviceDriver.getIo_action() == 3) { +// inst.setExecute_device_code(processingVehicle); +// inst.setExecute_status("2"); +// standardInspectSiteSmartDeviceDriver.writing(2); +// is_feedback = true; +// } +// } else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 +// // && standardInspectSiteSmartDeviceDriver.getMove() == 0 +// ) { +// inst.setExecute_device_code(processingVehicle); +// inst.setExecute_status("2"); +// standardInspectSiteSmartDeviceDriver.writing(2); +// is_feedback = true; +// } //放货完成 } else if ("Unload".equals(action)) { + standardInspectSiteSmartDeviceDriver.setFlag(4); + is_feedback = true; - if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) { - if (standardInspectSiteSmartDeviceDriver.getMode() != 0 - // && standardInspectSiteSmartDeviceDriver.getMove() > 0 - && standardInspectSiteSmartDeviceDriver.getAction() == 3 - && standardInspectSiteSmartDeviceDriver.getIo_action() == 3) { - inst.setExecute_device_code(address); - inst.setExecute_status("4"); - standardInspectSiteSmartDeviceDriver.writing(3); - is_feedback = true; - } - } else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 - //&& standardInspectSiteSmartDeviceDriver.getMove() > 0 - ) { - inst.setExecute_device_code(address); - inst.setExecute_status("4"); - standardInspectSiteSmartDeviceDriver.writing(3); - is_feedback = true; - } +// if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) { +// if (standardInspectSiteSmartDeviceDriver.getMode() != 0 +// // && standardInspectSiteSmartDeviceDriver.getMove() > 0 +// && standardInspectSiteSmartDeviceDriver.getAction() == 3 +// && standardInspectSiteSmartDeviceDriver.getIo_action() == 3) { +// inst.setExecute_device_code(address); +// inst.setExecute_status("4"); +// standardInspectSiteSmartDeviceDriver.writing(3); +// is_feedback = true; +// } +// } else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 +// //&& standardInspectSiteSmartDeviceDriver.getMove() > 0 +// ) { +// inst.setExecute_device_code(address); +// inst.setExecute_status("4"); +// standardInspectSiteSmartDeviceDriver.writing(3); +// is_feedback = true; +// } } } @@ -1369,6 +1376,7 @@ public class AgvServiceImpl implements AgvService { Device addressdevice = appService.findDeviceByCode(address); StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; + StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver; StandardStorageDeviceDriver standardStorageDeviceDriver; //mes = AgvClientXZ.mes(zlbh, device, type); //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 @@ -1413,6 +1421,52 @@ public class AgvServiceImpl implements AgvService { } } + if (addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) { + standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) addressdevice.getDeviceDriver(); + String apply_task = addressdevice.getExtraValue().get("apply_task").toString(); + + //取货完成请求离开 + if (standardInspectSiteSmartDeviceDriver.getFlag() == 2) { + //如果开启呼叫按钮,那么就需要判断进出动作信号 + if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) { + if (standardInspectSiteSmartDeviceDriver.getMode() != 0 + //&& standardInspectSiteSmartDeviceDriver.getMove() == 0 + && standardInspectSiteSmartDeviceDriver.getAction() == 3 + && standardInspectSiteSmartDeviceDriver.getIo_action() == 3) { + + standardInspectSiteSmartDeviceDriver.writing(2); + flag = true; + } + } else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 + // && standardInspectSiteSmartDeviceDriver.getMove() == 0 + ) { + + standardInspectSiteSmartDeviceDriver.writing(2); + flag = true; + } + } + //放货完成请求离开 + if (standardInspectSiteSmartDeviceDriver.getFlag() == 4) { + //如果开启呼叫按钮,那么就需要判断进出动作信号 + if (ObjectUtil.isNotEmpty(apply_task) && apply_task.equals("true")) { + if (standardInspectSiteSmartDeviceDriver.getMode() != 0 + //&& standardInspectSiteSmartDeviceDriver.getMove() == 0 + && standardInspectSiteSmartDeviceDriver.getAction() == 3 + && standardInspectSiteSmartDeviceDriver.getIo_action() == 3) { + + standardInspectSiteSmartDeviceDriver.writing(2); + flag = true; + } + } else if (standardInspectSiteSmartDeviceDriver.getMode() != 0 + // && standardInspectSiteSmartDeviceDriver.getMove() == 0 + ) { + + standardInspectSiteSmartDeviceDriver.writing(2); + flag = true; + } + } + } + if (flag) { log.info("AGV请求离开,反馈成功:{}", address); System.out.println("AGV请求离开,反馈成功 " + address); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java index 2e49e2e..327f7a0 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java @@ -95,7 +95,7 @@ public class ItemProtocol { list.add(new ItemDto(item_mode, "工作状态", "VW2", Boolean.valueOf(true))); list.add(new ItemDto(item_move, "光电开关信号", "VW4")); list.add(new ItemDto(item_action, "动作信号", "VW6")); - list.add(new ItemDto(item_ioaction, "进出信号", "VW8")); +// list.add(new ItemDto(item_ioaction, "进出信号", "VW8")); list.add(new ItemDto(item_error, "报警信号", "VW12")); list.add(new ItemDto(item_task, "任务号", "VD14")); return list; @@ -109,5 +109,11 @@ public class ItemProtocol { return list; } + @Override + public String toString() { + return ""; + } + + } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java index a3ea0e3..9d13f33 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java @@ -167,7 +167,7 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive error = this.itemProtocol.getError(); move = this.itemProtocol.getMove(); action = this.itemProtocol.getAction(); - io_action = this.itemProtocol.getIo_action(); + //io_action = this.itemProtocol.getIo_action(); task = this.itemProtocol.getTask(); hasGoods = this.itemProtocol.getMove();