From 762eed3a31840aa91ac508c63b8df54029cf0262 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 18 七月 2023 16:48:12 +0800 Subject: [PATCH] 炫彩功能优化 --- HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs | 108 +++++++++--------- HDL-ON_iOS/Resources/Language.ini | 10 HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs | 55 +++++++- HDL-ON_Android/Assets/Language.ini | 10 HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs | 14 ++ HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs | 9 + HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs | 16 + HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 58 +++++++-- HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 32 ++++- HDL_ON/UI/MainPage.cs | 3 SiriIntents/Server/HttpUtil.cs | 4 12 files changed, 218 insertions(+), 105 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 5190f56..3d19285 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -617,7 +617,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) @@ -1954,7 +1954,7 @@ 630=鐐僵鍔熻兘 631=璧峰棰滆壊 632=缁撴潫棰滆壊 -633=宸ヤ綔鏃堕暱 +633=鐐僵鍛ㄦ湡 634=鎺ㄨ崘 635=褰撳墠棰滆壊 636=鑹插�煎彿涓�6浣嶏紙鐢辩函鏁板瓧/鏁板瓧+瀛楁瘝缁勫悎锛� @@ -3288,7 +3288,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) @@ -4619,7 +4619,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) @@ -5939,7 +5939,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 5190f56..3d19285 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -617,7 +617,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) @@ -1954,7 +1954,7 @@ 630=鐐僵鍔熻兘 631=璧峰棰滆壊 632=缁撴潫棰滆壊 -633=宸ヤ綔鏃堕暱 +633=鐐僵鍛ㄦ湡 634=鎺ㄨ崘 635=褰撳墠棰滆壊 636=鑹插�煎彿涓�6浣嶏紙鐢辩函鏁板瓧/鏁板瓧+瀛楁瘝缁勫悎锛� @@ -3288,7 +3288,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) @@ -4619,7 +4619,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) @@ -5939,7 +5939,7 @@ 630=Colorful function 631=Starting color 632=End color -633=Working hours +633=Colorful cycle 634=Recommen 635=Current Color 636=Color value number is 6 digits (composed of pure numbers/numbers+letters) diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 4766d4f..fcb9604 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -18,8 +18,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; const string APP_KEY = "HDL-HOME-APP-TEST"; const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index 91c3948..cf5614a 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -607,7 +607,8 @@ public static void Log(string msg) { #if DEBUG - Console.WriteLine(msg); + if (msg.Contains("鏀跺埌鏁版嵁")) + Console.WriteLine(msg); #endif } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs index 5ae667f..9bc1eb7 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs @@ -545,6 +545,15 @@ sceneFunctionInfo += " "+ perState.value + "掳"; } + var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); + if(perColorful != null) + { + if(perColorful.value == "on") + sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp); + else + sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); + } + return sceneFunctionInfo; } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 9f5c0ef..670beb1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -1910,6 +1910,7 @@ { isColorful = true; LoadColorfulRow(colorfulStatus); + isColorful = colorfulStatus.value == "on"; } } foreach (var attr in sceneFunction.status) @@ -1983,7 +1984,20 @@ { if (isOnStatus) { - + if (isColorful) + { + sceneFunction.status.Clear(); + sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.OnOff, value = "on" }); + sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.Colorful, value = "on" }); + } + else + { + var isHasColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); + if (isHasColorful != null) + { + sceneFunction.status.Remove(isHasColorful); + } + } } else { @@ -2030,6 +2044,9 @@ this.RemoveFromParent(); } }; + + + UpdataFunctionRow(); } void UpdataFunctionRow() @@ -2544,11 +2561,13 @@ dialog.Show(); - pView.MouseUpEventHandler = (sender, e) => { + pView.MouseUpEventHandler = (sender, e) => + { dialog.Close(); }; - btnCancel.MouseUpEventHandler = (sender, e) => { + btnCancel.MouseUpEventHandler = (sender, e) => + { dialog.Close(); }; btnOn.MouseUpEventHandler = (sender, e) => @@ -2609,10 +2628,10 @@ MainPage.Log($"鍦烘櫙閰嶇疆寮傚父3锛歿ex.Message}"); } }; - btnOff.MouseUpEventHandler = (sender,e) =>{ + btnOff.MouseUpEventHandler = (sender, e) => + { dialog.Close(); trait.value = "off"; - isOnStatus = false; try { sceneFunction.status.Find((obj) => obj.key == trait.key).value = "off"; @@ -2627,6 +2646,7 @@ btn.Text = trait.GetValueText() + trait.GetUintString(); if (trait.key == FunctionAttributeKey.OnOff) { + isOnStatus = false; var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); if (temp == null) { @@ -2664,7 +2684,7 @@ { MainPage.Log($"鍦烘櫙閰嶇疆寮傚父3锛歿ex.Message}"); } - }; + }; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs index 8b146ad..6622d1c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs @@ -1102,70 +1102,70 @@ } - else if(function.spk == SPK.LightRGB) - { - contentView.AddChidren(new Button - { - Height = Application.GetRealHeight(8), - }); + //else if(function.spk == SPK.LightRGB) + //{ + // contentView.AddChidren(new Button + // { + // Height = Application.GetRealHeight(8), + // }); - var list = FunctionList.List.GetSeries(); - foreach (var temp in list) - { + // var list = FunctionList.List.GetSeries(); + // foreach (var temp in list) + // { - #region - var viewRow0 = new FrameLayout() - { - Height = Application.GetRealHeight(55), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - contentView.AddChidren(viewRow0); + // #region + // var viewRow0 = new FrameLayout() + // { + // Height = Application.GetRealHeight(55), + // BackgroundColor = CSS_Color.MainBackgroundColor, + // }; + // contentView.AddChidren(viewRow0); - var btnRowTitle0 = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(160), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - Text = temp.name, - }; - viewRow0.AddChidren(btnRowTitle0); + // var btnRowTitle0 = new Button() + // { + // X = Application.GetRealWidth(16), + // Width = Application.GetRealWidth(160), + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.FirstLevelTitleColor, + // TextSize = CSS_FontSize.SubheadingFontSize, + // Text = temp.name, + // }; + // viewRow0.AddChidren(btnRowTitle0); - var btnSwtichIcon0 = new Button() - { - X = Application.GetRealWidth(322), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(36), - Height = Application.GetMinRealAverage(36), - UnSelectedImagePath = "Public/Switch_2.png", - SelectedImagePath = "Public/SwitchOn_2.png", - }; - viewRow0.AddChidren(btnSwtichIcon0); + // var btnSwtichIcon0 = new Button() + // { + // X = Application.GetRealWidth(322), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetMinRealAverage(36), + // Height = Application.GetMinRealAverage(36), + // UnSelectedImagePath = "Public/Switch_2.png", + // SelectedImagePath = "Public/SwitchOn_2.png", + // }; + // viewRow0.AddChidren(btnSwtichIcon0); - DeviceMessageRules deviceMessageRules = new DeviceMessageRules() - { - deviceId = function.deviceId - }; + // DeviceMessageRules deviceMessageRules = new DeviceMessageRules() + // { + // deviceId = function.deviceId + // }; - btnSwtichIcon0.MouseUpEventHandler = (sender, e) => - { + // btnSwtichIcon0.MouseUpEventHandler = (sender, e) => + // { - }; + // }; - viewRow0.AddChidren(new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(54), - BackgroundColor = CSS_Color.DividingLineColor, - Width = Application.GetRealWidth(343), - Height = Application.GetRealHeight(1) - }); - #endregion - } + // viewRow0.AddChidren(new Button() + // { + // Gravity = Gravity.CenterHorizontal, + // Y = Application.GetRealHeight(54), + // BackgroundColor = CSS_Color.DividingLineColor, + // Width = Application.GetRealWidth(343), + // Height = Application.GetRealHeight(1) + // }); + // #endregion + // } - } + //} LoadEventList(); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs index 8b683de..63cd333 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs @@ -1,6 +1,7 @@ 锘� using System; using System.Collections.Generic; +using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.Stan; using HDL_ON.UI.CSS; @@ -88,7 +89,7 @@ btnStartColor.BackgroundColor = color; function.SetAttrState(FunctionAttributeKey.ColorfulBegin, color); }; - var rgbView = new ColorfulSettingPage(action); + var rgbView = new ColorfulSettingPage(function, action,true); MainPage.BasePageView.AddChidren(rgbView); rgbView.LoadPage(function.GetAttrState(FunctionAttributeKey.ColorfulBegin)); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; @@ -134,7 +135,7 @@ Radius = (uint)Application.GetRealWidth(14), BorderColor = CSS_Color.DividingLineColor, BorderWidth = 1, - BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function.GetAttrState(FunctionAttributeKey.ColorfulBegin))) + BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function.GetAttrState(FunctionAttributeKey.ColorfulEnd))) }; endColorView.AddChidren(btnEndColor); @@ -145,7 +146,7 @@ btnEndColor.BackgroundColor = color; function.SetAttrState(FunctionAttributeKey.ColorfulEnd, color); }; - var rgbView = new ColorfulSettingPage(action); + var rgbView = new ColorfulSettingPage(function, action,false); MainPage.BasePageView.AddChidren(rgbView); rgbView.LoadPage(function.GetAttrState(FunctionAttributeKey.ColorfulEnd)); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; @@ -155,7 +156,7 @@ #endregion - #region 宸ヤ綔鏃堕暱 + #region 鐐僵鍛ㄦ湡 var workHoursView = new FrameLayout() { Height = Application.GetRealHeight(50), @@ -213,6 +214,11 @@ btnWorkHours.Text = hour + "鏃�"; btnWorkHours.Text += minute + "鍒�"; btnWorkHours.Text += second + "绉�"; + new System.Threading.Thread(() => { + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString()); + Control.Ins.SendWriteCommand(function, d); + }) { IsBackground = true }.Start(); }); }); } @@ -307,7 +313,7 @@ Height = Application.GetRealHeight(210), Radius = (uint)Application.GetRealWidth(12), }; - for (int i = 0; i <= 23; i += 1) + for (int i = 0; i <= 15; i += 1) { item1.Add(i+Language.StringByID(StringId.h)); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs index fdf6d44..60ce741 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; @@ -11,11 +12,17 @@ Action<uint> backAction; public uint curColor = 0; - - public ColorfulSettingPage(Action<uint> action) + bool isSatrtColor = false; + byte redColor = 0; + byte greenColor = 0; + byte blueColor = 0; + Function function; + public ColorfulSettingPage(Function device, Action<uint> action,bool isStart) { bodyView = this; + function = device; backAction = action; + isSatrtColor = isStart; } public void LoadPage(string curColorString) @@ -24,14 +31,12 @@ bodyView.BackgroundColor = CSS_Color.BackgroundColor; new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(()=> { - backAction?.Invoke(curColor) ; }); - var contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64+34), - Height = Application.GetRealHeight(500), + Height = Application.GetRealHeight(570), ScrollEnabled = false, }; bodyView.AddChidren(contentView); @@ -96,7 +101,6 @@ #endregion - #region 鎺ㄨ崘 var recommendView = new FrameLayout() @@ -208,7 +212,6 @@ #endregion - #region 褰撳墠棰滆壊 var curColorView = new FrameLayout() { @@ -308,11 +311,43 @@ #endregion + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(30) + }); + + #region 淇濆瓨 + var btnConfrim = new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainBackgroundColor, + BackgroundColor = CSS_Color.MainColor, + TextID = StringId.Save, + TextSize = CSS_FontSize.SubheadingFontSize, + }; + contentView.AddChidren(btnConfrim); + btnConfrim.MouseUpEventHandler = (sender, e) => + { + backAction?.Invoke(curColor) ; + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + if (isSatrtColor) + d.Add(FunctionAttributeKey.ColorfulBegin, redColor + "," + greenColor + "," + blueColor); + else + d.Add(FunctionAttributeKey.ColorfulEnd, redColor + "," + greenColor + "," + blueColor); + Control.Ins.SendWriteCommand(function, d); + }; + + + #endregion colorPicker.ColorChaged += (sender2, color) => { - byte redColor = color[0]; - byte greenColor = color[1]; - byte blueColor = color[2]; + redColor = color[0]; + greenColor = color[1]; + blueColor = color[2]; int recolor = redColor * 256 * 256 + greenColor * 256 + blueColor; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs index b6d04cf..e92f3e5 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; @@ -49,6 +50,11 @@ /// 鑹茬洏閲岄潰閭d釜浼氭粦鍔ㄧ殑鐞� /// </summary> Button btnWhiteRound; + /// <summary> + /// 鐐僵寮�鍏虫寜閽� + /// </summary> + Button btnColorfulSwitch; + #endregion #region 鍖哄煙鍙橀噺 @@ -228,7 +234,7 @@ dimmerBar = new DiyImageSeekBar() { X = Application.GetRealWidth(35 + 22), - Y = Application.GetRealHeight(312 - magriHeight), + Y = Application.GetRealHeight(316 - magriHeight), Width = Application.GetRealWidth(210), Height = Application.GetRealHeight(54), SeekBarViewHeight = Application.GetRealHeight(8), @@ -279,7 +285,7 @@ var btnGradualChangeMinValuesText = new Button() { X = Application.GetRealWidth(35), - Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), + Y = btnGradualChangeText.Bottom,// + Application.GetRealHeight(10), Width = Application.GetRealWidth(22), Height = Application.GetRealHeight(21), Text = "0s", @@ -317,7 +323,7 @@ var btnGradualChangeMaxValuesText = new Button() { X = barFadeTime.Right, - Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), + Y = btnGradualChangeText.Bottom,// + Application.GetRealHeight(10), Width = Application.GetRealWidth(35), Height = Application.GetRealHeight(21), Text = "10s", @@ -329,7 +335,7 @@ }; controlView.AddChidren(btnGradualChangeMaxValuesText); #endregion - heightMore = 70; + //heightMore += 70; } @@ -337,10 +343,11 @@ { #region 鐐僵鍔熻兘 + var btnGradualChangeText = new Button() { X = Application.GetRealWidth(35), - Y = Application.GetRealHeight(375+ heightMore- magriHeight), + Y = Application.GetRealHeight(heightMore + magriHeight), Width = Application.GetRealWidth(224), Height = Application.GetRealHeight(21), TextAlignment = TextAlignment.CenterLeft, @@ -350,16 +357,16 @@ }; controlView.AddChidren(btnGradualChangeText); - var btnGradualChangeMinValuesText = new Button() + var btnEditColorful = new Button() { X = Application.GetRealWidth(35), - Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), + Y = btnGradualChangeText.Bottom,// + Application.GetRealHeight(10), Width = Application.GetRealWidth(22), Height = Application.GetRealHeight(21), UnSelectedImagePath = "Public/Edit.png", }; - controlView.AddChidren(btnGradualChangeMinValuesText); - btnGradualChangeMinValuesText.MouseUpEventHandler = (sender, e) => { + controlView.AddChidren(btnEditColorful); + btnEditColorful.MouseUpEventHandler = (sender, e) => { var rgbView = new ColorfulInfoPage(function); MainPage.BasePageView.AddChidren(rgbView); rgbView.LoadPage(); @@ -368,23 +375,44 @@ var barColorful = new FrameLayout() { - X = btnGradualChangeMinValuesText.Right + Application.GetRealWidth(15), - Y = Application.GetRealHeight(412 + heightMore-magriHeight), + X = btnEditColorful.Right + Application.GetRealWidth(15), + Y = Application.GetRealHeight(27 + heightMore + magriHeight), Width = Application.GetRealWidth(180), Height = Application.GetRealHeight(8), BackgroundImagePath = "FunctionIcon/Light/ColorfulBar.png", }; controlView.AddChidren(barColorful); - var btnGradualChangeMaxValuesText = new Button() + btnColorfulSwitch = new Button() { X = barColorful.Right + Application.GetRealWidth(8), - Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), + Y = btnGradualChangeText.Bottom,// + Application.GetRealHeight(10), Width = Application.GetRealWidth(38), Height = Application.GetRealHeight(24), - UnSelectedImagePath = "Public/Switch.png" + UnSelectedImagePath = "Public/Switch.png", + SelectedImagePath = "Public/SwitchOn.png", }; - controlView.AddChidren(btnGradualChangeMaxValuesText); + controlView.AddChidren(btnColorfulSwitch); + + btnColorfulSwitch.MouseUpEventHandler = (sender, e) => { + btnColorfulSwitch.IsSelected = !btnColorfulSwitch.IsSelected; + new System.Threading.Thread(() => + { + try + { + var controlColorfulState = btnColorfulSwitch.IsSelected ? "on" : "off"; + function.SetAttrState(FunctionAttributeKey.Colorful, controlColorfulState); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Colorful, controlColorfulState); + Control.Ins.SendWriteCommand(function, d); + }catch(Exception ex) + { + MainPage.Log($"鎺у埗鐐僵寮�鍏冲紓甯�:{ex.Message}"); + } + }) + { IsBackground = true }.Start(); + }; + #endregion diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs index b222e1b..2654e0b 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs @@ -58,6 +58,20 @@ { bodyView.btnCurColor.BorderColor = 0x00000000; } + try + { + var colorfulState = updateTemp.GetAttribute(FunctionAttributeKey.Colorful); + if (colorfulState != null) + { + if(bodyView.btnColorfulSwitch!= null) + { + bodyView.btnColorfulSwitch.IsSelected = colorfulState.curValue.ToString() == "on"; + } + } + }catch(Exception ex) + { + MainPage.Log($"鏇存柊RGB 鐐僵寮�鍏崇姸鎬佸紓甯�:{ex.Message}"); + } } } catch (Exception ex) diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs index dc7aca0..8d4483c 100644 --- a/SiriIntents/Server/HttpUtil.cs +++ b/SiriIntents/Server/HttpUtil.cs @@ -16,8 +16,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; const string APP_KEY = "HDL-HOME-APP-TEST"; const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm -- Gitblit v1.8.0