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/ColorTureLampPageBLL.cs |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
index 09d981d..6da0079 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -27,8 +27,11 @@
                             {
                                 bodyView.dimmerBar.Progress = Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness));
                             }
-                            bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%";
-                            bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80);
+                            if (updataTemp.GetAttrState(FunctionAttributeKey.Brightness) != "0")
+                            {
+                                bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%";
+                                bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80);
+                            }
                         }
                         else
                         {
@@ -134,6 +137,7 @@
             };
         }
 
+        bool curDimmerStatus = false;
         /// <summary>
         /// 鐏厜璋冨厜浜嬩欢
         /// </summary>
@@ -151,11 +155,16 @@
                 //    }.Show(MainPage.BaseView);
                 //    return;
                 //}
-                onDimmerBar = false;
+                //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());
-                d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
+                d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
+                if (dimmerBar.Progress > 0)
+                {
+                    d.Add(FunctionAttributeKey.OnOff, "on");
+                }
                 Control.Ins.SendWriteCommand(function, d);
                 //function.fadeTime = barFadeTime.Progress;
                 btnBrightnessText.Text = dimmerBar.Progress + "%";

--
Gitblit v1.8.0