| | |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | if (LocalDevice.Current.GetDevice(room.TemperatrueDevice) != null) |
| | | { |
| | | //这个设备要存在本地才行 |
| | | temperatureText.Text = room.Temperatrue == 0 ? "0.0℃" : room.Temperatrue.ToString() + "℃"; |
| | | if (this.temperDevice != null) |
| | | {
|
| | | //这个设备要存在本地才行
|
| | | decimal temperatrue = (decimal)temperDevice.GetType().InvokeMember("currentTemperature", System.Reflection.BindingFlags.GetField, null, temperDevice, null); |
| | | temperatureText.Text = temperatrue == 0 ? "0.0℃" : temperatrue.ToString() + "℃"; |
| | | } |
| | | roomTemperatureBackground.AddChidren(temperatureText); |
| | | temperatureText.Width = temperatureText.GetTextWidth() + Application.GetRealWidth(60); |
| | |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | if (LocalDevice.Current.GetDevice(room.HumidityDevice) != null) |
| | | { |
| | | //这个设备要存在本地才行 |
| | | humidityText.Text = room.Humidity == 0 ? "0.0%" : room.Humidity.ToString() + "%"; |
| | |
|
| | | if (this.humidDevice != null) |
| | | {
|
| | | //这个设备要存在本地才行
|
| | | decimal humidity = (decimal)humidDevice.GetType().InvokeMember("currentHumidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null); |
| | | humidityText.Text = humidity == 0 ? "0.0%" : humidity.ToString() + "%"; |
| | | } |
| | | roomTemperatureBackground.AddChidren(humidityText); |
| | | humidityText.Width = humidityText.GetTextWidth() + Application.GetRealWidth(60); |
| | |
| | | if (report.DeviceAddr == temperDevice.DeviceAddr && report.DeviceEpoint == temperDevice.DeviceEpoint) |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | if (((TemperatureSensor)temperDevice).Temperatrue == 0) |
| | | {
|
| | | decimal temperatrue = (decimal)temperDevice.GetType().InvokeMember("currentTemperature", System.Reflection.BindingFlags.GetField, null, temperDevice, null); |
| | | if (temperatrue == 0) |
| | | { |
| | | temperatureText.Text = "0.0℃"; |
| | | } |
| | | else |
| | | { |
| | | temperatureText.Text = ((TemperatureSensor)temperDevice).Temperatrue + "℃"; |
| | | temperatureText.Text = temperatrue + "℃"; |
| | | } |
| | | }, ShowErrorMode.NO); |
| | | } |
| | |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | {
|
| | | decimal humidity = (decimal)humidDevice.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null); |
| | | decimal humidity = (decimal)humidDevice.GetType().InvokeMember("currentHumidity", System.Reflection.BindingFlags.GetField, null, humidDevice, null); |
| | | if (humidity == 0) |
| | | { |
| | | humidityText.Text = "--%"; |