From 917c28d31963e893d7dd26f933adfa3bde3cf260 Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期三, 26 七月 2023 15:54:29 +0800 Subject: [PATCH] feature 门锁不支持一键开锁设备按钮置灰&&门锁呼叫 --- HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 60 ++++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 44 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..60f9806 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,15 @@ this.RemoveFromParent(); } }; + + + UpdataFunctionRow(); } void UpdataFunctionRow() { - for(var i =0;i< functionRowList.Count; i++) + contentView.RemoveAll(); + for (var i =0;i< functionRowList.Count; i++) { try { @@ -2045,11 +2065,16 @@ { if (view.Tag != null) { + if (view.Tag.ToString() == FunctionAttributeKey.OnOff) + { + contentView.AddChidren(view); + + } if (isOnStatus) { if (view.Tag.ToString() != FunctionAttributeKey.OnOff) { - if (isColorful) + if (isColorful && sceneFunction.localFunction.spk == SPK.LightRGB) { if(view.Tag.ToString() != FunctionAttributeKey.Colorful) { @@ -2544,11 +2569,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 +2636,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 +2654,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 +2692,7 @@ { MainPage.Log($"鍦烘櫙閰嶇疆寮傚父3锛歿ex.Message}"); } - }; + }; } -- Gitblit v1.8.0