From 4c17caa61bc3b0a05a2b303bccdfedfbf3853f6d Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 24 十一月 2020 15:58:10 +0800 Subject: [PATCH] 2020-11-24 1.优化登录界面失败提示。 --- HDL_ON/Entity/Function/Function.cs | 84 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 68 insertions(+), 16 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 053e45b..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> @@ -258,22 +319,10 @@ /// 灞炴�у悕绉� /// </summary> public string name; - List<string> _value_key; /// <summary> /// 灞炴�х殑鍊煎垪琛� /// </summary> - [Newtonsoft.Json.JsonIgnore] - public List<string> value_key - { - get - { - return _value_key; - } - set - { - _value_key = value; - } - } + public List<string> value_key = new List<string>(); /// <summary> /// 鏈�澶у�� /// </summary> @@ -312,6 +361,7 @@ switch (name) { case "temperature": + case "set_temperature": us = "掳C"; break; case "percent": @@ -351,6 +401,7 @@ text = Language.StringByID(StringId.FanSpeed); break; case "temperature": + case "set_temperature": text = Language.StringByID(StringId.Temp); break; case "delay": @@ -366,7 +417,7 @@ //case "lock": //case "ico": //case "swing": - //case "set_ point": + //case "set_point": //case "pm25": //case "volume": //case "vol_step": @@ -413,6 +464,7 @@ text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF); break; case "temperature": + case "set_temperature": case "brightness": case "percent": if (value == "") @@ -521,7 +573,7 @@ //case "lock": //case "ico": //case "swing": - //case "set_ point": + //case "set_point": //case "pm25": //case "volume": //case "vol_step": -- Gitblit v1.8.0