From 1dade03e0e71076af3a3de1bf10ba6cad61ac216 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 01 二月 2021 19:22:38 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into NewFilePath

---
 HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs |   28 ++++------------------------
 1 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
old mode 100755
new mode 100644
index 46a6942..8f55da9
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
@@ -78,6 +78,8 @@
             seekBarContr.MinValue = 1;
             seekBarContr.MaxValue = 15;
             FrameWhiteCentet1.AddChidren(seekBarContr);
+            seekBarContr.Progress = this.fanData.SpeedLevel;
+            this.btnNowGear.Text = this.fanData.SpeedLevel + Language.StringByID(StringId.Gear);
 
             //寮�鍏冲浘鏍�
             this.btnSwitch = new IconViewControl(40);
@@ -94,14 +96,10 @@
 
             //鍒锋柊鐣岄潰鐘舵��
             this.RefreshFormStatu(false);
-
-            int oldProgressValue = fanData.SpeedLevel;
-            int nowProgressValue = fanData.SpeedLevel;
             //妗�
             var strView = Language.StringByID(StringId.Gear);
             seekBarContr.ProgressChangedEvent += (div, value) =>
             {
-                nowProgressValue = value;
                 this.btnNowGear.Text = value + strView;
                 //婊戝姩涓�
                 if (div == 0) { this.fanData.IsProgressing = true; }
@@ -110,28 +108,10 @@
                 {
                     this.fanData.IsProgressing = false;
                     this.fanData.ProgressEndTime = DateTime.Now;
+                    //鍙戦�侀閫熷懡浠�
+                    this.SendSpeedComand(value);
                 }
             };
-
-            HdlThreadLogic.Current.RunThread(() =>
-            {
-                while (this.Parent != null)
-                {
-                    if (nowProgressValue != oldProgressValue)
-                    {
-                        //鍙戦�侀閫熷懡浠�
-                        this.SendSpeedComand(nowProgressValue);
-                        oldProgressValue = nowProgressValue;
-                    }
-                    System.Threading.Thread.Sleep(1000);
-                }
-                //鐣岄潰鍏抽棴鏃�
-                if (nowProgressValue != oldProgressValue)
-                {
-                    //鍙戦�侀閫熷懡浠�
-                    this.SendSpeedComand(nowProgressValue);
-                }
-            });
         }
 
         #endregion

--
Gitblit v1.8.0