From adb12dcdbb2ddaeac687c3aa9e57bb7ed459ab7e Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 24 六月 2020 15:26:46 +0800
Subject: [PATCH] 2020.06.24.01

---
 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs |   32 ++++++++++----------------------
 1 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
index 885111b..6a1ef7c 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceRelayDetailCardForm.cs
@@ -215,9 +215,6 @@
         /// <param name="isOpen">鎵撳紑鐘舵��</param>
         private void RefreshSwitchStatu(bool isOpen)
         {
-            //鐘舵�佷竴鑷�(绗簩绱㈠紩鐨勬帶浠跺鏋滄槸閫夋嫨鐘舵��,鍒欏繀瀹氫负寮�鐘舵��)
-            if (listControl[1].IsSelected == isOpen) { return; }
-
             //鍙樻洿鐘舵��
             if (this.device.DfunctionType == DeviceFunctionType.A寮�鍏�)
             {
@@ -232,6 +229,8 @@
                 listControl[0].IsSelected = isOpen;
                 listControl[1].IsSelected = isOpen;
             }
+            //璁剧疆鐘舵�佹枃瀛�
+            this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
         }
 
         #endregion
@@ -246,19 +245,14 @@
         /// <returns></returns>
         public override bool CheckResponeResultStatu(ReceiveComandDiv comandDiv, CommonDevice report)
         {
-            if (comandDiv == ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉)
-            {
-                return true;
-            }
-            else if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�)
+            if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�)
             {
                 HdlThreadLogic.Current.RunMain(() =>
                 {
                     //鍙樻洿鍗$墖鐘舵��
                     this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
-                    //璁剧疆鐘舵�佹枃瀛�
-                    this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                 });
+                return true;
             }
             return false;
         }
@@ -279,36 +273,30 @@
                 ((LightBase)this.device).OnOffStatus = isOpen == true ? 1 : 0;
                 //鍙樻洿鍗$墖鐘舵��
                 this.RefreshSwitchStatu(((LightBase)this.device).OnOffStatus == 1);
-                //璁剧疆鐘舵�佹枃瀛�
-                this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
                 return;
             }
             //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
             this.StartCheckResponeResult(this.listControl, (result) =>
             {
-                //娌℃湁鎺ユ敹鍒扮綉鍏冲洖澶�
-                if (result == false)
+                //鎺ユ敹鍒扮綉鍏冲洖澶�
+                if (result == true)
                 {
                     HdlThreadLogic.Current.RunMain(() =>
-                    {             
-                        //璁剧疆鐘舵�佹枃瀛�
-                        this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
+                    {
+                        //鍙樻洿鍗$墖鐘舵��
+                        bool statu = ((LightBase)this.device).OnOffStatus == 1;
+                        this.RefreshSwitchStatu(statu);
                     });
                 }
             });
-            //鍙樻洿鍗$墖鐘舵��
-            this.RefreshSwitchStatu(isOpen);
-
             if (isOpen == true)
             {
                 //鎵撳紑
-                this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
                 this.device.SwitchControl(1);
             }
             else
             {
                 //鍏抽棴
-                this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close));
                 this.device.SwitchControl(0);
             }
         }

--
Gitblit v1.8.0