fix
This commit is contained in:
@@ -1,60 +1,60 @@
|
|||||||
package org.nl.acs.device_driver.box_manipulator;
|
//package org.nl.acs.device_driver.box_manipulator;
|
||||||
|
//
|
||||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
//import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||||
import org.nl.acs.device.domain.Device;
|
//import org.nl.acs.device.domain.Device;
|
||||||
import org.nl.acs.device.enums.DeviceType;
|
//import org.nl.acs.device.enums.DeviceType;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
//import org.nl.acs.device_driver.DeviceDriver;
|
||||||
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
//import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
||||||
import org.nl.acs.device_driver.manipulator.standard_manipulator.StandardItemProtocol;
|
//import org.nl.acs.device_driver.manipulator.standard_manipulator.StandardItemProtocol;
|
||||||
import org.springframework.stereotype.Service;
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
import java.util.LinkedList;
|
//import java.util.LinkedList;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
@Service
|
//@Service
|
||||||
public class BoxManipulatorDefination implements OpcDeviceDriverDefination {
|
//public class BoxManipulatorDefination implements OpcDeviceDriverDefination {
|
||||||
@Override
|
// @Override
|
||||||
public String getDriverCode() {
|
// public String getDriverCode() {
|
||||||
return "box_manipulator";
|
// return "box_manipulator";
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public String getDriverName() {
|
// public String getDriverName() {
|
||||||
return "装箱行架机械手";
|
// return "装箱行架机械手";
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public String getDriverDescription() {
|
// public String getDriverDescription() {
|
||||||
return "装箱行架机械手";
|
// return "装箱行架机械手";
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public DeviceDriver getDriverInstance(Device device) {
|
// public DeviceDriver getDriverInstance(Device device) {
|
||||||
return (new BoxManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
// return (new BoxManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
// public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||||
return BoxManipulatorDeviceDriver.class;
|
// return BoxManipulatorDeviceDriver.class;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public List<DeviceType> getFitDeviceTypes() {
|
// public List<DeviceType> getFitDeviceTypes() {
|
||||||
List<DeviceType> types = new LinkedList();
|
// List<DeviceType> types = new LinkedList();
|
||||||
types.add(DeviceType.station);
|
// types.add(DeviceType.station);
|
||||||
return types;
|
// return types;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public List<ItemDto> getReadableItemDtos() {
|
// public List<ItemDto> getReadableItemDtos() {
|
||||||
return StandardItemProtocol.getReadableItemDtos();
|
// return StandardItemProtocol.getReadableItemDtos();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public List<ItemDto> getWriteableItemDtos() {
|
// public List<ItemDto> getWriteableItemDtos() {
|
||||||
return StandardItemProtocol.getWriteableItemDtos();
|
// return StandardItemProtocol.getWriteableItemDtos();
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -1,396 +1,396 @@
|
|||||||
package org.nl.acs.device_driver.box_manipulator;
|
//package org.nl.acs.device_driver.box_manipulator;
|
||||||
|
//
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
//import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
//import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
//import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
//import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.common.base.CommonFinalParam;
|
//import org.nl.acs.common.base.CommonFinalParam;
|
||||||
import org.nl.acs.device.domain.Device;
|
//import org.nl.acs.device.domain.Device;
|
||||||
import org.nl.acs.device.service.DeviceExtraService;
|
//import org.nl.acs.device.service.DeviceExtraService;
|
||||||
import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
|
//import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
//import org.nl.acs.device_driver.DeviceDriver;
|
||||||
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
//import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
//import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
//import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
//import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.device_driver.manipulator.standard_manipulator.StandardItemProtocol;
|
//import org.nl.acs.device_driver.manipulator.standard_manipulator.StandardItemProtocol;
|
||||||
import org.nl.acs.history.ErrorUtil;
|
//import org.nl.acs.history.ErrorUtil;
|
||||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
//import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
//import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||||
import org.nl.acs.instruction.domain.Instruction;
|
//import org.nl.acs.instruction.domain.Instruction;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
//import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
//import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
//import org.nl.acs.monitor.DeviceStageMonitor;
|
||||||
import org.nl.acs.opc.DeviceAppService;
|
//import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
//import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
import org.nl.acs.route.service.RouteLineService;
|
//import org.nl.acs.route.service.RouteLineService;
|
||||||
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
//import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||||
import org.nl.acs.task.service.TaskService;
|
//import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.config.SpringContextHolder;
|
//import org.nl.config.SpringContextHolder;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
//
|
||||||
import java.util.Date;
|
//import java.util.Date;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* 装箱行架机械手
|
// * 装箱行架机械手
|
||||||
*/
|
// */
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
@Data
|
//@Data
|
||||||
@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
public class BoxManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed {
|
//public class BoxManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed {
|
||||||
|
//
|
||||||
protected StandardItemProtocol standardItemProtocol = new StandardItemProtocol("2");
|
// protected StandardItemProtocol standardItemProtocol = new StandardItemProtocol("2");
|
||||||
@Autowired
|
// @Autowired
|
||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
// DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
@Autowired
|
// @Autowired
|
||||||
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
// TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||||
@Autowired
|
// @Autowired
|
||||||
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
// InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
||||||
@Autowired
|
// @Autowired
|
||||||
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
// DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
@Autowired
|
// @Autowired
|
||||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
// RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
||||||
@Autowired
|
// @Autowired
|
||||||
DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class);
|
// DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class);
|
||||||
@Autowired
|
// @Autowired
|
||||||
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
// DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||||
|
//
|
||||||
//工作模式
|
// //工作模式
|
||||||
int mode = 0;
|
// int mode = 0;
|
||||||
int last_mode = 0;
|
// int last_mode = 0;
|
||||||
//光电信号
|
// //光电信号
|
||||||
int move = 0;
|
// int move = 0;
|
||||||
int last_move = 0;
|
// int last_move = 0;
|
||||||
//动作信号
|
// //动作信号
|
||||||
int action = 0;
|
// int action = 0;
|
||||||
int last_action = 0;
|
// int last_action = 0;
|
||||||
//行走列
|
// //行走列
|
||||||
int walk_y = 0;
|
// int walk_y = 0;
|
||||||
int last_walk_y = 0;
|
// int last_walk_y = 0;
|
||||||
//报警信号
|
// //报警信号
|
||||||
int error = 0;
|
// int error = 0;
|
||||||
int last_error = 0;
|
// int last_error = 0;
|
||||||
//任务号
|
// //任务号
|
||||||
int task = 0;
|
// int task = 0;
|
||||||
int last_task = 0;
|
// int last_task = 0;
|
||||||
// x坐标
|
// // x坐标
|
||||||
float x_position = 0;
|
// float x_position = 0;
|
||||||
float last_x_position = 0;
|
// float last_x_position = 0;
|
||||||
// y坐标
|
// // y坐标
|
||||||
float y_position = 0;
|
// float y_position = 0;
|
||||||
float last_y_position = 0;
|
// float last_y_position = 0;
|
||||||
|
//
|
||||||
int heartbeat = 0;
|
// int heartbeat = 0;
|
||||||
int last_heartbeat = 0;
|
// int last_heartbeat = 0;
|
||||||
int to_command = 0;
|
// int to_command = 0;
|
||||||
int last_to_command = 0;
|
// int last_to_command = 0;
|
||||||
|
//
|
||||||
int to_target = 0;
|
// int to_target = 0;
|
||||||
int last_to_target = 0;
|
// int last_to_target = 0;
|
||||||
|
//
|
||||||
int to_task = 0;
|
// int to_task = 0;
|
||||||
int last_to_task = 0;
|
// int last_to_task = 0;
|
||||||
|
//
|
||||||
int to_onset = 0;
|
// int to_onset = 0;
|
||||||
int last_to_onset = 0;
|
// int last_to_onset = 0;
|
||||||
|
//
|
||||||
Boolean isonline = true;
|
// Boolean isonline = true;
|
||||||
int hasGoods = 0;
|
// int hasGoods = 0;
|
||||||
String message = null;
|
// String message = null;
|
||||||
Boolean iserror = false;
|
// Boolean iserror = false;
|
||||||
private Date instruction_update_time = new Date();
|
// private Date instruction_update_time = new Date();
|
||||||
private int instruction_update_time_out = 1000;
|
// private int instruction_update_time_out = 1000;
|
||||||
Integer heartbeat_tag;
|
// Integer heartbeat_tag;
|
||||||
private Date instruction_require_time = new Date();
|
// private Date instruction_require_time = new Date();
|
||||||
|
//
|
||||||
private int instruction_require_time_out = 3000;
|
// private int instruction_require_time_out = 3000;
|
||||||
//行架机械手申请任务成功标识
|
// //行架机械手申请任务成功标识
|
||||||
boolean requireSucess = false;
|
// boolean requireSucess = false;
|
||||||
|
//
|
||||||
private int instruction_finished_time_out;
|
// private int instruction_finished_time_out;
|
||||||
|
//
|
||||||
int branchProtocol = 0;
|
// int branchProtocol = 0;
|
||||||
private String error_type = "hxhj_error_type";
|
// private String error_type = "hxhj_error_type";
|
||||||
|
//
|
||||||
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
// //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
||||||
int flag;
|
// int flag;
|
||||||
|
//
|
||||||
String device_code;
|
// String device_code;
|
||||||
|
//
|
||||||
//当前指令
|
// //当前指令
|
||||||
Instruction inst = null;
|
// Instruction inst = null;
|
||||||
|
//
|
||||||
//0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成
|
// //0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成
|
||||||
int now_steps_type = 0;
|
// int now_steps_type = 0;
|
||||||
String notCreateTaskMessage = "";
|
// String notCreateTaskMessage = "";
|
||||||
String notCreateInstMessage = "";
|
// String notCreateInstMessage = "";
|
||||||
String feedMessage = "";
|
// String feedMessage = "";
|
||||||
|
//
|
||||||
|
//
|
||||||
List<String> getDeviceCodeList = null;
|
// List<String> getDeviceCodeList = null;
|
||||||
|
//
|
||||||
List<String> putDeviceCodeList = null;
|
// List<String> putDeviceCodeList = null;
|
||||||
|
//
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Device getDevice() {
|
// public Device getDevice() {
|
||||||
return this.device;
|
// return this.device;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void execute() {
|
// public void execute() {
|
||||||
String message = null;
|
// String message = null;
|
||||||
try {
|
// try {
|
||||||
device_code = this.getDeviceCode();
|
// device_code = this.getDeviceCode();
|
||||||
mode = this.standardItemProtocol.getMode();
|
// mode = this.standardItemProtocol.getMode();
|
||||||
move = this.standardItemProtocol.getMove();
|
// move = this.standardItemProtocol.getMove();
|
||||||
action = this.standardItemProtocol.getAction();
|
// action = this.standardItemProtocol.getAction();
|
||||||
walk_y = this.standardItemProtocol.getWalk_y();
|
// walk_y = this.standardItemProtocol.getWalk_y();
|
||||||
error = this.standardItemProtocol.getError();
|
// error = this.standardItemProtocol.getError();
|
||||||
task = this.standardItemProtocol.getTask();
|
// task = this.standardItemProtocol.getTask();
|
||||||
heartbeat = this.standardItemProtocol.getHeartbeat();
|
// heartbeat = this.standardItemProtocol.getHeartbeat();
|
||||||
to_command = this.standardItemProtocol.getTo_command();
|
// to_command = this.standardItemProtocol.getTo_command();
|
||||||
to_target = this.standardItemProtocol.getTo_target();
|
// to_target = this.standardItemProtocol.getTo_target();
|
||||||
to_task = this.standardItemProtocol.getTo_task();
|
// to_task = this.standardItemProtocol.getTo_task();
|
||||||
to_onset = this.standardItemProtocol.getTo_onset();
|
// to_onset = this.standardItemProtocol.getTo_onset();
|
||||||
x_position = this.standardItemProtocol.getX_position();
|
// x_position = this.standardItemProtocol.getX_position();
|
||||||
y_position = this.standardItemProtocol.getY_position();
|
// y_position = this.standardItemProtocol.getY_position();
|
||||||
|
//
|
||||||
if (to_onset != last_to_onset) {
|
// if (to_onset != last_to_onset) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset);
|
||||||
}
|
// }
|
||||||
if (to_command != last_to_command) {
|
// if (to_command != last_to_command) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command);
|
||||||
}
|
// }
|
||||||
if (to_target != last_to_target) {
|
// if (to_target != last_to_target) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target);
|
||||||
}
|
// }
|
||||||
if (to_task != last_to_task) {
|
// if (to_task != last_to_task) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
||||||
}
|
// }
|
||||||
if (mode != last_mode) {
|
// if (mode != last_mode) {
|
||||||
requireSucess = false;
|
// requireSucess = false;
|
||||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
// logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||||
}
|
// }
|
||||||
if (move != last_move) {
|
// if (move != last_move) {
|
||||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
// logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||||
}
|
// }
|
||||||
if (action != last_action) {
|
// if (action != last_action) {
|
||||||
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
|
// logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action);
|
||||||
}
|
// }
|
||||||
if (error != last_error) {
|
// if (error != last_error) {
|
||||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
// logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||||
}
|
// }
|
||||||
if (walk_y != last_walk_y) {
|
// if (walk_y != last_walk_y) {
|
||||||
logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y));
|
// logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y);
|
||||||
}
|
// }
|
||||||
if (task != last_task) {
|
// if (task != last_task) {
|
||||||
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
// logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||||
}
|
// }
|
||||||
if (x_position != last_x_position) {
|
// if (x_position != last_x_position) {
|
||||||
logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position));
|
// logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + last_x_position + "->" + x_position);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + last_x_position + "->" + x_position);
|
||||||
}
|
// }
|
||||||
if (y_position != last_y_position) {
|
// if (y_position != last_y_position) {
|
||||||
logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position));
|
// logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + last_y_position + "->" + y_position);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + last_y_position + "->" + y_position);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 更新指令状态
|
// // 更新指令状态
|
||||||
if (mode == 3 && task > 0) {
|
// if (mode == 3 && task > 0) {
|
||||||
Date date = new Date();
|
// Date date = new Date();
|
||||||
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
// if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
|
// log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
|
||||||
|
//
|
||||||
} else {
|
// } else {
|
||||||
this.instruction_update_time = date;
|
// this.instruction_update_time = date;
|
||||||
//更改指令状态
|
// //更改指令状态
|
||||||
if (task > 0) {
|
// if (task > 0) {
|
||||||
Instruction inst = checkInst();
|
// Instruction inst = checkInst();
|
||||||
if (inst != null) {
|
// if (inst != null) {
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
// if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
||||||
inst.setInstruction_status(CommonFinalParam.ONE);
|
// inst.setInstruction_status(CommonFinalParam.ONE);
|
||||||
inst.setExecute_device_code(this.device_code);
|
// inst.setExecute_device_code(this.device_code);
|
||||||
instructionService.update(inst);
|
// instructionService.update(inst);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception var17) {
|
|
||||||
var17.printStackTrace();
|
|
||||||
feedMessage = var17.getMessage();
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.standardItemProtocol));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode == 0) {
|
|
||||||
this.setIsonline(false);
|
|
||||||
message = "未联机";
|
|
||||||
//有报警
|
|
||||||
} else if (error != 0) {
|
|
||||||
this.setIserror(true);
|
|
||||||
message = "有报警";
|
|
||||||
//无报警
|
|
||||||
} else {
|
|
||||||
this.setIsonline(true);
|
|
||||||
this.setIserror(false);
|
|
||||||
message = "";
|
|
||||||
Instruction instruction = null;
|
|
||||||
List toInstructions;
|
|
||||||
|
|
||||||
//行架机械手申请任务
|
|
||||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
|
||||||
// boolean res = applyTask();
|
|
||||||
// if (res) {
|
|
||||||
// notCreateInstMessage = "";
|
|
||||||
// notCreateTaskMessage = "";
|
|
||||||
// feedMessage = "";
|
|
||||||
// }
|
// }
|
||||||
} else {
|
// }
|
||||||
if (mode == 2) {
|
//
|
||||||
//if (!requireSucess) {
|
// } catch (Exception var17) {
|
||||||
String remark = "未查找任务原因为:";
|
// var17.printStackTrace();
|
||||||
if (mode != 2) {
|
// feedMessage = var17.getMessage();
|
||||||
remark = remark + "工作模式(mode)不是待机状态,";
|
// logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.standardItemProtocol));
|
||||||
}
|
//
|
||||||
if (move != 0) {
|
// }
|
||||||
remark = remark + "光电信号(move)为有货状态,";
|
//
|
||||||
}
|
// if (mode == 0) {
|
||||||
if (task != 0) {
|
// this.setIsonline(false);
|
||||||
remark = remark + "当前上报任务号(task)应该为0,";
|
// message = "未联机";
|
||||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
// //有报警
|
||||||
this.inst = null;
|
// } else if (error != 0) {
|
||||||
}
|
// this.setIserror(true);
|
||||||
}
|
// message = "有报警";
|
||||||
if (requireSucess) {
|
// //无报警
|
||||||
remark = remark + "请右击该图标,将请求任务复位标记(requireSucess)改为否。";
|
// } else {
|
||||||
}
|
// this.setIsonline(true);
|
||||||
this.setNotCreateTaskMessage(remark);
|
// this.setIserror(false);
|
||||||
//}
|
// message = "";
|
||||||
}
|
// Instruction instruction = null;
|
||||||
}
|
// List toInstructions;
|
||||||
|
//
|
||||||
}
|
// //行架机械手申请任务
|
||||||
last_mode = mode;
|
// if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||||
last_move = move;
|
//// boolean res = applyTask();
|
||||||
last_action = action;
|
//// if (res) {
|
||||||
last_walk_y = walk_y;
|
//// notCreateInstMessage = "";
|
||||||
last_error = error;
|
//// notCreateTaskMessage = "";
|
||||||
last_task = task;
|
//// feedMessage = "";
|
||||||
last_heartbeat = heartbeat;
|
//// }
|
||||||
last_to_task = to_task;
|
// } else {
|
||||||
last_to_command = to_command;
|
// if (mode == 2) {
|
||||||
last_to_target = to_target;
|
// //if (!requireSucess) {
|
||||||
last_to_onset = to_onset;
|
// String remark = "未查找任务原因为:";
|
||||||
last_x_position = x_position;
|
// if (mode != 2) {
|
||||||
last_y_position = y_position;
|
// remark = remark + "工作模式(mode)不是待机状态,";
|
||||||
}
|
// }
|
||||||
|
// if (move != 0) {
|
||||||
@Override
|
// remark = remark + "光电信号(move)为有货状态,";
|
||||||
public JSONObject getDeviceStatusName() {
|
// }
|
||||||
JSONObject jo = new JSONObject();
|
// if (task != 0) {
|
||||||
String mode = "";
|
// remark = remark + "当前上报任务号(task)应该为0,";
|
||||||
String move = "";
|
// if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||||
String action = "";
|
// this.inst = null;
|
||||||
String walk_y = "";
|
// }
|
||||||
if (this.getMode() == 0) {
|
// }
|
||||||
mode = "脱机";
|
// if (requireSucess) {
|
||||||
} else if (this.getMode() == 1) {
|
// remark = remark + "请右击该图标,将请求任务复位标记(requireSucess)改为否。";
|
||||||
mode = "单机";
|
// }
|
||||||
} else if (this.getMode() == 2) {
|
// this.setNotCreateTaskMessage(remark);
|
||||||
mode = "待机";
|
// //}
|
||||||
} else if (this.getMode() == 3) {
|
// }
|
||||||
mode = "运行中";
|
// }
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
if (this.getMove() == 0) {
|
// last_mode = mode;
|
||||||
move = "无货";
|
// last_move = move;
|
||||||
} else if (this.getMove() == 1) {
|
// last_action = action;
|
||||||
move = "有货";
|
// last_walk_y = walk_y;
|
||||||
}
|
// last_error = error;
|
||||||
|
// last_task = task;
|
||||||
String requireSucess = "0";
|
// last_heartbeat = heartbeat;
|
||||||
if (this.requireSucess) {
|
// last_to_task = to_task;
|
||||||
requireSucess = "1";
|
// last_to_command = to_command;
|
||||||
}
|
// last_to_target = to_target;
|
||||||
jo.put("requireSucess", requireSucess);
|
// last_to_onset = to_onset;
|
||||||
if (this.getAction() == 1) {
|
// last_x_position = x_position;
|
||||||
action = "取货中";
|
// last_y_position = y_position;
|
||||||
} else if (this.getAction() == 2) {
|
// }
|
||||||
action = "取货完成";
|
//
|
||||||
} else if (this.getAction() == 3) {
|
// @Override
|
||||||
action = "放货中";
|
// public JSONObject getDeviceStatusName() {
|
||||||
} else if (this.getAction() == 4) {
|
// JSONObject jo = new JSONObject();
|
||||||
action = "放货完成";
|
// String mode = "";
|
||||||
}
|
// String move = "";
|
||||||
|
// String action = "";
|
||||||
jo.put("device_name", this.getDevice().getDevice_name());
|
// String walk_y = "";
|
||||||
jo.put("mode", mode);
|
// if (this.getMode() == 0) {
|
||||||
jo.put("move", move);
|
// mode = "脱机";
|
||||||
jo.put("action", action);
|
// } else if (this.getMode() == 1) {
|
||||||
jo.put("task", task);
|
// mode = "单机";
|
||||||
jo.put("walk_y", walk_y);
|
// } else if (this.getMode() == 2) {
|
||||||
jo.put("isOnline", this.getIsonline());
|
// mode = "待机";
|
||||||
jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError())));
|
// } else if (this.getMode() == 3) {
|
||||||
jo.put("isError", this.getIserror());
|
// mode = "运行中";
|
||||||
jo.put("message", this.getMessage());
|
// }
|
||||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
//
|
||||||
jo.put("notCreateInstMessage", notCreateInstMessage);
|
// if (this.getMove() == 0) {
|
||||||
jo.put("feedMessage", feedMessage);
|
// move = "无货";
|
||||||
jo.put("driver_type", "siemens_conveyor");
|
// } else if (this.getMove() == 1) {
|
||||||
jo.put("is_click", true);
|
// move = "有货";
|
||||||
jo.put("x", x_position);
|
// }
|
||||||
jo.put("y", y_position);
|
//
|
||||||
return jo;
|
// String requireSucess = "0";
|
||||||
}
|
// if (this.requireSucess) {
|
||||||
|
// requireSucess = "1";
|
||||||
@Override
|
// }
|
||||||
public void setDeviceStatus(JSONObject data) {
|
// jo.put("requireSucess", requireSucess);
|
||||||
String requestSucess = data.getString("requireSucess");
|
// if (this.getAction() == 1) {
|
||||||
if (StrUtil.equals(requestSucess, "0")) {
|
// action = "取货中";
|
||||||
this.requireSucess = false;
|
// } else if (this.getAction() == 2) {
|
||||||
} else if (StrUtil.equals(requestSucess, "1")) {
|
// action = "取货完成";
|
||||||
this.requireSucess = true;
|
// } else if (this.getAction() == 3) {
|
||||||
}
|
// action = "放货中";
|
||||||
}
|
// } else if (this.getAction() == 4) {
|
||||||
|
// action = "放货完成";
|
||||||
@Override
|
// }
|
||||||
public JSONObject feedLmsRealFailedInfo() {
|
//
|
||||||
JSONObject jo = new JSONObject();
|
// jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
jo.put("device_code", this.getDevice().getDevice_code());
|
// jo.put("mode", mode);
|
||||||
jo.put("device_name", this.getDevice().getDevice_name());
|
// jo.put("move", move);
|
||||||
jo.put("fault_code", String.valueOf(error));
|
// jo.put("action", action);
|
||||||
jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
// jo.put("task", task);
|
||||||
jo.put("fault_type", error_type);
|
// jo.put("walk_y", walk_y);
|
||||||
return jo;
|
// jo.put("isOnline", this.getIsonline());
|
||||||
}
|
// jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError())));
|
||||||
|
// jo.put("isError", this.getIserror());
|
||||||
|
// jo.put("message", this.getMessage());
|
||||||
public Instruction checkInst() {
|
// jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
// jo.put("notCreateInstMessage", notCreateInstMessage);
|
||||||
if (this.task > 0) {
|
// jo.put("feedMessage", feedMessage);
|
||||||
if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) {
|
// jo.put("driver_type", "siemens_conveyor");
|
||||||
return this.inst;
|
// jo.put("is_click", true);
|
||||||
} else {
|
// jo.put("x", x_position);
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
// jo.put("y", y_position);
|
||||||
return inst;
|
// return jo;
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
} else {
|
// @Override
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
// public void setDeviceStatus(JSONObject data) {
|
||||||
return inst;
|
// String requestSucess = data.getString("requireSucess");
|
||||||
}
|
// if (StrUtil.equals(requestSucess, "0")) {
|
||||||
return null;
|
// this.requireSucess = false;
|
||||||
}
|
// } else if (StrUtil.equals(requestSucess, "1")) {
|
||||||
}
|
// this.requireSucess = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public JSONObject feedLmsRealFailedInfo() {
|
||||||
|
// JSONObject jo = new JSONObject();
|
||||||
|
// jo.put("device_code", this.getDevice().getDevice_code());
|
||||||
|
// jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
|
// jo.put("fault_code", String.valueOf(error));
|
||||||
|
// jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
||||||
|
// jo.put("fault_type", error_type);
|
||||||
|
// return jo;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// public Instruction checkInst() {
|
||||||
|
// if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||||
|
// if (this.task > 0) {
|
||||||
|
// if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) {
|
||||||
|
// return this.inst;
|
||||||
|
// } else {
|
||||||
|
// inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
// return inst;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
// return inst;
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package org.nl.acs.device_driver.manipulator.standard_manipulator;
|
||||||
|
|
||||||
|
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device.enums.DeviceType;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BoxManipulatorDefination implements OpcDeviceDriverDefination {
|
||||||
|
@Override
|
||||||
|
public String getDriverCode() {
|
||||||
|
return "box_manipulator";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDriverName() {
|
||||||
|
return "装箱行架机械手";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDriverDescription() {
|
||||||
|
return "装箱行架机械手";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceDriver getDriverInstance(Device device) {
|
||||||
|
return (new BoxManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||||
|
return BoxManipulatorDeviceDriver.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceType> getFitDeviceTypes() {
|
||||||
|
List<DeviceType> types = new LinkedList();
|
||||||
|
types.add(DeviceType.station);
|
||||||
|
return types;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemDto> getReadableItemDtos() {
|
||||||
|
return StandardItemProtocol.getReadableItemDtos();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemDto> getWriteableItemDtos() {
|
||||||
|
return StandardItemProtocol.getWriteableItemDtos();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,397 @@
|
|||||||
|
package org.nl.acs.device_driver.manipulator.standard_manipulator;
|
||||||
|
|
||||||
|
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;
|
||||||
|
import org.nl.acs.common.base.CommonFinalParam;
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device.service.DeviceExtraService;
|
||||||
|
import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||||
|
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.history.ErrorUtil;
|
||||||
|
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
|
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||||
|
import org.nl.acs.instruction.domain.Instruction;
|
||||||
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
|
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
|
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||||
|
import org.nl.acs.task.service.TaskService;
|
||||||
|
import org.nl.config.SpringContextHolder;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装箱行架机械手
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Data
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BoxManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed {
|
||||||
|
protected StandardItemProtocol standardItemProtocol = new StandardItemProtocol(this);
|
||||||
|
@Autowired
|
||||||
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||||
|
|
||||||
|
//工作模式
|
||||||
|
int mode = 0;
|
||||||
|
int last_mode = 0;
|
||||||
|
//光电信号
|
||||||
|
int move = 0;
|
||||||
|
int last_move = 0;
|
||||||
|
//动作信号
|
||||||
|
int action = 0;
|
||||||
|
int last_action = 0;
|
||||||
|
//行走列
|
||||||
|
int walk_y = 0;
|
||||||
|
int last_walk_y = 0;
|
||||||
|
//报警信号
|
||||||
|
int error = 0;
|
||||||
|
int last_error = 0;
|
||||||
|
//任务号
|
||||||
|
int task = 0;
|
||||||
|
int last_task = 0;
|
||||||
|
// x坐标
|
||||||
|
float x_position = 0;
|
||||||
|
float last_x_position = 0;
|
||||||
|
// y坐标
|
||||||
|
float y_position = 0;
|
||||||
|
float last_y_position = 0;
|
||||||
|
|
||||||
|
int heartbeat = 0;
|
||||||
|
int last_heartbeat = 0;
|
||||||
|
int to_command = 0;
|
||||||
|
int last_to_command = 0;
|
||||||
|
|
||||||
|
int to_target = 0;
|
||||||
|
int last_to_target = 0;
|
||||||
|
|
||||||
|
int to_task = 0;
|
||||||
|
int last_to_task = 0;
|
||||||
|
|
||||||
|
int to_onset = 0;
|
||||||
|
int last_to_onset = 0;
|
||||||
|
|
||||||
|
Boolean isonline = true;
|
||||||
|
int hasGoods = 0;
|
||||||
|
String message = null;
|
||||||
|
Boolean iserror = false;
|
||||||
|
private Date instruction_update_time = new Date();
|
||||||
|
private int instruction_update_time_out = 1000;
|
||||||
|
Integer heartbeat_tag;
|
||||||
|
private Date instruction_require_time = new Date();
|
||||||
|
|
||||||
|
private int instruction_require_time_out = 3000;
|
||||||
|
//行架机械手申请任务成功标识
|
||||||
|
boolean requireSucess = false;
|
||||||
|
|
||||||
|
private int instruction_finished_time_out;
|
||||||
|
|
||||||
|
int branchProtocol = 0;
|
||||||
|
private String error_type = "hxhj_error_type";
|
||||||
|
|
||||||
|
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
||||||
|
int flag;
|
||||||
|
|
||||||
|
String device_code;
|
||||||
|
|
||||||
|
//当前指令
|
||||||
|
Instruction inst = null;
|
||||||
|
|
||||||
|
|
||||||
|
//0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成
|
||||||
|
int now_steps_type = 0;
|
||||||
|
String notCreateTaskMessage = "";
|
||||||
|
String notCreateInstMessage = "";
|
||||||
|
String feedMessage = "";
|
||||||
|
|
||||||
|
|
||||||
|
List<String> getDeviceCodeList = null;
|
||||||
|
|
||||||
|
List<String> putDeviceCodeList = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Device getDevice() {
|
||||||
|
return this.device;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
String message = null;
|
||||||
|
try {
|
||||||
|
device_code = this.getDeviceCode();
|
||||||
|
mode = this.standardItemProtocol.getMode(device_code);
|
||||||
|
move = this.standardItemProtocol.getMove(device_code);
|
||||||
|
action = this.standardItemProtocol.getAction(device_code);
|
||||||
|
walk_y = this.standardItemProtocol.getWalk_y(device_code);
|
||||||
|
error = this.standardItemProtocol.getError(device_code);
|
||||||
|
task = this.standardItemProtocol.getTask(device_code);
|
||||||
|
heartbeat = this.standardItemProtocol.getHeartbeat(device_code);
|
||||||
|
to_command = this.standardItemProtocol.getTo_command(device_code);
|
||||||
|
to_target = this.standardItemProtocol.getTo_target(device_code);
|
||||||
|
to_task = this.standardItemProtocol.getTo_task(device_code);
|
||||||
|
to_onset = this.standardItemProtocol.getTo_onset(device_code);
|
||||||
|
x_position = this.standardItemProtocol.getX_position(device_code);
|
||||||
|
y_position = this.standardItemProtocol.getY_position(device_code);
|
||||||
|
|
||||||
|
if (to_onset != last_to_onset) {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset);
|
||||||
|
}
|
||||||
|
if (to_command != last_to_command) {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command);
|
||||||
|
}
|
||||||
|
if (to_target != last_to_target) {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + last_to_target + "->" + to_target);
|
||||||
|
}
|
||||||
|
if (to_task != last_to_task) {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
||||||
|
}
|
||||||
|
if (mode != last_mode) {
|
||||||
|
requireSucess = false;
|
||||||
|
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||||
|
}
|
||||||
|
if (move != last_move) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||||
|
}
|
||||||
|
if (action != last_action) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action);
|
||||||
|
}
|
||||||
|
if (error != last_error) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||||
|
}
|
||||||
|
if (walk_y != last_walk_y) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y);
|
||||||
|
}
|
||||||
|
if (task != last_task) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||||
|
}
|
||||||
|
if (x_position != last_x_position) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + last_x_position + "->" + x_position);
|
||||||
|
}
|
||||||
|
if (y_position != last_y_position) {
|
||||||
|
logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position));
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + last_y_position + "->" + y_position);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新指令状态
|
||||||
|
if (mode == 3 && task > 0) {
|
||||||
|
Date date = new Date();
|
||||||
|
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
||||||
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.instruction_update_time = date;
|
||||||
|
//更改指令状态
|
||||||
|
if (task > 0) {
|
||||||
|
Instruction inst = checkInst();
|
||||||
|
if (inst != null) {
|
||||||
|
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
||||||
|
inst.setInstruction_status(CommonFinalParam.ONE);
|
||||||
|
inst.setExecute_device_code(this.device_code);
|
||||||
|
instructionService.update(inst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception var17) {
|
||||||
|
var17.printStackTrace();
|
||||||
|
feedMessage = var17.getMessage();
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.standardItemProtocol));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode == 0) {
|
||||||
|
this.setIsonline(false);
|
||||||
|
message = "未联机";
|
||||||
|
//有报警
|
||||||
|
} else if (error != 0) {
|
||||||
|
this.setIserror(true);
|
||||||
|
message = "有报警";
|
||||||
|
//无报警
|
||||||
|
} else {
|
||||||
|
this.setIsonline(true);
|
||||||
|
this.setIserror(false);
|
||||||
|
message = "";
|
||||||
|
Instruction instruction = null;
|
||||||
|
List toInstructions;
|
||||||
|
|
||||||
|
//行架机械手申请任务
|
||||||
|
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||||
|
// boolean res = applyTask();
|
||||||
|
// if (res) {
|
||||||
|
// notCreateInstMessage = "";
|
||||||
|
// notCreateTaskMessage = "";
|
||||||
|
// feedMessage = "";
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
if (mode == 2) {
|
||||||
|
//if (!requireSucess) {
|
||||||
|
String remark = "未查找任务原因为:";
|
||||||
|
if (mode != 2) {
|
||||||
|
remark = remark + "工作模式(mode)不是待机状态,";
|
||||||
|
}
|
||||||
|
if (move != 0) {
|
||||||
|
remark = remark + "光电信号(move)为有货状态,";
|
||||||
|
}
|
||||||
|
if (task != 0) {
|
||||||
|
remark = remark + "当前上报任务号(task)应该为0,";
|
||||||
|
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||||
|
this.inst = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requireSucess) {
|
||||||
|
remark = remark + "请右击该图标,将请求任务复位标记(requireSucess)改为否。";
|
||||||
|
}
|
||||||
|
this.setNotCreateTaskMessage(remark);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
last_mode = mode;
|
||||||
|
last_move = move;
|
||||||
|
last_action = action;
|
||||||
|
last_walk_y = walk_y;
|
||||||
|
last_error = error;
|
||||||
|
last_task = task;
|
||||||
|
last_heartbeat = heartbeat;
|
||||||
|
last_to_task = to_task;
|
||||||
|
last_to_command = to_command;
|
||||||
|
last_to_target = to_target;
|
||||||
|
last_to_onset = to_onset;
|
||||||
|
last_x_position = x_position;
|
||||||
|
last_y_position = y_position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getDeviceStatusName() {
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
String mode = "";
|
||||||
|
String move = "";
|
||||||
|
String action = "";
|
||||||
|
String walk_y = "";
|
||||||
|
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() == 1) {
|
||||||
|
action = "取货中";
|
||||||
|
} else if (this.getAction() == 2) {
|
||||||
|
action = "取货完成";
|
||||||
|
} else if (this.getAction() == 3) {
|
||||||
|
action = "放货中";
|
||||||
|
} else if (this.getAction() == 4) {
|
||||||
|
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", walk_y);
|
||||||
|
jo.put("isOnline", this.getIsonline());
|
||||||
|
jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError())));
|
||||||
|
jo.put("isError", this.getIserror());
|
||||||
|
jo.put("message", this.getMessage());
|
||||||
|
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||||
|
jo.put("notCreateInstMessage", notCreateInstMessage);
|
||||||
|
jo.put("feedMessage", feedMessage);
|
||||||
|
jo.put("driver_type", "siemens_conveyor");
|
||||||
|
jo.put("is_click", true);
|
||||||
|
jo.put("x", x_position);
|
||||||
|
jo.put("y", y_position);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject feedLmsRealFailedInfo() {
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("device_code", this.getDevice().getDevice_code());
|
||||||
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
|
jo.put("fault_code", String.valueOf(error));
|
||||||
|
jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError())));
|
||||||
|
jo.put("fault_type", error_type);
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Instruction checkInst() {
|
||||||
|
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||||
|
if (this.task > 0) {
|
||||||
|
if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) {
|
||||||
|
return this.inst;
|
||||||
|
} else {
|
||||||
|
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
return inst;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
return inst;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,11 @@ package org.nl.acs.device_driver.manipulator.standard_manipulator;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||||
import org.nl.acs.device_driver.box_manipulator.BoxManipulatorDeviceDriver;
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
|
import org.nl.config.SpringContextHolder;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -12,6 +16,9 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Data
|
@Data
|
||||||
public class StandardItemProtocol {
|
public class StandardItemProtocol {
|
||||||
|
|
||||||
|
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
|
|
||||||
//心跳
|
//心跳
|
||||||
public static String item_heartbeat = "heartbeat";
|
public static String item_heartbeat = "heartbeat";
|
||||||
//工作模式
|
//工作模式
|
||||||
@@ -40,77 +47,80 @@ public class StandardItemProtocol {
|
|||||||
//下发任务号
|
//下发任务号
|
||||||
public static String item_to_task = "to_task";
|
public static String item_to_task = "to_task";
|
||||||
|
|
||||||
StandardManipulatorDeviceDriver standardManipulatorDeviceDriver;
|
|
||||||
BoxManipulatorDeviceDriver boxManipulatorDeviceDriver;
|
|
||||||
|
|
||||||
private final String type;
|
private final DeviceDriver driver;
|
||||||
|
|
||||||
|
|
||||||
public StandardItemProtocol(String type) {
|
public StandardItemProtocol(DeviceDriver driver) {
|
||||||
this.type = type;
|
this.driver = driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeartbeat() {
|
public int getHeartbeat(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_heartbeat,type);
|
return this.getOpcIntegerValue(item_heartbeat,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMode() {
|
public int getMode(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_mode,type);
|
return this.getOpcIntegerValue(item_mode,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMove() {
|
public int getMove(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_move,type);
|
return this.getOpcIntegerValue(item_move,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAction() {
|
public int getAction(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_action,type);
|
return this.getOpcIntegerValue(item_action,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWalk_y() {
|
public int getWalk_y(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_walk_y,type);
|
return this.getOpcIntegerValue(item_walk_y,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getError() {
|
public int getError(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_error,type);
|
return this.getOpcIntegerValue(item_error,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTask() {
|
public int getTask(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_task,type);
|
return this.getOpcIntegerValue(item_task,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_command() {
|
public int getTo_command(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_to_command,type);
|
return this.getOpcIntegerValue(item_to_command,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_target() {
|
public int getTo_target(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_to_target,type);
|
return this.getOpcIntegerValue(item_to_target,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_task() {
|
public int getTo_task(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_to_task,type);
|
return this.getOpcIntegerValue(item_to_task,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_onset() {
|
public int getTo_onset(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_to_onset,type);
|
return this.getOpcIntegerValue(item_to_onset,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getX_position() {
|
public int getX_position(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_x_position,type);
|
return this.getOpcIntegerValue(item_x_position,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getY_position() {
|
public int getY_position(String device_code) {
|
||||||
return this.getOpcIntegerValue(item_y_position,type);
|
return this.getOpcIntegerValue(item_y_position,device_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Boolean isonline;
|
Boolean isonline;
|
||||||
|
|
||||||
public int getOpcIntegerValue(String protocol,String type) {
|
public int getOpcIntegerValue(String protocol,String device_code) {
|
||||||
Integer value = null;
|
Integer value = null;
|
||||||
if ("1".equals(type)){
|
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||||
value = this.standardManipulatorDeviceDriver.getIntegeregerValue(protocol);
|
if (device.getDeviceDriver() instanceof StandardManipulatorDeviceDriver) {
|
||||||
}else if ("2".equals(type)){
|
StandardManipulatorDeviceDriver standardManipulatorDeviceDriver;
|
||||||
value = this.boxManipulatorDeviceDriver.getIntegeregerValue(protocol);
|
standardManipulatorDeviceDriver = (StandardManipulatorDeviceDriver) device.getDeviceDriver();
|
||||||
|
value = standardManipulatorDeviceDriver.getIntegeregerValue(protocol);
|
||||||
|
}else if (device.getDeviceDriver() instanceof BoxManipulatorDeviceDriver){
|
||||||
|
BoxManipulatorDeviceDriver boxManipulatorDeviceDriver;
|
||||||
|
boxManipulatorDeviceDriver = (BoxManipulatorDeviceDriver) device.getDeviceDriver();
|
||||||
|
value = boxManipulatorDeviceDriver.getIntegeregerValue(protocol);
|
||||||
}
|
}
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
|
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import org.nl.acs.device.domain.Device;
|
|||||||
import org.nl.acs.device.enums.DeviceType;
|
import org.nl.acs.device.enums.DeviceType;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
|
||||||
import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
@@ -30,7 +29,7 @@ public class StandardManipulatorDefination implements OpcDeviceDriverDefination
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeviceDriver getDriverInstance(Device device) {
|
public DeviceDriver getDriverInstance(Device device) {
|
||||||
return (new StandardStackerDeviceDriver()).setDevice(device).setDriverDefination(this);
|
return (new StandardManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
|||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -40,7 +42,7 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class StandardManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed {
|
public class StandardManipulatorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed {
|
||||||
protected StandardItemProtocol standardItemProtocol = new StandardItemProtocol("1");
|
protected StandardItemProtocol standardItemProtocol = new StandardItemProtocol(this);
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -143,19 +145,19 @@ public class StandardManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
String message = null;
|
String message = null;
|
||||||
try {
|
try {
|
||||||
device_code = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
mode = this.standardItemProtocol.getMode();
|
mode = this.standardItemProtocol.getMode(device_code);
|
||||||
move = this.standardItemProtocol.getMove();
|
move = this.standardItemProtocol.getMove(device_code);
|
||||||
action = this.standardItemProtocol.getAction();
|
action = this.standardItemProtocol.getAction(device_code);
|
||||||
walk_y = this.standardItemProtocol.getWalk_y();
|
walk_y = this.standardItemProtocol.getWalk_y(device_code);
|
||||||
error = this.standardItemProtocol.getError();
|
error = this.standardItemProtocol.getError(device_code);
|
||||||
task = this.standardItemProtocol.getTask();
|
task = this.standardItemProtocol.getTask(device_code);
|
||||||
heartbeat = this.standardItemProtocol.getHeartbeat();
|
heartbeat = this.standardItemProtocol.getHeartbeat(device_code);
|
||||||
to_command = this.standardItemProtocol.getTo_command();
|
to_command = this.standardItemProtocol.getTo_command(device_code);
|
||||||
to_target = this.standardItemProtocol.getTo_target();
|
to_target = this.standardItemProtocol.getTo_target(device_code);
|
||||||
to_task = this.standardItemProtocol.getTo_task();
|
to_task = this.standardItemProtocol.getTo_task(device_code);
|
||||||
to_onset = this.standardItemProtocol.getTo_onset();
|
to_onset = this.standardItemProtocol.getTo_onset(device_code);
|
||||||
x_position = this.standardItemProtocol.getX_position();
|
x_position = this.standardItemProtocol.getX_position(device_code);
|
||||||
y_position = this.standardItemProtocol.getY_position();
|
y_position = this.standardItemProtocol.getY_position(device_code);
|
||||||
|
|
||||||
if (to_onset != last_to_onset) {
|
if (to_onset != last_to_onset) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset);
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import org.nl.acs.device.service.DeviceService;
|
|||||||
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||||
import org.nl.acs.device_driver.agv.ndcone.AgvNdcOneDeviceDriver;
|
import org.nl.acs.device_driver.agv.ndcone.AgvNdcOneDeviceDriver;
|
||||||
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
|
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
|
||||||
import org.nl.acs.device_driver.box_manipulator.BoxManipulatorDeviceDriver;
|
|
||||||
import org.nl.acs.device_driver.conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.manipulator.standard_manipulator.BoxManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.manipulator.standard_manipulator.StandardManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.manipulator.standard_manipulator.StandardManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.three_color.lamp_three_color.LampThreecolorDeviceDriver;
|
import org.nl.acs.device_driver.three_color.lamp_three_color.LampThreecolorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
|
||||||
|
|||||||
Reference in New Issue
Block a user