diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceDriverDefinationAppService.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceDriverDefinitionAppService.java similarity index 52% rename from acs/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceDriverDefinationAppService.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceDriverDefinitionAppService.java index c1668e0..0f3dcba 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceDriverDefinationAppService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/DeviceDriverDefinitionAppService.java @@ -1,19 +1,19 @@ package org.nl.acs.device.service; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.DeviceType; import java.util.List; -public interface DeviceDriverDefinationAppService { +public interface DeviceDriverDefinitionAppService { List getDeviceDriverCodes(); - DeviceDriverDefination getDeviceDriverDefination(String driverCode); + DeviceDriverDefinition getDeviceDriverDefinition(String driverCode); - List getDeviceDriverDefinations(); + List getDeviceDriverDefinitions(); - List getDeviceDriverDefinations(DeviceType var1); + List getDeviceDriverDefinitions(DeviceType var1); boolean isRoute(Class var1); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index a50e0ed..f8fc729 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -20,7 +20,7 @@ import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.*; import org.nl.acs.device.service.dto.*; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.device_driver.ScannerDeviceDriver; import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; @@ -31,7 +31,7 @@ import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanne import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_scanner.StandardScannerDeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; @@ -73,7 +73,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial private final OpcService opcService; private final RedisUtils redisUtils; private final OpcPlcService opcPlcService; - private final DeviceDriverDefinationAppService deviceDriverDefinationAppService; + private final DeviceDriverDefinitionAppService deviceDriverDefinitionAppService; private final DeviceAppService deviceAppService; private final ParamService paramService; List storageCells = new ArrayList<>(); @@ -260,7 +260,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial log.info("设备删除成功!"); if (deviceByCode != null) { - if (StrUtil.equals("storage", deviceByCode.getDeviceDriverDefination().getFitDeviceTypes().get(0).name())) { + if (StrUtil.equals("storage", deviceByCode.getDeviceDriverDefinition().getFitDeviceTypes().get(0).name())) { storageTab.delete("substring_index( storage_code,'-',1)= '" + device_code + "'"); } else { @@ -1140,13 +1140,13 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial JSONObject result = new JSONObject(); //根据设备驱动定义获取OPC读写数据 - DeviceDriverDefination deviceDriverDefination = deviceDriverDefinationAppService.getDeviceDriverDefination(driver_code); - OpcDeviceDriverDefination opcDeviceDriverDefination = null; - if (deviceDriverDefination instanceof OpcDeviceDriverDefination) { - opcDeviceDriverDefination = (OpcDeviceDriverDefination) deviceDriverDefination; + DeviceDriverDefinition deviceDriverDefinition = deviceDriverDefinitionAppService.getDeviceDriverDefinition(driver_code); + OpcDeviceDriverDefinition opcDeviceDriverDefinition = null; + if (deviceDriverDefinition instanceof OpcDeviceDriverDefinition) { + opcDeviceDriverDefinition = (OpcDeviceDriverDefinition) deviceDriverDefinition; //处理DB读和写属性 - result.put("rs", opcDeviceDriverDefination.getReadableItemDtos()); - result.put("ws", opcDeviceDriverDefination.getWriteableItemDtos()); + result.put("rs", opcDeviceDriverDefinition.getReadableItemDTOs()); + result.put("ws", opcDeviceDriverDefinition.getWriteableItemDTOs()); } @@ -1204,8 +1204,8 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial JSONArray rs = WQLObject.getWQLObject("acs_device_extra").query("filed_type='02' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0); JSONArray r_arry = new JSONArray(); //先获取模板 - if (ObjectUtil.isNotEmpty(opcDeviceDriverDefination)) { - List readableItemDtos = opcDeviceDriverDefination.getReadableItemDtos(); + if (ObjectUtil.isNotEmpty(opcDeviceDriverDefinition)) { + List readableItemDtos = opcDeviceDriverDefinition.getReadableItemDTOs(); List readableItemJsons = new ArrayList<>(); for (int i = 0; i < readableItemDtos.size(); i++) { ItemDto itemDto = readableItemDtos.get(i); @@ -1251,7 +1251,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial } JSONArray ws = WQLObject.getWQLObject("acs_device_extra").query("filed_type='03' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0); JSONArray w_arry = new JSONArray(); - List writeableItemDtos = opcDeviceDriverDefination.getWriteableItemDtos(); + List writeableItemDtos = opcDeviceDriverDefinition.getWriteableItemDTOs(); List writeableItemJsons = new ArrayList<>(); for (int i = 0; i < writeableItemDtos.size(); i++) { ItemDto itemDto = writeableItemDtos.get(i); @@ -1593,12 +1593,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial //处理设备扩展属性 JSONObject result = new JSONObject(); //根据设备驱动定义获取OPC读写数据 - DeviceDriverDefination deviceDriverDefination = deviceDriverDefinationAppService.getDeviceDriverDefination(driver_code); - if (deviceDriverDefination instanceof OpcDeviceDriverDefination) { - OpcDeviceDriverDefination opcDeviceDriverDefination = (OpcDeviceDriverDefination) deviceDriverDefination; + DeviceDriverDefinition deviceDriverDefinition = deviceDriverDefinitionAppService.getDeviceDriverDefinition(driver_code); + if (deviceDriverDefinition instanceof OpcDeviceDriverDefinition) { + OpcDeviceDriverDefinition opcDeviceDriverDefinition = (OpcDeviceDriverDefinition) deviceDriverDefinition; //处理DB读和写属性 - result.put("rs", opcDeviceDriverDefination.getReadableItemDtos()); - result.put("ws", opcDeviceDriverDefination.getWriteableItemDtos()); + result.put("rs", opcDeviceDriverDefinition.getReadableItemDTOs()); + result.put("ws", opcDeviceDriverDefinition.getWriteableItemDTOs()); } return result; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriver.java index 3f702c5..6ecb16d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriver.java @@ -2,8 +2,6 @@ package org.nl.acs.device_driver; import org.nl.acs.opc.Device; -import java.util.List; - public interface DeviceDriver { default String getDeviceCode() { return this.getDevice().getDevice_code(); @@ -11,12 +9,12 @@ public interface DeviceDriver { Device getDevice(); - DeviceDriverDefination getDriverDefination(); + DeviceDriverDefinition getDriverDefinition(); - DeviceDriver setDriverDefination(DeviceDriverDefination var1); + DeviceDriver setDriverDefinition(DeviceDriverDefinition var1); - default String getDriverDefinationCode() { - return this.getDriverDefination().getDriverCode(); + default String getDriverDefinitionCode() { + return this.getDriverDefinition().getDriverCode(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriverDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriverDefinition.java similarity index 89% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriverDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriverDefinition.java index 8be0ab3..f340c2f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriverDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/DeviceDriverDefinition.java @@ -5,7 +5,7 @@ import org.nl.acs.opc.DeviceType; import java.util.List; -public interface DeviceDriverDefination { +public interface DeviceDriverDefinition { String getDriverCode(); String getDriverName(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDefinition.java similarity index 87% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDefinition.java index 50f1fce..7a827f6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDefinition.java @@ -1,7 +1,7 @@ package org.nl.acs.device_driver.basedriver.agv.magic_agv; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import java.util.List; * 普通站点定义 */ @Service -public class MagicAgvDefination implements DeviceDriverDefination { +public class MagicAgvDefinition implements DeviceDriverDefinition { @Override public String getDriverCode() { return "magic_agv"; @@ -31,7 +31,7 @@ public class MagicAgvDefination implements DeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new MagicAgvDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new MagicAgvDeviceDriver()).setDevice(device).setDriverDefinition(this); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDeviceDriver.java index ae0cd7e..812e50e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/magic_agv/MagicAgvDeviceDriver.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.agv.magic_agv; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.device_driver.driver.AbstractDeviceDriver; import org.nl.acs.opc.Device; import org.springframework.stereotype.Service; @@ -19,12 +19,12 @@ public class MagicAgvDeviceDriver extends AbstractDeviceDriver implements Device } @Override - public DeviceDriverDefination getDriverDefination() { + public DeviceDriverDefinition getDriverDefinition() { return null; } @Override - public DeviceDriver setDriverDefination(DeviceDriverDefination var1) { + public DeviceDriver setDriverDefinition(DeviceDriverDefinition var1) { return null; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefinition.java similarity index 87% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefinition.java index 7a7ec93..2d6e996 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDefinition.java @@ -1,7 +1,7 @@ package org.nl.acs.device_driver.basedriver.agv.ndcone; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import java.util.List; * NDC单工位AGV */ @Service -public class AgvNdcOneDefination implements DeviceDriverDefination { +public class AgvNdcOneDefinition implements DeviceDriverDefinition { @Override public String getDriverCode() { return "agv_ndc_one"; @@ -31,7 +31,7 @@ public class AgvNdcOneDefination implements DeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new AgvNdcOneDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new AgvNdcOneDeviceDriver()).setDevice(device).setDriverDefinition(this); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index b6e63cb..c66924d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -17,6 +17,7 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.basedriver.agv.utils.ErrorUtil; import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_autodoor.StandardAutoDoorDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_elevator.StandardElevatorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; @@ -912,6 +913,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (driver.getAction() == 1) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } + } else if (device.getDeviceDriver() instanceof StandardElevatorDeviceDriver) { + StandardElevatorDeviceDriver driver = (StandardElevatorDeviceDriver) device.getDeviceDriver(); + + } } else if (phase == 0x51) {//离开区域 if (agvaddr == 0) { @@ -982,6 +987,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (driver.getAction() == 2) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } + } else if (device.getDeviceDriver() instanceof StandardElevatorDeviceDriver) { + StandardElevatorDeviceDriver driver = (StandardElevatorDeviceDriver) device.getDeviceDriver(); + + } } else if (phase == 0x67) {//agv异常 if (ikey == 0) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefinition.java similarity index 87% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefinition.java index c67d99d..b3d8fce 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDefinition.java @@ -1,7 +1,7 @@ package org.nl.acs.device_driver.basedriver.agv.ndctwo; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import java.util.List; * NDC双工位AGV */ @Service -public class AgvNdcTwoDefination implements DeviceDriverDefination { +public class AgvNdcTwoDefinition implements DeviceDriverDefinition { @Override public String getDriverCode() { return "agv_ndc_two"; @@ -31,7 +31,7 @@ public class AgvNdcTwoDefination implements DeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new AgvNdcTwoDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new AgvNdcTwoDeviceDriver()).setDevice(device).setDriverDefinition(this); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDefinition.java index 5b7d1fc..76b1a7f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/box_palletizing_manipulator/BoxPalletizingManipulatorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.box_palletizing_manipulator; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ import java.util.List; * */ @Service -public class BoxPalletizingManipulatorDefination implements OpcDeviceDriverDefination { +public class BoxPalletizingManipulatorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "box_palletizing_manipulator"; @@ -33,7 +33,7 @@ public class BoxPalletizingManipulatorDefination implements OpcDeviceDriverDefin @Override public DeviceDriver getDriverInstance(Device device) { - return (new BoxPalletizingManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new BoxPalletizingManipulatorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,14 +50,14 @@ public class BoxPalletizingManipulatorDefination implements OpcDeviceDriverDefin } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/cargo_lift_conveyor/CargoLiftConveyorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/cargo_lift_conveyor/CargoLiftConveyorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/cargo_lift_conveyor/CargoLiftConveyorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/cargo_lift_conveyor/CargoLiftConveyorDefinition.java index eb17957..d791789 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/cargo_lift_conveyor/CargoLiftConveyorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/cargo_lift_conveyor/CargoLiftConveyorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.cargo_lift_conveyor; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 货梯对接线 */ @Service -public class CargoLiftConveyorDefination implements OpcDeviceDriverDefination { +public class CargoLiftConveyorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "cargo_lift_conveyor"; @@ -32,7 +32,7 @@ public class CargoLiftConveyorDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new CargoLiftConveyorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new CargoLiftConveyorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @Override @@ -48,12 +48,12 @@ public class CargoLiftConveyorDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/empty_vehicle_stacking_position/EmptyVehicleStackingPositionDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/empty_vehicle_stacking_position/EmptyVehicleStackingPositionDefinition.java similarity index 81% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/empty_vehicle_stacking_position/EmptyVehicleStackingPositionDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/empty_vehicle_stacking_position/EmptyVehicleStackingPositionDefinition.java index a5e78fc..fc8b48c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/empty_vehicle_stacking_position/EmptyVehicleStackingPositionDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/empty_vehicle_stacking_position/EmptyVehicleStackingPositionDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 空托盘叠盘位 */ @Service -public class EmptyVehicleStackingPositionDefination implements OpcDeviceDriverDefination { +public class EmptyVehicleStackingPositionDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "empty_vehicle_stacking_position"; @@ -32,7 +32,7 @@ public class EmptyVehicleStackingPositionDefination implements OpcDeviceDriverDe @Override public DeviceDriver getDriverInstance(Device device) { - return (new EmptyVehicleStackingPositionDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new EmptyVehicleStackingPositionDeviceDriver()).setDevice(device).setDriverDefinition(this); } @Override @@ -48,12 +48,12 @@ public class EmptyVehicleStackingPositionDefination implements OpcDeviceDriverDe } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefinition.java index f650942..a20a06a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_smart_plc_test/HailiangSmartplcTestDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 三工位 */ @Service -public class HailiangSmartplcTestDefination implements OpcDeviceDriverDefination { +public class HailiangSmartplcTestDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "hailiang_smart_plc_test"; @@ -32,7 +32,7 @@ public class HailiangSmartplcTestDefination implements OpcDeviceDriverDefination @Override public DeviceDriver getDriverInstance(Device device) { - return (new HailiangSmartplcTestDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new HailiangSmartplcTestDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -49,12 +49,12 @@ public class HailiangSmartplcTestDefination implements OpcDeviceDriverDefination } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_conveyor/HongXiangStationDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_conveyor/HongXiangStationDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_conveyor/HongXiangStationDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_conveyor/HongXiangStationDefinition.java index 1a3e4a0..aab0309 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_conveyor/HongXiangStationDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_conveyor/HongXiangStationDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.hongxiang_conveyor; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 烘箱设备对接位 */ @Service -public class HongXiangStationDefination implements OpcDeviceDriverDefination { +public class HongXiangStationDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "hongxiang_conveyor"; @@ -32,7 +32,7 @@ public class HongXiangStationDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new HongXiangStationDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new HongXiangStationDeviceDriver()).setDevice(device).setDriverDefinition(this); } @Override @@ -48,12 +48,12 @@ public class HongXiangStationDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDefinition.java index 1dbce62..64e9dd2 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.hongxiang_device; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 烘箱工位 */ @Service -public class HongXiangConveyorDefination implements OpcDeviceDriverDefination { +public class HongXiangConveyorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "hongxiang_device"; @@ -32,7 +32,7 @@ public class HongXiangConveyorDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new HongXiangConveyorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new HongXiangConveyorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @Override @@ -48,12 +48,12 @@ public class HongXiangConveyorDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDefinition.java index e22c4a5..3664901 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/oven_manipulator/OvenGantryManipulatorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.oven_manipulator; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ import java.util.List; * */ @Service -public class OvenGantryManipulatorDefination implements OpcDeviceDriverDefination { +public class OvenGantryManipulatorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "oven_manipulator"; @@ -33,7 +33,7 @@ public class OvenGantryManipulatorDefination implements OpcDeviceDriverDefinatio @Override public DeviceDriver getDriverInstance(Device device) { - return (new OvenGantryManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new OvenGantryManipulatorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,14 +50,14 @@ public class OvenGantryManipulatorDefination implements OpcDeviceDriverDefinatio } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDefinition.java index 322e715..79c0054 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paint_conveyor/PaintConveyorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.paint_conveyor; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 油漆线 */ @Service -public class PaintConveyorDefination implements OpcDeviceDriverDefination { +public class PaintConveyorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "paint_conveyor"; @@ -32,7 +32,7 @@ public class PaintConveyorDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new PaintConveyorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new PaintConveyorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -49,12 +49,12 @@ public class PaintConveyorDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDefinition.java index bce3297..f11b2ae 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plug_pull_device_site/PlugPullDeviceSiteDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.plug_pull_device_site; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 插拔轴工位 */ @Service -public class PlugPullDeviceSiteDefination implements OpcDeviceDriverDefination { +public class PlugPullDeviceSiteDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "plug_pull_device_site"; @@ -32,7 +32,7 @@ public class PlugPullDeviceSiteDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new PlugPullDeviceSiteDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new PlugPullDeviceSiteDeviceDriver()).setDevice(device).setDriverDefinition(this); } @Override @@ -48,12 +48,12 @@ public class PlugPullDeviceSiteDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefinition.java index 465f0a7..383e387 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.siemens_conveyor; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ import java.util.List; * */ @Service -public class SiemensConveyorDefination implements OpcDeviceDriverDefination { +public class SiemensConveyorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "siemens_conveyor"; @@ -33,7 +33,7 @@ public class SiemensConveyorDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new SiemensConveyorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new SiemensConveyorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,14 +50,14 @@ public class SiemensConveyorDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDefinition.java index 248dc8f..03d87ce 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_ckk/SiemensConveyorCkkDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ import java.util.List; * */ @Service -public class SiemensConveyorCkkDefination implements OpcDeviceDriverDefination { +public class SiemensConveyorCkkDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "siemens_conveyor_ckk"; @@ -33,7 +33,7 @@ public class SiemensConveyorCkkDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new SiemensConveyorCkkDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new SiemensConveyorCkkDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,14 +50,14 @@ public class SiemensConveyorCkkDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDefinition.java index 20f246c..37cdf08 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ import java.util.List; * */ @Service -public class SiemensConveyorLabelingDefination implements OpcDeviceDriverDefination { +public class SiemensConveyorLabelingDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "siemens_conveyor_labeling"; @@ -33,7 +33,7 @@ public class SiemensConveyorLabelingDefination implements OpcDeviceDriverDefinat @Override public DeviceDriver getDriverInstance(Device device) { - return (new SiemensConveyorLabelingDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new SiemensConveyorLabelingDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,14 +50,14 @@ public class SiemensConveyorLabelingDefination implements OpcDeviceDriverDefinat } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDefinition.java index c0dc36f..e098fec 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.slit_two_manipulator; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -15,7 +15,7 @@ import java.util.List; * */ @Service -public class SlitTwoManipulatorDefination implements OpcDeviceDriverDefination { +public class SlitTwoManipulatorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "slit_two_manipulator"; @@ -33,7 +33,7 @@ public class SlitTwoManipulatorDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new SlitTwoManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new SlitTwoManipulatorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,12 +50,12 @@ public class SlitTwoManipulatorDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutoDoorDefinition.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutoDoorDefinition.java index cab2b5b..6ce24ce 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutoDoorDefinition.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutoDoorDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.standard_autodoor; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 自动门驱动定义 */ @Service -public class StandardAutoDoorDefinition implements OpcDeviceDriverDefination { +public class StandardAutoDoorDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "standard_autodoor"; @@ -32,7 +32,7 @@ public class StandardAutoDoorDefinition implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardAutoDoorDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardAutoDoorDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -49,7 +49,7 @@ public class StandardAutoDoorDefinition implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return getReadableItemDtos2(); } @@ -58,7 +58,7 @@ public class StandardAutoDoorDefinition implements OpcDeviceDriverDefination { } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefinition.java similarity index 81% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefinition.java index f8a8cdd..3044707 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefinition.java @@ -2,12 +2,11 @@ package org.nl.acs.device_driver.basedriver.standard_conveyor_control; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -16,7 +15,7 @@ import java.util.List; * 说明:该站点为普通带光电检测站点 */ @Service -public class StandardConveyorControlDefination implements OpcDeviceDriverDefination { +public class StandardConveyorControlDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "standard_conveyor_control"; @@ -34,7 +33,7 @@ public class StandardConveyorControlDefination implements OpcDeviceDriverDefinat @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardCoveyorControlDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardCoveyorControlDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -51,13 +50,13 @@ public class StandardConveyorControlDefination implements OpcDeviceDriverDefinat } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefinition.java similarity index 80% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefinition.java index faf9dda..8325be1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefinition.java @@ -2,12 +2,11 @@ package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcsc import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -15,7 +14,7 @@ import java.util.List; * 输送机-控制点-PLC扫码器驱动定义 */ @Service -public class StandardConveyorControlWithPlcScannerDefination implements OpcDeviceDriverDefination { +public class StandardConveyorControlWithPlcScannerDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "standard_conveyor_control_with_plcscanner"; @@ -33,7 +32,7 @@ public class StandardConveyorControlWithPlcScannerDefination implements OpcDevic @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardCoveyorControlWithPlcScannerDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardCoveyorControlWithPlcScannerDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -50,13 +49,13 @@ public class StandardConveyorControlWithPlcScannerDefination implements OpcDevic } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardConveyorControlWithScannerDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardConveyorControlWithScannerDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardConveyorControlWithScannerDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardConveyorControlWithScannerDefinition.java index b2dc671..df3e389 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardConveyorControlWithScannerDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardConveyorControlWithScannerDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scann import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -14,7 +14,7 @@ import java.util.List; * 说明:该站点为输送机-控制点-关联扫码 */ @Service -public class StandardConveyorControlWithScannerDefination implements OpcDeviceDriverDefination { +public class StandardConveyorControlWithScannerDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "standard_conveyor_control_with_scanner"; @@ -32,7 +32,7 @@ public class StandardConveyorControlWithScannerDefination implements OpcDeviceDr @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardCoveyorControlWithScannerDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardCoveyorControlWithScannerDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -49,13 +49,13 @@ public class StandardConveyorControlWithScannerDefination implements OpcDeviceDr } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return ItemProtocol.getReadableItemDtos(); } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/ItemProtocol.java new file mode 100644 index 0000000..ba83653 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/ItemProtocol.java @@ -0,0 +1,115 @@ +package org.nl.acs.device_driver.basedriver.standard_elevator; + +import lombok.Data; +import org.jetbrains.annotations.NotNull; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author zhangjiangwei + */ +@Data +public class ItemProtocol { + + // 心跳 + public static final String ITEM_HEARTBEAT = "heartbeat"; + // 工作模式 + public static final String ITEM_MODE = "mode"; + // 楼层 + public static final String ITEM_FLOOR = "floor"; + // 前门信号 + public static final String ITEM_DOOR1 = "door1"; + // 后门信号 + public static final String ITEM_DOOR2 = "door2"; + // error + public static final String ITEM_ERROR = "error"; + + // 下发命令 + public static final String ITEM_TO_COMMAND = "to_command"; + // 前门 + public static final String ITEM_TO_DOOR1 = "to_door1"; + // 后门 + public static final String ITEM_TO_DOOR2 = "to_door2"; + // 前往楼层 + public static final String ITEM_TO_FLOOR = "to_floor"; + + private boolean isOnline; + + private final StandardElevatorDeviceDriver driver; + + public ItemProtocol(StandardElevatorDeviceDriver driver) { + this.driver = driver; + } + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + + if (value == null) { + this.isOnline = false; + return 0; + } else { + this.isOnline = true; + return value; + } + } + + public int getMode() { + return this.getOpcIntegerValue(ITEM_MODE); + } + + public int getFloor() { + return this.getOpcIntegerValue(ITEM_FLOOR); + } + + public int getDoor1() { + return this.getOpcIntegerValue(ITEM_DOOR1); + } + + public int getDoor2() { + return this.getOpcIntegerValue(ITEM_DOOR2); + } + + public int getError() { + return this.getOpcIntegerValue(ITEM_ERROR); + } + + public int getToCommand() { + return this.getOpcIntegerValue(ITEM_TO_COMMAND); + } + + public int getToDoor1() { + return this.getOpcIntegerValue(ITEM_TO_DOOR1); + } + + public int getToDoor2() { + return this.getOpcIntegerValue(ITEM_TO_DOOR2); + } + + public int getToFloor() { + return this.getOpcIntegerValue(ITEM_TO_FLOOR); + } + + @NotNull + public static List getReadableItemDTOs() { + ArrayList itemDTOs = new ArrayList<>(); + itemDTOs.add(new ItemDto(ITEM_HEARTBEAT, "心跳", "DB600.B0")); + itemDTOs.add(new ItemDto(ITEM_MODE, "工作模式", "DB600.B2")); + itemDTOs.add(new ItemDto(ITEM_FLOOR, "楼层", "DB600.B3")); + itemDTOs.add(new ItemDto(ITEM_DOOR1, "前门信号", "DB600.B4")); + itemDTOs.add(new ItemDto(ITEM_DOOR2, "后门信号", "DB600.B5")); + itemDTOs.add(new ItemDto(ITEM_ERROR, "error", "DB600.B6")); + return itemDTOs; + } + + @NotNull + public static List getWriteableItemDTOs() { + ArrayList itemDTOs = new ArrayList<>(); + itemDTOs.add(new ItemDto(ITEM_TO_COMMAND, "下发命令", "DB610.W2")); + itemDTOs.add(new ItemDto(ITEM_TO_DOOR1, "前门", "DB610.W4")); + itemDTOs.add(new ItemDto(ITEM_TO_DOOR2, "后门", "DB610.W6")); + itemDTOs.add(new ItemDto(ITEM_TO_FLOOR, "前往楼层", "DB610.W8")); + return itemDTOs; + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/StandardElevatorDefinition.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/StandardElevatorDefinition.java new file mode 100644 index 0000000..f14d618 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/StandardElevatorDefinition.java @@ -0,0 +1,61 @@ +package org.nl.acs.device_driver.basedriver.standard_elevator; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceType; +import org.springframework.stereotype.Service; + +import java.util.LinkedList; +import java.util.List; + +/** + * @author zhangjiangwei + */ +@Service +public class StandardElevatorDefinition implements OpcDeviceDriverDefinition { + + + @Override + public String getDriverCode() { + return "standard_elevator"; + } + + @Override + public String getDriverName() { + return "标准版-电梯"; + } + + @Override + public String getDriverDescription() { + return "标准版-电梯"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return new StandardElevatorDeviceDriver().setDevice(device).setDriverDefinition(this); + } + + @Override + public Class getDeviceDriverType() { + return StandardElevatorDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList<>(); + types.add(DeviceType.conveyor); + return types; + } + + @Override + public List getReadableItemDTOs() { + return ItemProtocol.getReadableItemDTOs(); + } + + @Override + public List getWriteableItemDTOs() { + return ItemProtocol.getWriteableItemDTOs(); + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/StandardElevatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/StandardElevatorDeviceDriver.java new file mode 100644 index 0000000..568d16c --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_elevator/StandardElevatorDeviceDriver.java @@ -0,0 +1,216 @@ +package org.nl.acs.device_driver.basedriver.standard_elevator; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.RouteableDeviceDriver; +import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; +import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.monitor.DeviceStageMonitor; +import org.nl.modules.wql.util.SpringContextHolder; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author zhangjiangwei + */ +@Slf4j +@Getter +@Setter +public class StandardElevatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { + + private final ItemProtocol itemProtocol = new ItemProtocol(this); + + DeviceExecuteLogService deviceLog = SpringContextHolder.getBean(DeviceExecuteLogService.class); + + // 工作模式 + private int mode = 0; + private int lastMode = this.mode; + // 楼层 + private int floor = 0; + private int lastFloor = this.floor; + // 前门信号 + private int door1 = 0; + private int lastDoor1 = this.door1; + // 后门信号 + private int door2 = 0; + private int lastDoor2 = this.door2; + // error + private int error = 0; + private int lastError = this.error; + + // 下发命令 + private int toCommand = 0; + private int lastToCommand = this.toCommand; + // 前门 + private int toDoor1 = 0; + private int lastToDoor1 = this.toDoor1; + // 后门 + private int toDoor2 = 0; + private int lastToDoor2 = this.toDoor2; + // 前往楼层 + private int toFloor = 0; + private int lastToFloor = this.toFloor; + + // 设备编码 + private String deviceCode; + // 是否在线 + private boolean isOnline; + // 是否报错 + private boolean isError; + // 信息 + private String message; + + @Override + public void execute() { + try { + this.deviceCode = this.getDevice().getDevice_code(); + + this.mode = this.itemProtocol.getMode(); + this.floor = this.itemProtocol.getFloor(); + this.door1 = this.itemProtocol.getDoor1(); + this.door2 = this.itemProtocol.getDoor2(); + this.error = this.itemProtocol.getError(); + + this.toCommand = this.itemProtocol.getToCommand(); + this.toDoor1 = this.itemProtocol.getToDoor1(); + this.toDoor2 = this.itemProtocol.getToDoor2(); + this.toFloor = this.itemProtocol.getToFloor(); + + if (this.mode != this.lastMode) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_MODE, String.valueOf(this.mode)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_MODE + " " + this.lastMode + " -> " + this.mode); + } + if (this.floor != this.lastFloor) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_FLOOR, String.valueOf(this.floor)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_FLOOR + " " + this.lastFloor + " -> " + this.floor); + } + if (this.door1 != this.lastDoor1) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_DOOR1, String.valueOf(this.door1)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_DOOR1 + " " + this.lastDoor1 + " -> " + this.door1); + } + if (this.door2 != this.lastDoor2) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_DOOR2, String.valueOf(this.door2)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_DOOR2 + " " + this.lastDoor2 + " -> " + this.door2); + } + if (this.error != this.lastError) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_ERROR, String.valueOf(this.error)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_ERROR + " " + this.lastError + " -> " + this.error); + } + + if (this.toCommand != this.lastToCommand) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_COMMAND, String.valueOf(this.toCommand)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_COMMAND + " " + this.lastToCommand + " -> " + this.toCommand); + } + if (this.toDoor1 != this.lastToDoor1) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_DOOR1, String.valueOf(this.toDoor1)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_DOOR1 + " " + this.lastToDoor1 + " -> " + this.toDoor1); + } + if (this.toDoor2 != this.lastToDoor2) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_DOOR2, String.valueOf(this.toDoor2)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_DOOR2 + " " + this.lastToDoor2 + " -> " + this.toDoor2); + } + if (this.toFloor != this.lastToFloor) { + deviceLog.deviceItemValue(this.deviceCode, ItemProtocol.ITEM_TO_FLOOR, String.valueOf(this.toFloor)); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_FLOOR + " " + this.lastToFloor + " -> " + this.toFloor); + } + } catch (Exception e) { + log.error("StandardElevatorDeviceDriver execute error!", e); + return; + } + + if (!this.itemProtocol.isOnline()) { + // 信号量同步异常 + this.isOnline = false; + this.isError = true; + message = "信号量同步异常。"; + } else if (mode == 0) { + // 脱机 + this.isOnline = false; + this.isError = true; + message = "脱机。"; + } else if (error != 0) { + // 报警 + this.isOnline = false; + this.isError = true; + message = "有报警。"; + } else { + // 正常 + this.isOnline = true; + this.isError = false; + message = ""; + } + + this.lastMode = this.mode; + this.lastFloor = this.floor; + this.lastDoor1 = this.door1; + this.lastDoor2 = this.door2; + this.lastError = this.error; + } + + public void writing(int command) { + Map itemMap = new HashMap<>(); + itemMap.put(this.getToParam() + ItemProtocol.ITEM_TO_COMMAND, command); + this.control(itemMap); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", ItemProtocol.ITEM_TO_COMMAND + " 写入 " + command); + } + + public void writing(Map map) { + Map itemMap = new LinkedHashMap<>(); + map.forEach((key, value) -> { + if (value != null) { + itemMap.put(getToParam() + key, value); + deviceLog.deviceExecuteLog(this.deviceCode, "", "", key + " 写入 " + value); + } + }); + if (ObjectUtil.isNotEmpty(itemMap)) { + this.control(itemMap); + } + } + + public String getToParam() { + return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "."; + } + + @Override + public JSONObject getDeviceStatusName() throws Exception { + String mode; + + switch (this.mode) { + case 0: + mode = "脱机"; + break; + case 2: + mode = "待机"; + break; + case 3: + mode = "运行中"; + break; + default: + mode = String.valueOf(this.mode); + } + + JSONObject result = new JSONObject(); + result.put("device_name", this.getDevice().getDevice_name()); + result.put(ItemProtocol.ITEM_MODE, mode); + result.put(ItemProtocol.ITEM_FLOOR, this.floor); + result.put(ItemProtocol.ITEM_DOOR1, this.door1); + result.put(ItemProtocol.ITEM_DOOR2, this.door2); + result.put(ItemProtocol.ITEM_ERROR, this.error); + result.put("isOnline", this.isOnline); + result.put("isError", this.isError); + result.put("message", message); + return result; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDefinition.java similarity index 87% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDefinition.java index 4299036..4390c08 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDefinition.java @@ -2,7 +2,7 @@ package org.nl.acs.device_driver.basedriver.standard_inspect_site; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -16,7 +16,7 @@ import java.util.List; * 说明:该站点为普通带光电检测站点 */ @Service -public class StandardInspectSiteDefination implements OpcDeviceDriverDefination { +public class StandardInspectSiteDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "standard_inspect_site"; @@ -34,7 +34,7 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardInspectSiteDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardInspectSiteDeviceDriver()).setDevice(device).setDriverDefinition(this); } @@ -51,7 +51,7 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return getReadableItemDtos2(); } @@ -66,7 +66,7 @@ public class StandardInspectSiteDefination implements OpcDeviceDriverDefination } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java index 7239c5a..3fe9dc0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java @@ -257,7 +257,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp //String opcservcerid = this.getDevice().getOpc_server_id(); //Server server = ReadUtil.getServer(opcservcerid); - Map itemMap = new HashMap(); + Map itemMap = new HashMap<>(); itemMap.put(to_command, command); this.control(itemMap); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDefinition.java similarity index 86% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDefinition.java index fbe27f4..0603528 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDefinition.java @@ -1,7 +1,7 @@ package org.nl.acs.device_driver.basedriver.standard_ordinary_site; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import java.util.List; * 普通站点定义 */ @Service -public class StandardOrdinarySiteDefination implements DeviceDriverDefination { +public class StandardOrdinarySiteDefinition implements DeviceDriverDefinition { @Override public String getDriverCode() { return "standard_ordinary_site"; @@ -31,7 +31,7 @@ public class StandardOrdinarySiteDefination implements DeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardOrdinarySiteDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardOrdinarySiteDeviceDriver()).setDevice(device).setDriverDefinition(this); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_scanner/StandardScannerDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_scanner/StandardScannerDefinition.java similarity index 86% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_scanner/StandardScannerDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_scanner/StandardScannerDefinition.java index 0a29625..3ab7906 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_scanner/StandardScannerDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_scanner/StandardScannerDefinition.java @@ -1,7 +1,7 @@ package org.nl.acs.device_driver.basedriver.standard_scanner; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import java.util.List; * 扫码器 */ @Service -public class StandardScannerDefination implements DeviceDriverDefination { +public class StandardScannerDefinition implements DeviceDriverDefinition { @Override public String getDriverCode() { return "standard_scanner"; @@ -31,7 +31,7 @@ public class StandardScannerDefination implements DeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardScannerDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardScannerDeviceDriver()).setDevice(device).setDriverDefinition(this); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_storage/StandardStorageDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_storage/StandardStorageDefinition.java similarity index 86% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_storage/StandardStorageDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_storage/StandardStorageDefinition.java index 78bd720..735a693 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_storage/StandardStorageDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_storage/StandardStorageDefinition.java @@ -1,7 +1,7 @@ package org.nl.acs.device_driver.basedriver.standard_storage; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import java.util.List; * 货架 */ @Service -public class StandardStorageDefination implements DeviceDriverDefination { +public class StandardStorageDefinition implements DeviceDriverDefinition { @Override public String getDriverCode() { return "standard_storage"; @@ -31,7 +31,7 @@ public class StandardStorageDefination implements DeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new StandardStorageDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new StandardStorageDeviceDriver()).setDevice(device).setDriverDefinition(this); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/defination/OpcDeviceDriverDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/defination/OpcDeviceDriverDefination.java deleted file mode 100644 index 8c57a60..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/defination/OpcDeviceDriverDefination.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.nl.acs.device_driver.defination; - -import org.nl.acs.device.device_driver.standard_inspect.ItemDto; -import org.nl.acs.device_driver.DeviceDriverDefination; - -import java.util.List; - -public interface OpcDeviceDriverDefination extends DeviceDriverDefination { - List getReadableItemDtos(); - - List getWriteableItemDtos(); -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/defination/OpcDeviceDriverDefinition.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/defination/OpcDeviceDriverDefinition.java new file mode 100644 index 0000000..0915fbc --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/defination/OpcDeviceDriverDefinition.java @@ -0,0 +1,12 @@ +package org.nl.acs.device_driver.defination; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device_driver.DeviceDriverDefinition; + +import java.util.List; + +public interface OpcDeviceDriverDefinition extends DeviceDriverDefinition { + List getReadableItemDTOs(); + + List getWriteableItemDTOs(); +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractDeviceDriver.java index e0c58cf..ff43a79 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractDeviceDriver.java @@ -2,14 +2,14 @@ package org.nl.acs.device_driver.driver; import lombok.Data; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.opc.Device; @Data public class AbstractDeviceDriver implements DeviceDriver { public Device device; - private DeviceDriverDefination driverDefination; + private DeviceDriverDefinition driverDefinition; private boolean stop = false; @@ -26,13 +26,13 @@ public class AbstractDeviceDriver implements DeviceDriver { @Override - public DeviceDriverDefination getDriverDefination() { - return this.driverDefination; + public DeviceDriverDefinition getDriverDefinition() { + return this.driverDefinition; } @Override - public DeviceDriver setDriverDefination(DeviceDriverDefination var1) { - this.driverDefination = driverDefination; + public DeviceDriver setDriverDefinition(DeviceDriverDefinition var1) { + this.driverDefinition = var1; return this; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDefinition.java similarity index 82% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDefination.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDefinition.java index 666b556..c3563c5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/fold_disc_site/FoldDiscSiteDefinition.java @@ -2,12 +2,11 @@ package org.nl.acs.device_driver.fold_disc_site; import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefinition; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceType; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -15,7 +14,7 @@ import java.util.List; * 晟华叠盘机 */ @Service -public class FoldDiscSiteDefination implements OpcDeviceDriverDefination { +public class FoldDiscSiteDefinition implements OpcDeviceDriverDefinition { @Override public String getDriverCode() { return "fold_disc_site"; @@ -33,7 +32,7 @@ public class FoldDiscSiteDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new FoldDiscSiteDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new FoldDiscSiteDeviceDriver()).setDevice(device).setDriverDefinition(this); } @Override @@ -49,7 +48,7 @@ public class FoldDiscSiteDefination implements OpcDeviceDriverDefination { } @Override - public List getReadableItemDtos() { + public List getReadableItemDTOs() { return getReadableItemDtos2(); } @@ -58,7 +57,7 @@ public class FoldDiscSiteDefination implements OpcDeviceDriverDefination { } @Override - public List getWriteableItemDtos() { + public List getWriteableItemDTOs() { return ItemProtocol.getWriteableItemDtos(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 7f2731c..e4c70f8 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -3,7 +3,6 @@ package org.nl.acs.ext.wms.service.impl; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONString; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -12,14 +11,11 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; import org.nl.acs.common.IDriverService; import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver; -import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver; import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver; import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.ext.wms.data.*; -import org.nl.acs.ext.wms.liKuData.Resp; import org.nl.acs.ext.wms.service.AcsToLiKuService; import org.nl.acs.ext.wms.service.WmsToAcsService; import org.nl.acs.instruction.service.InstructionService; @@ -279,7 +275,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String[] split = extra_code.split("\\."); extra_code = split[split.length - 1]; extra_code = extra_code.substring(0, 1).toUpperCase() + extra_code.substring(1); - IDriverService driverService = applicationContext.getBean(device.getDeviceDriverDefination().getDriverCode(), IDriverService.class); + IDriverService driverService = applicationContext.getBean(device.getDeviceDriverDefinition().getDriverCode(), IDriverService.class); Integer dbValue = driverService.getDbValue(device, extra_code); map.put(dbName, dbValue); break; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index a7ebe17..1c171b9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -53,7 +53,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.function.Predicate; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -805,14 +804,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu String start_device = deviceAppService .findDeviceByCode(start_device_code) - .getDeviceDriverDefination() + .getDeviceDriverDefinition() .getFitDeviceTypes() .get(0) .name(); String next_device = deviceAppService .findDeviceByCode(next_device_code) - .getDeviceDriverDefination() + .getDeviceDriverDefinition() .getFitDeviceTypes() .get(0) .name(); @@ -1175,7 +1174,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu String start_device = deviceAppService .findDeviceByCode(start_device_code) - .getDeviceDriverDefination() + .getDeviceDriverDefinition() .getFitDeviceTypes() .get(0) .name(); @@ -1201,7 +1200,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu String next_device = deviceAppService .findDeviceByCode(next_device_code) - .getDeviceDriverDefination() + .getDeviceDriverDefinition() .getFitDeviceTypes() .get(0) .name(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/Device.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/Device.java index 0230442..88db36a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/Device.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/Device.java @@ -2,7 +2,7 @@ package org.nl.acs.opc; import lombok.Data; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; @Data public class Device extends DeviceManageDto { @@ -11,7 +11,7 @@ public class Device extends DeviceManageDto { private int status_code = 0; private String status_message = ""; private DeviceDriver deviceDriver; - private DeviceDriverDefination deviceDriverDefination; + private DeviceDriverDefinition deviceDriverDefinition; @Override public String toString() { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceAppServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceAppServiceImpl.java index 7f1d710..1390910 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceAppServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceAppServiceImpl.java @@ -5,9 +5,9 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import org.nl.acs.auto.initial.ApplicationAutoInitial; -import org.nl.acs.device.service.DeviceDriverDefinationAppService; +import org.nl.acs.device.service.DeviceDriverDefinitionAppService; import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; +import org.nl.acs.device_driver.DeviceDriverDefinition; import org.nl.acs.device_driver.LinewayDeviceDriver; import org.nl.acs.device_driver.driver.OpcDeviceDriver; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +23,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn @Autowired private DeviceManageService deviceManageService; @Autowired - private DeviceDriverDefinationAppService deviceDriverDefinationAppService; + private DeviceDriverDefinitionAppService deviceDriverDefinitionAppService; @Override public List findAllDevice() { @@ -296,7 +296,7 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn while (var3.hasNext()) { Device device = (Device) var3.next(); if (ObjectUtil.equal(device.getDevice_code(), deviceCode)) { - return device.getDeviceDriverDefination().getFitDeviceTypes().get(0).name(); + return device.getDeviceDriverDefinition().getFitDeviceTypes().get(0).name(); } } return null; @@ -328,9 +328,9 @@ public class DeviceAppServiceImpl implements DeviceAppService, ApplicationAutoIn this.code_indexs.add(device.getDevice_code()); if (!StrUtil.isEmpty(device.getDriver_code())) { - DeviceDriverDefination defination = this.deviceDriverDefinationAppService.getDeviceDriverDefination(deviceManage.getDriver_code()); + DeviceDriverDefinition defination = this.deviceDriverDefinitionAppService.getDeviceDriverDefinition(deviceManage.getDriver_code()); if (defination != null) { - device.setDeviceDriverDefination(defination); + device.setDeviceDriverDefinition(defination); DeviceDriver driver = defination.getDriverInstance(device); device.setDeviceDriver(driver); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceDriverDefinationAppServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceDriverDefinationAppServiceImpl.java deleted file mode 100644 index 5ac2623..0000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceDriverDefinationAppServiceImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.nl.acs.opc; - -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.device.service.DeviceDriverDefinationAppService; -import org.nl.acs.device_driver.DeviceDriver; -import org.nl.acs.device_driver.DeviceDriverDefination; -import org.nl.modules.common.exception.BadRequestException; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.stereotype.Service; - -import java.util.*; - -@Service -@Slf4j -public class DeviceDriverDefinationAppServiceImpl implements DeviceDriverDefinationAppService, InitializingBean, ApplicationContextAware { - @Autowired - private Map deviceDriverDefinations = new HashMap(); - @Autowired( - required = false - ) - List deviceDriverDefinationsx; - - public DeviceDriverDefinationAppServiceImpl() { - this.deviceDriverDefinations = Collections.synchronizedMap(this.deviceDriverDefinations); - } - - @Override - public List getDeviceDriverCodes() { - return null; - } - - @Override - public DeviceDriverDefination getDeviceDriverDefination(String driverCode) { - return (DeviceDriverDefination) this.deviceDriverDefinations.get(driverCode); - } - - @Override - public List getDeviceDriverDefinations() { - return new LinkedList(this.deviceDriverDefinations.values()); - } - - @Override - public List getDeviceDriverDefinations(DeviceType deviceType) { - Collection definations = this.deviceDriverDefinations.values(); - List deviceTypeDefinations = new LinkedList(); - Iterator var4 = definations.iterator(); - - while (var4.hasNext()) { - DeviceDriverDefination defination = (DeviceDriverDefination) var4.next(); - if (defination.getFitDeviceTypes() == null || defination.getDriverCode() == null || defination.getDeviceDriverType() == null) { - throw new BadRequestException("当前驱动defination定义异常:" + defination.getClass()); - } - - if (defination.getFitDeviceTypes().contains(deviceType)) { - deviceTypeDefinations.add(defination); - } - } - - return deviceTypeDefinations; - } - - @Override - public boolean isRoute(Class var1) { - return false; - } - - @Override - public boolean isOpc(Class var1) { - return false; - } - - @Override - public void afterPropertiesSet() throws Exception { - this.initial(); - } - - public void initial() { - if (this.deviceDriverDefinationsx != null) { - Iterator var1 = this.deviceDriverDefinationsx.iterator(); - - DeviceDriverDefination deviceDriverDefination; - while (var1.hasNext()) { - deviceDriverDefination = (DeviceDriverDefination) var1.next(); - if (deviceDriverDefination.getDriverCode() != null && deviceDriverDefination.getFitDeviceTypes() != null && deviceDriverDefination.getFitDeviceTypes() != null) { - this.addDeviceDriverDefination(deviceDriverDefination.getDriverCode(), deviceDriverDefination); - } - - //log.warn("{}驱动定义异常", deviceDriverDefination.getClass()); - } - - } - } - - private void addDeviceDriverDefination(String driverCode, DeviceDriverDefination deviceDriverDefination) { - this.deviceDriverDefinations.put(driverCode, deviceDriverDefination); - } - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - - } -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceDriverDefinitionAppServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceDriverDefinitionAppServiceImpl.java new file mode 100644 index 0000000..3af4f36 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceDriverDefinitionAppServiceImpl.java @@ -0,0 +1,106 @@ +package org.nl.acs.opc; + +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.service.DeviceDriverDefinitionAppService; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.DeviceDriverDefinition; +import org.nl.modules.common.exception.BadRequestException; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +@Slf4j +public class DeviceDriverDefinitionAppServiceImpl implements DeviceDriverDefinitionAppService, InitializingBean, ApplicationContextAware { + @Autowired + private Map deviceDriverDefinitions = new HashMap(); + @Autowired( + required = false + ) + List deviceDriverDefinitionsxes; + + public DeviceDriverDefinitionAppServiceImpl() { + this.deviceDriverDefinitions = Collections.synchronizedMap(this.deviceDriverDefinitions); + } + + @Override + public List getDeviceDriverCodes() { + return null; + } + + @Override + public DeviceDriverDefinition getDeviceDriverDefinition(String driverCode) { + return (DeviceDriverDefinition) this.deviceDriverDefinitions.get(driverCode); + } + + @Override + public List getDeviceDriverDefinitions() { + return new LinkedList(this.deviceDriverDefinitions.values()); + } + + @Override + public List getDeviceDriverDefinitions(DeviceType deviceType) { + Collection definations = this.deviceDriverDefinitions.values(); + List deviceTypeDefinitions = new LinkedList(); + Iterator var4 = definations.iterator(); + + while (var4.hasNext()) { + DeviceDriverDefinition defination = (DeviceDriverDefinition) var4.next(); + if (defination.getFitDeviceTypes() == null || defination.getDriverCode() == null || defination.getDeviceDriverType() == null) { + throw new BadRequestException("当前驱动defination定义异常:" + defination.getClass()); + } + + if (defination.getFitDeviceTypes().contains(deviceType)) { + deviceTypeDefinitions.add(defination); + } + } + + return deviceTypeDefinitions; + } + + @Override + public boolean isRoute(Class var1) { + return false; + } + + @Override + public boolean isOpc(Class var1) { + return false; + } + + @Override + public void afterPropertiesSet() throws Exception { + this.initial(); + } + + public void initial() { + if (this.deviceDriverDefinitionsxes != null) { + Iterator var1 = this.deviceDriverDefinitionsxes.iterator(); + + DeviceDriverDefinition deviceDriverDefinition; + while (var1.hasNext()) { + deviceDriverDefinition = (DeviceDriverDefinition) var1.next(); + if (deviceDriverDefinition.getDriverCode() != null && deviceDriverDefinition.getFitDeviceTypes() != null && deviceDriverDefinition.getFitDeviceTypes() != null) { + this.addDeviceDriverDefinition(deviceDriverDefinition.getDriverCode(), deviceDriverDefinition); + } + + //log.warn("{}驱动定义异常", deviceDriverDefinition.getClass()); + } + + } + } + + private void addDeviceDriverDefinition(String driverCode, DeviceDriverDefinition deviceDriverDefinition) { + this.deviceDriverDefinitions.put(driverCode, deviceDriverDefinition); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index e5f42b2..278de2f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -10,7 +10,6 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; -import lombok.Synchronized; import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; import org.nl.acs.agv.server.XianGongAgvService; @@ -54,7 +53,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -1440,7 +1438,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { String start_device = deviceAppService .findDeviceByCode(start_point_code) - .getDeviceDriverDefination() + .getDeviceDriverDefinition() .getFitDeviceTypes() .get(0) .name(); @@ -1504,7 +1502,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { String next_device = deviceAppService .findDeviceByCode(next_point_code) - .getDeviceDriverDefination() + .getDeviceDriverDefinition() .getFitDeviceTypes() .get(0) .name(); diff --git a/acs/nladmin-system/src/main/resources/config/application-prod.yml b/acs/nladmin-system/src/main/resources/config/application-prod.yml index d064404..626fb26 100644 --- a/acs/nladmin-system/src/main/resources/config/application-prod.yml +++ b/acs/nladmin-system/src/main/resources/config/application-prod.yml @@ -11,7 +11,7 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wzgj_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:bjsz_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} password: ${DB_PWD:123456} # 初始连接数 diff --git a/acs/nladmin-system/src/main/resources/config/application.yml b/acs/nladmin-system/src/main/resources/config/application.yml index f943602..cfc52fe 100644 --- a/acs/nladmin-system/src/main/resources/config/application.yml +++ b/acs/nladmin-system/src/main/resources/config/application.yml @@ -2,7 +2,7 @@ spring: freemarker: check-template-location: false profiles: - active: dev + active: prod jackson: time-zone: GMT+8 data: diff --git a/acs/nladmin-ui/.env.production b/acs/nladmin-ui/.env.production index 9be6cba..762ac12 100644 --- a/acs/nladmin-ui/.env.production +++ b/acs/nladmin-ui/.env.production @@ -2,6 +2,6 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http -VUE_APP_BASE_API = 'http://10.1.3.90:8011' +VUE_APP_BASE_API = 'http://127.0.0.1:8010' # 如果接口是 http 形式, wss 需要改为 ws -VUE_APP_WS_API = 'ws://10.1.3.90:8011' +VUE_APP_WS_API = 'ws://127.0.0.1:8010'