From 97165bc085430cd4cec9a118254cae22ab8e1f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BF=8A=E6=9D=B0?= <9463626+zhou-junjiezjj@user.noreply.gitee.com> Date: Mon, 10 Jul 2023 15:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=94=BE=E8=B4=A7=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 36 ++++++++++++++++++- .../standard_inspect_site/ItemProtocol.java | 9 +++-- .../StandardInspectSiteDefination.java | 5 +-- .../StandardInspectSiteDeviceDriver.java | 1 + .../quartz/task/QueryAgvTaskStatus.java | 2 +- 5 files changed, 47 insertions(+), 6 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 7419887..dc9bde7 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 @@ -22,6 +22,7 @@ import org.nl.acs.device_driver.ndxy_special_two.NdxySpecialTwoDeviceDriver; import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; +import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_manipulator_stacking_site.StandardManipulatorStackingSiteDeviceDriver; import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; @@ -859,10 +860,11 @@ public class AgvServiceImpl implements AgvService { Instruction inst = instructionService.findByCodeFromCache(jobno); TaskDto task = taskService.findByCode(inst.getTask_code()); - DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device addressdevice = appService.findDeviceByCode(address); StandardManipulatorStackingSiteDeviceDriver standardManipulatorStackingSiteDeviceDriver; + StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; //取货的进入前等待和离开等待 if (action.equals("Load")) { if ("EntryRequired".equals(type)) { @@ -879,6 +881,14 @@ public class AgvServiceImpl implements AgvService { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { is_feedback = true; } + if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver){ + standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); + if(standardInspectSiteDeviceDriver.getMove()==1&&standardInspectSiteDeviceDriver.getAction()==1){ + is_feedback = true; + }else { + log.info("设备{} 请求取货,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove()); + } + } } if ("PauseOnStation".equals(type)) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { @@ -892,6 +902,14 @@ public class AgvServiceImpl implements AgvService { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { is_feedback = true; } + if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ + standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); + if(standardInspectSiteDeviceDriver.getMove()==0){ + is_feedback = true; + }else { + log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove()); + } + } } } @@ -909,6 +927,14 @@ public class AgvServiceImpl implements AgvService { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { is_feedback = true; } + if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ + standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); + if(standardInspectSiteDeviceDriver.getMove()==0&&standardInspectSiteDeviceDriver.getAction()==2){ + is_feedback = true; + }else { + log.info("设备{} 请求放货,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove()); + } + } } if ("PauseOnStation".equals(type)) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { @@ -922,6 +948,14 @@ public class AgvServiceImpl implements AgvService { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { is_feedback = true; } + if(addressdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ + standardInspectSiteDeviceDriver=(StandardInspectSiteDeviceDriver) addressdevice.getDeviceDriver(); + if(standardInspectSiteDeviceDriver.getMove()==1){ + is_feedback = true; + }else { + log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardInspectSiteDeviceDriver.getMove()); + } + } } } com.alibaba.fastjson.JSONObject requestjo = new com.alibaba.fastjson.JSONObject(); diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java index f2a74eb..16850ab 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java @@ -14,6 +14,7 @@ public class ItemProtocol { public static String item_heartbeat = "heartbeat"; public static String item_mode = "mode"; public static String item_move = "move"; + public static String item_action = "action"; public static String item_ioaction = "ioaction"; public static String item_error = "error"; public static String item_task = "task"; @@ -22,6 +23,7 @@ public class ItemProtocol { public static String item_to_task = "to_task"; public static String item_weight = "weight"; + private StandardInspectSiteDeviceDriver driver; public ItemProtocol(StandardInspectSiteDeviceDriver driver) { @@ -36,6 +38,8 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_mode); } + public int getAction(){return this.getOpcIntegerValue(item_action);} + public int getMove() { return this.getOpcIntegerValue(item_move); } @@ -89,8 +93,9 @@ public class ItemProtocol { list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0")); list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true))); list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3")); - list.add(new ItemDto(item_error, "报警信号", "DB600.B7")); - list.add(new ItemDto(item_task, "任务号", "DB600.D10")); + list.add(new ItemDto(item_action,"取放信号","DB600,B4")); + list.add(new ItemDto(item_error, "报警信号", "DB600.B5")); + list.add(new ItemDto(item_task, "任务号", "DB600.D6")); return list; } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java index 2865d8d..b7a9318 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDefination.java @@ -60,8 +60,9 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B2", true)); list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B3")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B7")); - list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D10")); + list.add(new ItemDto(ItemProtocol.item_action,"取放信号","DB600,B4")); + list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B5")); + list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D6")); return list; } diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java index 917354f..0602074 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -66,6 +66,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp int mode = 0; int error = 0; int move = 0; + int action=0; int task = 0; int last_mode = 0; int last_error = 0; diff --git a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryAgvTaskStatus.java b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryAgvTaskStatus.java index 0310051..175f193 100644 --- a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryAgvTaskStatus.java +++ b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryAgvTaskStatus.java @@ -33,7 +33,7 @@ public class QueryAgvTaskStatus { JSONArray inst_rows = JSONArray.parseArray(response.body()); for (int i = 0; i < inst_rows.size(); i++) { JSONObject inst_jo = inst_rows.getJSONObject(i); - String inst_code = inst_jo.getString("task_code"); + String inst_code = inst_jo.getString("taskCode"); Instruction inst = instructionService.findByCodeFromCache(inst_code); if (ObjectUtil.isEmpty(inst)) { continue;