晟华驱动更新
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
//驱动索引
|
||||
|
||||
@@ -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<ItemDto> 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<ItemDto> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return LnshCrusherDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
return types;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemDto> getReadableItemDtos() {
|
||||
return getReadableItemDtos2();
|
||||
}
|
||||
|
||||
public static List<ItemDto> 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<ItemDto> getWriteableItemDtos() {
|
||||
return ItemProtocol.getWriteableItemDtos();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<String, Object> 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<String, Object> itemMap = new HashMap<String, Object>();
|
||||
|
||||
itemMap.put(to_param, value);
|
||||
ReadUtil.write(itemMap, server);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -120,25 +120,25 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> 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<ItemDto> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,16 +57,16 @@ public class LnshPackageSiteDefination implements OpcDeviceDriverDefination {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos2() {
|
||||
List<ItemDto> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user