From 8c28c3f43f91510e3a99189243c17717bdee1a0e Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 20 七月 2023 08:58:04 +0800 Subject: [PATCH] 群控功能迭代 --- HDL_ON/Entity/Function/Function.cs | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 8b52231..8f4f3c3 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -100,7 +100,7 @@ /// <returns></returns> public FunctionAttributes GetAttribute(string key) { - var attr = attributes.Find((a) => a.key == key); + var attr = GetFunctionAttributes().Find((a) => a.key == key); return attr; } @@ -799,11 +799,36 @@ public SceneFunction ConvertSceneFunction() { var sFunc = new SceneFunction(); - if(spk == SPK.GroupControl) + + var list = new List<FunctionAttributes>(); + if (spk == SPK.GroupControl) { + var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); + if (gc != null) + { + foreach (var temp in gc.sids) + { + var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); + if (light != null) + { + foreach (var attr in light.attributes) + { + if (list.Find((obj) => obj.key == attr.key) == null) + { + list.Add(attr); + } + } + } + } + } } - foreach (var attr in attributes) + else + { + list.AddRange(attributes); + } + + foreach (var attr in list) { //绐楀笜鍚屾椂鍙戦�佸紑鍏宠窡鐧惧垎姣斾細鏈夐棶棰橈紝 if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream) -- Gitblit v1.8.0