From 469b0eacbc45dc5fd4d947c1636651629a286f6b Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期五, 18 十月 2024 08:42:53 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java index 18b3460..43d9acd 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java @@ -22,17 +22,19 @@ import com.dy.rtuMw.resource.ResourceUnit; import com.dy.rtuMw.resource.ResourceUnitConfigVo; import com.dy.common.springUtil.SpringContextUtil; -import com.dy.common.util.ConfigXml; +import com.dy.common.util.ConfigXml4Springboot; import com.dy.common.util.IDLongGenerator; import org.jdom2.Document; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ResourceLoader; import org.springframework.stereotype.Component; @Component public class Server { - private ConfigXml conf = null ; + private ConfigXml4Springboot conf = null ; private Document doc = null ; private boolean showStartInfo = false ; @@ -42,6 +44,9 @@ private String HttpSvPort ; @Value("${server.servlet.context-path}") private String HttpSvPath ; + + @Autowired + protected ResourceLoader resourceLoader ; private List<UnitInterface> units = new ArrayList<UnitInterface>() ; @@ -78,8 +83,8 @@ try { //ConfigProperties.init(this.getClass().getResourceAsStream("/config/config.properties"), false); - this.conf = new ConfigXml() ; - this.doc = this.conf.createDom(this.getClass(), "config.xml") ; + this.conf = new ConfigXml4Springboot() ; + this.doc = this.conf.createDom(this.resourceLoader, "config.xml") ; //////////////// //鏈嶅姟 閰嶇疆 this.showStartInfo = this.conf.getSetAttrBoolean(this.doc, "config.server", "showStartInfo", null, null) ; @@ -199,6 +204,9 @@ //宸ヤ綔鎶ュお棰戠箒锛孨娆′笂鎶ュ鐞�1娆★紝鍙栧�艰寖鍥存槸1-100 ServerProperties.workReportDealOneByTimes = conf.getSetAttrPlusInt(doc, "config.base", "workReportDealOneByTimes", null, 1, 100, null) ; + //瑙﹀彂鍙戦�侀拤閽夋姤璀︽秷鎭殑鍙栨按鍙f棩婕忔崯閲忕殑鏈�灏忓�硷紙鍖呮嫭浣嗛櫎0.0澶栵級 + ServerProperties.intakeAlarmLossMinValue = conf.getSetAttrPlusDouble(doc, "config.base", "intakeAlarmLossMinValue", null, 0.0, 1000000.0, null) ; + //鏈夋姤璀﹀彂鐢熸椂锛屽悜閽夐拤鍙戦�佹秷鎭殑闂撮殧鏃堕暱锛堝垎閽燂級 ServerProperties.sendDingDingAlarmMsInterval = conf.getSetAttrPlusInt(doc, "config.base", "sendDingDingAlarmMsInterval", null, 1, 600, null) ; @@ -279,7 +287,7 @@ //RTU鏃ュ織鏂囦欢瀛樺偍鐩綍(鐩稿鐩綍) resVo.rtuLogDir = conf.getSetAttrTxt(doc, "config.resource", "rtuLogDir", null, false, null) ; //RTU鏃ュ織鏂囦欢鏈�澶у瓧鑺傛暟(KB) - resVo.rtuLogFileMaxSize = conf.getSetAttrPlusInt(doc, "config.resource", "rtuLogFileMaxSize", null, 100000, 2000000, null) ; + resVo.rtuLogFileMaxSize = conf.getSetAttrPlusInt(doc, "config.resource", "rtuLogFileMaxSize", null, 10, 2000000, null) ; //RTU鏃ュ織鏂囦欢鏈�澶ф枃浠舵暟 resVo.rtuLogFileMaxCount = conf.getSetAttrPlusInt(doc, "config.resource", "rtuLogFileMaxCount", null, 1, 10, null) ; @@ -323,8 +331,9 @@ */ ///////////////// - //RTU涓婅鏁版嵁澶勭悊妯″潡 + //RTU涓婅鏁版嵁澶勭悊妯″潡锛堜换鍔℃爲锛� RtuDataUnitConfigVo rducVo = new RtuDataUnitConfigVo(); + rducVo.resourceLoader = this.resourceLoader ; AdapterImp_RtuDataUnit rducAdap = new AdapterImp_RtuDataUnit(); rducAdap.setConfig(rducVo); RtuDataUnit rducUnit = RtuDataUnit.getInstance(); -- Gitblit v1.8.0