| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.dy.common.util.ConfigProperties; |
| | | import com.dy.rtuMw.server.*; |
| | | import com.dy.rtuMw.server.msCenter.MsCenterConfigVo; |
| | | import com.dy.rtuMw.server.msCenter.MsCenterUnit; |
| | | import com.dy.rtuMw.server.rtuData.RtuDataUnit; |
| | | import com.dy.rtuMw.server.rtuData.RtuDataUnitConfigVo; |
| | | import com.dy.rtuMw.server.tasks.FromRtuComResultConstantTask; |
| | |
| | | private Document doc = null ; |
| | | private boolean showStartInfo = false ; |
| | | |
| | | private String orgTag ; |
| | | private String RmiSvUrl ; |
| | | private String TcpSvUrl ; |
| | | @Value("${server.port}") |
| | |
| | | boolean running = false ; |
| | | long start = System.currentTimeMillis() ; |
| | | try { |
| | | //ConfigProperties.init(this.getClass().getResourceAsStream("/config/config.properties"), false); |
| | | ConfigProperties.init(this.getClass().getResourceAsStream("/config.properties"), false); |
| | | |
| | | this.conf = new ConfigXml4Springboot() ; |
| | | this.doc = this.conf.createDom(this.resourceLoader, "config.xml") ; |
| | |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@# #@@@@@@@@@@@@@@@@O") ; |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@@@ &@@@@@@@@@@@@@@") ; |
| | | System.out.println("@@@@@@$ $@@@@@@@@@& O@@@@@@@@@@@#") ; |
| | | System.out.println("@@@@@@$ @@@@@@@@@ @@@@@@@@@& " + svName + "RtuMw 1.0.00" ) ; |
| | | System.out.println("@@@@@@$ @@@@@@@@@ @@@@@@@@@& " + this.orgTag + svName + "RtuMw 1.0.00" ) ; |
| | | if(this.HttpSvPath != null && this.HttpSvPort != null){ |
| | | System.out.println("@@@@@@$ O@@@@@@@@@ &@@@@@@@@ HttpSv [ip]:" + this.HttpSvPort + this.HttpSvPath) ; |
| | | }else{ |
| | |
| | | }else{ |
| | | System.out.println("@@@@@@$ #@@@@@@@@@$ &@@@@@@@@" ) ; |
| | | } |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@@# &@@@@@@@@ Runing in standalone mode" ) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@@# &@@@@@@@@ Running in standalone mode" ) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@& &@@@@@@@@ Startup in " + (System.currentTimeMillis() - start) + " MS" ) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@# &@@@@@@@@ " + company) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@#O &@@@@@@@@") ; |
| | |
| | | /////////////// |
| | | //基本配置 |
| | | ServerProperties.orgTag = this.conf.getSetAttrTxt(this.doc, "config.base", "orgTag", null, false, null) ; |
| | | if(ServerProperties.orgTag==null || ServerProperties.orgTag.trim().equals("")){ |
| | | if(ServerProperties.orgTag == null || ServerProperties.orgTag.trim().equals("")){ |
| | | throw new Exception("机构tag不能为空") ; |
| | | } |
| | | this.orgTag = ServerProperties.orgTag ; |
| | | ServerProperties.isLowPower = conf.getSetAttrBoolean(doc, "config.base", "isLowPower", null, null) ; |
| | | if(ServerProperties.isLowPower == null){ |
| | | ServerProperties.isLowPower = false ; |
| | |
| | | } |
| | | */ |
| | | |
| | | |
| | | ///////////////// |
| | | //消息中心模块 |
| | | MsCenterConfigVo mscVo = new MsCenterConfigVo(); |
| | | mscVo.enable = conf.getSetAttrBoolean(doc, "config.msCenter", "enable", null, null) ; |
| | | mscVo.notifyMsInterval = conf.getSetAttrPlusInt(doc, "config.msCenter", "notifyInterval", null, 1, 600, null) * 1000L ; |
| | | mscVo.showStartInfo = showStartInfo ; |
| | | AdapterImp_MsCenterUnit mscAdapt = new AdapterImp_MsCenterUnit(); |
| | | mscAdapt.setConfig(mscVo); |
| | | MsCenterUnit mscUnit = MsCenterUnit.getInstance(); |
| | | mscUnit.setAdapter(mscAdapt); |
| | | mscUnit.start(obj -> { |
| | | }); |
| | | units.add(mscUnit) ; |
| | | |
| | | |
| | | ///////////////// |
| | | //RTU远程升级模块 |
| | | UpgradeUnitConfigVo ugVo = new UpgradeUnitConfigVo(); |