From 0e0584b87851c56745bf73b1a961b80613dd0721 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 19 五月 2020 16:35:16 +0800 Subject: [PATCH] 2020-05-19-4 --- ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 83 +++++++++++++++-------------------------- 1 files changed, 30 insertions(+), 53 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index 79e3f4f..b6ddfc2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -313,6 +313,10 @@ //鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎴块棿鍒楄〃淇℃伅 MainPage.ListRoomViewFrom.Instance.RefreshListRoom(); } + + //绠椾簡,杩欓噷濡傛灉鎸変笅淇濆瓨,鍒欎富椤甸渶瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; + this.CloseForm(); }; } @@ -420,41 +424,22 @@ { return; } - - foreach (var data in report.DeviceStatusReport.AttriBute) + var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys); + HdlThreadLogic.Current.RunMain(() => { - if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + if (((ZigBee.Device.TemperatureSensor)localDevice).Temperatrue == 0) { - HdlThreadLogic.Current.RunMain(() => - { - if (data.AttriButeData == 0) - { - //0鈩� - btnTemper.Text = "0.0鈩�"; - this.cloneRoom.Temperatrue = 0; - } - else if (data.AttriButeData > 32767) - { - //璐熸暟(鐗规畩澶勭悊) - string strValue = (data.AttriButeData - 65536).ToString(); - //灏忔暟鐐归渶瑕佷竴浣� - strValue = strValue.Substring(0, strValue.Length - 1); - //璁板綍娓╁害 - this.cloneRoom.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�"; - } - else - { - //灏忔暟鐐归渶瑕佷竴浣� - string strValue = data.AttriButeData.ToString(); - strValue = strValue.Substring(0, strValue.Length - 1); - //璁板綍娓╁害 - this.cloneRoom.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�"; - } - }); + //0鈩� + btnTemper.Text = "0.0鈩�"; + this.cloneRoom.Temperatrue = 0; } - } + else + { + //璁板綍娓╁害 + this.cloneRoom.Temperatrue = ((ZigBee.Device.TemperatureSensor)localDevice).Temperatrue; + btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�"; + } + }, ShowErrorMode.NO); })); //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); @@ -527,30 +512,22 @@ { return; } - foreach (var data in report.DeviceStatusReport.AttriBute) + var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys); + HdlThreadLogic.Current.RunMain(() => { - if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + if (((ZigBee.Device.TemperatureSensor)localDevice).Humidity == 0) { - HdlThreadLogic.Current.RunMain(() => - { - if (data.AttriButeData == 0) - { - //0 - btnHumi.Text = "0.0%"; - this.cloneRoom.Humidity = 0; - } - else - { - //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟) - string strValue = data.AttriButeData.ToString(); - strValue = strValue.Substring(0, strValue.Length - 1); - //璁板綍婀垮害 - this.cloneRoom.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%"; - } - }); + //0 + btnHumi.Text = "0.0%"; + this.cloneRoom.Humidity = 0; } - } + else + { + //璁板綍婀垮害 + this.cloneRoom.Humidity = ((ZigBee.Device.TemperatureSensor)localDevice).Humidity; + btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%"; + } + }, ShowErrorMode.NO); }); //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护 ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); -- Gitblit v1.8.0