设备监控驱动更新

This commit is contained in:
lyd
2022-08-17 18:29:26 +08:00
parent a02a2279f0
commit 8a65e47bbd
14 changed files with 807 additions and 93 deletions

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@@ -36,7 +37,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -403,4 +404,36 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
}
return flag;
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("container_type", this.getContainer_type());
jo.put("barcode", this.getBarcode());
jo.put("task", this.getTask());
jo.put("error", this.getError());
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device_driver.lnsh.lnsh_kiln_lane;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -13,6 +14,7 @@ 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.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@@ -28,7 +30,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshKilnLaneDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshKilnLaneDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -357,4 +359,46 @@ public class LnshKilnLaneDeviceDriver extends AbstractOpcDeviceDriver implements
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String status = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
}
if (this.getStatus() == 1) {
status = "待机";
} else if (this.getStatus() == 2) {
status = "生产中";
} else if (this.getStatus() == 3) {
status = "故障";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("open_time", this.getOpen_time());
jo.put("standby_time", this.getStandby_time());
jo.put("production_time", this.getProduction_time());
jo.put("error_time", this.getError_time());
jo.put("car_sum", this.getCar_sum());
jo.put("nullCar_qty", this.getNullCar_qty());
jo.put("burning_car_qty", this.getBurning_car_qty());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.lnsh.lnsh_labeling_machine;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -13,6 +14,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@@ -28,7 +30,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -227,4 +229,48 @@ public class LnshLabelingMachineDeviceDriver extends AbstractOpcDeviceDriver imp
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String status = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getStatus() == 1) {
status = "待机";
} else if (this.getStatus() == 2) {
status = "生产中";
} else if (this.getStatus() == 3) {
status = "故障";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
jo.put("isOnline", this.getIsonline());
jo.put("open_time", this.getOpen_time());
jo.put("close_time", this.getClose_time());
jo.put("standby_time", this.getStandby_time());
jo.put("production_time", this.getProduction_time());
jo.put("error_time", this.getError_time());
jo.put("labeling_qty", this.getLabeling_qty());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -16,6 +17,7 @@ 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.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
@@ -35,7 +37,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -402,4 +404,78 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D
return true;
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String move_1 = "";
String action_1 = "";
String walk_y = "";
String mode = "";
String status = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getStatus() == 1) {
status = "待机";
} else if (this.getStatus() == 2) {
status = "生产中";
} else if (this.getStatus() == 3) {
status = "故障";
}
if (this.getMove_1() == 0) {
move_1 = "无货";
} else if (this.getMove_1() == 1) {
move_1 = "有货";
} else if (this.getMove_1() == 2) {
move_1 = "有托盘有货";
}
if (this.getAction_1() == 1) {
action_1 = "取货中";
} else if (this.getAction_1() == 2) {
action_1 = "取货完成";
} else if (this.getAction_1() == 3) {
action_1 = "放货中";
} else if (this.getAction_1() == 4) {
action_1 = "放货完成";
}
if (this.getWalk_y() == 0) {
walk_y = "原位";
} else if (this.getWalk_y() == 2) {
walk_y = "非原位";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
jo.put("move_1", move_1);
jo.put("action_1", action_1);
jo.put("walk_y", walk_y);
jo.put("error", this.getError());
jo.put("task1", this.getTask1());
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
jo.put("task_qty", this.getTask_qty());
jo.put("finishTask_qty", this.getFinishTask_qty());
jo.put("batch", this.getBatch());
jo.put("specifications", this.getSpecifications());
jo.put("qty", this.getQty());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
@@ -35,7 +36,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -1244,4 +1245,71 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String status = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
} else if (this.getMode() == 4) {
mode = "人工排产确认";
} else if (this.getMode() == 5) {
mode = "获取托盘信息";
} else if (this.getMode() == 6) {
mode = "码垛完成";
} else if (this.getMode() == 7) {
mode = "码垛强制完成";
} else if (this.getMode() == 8) {
mode = "申请空盘";
}
if (this.getStatus() == 1) {
status = "待机";
} else if (this.getStatus() == 2) {
status = "生产中";
} else if (this.getStatus() == 3) {
status = "故障";
}
String onoff_status = "";
if (this.getOnoff_status() == 1) {
onoff_status = "关机";
} else if (this.getOnoff_status() == 2) {
onoff_status = "开机";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
jo.put("onoff_status", onoff_status);
jo.put("specifications", this.getSpecifications());
jo.put("batch", this.getBatch());
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("putStation", this.getPut_station());
jo.put("barcode", this.getBarcode());
jo.put("material", this.getMaterial());
jo.put("qty", this.getQty());
jo.put("open_time", this.getOpen_time());
jo.put("standby_time", this.getStandby_time());
jo.put("production_time", this.getProduction_time());
jo.put("error_time", this.getError_time());
jo.put("order_No", this.getOrder_No());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
@@ -36,7 +37,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -482,6 +483,69 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String status = "";
String action = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "工作中";
} else if (this.getMode() == 4) {
mode = "获取托盘信息";
} else if (this.getMode() == 5) {
mode = "码垛完成";
} else if (this.getMode() == 6) {
mode = "码垛强制完成";
} else if (this.getMode() == 7) {
mode = "申请空盘";
}
if (this.getStatus() == 1) {
status = "待机";
} else if (this.getStatus() == 2) {
status = "生产中";
} else if (this.getStatus() == 3) {
status = "故障";
}
if (this.getAction() == 0) {
action = "禁止取放";
} else if (this.getAction() == 1) {
action = "允许取货";
} else if (this.getAction() == 2) {
action = "允许放货";
} else if (this.getAction() == 3) {
action = "允许取放";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("put_station", this.getPut_station());
jo.put("material", this.getMaterial());
jo.put("encoder_qty", this.getEncoder_qty());
jo.put("specifications", this.getSpecifications());
jo.put("batch", this.getBatch());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
// public void writing(int type, int command) {
// String to_material_code = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
// + "." + ItemProtocol.item_to_material_code;

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@@ -35,7 +36,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -473,4 +474,78 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
return "";
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String io_action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 4) {
mode = "叫料";
} else if (this.getMode() == 5) {
mode = "申请空盘";
} else if (this.getMode() == 6) {
mode = "申请入库";
}
if (this.getAction() == 0) {
action = "禁止取放";
} else if (this.getAction() == 1) {
action = "允许取货";
} else if (this.getAction() == 2) {
action = "允许放货";
} else if (this.getAction() == 3) {
action = "允许取放";
}
if (this.getIo_action() == 0) {
io_action = "禁止进出";
} else if (this.getIo_action() == 1) {
io_action = "允许进入";
} else if (this.getIo_action() == 2) {
io_action = "允许离开";
} else if (this.getIo_action() == 3) {
io_action = "允许进出";
}
if (this.getMove() == 0) {
move = "无货";
} else if (this.getMove() == 1) {
move = "有货";
} else if (this.getMove() == 2) {
move = "有托盘有货";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("io_action", io_action);
jo.put("hasGoods", this.getHasGoods());
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
jo.put("task", this.getTask());
jo.put("weight", this.getWeight());
jo.put("material", this.getMaterial());
jo.put("barcode", this.getBarcode());
jo.put("specifications", this.getSpecifications());
jo.put("AlongSide", this.getAlongSide());
jo.put("BshortSide", this.getBshortSide());
jo.put("Htrapezoidal", this.getHtrapezoidal());
jo.put("Wthickness", this.getWthickness());
jo.put("batch", this.getBatch());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -16,6 +17,7 @@ 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.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
@@ -38,7 +40,7 @@ import java.util.Map;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -612,4 +614,106 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
Map<String, Object> itemMap = new HashMap<String, Object>();
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String move_1 = "";
String move_2 = "";
String action_1 = "";
String action_2 = "";
String walk_y = "";
String mode = "";
String status = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getStatus() == 1) {
status = "待机";
} else if (this.getStatus() == 2) {
status = "生产中";
} else if (this.getStatus() == 3) {
status = "故障";
}
if (this.getMove_1() == 0) {
move_1 = "无货";
} else if (this.getMove_1() == 1) {
move_1 = "有货";
} else if (this.getMove_1() == 2) {
move_1 = "有托盘有货";
}
if (this.getMove_2() == 0) {
move_2 = "无货";
} else if (this.getMove_2() == 1) {
move_2 = "有货";
} else if (this.getMove_2() == 2) {
move_2 = "有托盘有货";
}
if (this.getAction_1() == 1) {
action_1 = "取货中";
} else if (this.getAction_1() == 2) {
action_1 = "取货完成";
} else if (this.getAction_1() == 3) {
action_1 = "放货中";
} else if (this.getAction_1() == 4) {
action_1 = "放货完成";
}
if (this.getAction_2() == 1) {
action_2 = "取货中";
} else if (this.getAction_2() == 2) {
action_2 = "取货完成";
} else if (this.getAction_2() == 3) {
action_2 = "放货中";
} else if (this.getAction_2() == 4) {
action_2 = "放货完成";
}
if (this.getWalk_y() == 0) {
walk_y = "原位";
} else if (this.getWalk_y() == 2) {
walk_y = "非原位";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
jo.put("move_1", move_1);
jo.put("move_2", move_2);
jo.put("action_1", action_1);
jo.put("action_2", action_2);
jo.put("walk_y", walk_y);
jo.put("error", this.getError());
jo.put("task1", this.getTask1());
jo.put("task2", this.getTask2());
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
jo.put("open_time", this.getOpen_time());
jo.put("standby_time", this.getStandby_time());
jo.put("production_time", this.getProduction_time());
jo.put("error_time", this.getError_time());
jo.put("task_qty", this.getTask_qty());
jo.put("finishTask_qty", this.getFinishTask_qty());
jo.put("batch", this.getBatch());
jo.put("specifications", this.getSpecifications());
jo.put("qty", this.getQty());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
@@ -34,7 +35,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -1038,4 +1039,57 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "工作中";
} else if (this.getMode() == 5) {
mode = "获取托盘信息";
} else if (this.getMode() == 6) {
mode = "拆垛完成";
} else if (this.getMode() == 7) {
mode = "申请空盘";
}
String onoff_status = "";
if (this.getOnoff_status() == 0) {
onoff_status = "关机";
} else if (this.getOnoff_status() == 1) {
onoff_status = "开机";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("getStation", this.getGetStation());
jo.put("barcode", this.getBarcode());
jo.put("material", this.getMaterial());
jo.put("total_split", this.getTotal_split());
jo.put("open_time", this.getOpen_time());
jo.put("standby_time", this.getStandby_time());
jo.put("production_time", this.getProduction_time());
jo.put("error_time", this.getError_time());
jo.put("batch", this.getBatch());
jo.put("specifications", this.getSpecifications());
jo.put("qty", this.getQty());
jo.put("onoff_status", onoff_status);
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -19,6 +19,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
@@ -37,7 +38,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -661,4 +662,74 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
return "";
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String io_action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 4) {
mode = "叫料";
} else if (this.getMode() == 5) {
mode = "申请空盘";
} else if (this.getMode() == 6) {
mode = "申请入库";
}
if (this.getAction() == 0) {
action = "禁止取放";
} else if (this.getAction() == 1) {
action = "允许取货";
} else if (this.getAction() == 2) {
action = "允许放货";
} else if (this.getAction() == 3) {
action = "允许取放";
}
if (this.getIo_action() == 0) {
io_action = "禁止进出";
} else if (this.getIo_action() == 1) {
io_action = "允许进入";
} else if (this.getIo_action() == 2) {
io_action = "允许离开";
} else if (this.getIo_action() == 3) {
io_action = "允许进出";
}
if (this.getMove() == 0) {
move = "无货";
} else if (this.getMove() == 1) {
move = "有货";
} else if (this.getMove() == 2) {
move = "有托盘有货";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("io_action", io_action);
jo.put("hasGoods", this.getHasGoods());
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
jo.put("task", this.getTask());
jo.put("weight", this.getWeight());
jo.put("material", this.getMaterial());
jo.put("barcode", this.getBarcode());
jo.put("specifications", this.getSpecifications());
jo.put("batch", this.getBatch());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -17,6 +17,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
@@ -35,7 +36,7 @@ import java.util.*;
@Slf4j
@Data
@RequiredArgsConstructor
public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@@ -1315,4 +1316,36 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
ReadUtil.write(itemMap, server);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
jo.put("device_code", device.getDevice_code());
jo.put("mode", this.getMode());
jo.put("status", this.getStatus());
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("putStation", this.getPut_station());
jo.put("barcode", this.getBarcode());
jo.put("material", this.getMaterial());
jo.put("qty", this.getQty());
jo.put("open_time", this.getOpen_time());
jo.put("standby_time", this.getStandby_time());
jo.put("production_time", this.getProduction_time());
jo.put("error_time", this.getError_time());
jo.put("order_No", this.getOrder_No());
jo.put("onoff_status", this.getOnoff_status());
jo.put("getStation", this.getGetStation());
jo.put("specifications", this.getSpecifications());
jo.put("batch", this.getBatch());
jo.put("total_split", this.getTotal_split());
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -15,8 +15,10 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
@@ -434,6 +436,5 @@ public class SpecialOrdinarySiteDeviceDriver extends AbstractDeviceDriver implem
return true;
}
}
}