From bda423b1aae1d5322116511651ae03a54cdcd231 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 26 十一月 2024 17:25:39 +0800 Subject: [PATCH] 1、几个测试模块系统的log4j.xml配置中的编码修改; 2、RTU升级模拟器增加命令行设置服务端IP和端口功能; 3、应王江海要求,井电双控协议中也实现远程升级功能,因井电双控协议、阀控器协议不同,而双方协议中的升级子协议相同,所以通信中间件做增量开发、适应性修改,以适应这种混合协议情况,同时也提高通信中间件运行效率。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java | 34 ++++++++++++++++++---------------- 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java index 6fd31f7..6b3ce51 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java @@ -6,7 +6,8 @@ import com.dy.common.queue.Queue; import com.dy.common.mw.UnitAdapterInterface; import com.dy.common.mw.UnitInterface; -import com.dy.common.mw.UnitStartedCallbackInterface; +import com.dy.common.mw.UnitCallbackInterface; + public class CoreUnit implements UnitInterface { @@ -36,17 +37,14 @@ if(vo == null){ throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄涓嶈兘涓虹┖锛�") ; } - if(vo.sleepBigBusy == null || vo.sleepSmallBusy == null){ + if(vo.coreInterval == null){ throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄闂撮殧灞炴�у�间笉鑳戒负绌猴紒") ; } - if(vo.sleepBigBusy <= 0){ - throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄灞炴�leepBigBusy鍊间笉鑳藉皬浜�0锛�") ; + if(vo.coreInterval <= 0){ + throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄灞炴�oreInterval鍊间笉鑳藉皬浜�0锛�") ; } - if(vo.sleepBigBusy > 1000){ - throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄灞炴�leepBigBusy鍊间笉鑳藉ぇ浜�1000锛�") ; - } - if(vo.sleepSmallBusy > 1000){ - throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄灞炴�leepSmallBusy鍊间笉鑳藉ぇ浜�1000锛�") ; + if(vo.coreInterval > 1000){ + throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄灞炴�oreInterval鍊间笉鑳藉ぇ浜�1000锛�") ; } if(vo.queueWarnSize == null || vo.queueMaxSize == null){ throw new Exception("鏍稿績妯″潡閰嶇疆瀵硅薄闃熷垪鑺傜偣闄愬埗鏁伴噺灞炴�у�间笉鑳戒负绌猴紒") ; @@ -64,28 +62,32 @@ } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { if(!started){ started = true ; + /* CoreThread ct = CoreThread.getInstance() ; ct.setSleep(this.adapter.getConfig().sleepBigBusy, this.adapter.getConfig().sleepSmallBusy); - ct.start(); - + ct.start(); + */ + CoreTimer ct = CoreTimer.getInstance() ; + ct.setSleep(this.adapter.getConfig().coreInterval); + ct.start(); + CoreConstantManage ccm = CoreConstantManage.getInstance() ; - ccm.setSleep(this.adapter.getConfig().sleepBigBusy, this.adapter.getConfig().sleepSmallBusy); + ccm.setSleep(this.adapter.getConfig().coreInterval); ccm.start(); if(adapter.getConfig().showStartInfo){ System.out.println("鏍稿績妯″潡鎴愬姛鍚姩锛�" - + "涓荤嚎绋嬬箒蹇欓棿闅旓細" + adapter.getConfig().sleepBigBusy + "姣锛�" - + "杞婚棽闂撮殧锛�" + adapter.getConfig().sleepSmallBusy + "姣" ); + + "涓荤嚎绋嬫墽琛岄棿闅旓細" + adapter.getConfig().coreInterval + "姣"); } callback.call(null); } } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } -- Gitblit v1.8.0