From 936a3f961de4e7de9e2b28d6cb36dadb1efa57e1 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 19 六月 2023 11:20:58 +0800
Subject: [PATCH] 降低小车进出提升机速度

---
 src/main/java/com/zy/core/thread/LiftThread.java |   38 ++++++++++++++++++++++++++------------
 1 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java
index 70151e9..c1c4a82 100644
--- a/src/main/java/com/zy/core/thread/LiftThread.java
+++ b/src/main/java/com/zy/core/thread/LiftThread.java
@@ -6,6 +6,7 @@
 import HslCommunication.ModBus.ModbusTcpNet;
 import com.alibaba.fastjson.JSON;
 import com.core.common.DateUtils;
+import com.core.common.RadixTools;
 import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.BasLift;
@@ -21,7 +22,6 @@
 import com.zy.core.cache.OutputQueue;
 import com.zy.core.cache.SlaveConnection;
 import com.zy.core.enums.*;
-import com.zy.core.model.DevpSlave;
 import com.zy.core.model.LiftSlave;
 import com.zy.core.model.Task;
 import com.zy.core.model.command.*;
@@ -127,7 +127,7 @@
                 liftProtocol.setLiftLock(CommonUtils.shortToBoolean(modbusTcpNet.getByteTransform().TransInt16(content, 0)));
                 //浣嶇疆鍒拌揪鍙嶉
                 liftProtocol.setPositionArrivalFeedback(modbusTcpNet.getByteTransform().TransInt16(content,2));
-
+                
                 byte by = modbusTcpNet.getByteTransform().TransByte(content, 5);
                 int[] datas = CommonUtils.byteToBits(by);
                 //鍑嗗灏辩华
@@ -275,6 +275,14 @@
             array[29] = command.getLiftLockShortValue();
         }
 
+        if (array[2] == 0) {
+            // 寮�濮嬩换鍔�
+            short[] tmp = new short[2];
+            tmp[0] = array[0];
+            tmp[1] = array[1];
+            array = tmp;
+        }
+
         OperateResult result = modbusTcpNet.Write("41088", array);;
         if (result != null && result.IsSuccess) {
             News.info("鎻愬崌鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
@@ -392,6 +400,12 @@
             News.info("鎻愬崌鏈哄懡浠や笅鍙戞垚鍔燂紝鎻愬崌鏈哄彿={}锛屼换鍔℃暟鎹�={}", command.getLiftNo(), JSON.toJSON(command));
             liftProtocol.setWrkTime(new Date());//鏇存柊宸ヤ綔鏃堕棿
 
+            try {
+                Thread.sleep(1000);//鍛戒护涓嬪彂瀹屾垚鍚庝紤鐪�1s
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+
             //鍒ゆ柇鏁版嵁鏄惁鎵ц瀹屾垚
             if (commandStep < size - 1) {
                 //鏇存柊redis鏁版嵁
@@ -458,11 +472,11 @@
         command.setRun((short) 1);//鍗囬檷
         Short position = LiftLevType.getRealLev(lev);//鑾峰彇鎻愬崌鏈哄疄闄呮ゼ灞傛暟鍊�
         command.setDistPosition(position);
-        command.setSpeed((short) 200);
-        command.setHeight2((short) 180);
-        command.setHeight3((short) 1645);
-        command.setHeight4((short) (2 * 1645));
-        command.setHeight5((short) (3 * 1645));
+//        command.setSpeed((short) 200);
+//        command.setHeight2((short) 180);
+//        command.setHeight3((short) 1645);
+//        command.setHeight4((short) (2 * 1645));
+//        command.setHeight5((short) (3 * 1645));
         return command;
     }
 
@@ -476,11 +490,11 @@
         command.setLiftNo(liftNo);//鎻愬崌鏈哄彿
         command.setTaskNo(taskNo);//浠诲姟鍙�
         command.setDistPosition(position);//鐩爣妤煎眰
-        command.setSpeed((short) 200);
-        command.setHeight2((short) 180);
-        command.setHeight3((short) 1645);
-        command.setHeight4((short) 3290);
-        command.setHeight5((short) 4945);
+//        command.setSpeed((short) 200);
+//        command.setHeight2((short) 180);
+//        command.setHeight3((short) 1645);
+//        command.setHeight4((short) 3290);
+//        command.setHeight5((short) 4945);
         return command;
     }
 

--
Gitblit v1.9.1