From ca633ff27daa2754e5bc40f73982bd9d09f9fe8c Mon Sep 17 00:00:00 2001 From: yanps Date: Tue, 23 Apr 2024 17:19:49 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E5=8F=8D=E9=A6=88LMS?= =?UTF-8?q?=E7=83=98=E7=AE=B1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PullHeadManipulatorDeviceDriver.java | 85 +++++++++++++------ .../wms/service/impl/WmsToAcsServiceImpl.java | 21 +++++ 2 files changed, 82 insertions(+), 24 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 82da1d99d..f266482b0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -360,7 +360,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } String startAddr = startDevice.getExtraValue().get("address").toString(); String nextAddr = nextDevice.getExtraValue().get("address").toString(); - /*String interaction_json = taskDto.getInteraction_json(); + String interaction_json = taskDto.getInteraction_json(); JSONObject jsonObject = JSONObject.parseObject(interaction_json); //套管1物料 Object to_material1 = jsonObject.get("left"); @@ -390,14 +390,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp //套管数量 Object to_qty1 = jsonObject.get("casingCount"); //拔管数量 - Object to_qty2 = jsonObject.get("pullCount");*/ + Object to_qty2 = jsonObject.get("pullCount"); Map map = new LinkedHashMap<>(); map.put("to_command", CommonFinalParam.ONE); map.put("to_onset", startAddr); map.put("to_task", instruction.getInstruction_code()); map.put("to_target", nextAddr); - toTranscription(taskDto,map); - /*map.put("to_material1", to_material1); + //toTranscription(taskDto,map); + map.put("to_material1", to_material1); if (ObjectUtil.isNotEmpty(to_material2)) { map.put("to_material2", to_material2); } @@ -422,7 +422,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp map.put("to_spec4", to_spec4); } map.put("to_qty1", to_qty1); - map.put("to_qty2", to_qty2);*/ + map.put("to_qty2", to_qty2); this.writing(map); this.setRequireSucess(true); return true; @@ -499,32 +499,69 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp } String startAddr = startDevice.getExtraValue().get("address").toString(); String nextAddr = nextDevice.getExtraValue().get("address").toString(); - /*String interactionJson = task.getInteraction_json(); - JSONObject jsonObject = JSONObject.parseObject(interactionJson); - //所需纸管信息(左边) - Object left = jsonObject.get("left"); - //所需纸管信息(右边) - Object right = jsonObject.get("right"); - //当前纸管信息(左边) - Object currentLeft = jsonObject.get("currentLeft"); - //当前纸管信息(右边) - Object currentRight = jsonObject.get("currentRight"); + String interaction_json = task.getInteraction_json(); + JSONObject jsonObject = JSONObject.parseObject(interaction_json); + //套管1物料 + Object to_material1 = jsonObject.get("left"); + //套管2物料 + Object to_material2 = jsonObject.get("right"); + //套管1规格 + Object to_spec1 = jsonObject.get("leftSpec"); + //套管2规格 + Object to_spec2 = jsonObject.get("rightSpec"); + //套管1尺寸 + Object to_size1 = jsonObject.get("leftSize"); + //套管2尺寸 + Object to_size2 = jsonObject.get("rightSize"); + //拔管1物料 + Object to_material3 = jsonObject.get("currentLeft"); + //拔管2物料 + Object to_material4 = jsonObject.get("currentRight"); + //拔管1尺寸 + Object to_size3 = jsonObject.get("currentLeftSize"); + //拔管2尺寸 + Object to_size4 = jsonObject.get("currentRightSize"); + //拔管1规格 + Object to_spec3 = jsonObject.get("currentLeftSpec"); + //拔管2规格 + Object to_spec4 = jsonObject.get("currentRightSpec"); + //套管数量 - Object casingCount = jsonObject.get("casingCount"); + Object to_qty1 = jsonObject.get("casingCount"); //拔管数量 - Object pullCount = jsonObject.get("pullCount");*/ + Object to_qty2 = jsonObject.get("pullCount"); Map map = new LinkedHashMap<>(); map.put("to_command", CommonFinalParam.ONE); map.put("to_onset", startAddr); map.put("to_task", instdto.getInstruction_code()); map.put("to_target", nextAddr); - toTranscription(task,map); - /*map.put("left", left); - map.put("right", right); - map.put("currentLeft", currentLeft); - map.put("currentRight", currentRight); - map.put("casingCount", casingCount); - map.put("pullCount", pullCount);*/ + //toTranscription(taskDto,map); + map.put("to_material1", to_material1); + if (ObjectUtil.isNotEmpty(to_material2)) { + map.put("to_material2", to_material2); + } + map.put("to_spec1", to_spec1); + if (ObjectUtil.isNotEmpty(to_spec2)) { + map.put("to_spec2", to_spec2); + } + map.put("to_size1", to_size1); + if (ObjectUtil.isNotEmpty(to_size2)) { + map.put("to_size2", to_size2); + } + map.put("to_material3", to_material3); + if (ObjectUtil.isNotEmpty(to_material4)) { + map.put("to_material4", to_material4); + } + map.put("to_size3", to_size3); + if (ObjectUtil.isNotEmpty(to_size4)) { + map.put("to_size4", to_size4); + } + map.put("to_spec3", to_spec3); + if (ObjectUtil.isNotEmpty(to_spec4)) { + map.put("to_spec4", to_spec4); + } + map.put("to_qty1", to_qty1); + map.put("to_qty2", to_qty2); this.writing(map); this.setRequireSucess(true); notCreateInstMessage = ""; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index bacf82a46..32d80efdc 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -23,6 +23,7 @@ import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletiz import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver; import org.nl.acs.device_driver.two_conveyor.blank_manipulator.BlankManipulatorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver; +import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.inflatable_shaft_library.InflatableShaftLibraryDeviceDriver; import org.nl.acs.device_driver.two_conveyor.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver; @@ -605,6 +606,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { BlankManipulatorDeviceDriver blankManipulatorDeviceDriver; //烘箱行架机械手 OvenGantryManipulatorDeviceDriver ovenGantryManipulatorDeviceDriver; + //烘箱 + HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; //装箱行架机械手 BoxPackageManipulatorDeviceDriver boxManipulatorDeviceDriver; //木箱码垛机械手 @@ -647,6 +650,24 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("action", Math.min(3, blankManipulatorDeviceDriver.getAction())); jo.put("task", Math.min(3, blankManipulatorDeviceDriver.getTask())); jo.put("error", blankManipulatorDeviceDriver.getError()); + }else if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { + hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); + jo.put("device_code", parent_device_code); + jo.put("mode", hongXiangConveyorDeviceDriver.getMode()); + jo.put("status", Math.min(3, hongXiangConveyorDeviceDriver.getMode())); + jo.put("move", hongXiangConveyorDeviceDriver.getMove()); + jo.put("countdown_house", hongXiangConveyorDeviceDriver.getCountdown_house()); + jo.put("countdown_min", hongXiangConveyorDeviceDriver.getCountdown_min()); + jo.put("countdown_sec", hongXiangConveyorDeviceDriver.getCountdown_sec()); + //温度需要除以10 + jo.put("temperature", hongXiangConveyorDeviceDriver.getTo_temperature() / 10); + jo.put("now_temperature", hongXiangConveyorDeviceDriver.getTemperature() / 10); + + jo.put("door", hongXiangConveyorDeviceDriver.getDoor()); + jo.put("finish", hongXiangConveyorDeviceDriver.getFinish()); + jo.put("task", hongXiangConveyorDeviceDriver.getTask()); + jo.put("error", hongXiangConveyorDeviceDriver.getError()); + jo.put("isError", hongXiangConveyorDeviceDriver.getError()); } else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { ovenGantryManipulatorDeviceDriver = (OvenGantryManipulatorDeviceDriver) device.getDeviceDriver(); jo.put("device_code", ovenGantryManipulatorDeviceDriver.getDevice().getDevice_code());