From 69956cd46e68d240701b6269cc0d01862e450c82 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期一, 24 三月 2025 14:50:07 +0800
Subject: [PATCH] 1

---
 src/main/java/com/zy/core/thread/SiemensDevpThread.java |   42 +++++++++++++++++++++++++-----------------
 1 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index 955f1b5..85c82c1 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -53,6 +53,8 @@
         add(401);add(402);
     }};
 
+    private Integer count=0;
+
     /**
      * 鏉$爜鏁伴噺
      */
@@ -123,26 +125,30 @@
      * 鍒濆鍖栫珯鐐圭姸鎬�
      */
     private void initSite() {
+        count ++;
         ArrayList<Integer> staNos = getStaNo();
-        // 绔欑偣缂栧彿
-        for (Integer siteId : staNos) {
-            StaProtocol staProtocol = station.get(siteId);
-            if (null == staProtocol) {
-                staProtocol = new StaProtocol();
-                staProtocol.setSiteId(siteId);
-                station.put(siteId, staProtocol);
-            }
-            staProtocol.setWorkNo((short) 0);    // ID
-            staProtocol.setAutoing(false);      // 鑷姩
-            staProtocol.setLoading(false);      // 鏈夌墿
-            staProtocol.setInEnable(false);     // 鍙叆
-            staProtocol.setOutEnable(false);    // 鍙嚭
-            staProtocol.setEmptyMk(false);      // 绌烘澘淇″彿
-            staProtocol.setStaNo((short) 0);     // 鐩爣绔�
+        if(count > 10) {
+            // 绔欑偣缂栧彿
+            for (Integer siteId : staNos) {
+                StaProtocol staProtocol = station.get(siteId);
+                if (null == staProtocol) {
+                    staProtocol = new StaProtocol();
+                    staProtocol.setSiteId(siteId);
+                    station.put(siteId, staProtocol);
+                }
+                staProtocol.setWorkNo((short) 0);    // ID
+                staProtocol.setAutoing(false);      // 鑷姩
+                staProtocol.setLoading(false);      // 鏈夌墿
+                staProtocol.setInEnable(false);     // 鍙叆
+                staProtocol.setOutEnable(false);    // 鍙嚭
+                staProtocol.setEmptyMk(false);      // 绌烘澘淇″彿
+                staProtocol.setStaNo((short) 0);     // 鐩爣绔�
 
-            if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
-                staProtocol.setPakMk(true);
+                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
+                    staProtocol.setPakMk(true);
+                }
             }
+            count = 0;
         }
     }
 
@@ -224,6 +230,7 @@
                     if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
                         staProtocol.setPakMk(true);
                     }
+                    count = 0;
                 }
             }
         } else if(slave.getId()==2) {
@@ -246,6 +253,7 @@
                         staProtocol.setPakMk(true);
                     }
                 }
+                count = 0;
             }
         }
 

--
Gitblit v1.9.1