From acc8caee31c4be90bd38d1af18136b0e84f6fe94 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期五, 27 九月 2024 14:01:19 +0800 Subject: [PATCH] Merge branch 'feature/v2.7_迭代' into feature/V2.7_Google --- HDL_ON/Entity/FunctionList.cs | 120 +++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 82 insertions(+), 38 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index f8e9c99..9b3858a 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -14,20 +14,20 @@ { static FunctionList _FunctionList; - public static void ClearData() - { - try - { - _FunctionList._IpCamImou = null; - _FunctionList.ClearDatas(); - _FunctionList = null; - } - catch (Exception ex) - { - MainPage.Log($"娓呯悊FunctionList寮傚父:{ex.Message}"); - _FunctionList = null; - } - } + //public static void ClearData() + //{ + // try + // { + // _FunctionList._IpCamImou = null; + // _FunctionList.ClearDatas(); + // _FunctionList = null; + // } + // catch (Exception ex) + // { + // MainPage.Log($"娓呯悊FunctionList寮傚父:{ex.Message}"); + // _FunctionList = null; + // } + //} public static FunctionList List { @@ -55,6 +55,12 @@ /// 鍔熻兘鍒楄〃 /// </summary> public List<Function> Functions = new List<Function>(); + /// <summary> + /// 缇ゆ帶鍒楄〃 + /// </summary> + public List<GroupControl> groupControls = new List<GroupControl>(); + + /// <summary> /// 鏈烘鑷傚垪琛� /// </summary> @@ -105,7 +111,7 @@ /// <returns></returns> public List<Function> GetAcstParentList() { - return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);//.OrderByDescending(o=>o.controlCounter).ToList() + return Functions.FindAll((obj) => obj.spk == SPK.AcstParent); } /// <summary> @@ -116,6 +122,28 @@ public List<Function> GetAcstSubList() { return Functions.FindAll((obj) => obj.spk == SPK.AcstSub); + } + /// <summary> + /// 缁垮缓绉戞妧绯荤粺 + /// 鐑按鍣ㄥ垪琛� + /// </summary> + /// <returns></returns> + public List<Function> GetWaterHeaterJinmaoList() + { + return Functions.FindAll((obj) => obj.spk == SPK.WaterHeaterJinmao); + } + /// <summary> + /// 閲戣寕鍏変紡鍌ㄨ兘 + /// </summary> + /// <returns></returns> + public List<Function> GetInverterJinmaoList() + { + var tempList = Functions.FindAll((obj) => obj.spk == SPK.InverterJinmao); + foreach(var device in tempList) + { + device.collect = true; + } + return tempList; } /// <summary> @@ -136,6 +164,15 @@ var spkList = SPK.LightSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } + /// <summary> + /// 搴忓垪鍒楄〃 + /// </summary> + /// <returns></returns> + public List<Function> GetSeries() + { + return Functions.FindAll((obj) => obj.spk == SPK.CommonSeries); + } + /// <summary> /// 绐楀笜鍒楄〃 /// </summary> @@ -197,8 +234,8 @@ var spkList = SPK.ElectricalSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } - - + + /// <summary> /// 绾㈠瀹濆垪琛� /// </summary> @@ -206,7 +243,7 @@ { return Functions.FindAll((obj) => obj.spk == SPK.IrModule); } -#endregion + #endregion /// <summary> /// 闊充箰鍒楄〃 @@ -243,10 +280,13 @@ var spkList = new List<string>() { SPK.SensorPir, + SPK.SensorPirHold, SPK.SensorDoorWindow, SPK.SensorSmoke, SPK.SensorWater, SPK.SensorGas, + SPK.SensorDryContact, + SPK.SensorDryContact2, }; return Functions.FindAll((obj) => spkList.Contains(obj.spk)); @@ -267,7 +307,7 @@ { get { - if(_OtherBrandFunction == null) + if (_OtherBrandFunction == null) { _OtherBrandFunction = new List<Function>(); var spkList = SPK.GetAll3tySPK(); @@ -335,9 +375,9 @@ { //妫�娴嬮噸澶� var same = Functions.FindAll((obj) => obj.deviceId == tempFunction.deviceId); - if(same!= null) + if (same != null) { - foreach(var sameTemp in same) + foreach (var sameTemp in same) { Functions.Remove(sameTemp); } @@ -369,7 +409,7 @@ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString); if (temp == null) { - MainPage.Log("null"); + MainPage.Log("SecurityData_null"); FileUtlis.Files.DeleteFile(filePath); return; } @@ -409,7 +449,7 @@ { } else - { + { switch (brandType) { case SPK.BrandType.Hdl: @@ -476,11 +516,11 @@ /// <summary> /// 鍔熻兘缁戝畾鎴块棿 /// </summary> - public string FunctionsBindRooms(List<string> roomIds,List<string> deviceIds) + public string FunctionsBindRooms(List<string> roomIds, List<string> deviceIds) { var pm = new HttpServerRequest(); var pack = pm.BindDeviceToRoom(deviceIds, roomIds); - if(pack.Code == StateCode.SUCCESS) + if (pack.Code == StateCode.SUCCESS) { } @@ -494,7 +534,7 @@ /// <summary> /// 鍒犻櫎鍦烘櫙 /// </summary> - public void DeleteScene(Scene scene,bool upSevser) + public void DeleteScene(Scene scene, bool upSevser) { if (upSevser) { @@ -522,6 +562,10 @@ /// </summary> public void DeleteFunction(Function delTemp) { + if(delTemp == null) + { + return; + } Functions.Remove(Functions.Find((obj) => obj.deviceId == delTemp.deviceId)); FileUtlis.Files.DeleteFile(delTemp.savePath); } @@ -561,14 +605,14 @@ { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖1"); return; } new Thread(() => { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖2"); return; } MainPage.Log($"杩涘叆--璇诲彇"); @@ -577,7 +621,7 @@ { Read3tyFunctionStatus(); - if(DriverLayer.Control.Ins.GatewayOnline_Local) + if (DriverLayer.Control.Ins.GatewayOnline_Local) { //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl); @@ -641,12 +685,12 @@ MainPage.Log($"缁撴潫--璇诲彇"); } - + }) { IsBackground = true }.Start(); } -#region 鍦烘櫙鐩稿叧 + #region 鍦烘櫙鐩稿叧 /// <summary> /// 娣诲姞鍦烘櫙 /// </summary> @@ -678,10 +722,10 @@ } return revPack.Code; } -#endregion + #endregion -#region 鏀惰棌鍔熻兘 - + #region 鏀惰棌鍔熻兘 + /// <summary> /// 鏀惰棌鍦烘櫙 /// </summary> @@ -706,14 +750,14 @@ return result; } -#endregion + #endregion -#region - + #region -#endregion + + #endregion } } -- Gitblit v1.8.0