From f54a487bb42ac49bf81bd7b5eea311fc79231bc6 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期四, 06 六月 2024 17:37:22 +0800 Subject: [PATCH] 备份 --- HDL_ON/Entity/FunctionList.cs | 158 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 106 insertions(+), 52 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 040fd16..67fcdb7 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 { @@ -56,6 +56,12 @@ /// </summary> public List<Function> Functions = new List<Function>(); /// <summary> + /// 缇ゆ帶鍒楄〃 + /// </summary> + public List<GroupControl> groupControls = new List<GroupControl>(); + + + /// <summary> /// 鏈烘鑷傚垪琛� /// </summary> /// <returns></returns> @@ -64,20 +70,27 @@ return Functions.FindAll((obj) => obj.spk == SPK.MechanicalArm); } - List<Function> _IpCamImou; + + /// <summary> - /// 鑾峰彇鎽勫儚澶村垪琛� + /// 缁垮缓绉戞妧绯荤粺 + /// 鎬绘帶鍒楄〃 /// </summary> /// <returns></returns> - public List<Function> GetIpCamImouList() + public List<Function> GetAcstParentList() { - if (_IpCamImou == null) - { - _IpCamImou = Functions.FindAll((obj) => obj.spk == SPK.IpCam_Imou); - } - return _IpCamImou; + return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);//.OrderByDescending(o=>o.controlCounter).ToList() } + /// <summary> + /// 缁垮缓绉戞妧绯荤粺 + /// 瀛愭帶鍒楄〃 + /// </summary> + /// <returns></returns> + public List<Function> GetAcstSubList() + { + return Functions.FindAll((obj) => obj.spk == SPK.AcstSub); + } /// <summary> /// 绌鸿皟鍒楄〃 @@ -97,6 +110,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> @@ -120,6 +142,34 @@ 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)); + } + /// <summary> + /// 鑾峰彇钀ょ煶鎽勫儚澶� + /// </summary> + /// <returns></returns> + public List<Function> GetEzMonitorList() + { + var spkList = SPK.GetEvIpcamSPKList(); + return Functions.FindAll((obj) => spkList.Contains(obj.spk)); + } + + /// <summary> + /// 鑾峰彇褰遍煶涓帶鍒楄〃 + /// </summary> + /// <returns></returns> + public List<Function> GetVideoControlsList() + { + var spkList = SPK.GetVideoControlsSPKList(); + return Functions.FindAll((obj) => spkList.Contains(obj.spk)); + } /// <summary> /// 鏂伴鍒楄〃 @@ -140,8 +190,6 @@ var spkList = SPK.EnergySpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } - - #region 瀹剁數鍒楄〃 electricals /// <summary> /// 瀹剁數鍒楄〃 @@ -151,8 +199,8 @@ var spkList = SPK.ElectricalSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } - - + + /// <summary> /// 绾㈠瀹濆垪琛� /// </summary> @@ -160,7 +208,7 @@ { return Functions.FindAll((obj) => obj.spk == SPK.IrModule); } -#endregion + #endregion /// <summary> /// 闊充箰鍒楄〃 @@ -197,14 +245,24 @@ 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)); } + + + /// <summary> + /// 鍙瀵硅鍒楄〃,褰撲负null鎴杝ize涓�0鍒欎笉鏄剧ず鍙瀵硅icon + /// </summary> + // public UI.UI2.FuntionControlView.Video.VideoClouds videoIntercom; + public List<UI.UI2.FuntionControlView.Video.Video> videoIntercom = new List<UI.UI2.FuntionControlView.Video.Video>(); List<Function> _OtherBrandFunction; /// <summary> @@ -214,7 +272,7 @@ { get { - if(_OtherBrandFunction == null) + if (_OtherBrandFunction == null) { _OtherBrandFunction = new List<Function>(); var spkList = SPK.GetAll3tySPK(); @@ -282,9 +340,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); } @@ -316,7 +374,7 @@ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString); if (temp == null) { - MainPage.Log("null"); + MainPage.Log("SecurityData_null"); FileUtlis.Files.DeleteFile(filePath); return; } @@ -356,7 +414,7 @@ { } else - { + { switch (brandType) { case SPK.BrandType.Hdl: @@ -406,11 +464,7 @@ { try { - if (_IpCamImou != null) - { - _IpCamImou.Clear(); - _IpCamImou = null; - } + _FunctionList = new FunctionList(); } catch (Exception ex) @@ -423,11 +477,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) { } @@ -441,7 +495,7 @@ /// <summary> /// 鍒犻櫎鍦烘櫙 /// </summary> - public void DeleteScene(Scene scene,bool upSevser) + public void DeleteScene(Scene scene, bool upSevser) { if (upSevser) { @@ -508,14 +562,14 @@ { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖1"); return; } new Thread(() => { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖2"); return; } MainPage.Log($"杩涘叆--璇诲彇"); @@ -524,7 +578,7 @@ { Read3tyFunctionStatus(); - if(DriverLayer.Control.Ins.GatewayOnline_Local) + if (DriverLayer.Control.Ins.GatewayOnline_Local) { //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl); @@ -588,12 +642,12 @@ MainPage.Log($"缁撴潫--璇诲彇"); } - + }) { IsBackground = true }.Start(); } -#region 鍦烘櫙鐩稿叧 + #region 鍦烘櫙鐩稿叧 /// <summary> /// 娣诲姞鍦烘櫙 /// </summary> @@ -625,10 +679,10 @@ } return revPack.Code; } -#endregion + #endregion -#region 鏀惰棌鍔熻兘 - + #region 鏀惰棌鍔熻兘 + /// <summary> /// 鏀惰棌鍦烘櫙 /// </summary> @@ -653,14 +707,14 @@ return result; } -#endregion + #endregion -#region - + #region -#endregion + + #endregion } } -- Gitblit v1.8.0