From 01c46e7bfe9aa8fb20b29f70c83c03a307af548a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 22 十二月 2020 16:35:16 +0800 Subject: [PATCH] 2020-12-22 1.更新。 --- HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs old mode 100755 new mode 100644 index 3ac7385..e3103d7 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs @@ -64,7 +64,7 @@ /// </summary> void LoadEvet_ChangeFadeTime() { - barFadeTime.OnProgressChangedEvent = (sender, e) => + barFadeTime.OnStopTrackingTouchEvent = (sender, e) => { light.fadeTime = e; light.SaveFunctionData(true); @@ -78,8 +78,19 @@ { barColorTemplatrue.OnProgressChangedEvent += (sender, value) => { - //璁剧疆鑷畾涔夌殑鏂囨湰 - barColorTemplatrue.SetCustomText(value * 100 + "K"); + new System.Threading.Thread(() => + { + Application.RunOnMainThread(() => + { + //璁剧疆鑷畾涔夌殑鏂囨湰 + barColorTemplatrue.SetCustomText(value * 100 + "K"); + light.Attr_CCT.curValue = value * 100; + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString()); + Control.Ins.SendWriteCommand(light, d); + }); + System.Threading.Thread.Sleep(200); + }).Start(); }; } @@ -123,7 +134,6 @@ if (e == 0 || e == 100) { - //Control.Send(CommandType_A.write, this.light); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString()); Control.Ins.SendWriteCommand(light, d); @@ -170,6 +180,7 @@ light.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, light.trait_on_off.curValue.ToString()); + d.Add(FunctionAttributeKey.FadeTime, light.fadeTime.ToString()); if (btnSwitch.IsSelected) { d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString()); -- Gitblit v1.8.0