From 5985ef28a5722360fa00f88f23544ed585fd05ef Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 05 五月 2022 22:34:50 +0800 Subject: [PATCH] 备份 --- HDL_ON/Entity/Function/Function.cs | 103 ++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 85 insertions(+), 18 deletions(-) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 82876da..ba28965 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -88,7 +88,7 @@ { var attrs = new List<string>(); - foreach(var attr in attributes) + foreach (var attr in attributes) { attrs.Add(attr.key); } @@ -349,6 +349,26 @@ public List<string> roomIds = new List<string>(); /// <summary> + /// 瀛樺偍灞炴�ч厤缃� + /// 鐜浼犳劅鍣ㄧ殑绛夌骇 + /// </summary> + public List<AttrKeyConfig> attrKeyConfigs = new List<AttrKeyConfig>(); + + public List<AttrKeyConfig> GetAttrKeyConfigs(string key) + { + if (attrKeyConfigs.Count == 0) + { + switch (key) + { + case "pm2.5": + + break; + } + } + return attrKeyConfigs; + } + + /// <summary> /// bus鍗忚鏁版嵁鏍煎紡 /// 浣跨敤A鍗忚鎺у埗鏃讹紝鏀瑰睘鎬т负绌� /// </summary> @@ -361,6 +381,11 @@ /// 鏄惁鍦ㄧ嚎 /// </summary> public bool online = true; + + /// <summary> + /// 鐜闈㈡澘 缁戝畾鐨� 璁惧鐩爣sid鍒楄〃 + /// </summary> + public List<string> targetSids = new List<string>(); /// <summary> /// 浜戠鏁版嵁鍒涘缓鐨勬椂闂� /// </summary> @@ -403,7 +428,7 @@ _trait_on_off.curValue = "off"; } } - if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop") + if (_trait_on_off.curValue.ToString() != "on" && _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop") { _trait_on_off.curValue = "off"; } @@ -470,7 +495,7 @@ collect = !collect; IMessageCommon.Current.ShowErrorInfoAlter(result); }); - }else + } else { Application.RunOnMainThread(() => { @@ -495,7 +520,7 @@ } else { - result = ApiUtlis.Ins.HttpRequest.UnbindDeviceToRoom(deviceId,roomId); + result = ApiUtlis.Ins.HttpRequest.UnbindDeviceToRoom(deviceId, roomId); } //鎻愮ず閿欒 if (result != StateCode.SUCCESS) @@ -538,9 +563,9 @@ { roomNameList += ","; } - roomNameList += findRoom.floorName +"-"+ findRoom.roomName; + roomNameList += findRoom.floorName + "-" + findRoom.roomName; } - if (roomNameList == "" ) + if (roomNameList == "") { roomNameList = Language.StringByID(StringId.WholeZone); } @@ -653,14 +678,14 @@ case FunctionAttributeKey.Percent: case FunctionAttributeKey.CCT: case FunctionAttributeKey.RGB: - //case FunctionAttributeKey.FadeTime: + //case FunctionAttributeKey.FadeTime: if (attr.curValue.ToString() == "{}") { if (attr.key == FunctionAttributeKey.OnOff) { attr.curValue = "off"; } - else if (attr.key == FunctionAttributeKey.Mode ) + else if (attr.key == FunctionAttributeKey.Mode) { if (DB_ResidenceData.Instance.GatewayType == 0) { @@ -678,7 +703,7 @@ } } } - else + else { attr.curValue = "0"; } @@ -731,7 +756,7 @@ return sendDataObj; } - public AlinkDoorlockObj GetGatewayAlinkDoorlockData(string userId,string extStr) + public AlinkDoorlockObj GetGatewayAlinkDoorlockData(string userId, string extStr) { var sendDataObj = new AlinkDoorlockObj(); sendDataObj.id = Control.Ins.msg_id.ToString(); @@ -1162,7 +1187,7 @@ try { return Convert.ToByte(loopId, 16); - }catch + } catch { return 0; } @@ -1266,7 +1291,7 @@ /// <summary> /// 锛堢孩澶栫┖璋冿級 /// </summary> - public const string AcIr= "ir.ac"; + public const string AcIr = "ir.ac"; /// <summary> /// 绌鸿皟 /// </summary> @@ -1467,7 +1492,9 @@ spkList.Add(SenesorMegahealth2); return spkList; } + #endregion + public const string PanelEnvironment = "screen.panel"; /// <summary> /// 闈㈡澘spk鍒楄〃 /// </summary> @@ -1476,9 +1503,9 @@ { var spkList = new List<string>(); spkList.Add(SensorHelp); + spkList.Add(PanelEnvironment); return spkList; } - #endregion #region 鐜浼犳劅鍣� /// <summary> @@ -1839,9 +1866,49 @@ //} -public class VersionInfo -{ - public string module = ""; - public string version = ""; -} + public class VersionInfo + { + public string module = ""; + public string version = ""; + } + + /// <summary> + /// 鍔熻兘灞炴�х浉鍏抽厤缃俊鎭� + /// 鐜浼犳劅鍣ㄧ瓑绾т娇鐢� + /// </summary> + public class AttrKeyConfig + { + public string key = string.Empty; + /// <summary> + /// 閰嶇疆绫诲瀷 + /// interval 鍖洪棿 + /// 鐩墠鍙敮鎸侊細interval + /// </summary> + public string type = string.Empty; + + public string unit = string.Empty; + + public List<AttrKeyInfo> configs = new List<AttrKeyInfo>(); + + } + + public class AttrKeyInfo + { + /// <summary> + /// + /// </summary> + public string start = string.Empty; + /// <summary> + /// + /// </summary> + public string end = string.Empty; + /// <summary> + /// + /// </summary> + public uint color = 0x00000000; + /// <summary> + /// 鎻忚堪 + /// </summary> + public string desc = string.Empty; + } } -- Gitblit v1.8.0