From 3a3ec51d536a37713d8270ec797c451e347fed5e Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 06 七月 2023 11:15:59 +0800
Subject: [PATCH] #
---
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