From b4e0f827567f8d5ad4a1ff5caa22675cbc165b88 Mon Sep 17 00:00:00 2001 From: lsh <lsh123456> Date: 星期三, 11 六月 2025 10:27:31 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/SiemensDevpThread.java | 44 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java index e1bd0b0..8d7b143 100644 --- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java +++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java @@ -58,6 +58,8 @@ add(144);add(145);add(146);add(147); add(148);add(149);add(150);add(151); add(152);add(153); + add(170); + add(171); }}; public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ add(200);add(201);add(202);add(203); @@ -69,7 +71,7 @@ }}; public static final ArrayList<Integer> staNos1Super = new ArrayList<Integer>() {{ - add(118);add(119);add(120);add(121);add(131);add(135);add(147); + add(118);add(119);add(120);add(121);add(122);add(123);add(131);add(135);add(147); }}; public static final ArrayList<Integer> staNos2Super = new ArrayList<Integer>() {{ @@ -206,6 +208,28 @@ if (result.IsSuccess) { for (int i = 0; i < staNoSize; i++) { Integer siteId = staNos.get(i); // 绔欑偣缂栧彿 + if (siteId==119){ + StaProtocol staProtocol = station.get(siteId); + if (null == staProtocol) { + staProtocol = new StaProtocol(); + staProtocol.setSiteId(siteId); + station.put(siteId, staProtocol); + } + staProtocol.setWorkNo(0); // 宸ヤ綔鍙� + + staProtocol.setStaNo(0); // 鐩爣绔� + + boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, i*8 + 6, 2); + staProtocol.setAutoing(false); // 鑷姩 + staProtocol.setLoading(status[1]); // 鏈夌墿 + staProtocol.setInEnable(status[2]); // 鍙叆 + staProtocol.setOutEnable(status[3]);// 鍙嚭 + staProtocol.setEmptyMk(status[4]); // 绌烘澘淇″彿 + staProtocol.setFullPlt(status[5]); // 婊℃墭鐩� + staProtocol.setHigh(status[6]); // 楂樺簱浣� + staProtocol.setLow(status[7]); // 浣庡簱浣� + continue; + } StaProtocol staProtocol = station.get(siteId); if (null == staProtocol) { staProtocol = new StaProtocol(); @@ -225,7 +249,6 @@ staProtocol.setFullPlt(status[5]); // 婊℃墭鐩� staProtocol.setHigh(status[6]); // 楂樺簱浣� staProtocol.setLow(status[7]); // 浣庡簱浣� - if (!staProtocol.isPakMk() && !staProtocol.isLoading()) { staProtocol.setPakMk(true); } @@ -329,7 +352,7 @@ staProtocol.setSiteId(siteId); station.put(siteId, staProtocol); } - short loadingSuper = siemensS7Net.getByteTransform().TransInt16(result.Content, i * 2); + short loadingSuper = siemensS7Net.getByteTransform().TransInt16(resultStaSuper.Content, i * 2); staProtocol.setLoadingSuper(loadingSuper==0); // 鐩爣绔� } } @@ -420,7 +443,7 @@ case 118: index=0; break; - case 119: + case 171: index=1; break; case 120: @@ -487,7 +510,7 @@ case 118: index=0; break; - case 119: + case 171: index=1; break; case 120: @@ -570,6 +593,17 @@ } } + /** + * 璁剧疆鍏ュ簱鏍囪 + */ + @Override + public void setReportSign(Integer siteId, boolean pakMk) { + StaProtocol staProtocol = station.get(siteId); + if (null != staProtocol) { + staProtocol.setReportSign(pakMk); + } + } + @Override public void close() { siemensS7Net.ConnectClose(); -- Gitblit v1.9.1