作者 钟来

修改bug

@@ -31,6 +31,21 @@ public class DeviceDataConfig { @@ -31,6 +31,21 @@ public class DeviceDataConfig {
31 this.attribute_describe = attribute_describe; 31 this.attribute_describe = attribute_describe;
32 } 32 }
33 33
  34 + public DeviceDataConfig(String attribute_name, PLCType device_type, PLCDataType plc_data_type,String sensor_numer,String attribute_describe,String alarmValue) {
  35 + this.attribute_name = attribute_name;
  36 + if(null != device_type)
  37 + {
  38 + this.device_type = device_type.name();
  39 + }
  40 + if(null != plc_data_type)
  41 + {
  42 + this.plc_data_type = plc_data_type.name();
  43 + }
  44 + this.sensor_numer = sensor_numer;
  45 + this.attribute_describe = attribute_describe;
  46 + this.alarmValue = alarmValue;
  47 + }
  48 +
34 public DeviceDataConfig(Integer number, String attribute_name,PLCType device_type, PLCDataType plc_data_type,String sensor_numer,String attribute_describe,String alarmCode,String alarmValue) { 49 public DeviceDataConfig(Integer number, String attribute_name,PLCType device_type, PLCDataType plc_data_type,String sensor_numer,String attribute_describe,String alarmCode,String alarmValue) {
35 this.attribute_name = attribute_name; 50 this.attribute_name = attribute_name;
36 if(null != device_type) 51 if(null != device_type)
@@ -40,15 +40,15 @@ public class DeviceProductProtocol { @@ -40,15 +40,15 @@ public class DeviceProductProtocol {
40 { 40 {
41 // String attribute_name, PLCType device_type, PLCDataType plc_data_type,String sensor_numer,String attribute_describe 41 // String attribute_name, PLCType device_type, PLCDataType plc_data_type,String sensor_numer,String attribute_describe
42 Map<String, DeviceDataConfig> deviceDataConfigReadMap = new HashMap<>(); 42 Map<String, DeviceDataConfig> deviceDataConfigReadMap = new HashMap<>();
43 - deviceDataConfigReadMap.put("YC_QT_C001A",new DeviceDataConfig("YC_QT_C001A",PLCType.推水机,PLCDataType.控制器状态码,"01","远程启停按钮"));  
44 - deviceDataConfigReadMap.put("YC_QT_C001B",new DeviceDataConfig("YC_QT_C001B",PLCType.推水机,PLCDataType.控制器状态码,"02","远程启停按钮"));  
45 - deviceDataConfigReadMap.put("YC_QT_C001C",new DeviceDataConfig("YC_QT_C001C",PLCType.推水机,PLCDataType.控制器状态码,"03","远程启停按钮"));  
46 - deviceDataConfigReadMap.put("YC_QT_C001D",new DeviceDataConfig("YC_QT_C001D",PLCType.推水机,PLCDataType.控制器状态码,"04","远程启停按钮"));  
47 - deviceDataConfigReadMap.put("YC_QT_C002",new DeviceDataConfig("YC_QT_C002",PLCType.增氧机,PLCDataType.控制器状态码,"34","远程启停按钮"));  
48 - deviceDataConfigReadMap.put("YC_QT_P001A",new DeviceDataConfig("YC_QT_P001A",PLCType.排污,PLCDataType.控制器状态码,"21","远程启停按钮"));  
49 - deviceDataConfigReadMap.put("YC_QT_P001B",new DeviceDataConfig("YC_QT_P001B",PLCType.排污,PLCDataType.控制器状态码,"22","远程启停按钮"));  
50 - deviceDataConfigReadMap.put("YC_QT_P001C",new DeviceDataConfig("YC_QT_P001C",PLCType.排污,PLCDataType.控制器状态码,"23","远程启停按钮"));  
51 - deviceDataConfigReadMap.put("YC_QT_P001D",new DeviceDataConfig("YC_QT_P001D",PLCType.排污,PLCDataType.控制器状态码,"24","远程启停按钮")); 43 + deviceDataConfigReadMap.put("YC_QT_C001A",new DeviceDataConfig("YC_QT_C001A",PLCType.推水机,PLCDataType.控制器状态码,"01","远程启停按钮","01"));
  44 + deviceDataConfigReadMap.put("YC_QT_C001B",new DeviceDataConfig("YC_QT_C001B",PLCType.推水机,PLCDataType.控制器状态码,"02","远程启停按钮","01"));
  45 + deviceDataConfigReadMap.put("YC_QT_C001C",new DeviceDataConfig("YC_QT_C001C",PLCType.推水机,PLCDataType.控制器状态码,"03","远程启停按钮","01"));
  46 + deviceDataConfigReadMap.put("YC_QT_C001D",new DeviceDataConfig("YC_QT_C001D",PLCType.推水机,PLCDataType.控制器状态码,"04","远程启停按钮","01"));
  47 + deviceDataConfigReadMap.put("YC_QT_C002",new DeviceDataConfig("YC_QT_C002",PLCType.增氧机,PLCDataType.控制器状态码,"34","远程启停按钮","01"));
  48 + deviceDataConfigReadMap.put("YC_QT_P001A",new DeviceDataConfig("YC_QT_P001A",PLCType.排污,PLCDataType.控制器状态码,"21","远程启停按钮","01"));
  49 + deviceDataConfigReadMap.put("YC_QT_P001B",new DeviceDataConfig("YC_QT_P001B",PLCType.排污,PLCDataType.控制器状态码,"22","远程启停按钮","01"));
  50 + deviceDataConfigReadMap.put("YC_QT_P001C",new DeviceDataConfig("YC_QT_P001C",PLCType.排污,PLCDataType.控制器状态码,"23","远程启停按钮","01"));
  51 + deviceDataConfigReadMap.put("YC_QT_P001D",new DeviceDataConfig("YC_QT_P001D",PLCType.排污,PLCDataType.控制器状态码,"24","远程启停按钮","01"));
52 return deviceDataConfigReadMap; 52 return deviceDataConfigReadMap;
53 } 53 }
54 } 54 }