前后工位更新

This commit is contained in:
2022-12-22 18:27:24 +08:00
parent 3eec6e1679
commit 7132431900

View File

@@ -251,7 +251,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
// } // }
// } // }
; ;
// this.setNow_steps_type2(1); // this.setNow_steps_type2(1);
} }
} }
} }
@@ -318,15 +318,15 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
} }
//单任务/或双任务 后工位收到取货完成信号并反馈 //单任务/或双任务 后工位收到取货完成信号并反馈
if (mode == 3 && action2 == 2 && move2 == 1 && task2 > 0){ if (mode == 3 && action2 == 2 && move2 == 1 && task2 > 0) {
this.writing("to_command2","3"); this.writing("to_command2", "3");
if (type == 2){ if (type == 2) {
this.setNow_steps_type2(4); this.setNow_steps_type2(4);
} }
if (type == 3){ if (type == 3) {
this.setNow_steps_type3(4); this.setNow_steps_type3(4);
} }
}else { } else {
if (this.getNow_steps_type2() == 3 || this.getNow_steps_type3() == 3) { if (this.getNow_steps_type2() == 3 || this.getNow_steps_type3() == 3) {
feedMessage = "请检查mode == 3 && action2 == 2 && move2 == 1 && task2 > 0"; feedMessage = "请检查mode == 3 && action2 == 2 && move2 == 1 && task2 > 0";
} }
@@ -347,15 +347,15 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
} }
//单任务/双任务 前工位取货完成并反馈 //单任务/双任务 前工位取货完成并反馈
if (mode == 3 && action1 == 2 && move1 == 1 && task1 > 0){ if (mode == 3 && action1 == 2 && move1 == 1 && task1 > 0) {
this.writing("to_command1","3"); this.writing("to_command1", "3");
if (type == 1){ if (type == 1) {
this.setNow_steps_type1(4); this.setNow_steps_type1(4);
} }
if (type == 3){ if (type == 3) {
this.setNow_steps_type3(6); this.setNow_steps_type3(6);
} }
}else { } else {
if (this.getNow_steps_type1() == 3 || this.getNow_steps_type3() == 5) { if (this.getNow_steps_type1() == 3 || this.getNow_steps_type3() == 5) {
feedMessage = "请检查:mode == 3 && action1 == 2 && move1 == 1 && task1 > 0"; feedMessage = "请检查:mode == 3 && action1 == 2 && move1 == 1 && task1 > 0";
} }
@@ -478,7 +478,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
} }
//双工位 任务完成 前工位反馈4 //双工位 任务完成 前工位反馈4
if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3) { if (mode == 3 && action1 == 4 && move1 == 0 && task1 > 0 && task2 > 0 && type == 3) {
//inst_message //inst_message
@@ -510,7 +509,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
} }
} catch (Exception var17) { } catch (Exception var17) {
return; return;
} }
@@ -956,12 +954,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
Device nextDevice2 = deviceAppservice.findDeviceByCode(next_device_code2); Device nextDevice2 = deviceAppservice.findDeviceByCode(next_device_code2);
String start_addr2 = startDevice2.getExtraValue().get("address").toString(); String start_addr2 = startDevice2.getExtraValue().get("address").toString();
String next_addr2 = nextDevice2.getExtraValue().get("address").toString(); String next_addr2 = nextDevice2.getExtraValue().get("address").toString();
this.writing("to_onset1", start_addr); this.writing("to_onset1", start_addr2);
this.writing("to_target1", next_addr); this.writing("to_target1", next_addr2);
this.writing("to_task1", dto.getInstruction_code()); this.writing("to_task1", dto.getInstruction_code());
this.writing("to_command1", "1"); this.writing("to_command1", "1");
this.writing("to_onset2", start_addr2); this.writing("to_onset2", start_addr);
this.writing("to_target2", next_addr2); this.writing("to_target2", next_addr);
this.writing("to_task2", dto.getInstruction_code()); this.writing("to_task2", dto.getInstruction_code());
this.writing("to_command2", "1"); this.writing("to_command2", "1");
this.writing("to_type", "3"); this.writing("to_type", "3");
@@ -1060,7 +1058,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
//将扩展表中的字符串数组数据转换成集合 //将扩展表中的字符串数组数据转换成集合
public List<String> getExtraDeviceCodes(String extraName) { public List<String> getExtraDeviceCodes(String extraName) {
String extraValue = (String) this.getDevice().getExtraValue().get(extraName); String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
if (StrUtil.isEmpty(extraValue)){ if (StrUtil.isEmpty(extraValue)) {
return new ArrayList<>(); return new ArrayList<>();
} }
String devicesString = extraValue.substring(1, extraValue.length() - 1); String devicesString = extraValue.substring(1, extraValue.length() - 1);
@@ -1073,14 +1071,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
return devicesList; return devicesList;
} }
public List<TaskDto> sortTask(List<TaskDto> taskDtos){ public List<TaskDto> sortTask(List<TaskDto> taskDtos) {
Collections.sort(taskDtos, new Comparator<TaskDto>() { Collections.sort(taskDtos, new Comparator<TaskDto>() {
@Override @Override
public int compare(TaskDto t1, TaskDto t2) { public int compare(TaskDto t1, TaskDto t2) {
//优先级从大到小 //优先级从大到小
int i = t2.getPriority().compareTo(t1.getPriority()); int i = t2.getPriority().compareTo(t1.getPriority());
//如果优先级相等 //如果优先级相等
if (i == 0){ if (i == 0) {
//时间从早到晚 //时间从早到晚
i = t1.getCreate_time().compareTo(t2.getCreate_time()); i = t1.getCreate_time().compareTo(t2.getCreate_time());
} }