From dc9a1b15bb69227e19afc070adf58156a362d2a2 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期一, 30 九月 2024 17:07:58 +0800
Subject: [PATCH] 安卓可视对讲响铃,

---
 HDL_ON/Entity/FunctionList.cs |  135 ++++++++++++++++++++++++++++++++------------
 1 files changed, 97 insertions(+), 38 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index f8e9c99..a2fc90f 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>
@@ -137,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()
@@ -157,6 +194,25 @@
         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));
+        }
+
+        /// <summary>
+        /// 鑾峰彇褰遍煶涓帶鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<Function> GetVideoControlsList()
+        {
+            var spkList = SPK.GetVideoControlsSPKList();
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
 
@@ -197,8 +253,8 @@
             var spkList = SPK.ElectricalSpkList();
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
-    
-      
+
+
         /// <summary>
         /// 绾㈠瀹濆垪琛�
         /// </summary>
@@ -206,7 +262,7 @@
         {
             return Functions.FindAll((obj) => obj.spk == SPK.IrModule);
         }
-#endregion
+        #endregion
 
         /// <summary>
         /// 闊充箰鍒楄〃
@@ -243,10 +299,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 +326,7 @@
         {
             get
             {
-                if(_OtherBrandFunction == null)
+                if (_OtherBrandFunction == null)
                 {
                     _OtherBrandFunction = new List<Function>();
                     var spkList = SPK.GetAll3tySPK();
@@ -335,9 +394,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 +428,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 +468,7 @@
             {
             }
             else
-            { 
+            {
                 switch (brandType)
                 {
                     case SPK.BrandType.Hdl:
@@ -476,11 +535,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 +553,7 @@
         /// <summary>
         /// 鍒犻櫎鍦烘櫙
         /// </summary>
-        public void DeleteScene(Scene scene,bool upSevser)
+        public void DeleteScene(Scene scene, bool upSevser)
         {
             if (upSevser)
             {
@@ -561,14 +620,14 @@
         {
             if (lockReadFunctionStatus)
             {
-                MainPage.Log($"澶氭杩涘叆--杩斿洖");
+                MainPage.Log($"澶氭杩涘叆--杩斿洖1");
                 return;
             }
             new Thread(() =>
             {
                 if (lockReadFunctionStatus)
                 {
-                    MainPage.Log($"澶氭杩涘叆--杩斿洖");
+                    MainPage.Log($"澶氭杩涘叆--杩斿洖2");
                     return;
                 }
                 MainPage.Log($"杩涘叆--璇诲彇");
@@ -577,7 +636,7 @@
                 {
                     Read3tyFunctionStatus();
 
-                    if(DriverLayer.Control.Ins.GatewayOnline_Local)
+                    if (DriverLayer.Control.Ins.GatewayOnline_Local)
                     {
 
                         //List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl);
@@ -641,12 +700,12 @@
                     MainPage.Log($"缁撴潫--璇诲彇");
                 }
 
-                
+
             })
             { IsBackground = true }.Start();
         }
 
-#region 鍦烘櫙鐩稿叧
+        #region 鍦烘櫙鐩稿叧
         /// <summary>
         /// 娣诲姞鍦烘櫙
         /// </summary>
@@ -678,10 +737,10 @@
             }
             return revPack.Code;
         }
-#endregion
+        #endregion
 
-#region 鏀惰棌鍔熻兘
-     
+        #region 鏀惰棌鍔熻兘
+
         /// <summary>
         /// 鏀惰棌鍦烘櫙
         /// </summary>
@@ -706,14 +765,14 @@
             return result;
         }
 
-#endregion
+        #endregion
 
 
-#region 
-       
+        #region 
 
 
-#endregion
+
+        #endregion
     }
 
 }

--
Gitblit v1.8.0