From 5986f63b75bd81c6cef262c670e9251c038cbf5d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 17 十二月 2019 17:21:07 +0800
Subject: [PATCH] 合并一个版本

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs
index fb7754d..bdfa99d 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);
             };
@@ -231,7 +239,7 @@
         /// </summary>
         private void StartReceiveDataEvent()
         {
-            HdlDeviceAttributeLogic.Current.AddAttributeEvent("IndoorUnitListFormEvent", "DeviceStatusReport", (device) =>
+            HdlGatewayReceiveLogic.Current.AddAttributeEvent("IndoorUnitListFormEvent", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (device) =>
             {
                 string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
                 if (dicControl.ContainsKey(mainkeys) == false || device.DeviceStatusReport.CluterID != 513)
@@ -299,11 +307,36 @@
         /// <summary>
         /// 鐣岄潰鍏抽棴
         /// </summary>
-        public override void CloseForm()
+        public override void CloseFormBefore()
         {
-            HdlDeviceAttributeLogic.Current.RemoveEvent("IndoorUnitListFormEvent");
+            HdlGatewayReceiveLogic.Current.RemoveEvent("IndoorUnitListFormEvent");
 
-            base.CloseForm();
+            base.CloseFormBefore();
+        }
+
+        #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
@@ -316,6 +349,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