From d90c55272f597acd0e946493896b7977293cf84d Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 09 三月 2023 09:10:31 +0800 Subject: [PATCH] 人脸管理菜单 --- HDL_ON/Entity/FunctionList.cs | 66 ++++++++++++++++++-------------- 1 files changed, 37 insertions(+), 29 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 3f2a267..b294d7d 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -18,7 +18,8 @@ { try { - _FunctionList.Clear(); + _FunctionList._IpCamImou = null; + _FunctionList.ClearDatas(); _FunctionList = null; } catch (Exception ex) @@ -75,7 +76,12 @@ _IpCamImou = Functions.FindAll((obj) => obj.spk == SPK.IpCam_Imou); if (_IpCamImou.Count > 0) { +#if __IOS__ +#else Com.Utils.HdlToLcUtils.Instance.InitData(Shared.Application.Activity, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost); + Com.Utils.HdlToLcUtils.Instance.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; + Com.Utils.HdlToLcUtils.Instance.Token = UserInfo.Current.AccessToken; +#endif } } return _IpCamImou; @@ -88,7 +94,7 @@ /// <returns></returns> public List<Function> GetAcstParentList() { - return Functions.FindAll((obj) => obj.spk == SPK.AcstParent); + return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);//.OrderByDescending(o=>o.controlCounter).ToList() } /// <summary> @@ -169,15 +175,7 @@ /// </summary> public List<Function> InverterList() { - //get - //{ - // return _inverterList; - //} - //set - //{ - // _inverterList = value; - //} - return Functions.FindAll((obj) => obj.spk == SPK.Inverter); + return Functions.FindAll((obj) => obj.spk == SPK.Inverter || obj.spk == SPK.InverterRst); } #region 瀹剁數鍒楄〃 electricals /// <summary> @@ -197,7 +195,7 @@ { return Functions.FindAll((obj) => obj.spk == SPK.IrModule); } - #endregion +#endregion /// <summary> /// 闊充箰鍒楄〃 @@ -325,16 +323,24 @@ if (checkRepeat == true) { //妫�娴嬮噸澶� - for (int i = 0; i < Functions.Count; i++) + var same = Functions.FindAll((obj) => obj.deviceId == tempFunction.deviceId); + if(same!= null) { - if (Functions[i].deviceId == tempFunction.deviceId) + foreach(var sameTemp in same) { - //鍏堢Щ闄ゆ帀鍐嶅姞 - Functions.RemoveAt(i); - Functions.Add(tempFunction); - return; + Functions.Remove(sameTemp); } } + //for (int i = 0; i < Functions.Count; i++) + //{ + // if (Functions[i].deviceId == tempFunction.deviceId) + // { + // //鍏堢Щ闄ゆ帀鍐嶅姞 + // Functions.RemoveAt(i); + // Functions.Add(tempFunction); + // return; + // } + //} } Functions.Add(tempFunction); } @@ -438,14 +444,16 @@ /// <summary> /// 娓呯┖璁惧鍔熻兘鍒楄〃 /// </summary> - public void Clear() + public void ClearDatas() { try { - _IpCamImou.Clear(); - _IpCamImou = null; - _FunctionList.Clear(); - _FunctionList = null; + if (_IpCamImou != null) + { + _IpCamImou.Clear(); + _IpCamImou = null; + } + _FunctionList = new FunctionList(); } catch (Exception ex) { @@ -627,7 +635,7 @@ { IsBackground = true }.Start(); } - #region 鍦烘櫙鐩稿叧 +#region 鍦烘櫙鐩稿叧 /// <summary> /// 娣诲姞鍦烘櫙 /// </summary> @@ -659,9 +667,9 @@ } return revPack.Code; } - #endregion +#endregion - #region 鏀惰棌鍔熻兘 +#region 鏀惰棌鍔熻兘 /// <summary> /// 鏀惰棌鍦烘櫙 @@ -687,14 +695,14 @@ return result; } - #endregion +#endregion - #region +#region - #endregion +#endregion } } -- Gitblit v1.8.0