From f718d23a262a5a8e1241fdeaeb4153399f95e79d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 21 四月 2020 09:19:05 +0800
Subject: [PATCH] 20200421

---
 HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
index 1513d35..a725456 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -108,7 +108,7 @@
                 if (curtain.openLevel > 1)
                 {
                     curtain.openLevel--;
-                    controlBar.Progress = curtain.openLevel;
+                    curtainSeekBar.Progress = controlBar.Progress = curtain.openLevel;
                     delayTime = DateTime.Now;
                     new System.Threading.Thread(() => {
                         while(delayTime != DateTime.MaxValue)
@@ -135,10 +135,10 @@
             };
 
             btnPlusSgnIcon.MouseDownEventHandler = (sender, e) => {
-                if (curtain.openLevel > 1)
+                if (curtain.openLevel < 100)
                 {
                     curtain.openLevel++;
-                    controlBar.Progress = curtain.openLevel;
+                    curtainSeekBar.Progress = controlBar.Progress = curtain.openLevel;
                     delayTime = DateTime.Now;
                     new System.Threading.Thread(() => {
                         while (delayTime != DateTime.MaxValue)
@@ -171,6 +171,18 @@
                 {
                     delayTime = DateTime.Now;
                     curtain.openLevel = e;
+                    controlBar.Progress = e;
+                    Control.Send(CommandType_A.write, curtain);
+                }
+            };
+
+            controlBar.OnProgressChangedEvent = (sender, e) =>
+            {
+                if ((DateTime.Now - delayTime).TotalMilliseconds > 300)
+                {
+                    delayTime = DateTime.Now;
+                    curtain.openLevel = e;
+                    curtainSeekBar.Progress = e;
                     Control.Send(CommandType_A.write, curtain);
                 }
             };

--
Gitblit v1.8.0