| | |
| | | { |
| | | X = Application.GetRealWidth(69), |
| | | Width = Application.GetRealWidth(120), |
| | | Text = room.Temperatrue == 0 ? "--℃" : $"{room.Temperatrue}℃", |
| | | Text = "--℃", |
| | | TextSize = 14, |
| | | TextAlignment=TextAlignment.CenterLeft |
| | | }; |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | {
|
| | | temperatureText.Text = room.Temperatrue == 0 ? "0.0℃" : room.Temperatrue.ToString() + "℃"; |
| | | } |
| | | roomTemperatureBackground.AddChidren(temperatureText); |
| | | temperatureText.Width = temperatureText.GetTextWidth() + Application.GetRealWidth(60); |
| | | |
| | |
| | | { |
| | | X = humidityIcon.Right, |
| | | Width = Application.GetRealWidth(120), |
| | | Text = room.Humidity == 0 ? "--%" : $"{room.Humidity}%", |
| | | Text = "--%", |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | if (string.IsNullOrEmpty(room.HumidityDevice) == false) |
| | | {
|
| | | humidityText.Text = room.Humidity == 0 ? "0.0%" : room.Humidity.ToString() + "%"; |
| | | } |
| | | roomTemperatureBackground.AddChidren(humidityText); |
| | | humidityText.Width = humidityText.GetTextWidth() + Application.GetRealWidth(60); |
| | | roomTemperatureBackground.Width = (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)) > Application.GetRealWidth(600) ? Application.GetRealWidth(600) : (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)); |
| | | |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | {
|
| | | //发送获取温度的命令 |
| | | var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); |
| | | ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev); |
| | |
| | | roomListBtn.MouseUpEventHandler += (send, e) => |
| | | { |
| | | CommonPage.Instance.IsDrawerLockMode = true; |
| | | var editRoom = new Device.Room.EditRoom(); |
| | | HomePage.Instance.AddChidren(editRoom); |
| | | HomePage.Instance.PageIndex += 1; |
| | | editRoom.temperDevice = this.temperDevice; |
| | | editRoom.humidDevice = this.humidDevice; |
| | | editRoom.Show(room); |
| | | editRoom.action += () => |
| | | { |
| | | action?.Invoke(); |
| | | |
| | | var form = new UserCenter.Residence.EditorRoomInforForm(); |
| | | form.AddForm(room); |
| | | form.FinishEditorEvent += (roomName2) =>
|
| | | {
|
| | | action?.Invoke();
|
| | | }; |
| | | }; |
| | | } |