From fd1f19e8479c764fa28b0da3a2f9b34a3debe772 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 03 八月 2023 21:47:04 +0800
Subject: [PATCH] 2023年08月03日21:47:02
---
HDL_ON/Entity/Function/Function.cs | 97 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 92 insertions(+), 5 deletions(-)
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 0960b7e..d17fa05 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,38 @@
public SceneFunction ConvertSceneFunction()
{
var sFunc = new SceneFunction();
- foreach (var attr in attributes)
+
+ 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);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ list.AddRange(attributes);
+ }
+
+ foreach (var attr in list)
{
//绐楀笜鍚屾椂鍙戦�佸紑鍏宠窡鐧惧垎姣斾細鏈夐棶棰橈紝
if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
@@ -778,6 +842,9 @@
continue;
}
}
+ }else if (spk == SPK.GroupControl)
+ {
+ sFunc.type = "5";
}
string us = "";
@@ -1077,6 +1144,10 @@
/// 褰撳墠鍊�
/// </summary>
public object curValue = new object();
+ /// <summary>
+ /// 灞炴�у崟浣�
+ /// </summary>
+ public string unit=string.Empty;
}
/// <summary>
@@ -1424,7 +1495,7 @@
/// <summary>
/// 缇ゆ帶锛堣嚜瀹氫箟锛�
/// </summary>
- public const string GroupControl = "GroupControl";
+ public const string GroupControl = "groupControl";
/// <summary>
/// 閫氱敤寮�鍏�
/// </summary>
@@ -1487,6 +1558,10 @@
/// </summary>
public const string Ev_Ipcam = "security.ipcam.ez";
/// <summary>
+ /// 褰遍煶涓帶
+ /// </summary>
+ public const string AvZkAiks = "av.zk.aiks";
+ /// <summary>
/// 钀ょ煶瑙嗛闂ㄩ攣spk鍒楄〃
/// </summary>
/// <returns></returns>
@@ -1496,6 +1571,18 @@
list.Add(VideoDoorLock);
return list;
}
+ /// <summary>
+ /// 褰遍煶涓帶spk鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ public static List<string> GetVideoControlsSPKList()
+ {
+ var list = new List<string>
+ {
+ AvZkAiks
+ };
+ return list;
+ }
/// <summary>
/// 钀ょ煶鎽勫儚澶磗pk鍒楄〃
--
Gitblit v1.8.0