fix: 双工位堆垛机修改

This commit is contained in:
2023-12-05 17:45:26 +08:00
parent b50fb70cd6
commit 1156f212cf

View File

@@ -91,8 +91,8 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
Integer lastFrontTask = 0;
//行走激光数值
Integer distancex = 0;
Integer lastDistancex = 0;
Integer distanceX = 0;
Integer lastDistanceX = 0;
//特殊开关量1
Float special1 = 0F;
@@ -173,8 +173,8 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
private int instructionUpdateTimeOut = 3000;
private Date instructionRequireTime = new Date();
private Date instructionUpdateTime = new Date();
List<String> getdevice_codeList = null;
List<String> putdevice_codeList = null;
List<String> getDeviceCodeList = null;
List<String> putDeviceCodeList = null;
//请求成功标记
Boolean requireSucess = false;
@@ -219,14 +219,14 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
LinkedList<Instruction> inst = new LinkedList<>();
getIns(inst);
if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isNotEmpty(inst.get(0))) {
String startdevice_code = inst.get(0).getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(startdevice_code);
writeStorageOrConveyor(inst,startdevice_code,startDevice,map);
String startDeviceCode = inst.get(0).getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode);
writeStorageOrConveyor(inst,startDeviceCode,startDevice,map);
}
if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isEmpty(inst.get(0))) {
String startdevice_code = inst.get(1).getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(startdevice_code);
writeStorageOrConveyor(inst,startdevice_code,startDevice,map);
String startDeviceCode = inst.get(1).getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode);
writeStorageOrConveyor(inst,startDeviceCode,startDevice,map);
}
map.put("to_command", CommandEnum.PICKUP_COMPLETE.getStatus());
requireSucess = true;
@@ -239,16 +239,16 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
LinkedList<Instruction> inst = new LinkedList<>();
getIns(inst);
if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isNotEmpty(inst.get(0))) {
String nextdevice_code = inst.get(0).getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(nextdevice_code);
String nextDeviceCode = inst.get(0).getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode);
//指令为执行
if (unloadCheck(nextDevice)) return;
map.put("to_command", 3);
requireSucess = true;
}
if (CollectionUtil.isNotEmpty(inst)&&ObjectUtil.isEmpty(inst.get(0))) {
String nextdevice_code = inst.get(1).getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(nextdevice_code);
String nextDeviceCode = inst.get(1).getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode);
if (unloadCheck(nextDevice)) return;
map.put("to_command", 3);
requireSucess = true;
@@ -308,7 +308,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
lastFrontY = frontY;
lastBackY = backY;
lastAction = action;
lastDistancex = distancex;
lastDistanceX = distanceX;
lastFrontForkCargo = frontForkCargo;
lastBackForkCargo = backForkCargo;
lastFrontForkLocation = frontForkLocation;
@@ -446,17 +446,17 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
return true;
}
for (Instruction instruction : instructions) {
List<RouteLineDto> routeLineDtos = routeLineService.selectDeviceCodeList(instruction.getStart_device_code());
if (CollUtil.isEmpty(routeLineDtos) || routeLineDtos.size() < 1) {
List<RouteLineDto> routeLines = routeLineService.selectDeviceCodeList(instruction.getStart_device_code());
if (CollUtil.isEmpty(routeLines) || routeLines.size() < 1) {
message = "没有输送线到堆垛机的路由";
logServer.deviceExecuteLog(this.device_code, "", "", "没有" + instruction.getStart_device_code() + "->"
+ this.device_code + "的路由");
continue;
}
for (RouteLineDto routeLineDto : routeLineDtos) {
for (RouteLineDto routeLineDto : routeLines) {
if (this.getDeviceCode().equals(routeLineDto.getNext_device_code())) {
List<RouteLineDto> routeLineDtoList = routeLineService.selectDeviceCodeList(this.getDeviceCode());
if (CollUtil.isEmpty(routeLineDtos) || routeLineDtos.size() < 1) {
if (CollUtil.isEmpty(routeLines) || routeLines.size() < 1) {
message = "没有输送线到堆垛机的路由";
logServer.deviceExecuteLog(this.device_code, "", "", "没有" + instruction.getStart_device_code() + "->"
+ this.device_code + "的路由");
@@ -475,8 +475,8 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
private boolean wirteData(LinkedList<Instruction> inst) {
if (StrUtil.equals(inst.get(0).getInstruction_status(), InstructionStatusEnum.READY.getIndex())) {
String startdevice_code = inst.get(0).getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(startdevice_code);
String startDeviceCode = inst.get(0).getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode);
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver();
@@ -504,7 +504,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
map.put("to_front_task", inst.get(0).getInstruction_code());
map.put("to_back_task", inst.get(1).getInstruction_code());
}
writeStorageOrConveyor(inst, startdevice_code, startDevice, map);
writeStorageOrConveyor(inst, startDeviceCode, startDevice, map);
this.writing(map);
}
@@ -818,9 +818,9 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + lastAction + "->" + action);
}
if (!distancex.equals(lastDistancex)) {
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distancex));
logServer.deviceExecuteLog(this.device_code, "", "", "信号distancex" + lastDistancex + "->" + distancex);
if (!distanceX.equals(lastDistanceX)) {
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distanceX));
logServer.deviceExecuteLog(this.device_code, "", "", "信号distancex" + lastDistanceX + "->" + distanceX);
}
if (!frontForkCargo.equals(lastFrontForkCargo)) {