更新
This commit is contained in:
@@ -238,7 +238,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成";
|
// message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成";
|
||||||
inst_message = null;
|
inst_message = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -922,14 +922,14 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
message = "申请AGV搬运任务接口不通";
|
message = "申请AGV搬运任务接口不通";
|
||||||
requireSucess = true;
|
// requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
if (jo.getInteger("status") == 200) {
|
if (jo.getInteger("status") == 200) {
|
||||||
message = "申请AGV搬运任务成功";
|
message = "申请AGV搬运任务成功";
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:"+jo);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:"+jo);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
requireSucess = true;
|
// requireSucess = true;
|
||||||
message = "申请AGV搬运任务失败," + jo.get("message").toString();
|
message = "申请AGV搬运任务失败," + jo.get("message").toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
|||||||
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
|
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
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.dto.DeviceErrorLogDto;
|
|
||||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
import org.nl.acs.instruction.service.dto.Instruction;
|
||||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
@@ -72,8 +69,6 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
@Autowired
|
@Autowired
|
||||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
|
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
@Autowired
|
|
||||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
|
||||||
//当前指令
|
//当前指令
|
||||||
Instruction inst = null;
|
Instruction inst = null;
|
||||||
|
|
||||||
@@ -180,13 +175,6 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction);
|
||||||
}
|
}
|
||||||
if (error != last_error) {
|
if (error != last_error) {
|
||||||
if (error != 0) {
|
|
||||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
|
||||||
dto.setDevice_code(device_code);
|
|
||||||
dto.setError_code(String.valueOf(error));
|
|
||||||
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
|
|
||||||
deviceErrorLogService.create(dto);
|
|
||||||
}
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -215,7 +203,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task);
|
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task);
|
||||||
message = "输送线任务反馈状态,查询不到指令号:" + task + "指令已完成";
|
// message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成";
|
||||||
inst_message = null;
|
inst_message = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -861,6 +861,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public synchronized void emptyIn() {
|
public synchronized void emptyIn() {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.require_empty_in_time.getTime()
|
if (date.getTime() - this.require_empty_in_time.getTime()
|
||||||
|
|||||||
@@ -120,6 +120,15 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_to_command2);
|
return this.getOpcIntegerValue(item_to_command2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTo_task1() {
|
||||||
|
return this.getOpcIntegerValue(item_to_task1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTo_task2() {
|
||||||
|
return this.getOpcIntegerValue(item_to_task2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//是否有货
|
//是否有货
|
||||||
public int hasGoods(int move) {
|
public int hasGoods(int move) {
|
||||||
return move;
|
return move;
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
//分切行架机械手是否禁用 0否 1是
|
//分切行架机械手是否禁用 0否 1是
|
||||||
private int is_disable = 0;
|
private int is_disable = 0;
|
||||||
|
|
||||||
|
Instruction cache_inst = null;
|
||||||
|
String inst_type = null;
|
||||||
|
|
||||||
//工作模式
|
//工作模式
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
int last_mode = 0;
|
int last_mode = 0;
|
||||||
@@ -98,7 +101,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
int last_task2 = 0;
|
int last_task2 = 0;
|
||||||
int to_command1 = 0;
|
int to_command1 = 0;
|
||||||
int to_command2 = 0;
|
int to_command2 = 0;
|
||||||
|
int to_task1 = 0;
|
||||||
|
int to_task2 = 0;
|
||||||
Boolean isonline = true;
|
Boolean isonline = true;
|
||||||
//前工位申请任务请求标记
|
//前工位申请任务请求标记
|
||||||
Boolean requireSucess = false;
|
Boolean requireSucess = false;
|
||||||
@@ -130,6 +134,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
//请求超时时间
|
//请求超时时间
|
||||||
private int instruction_require_time_out = 3000;
|
private int instruction_require_time_out = 3000;
|
||||||
|
//写入信号时间
|
||||||
|
private int instruction_write_time_out = 1000;
|
||||||
|
|
||||||
|
|
||||||
//后工位申请任务请求时间
|
//后工位申请任务请求时间
|
||||||
@@ -137,6 +143,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
//前工位申请任务请求时间
|
//前工位申请任务请求时间
|
||||||
private Date instruction_head_time = new Date();
|
private Date instruction_head_time = new Date();
|
||||||
|
|
||||||
|
private Date instruction_write_time = new Date();
|
||||||
|
|
||||||
|
|
||||||
String notCreateTaskMessage = "";
|
String notCreateTaskMessage = "";
|
||||||
String notCreateInstMessage = "";
|
String notCreateInstMessage = "";
|
||||||
String feedMessage = "";
|
String feedMessage = "";
|
||||||
@@ -167,10 +176,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
to_command1 = this.itemProtocol.getTo_command1();
|
to_command1 = this.itemProtocol.getTo_command1();
|
||||||
to_command2 = this.itemProtocol.getTo_command2();
|
to_command2 = this.itemProtocol.getTo_command2();
|
||||||
heartbeat = this.itemProtocol.getHeartbeat();
|
heartbeat = this.itemProtocol.getHeartbeat();
|
||||||
|
to_task1 = this.itemProtocol.getTo_task1();
|
||||||
|
to_task2 = this.itemProtocol.getTo_task2();
|
||||||
// if(heartbeat != last_heartbeat){
|
// if(heartbeat != last_heartbeat){
|
||||||
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat);
|
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat:" + last_heartbeat + "->" + heartbeat);
|
||||||
// }
|
// }
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
|
inst_type = null;
|
||||||
|
cache_inst = null;
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为:" + requireSucess);
|
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为:" + requireSucess);
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
@@ -647,10 +660,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task_check();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
feedMessage = e.getMessage();
|
feedMessage = e.getMessage();
|
||||||
System.out.println("11111111:" + e.getMessage());
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,6 +762,36 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
last_heartbeat = heartbeat;
|
last_heartbeat = heartbeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized boolean task_check() {
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
if (date.getTime() - this.instruction_write_time.getTime() < (long) this.instruction_write_time_out) {
|
||||||
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_write_time);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if(ObjectUtil.isNotEmpty(cache_inst)) {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "程序逻辑校验,下发指令信号后电气任务号未变化,再次下发指令号:"+cache_inst.getInstruction_code() +",行架指令类型:"+type );
|
||||||
|
|
||||||
|
//前工位任务
|
||||||
|
if (StrUtil.equals(inst_type, "1")) {
|
||||||
|
if (task1 != Integer.parseInt(cache_inst.getInstruction_code())) {
|
||||||
|
this.sendSignalType(cache_inst, inst_type);
|
||||||
|
}
|
||||||
|
} else if (StrUtil.equals(inst_type, "2")) {
|
||||||
|
if (task2 != Integer.parseInt(cache_inst.getInstruction_code())) {
|
||||||
|
this.sendSignalType(cache_inst, inst_type);
|
||||||
|
}
|
||||||
|
} else if (StrUtil.equals(inst_type, "3")) {
|
||||||
|
if (task1 != Integer.parseInt(cache_inst.getInstruction_code()) || task2 != Integer.parseInt(cache_inst.getInstruction_code())) {
|
||||||
|
this.sendSignalType(cache_inst, inst_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//关联设备异常申请任务
|
//关联设备异常申请任务
|
||||||
public synchronized boolean instruction_require2() {
|
public synchronized boolean instruction_require2() {
|
||||||
Boolean flag = false;
|
Boolean flag = false;
|
||||||
@@ -1197,7 +1242,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.writing(list);
|
this.writing(list);
|
||||||
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "再次下发电气信号");
|
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "再次下发电气信号");
|
||||||
}
|
}
|
||||||
|
inst_type = type;
|
||||||
|
cache_inst = dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断点位是否设置电气值
|
//判断点位是否设置电气值
|
||||||
|
|||||||
@@ -464,11 +464,17 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
logServer.deviceExecuteLog(device_code, "", "", "申请任务时,根据托盘号:" + container_code + ",查询出来得任务信息是:" + JSON.toJSONString(task));
|
logServer.deviceExecuteLog(device_code, "", "", "申请任务时,根据托盘号:" + container_code + ",查询出来得任务信息是:" + JSON.toJSONString(task));
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
Instruction instdto = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
||||||
if (!StrUtil.equals(instdto.getStart_device_code(), this.device_code)) {
|
if(ObjectUtil.isEmpty(instdto)){
|
||||||
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
||||||
// this.setIserror(true);
|
this.setIserror(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!StrUtil.equals(instdto.getStart_device_code(), this.device_code)) {
|
||||||
|
message = "当前载具号" + container_code + "未找到就绪状态指令";
|
||||||
|
this.setIserror(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.setIserror(false);
|
||||||
if (ObjectUtil.isNotEmpty(instdto)) {
|
if (ObjectUtil.isNotEmpty(instdto)) {
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
@@ -533,6 +539,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||||
if (!StrUtil.equals(instdto.getStart_device_code(), this.device_code)) {
|
if (!StrUtil.equals(instdto.getStart_device_code(), this.device_code)) {
|
||||||
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
||||||
|
this.setIserror(true);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请任务"
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请任务"
|
||||||
+ "当前载具号" + container_code + "查找对应指令起点与当前设备不符");
|
+ "当前载具号" + container_code + "查找对应指令起点与当前设备不符");
|
||||||
return false;
|
return false;
|
||||||
@@ -578,6 +585,14 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code(), "1"))) {
|
if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code(), "1"))) {
|
||||||
{
|
{
|
||||||
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code(), "1");
|
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code(), "1");
|
||||||
|
if(!ObjectUtil.equal(instdto.getStart_device_code(),this.device_code)){
|
||||||
|
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
||||||
|
this.setIserror(true);
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请任务"
|
||||||
|
+ "当前载具号" + container_code + "查找对应指令起点与当前设备不符");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.setIserror(false);
|
||||||
if (to_task != Integer.parseInt(instdto.getInstruction_code())) {
|
if (to_task != Integer.parseInt(instdto.getInstruction_code())) {
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
@@ -671,21 +686,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
|
|
||||||
if (!StrUtil.equals(taskdto.getStart_device_code(), this.device_code)) {
|
if (!StrUtil.equals(taskdto.getStart_device_code(), this.device_code)) {
|
||||||
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
message = "当前载具号" + container_code + "查找对应指令起点与当前设备不符";
|
||||||
// List list = new ArrayList();
|
|
||||||
// Map map = new HashMap();
|
|
||||||
// map.put("code","to_target");
|
|
||||||
// map.put("value","1011");
|
|
||||||
// list.add(map);
|
|
||||||
// Map map2 = new HashMap();
|
|
||||||
// map2.put("code","to_command");
|
|
||||||
// map2.put("value","1");
|
|
||||||
// Map map3 = new HashMap();
|
|
||||||
// map3.put("code","to_task");
|
|
||||||
// map3.put("value","0");
|
|
||||||
// list.add(map3);
|
|
||||||
// this.writing(list);
|
|
||||||
// this.setRequireSucess(true);
|
|
||||||
// this.setApplySucess(true);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ public interface OpcDeviceDriver extends DeviceDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default Integer getIntegeregerValue(String protocol) {
|
default Integer getIntegeregerValue(String protocol) {
|
||||||
return (Integer) this.getValue(protocol);
|
Object value = this.getValue(protocol)==null?"0":this.getValue(protocol);
|
||||||
|
return Integer.parseInt(value.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
default Float getDoubleValue(String protocol) {
|
default Float getDoubleValue(String protocol) {
|
||||||
|
|||||||
@@ -512,7 +512,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||||
} else {
|
} else {
|
||||||
// Boolean result = createLkInst(task.getStorage_task_type(),dto);
|
Resp resp = acsToLiKuService.sendInst(task.getStorage_task_type(), dto);
|
||||||
|
if (StrUtil.equals(resp.result, "true")) {
|
||||||
|
dto.setSend_status("1");
|
||||||
|
} else {
|
||||||
|
dto.setSend_status("2");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user