From 505effa88b17ce8c3c7ac5403b76d9e5d0cfc2a5 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 28 十月 2024 11:58:31 +0800 Subject: [PATCH] 谷歌版本问题修复 --- HDL_ON/Entity/FunctionList.cs | 123 +++++++++++++++++++++++++--------------- 1 files changed, 76 insertions(+), 47 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index aecf05a..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 { @@ -111,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> @@ -122,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> @@ -143,6 +165,15 @@ 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> public List<Function> GetCurtainList() @@ -163,15 +194,6 @@ public List<Function> GetDoorLockList() { var spkList = SPK.GetDoorLockSPKList(); - return Functions.FindAll((obj) => spkList.Contains(obj.spk)); - } - /// <summary> - /// 鑾峰彇钀ょ煶瑙嗛闂ㄩ攣 - /// </summary> - /// <returns></returns> - public List<Function> GetVideoDoorLockList() - { - var spkList = SPK.GetVideoDoorLockSPKList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } @@ -212,8 +234,8 @@ var spkList = SPK.ElectricalSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } - - + + /// <summary> /// 绾㈠瀹濆垪琛� /// </summary> @@ -221,7 +243,7 @@ { return Functions.FindAll((obj) => obj.spk == SPK.IrModule); } -#endregion + #endregion /// <summary> /// 闊充箰鍒楄〃 @@ -258,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)); @@ -282,7 +307,7 @@ { get { - if(_OtherBrandFunction == null) + if (_OtherBrandFunction == null) { _OtherBrandFunction = new List<Function>(); var spkList = SPK.GetAll3tySPK(); @@ -350,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); } @@ -384,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; } @@ -424,7 +449,7 @@ { } else - { + { switch (brandType) { case SPK.BrandType.Hdl: @@ -491,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) { } @@ -509,7 +534,7 @@ /// <summary> /// 鍒犻櫎鍦烘櫙 /// </summary> - public void DeleteScene(Scene scene,bool upSevser) + public void DeleteScene(Scene scene, bool upSevser) { if (upSevser) { @@ -537,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); } @@ -576,14 +605,14 @@ { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖1"); return; } new Thread(() => { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖2"); return; } MainPage.Log($"杩涘叆--璇诲彇"); @@ -592,7 +621,7 @@ { Read3tyFunctionStatus(); - if(DriverLayer.Control.Ins.GatewayOnline_Local) + if (DriverLayer.Control.Ins.GatewayOnline_Local) { //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl); @@ -656,12 +685,12 @@ MainPage.Log($"缁撴潫--璇诲彇"); } - + }) { IsBackground = true }.Start(); } -#region 鍦烘櫙鐩稿叧 + #region 鍦烘櫙鐩稿叧 /// <summary> /// 娣诲姞鍦烘櫙 /// </summary> @@ -693,10 +722,10 @@ } return revPack.Code; } -#endregion + #endregion -#region 鏀惰棌鍔熻兘 - + #region 鏀惰棌鍔熻兘 + /// <summary> /// 鏀惰棌鍦烘櫙 /// </summary> @@ -721,14 +750,14 @@ return result; } -#endregion + #endregion -#region - + #region -#endregion + + #endregion } } -- Gitblit v1.8.0