|
@@ -22,6 +22,12 @@ public class KprBaseInitFun {
|
|
|
|
|
|
public Map<String,String> measurementMap = new HashMap<>();
|
|
|
|
|
|
+ //TODO 江津相关
|
|
|
+ public Map<String,List<String>> jiangjinParams = new HashMap<>();
|
|
|
+ public Map<String,List<String>> jiangjinDeviceList = new HashMap<>();
|
|
|
+
|
|
|
+ public Map<String,String> jiangjinMeasurementMap = new HashMap<>();
|
|
|
+
|
|
|
private static volatile KprBaseInitFun msInstance = null;
|
|
|
public static KprBaseInitFun getInstance(){
|
|
|
if (msInstance == null){
|
|
@@ -39,37 +45,138 @@ public class KprBaseInitFun {
|
|
|
|
|
|
public void init(){
|
|
|
try {
|
|
|
- InputStream inputStream = getConfigStream("application.yml");
|
|
|
- Properties properties = new Properties();
|
|
|
- properties.load(inputStream);
|
|
|
- List<String> WATER_METER= Arrays.asList(properties.getProperty("watermeter").split(","));
|
|
|
- List<String> FLOW_METER=Arrays.asList(properties.getProperty("flowmeter").split(","));
|
|
|
- List<String> PRESS_METER=Arrays.asList(properties.getProperty("pressmeter").split(","));
|
|
|
- List<String> WATER_QUALITY=Arrays.asList(properties.getProperty("waterquality").split(","));
|
|
|
- List<String> WATER_PUMP=Arrays.asList(properties.getProperty("waterpump").split(","));
|
|
|
- List<String> ELEC_CTRL_VALVE=Arrays.asList(properties.getProperty("elecctrlvalve").split(","));
|
|
|
- List<String> LIQUID_LEVEL_METER=Arrays.asList(properties.getProperty("liquidlevelmeter").split(","));
|
|
|
-
|
|
|
- dangyangParams.put("WATER_METER",WATER_METER);
|
|
|
- dangyangParams.put("FLOW_METER",FLOW_METER);
|
|
|
- dangyangParams.put("PRESS_METER",PRESS_METER);
|
|
|
- dangyangParams.put("WATER_QUALITY",WATER_QUALITY);
|
|
|
- dangyangParams.put("WATER_PUMP",WATER_PUMP);
|
|
|
- dangyangParams.put("ELEC_CTRL_VALVE",ELEC_CTRL_VALVE);
|
|
|
- dangyangParams.put("LIQUID_LEVEL_METER",LIQUID_LEVEL_METER);
|
|
|
-
|
|
|
- measurementMap.put("WATER_METER",properties.getProperty("WATER_METER"));
|
|
|
- measurementMap.put("FLOW_METER",properties.getProperty("FLOW_METER"));
|
|
|
- measurementMap.put("PRESS_METER",properties.getProperty("PRESS_METER"));
|
|
|
- measurementMap.put("WATER_QUALITY",properties.getProperty("WATER_QUALITY"));
|
|
|
- measurementMap.put("WATER_PUMP",properties.getProperty("WATER_PUMP"));
|
|
|
- measurementMap.put("ELEC_CTRL_VALVE",properties.getProperty("ELEC_CTRL_VALVE"));
|
|
|
- measurementMap.put("LIQUID_LEVEL_METER",properties.getProperty("LIQUID_LEVEL_METER"));
|
|
|
+ initDangyang();
|
|
|
+ initJiangjin();
|
|
|
}catch(Exception ex){
|
|
|
ex.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public void initDangyang()throws Exception{
|
|
|
+ InputStream inputStream = getConfigStream("application.yml");
|
|
|
+ Properties properties = new Properties();
|
|
|
+ properties.load(inputStream);
|
|
|
+ List<String> WATER_METER= Arrays.asList(properties.getProperty("watermeter").split(","));
|
|
|
+ List<String> FLOW_METER=Arrays.asList(properties.getProperty("flowmeter").split(","));
|
|
|
+ List<String> PRESS_METER=Arrays.asList(properties.getProperty("pressmeter").split(","));
|
|
|
+ List<String> WATER_QUALITY=Arrays.asList(properties.getProperty("waterquality").split(","));
|
|
|
+ List<String> WATER_PUMP=Arrays.asList(properties.getProperty("waterpump").split(","));
|
|
|
+ List<String> ELEC_CTRL_VALVE=Arrays.asList(properties.getProperty("elecctrlvalve").split(","));
|
|
|
+ List<String> LIQUID_LEVEL_METER=Arrays.asList(properties.getProperty("liquidlevelmeter").split(","));
|
|
|
+
|
|
|
+ dangyangParams.put("WATER_METER",WATER_METER);
|
|
|
+ dangyangParams.put("FLOW_METER",FLOW_METER);
|
|
|
+ dangyangParams.put("PRESS_METER",PRESS_METER);
|
|
|
+ dangyangParams.put("WATER_QUALITY",WATER_QUALITY);
|
|
|
+ dangyangParams.put("WATER_PUMP",WATER_PUMP);
|
|
|
+ dangyangParams.put("ELEC_CTRL_VALVE",ELEC_CTRL_VALVE);
|
|
|
+ dangyangParams.put("LIQUID_LEVEL_METER",LIQUID_LEVEL_METER);
|
|
|
+
|
|
|
+ measurementMap.put("WATER_METER",properties.getProperty("WATER_METER"));
|
|
|
+ measurementMap.put("FLOW_METER",properties.getProperty("FLOW_METER"));
|
|
|
+ measurementMap.put("PRESS_METER",properties.getProperty("PRESS_METER"));
|
|
|
+ measurementMap.put("WATER_QUALITY",properties.getProperty("WATER_QUALITY"));
|
|
|
+ measurementMap.put("WATER_PUMP",properties.getProperty("WATER_PUMP"));
|
|
|
+ measurementMap.put("ELEC_CTRL_VALVE",properties.getProperty("ELEC_CTRL_VALVE"));
|
|
|
+ measurementMap.put("LIQUID_LEVEL_METER",properties.getProperty("LIQUID_LEVEL_METER"));
|
|
|
+ }
|
|
|
+ public void initJiangjin()throws Exception{
|
|
|
+ InputStream inputStream = getConfigStream("application-config.yml");
|
|
|
+ Properties properties = new Properties();
|
|
|
+ properties.load(inputStream);
|
|
|
+
|
|
|
+ List<String> VoltageSwitchgear=Arrays.asList(properties.getProperty("VoltageSwitchgear").split(","));
|
|
|
+ List<String> WaterValve=Arrays.asList(properties.getProperty("WaterValve").split(","));
|
|
|
+ List<String> VariableFrequencyDrive=Arrays.asList(properties.getProperty("VariableFrequencyDrive").split(","));
|
|
|
+ List<String> ChlorineFlowMeter=Arrays.asList(properties.getProperty("ChlorineFlowMeter").split(","));
|
|
|
+ List<String> WaterQuality=Arrays.asList(properties.getProperty("WaterQuality").split(","));
|
|
|
+ List<String> DifferentialPressure=Arrays.asList(properties.getProperty("DifferentialPressure").split(","));
|
|
|
+ List<String> ElectricMotor=Arrays.asList(properties.getProperty("ElectricMotor").split(","));
|
|
|
+ List<String> WaterPump=Arrays.asList(properties.getProperty("WaterPump").split(","));
|
|
|
+ List<String> AirCompressor=Arrays.asList(properties.getProperty("AirCompressor").split(","));
|
|
|
+ List<String> RootsBlower=Arrays.asList(properties.getProperty("RootsBlower").split(","));
|
|
|
+ List<String> thMeter=Arrays.asList(properties.getProperty("thMeter").split(","));
|
|
|
+ List<String> SludgeIntfMeter=Arrays.asList(properties.getProperty("SludgeIntfMeter").split(","));
|
|
|
+ List<String> InformationSoftware=Arrays.asList(properties.getProperty("InformationSoftware").split(","));
|
|
|
+ List<String> WaterMeter=Arrays.asList(properties.getProperty("WaterMeter").split(","));
|
|
|
+ List<String> SmokeDetector=Arrays.asList(properties.getProperty("SmokeDetector").split(","));
|
|
|
+ List<String> LiquidLevelDiffer=Arrays.asList(properties.getProperty("LiquidLevelDiffer").split(","));
|
|
|
+ List<String> LiquidLevel=Arrays.asList(properties.getProperty("LiquidLevel").split(","));
|
|
|
+
|
|
|
+ jiangjinParams.put("VoltageSwitchgear",VoltageSwitchgear);
|
|
|
+ jiangjinParams.put("WaterValve",WaterValve);
|
|
|
+ jiangjinParams.put("VariableFrequencyDrive",VariableFrequencyDrive);
|
|
|
+ jiangjinParams.put("ChlorineFlowMeter",ChlorineFlowMeter);
|
|
|
+ jiangjinParams.put("WaterQuality",WaterQuality);
|
|
|
+ jiangjinParams.put("DifferentialPressure",DifferentialPressure);
|
|
|
+ jiangjinParams.put("ElectricMotor",ElectricMotor);
|
|
|
+ jiangjinParams.put("WaterPump",WaterPump);
|
|
|
+ jiangjinParams.put("AirCompressor",AirCompressor);
|
|
|
+ jiangjinParams.put("RootsBlower",RootsBlower);
|
|
|
+ jiangjinParams.put("thMeter",thMeter);
|
|
|
+ jiangjinParams.put("SludgeIntfMeter",SludgeIntfMeter);
|
|
|
+ jiangjinParams.put("InformationSoftware",InformationSoftware);
|
|
|
+ jiangjinParams.put("WaterMeter",WaterMeter);
|
|
|
+ jiangjinParams.put("SmokeDetector",SmokeDetector);
|
|
|
+ jiangjinParams.put("LiquidLevelDiffer",LiquidLevelDiffer);
|
|
|
+ jiangjinParams.put("LiquidLevel",LiquidLevel);
|
|
|
+
|
|
|
+ List<String> DeviceVoltageSwitchgear=Arrays.asList(properties.getProperty("VoltageSwitchgear_device").split(","));
|
|
|
+ List<String> DeviceWaterValve=Arrays.asList(properties.getProperty("WaterValve_device").split(","));
|
|
|
+ List<String> DeviceVariableFrequencyDrive=Arrays.asList(properties.getProperty("VariableFrequencyDrive_device").split(","));
|
|
|
+ List<String> DeviceChlorineFlowMeter=Arrays.asList(properties.getProperty("ChlorineFlowMeter_device").split(","));
|
|
|
+ List<String> DeviceWaterQuality=Arrays.asList(properties.getProperty("WaterQuality_device").split(","));
|
|
|
+ List<String> DeviceDifferentialPressure=Arrays.asList(properties.getProperty("DifferentialPressure_device").split(","));
|
|
|
+ List<String> DeviceElectricMotor=Arrays.asList(properties.getProperty("ElectricMotor_device").split(","));
|
|
|
+ List<String> DeviceWaterPump=Arrays.asList(properties.getProperty("WaterPump_device").split(","));
|
|
|
+ List<String> DeviceAirCompressor=Arrays.asList(properties.getProperty("AirCompressor_device").split(","));
|
|
|
+ List<String> DeviceRootsBlower=Arrays.asList(properties.getProperty("RootsBlower_device").split(","));
|
|
|
+ List<String> DevicethMeter=Arrays.asList(properties.getProperty("thMeter_device").split(","));
|
|
|
+ List<String> DeviceSludgeIntfMeter=Arrays.asList(properties.getProperty("SludgeIntfMeter_device").split(","));
|
|
|
+ List<String> DeviceInformationSoftware=Arrays.asList(properties.getProperty("InformationSoftware_device").split(","));
|
|
|
+ List<String> DeviceWaterMeter=Arrays.asList(properties.getProperty("WaterMeter_device").split(","));
|
|
|
+ List<String> DeviceSmokeDetector=Arrays.asList(properties.getProperty("SmokeDetector_device").split(","));
|
|
|
+ List<String> DeviceLiquidLevelDiffer=Arrays.asList(properties.getProperty("LiquidLevelDiffer_device").split(","));
|
|
|
+ List<String> DeviceLiquidLevel=Arrays.asList(properties.getProperty("LiquidLevel_device").split(","));
|
|
|
+
|
|
|
+ jiangjinDeviceList.put("Device_VoltageSwitchgear",DeviceVoltageSwitchgear);
|
|
|
+ jiangjinDeviceList.put("Device_WaterValve",DeviceWaterValve);
|
|
|
+ jiangjinDeviceList.put("Device_VariableFrequencyDrive",DeviceVariableFrequencyDrive);
|
|
|
+ jiangjinDeviceList.put("Device_ChlorineFlowMeter",DeviceChlorineFlowMeter);
|
|
|
+ jiangjinDeviceList.put("Device_WaterQuality",DeviceWaterQuality);
|
|
|
+ jiangjinDeviceList.put("Device_DifferentialPressure",DeviceDifferentialPressure);
|
|
|
+ jiangjinDeviceList.put("Device_ElectricMotor",DeviceElectricMotor);
|
|
|
+ jiangjinDeviceList.put("Device_WaterPump",DeviceWaterPump);
|
|
|
+ jiangjinDeviceList.put("Device_AirCompressor",DeviceAirCompressor);
|
|
|
+ jiangjinDeviceList.put("Device_RootsBlower",DeviceRootsBlower);
|
|
|
+ jiangjinDeviceList.put("Device_thMeter",DevicethMeter);
|
|
|
+ jiangjinDeviceList.put("Device_SludgeIntfMeter",DeviceSludgeIntfMeter);
|
|
|
+ jiangjinDeviceList.put("Device_InformationSoftware",DeviceInformationSoftware);
|
|
|
+ jiangjinDeviceList.put("Device_WaterMeter",DeviceWaterMeter);
|
|
|
+ jiangjinDeviceList.put("Device_SmokeDetector",DeviceSmokeDetector);
|
|
|
+ jiangjinDeviceList.put("Device_LiquidLevelDiffer",DeviceLiquidLevelDiffer);
|
|
|
+ jiangjinDeviceList.put("Device_LiquidLevel",DeviceLiquidLevel);
|
|
|
+
|
|
|
+ jiangjinMeasurementMap.put("VoltageSwitchgear","VoltageSwitchgear");
|
|
|
+ jiangjinMeasurementMap.put("WaterValve","WaterValve");
|
|
|
+ jiangjinMeasurementMap.put("VariableFrequencyDrive","VariableFrequencyDrive");
|
|
|
+ jiangjinMeasurementMap.put("ChlorineFlowMeter","ChlorineFlowMeter");
|
|
|
+ jiangjinMeasurementMap.put("WaterQuality","WaterQuality");
|
|
|
+ jiangjinMeasurementMap.put("DifferentialPressure","DifferentialPressure");
|
|
|
+ jiangjinMeasurementMap.put("ElectricMotor","ElectricMotor");
|
|
|
+ jiangjinMeasurementMap.put("WaterPump","WaterPump");
|
|
|
+ jiangjinMeasurementMap.put("AirCompressor","AirCompressor");
|
|
|
+ jiangjinMeasurementMap.put("RootsBlower","RootsBlower");
|
|
|
+ jiangjinMeasurementMap.put("thMeter","thMeter");
|
|
|
+ jiangjinMeasurementMap.put("SludgeIntfMeter","SludgeIntfMeter");
|
|
|
+ jiangjinMeasurementMap.put("InformationSoftware","InformationSoftware");
|
|
|
+ jiangjinMeasurementMap.put("WaterMeter","WaterMeter");
|
|
|
+ jiangjinMeasurementMap.put("SmokeDetector","SmokeDetector");
|
|
|
+ jiangjinMeasurementMap.put("LiquidLevelDiffer","LiquidLevelDiffer");
|
|
|
+ jiangjinMeasurementMap.put("LiquidLevel","LiquidLevel");
|
|
|
+ }
|
|
|
+
|
|
|
public InputStream getConfigStream(String configFileName) {
|
|
|
InputStream inputStream = null;
|
|
|
try {
|