rev 优化
This commit is contained in:
@@ -27,6 +27,7 @@ import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
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;
|
||||
@@ -49,7 +50,7 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver {
|
||||
public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
protected org.nl.acs.device_driver.basedriver.indoor_manipulator.ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
@Autowired
|
||||
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
||||
@@ -647,6 +648,76 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
return taskDtos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
String mode = "";
|
||||
String move = "";
|
||||
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 = "运行中";
|
||||
}
|
||||
|
||||
if (this.getMove() == 0) {
|
||||
move = "无货";
|
||||
} else if (this.getMove() == 1) {
|
||||
move = "有货";
|
||||
}
|
||||
|
||||
String requireSucess = "0";
|
||||
if (this.requireSucess) {
|
||||
requireSucess = "1";
|
||||
}
|
||||
jo.put("requireSucess", requireSucess);
|
||||
if (this.getAction() == 2) {
|
||||
action = "反馈气胀轴尺寸";
|
||||
} else if (this.getAction() == 3) {
|
||||
action = "申请放货点";
|
||||
} else if (this.getAction() == 4) {
|
||||
action = "申请新取货点";
|
||||
} else if (this.getAction() == 5) {
|
||||
action = "申请二次放货点";
|
||||
} else if (this.getAction() == 6) {
|
||||
action = "缓存库取货完成";
|
||||
} else if (this.getAction() == 7) {
|
||||
action = "缓存线放货完成";
|
||||
} else if (this.getAction() == 8) {
|
||||
action = "任务完成";
|
||||
}
|
||||
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
jo.put("action", action);
|
||||
jo.put("task", task);
|
||||
jo.put("walk_y", String.valueOf(this.walk_y));
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", this.getError());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", this.getMessage());
|
||||
jo.put("is_click", true);
|
||||
jo.put("x", x_position);
|
||||
jo.put("y", y_position);
|
||||
jo.put("inflatable_shaft_size", this.inflatable_shaft_size);
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String requestSucess = data.getString("requireSucess");
|
||||
if (StrUtil.equals(requestSucess, "0")) {
|
||||
this.requireSucess = false;
|
||||
} else if (StrUtil.equals(requestSucess, "1")) {
|
||||
this.requireSucess = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void writing(String param, String value) {
|
||||
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
|
||||
@@ -308,7 +308,6 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
String mode = "";
|
||||
String action = "";
|
||||
String move = "";
|
||||
if (this.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
@@ -318,6 +317,8 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
mode = "联机";
|
||||
} else if (this.getMode() == 3) {
|
||||
mode = "运行中";
|
||||
} else if (this.getMode() == 4) {
|
||||
mode = "套轴申请";
|
||||
}
|
||||
|
||||
if (this.getMove() == 0) {
|
||||
@@ -335,6 +336,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
jo.put("move", move);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", this.getMessage());
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
return this.device;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
@@ -108,6 +109,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
qty2 = this.itemProtocol.getQty2();
|
||||
task = this.itemProtocol.getTask();
|
||||
|
||||
|
||||
if (mode != last_mode) {
|
||||
this.requireSucess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
@@ -259,6 +261,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
mode = "联机";
|
||||
} else if (this.getMode() == 3) {
|
||||
mode = "运行中";
|
||||
} else if (this.getMode() == 4) {
|
||||
mode = "反馈重量";
|
||||
}
|
||||
|
||||
if (this.getMove1() == 0 && this.getMove2() == 0) {
|
||||
@@ -274,6 +278,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
jo.put("move2", move2);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("qty1", this.getQty1());
|
||||
jo.put("qty2", this.getQty2());
|
||||
jo.put("message", this.getMessage());
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -634,6 +634,15 @@ export default {
|
||||
} else if (val === 'task_id') {
|
||||
const obj = { name: '任务号', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'inflatable_shaft_size') {
|
||||
const obj = { name: '任务号', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'qty1') {
|
||||
const obj = { name: '任务号', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'qty2') {
|
||||
const obj = { name: '任务号', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user