From 31e484e5d3e42e825e43ef9d1707c1adc02a4e1c Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 18 十二月 2020 19:57:34 +0800 Subject: [PATCH] 完成 dali 的 UI --- HDL_ON/Entity/Function/Function.cs | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index d6d1e9b..73b521e 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -119,7 +119,7 @@ /// bus鍗忚鏁版嵁鏍煎紡 /// 浣跨敤A鍗忚鎺у埗鏃讹紝鏀瑰睘鎬т负绌� /// </summary> - public BusData bus_Data; + public BusData bus; /// <summary> /// 鏄惁鏀惰棌 /// </summary> @@ -173,8 +173,8 @@ max = 1, min = 0, }; + _trait_on_off.curValue = "on"; } - _trait_on_off.curValue = "on"; } return _trait_on_off; } @@ -206,9 +206,9 @@ public string GetBusId() { string busId = ""; - if (bus_Data != null) + if (bus != null) { - busId = bus_Data.SubnetID + "_" + bus_Data.DeviceID + "_" + bus_Data.loopId; + busId = bus.SubnetID + "_" + bus.DeviceID + "_" + bus.LoopId; } return busId; } @@ -286,9 +286,14 @@ var sFunc = new SceneFunction(); foreach (var attr in attributes) { + if (attr.curValue.ToString() == "{}") + { + attr.curValue = "0"; + } if (attr.key == FunctionAttributeKey.SetTemp) { - var vv = Convert.ToDouble(attr.value); + double vv = 16; + Double.TryParse(attr.curValue.ToString(),out vv); sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = Convert.ToInt32(vv).ToString() }); } else @@ -317,9 +322,9 @@ var acd = new AlinkControlData(); acd.sid = sid; - var aca = new AlinkControlAttributes(); foreach (var dic in commandDictionary) { + var aca = new AlinkControlAttributes(); aca.key = dic.Key; aca.value = dic.Value; acd.status.Add(aca); @@ -420,6 +425,7 @@ /// 鍔熻兘灞炴�� /// 灞炴�у瓧娈佃В鏋愶細attri :灞炴�у唴瀹癸紝value 灞炴�х殑鍊硷紝max 鏈�澶у�� min 鏈�灏忓�� /// </summary> + [System.Serializable] public class FunctionAttributes { /// <summary> @@ -533,7 +539,15 @@ return Convert.ToByte(addresses.Substring(2, 2), 16); } } - public byte loopId; + public byte LoopId + { + get + { + return Convert.ToByte(loopId, 16); + } + } + + public string loopId; } public static class SPK -- Gitblit v1.8.0