From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 01 六月 2020 14:59:39 +0800
Subject: [PATCH] 上传一个合并的版本

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
index 974445d..4e1e63a 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
@@ -26,6 +26,10 @@
         /// </summary>
         public Common.Room nowSelectRoom = null;
         /// <summary>
+        /// 鏍囪瀹冩槸鐢卞摢涓帶浠惰皟璧风殑
+        /// </summary>
+        public ViewGroup RowOrCardControl = null;
+        /// <summary>
         /// 鐘舵�佹帶浠�
         /// </summary>
         private NormalViewControl btnStatu = null;
@@ -237,7 +241,7 @@
 
             HdlThreadLogic.Current.RunThread(() =>
             {
-                int waitime = 30;
+                int waitime = 40;
                 while (waitime > 0)
                 {
                     System.Threading.Thread.Sleep(100);
@@ -247,8 +251,18 @@
                         break;
                     }
                     waitime--;
+                    //2绉掔殑鏃跺��,杩樻槸鎺ュ彈涓嶅埌鐨勮瘽,寮哄埗鍐嶆鍒锋柊璁惧鐘舵��
+                    if (waitime == 20)
+                    {
+                        //浠庢柊鍙戦�佽幏鍙栬澶囩殑鐘舵��(寮哄埗)
+                        this.device.HadReadDeviceStatu = false;
+                        if (this.RowOrCardControl != null)
+                        {
+                            this.RowOrCardControl.GetType().InvokeMember("SendStatuComand", System.Reflection.BindingFlags.InvokeMethod, null, this.RowOrCardControl, null);
+                        }
+                    }
                 }
-                if (waitime <= 0)
+                if (waitime <= 0 && this.Parent != null)
                 {
                     //娌℃湁鑾峰彇寰楀埌缁撴灉
                     HdlThreadLogic.Current.RunMain(() =>
@@ -292,22 +306,6 @@
         private void AddDeviceReportEvent()
         {
             string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device);
-            //鑺傜偣鍙嶉
-            HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardControl" + mainKeys, ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) =>
-            {
-                string mainKey2 = Common.LocalDevice.Current.GetDeviceMainKeys(report);
-                if (mainKeys != mainKey2)
-                {
-                    //涓嶆槸鍚屼竴涓笢瑗�
-                    return;
-                }
-                //妫�娴嬬粨鏋�
-                if (this.CheckResponeResultStatu(ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, report) == true)
-                {
-                    //缁撴灉宸茬粡鎺ユ敹鍒�
-                    this.ResponeResult = 1;
-                }
-            });
             //灞炴�т笂鎶�
             HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardAttribute" + mainKeys, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
             {

--
Gitblit v1.8.0