From 5a0f4ce17e31d84068bdb2f62d5bb7ef27f87d0f Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期六, 22 六月 2024 09:33:07 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/SteThread.java | 49 ++++++++++++++-----------------------------------
1 files changed, 14 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/SteThread.java b/src/main/java/com/zy/core/thread/SteThread.java
index 536e038..22155d8 100644
--- a/src/main/java/com/zy/core/thread/SteThread.java
+++ b/src/main/java/com/zy/core/thread/SteThread.java
@@ -143,44 +143,23 @@
steProtocol.setRow(siemensS7Net.getByteTransform().TransInt16(result.Content, 14));
steProtocol.setBay(siemensS7Net.getByteTransform().TransInt16(result.Content, 16));
steProtocol.setLev(siemensS7Net.getByteTransform().TransInt16(result.Content, 18));
-
-// steProtocol.setReady(siemensS7Net.getByteTransform().TransInt16(result.Content, 20));
- boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, 20, 1);
- steProtocol.setReady(status[0]?(short)1:(short)0);
+ steProtocol.setLoca(siemensS7Net.getByteTransform().TransInt16(result.Content, 20));
+ steProtocol.setLocaStart(siemensS7Net.getByteTransform().TransInt16(result.Content, 22));
+ steProtocol.setLocaEnd(siemensS7Net.getByteTransform().TransInt16(result.Content, 24));
+ boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, 26, 1);
+// steProtocol.setReady(status[0]?(short)1:(short)0);
// steProtocol.setReady(status[1]?(short)1:(short)0);
-// steProtocol.setReady(status[2]?(short)1:(short)0);
-// steProtocol.setLoad(status[3]?(short)1:(short)0);
-// steProtocol.setReady(status[4]?(short)1:(short)0);
- steProtocol.setChargeStatus(status[5]?(short)1:(short)0);
- steProtocol.setTrack(status[6]?(short)1:(short)0);
+ steProtocol.setReady(status[3]?(short)1:(short)0);
+// steProtocol.setReady(status[3]?(short)1:(short)0);
+// steProtocol.setTrack(status[6]?(short)1:(short)0);
- SteLocaType locaType = SteLocaType.NONE;
- boolean[] status2 = siemensS7Net.getByteTransform().TransBool(result.Content, 21, 1);
- if (steProtocol.getRow().intValue() >= 6) {
- if (status[7]){//A鐐�
- locaType = SteLocaType.A;
- }
- if (status2[1]){//A寰呮満鐐�
- if (locaType.equals(SteLocaType.NONE)) {
- locaType = SteLocaType.A_WAITING;
- }
- }
- }else {
- if (status2[0]){//B鐐�
- if (locaType.equals(SteLocaType.NONE)) {
- locaType = SteLocaType.B;
- }
- }
- if (status2[2]){//B寰呮満鐐�
- if (locaType.equals(SteLocaType.NONE)) {
- locaType = SteLocaType.B_WAITING;
- }
- }
- }
+ boolean[] status2 = siemensS7Net.getByteTransform().TransBool(result.Content, 27, 1);
- steProtocol.setLoca(locaType.id.shortValue());
- steProtocol.setReady(status2[3]?(short)1:(short)0);
- steProtocol.setLoad(status2[4]?(short)1:(short)0);
+ steProtocol.setChargeStatus(status[0]?(short)1:(short)0);
+ steProtocol.setTrack(status[1]?(short)1:(short)0);
+
+// steProtocol.setLoad(status2[6]?(short)1:(short)0);
+ steProtocol.setLoad(status2[7]?(short)1:(short)0);
OutputQueue.STE.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
--
Gitblit v1.9.1