From d4257e29fb63389203cf20c69c1f15123ef698d6 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期五, 18 四月 2025 09:04:41 +0800
Subject: [PATCH] 注释许可证限制
---
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 43 ++++++++++++++++++++++++++-----------------
1 files changed, 26 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..e637f82 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;
}
}
@@ -329,6 +337,7 @@
// OperateResult write1 = siemensS7Net.Write("DB101." + index*2, staProtocol.getStaNo()); // 鐩爣绔�
if (!write.IsSuccess) {
+ log.warn("鐩樼偣鍐嶅叆搴撶粰杈撻�佺嚎涓嬪彂鍛戒护瀹屾垚锛歿}",JSON.toJSON(staProtocol));
staProtocol = station.get(staProtocol.getSiteId());
if (staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0) {
staProtocol.setPakMk(true);
--
Gitblit v1.9.1