From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 06 六月 2023 11:51:12 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' --- HDL_ON/Entity/FunctionList.cs | 119 ++++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 77 insertions(+), 42 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 3f2a267..cf7a775 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -14,19 +14,20 @@ { static FunctionList _FunctionList; - public static void ClearData() - { - try - { - _FunctionList.Clear(); - _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 +56,12 @@ /// </summary> public List<Function> Functions = new List<Function>(); /// <summary> + /// 缇ゆ帶鍒楄〃 + /// </summary> + public List<GroupControl> groupControls = new List<GroupControl>(); + + + /// <summary> /// 鏈烘鑷傚垪琛� /// </summary> /// <returns></returns> @@ -75,7 +82,23 @@ _IpCamImou = Functions.FindAll((obj) => obj.spk == SPK.IpCam_Imou); if (_IpCamImou.Count > 0) { +#if __IOS__ + //鍒濆鍖栧ぇ鍗庢憚鍍忓ごsdk + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().InitSDKWithAppKey("HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost); + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken = UserInfo.Current.LoginTokenString; + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshToken = UserInfo.Current.RefreshToken; + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().HomeId = DB_ResidenceData.Instance.CurrentRegion.id; + Console.WriteLine("token锛�" + UserInfo.Current.LoginTokenString); + Console.WriteLine("token锛�" + UserInfo.Current.RefreshToken); + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList(); + + + +#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 +111,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> @@ -142,6 +165,15 @@ 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> /// 鏂伴鍒楄〃 @@ -169,15 +201,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 +221,7 @@ { return Functions.FindAll((obj) => obj.spk == SPK.IrModule); } - #endregion +#endregion /// <summary> /// 闊充箰鍒楄〃 @@ -234,6 +258,7 @@ var spkList = new List<string>() { SPK.SensorPir, + SPK.SensorPirHold, SPK.SensorDoorWindow, SPK.SensorSmoke, SPK.SensorWater, @@ -325,16 +350,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); } @@ -352,7 +385,7 @@ var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString); if (temp == null) { - MainPage.Log("null"); + MainPage.Log("SecurityData_null"); FileUtlis.Files.DeleteFile(filePath); return; } @@ -438,14 +471,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 +662,7 @@ { IsBackground = true }.Start(); } - #region 鍦烘櫙鐩稿叧 +#region 鍦烘櫙鐩稿叧 /// <summary> /// 娣诲姞鍦烘櫙 /// </summary> @@ -659,9 +694,9 @@ } return revPack.Code; } - #endregion +#endregion - #region 鏀惰棌鍔熻兘 +#region 鏀惰棌鍔熻兘 /// <summary> /// 鏀惰棌鍦烘櫙 @@ -687,14 +722,14 @@ return result; } - #endregion +#endregion - #region +#region - #endregion +#endregion } } -- Gitblit v1.8.0