| | |
| | | try { |
| | | /////////////// |
| | | //基本配置 |
| | | ServerProperties.orgTag = this.conf.getSetAttrTxt(this.doc, "config.base", "orgTag", null, false, null) ; |
| | | if(ServerProperties.orgTag==null || ServerProperties.orgTag.trim().equals("")){ |
| | | throw new Exception("机构tag不能为空") ; |
| | | } |
| | | ServerProperties.isLowPower = conf.getSetAttrBoolean(doc, "config.base", "isLowPower", null, null) ; |
| | | if(ServerProperties.isLowPower == null){ |
| | | ServerProperties.isLowPower = false ; |
| | |
| | | //不在线缓存的命令最大缓存时长 |
| | | ServerProperties.offLineCachTimeout = conf.getSetAttrPlusInt(doc, "config.base", "offLineCachTimeout", null, 15, 172800, null) * 1000L ; |
| | | //TCP上行数据时刻缓存时长,当达到时长时,TCP上行数据时刻被清空,采用TCP上行数据时刻目的是,阻止上数据同时下发数据,因为RTU处理不过来 |
| | | ServerProperties.lastUpDataTimeLive = conf.getSetAttrPlusInt(doc, "config.base", "lastUpDataTimeLive", null, 0, 5, null) * 1000L ; |
| | | ServerProperties.lastUpDataTimeLive = conf.getSetAttrPlusInt(doc, "config.base", "lastUpDataTimeLive", null, 0, 5000, null) * 1L ; |
| | | //数据库数据id生成器的id后缀,0是默认的后缀,一般web系统应用,数据中间件id后缀大于等于1 |
| | | ServerProperties.dbDataIdSuffix = conf.getSetAttrInt(doc, "config.base", "dbDataIdSuffix", null, 0, 99, null); |
| | | //上下行数据缓存队列中缓存数据个数的报警量,这个与现实项目所接水表数相关 |
| | |
| | | if(ServerProperties.cacheUpDownDataMaxCount <= ServerProperties.cacheUpDownDataWarnCount){ |
| | | throw new Exception("cacheUpDownDataMaxCount必须大于cacheUpDownDataWarnCount") ; |
| | | } |
| | | //没有上行数据的分钟数,达到这个分钟数,认为RTU断网了,取值范围是2_100 |
| | | ServerProperties.disconnectedByNoUpDataMinutes = 0L + conf.getSetAttrPlusInt(doc, "config.base", "disconnectedByNoUpDataMinutes", null, 1, 100, null) ; |
| | | if(ServerProperties.disconnectedByNoUpDataMinutes < 1 || ServerProperties.disconnectedByNoUpDataMinutes > 100){ |
| | | throw new Exception("disconnectedByNoUpDataMinutes取值必须是1~100") ; |
| | | } |
| | | ServerProperties.disconnectedByNoUpDataMinutes = ServerProperties.disconnectedByNoUpDataMinutes * 60 * 1000 ; |
| | | |
| | | //设置ID生成器的后缀 |
| | | IDLongGenerator.setSuffix(ServerProperties.dbDataIdSuffix.intValue()); |