From 39b8b0b9bcf5805ada1a44e5dc72f05f9c6e4fcc Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 25 七月 2023 13:12:30 +0800
Subject: [PATCH] 2.0备份

---
 HDL_ON/Entity/Function/Function.cs |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 8b52231..0baf1eb 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,38 @@
         public SceneFunction ConvertSceneFunction()
         {
             var sFunc = new SceneFunction();
-            if(spk == SPK.GroupControl)
-            {
 
+            var list = new List<FunctionAttributes>();
+            if (spk == SPK.GroupControl)
+            {
+                lock (list)
+                {
+                    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