From e842a3bbfccf8adfde4da0b2d1bd08414c2f30ae Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 20 七月 2023 10:26:36 +0800 Subject: [PATCH] 2023年07月20日10:26:16 --- HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 54 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 38 insertions(+), 16 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 9f5c0ef..3593598 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -1903,13 +1903,14 @@ } LoadFunctionRow(onOffStatus); - if (sceneFunction.localFunction.spk == SPK.LightRGB) + if (sceneFunction.localFunction.spk == SPK.LightRGB || sceneFunction.localFunction.spk == SPK.GroupControl) { var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); if (colorfulStatus != null) { isColorful = true; LoadColorfulRow(colorfulStatus); + isColorful = colorfulStatus.value == "on"; } } foreach (var attr in sceneFunction.status) @@ -1981,17 +1982,32 @@ btnConfrim.MouseUpEventHandler = (sender, e) => { - if (isOnStatus) - { - - } + if (sceneFunction.localFunction.spk == SPK.GroupControl) { } else { - if (isColorful) { } else { } - sceneFunction.status.Clear(); - sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.OnOff, value = "off" }); + 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 + { + sceneFunction.status.Clear(); + sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.OnOff, value = "off" }); + } } - var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); if (temp != null) @@ -2030,11 +2046,14 @@ this.RemoveFromParent(); } }; + + + UpdataFunctionRow(); } void UpdataFunctionRow() { - for(var i =0;i< functionRowList.Count; i++) + for (var i =0;i< functionRowList.Count; i++) { try { @@ -2049,7 +2068,7 @@ { if (view.Tag.ToString() != FunctionAttributeKey.OnOff) { - if (isColorful) + if (isColorful && sceneFunction.localFunction.spk == SPK.LightRGB) { if(view.Tag.ToString() != FunctionAttributeKey.Colorful) { @@ -2544,11 +2563,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 +2630,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 +2648,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 +2686,7 @@ { MainPage.Log($"鍦烘櫙閰嶇疆寮傚父3锛歿ex.Message}"); } - }; + }; } -- Gitblit v1.8.0