From 611786df5108dca0bdcff03834cc285cba4b8e61 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 13 十月 2020 16:48:43 +0800
Subject: [PATCH] 2020-10-13-1
---
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 74 ++++++++++++++++++++++++++++--------
1 files changed, 57 insertions(+), 17 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
index 156712d..afd6da5 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -76,31 +76,69 @@
/// </summary>
void LoadEvent_LightDimming(DiyImageSeekBar dimmerControlBar)
{
- if (function.functionType == FunctionType.Dimmer || function.functionType == FunctionType.RGB)
+ //if (function.functionType == FunctionType.Dimmer || function.functionType == FunctionType.RGB)
+ //{
+ // if (dimmerControlBar == null)
+ // return;
+ // var light = function as Light;
+ // dimmerControlBar.OnProgressChangedEvent += (sender, e) =>
+ // {
+ // if ((DateTime.Now - light.refreshTime).TotalMilliseconds > 200)//璋冨厜鍛戒护鍙戦�侀棿闅斾簨浠�
+ // {
+ // new System.Threading.Thread(() =>
+ // {
+ // light.refreshTime = DateTime.Now;
+ // light.brightness = e;
+ // Control.Send(CommandType_A.write, function);
+ // })
+ // { IsBackground = true }.Start();
+ // }
+ // };
+ // dimmerControlBar.OnStopTrackingTouchEvent += (sender, e) =>
+ // {
+ // light.brightness = dimmerControlBar.Progress;
+ // Control.Send(CommandType_A.write, function);
+ // };
+ //}
+ if(function.functionType == FunctionType.Dimmer || function.functionType == FunctionType.RGB)
{
- if (dimmerControlBar == null)
- return;
-
var light = function as Light;
- dimmerControlBar.OnProgressChangedEvent += (sender, e) =>
- {
- if ((DateTime.Now - light.refreshTime).TotalMilliseconds > 200)//璋冨厜鍛戒护鍙戦�侀棿闅斾簨浠�
+ dimmerControlBar.OnStartTrackingTouchEvent = (sender, e) => {
+ onDimmerBar = true;
+ };
+ dimmerControlBar.OnStopTrackingTouchEvent = (sender, e) => {
+ onDimmerBar = false;
+ light.brightness = dimmerControlBar.Progress;
+ Control.Send(CommandType_A.write, light);
+ };
+ dimmerControlBar.OnProgressChangedEvent = (sender, e) => {
+ light.brightness = e;
+ light.on_off = e > 0 ? "on" : "off";
+
+ if (e == 0 || e == 100)
{
- new System.Threading.Thread(() =>
+ Control.Send(CommandType_A.write, light);
+ }
+ else
+ {
+ if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
{
light.refreshTime = DateTime.Now;
- light.brightness = e;
- Control.Send(CommandType_A.write, function);
- })
- { IsBackground = true }.Start();
+ new System.Threading.Thread(() =>
+ {
+ Control.Send(CommandType_A.write, light);
+ })
+ { IsBackground = true }.Start();
+ }
+ else
+ {
+ MainPage.Log("skip dimmer control!!");
+ }
}
};
- dimmerControlBar.OnStopTrackingTouchEvent += (sender, e) =>
- {
- light.brightness = dimmerControlBar.Progress;
- Control.Send(CommandType_A.write, function);
- };
+
}
+
}
#endregion
@@ -159,6 +197,8 @@
{
var eventHandler = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollectionIcon, btnName, btnFromFloor);
this.MouseUpEventHandler = eventHandler;
+ btnName.MouseUpEventHandler = eventHandler;
+ btnFromFloor.MouseUpEventHandler = eventHandler;
}
--
Gitblit v1.8.0