| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | |
| | | 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"; |
| | | sendDataObj.id = Control.Ins.msg_id.ToString(); |
| | | sendDataObj.time_stamp = Control.Ins.Get_TimeStamp(); |
| | | |
| | | var acoList = new AprotocolControlData(); |
| | | acoList.sid = sid; |
| | | var aco = new AprotocolControlAttribute(); |
| | | |
| | | var acd = new AprotocolControlData(); |
| | | acd.sid = sid; |
| | | #if DEBUG |
| | | acd.sid = "0001016FB925AB02020100010101"; |
| | | #endif |
| | | var aca = new AprotocolControlAttribute(); |
| | | foreach(var dic in commandDictionary) |
| | | { |
| | | aco.name = dic.Key; |
| | | aco.value = dic.Value; |
| | | acoList.function.Add(aco); |
| | | aca.key = dic.Key; |
| | | aca.value = dic.Value; |
| | | acd.status.Add(aca); |
| | | } |
| | | |
| | | sendDataObj.objects.Add(acoList); |
| | | |
| | | sendDataObj.objects.Add(acd); |
| | | |
| | | return sendDataObj; |
| | | } |
| | |
| | | { |
| | | 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 = ""; |
| | | public string id = ""; |
| | | } |
| | | /// <summary> |
| | | /// A协议控制数据 |
| | |
| | | { |
| | | |
| | | public string sid = ""; |
| | | public List<AprotocolControlAttribute> function = new List<AprotocolControlAttribute>(); |
| | | public List<AprotocolControlAttribute> status = new List<AprotocolControlAttribute>(); |
| | | } |
| | | /// <summary> |
| | | /// A协议控制属性对象 |
| | | /// </summary> |
| | | public class AprotocolControlAttribute |
| | | { |
| | | public string name; |
| | | public string key; |
| | | public string value; |
| | | } |
| | | |