fix: 堆垛机command顺序修改

This commit is contained in:
2024-06-25 15:13:13 +08:00
parent 18cc9ccb61
commit 968e2540a6

View File

@@ -507,9 +507,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
String start_device_code = errorInst.getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
List listError = new ArrayList();
pakageCommand(listError, "1", errorInst.getInstruction_code());
pakageCommand(listError , errorInst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) {
pakagePlc(errorInst, listError);
pakagePlc(errorInst, listError,"1");
}
if (ObjectUtil.isNotEmpty(listError)) {
this.writing(listError);
@@ -995,10 +995,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
List list = new ArrayList();
pakageCommand(list, "1", inst.getInstruction_code());
pakageCommand(list, inst.getInstruction_code());
packagePlcCoordinate(startDevice, list);
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) {
pakagePlc(inst, list);
pakagePlc(inst, list,"1");
}
if (ObjectUtil.isNotEmpty(list)) {
this.writing(list);
@@ -1033,7 +1033,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
private void pakagePlc(Instruction inst, List list) {
private void pakagePlc(Instruction inst, List list, String toCommand) {
HashMap map4 = new HashMap();
map4.put("code", "to_y");
map4.put("value", inst.getFrom_z());
@@ -1054,17 +1054,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
map7.put("code", "to_x");
map7.put("value", inst.getFrom_y());
list.add(map7);
}
private void pakageCommand(List list, String toCommand, String inst) {
HashMap map1 = new HashMap();
map1.put("code", "to_device_code");
map1.put("value", this.getDevice().getAddress());
list.add(map1);
HashMap map2 = new HashMap();
map2.put("code", "to_command");
map2.put("value", toCommand);
list.add(map2);
}
private void pakageCommand(List list, String inst) {
HashMap map1 = new HashMap();
map1.put("code", "to_device_code");
map1.put("value", this.getDevice().getAddress());
list.add(map1);
HashMap map3 = new HashMap();
map3.put("code", "to_task");
map3.put("value", inst);