From a5f1e62e8ad1719c4640b98e9b3296b56571340b Mon Sep 17 00:00:00 2001 From: loujf Date: Mon, 22 Aug 2022 18:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=9F=E5=8D=8E=E9=A9=B1=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/device_driver/DriverTypeEnum.java | 4 +- .../lnsh/lnsh_crusher/ItemProtocol.java | 145 ++++++ .../lnsh_crusher/LnshCrusherDefination.java | 78 +++ .../lnsh_crusher/LnshCrusherDeviceDriver.java | 251 ++++++++++ .../lnsh_fold_disc_site/ItemProtocol.java | 2 +- .../lnsh/lnsh_kiln_lane/ItemProtocol.java | 2 +- .../lnsh/lnsh_kiln_truss/ItemProtocol.java | 2 +- .../lnsh/lnsh_mixing_mill/ItemProtocol.java | 2 +- .../lnsh_out_kiln_truss/ItemProtocol.java | 2 +- .../lnsh/lnsh_package_line/ItemProtocol.java | 2 +- .../ItemProtocol.java | 2 +- .../lnsh/lnsh_package_site/ItemProtocol.java | 28 +- .../LnshPackageSiteDefination.java | 20 +- .../lnsh_pallet_storage/ItemProtocol.java | 2 +- .../ItemProtocol.java | 2 +- .../lnsh/lnsh_press/ItemProtocol.java | 2 +- .../lnsh/lnsh_rgv/ItemProtocol.java | 2 +- .../lnsh_split_manipulator/ItemProtocol.java | 2 +- .../service/impl/StageActorServiceImpl.java | 39 +- acs/qd/src/views/acs/device/config.vue | 4 +- .../driver/lnsh/lnsh_Laminating_machine.vue | 1 + .../acs/device/driver/lnsh/lnsh_crusher.vue | 474 ++++++++++++++++++ .../driver/lnsh/lnsh_fold_disc_site.vue | 1 + .../acs/device/driver/lnsh/lnsh_kiln_lane.vue | 1 + .../device/driver/lnsh/lnsh_kiln_truss.vue | 1 + .../driver/lnsh/lnsh_labeling_machine.vue | 1 + .../device/driver/lnsh/lnsh_mixing_mill.vue | 69 ++- .../driver/lnsh/lnsh_out_kiln_truss.vue | 1 + .../device/driver/lnsh/lnsh_package_line.vue | 1 + .../lnsh/lnsh_package_pallet_manipulator.vue | 1 + .../device/driver/lnsh/lnsh_package_site.vue | 19 +- .../driver/lnsh/lnsh_pallet_storage.vue | 1 + .../lnsh/lnsh_palletizing_manipulator.vue | 1 + .../acs/device/driver/lnsh/lnsh_press.vue | 1 + .../views/acs/device/driver/lnsh/lnsh_rgv.vue | 1 + .../driver/lnsh/lnsh_split_manipulator.vue | 1 + .../acs/device/driver/lnsh/lnsh_station.vue | 4 + .../device/driver/standard_inspect_site.vue | 3 + .../src/views/acs/device/protocol/index.vue | 1 + acs/qd/src/views/acs/monitor/device/index.vue | 6 + .../src/views/acs/route/routeLine/index.vue | 2 + 41 files changed, 1120 insertions(+), 64 deletions(-) create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/ItemProtocol.java create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDefination.java create mode 100644 acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDeviceDriver.java create mode 100644 acs/qd/src/views/acs/device/driver/lnsh/lnsh_crusher.vue diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index d3a7ee7..2b458b9 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -111,7 +111,9 @@ public enum DriverTypeEnum { LNSH_LAMINATING_MACHINE(51, "lnsh_Laminating_machine", "晟华-覆膜机", "station"), - LNSH_PACKAGE_SITE(52, "lnsh_package_site", "晟华-包装线工位", "station"); + LNSH_PACKAGE_SITE(52, "lnsh_package_site", "晟华-包装线工位", "station"), + + LNSH_CRUSHER(52, "lnsh_crusher", "晟华-破碎机", "station"); //驱动索引 diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/ItemProtocol.java new file mode 100644 index 0000000..38b9399 --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/ItemProtocol.java @@ -0,0 +1,145 @@ +package org.nl.acs.device_driver.lnsh.lnsh_crusher; + +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Data +public class ItemProtocol { + public static String item_heartbeat = "heartbeat"; + public static String item_mode = "mode"; + public static String item_status = "status"; + public static String item_error = "error"; + public static String item_open_time = "open_time"; + public static String item_standby_time = "standby_time"; + public static String item_production_time = "production_time"; + public static String item_error_time = "error_time"; + public static String item_close_time = "close_time"; + public static String item_material = "material"; + public static String item_waitBroken_weight = "waitBroken_weight"; + public static String item_alreadyBroken_weight = "alreadyBroken_weight"; + public static String item_to_command = "to_command"; + public static String item_to_error = "to_error"; + Boolean isonline; + + private LnshCrusherDeviceDriver driver; + + public ItemProtocol(LnshCrusherDeviceDriver driver) { + this.driver = driver; + } + + public int getHeartbeat() { + return this.getOpcIntegerValue(item_heartbeat); + } + + public int getMode() { + return this.getOpcIntegerValue(item_mode); + } + + public int getStatus() { + return this.getOpcIntegerValue(item_status); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + public int getOpen_time() { + return this.getOpcIntegerValue(item_open_time); + } + + public int getStandby_time() { + return this.getOpcIntegerValue(item_standby_time); + } + + public int getProduction_time() { + return this.getOpcIntegerValue(item_production_time); + } + + public int getError_time() { + return this.getOpcIntegerValue(item_error_time); + } + + public int getClose_time() { + return this.getOpcIntegerValue(item_close_time); + } + + public String getMaterial() { + return this.getOpcStringValue(item_material); + } + + public int getWaitBroken_weight() { + return this.getOpcIntegerValue(item_waitBroken_weight); + } + + public int getAlreadyBroken_weight() { + return this.getOpcIntegerValue(item_alreadyBroken_weight); + } + + public int getTo_command() { + return this.getOpcIntegerValue(item_to_command); + } + + public int getTo_error() { + return this.getOpcIntegerValue(item_to_error); + } + + + //是否有货 + public int hasGoods(int move) { + return move; + } + + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + } + + public String getOpcStringValue(String protocol) { + String value = this.driver.getStringValue(protocol); + if (value == null) { + log.error("读取错误!"); + } else { + return value; + } + return "0"; + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); + list.add(new ItemDto(item_mode, "工作状态", "DB1.B1", Boolean.valueOf(true))); + list.add(new ItemDto(item_status, "设备状态", "DB1.B2")); + list.add(new ItemDto(item_error, "故障", "DB1.B3")); + list.add(new ItemDto(item_open_time, "开机时间", "DB1.D4")); + list.add(new ItemDto(item_standby_time, "待机时间", "DB1.D8")); + list.add(new ItemDto(item_production_time, "生产时间", "DB1.D12")); + list.add(new ItemDto(item_error_time, "故障时间", "DB1.D16")); + list.add(new ItemDto(item_close_time, "关机时间", "DB1.D20")); + list.add(new ItemDto(item_material, "当前生产物料", "DB1.S24")); + list.add(new ItemDto(item_waitBroken_weight, "待破碎重量", "DB1.D280")); + list.add(new ItemDto(item_alreadyBroken_weight, "已破碎重量", "DB1.D284")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0", Boolean.valueOf(true))); + list.add(new ItemDto(item_to_error, "下发故障", "DB2.W2")); + return list; + } + +} + diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDefination.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDefination.java new file mode 100644 index 0000000..0ec7ac4 --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDefination.java @@ -0,0 +1,78 @@ +package org.nl.acs.device_driver.lnsh.lnsh_crusher; + +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.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; + +/** + * 晟华破碎机 + */ +@Service +public class LnshCrusherDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "lnsh_crusher"; + } + + @Override + public String getDriverName() { + return "晟华-破碎机"; + } + + @Override + public String getDriverDescription() { + return "晟华-破碎机"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new LnshCrusherDeviceDriver()).setDevice(device).setDriverDefination(this); + } + + @Override + public Class getDeviceDriverType() { + return LnshCrusherDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList(); + types.add(DeviceType.station); + return types; + } + + @Override + public List getReadableItemDtos() { + return getReadableItemDtos2(); + } + + public static List getReadableItemDtos2() { + ArrayList list = new ArrayList(); + list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB1.B0")); + list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB1.B1", Boolean.valueOf(true))); + list.add(new ItemDto(ItemProtocol.item_status, "设备状态", "DB1.B2")); + list.add(new ItemDto(ItemProtocol.item_error, "故障", "DB1.B3")); + list.add(new ItemDto(ItemProtocol.item_open_time, "开机时间", "DB1.D4")); + list.add(new ItemDto(ItemProtocol.item_standby_time, "待机时间", "DB1.D8")); + list.add(new ItemDto(ItemProtocol.item_production_time, "生产时间", "DB1.D12")); + list.add(new ItemDto(ItemProtocol.item_error_time, "故障时间", "DB1.D16")); + list.add(new ItemDto(ItemProtocol.item_close_time, "关机时间", "DB1.D20")); + list.add(new ItemDto(ItemProtocol.item_material, "当前生产物料", "DB1.S24")); + list.add(new ItemDto(ItemProtocol.item_waitBroken_weight, "待破碎重量", "DB1.D280")); + list.add(new ItemDto(ItemProtocol.item_alreadyBroken_weight, "已破碎重量", "DB1.D284")); + return list; + } + + @Override + public List getWriteableItemDtos() { + return ItemProtocol.getWriteableItemDtos(); + } + +} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDeviceDriver.java new file mode 100644 index 0000000..8f06af2 --- /dev/null +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_crusher/LnshCrusherDeviceDriver.java @@ -0,0 +1,251 @@ +package org.nl.acs.device_driver.lnsh.lnsh_crusher; + +import cn.hutool.core.util.StrUtil; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; +import org.nl.acs.device.service.DeviceService; +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.instruction.service.InstructionService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.log.service.LogServer; +import org.nl.acs.opc.Device; +import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.task.service.TaskService; +import org.nl.utils.SpringContextHolder; +import org.openscada.opc.lib.da.Server; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 晟华破碎机 + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class LnshCrusherDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); + @Autowired + DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); + @Autowired + RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); + @Autowired + TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); + @Autowired + LogServer logServer = SpringContextHolder.getBean("logServerImpl"); + + String device_code; + int mode = 0; + int error = 0; + int last_mode = 0; + int last_error = 0; + Boolean isonline = true; + Boolean iserror = false; + + boolean requireSucess = false; + + int heartbeat; + int last_heartbeat; + private Date checkHeartbeattime = new Date(); + private Date last_checkHeartbeattime = new Date(); + + String message; + int status = 0; + int last_status = 0; + //开机时间 + int open_time = 0; + int last_open_time = 0; + //待机时间 + int standby_time = 0; + int last_standby_time = 0; + //生产时间 + int production_time = 0; + int last_production_time = 0; + //故障时间 + int error_time = 0; + int last_error_time = 0; + //关机时间 + int close_time = 0; + int last_close_time = 0; + //待破碎重量 + int waitBroken_weight = 0; + int last_waitBroken_weight = 0; + + //已破碎重量 + int alreadyBroken_weight = 0; + int last_alreadyBroken_weight = 0; + + String material; + String last_material; + + @Override + public Device getDevice() { + return this.device; + } + + + @Override + public void execute() { + String message = null; + try { + device_code = this.getDeviceCode(); + mode = this.itemProtocol.getMode(); + status = this.itemProtocol.getStatus(); + error = this.itemProtocol.getError(); + open_time = this.itemProtocol.getOpen_time(); + standby_time = this.itemProtocol.getStandby_time(); + production_time = this.itemProtocol.getProduction_time(); + error_time = this.itemProtocol.getError_time(); + close_time = this.itemProtocol.getClose_time(); + material = this.itemProtocol.getMaterial(); + waitBroken_weight = this.itemProtocol.getWaitBroken_weight(); + alreadyBroken_weight = this.itemProtocol.getAlreadyBroken_weight(); + + if (mode != last_mode) { + this.setRequireSucess(false); + logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); + logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode); + } + if (status != last_status) { + logServer.deviceLog(this.device_code,"status" ,String.valueOf(status)); + logServer.deviceLogToacs(this.device_code,"","","信号status:" + last_status + "->" + status); + } + if (error != last_error) { + logServer.deviceLog(this.device_code,"error" ,String.valueOf(error)); + logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error); + } + if (open_time != last_open_time) { + logServer.deviceLog(this.device_code,"open_time" ,String.valueOf(open_time)); + logServer.deviceLogToacs(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); + } + if (standby_time != last_standby_time) { + logServer.deviceLog(this.device_code,"standby_time" ,String.valueOf(standby_time)); + logServer.deviceLogToacs(this.device_code,"","","信号standby_time:" + last_standby_time + "->" + standby_time); + } + if (production_time != last_production_time) { + logServer.deviceLog(this.device_code,"production_time" ,String.valueOf(production_time)); + logServer.deviceLogToacs(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); + } + if (error_time != last_error_time) { + logServer.deviceLog(this.device_code,"error_time" ,String.valueOf(error_time)); + logServer.deviceLogToacs(this.device_code,"","","信号error_time:" + last_error_time + "->" + error_time); + } + if (close_time != last_close_time) { + logServer.deviceLog(this.device_code,"close_time" ,String.valueOf(close_time)); + logServer.deviceLogToacs(this.device_code,"","","信号close_time:" + last_close_time + "->" + close_time); + } + if (!StrUtil.equals(material,last_material)) { + logServer.deviceLog(this.device_code,"barcode", material); + logServer.deviceLogToacs(this.device_code,"","","信号material:" + last_material + "->" + material); + } + if (waitBroken_weight != last_waitBroken_weight) { + logServer.deviceLog(this.device_code,"waitBroken_weight" ,String.valueOf(waitBroken_weight)); + logServer.deviceLogToacs(this.device_code,"","","信号waitBroken_weight:" + last_waitBroken_weight + "->" + waitBroken_weight); + } + if (alreadyBroken_weight != last_alreadyBroken_weight) { + logServer.deviceLog(this.device_code,"alreadyBroken_weight" ,String.valueOf(alreadyBroken_weight)); + logServer.deviceLogToacs(this.device_code,"","","信号alreadyBroken_weight:" + last_alreadyBroken_weight + "->" + alreadyBroken_weight); + } + + } catch (Exception var17) { + return; + } + + //急停 + if (this.isStop()) { + + //未在线无心跳 + } else if (!this.itemProtocol.getIsonline()) { + this.setIsonline(false); + this.setIserror(true); + message = "信号量同步异常"; + //未联机 + } else if (mode == 0) { + this.setIsonline(false); + this.setIserror(true); + message = "未联机"; + //有报警 + } else if (error != 0) { + this.setIsonline(false); + this.setIserror(true); + message = "有报警"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + switch (mode) { + case 1: + log.debug("设备运转模式:等待工作"); + break; + case 2: + + break; + case 3: + + break; + case 4: + break; + } + } + + last_mode = mode; + last_status = status; + last_error = error; + last_open_time = open_time; + last_standby_time = standby_time; + last_production_time = production_time; + last_error_time = error_time; + last_close_time = close_time; + last_material = material; + last_waitBroken_weight = waitBroken_weight; + last_alreadyBroken_weight = alreadyBroken_weight; + } + + + protected void thingToNothing() throws Exception { + this.setRequireSucess(false); + } + + public boolean exe_error() { + if (this.error == 0) { + return true; + } else { + log.debug("设备报警"); + return false; + } + } + + public boolean exe_business() { + return true; + } + + public void executing(Server server, Map itemMap) { + ReadUtil.write(itemMap, server); + } + + 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; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + + itemMap.put(to_param, value); + ReadUtil.write(itemMap, server); + } + +} diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/ItemProtocol.java index e41602e..695796c 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/ItemProtocol.java @@ -15,7 +15,7 @@ public class ItemProtocol { public static String item_status = "status"; public static String item_open_time = "open_time"; public static String item_close_time = "close_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_container_qty = "container_qty"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/ItemProtocol.java index 87d1169..7d0b857 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_lane/ItemProtocol.java @@ -14,7 +14,7 @@ public class ItemProtocol { public static String item_mode = "mode"; public static String item_status = "status"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_car_sum = "car_sum"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_truss/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_truss/ItemProtocol.java index f65d4e6..d864d9b 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_truss/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_kiln_truss/ItemProtocol.java @@ -14,7 +14,7 @@ public class ItemProtocol { public static String item_mode = "mode"; public static String item_status = "status"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_to_command = "to_command"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/ItemProtocol.java index 08a5b28..53a9f1e 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/ItemProtocol.java @@ -16,7 +16,7 @@ public class ItemProtocol { public static String item_status = "status"; public static String item_error = "error"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_weight = "weight"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_out_kiln_truss/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_out_kiln_truss/ItemProtocol.java index 33ceef0..4511932 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_out_kiln_truss/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_out_kiln_truss/ItemProtocol.java @@ -17,7 +17,7 @@ public class ItemProtocol { public static String item_outKiln_barcode = "outKiln_barcode"; public static String item_outKiln_device = "outKiln_device"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_to_command = "to_command"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/ItemProtocol.java index aa1e797..d1c3860 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/ItemProtocol.java @@ -14,7 +14,7 @@ public class ItemProtocol { public static String item_mode = "mode"; public static String item_status = "status"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_barcode = "barcode"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/ItemProtocol.java index 463336d..1847021 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/ItemProtocol.java @@ -22,7 +22,7 @@ public class ItemProtocol { public static String item_material = "material"; public static String item_qty = "qty"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_order_No = "order_No"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/ItemProtocol.java index 7b93baf..cda9c82 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/ItemProtocol.java @@ -120,25 +120,25 @@ public class ItemProtocol { public static List getReadableItemDtos() { ArrayList list = new ArrayList(); - list.add(new ItemDto(item_heartbeat, "心跳", "DB4.B0")); - list.add(new ItemDto(item_mode, "工作状态", "DB4.B1", Boolean.valueOf(true))); - list.add(new ItemDto(item_move, "光电开关信号", "DB4.B2")); - list.add(new ItemDto(item_action, "取放信号", "DB4.B3")); - list.add(new ItemDto(item_ioaction, "进出信号", "DB4.B4")); - list.add(new ItemDto(item_error, "报警信号", "DB4.B5")); - list.add(new ItemDto(item_task, "任务号", "DB4.D6")); - list.add(new ItemDto(item_weight, "重量", "DB4.D10")); - list.add(new ItemDto(item_material, "物料", "DB4.S14")); - list.add(new ItemDto(item_barcode, "条码", "DB4.S270")); + list.add(new ItemDto(item_heartbeat, "心跳", "DB3.B0")); + list.add(new ItemDto(item_mode, "工作状态", "DB3.B1", Boolean.valueOf(true))); + list.add(new ItemDto(item_move, "光电开关信号", "DB3.B2")); + list.add(new ItemDto(item_action, "取放信号", "DB3.B3")); + list.add(new ItemDto(item_ioaction, "进出信号", "DB3.B4")); + list.add(new ItemDto(item_error, "报警信号", "DB3.B5")); + list.add(new ItemDto(item_task, "任务号", "DB3.D6")); + list.add(new ItemDto(item_weight, "重量", "DB3.D10")); + list.add(new ItemDto(item_material, "物料", "DB3.S14")); + list.add(new ItemDto(item_barcode, "条码", "DB3.S270")); return list; } public static List getWriteableItemDtos() { ArrayList list = new ArrayList(); - list.add(new ItemDto(item_to_command, "作业命令", "DB35.W0", Boolean.valueOf(true))); - list.add(new ItemDto(item_to_target, "目标站", "DB35.W2")); - list.add(new ItemDto(item_to_task, "任务号", "DB35.D4")); - list.add(new ItemDto(item_to_isPackage, "是否包装", "DB35.D8")); + list.add(new ItemDto(item_to_command, "作业命令", "DB4.W0", Boolean.valueOf(true))); + list.add(new ItemDto(item_to_target, "目标站", "DB4.W2")); + list.add(new ItemDto(item_to_task, "任务号", "DB4.D4")); + list.add(new ItemDto(item_to_isPackage, "是否包装", "DB4.D8")); return list; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/LnshPackageSiteDefination.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/LnshPackageSiteDefination.java index 58caad0..b9b219c 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/LnshPackageSiteDefination.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/LnshPackageSiteDefination.java @@ -57,16 +57,16 @@ public class LnshPackageSiteDefination implements OpcDeviceDriverDefination { public static List getReadableItemDtos2() { List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB4.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB4.B1", Boolean.valueOf(true))); - list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB4.B2")); - list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB4.B3")); - list.add(new ItemDto(ItemProtocol.item_ioaction, "进出信号", "DB4.B4")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB4.B5")); - list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB4.D6")); - list.add(new ItemDto(ItemProtocol.item_weight, "重量", "DB4.D10")); - list.add(new ItemDto(ItemProtocol.item_material, "物料", "DB4.S14")); - list.add(new ItemDto(ItemProtocol.item_barcode, "条码", "DB4.S270")); + list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB3.B0")); + list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB3.B1", Boolean.valueOf(true))); + list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB3.B2")); + list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB3.B3")); + list.add(new ItemDto(ItemProtocol.item_ioaction, "进出信号", "DB3.B4")); + list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB3.B5")); + list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB3.D6")); + list.add(new ItemDto(ItemProtocol.item_weight, "重量", "DB3.D10")); + list.add(new ItemDto(ItemProtocol.item_material, "物料", "DB3.S14")); + list.add(new ItemDto(ItemProtocol.item_barcode, "条码", "DB3.S270")); return list; } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_pallet_storage/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_pallet_storage/ItemProtocol.java index 35caeef..1561341 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_pallet_storage/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_pallet_storage/ItemProtocol.java @@ -15,7 +15,7 @@ public class ItemProtocol { public static String item_status = "status"; public static String item_open_time = "open_time"; public static String item_close_time = "close_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_tray_crib_qty = "tray_crib_qty"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java index 331010e..75885ed 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/ItemProtocol.java @@ -23,7 +23,7 @@ public class ItemProtocol { public static String item_material = "material"; public static String item_encoder_qty = "encoder_qty"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_product_code = "product_code"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java index c0af21e..09fbc61 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java @@ -16,7 +16,7 @@ public class ItemProtocol { public static String item_status = "status"; public static String item_error = "error"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_material = "material"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java index afaff1b..8f7fc6c 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java @@ -23,7 +23,7 @@ public class ItemProtocol { public static String item_task1 = "task1"; public static String item_task2 = "task2"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_to_command = "to_command"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java index 00bb0e0..288722b 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java @@ -19,7 +19,7 @@ public class ItemProtocol { public static String item_getStation = "getStation"; public static String item_barcode = "barcode"; public static String item_open_time = "open_time"; - public static String item_standby_time = "standby_time "; + public static String item_standby_time = "standby_time"; public static String item_production_time = "production_time"; public static String item_error_time = "error_time"; public static String item_material = "material"; diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java index 0fc832a..faac98f 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/stage/service/impl/StageActorServiceImpl.java @@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device_driver.electric_fence.ElectricFenceDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; +import org.nl.acs.device_driver.lnsh.lnsh_crusher.LnshCrusherDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site.LnshFoldDiscSiteDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_kiln_lane.LnshKilnLaneDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_kiln_truss.LnshKilnTrussDeviceDriver; @@ -373,6 +374,8 @@ public class StageActorServiceImpl implements StageActorService { LnshLaminatingMachineDeviceDriver lnshLaminatingMachineDeviceDriver; //晟华-包装线工位 LnshPackageSiteDeviceDriver lnshPackageSiteDeviceDriver; + //晟华-破碎机 + LnshCrusherDeviceDriver lnshCrusherDeviceDriver; if (device.getDeviceDriver() instanceof StandardCoveyorControlDeviceDriver) { standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); @@ -737,7 +740,6 @@ public class StageActorServiceImpl implements StageActorService { } obj.put("device_name", standardOrdinarySiteDeviceDriver.getDevice().getDevice_name()); jo.put("move", move); - jo.put("container", standardOrdinarySiteDeviceDriver.getContainer()); jo.put("hasGoods", standardOrdinarySiteDeviceDriver.getHasGoods()); jo.put("isOnline", true); //点击弹出 @@ -1627,6 +1629,41 @@ public class StageActorServiceImpl implements StageActorService { jo.put("standby_time", lnshRGVDeviceDriver.getStandby_time()); jo.put("production_time", lnshRGVDeviceDriver.getProduction_time()); jo.put("error_time", lnshRGVDeviceDriver.getError_time()); + } else if (device.getDeviceDriver() instanceof LnshCrusherDeviceDriver) { + lnshCrusherDeviceDriver = (LnshCrusherDeviceDriver) device.getDeviceDriver(); + if (lnshCrusherDeviceDriver.getMode() == 0) { + mode = "未联机"; + } else if (lnshCrusherDeviceDriver.getMode() == 1) { + mode = "单机"; + } else if (lnshCrusherDeviceDriver.getMode() == 2) { + mode = "联机"; + } else if (lnshCrusherDeviceDriver.getMode() == 3) { + mode = "运行中"; + } + + if (lnshCrusherDeviceDriver.getStatus() == 1) { + status = "待机"; + } else if (lnshCrusherDeviceDriver.getStatus() == 2) { + status = "生产中"; + } else if (lnshCrusherDeviceDriver.getStatus() == 3) { + status = "故障"; + } + + obj.put("device_name", lnshCrusherDeviceDriver.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("status", status); + jo.put("error", lnshCrusherDeviceDriver.getError()); + jo.put("isOnline", lnshCrusherDeviceDriver.getIsonline()); + jo.put("open_time", lnshCrusherDeviceDriver.getOpen_time()); + jo.put("standby_time", lnshCrusherDeviceDriver.getStandby_time()); + jo.put("production_time", lnshCrusherDeviceDriver.getProduction_time()); + jo.put("error_time", lnshCrusherDeviceDriver.getError_time()); + jo.put("close_time", lnshCrusherDeviceDriver.getClose_time()); + jo.put("material", lnshCrusherDeviceDriver.getMaterial()); + jo.put("waitBroken_weight", lnshCrusherDeviceDriver.getWaitBroken_weight()); + jo.put("alreadyBroken_weight", lnshCrusherDeviceDriver.getAlreadyBroken_weight()); + jo.put("isError", lnshCrusherDeviceDriver.getIserror()); + jo.put("message", lnshCrusherDeviceDriver.getMessage()); } obj.put("data", jo); } diff --git a/acs/qd/src/views/acs/device/config.vue b/acs/qd/src/views/acs/device/config.vue index b6cf969..5e77338 100644 --- a/acs/qd/src/views/acs/device/config.vue +++ b/acs/qd/src/views/acs/device/config.vue @@ -45,6 +45,7 @@ + +
+ + +
+ 设备协议: +
+ + + + OpcServer: + + + + + + PLC: + + + + + + +
+ + +
+ 输送系统: +
+ + + + + + + + + +
+ + +
+ 指令相关: +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ AGV相关: +
+ + + + + + + + + + + + + + +
+ + +
+ PLC读取字段: +
+ + + + + + + + + + + + + + +
+ + +
+ PLC写入字段: +
+ + + + + + + + + + + + + + +
+ + +
+ + 保存 + +
+
+ +
+ + + + + diff --git a/acs/qd/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue b/acs/qd/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue index aa6aae1..2abf5fa 100644 --- a/acs/qd/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue +++ b/acs/qd/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue @@ -13,6 +13,7 @@ v-model="opc_id" placeholder="无" clearable + filterable @change="changeOpc" >