From f16e7e4df7e7813e4a3052dae752aae3e6937b30 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 08 七月 2022 16:53:12 +0800 Subject: [PATCH] 自研可视对讲、毫米波 --- HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs index 519aec2..c724edb 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs @@ -90,7 +90,7 @@ /// </summary> void LoadEvent_DimmerBar() { - //if (function.online) + if (function.online) { dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { @@ -104,10 +104,10 @@ 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()); - if(dimmerBar.Progress > 0) - { - d.Add(FunctionAttributeKey.OnOff, "on"); - } + //if(dimmerBar.Progress > 0) + //{ + // d.Add(FunctionAttributeKey.OnOff, "on"); + //} Control.Ins.SendWriteCommand(function, d); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; @@ -131,7 +131,7 @@ } else { - if (500 < (DateTime.Now - function.refreshTime).TotalMilliseconds) + if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds) { function.refreshTime = DateTime.Now; new System.Threading.Thread(() => @@ -155,16 +155,16 @@ { btnSwitch.MouseUpEventHandler += (sender, e) => { - //if (!function.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - // return; - //} + if (!function.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } btnSwitch.IsSelected = !btnSwitch.IsSelected; if (btnSwitch.IsSelected) { @@ -179,7 +179,6 @@ function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); - d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime)); if (btnSwitch.IsSelected) { if(function.lastBrightness == 0) -- Gitblit v1.8.0