| | |
| | | //色盘的圆点隐藏 |
| | | bodyView.btnWhiteRound.Visible = false; |
| | | } |
| | | bodyView.btnCurColor.BackgroundColor = (uint)(0xFF000000 + bodyView.lightTemp.GetRGBcolor(updateTemp)); |
| | | bodyView.btnCurColor.BackgroundColor = (uint)(0xFF000000 + bodyView.lightTemp.GetRGBcolor(updateTemp.GetAttrState(FunctionAttributeKey.RGB))); |
| | | bodyView.lastColor = bodyView.lightTemp.GetRGBbytes(updateTemp); |
| | | if (bodyView.lightTemp.GetRGBcolor(updateTemp) == 16777215 && bodyView.btnCurColor.BorderColor != 0x00000000) |
| | | if (bodyView.lightTemp.GetRGBcolor(updateTemp.GetAttrState(FunctionAttributeKey.RGB)) == 16777215 && bodyView.btnCurColor.BorderColor != 0x00000000) |
| | | { |
| | | bodyView.btnCurColor.BorderColor = CSS.CSS_Color.PromptingColor2; |
| | | } |
| | |
| | | void LoadColorChangeEvent() |
| | | { |
| | | DateTime colorChangeTime = DateTime.MinValue; |
| | | //bool send = false; |
| | | |
| | | //当前点击的【点】是否正确 |
| | | bool pointIsRight = false; |
| | |
| | | //pointIsRight:点的区域不是圆盘内 |
| | | return; |
| | | } |
| | | lastColor = e2; |
| | | //if (send) |
| | | //{ |
| | | lastColor = e2; |
| | | // send = false; |
| | | //} |
| | | }; |
| | | |
| | | //colorPicker.MouseUpEventHandler += (sender, e) => { |
| | | // send = true; |
| | | //}; |
| | | |
| | | colorPicker.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | |
| | | lightTemp.SetRGBcolor(lastColor, function); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | Control.Ins.SendWriteCommand(function, d,false,0); |
| | | break; |
| | | } |
| | | } |
| | |
| | | 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()); |
| | | |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | }; |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => { |
| | | //function.fadeTime = 0; |
| | |
| | | /// </summary> |
| | | void LoadEvet_ChangeFadeTime() |
| | | { |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | function.UpdataFuncitonInfo(); |
| | | }; |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); |
| | | function.SaveFunctionFile(); |
| | | }; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 加载开关事件 |
| | |
| | | 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) |
| | |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | lastColor = new byte[] { 255, 255, 255 }; |
| | | }; |
| | | } |
| | | |