diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index 4779010..ca20653 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -35,7 +35,11 @@ public enum DriverTypeEnum { SIEMENS_CONVEYOR(14,"siemens_conveyor","西门子-输送机驱动","conveyor"), - BELT_CONVEYOR(13,"belt_conveyor","输送线","conveyor"), + BELT_CONVEYOR(13,"belt_conveyor","标准版-输送机","conveyor"), + + //LAMP_THREE_COLOR(17,"lamp_three_color","标准版-三色灯","conveyor"), + + //BOX_PALLETIZING_MANIPULATOR(16,"box_palletizing_manipulator","木箱码垛-行架机械手","station"), SCREEN(15, "led_screen", "LED点阵屏", "screen"); diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/belt_conveyor/BeltConveyorDefination.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/belt_conveyor/BeltConveyorDefination.java index bf9778d..7bad724 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/belt_conveyor/BeltConveyorDefination.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/belt_conveyor/BeltConveyorDefination.java @@ -11,7 +11,7 @@ import java.util.LinkedList; import java.util.List; /** - * 油漆线 + * 标准版-输送机 */ @Service public class BeltConveyorDefination implements OpcDeviceDriverDefination { diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java new file mode 100644 index 0000000..1d48fda --- /dev/null +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/ItemProtocol.java @@ -0,0 +1,48 @@ +package org.nl.acs.device_driver.basedriver.lamp_three_color; + +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +public class ItemProtocol { + + public static String item_to_command = "to_command"; + + + private LampThreecolorDeviceDriver driver; + + public ItemProtocol(LampThreecolorDeviceDriver driver) { + this.driver = driver; + } + + public int getToCommand() { + return this.getOpcIntegerValue(item_to_command); + } + + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + } else { + return value; + } + return 0; + + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList(); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_to_command, "作业命令", "08011")); + return list; + } + +} + diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java new file mode 100644 index 0000000..73c66c4 --- /dev/null +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDefination.java @@ -0,0 +1,64 @@ +package org.nl.acs.device_driver.basedriver.lamp_three_color; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device.enums.DeviceType; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.springframework.stereotype.Service; + +import java.util.LinkedList; +import java.util.List; + +/** + * 标准版-三色灯 + */ +@Service +public class LampThreecolorDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "lamp_three_color"; + } + + @Override + public String getDriverName() { + return "标准版-三色灯"; + } + + @Override + public String getDriverDescription() { + return "标准版-三色灯"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new LampThreecolorDeviceDriver()).setDevice(device).setDriverDefination(this); + + } + + @Override + public Class getDeviceDriverType() { + return LampThreecolorDeviceDriver.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/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java new file mode 100644 index 0000000..de33763 --- /dev/null +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/lamp_three_color/LampThreecolorDeviceDriver.java @@ -0,0 +1,105 @@ +package org.nl.acs.device_driver.basedriver.lamp_three_color; + +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device_driver.DeviceDriver; +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.config.SpringContextHolder; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 标准版-三色灯 + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver { + protected ItemProtocol itemProtocol = new ItemProtocol(this); + + @Autowired + DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); + + String container; + String container_type_desc; + String last_container_type_desc; + String last_container; + //放货准备锁 + String putReadyLock = null; + //有货标记 + protected boolean has_goods_tag = false; + String devicecode; + int mode = 0; + int action = 0; + int error = 0; + int move = 0; + int task = 0; + int last_action = 0; + int last_mode = 0; + int last_error = 0; + int last_move = 0; + int last_task = 0; + + boolean hasVehicle = false; + boolean isReady = false; + protected int instruction_num = 0; + protected int instruction_num_truth = 0; + protected boolean hasGoods = false; + boolean isFold = false; + private String assemble_check_tag; + private Boolean sampleMode0; + private Boolean sampleMode3; + private Integer sampleError; + private Boolean sampleOnline; + protected String displayMessage = null; + public int display_message_time_out = 30000; + public Date display_message_time; + protected String current_stage_instruction_message; + protected String last_stage_instruction_message; + Integer heartbeat_tag; + private Date instruction_require_time = new Date(); + private Date instruction_finished_time = new Date(); + + private int instruction_require_time_out; + boolean requireSucess = false; + + private int instruction_finished_time_out; + + int branchProtocol = 0; + + String device_code = null; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() { + String message = null; + device_code = this.getDevice().getDevice_code(); + + } + + public void writing(String param, String value) { + + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + + Map itemMap = new HashMap(); + + itemMap.put(to_param, Integer.parseInt(value)); + this.control(itemMap); + logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value); + } + + +} diff --git a/acs/nladmin-ui/src/views/acs/device/config.vue b/acs/nladmin-ui/src/views/acs/device/config.vue index 5c27dbb..2c7ace5 100644 --- a/acs/nladmin-ui/src/views/acs/device/config.vue +++ b/acs/nladmin-ui/src/views/acs/device/config.vue @@ -87,12 +87,19 @@ import standard_stacker from '@/views/acs/device/driver/standard_stacker' import siemens_conveyor_labeling from '@/views/acs/device/driver/siemens_conveyor_labeling' import siemens_conveyor from '@/views/acs/device/driver/siemens_conveyor' import belt_conveyor from '@/views/acs/device/driver/belt_conveyor' +import lamp_three_color from '@/views/acs/device/driver/lamp_three_color' +import box_palletizing_manipulator from '@/views/acs/device/driver/box_palletizing_manipulator' +import hongxiang_conveyor from '@/views/acs/device/driver/hongxiang_conveyor' +import hongxiang_device from '@/views/acs/device/driver/hongxiang_device' +import oven_manipulator from '@/views/acs/device/driver/oven_manipulator' +import plug_pull_device_site from '@/views/acs/device/driver/plug_pull_device_site' +import slit_two_manipulator from '@/views/acs/device/driver/slit_two_manipulator' // import empty_vehicle_stacking_position from '@/views/acs/device/driver/empty_vehicle_stacking_position' import agv_ndc_one from '@/views/acs/device/driver/agv/agv_ndc_one' import agv_ndc_two from '@/views/acs/device/driver/agv/agv_ndc_two' import xg_agv from '@/views/acs/device/driver/agv/xg_agv' import led_screen from './driver/led_screen' -// import standard_station from '@/views/acs/device/driver/standard_station' +import standard_station from '@/views/acs/device/driver/standard_station' export default { name: 'DeviceConfig', @@ -115,8 +122,15 @@ export default { standard_stacker, siemens_conveyor_labeling, siemens_conveyor, - belt_conveyor - // standard_station + belt_conveyor, + lamp_three_color, + box_palletizing_manipulator, + hongxiang_conveyor, + hongxiang_device, + standard_station, + oven_manipulator, + plug_pull_device_site, + slit_two_manipulator }, dicts: ['device_type'], mixins: [crud], diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_station.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_station.vue new file mode 100644 index 0000000..c5a9488 --- /dev/null +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_station.vue @@ -0,0 +1,618 @@ + + + + +