| | |
| | | case "tvoc": |
| | | newTemp.spk = SPK.SensorTVOC; |
| | | break; |
| | | case "hcho": |
| | | newTemp.spk = SPK.SensorHcho; |
| | | break; |
| | | } |
| | | if(!string.IsNullOrEmpty(newTemp.spk)) |
| | | { |
| | |
| | | { |
| | | if (btn.Tag != null) |
| | | { |
| | | FunctionAttributes attr = updateTemp.GetAttribute(FunctionAttributeKey.Value); |
| | | if(attr == null) |
| | | { |
| | | switch(updateTemp.spk) |
| | | { |
| | | case SPK.SensorCO2: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Co2); |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Temperature); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Tvoc); |
| | | break; |
| | | case SPK.SensorPm25: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Pm25); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Hcho); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Humidity); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | (btn as Button).Text = attr.state;// updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |