From ddb46a700775aacfb6cc82d9586302a38c8fa0a7 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期一, 23 十二月 2019 09:13:37 +0800 Subject: [PATCH] 2019.12.23 --- ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs index 589c395..5fb2f52 100644 --- a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs +++ b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs @@ -44,7 +44,7 @@ /// </summary> public int OldIconPathType; - + #endregion public EditRoom() @@ -207,6 +207,7 @@ return; } room.TemperatrueDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}"; + temperatureRow.SetTitle(R.MyInternationalizationString.Getting); HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice"); HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (Action<ZigBee.Device.CommonDevice>)((report) => @@ -227,6 +228,7 @@ { //0鈩� temperatureRow.NameText.Text = "0.0鈩�"; + room.Temperatrue = 0; } else if (data.AttriButeData > 32767) { @@ -235,6 +237,7 @@ //灏忔暟鐐归渶瑕佷竴浣� strValue = strValue.Substring(0, strValue.Length - 1); temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + room.Temperatrue = int.Parse(strValue) * 0.1; } else { @@ -242,6 +245,7 @@ string strValue = data.AttriButeData.ToString(); strValue = strValue.Substring(0, strValue.Length - 1); temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + room.Temperatrue = int.Parse(strValue) *0.1; } } } @@ -252,6 +256,7 @@ }; if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) { + temperatureRow.SetTitle(R.MyInternationalizationString.Getting); HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice"); HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (Action<ZigBee.Device.CommonDevice>)((report) => { @@ -271,6 +276,7 @@ { //0鈩� temperatureRow.NameText.Text = "0.0鈩�"; + room.Temperatrue = 0; } else if (data.AttriButeData > 32767) { @@ -279,6 +285,7 @@ //灏忔暟鐐归渶瑕佷竴浣� strValue = strValue.Substring(0, strValue.Length - 1); temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + room.Temperatrue = int.Parse(strValue) * 0.1; } else { @@ -286,6 +293,7 @@ string strValue = data.AttriButeData.ToString(); strValue = strValue.Substring(0, strValue.Length - 1); temperatureRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + room.Temperatrue = int.Parse(strValue) * 0.1; } } } @@ -296,6 +304,10 @@ { (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity(); } + } + else + { + temperatureRow.SetTitle(R.MyInternationalizationString.No); } @@ -318,6 +330,7 @@ return; } room.HumidityDevice = $"{selectTemp.DeviceAddr}{selectTemp.DeviceEpoint}"; + humidityRow.SetTitle(R.MyInternationalizationString.Getting); HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"); HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => @@ -337,6 +350,7 @@ { //0 humidityRow.NameText.Text = "0.0%"; + room.Humidity = 0; } else { @@ -344,6 +358,7 @@ string strValue = data.AttriButeData.ToString(); strValue = strValue.Substring(0, strValue.Length - 1); humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; + room.Humidity = int.Parse(strValue) * 0.1; } } } @@ -354,6 +369,7 @@ }; if (string.IsNullOrEmpty(room.HumidityDevice) == false) { + humidityRow.SetTitle(R.MyInternationalizationString.Getting); HdlGatewayReceiveLogic.Current.RemoveEvent("HumidityDevice"); HdlGatewayReceiveLogic.Current.AddAttributeEvent("HumidityDevice", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => { @@ -372,6 +388,7 @@ { //0 humidityRow.NameText.Text = "0.0%"; + room.Humidity = 0; } else { @@ -379,6 +396,7 @@ string strValue = data.AttriButeData.ToString(); strValue = strValue.Substring(0, strValue.Length - 1); humidityRow.NameText.Text = strValue.Insert(strValue.Length - 1, ".") + "%"; + room.Humidity = int.Parse(strValue) * 0.1; } } } @@ -390,6 +408,10 @@ (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity(); } } + else + { + humidityRow.SetTitle(R.MyInternationalizationString.No); + } if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove) { @@ -397,7 +419,7 @@ humidityRow.Y= Application.GetRealHeight(446); } - var confirm = new Device.CommonForm.CompleteButton(1700, 700, 127); + var confirm = new Device.CommonForm.CompleteButton(1700, 900, 127); confirm.SetTitle(R.MyInternationalizationString.Confrim); AddChidren(confirm); confirm.MouseUpEventHandler += (sender, e) => @@ -423,7 +445,6 @@ action?.Invoke(); RemoveFromParent(); }; - } /// <summary> @@ -457,7 +478,7 @@ BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor }; selectFL.AddChidren(itemFL); - itemFL.Animate = Animate.DownToUp; + //itemFL.Animate = Animate.DownToUp; var selectLocalPicture = new Button() { -- Gitblit v1.8.0