From 1f5d37fbca31293eff043f4a051be6f6876cea09 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 27 六月 2022 09:12:19 +0800 Subject: [PATCH] 跳动优化 --- HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs index ed7f296..519aec2 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs @@ -21,13 +21,13 @@ if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid) { bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%"; - bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); if (updataTemp.trait_on_off.curValue.ToString() == "on") { bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); if (!bodyView.onDimmerBar) { bodyView.dimmerBar.Progress = Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness)); + bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); } } else @@ -83,6 +83,8 @@ }; } + bool curDimmerStatus = false; + /// <summary> /// 鐏厜璋冨厜浜嬩欢 /// </summary> @@ -92,12 +94,13 @@ { dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { - onDimmerBar = true; + curDimmerStatus = onDimmerBar = true; dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); }; dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { - onDimmerBar = false; + + curDimmerStatus = false; function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); @@ -133,9 +136,9 @@ function.refreshTime = DateTime.Now; new System.Threading.Thread(() => { - System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - d.Add(FunctionAttributeKey.Brightness, e.ToString()); - Control.Ins.SendWriteCommand(function, d); + System.Collections.Generic.Dictionary<string, string> dic = new System.Collections.Generic.Dictionary<string, string>(); + dic.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, dic); }) { IsBackground = true }.Start(); } -- Gitblit v1.8.0