From e1ac4ab0e68024e6289e0b11756962d662749b04 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 三月 2021 17:15:23 +0800
Subject: [PATCH] Revert "Merge branch 'WJC' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into WJC"

---
 HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs
index d0199bb..171e369 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs
@@ -73,9 +73,9 @@
         /// </summary>
         private MostRightIconControl btnAnionSwitch = null;
         /// <summary>
-        /// 婊よ姱澶嶄綅寮�鍏虫帶浠� 2021.03.09鎺т欢鍙樻洿
+        /// 婊よ姱澶嶄綅寮�鍏虫帶浠�
         /// </summary>
-        //private MostRightIconControl btnResetSwitch = null;
+        private MostRightIconControl btnResetSwitch = null;
         /// <summary>
         /// 绌烘皵璐ㄩ噺鏁版嵁
         /// </summary>
@@ -328,11 +328,12 @@
             rowReset.Height = Application.GetRealHeight(50);
             rowReset.Width = FrameWhiteCentet2.Width;
             rowReset.Y = rowAnion.Bottom;
-            //FrameWhiteCentet2.AddChidren(rowReset);
+            FrameWhiteCentet2.AddChidren(rowReset);
             rowReset.AddLeftCaption(Language.StringByID(StringId.FilterElementReset), 200);
             rowReset.AddBottomLine();
-            rowReset.AddRightArrow();
-            rowReset.ButtonClickEvent += (sender, e) =>
+            this.btnResetSwitch = rowReset.AddMostRightSwitchIcon();
+            btnResetSwitch.IsSelected = this.airCleanerData.FilterReset;
+            btnResetSwitch.ButtonClickEvent += (sender, e) =>
             {
                 if (this.btnSwitch.IsSelected == false)
                 {
@@ -344,7 +345,7 @@
                 this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                 {
                     //鍙戦�佷娇鑳藉懡浠�
-                    this.SendEnableComand(null, "filter_reset", "true");
+                    this.SendEnableComand(btnResetSwitch, "filter_reset", btnResetSwitch.IsSelected == true ? "false" : "true");
                 });
             };
         }
@@ -623,18 +624,12 @@
         /// </summary>
         private void SendEnableComand(MostRightIconControl btnSwitch, string sendKey, string value)
         {
-            if (btnSwitch != null)
-            {
-                btnSwitch.CanClick = false;
-            }
+            btnSwitch.CanClick = false;
             HdlThreadLogic.Current.RunThread(() =>
             {
                 var dic = new Dictionary<string, string>();
                 dic.Add(sendKey, value);
                 Control.Ins.SendWriteCommand(this.device, dic, true);
-
-                if (btnSwitch == null) { return; }
-
                 HdlThreadLogic.Current.RunMain(() =>
                 {
                     btnSwitch.CanClick = true;
@@ -774,10 +769,10 @@
                 this.btnAnionSwitch.IsSelected = this.airCleanerData.Anion;
             }
             //婊よ姱澶嶄綅
-            //if (this.btnResetSwitch.IsSelected != this.airCleanerData.FilterReset)
-            //{
-            //    this.btnResetSwitch.IsSelected = this.airCleanerData.FilterReset;
-            //}
+            if (this.btnResetSwitch.IsSelected != this.airCleanerData.FilterReset)
+            {
+                this.btnResetSwitch.IsSelected = this.airCleanerData.FilterReset;
+            }
         }
 
         #endregion

--
Gitblit v1.8.0