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/Entity/Function/Function.cs | 75 +++++++++++++++++++++++++++++++++++--
1 files changed, 70 insertions(+), 5 deletions(-)
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 0960b7e..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;
}
@@ -109,7 +109,7 @@
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
- public string GetAttrState(string key , string defaultValue = "0")
+ public string GetAttrState(string key, string defaultValue = "0")
{
//涓�绾ф煡璇eyValue鍊�
var attrState = attributes.Find((s) => s.key == key.ToString());
@@ -279,7 +279,7 @@
/// <summary>
/// 鐗╃悊璁惧(妯″潡)鍨嬪彿
/// </summary>
- public string omodel =string.Empty;
+ public string omodel = string.Empty;
/// <summary>
/// 璁惧spk
/// </summary>
@@ -372,6 +372,39 @@
/// attri
/// </summary>
public List<FunctionAttributes> attributes = new List<FunctionAttributes>();
+
+ public List<FunctionAttributes> GetFunctionAttributes()
+ {
+ if (spk == SPK.GroupControl)
+ {
+ var list = new List<FunctionAttributes>();
+ 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);
+ }
+ }
+ }
+ }
+ }
+
+ return list;
+ }
+ else
+ {
+ return attributes;
+ }
+ }
+
/// <summary>
/// 鎴块棿ID鍒楄〃
@@ -766,7 +799,36 @@
public SceneFunction ConvertSceneFunction()
{
var sFunc = new SceneFunction();
- foreach (var attr in attributes)
+
+ 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);
+ }
+ }
+ }
+ }
+ }
+
+ }
+ else
+ {
+ list.AddRange(attributes);
+ }
+
+ foreach (var attr in list)
{
//绐楀笜鍚屾椂鍙戦�佸紑鍏宠窡鐧惧垎姣斾細鏈夐棶棰橈紝
if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
@@ -778,6 +840,9 @@
continue;
}
}
+ }else if (spk == SPK.GroupControl)
+ {
+ sFunc.type = "5";
}
string us = "";
@@ -1424,7 +1489,7 @@
/// <summary>
/// 缇ゆ帶锛堣嚜瀹氫箟锛�
/// </summary>
- public const string GroupControl = "GroupControl";
+ public const string GroupControl = "groupControl";
/// <summary>
/// 閫氱敤寮�鍏�
/// </summary>
--
Gitblit v1.8.0