From 5b40f1da1d28616de3880857b38357eef7859b64 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 26 十一月 2020 17:51:35 +0800
Subject: [PATCH] 2020-11-26-1
---
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