From e6a26ee148587327478d9a82624a820c907b6e16 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 04 十一月 2020 14:58:15 +0800
Subject: [PATCH] 20201104

---
 HDL_ON/Entity/Function/Function.cs |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 938977a..909a146 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -246,6 +246,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