From a715181089be0d31cd737a5367ffd02690b9d77f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 12 十一月 2020 13:36:01 +0800 Subject: [PATCH] 20201112 --- HDL_ON/Entity/Function/Function.cs | 63 +++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+), 1 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 938977a..b988436 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -219,8 +219,10 @@ { var findRoom = DB_ResidenceData.rooms.Find(obj => obj.sid == roomId); if (findRoom == null) + { continue; - if(roomNameList != "") + } + if (roomNameList != "") { roomNameList += ","; } @@ -246,6 +248,65 @@ /// 鏇存柊鏃堕棿 /// </summary> public DateTime refreshTime = DateTime.MinValue; + + /// <summary> + /// 鑾峰彇鎺у埗鍙戦�佹暟鎹� + /// </summary> + public AprotocolControlObj GetControlSendData(Dictionary<string, string> commandDictionary) + { + var sendDataObj = new AprotocolControlObj(); + sendDataObj.from_oid = ""; + sendDataObj.to_oid = ""; + sendDataObj.time_stamp = ""; + sendDataObj.type = "device_sid"; + sendDataObj.command = "write"; + + var acoList = new AprotocolControlData(); + acoList.sid = sid; + var aco = new AprotocolControlAttribute(); + foreach(var dic in commandDictionary) + { + aco.name = dic.Key; + aco.value = dic.Value; + acoList.function.Add(aco); + } + + sendDataObj.objects.Add(acoList); + + + return sendDataObj; + } + } + + /// <summary> + /// A鍗忚鎺у埗鏁版嵁鐨勫璞� + /// </summary> + public class AprotocolControlObj + { + public List<AprotocolControlData> objects = new List<AprotocolControlData>(); + + public string from_oid = ""; + public string to_oid = ""; + public string time_stamp = ""; + public string type = ""; + public string command = ""; + } + /// <summary> + /// A鍗忚鎺у埗鏁版嵁 + /// </summary> + public class AprotocolControlData + { + + public string sid = ""; + public List<AprotocolControlAttribute> function = new List<AprotocolControlAttribute>(); + } + /// <summary> + /// A鍗忚鎺у埗灞炴�у璞� + /// </summary> + public class AprotocolControlAttribute + { + public string name; + public string value; } /// <summary> -- Gitblit v1.8.0