From f510760823f431891a501cd556928e215702ddb7 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期六, 19 四月 2025 13:36:11 +0800
Subject: [PATCH] 999
---
src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java b/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
index ac67184..29d5f64 100644
--- a/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
+++ b/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
@@ -43,7 +43,6 @@
private ForkLiftSlave slave;
private ForkLiftProtocol forkLiftProtocol;
private RedisUtil redisUtil;
- private SiemensS7Net siemensS7Net;
private List<ForkLiftStaProtocol> forkLiftStaProtocols = new ArrayList<>();
private LfdZyForkLiftMasterThread masterThread;
@@ -70,7 +69,6 @@
if(masterThread != null) {
result = true;
this.masterThread = masterThread;
- this.siemensS7Net = masterThread.getSiemensS7Net();
}
return result;
}
@@ -141,6 +139,7 @@
OutputQueue.FORKLIFT.offer(MessageFormat.format("銆恵0}銆憑1}璇诲彇璐у弶鎻愬崌鏈虹姸鎬佷俊鎭け璐�", DateUtils.convert(new Date()), slave.getId()));
}
+ SiemensS7Net siemensS7Net = this.masterThread.getSiemensS7Net();
if (result1.IsSuccess) {
if (null == forkLiftProtocol) {
forkLiftProtocol = new ForkLiftProtocol();
@@ -305,6 +304,7 @@
if (this.forkLiftProtocol.getTaskNo() == null
|| this.forkLiftProtocol.getProtocolStatus() == null
|| this.forkLiftProtocol.getModel() == null
+ || this.forkLiftProtocol.getErrorCode() == null
) {
return false;
}
@@ -312,7 +312,9 @@
boolean res = this.forkLiftProtocol.getProtocolStatus() == ForkLiftProtocolStatusType.IDLE.id
&& this.forkLiftProtocol.getWrkNo() == 0
&& this.forkLiftProtocol.getTaskNo() == 0
- && this.forkLiftProtocol.getModel() == 2;
+ && this.forkLiftProtocol.getModel() == 2
+ && this.forkLiftProtocol.getErrorCode() == 0
+ ;
return res;
}
@@ -333,13 +335,16 @@
if (this.forkLiftProtocol.getTaskNo() == null
|| this.forkLiftProtocol.getProtocolStatus() == null
|| this.forkLiftProtocol.getModel() == null
+ || this.forkLiftProtocol.getErrorCode() == null
) {
return false;
}
boolean res = this.forkLiftProtocol.getProtocolStatus() == ForkLiftProtocolStatusType.IDLE.id
&& this.forkLiftProtocol.getWrkNo() == 0
- && this.forkLiftProtocol.getModel() == 2;
+ && this.forkLiftProtocol.getModel() == 2
+ && this.forkLiftProtocol.getErrorCode() == 0
+ ;
return res;
}
@@ -370,13 +375,16 @@
@Override
public List<ForkLiftCommand> getPickAndPutCommand(Integer taskNo, Integer pick, Integer put) {
+ Integer realPick = pick % 1000;
+ Integer realPut = put % 1000;
+
List<ForkLiftCommand> commands = new ArrayList<>();
ForkLiftCommand command = new ForkLiftCommand();
command.setLiftNo(slave.getId());
command.setTaskNo(taskNo.shortValue());
command.setMode(ForkLiftTaskModeType.PICK_PUT.id.shortValue());
- command.setPick(pick.shortValue());
- command.setPut(put.shortValue());
+ command.setPick(realPick.shortValue());
+ command.setPut(realPut.shortValue());
command.setConfirm((short) 1);
commands.add(command);
@@ -384,14 +392,17 @@
}
@Override
- public List<ForkLiftCommand> getShuttleSwitchCommand(Integer taskNo, Integer originLev, Integer targetLev) {
+ public List<ForkLiftCommand> getShuttleSwitchCommand(Integer taskNo, Integer pick, Integer put) {
+ Integer realPick = pick % 1000;
+ Integer realPut = put % 1000;
+
List<ForkLiftCommand> commands = new ArrayList<>();
ForkLiftCommand command = new ForkLiftCommand();
command.setLiftNo(slave.getId());
command.setTaskNo(taskNo.shortValue());
command.setMode(ForkLiftTaskModeType.SHUTTLE_SWITCH.id.shortValue());
- command.setPick(originLev.shortValue());
- command.setPut(targetLev.shortValue());
+ command.setPick(realPick.shortValue());
+ command.setPut(realPut.shortValue());
command.setConfirm((short) 1);
commands.add(command);
--
Gitblit v1.9.1