From 00ab3ddb140ba8bb88b5cf572b004a85e1da85e9 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 19:51:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs |  102 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 76 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
index b61a0b0..6b7a615 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
@@ -20,6 +20,10 @@
         /// 鎺т欢淇℃伅
         /// </summary>
         private Dictionary<string, RowControlInfo> dicControl = new Dictionary<string, RowControlInfo>();
+        /// <summary>
+        /// 婵�娲荤殑璁惧鍦板潃
+        /// </summary>
+        private string actionDeviceKeys = null;
 
         #endregion
 
@@ -114,6 +118,7 @@
             btnDeviceName.X = Application.GetRealWidth(193);
             btnDeviceName.Y = Application.GetRealHeight(45);
             frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
+            rowInfo.btnDeviceName = btnDeviceName;
             //鎴块棿
             var btnRoom = new NormalViewControl(400, 50, true);
             btnRoom.X = btnDeviceName.X;
@@ -122,6 +127,7 @@
             btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
             btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
             frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
+            rowInfo.btnRoom = btnRoom;
             //鎽勬皬搴�
             var btnValue = new NormalViewControl(300, 60, true);
             btnValue.Y = Application.GetRealHeight(58);
@@ -183,6 +189,8 @@
 
             frameTable.ButtonClickEvent += (sender, e) =>
             {
+                this.actionDeviceKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+
                 var form = new IndoorUnitSettionForm();
                 form.AddForm(device);
             };
@@ -245,27 +253,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)
                     {
@@ -273,9 +284,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)
@@ -283,9 +297,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;
+                            });
                         }
                     }
                 }
@@ -308,6 +325,31 @@
 
         #endregion
 
+        #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________
+
+        /// <summary>
+        /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠�
+        /// </summary>
+        public override int FormActionAgainEvent()
+        {
+            if (this.actionDeviceKeys != null && dicControl.ContainsKey(this.actionDeviceKeys) == true)
+            {
+                //鍒锋柊璁惧淇℃伅
+                var device = Common.LocalDevice.Current.GetDevice(this.actionDeviceKeys);
+                if (device != null)
+                {
+                    var contr = dicControl[this.actionDeviceKeys];
+                    contr.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
+                    contr.btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
+                }
+            }
+            this.actionDeviceKeys = null;
+
+            return 1;
+        }
+
+        #endregion
+
         #region 鈻� 缁撴瀯浣揰____________________________
 
         /// <summary>
@@ -316,6 +358,14 @@
         private class RowControlInfo
         {
             /// <summary>
+            /// 璁惧鍚嶅瓧
+            /// </summary>
+            public NormalViewControl btnDeviceName = null;
+            /// <summary>
+            /// 璁惧鎴块棿
+            /// </summary>
+            public NormalViewControl btnRoom = null;
+            /// <summary>
             /// 璁惧鍥炬爣鑳屾櫙
             /// </summary>
             public FrameLayout btnIconBack = null;

--
Gitblit v1.8.0