更新
This commit is contained in:
@@ -109,7 +109,6 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
String device_code;
|
||||
|
||||
|
||||
|
||||
//后工位申请任务请求时间
|
||||
private Date instruction_require_time = new Date();
|
||||
//前工位申请任务请求时间
|
||||
@@ -140,10 +139,6 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
task2 = this.itemProtocol.getTask2();
|
||||
|
||||
if (mode != last_mode) {
|
||||
if (mode == 2){
|
||||
this.setRequireBackSucess(false);
|
||||
this.setRequireHeadSucess(false);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
@@ -156,10 +151,16 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + "->" + status);
|
||||
}
|
||||
if (move1 != last_move1) {
|
||||
if (move1 == 0) {
|
||||
this.setRequireHeadSucess(false);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "move1", String.valueOf(move1));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move1:" + last_move1 + "->" + move1);
|
||||
}
|
||||
if (move2 != last_move2) {
|
||||
if (move2 == 0) {
|
||||
this.setRequireBackSucess(false);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "move2", String.valueOf(move2));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_move2 + "->" + move2);
|
||||
}
|
||||
@@ -225,10 +226,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
acsToWmsService.feedbackTaskStatusToWms(array);
|
||||
}
|
||||
}
|
||||
writing("to_command1", "0");
|
||||
writing("to_onset1", "0");
|
||||
writing("to_target1", "0");
|
||||
writing("to_task1", "0");
|
||||
this.writing("to_command1", "0");
|
||||
this.writing("to_onset1", "0");
|
||||
this.writing("to_target1", "0");
|
||||
this.writing("to_task1", "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -275,10 +276,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
acsToWmsService.feedbackTaskStatusToWms(array);
|
||||
}
|
||||
}
|
||||
writing("to_command2", "0");
|
||||
writing("to_onset2", "0");
|
||||
writing("to_target2", "0");
|
||||
writing("to_task2", "0");
|
||||
this.writing("to_command2", "0");
|
||||
this.writing("to_onset2", "0");
|
||||
this.writing("to_target2", "0");
|
||||
this.writing("to_task2", "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,16 +420,26 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_head_time = date;
|
||||
//后工位取货关联设备
|
||||
//前工位取货关联设备
|
||||
List<String> getDeviceCodeList = this.getExtraDeviceCodes("head_get_device_code");
|
||||
//后工位放货关联设备
|
||||
//前工位放货关联设备
|
||||
List<String> putDeviceCodeList = this.getExtraDeviceCodes("head_put_device_code");
|
||||
//前工位重复关联设备
|
||||
List<String> repeatDeviceCodeList = this.getExtraDeviceCodes("head_repeat_device_code");
|
||||
//前工位重复关联设备放货设备
|
||||
List<String> repeatPutDeviceCodeList = this.getExtraDeviceCodes("head_repeat_put_device_code");
|
||||
TaskDto task = null;
|
||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||
String startDeviceCode = getDeviceCodeList.get(i);
|
||||
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtos)) {
|
||||
TaskDto taskDto = taskDtos.get(0);
|
||||
if (repeatDeviceCodeList.contains(startDeviceCode)) {
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
if (!repeatPutDeviceCodeList.contains(next_device_code)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
|
||||
instruction.setInstruction_status("1");
|
||||
instruction.setUpdate_time(DateUtil.now());
|
||||
@@ -440,6 +451,12 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||
task = taskDtoList.get(0);
|
||||
String next_device_code = task.getNext_device_code();
|
||||
if (repeatDeviceCodeList.contains(startDeviceCode)) {
|
||||
if (!repeatPutDeviceCodeList.contains(next_device_code)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(task)) break;
|
||||
}
|
||||
@@ -506,6 +523,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
List<String> getDeviceCodeList = this.getExtraDeviceCodes("back_get_device_code");
|
||||
//后工位放货关联设备
|
||||
List<String> putDeviceCodeList = this.getExtraDeviceCodes("back_put_device_code");
|
||||
//后工位重复关联设备
|
||||
List<String> repeatDeviceCodeList = this.getExtraDeviceCodes("back_repeat_device_code");
|
||||
//后工位重复关联设备放货设备
|
||||
List<String> repeatPutDeviceCodeList = this.getExtraDeviceCodes("back_repeat_put_device_code");
|
||||
|
||||
TaskDto task = null;
|
||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||
@@ -513,6 +534,12 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtos)) {
|
||||
TaskDto taskDto = taskDtos.get(0);
|
||||
if (repeatDeviceCodeList.contains(startDeviceCode)) {
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
if (!repeatPutDeviceCodeList.contains(next_device_code)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
|
||||
instruction.setInstruction_status("1");
|
||||
instruction.setUpdate_time(DateUtil.now());
|
||||
@@ -524,6 +551,12 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||
task = taskDtoList.get(0);
|
||||
String next_device_code = task.getNext_device_code();
|
||||
if (repeatDeviceCodeList.contains(startDeviceCode)) {
|
||||
if (!repeatPutDeviceCodeList.contains(next_device_code)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(task)) break;
|
||||
}
|
||||
@@ -632,6 +665,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
itemMap.put(to_param, value);
|
||||
|
||||
ReadUtil.write(itemMap, server);
|
||||
log.info("设备号:{},下发信号{},下发信号值{}", device_code, to_param, value);
|
||||
}
|
||||
|
||||
public boolean exe_business() {
|
||||
|
||||
Reference in New Issue
Block a user