From c9f39a721e2e0320012d0b15a931f33160ac51ae Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 29 十月 2024 09:01:31 +0800
Subject: [PATCH] 命令日志查询增加一个state属性,并优化SQL

---
 pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java
index d698a66..6fd95b1 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java
@@ -2,7 +2,7 @@
 
 import com.dy.common.mw.UnitAdapterInterface;
 import com.dy.common.mw.UnitInterface;
-import com.dy.common.mw.UnitStartedCallbackInterface;
+import com.dy.common.mw.UnitCallbackInterface;
 import com.dy.common.util.Callback;
 import com.dy.pipIrrMwTestRtu.ServerProperties;
 import com.dy.pipIrrMwTestRtu.tcpClient.upData.UpData;
@@ -42,14 +42,14 @@
     }
 
     @Override
-    public void start(UnitStartedCallbackInterface callback) throws Exception {
+    public void start(UnitCallbackInterface callback) throws Exception {
         System.out.println("Tcp Client妯″潡鎴愬姛鍚姩");
         this.doStart();
         callback.call(null) ;
     }
 
     @Override
-    public void stop(UnitStartedCallbackInterface callback) throws Exception {
+    public void stop(UnitCallbackInterface callback) throws Exception {
         callback.call(null);
     }
 
@@ -108,13 +108,22 @@
         new Thread(new Runnable(){
             @Override
             public void run() {
-                while(true){
+                if(ServerProperties.onlyOneHeartBeat){
                     try {
                         UpHeartBeat.upCd02Data(ServerProperties.rtuAddr);
                         Thread.sleep(30000L);
                         //Thread.sleep(30000000L);
                     }catch (Exception e){
-                        continue;
+                    }
+                }else{
+                    while(true){
+                        try {
+                            UpHeartBeat.upCd02Data(ServerProperties.rtuAddr);
+                            Thread.sleep(30000L);
+                            //Thread.sleep(30000000L);
+                        }catch (Exception e){
+                            continue;
+                        }
                     }
                 }
             }

--
Gitblit v1.8.0