From cd1029a11d96f55337430cec97b7d4cd510f5d5f Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 17 十二月 2020 15:09:38 +0800 Subject: [PATCH] 2020-12-17 1.成员管理UI还原度修改。2.增加右键删除。3.增加无区域功能管理。 --- HDL_ON/Entity/FunctionList.cs | 207 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 197 insertions(+), 10 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 0dd75e6..a6a1f17 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -4,6 +4,7 @@ using System.Threading; using HDL_ON.DAL; using HDL_ON.DAL.Server; +using Shared; namespace HDL_ON.Entity { @@ -399,7 +400,7 @@ localFunction.collect = newFunction.collect; localFunction.modifyTime = newFunction.modifyTime; localFunction.roomIds = newFunction.roomIds; - localFunction.bus_Data = newFunction.bus_Data; + localFunction.bus = newFunction.bus; localFunction.SaveFunctionData(false); } deviceList.list.Remove(newFunction);//鎿嶄綔瀹岀殑鏁版嵁娓呯悊鎺夛紝鍓╀笅鐨勫氨鏄柊澧炵殑鍔熻兘 @@ -437,17 +438,14 @@ var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString()); if (sceneList != null) { - ////灏嗕笅杞藉埌鍒版暟鎹叏閮ㄤ繚瀛� - //new Thread(() => { - // foreach (var temp in sceneList) - // { - // temp.SaveSceneData(); - // } - //}) - //{ IsBackground = true }.Start(); - for(int i=0;i<List.scenes.Count;) + for (int i=0;i<List.scenes.Count;) { var localScene = List.scenes[i]; + if (localScene == null) + { + List.scenes.Remove(localScene); + continue; + } var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId); if (newScene == null)//濡傛灉浜戠鏈�鏂版暟鎹病鏈夎鏉℃暟鎹紝鍒欐湰鍦伴渶瑕佸垹鎺夎鏁版嵁璁板綍 { @@ -621,6 +619,195 @@ { IsBackground = true }.Start(); } + + #region 鍔熻兘鏂囨湰鐩稿叧 + /// <summary> + /// 灞炴�у悕绉版樉绀烘枃鏈� + /// 涓嫳鏂囨樉绀� + /// </summary> + public string GetNameText(string key) + { + string text = ""; + switch (key) + { + case FunctionAttributeKey.OnOff: + text = Language.StringByID(StringId.OnOff); + break; + case FunctionAttributeKey.Brightness: + text = Language.StringByID(StringId.Brightness); + break; + case FunctionAttributeKey.Color: + text = Language.StringByID(StringId.ColorValue); + break; + case FunctionAttributeKey.Mode: + text = Language.StringByID(StringId.Mode); + break; + case FunctionAttributeKey.FanSpeed: + text = Language.StringByID(StringId.FanSpeed); + break; + case FunctionAttributeKey.SetTemp: + text = Language.StringByID(StringId.Temp); + break; + case FunctionAttributeKey.IndoorTemp: + text = Language.StringByID(StringId.IndoorTemp); + break; + case FunctionAttributeKey.Delay: + text = Language.StringByID(StringId.Delay); + break; + case FunctionAttributeKey.CCT: + text = "CCT"; + break; + case FunctionAttributeKey.Percent: + text = Language.StringByID(StringId.PercentAdjustment); + break; + } + return text; + } + + /// <summary> + /// 灞炴�у�煎崟浣� + /// </summary> + public string GetUintString(string key) + { + var us = ""; + switch (key) + { + case FunctionAttributeKey.SetTemp: + case FunctionAttributeKey.IndoorTemp: + us = "掳C"; + break; + case FunctionAttributeKey.Percent: + case FunctionAttributeKey.Brightness: + us = "%"; + break; + } + return us; + } + + /// <summary> + /// 鑾峰彇鎸囧畾灞炴�х殑鏄剧ず鏂囨湰 + /// 涓嫳鏂囨樉绀� + /// </summary> + public string GetValueText(string key, string value) + { + string text = ""; + switch (key) + { + case FunctionAttributeKey.OnOff: + text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF); + break; + case FunctionAttributeKey.SetTemp: + case FunctionAttributeKey.IndoorTemp: + case FunctionAttributeKey.Brightness: + case FunctionAttributeKey.Percent: + if (value == "") + { + value = "0"; + } + text = value; + break; + case FunctionAttributeKey.Mode: + switch (value) + { + //----绌鸿皟 + case "auto": + text = Language.StringByID(StringId.Auto); + break; + case "cool": + text = Language.StringByID(StringId.Cool); + break; + case "heat": + text = Language.StringByID(StringId.Heat); + break; + case "dry": + text = Language.StringByID(StringId.Dry); + break; + case "fan": + text = Language.StringByID(StringId.AirSupply); + break; + //-----鍦扮儹 + case "day": + text = Language.StringByID(StringId.Day); + break; + case "night": + text = Language.StringByID(StringId.Night); + break; + case "away": + text = Language.StringByID(StringId.Away); + break; + case "normal": + text = Language.StringByID(StringId.Normal); + break; + case "timer": + text = Language.StringByID(StringId.Timer); + break; + } + break; + case FunctionAttributeKey.FanSpeed: + switch (value) + { + case "high": + text = Language.StringByID(StringId.HighWindSpeed); + break; + case "medium": + text = Language.StringByID(StringId.MiddleWindSpeed); + break; + case "low": + text = Language.StringByID(StringId.LowWindSpeed); + break; + case "auto": + text = Language.StringByID(StringId.Auto); + break; + default: + text = "low"; + break; + } + break; + case "high": + text = Language.StringByID(StringId.HighWindSpeed); + break; + case "medium": + text = Language.StringByID(StringId.MiddleWindSpeed); + break; + case "low": + text = Language.StringByID(StringId.LowWindSpeed); + break; + case "auto": + text = Language.StringByID(StringId.Auto); + break; + } + return text; + } + + + /// <summary> + /// 寤舵椂鏄剧ず鐨勬枃鏈� + /// </summary> + public string GetDelayText(string delay) + { + string text = ""; + switch (delay) + { + case "0": + text = Language.StringByID(StringId.NoDelay); + break; + case "30": + text = "30s"; + break; + case "60": + text = "1min"; + break; + case "120": + text = "2min"; + break; + case "300": + text = "5min"; + break; + } + return text; + } + + #endregion } } -- Gitblit v1.8.0