From 18e9643ddd498c2f1cbc116a2fbf1f42345da88a Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Fri, 31 Mar 2023 14:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=80=BC=E4=B8=8D=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=97=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/acs/opc/DeviceOpcProtocolRunable.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index adabd10..462db8d 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -176,11 +176,11 @@ public class DeviceOpcProtocolRunable implements Runnable { value = OpcUtl.getValue(item, itemState); his = accessor_value.getValue(item.getId()); if (!ObjectUtl.isEquals(itemState.getQuality(), QualityTypeValue.OPC_QUALITY_GOOD) && his != null) { - maxResartNum ++; - log.warn("线程 {} opc 值不健康 maxResartNum:{} ", tag, maxResartNum); - log.warn("opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", item.getId(), itemState.getQuality(), value, his); + flag = true; + log.warn("线程 {} opc 值不健康 maxResartNum:{} ", tag); + log.warn("线程 {} opc 值不健康 item: {}, 状态: {},当前读取值:{}, 系统内存值{} ", tag, item.getId(), itemState.getQuality(), value, his); } - if(maxResartNum>10){ + if(flag){ if (this.server != null) { try { this.server.disconnect(); @@ -194,7 +194,6 @@ public class DeviceOpcProtocolRunable implements Runnable { ExecutorService executorService = Executors.newCachedThreadPool(); executorService.submit(runable); log.warn("opc 值不健康 item: {}, 重新创建连接,当前线程名:{}", item.getId(),tag); - flag = true; break; } } while (ObjectUtil.equal(value, his));//如果两次的值相等,不走下面的代码