From 56ec341b21a32b1a7529267b15d6bb8ef392bd6b Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 27 七月 2023 17:04:42 +0800 Subject: [PATCH] tcp更新 --- HDL_ON/Entity/Function/Function.cs | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 116 insertions(+), 4 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 8b52231..4f6404c 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; } @@ -171,6 +171,9 @@ string iconPath = spk.Replace(".", ""); switch (spk) { + case SPK.AirSwitchP3: + iconPath = "electricalbreaker"; + break; case SPK.PanelSocket: iconPath = "electricalsocket"; break; @@ -799,11 +802,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) @@ -1117,6 +1147,10 @@ /// 褰撳墠鍊� /// </summary> public object curValue = new object(); + /// <summary> + /// 灞炴�у崟浣� + /// </summary> + public string unit=string.Empty; } /// <summary> @@ -1124,6 +1158,79 @@ /// </summary> public static class FunctionAttributeKey { + #region 涓夌浉绌哄紑灞炴�� + /// <summary> + /// A鐩稿姛鐜� + /// </summary> + public const string PowerA = "power_a"; + /// <summary> + /// B鐩稿姛鐜� + /// </summary> + public const string PowerB = "power_b"; + /// <summary> + /// C鐩稿姛鐜� + /// </summary> + public const string PowerC = "power_c"; + /// <summary> + /// A鐩哥數鍘� + /// </summary> + public const string VoltageA = "voltage_a"; + /// <summary> + /// B鐩哥數鍘� + /// </summary> + public const string VoltageB = "voltage_b"; + /// <summary> + /// C鐩哥數鍘� + /// </summary> + public const string VoltageC = "voltage_c"; + /// <summary> + /// A鐩哥數娴� + /// </summary> + public const string CurrentA = "current_a"; + /// <summary> + /// B鐩哥數娴� + /// </summary> + public const string CurrentB = "current_b"; + /// <summary> + /// C鐩哥數娴� + /// </summary> + public const string CurrentC = "current_c"; + /// <summary> + /// A鐩告俯搴� + /// </summary> + public const string TempA = "temp_a"; + /// <summary> + /// B鐩告俯搴� + /// </summary> + public const string TempB = "temp_b"; + /// <summary> + /// C鐩告俯搴� + /// </summary> + public const string TempC = "temp_c"; + /// <summary> + /// 杩囨祦鍊� + /// </summary> + public const string MaxCurrent = "max_current"; + /// <summary> + /// 杩囨俯鍊� + /// </summary> + public const string MaxTemp = "max_temp"; + /// <summary> + /// A鐩哥數閲� + /// </summary> + public const string ElectricityA = "electricity_a"; + /// <summary> + /// B鐩哥數閲� + /// </summary> + public const string ElectricityB = "electricity_b"; + /// <summary> + /// C鐩哥數閲� + /// </summary> + public const string ElectricityC = "electricity_c"; + + #endregion + + public const string _null = ""; /// <summary> /// 瀹夐槻甯冮槻鐘舵�� @@ -2027,6 +2134,10 @@ /// 鏅鸿兘绌哄紑 /// </summary> public const string AirSwitch = "electrical.breaker"; + /// <summary> + /// 涓夌浉鏅鸿兘绌哄紑 + /// </summary> + public const string AirSwitchP3 = "electrical.breakerP3"; #region 娑傞甫 /// <summary> @@ -2080,6 +2191,7 @@ spkList.Add(ElectricTuyaWaterValve); spkList.Add(ElectricTuyaWaterValve2); spkList.Add(AirSwitch); + spkList.Add(AirSwitchP3); return spkList; } -- Gitblit v1.8.0