From 73fd9aecc97d33f51ae7fe0350f3423cf8fd824f Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期一, 10 二月 2025 08:11:31 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/core/thread/JarThread.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/JarThread.java b/src/main/java/com/zy/core/thread/JarThread.java
index 8790090..51c1832 100644
--- a/src/main/java/com/zy/core/thread/JarThread.java
+++ b/src/main/java/com/zy/core/thread/JarThread.java
@@ -178,6 +178,62 @@
jarProtocol.setAutoing(siemensS7Net.getByteTransform().TransInt16(result.Content, 12) == 2);//鑷姩
+// if (jarProtocol.statusType .equals(JarStatusType.SOS)){
+// jarProtocol.setHoldingSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus()));
+// } else
+ if (jarProtocol.statusType .equals(JarStatusType.SOS2)){
+ jarProtocol.setHoldingSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus()));
+ if (!jarProtocol.rightDoorClose.equals(jarProtocol.leftDoorClose)) {
+ if (jarProtocol.rightDoorClose == 0 || jarProtocol.leftDoorClose == 0){
+ if (jarProtocol.rightDoorClose == 2 || jarProtocol.leftDoorClose == 2){
+ jarProtocol.setLeftDoorClose(0);//close the left door //杩涙枡闂�
+ jarProtocol.setRightDoorClose(0);//close the right door //鍑烘枡闂�
+ }
+ }
+ if (jarProtocol.rightDoorOpen == 0 || jarProtocol.leftDoorOpen == 0){
+ if (jarProtocol.rightDoorOpen == 2 || jarProtocol.leftDoorOpen == 2){
+ jarProtocol.setLeftDoorOpen(0);//open the left door //杩涙枡闂�
+ jarProtocol.setRightDoorOpen(0);//open the right door //鍑烘枡闂�
+ }
+ }
+ }
+ } else if (jarProtocol.statusType .equals(JarStatusType.WAITING3) || jarProtocol.statusType .equals(JarStatusType.WAITING4)){
+ jarProtocol.setOpenDoorSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus()));
+ } else if (jarProtocol.statusType .equals(JarStatusType.WAITING5) || jarProtocol.statusType .equals(JarStatusType.OFF_LINE)){
+ jarProtocol.setCloseDoorSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus()));
+ } else if (jarProtocol.leftDoorOpen==1 || jarProtocol.leftDoorClose==1 ||
+ jarProtocol.rightDoorOpen==1 || jarProtocol.rightDoorClose==1){
+
+ } else {
+ if (jarProtocol.statusType .equals(JarStatusType.WAITING2)){
+
+ if (jarProtocol.rightDoorOpen == 2 || jarProtocol.leftDoorOpen == 2){
+ jarProtocol.setLeftDoorOpen(0);//open the left door //杩涙枡闂�
+ jarProtocol.setRightDoorOpen(0);//open the right door //鍑烘枡闂�
+ }
+ if (jarProtocol.rightDoorClose == 2 || jarProtocol.leftDoorClose == 2){
+ jarProtocol.setLeftDoorClose(0);//close the left door //杩涙枡闂�
+ jarProtocol.setRightDoorClose(0);//close the right door //鍑烘枡闂�
+ }
+ } else if (jarProtocol.statusType .equals(JarStatusType.WAITING1) || jarProtocol.statusType .equals(JarStatusType.MOVING)){
+ if (!jarProtocol.rightDoorOpen.equals(jarProtocol.leftDoorOpen)) {
+ if (jarProtocol.rightDoorOpen == 0 || jarProtocol.leftDoorOpen == 0){
+ if (jarProtocol.rightDoorOpen == 2 || jarProtocol.leftDoorOpen == 2){
+ jarProtocol.setLeftDoorOpen(0);//open the left door //杩涙枡闂�
+ jarProtocol.setRightDoorOpen(0);//open the right door //鍑烘枡闂�
+ }
+ }
+ }
+ if (jarProtocol.rightDoorClose == 0 || jarProtocol.leftDoorClose == 0){
+ if (jarProtocol.rightDoorClose == 2 || jarProtocol.leftDoorClose == 2){
+ jarProtocol.setLeftDoorClose(0);//close the left door //杩涙枡闂�
+ jarProtocol.setRightDoorClose(0);//close the right door //鍑烘枡闂�
+ }
+ }
+ }
+ }
+
+ jarProtocol.setUpStatus(jarProtocol.getStatus());
//
// jarProtocol.setMode(2);//妯″紡
// jarProtocol.setStatus((short)6);//鐘舵��
@@ -318,7 +374,7 @@
OperateResultExOne<byte[]> resultRead2 = siemensS7Net.Read(resultV2, (short) 2);
if (resultRead2.IsSuccess) {
short transInt16 = siemensS7Net.getByteTransform().TransInt16(resultRead2.Content, 0);
- if (transInt16 == resultS1 || transInt16 == (short) 3){
+ if (transInt16 == resultS2 || transInt16 == (short) 3){
break;
} else {
log.error("鍐欏叆纭寲缃恜lc鏁版嵁澶辫触锛岄噸鏂颁笅鍙戜换鍔� 鍐欏叆鐩存帴澶辫触 ===>> [id:{}],{},[鍐欏叆娆℃暟:{}]", slave.getId(), JSON.toJSONString(command),writeCount);
--
Gitblit v1.9.1