From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 16 四月 2020 17:10:57 +0800
Subject: [PATCH] 请合并代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs |   85 +++++++++++++++++++++---------------------
 1 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
index bdfa99d..07b2928 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
@@ -113,7 +113,7 @@
             rowInfo.btnIcon = btnIcon;
 
             //璁惧鍚嶇О
-            var btnDeviceName = new NormalViewControl(400, 60, true);
+            var btnDeviceName = new NormalViewControl(700, 60, true);
             btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
             btnDeviceName.X = Application.GetRealWidth(193);
             btnDeviceName.Y = Application.GetRealHeight(45);
@@ -125,7 +125,7 @@
             btnRoom.Y = btnDeviceName.Bottom + Application.GetRealHeight(12);
             btnRoom.TextSize = 12;
             btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
+            btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(device);
             frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
             rowInfo.btnRoom = btnRoom;
             //鎽勬皬搴�
@@ -211,21 +211,13 @@
             {
                 for (int i = 0; i < listDevice.Count; i++)
                 {
-                    if (i != 0 && i % 5 == 0)
+                    if (this.Parent == null)
                     {
-                        //璇诲彇5涓悗锛岄棿闅斾竴娈垫椂闂�
-                        System.Threading.Thread.Sleep(200);
-                        if (this.Parent == null)
-                        {
-                            return;
-                        }
+                        return;
                     }
-                    //鑾峰彇褰撳墠瀹ゆ俯
-                    ((AC)listDevice[i]).ReadLocalTemperature();
-                    //鑾峰彇寮�鍏崇姸鎬�(澶勪簬鏌愮宸ヤ綔鐘舵��,鍗充负鎵撳紑鐘舵��)
-                    ((AC)listDevice[i]).ReadSystemMode();
-                    //娓呮礂婊ょ綉
-                    listDevice[i].ReadAttri(Cluster_ID.Thermostat, AttriButeId.FilterCleaningStatus);
+                    //璇诲彇鐘舵��
+                    Phone.Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendThermostatStatuComand(listDevice[i]);
+                    System.Threading.Thread.Sleep(200);
                 }
             });
         }
@@ -253,27 +245,30 @@
                     var data = device.DeviceStatusReport.AttriBute[i];
                     if (data.AttributeId == 0)
                     {
-                        //瀹ゅ唴娓╁害
-                        if (data.AttriButeData == 0)
+                        HdlThreadLogic.Current.RunMain(() =>
                         {
-                            //0鈩�
-                            rowInfo.btnValue.Text = "0.0鈩�";
-                        }
-                        else if (data.AttriButeData > 32767)
-                        {
-                            //璐熸暟(鐗规畩澶勭悊)
-                            string strValue = (data.AttriButeData - 65536).ToString();
-                            //灏忔暟鐐归渶瑕佷竴浣�
-                            strValue = strValue.Substring(0, strValue.Length - 1);
-                            rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
-                        }
-                        else
-                        {
-                            //灏忔暟鐐归渶瑕佷竴浣�
-                            string strValue = data.AttriButeData.ToString();
-                            strValue = strValue.Substring(0, strValue.Length - 1);
-                            rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
-                        }
+                            //瀹ゅ唴娓╁害
+                            if (data.AttriButeData == 0)
+                            {
+                                //0鈩�
+                                rowInfo.btnValue.Text = "0.0鈩�";
+                            }
+                            else if (data.AttriButeData > 32767)
+                            {
+                                //璐熸暟(鐗规畩澶勭悊)
+                                string strValue = (data.AttriButeData - 65536).ToString();
+                                //灏忔暟鐐归渶瑕佷竴浣�
+                                strValue = strValue.Substring(0, strValue.Length - 1);
+                                rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
+                            }
+                            else
+                            {
+                                //灏忔暟鐐归渶瑕佷竴浣�
+                                string strValue = data.AttriButeData.ToString();
+                                strValue = strValue.Substring(0, strValue.Length - 1);
+                                rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�";
+                            }
+                        });
                     }
                     else if (data.AttributeId == 28)
                     {
@@ -281,9 +276,12 @@
                         //Off = 0  Auto = 1 Cool = 3 Heat = 4 FanOnly = 7  Dry = 8
                         if (data.AttriButeData != 0)
                         {
-                            rowInfo.btnSwitch.IsSelected = true;
-                            rowInfo.btnIcon.IsSelected = true;
-                            rowInfo.btnIconBack.BackgroundColor = 0xfffef1ed;
+                            HdlThreadLogic.Current.RunMain(() =>
+                            {
+                                rowInfo.btnSwitch.IsSelected = true;
+                                rowInfo.btnIcon.IsSelected = true;
+                                rowInfo.btnIconBack.BackgroundColor = 0xfffef1ed;
+                            });
                         }
                     }
                     else if (data.AttributeId == 4097)
@@ -291,9 +289,12 @@
                         //42:闇�瑕佹竻娲楁护缃�
                         if (data.AttriButeData == 42)
                         {
-                            rowInfo.btnWarningIcon.Visible = true;
-                            //璇锋敞鎰忔竻娲楁护缃戝摝
-                            rowInfo.btnWarningMsg.TextID = R.MyInternationalizationString.uPleaseClreanACfilter;
+                            HdlThreadLogic.Current.RunMain(() =>
+                            {
+                                rowInfo.btnWarningIcon.Visible = true;
+                                //璇锋敞鎰忔竻娲楁护缃戝摝
+                                rowInfo.btnWarningMsg.TextID = R.MyInternationalizationString.uPleaseClreanACfilter;
+                            });
                         }
                     }
                 }
@@ -331,7 +332,7 @@
                 {
                     var contr = dicControl[this.actionDeviceKeys];
                     contr.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
-                    contr.btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
+                    contr.btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(device);
                 }
             }
             this.actionDeviceKeys = null;

--
Gitblit v1.8.0