From 5b77d9d57a6cddb474a66ca54401ad5ab0892db3 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 23 十一月 2022 14:23:42 +0800
Subject: [PATCH] Merge branch 'dev--wxr' into LcSdkV1

---
 HDL_ON/Entity/FunctionList.cs |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 398fb08..93616b8 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -13,6 +13,21 @@
     public class FunctionList
     {
         static FunctionList _FunctionList;
+
+        public static void ClearData()
+        {
+            try
+            {
+                _FunctionList.Clear();
+                _FunctionList = null;
+            }
+            catch (Exception ex)
+            {
+                MainPage.Log($"娓呯悊FunctionList寮傚父:{ex.Message}");
+                _FunctionList = null;
+            }
+        }
+
         public static FunctionList List
         {
             get
@@ -39,6 +54,28 @@
         /// 鍔熻兘鍒楄〃
         /// </summary>
         public List<Function> Functions = new List<Function>();
+        /// <summary>
+        /// 鏈烘鑷傚垪琛�
+        /// </summary>
+        /// <returns></returns>
+        public List<Function> GetMechanicalArmList()
+        {
+            return Functions.FindAll((obj) => obj.spk == SPK.MechanicalArm);
+        }
+
+        List<Function> _IpCamImou;
+        /// <summary>
+        /// 鑾峰彇鎽勫儚澶村垪琛�
+        /// </summary>
+        /// <returns></returns>
+        public List<Function> GetIpCamImouList()
+        {
+            if (_IpCamImou == null)
+            {
+                _IpCamImou = Functions.FindAll((obj) => obj.spk == SPK.IpCam_Imou);
+            }
+            return _IpCamImou;
+        }
 
         /// <summary>
         /// 缁垮缓绉戞妧绯荤粺
@@ -352,25 +389,33 @@
                 switch (brandType)
                 {
                     case SPK.BrandType.Hdl:
-                        foreach (var function in Functions)
+                        try
                         {
-                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(function.spk))
+                            foreach (var function in Functions)
                             {
-                                resultFunctions.Add(function);
+                                if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(function.spk))
+                                {
+                                    resultFunctions.Add(function);
+                                }
                             }
                         }
+                        catch { }
                         break;
 
                     case SPK.BrandType.Tuya:
                         lock (Functions)
                         {
-                            foreach (var function in Functions)
+                            try
                             {
-                                if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(function.spk))
+                                foreach (var function in Functions)
                                 {
-                                    resultFunctions.Add(function);
+                                    if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(function.spk))
+                                    {
+                                        resultFunctions.Add(function);
+                                    }
                                 }
                             }
+                            catch { }
                         }
                         break;
                 }
@@ -412,7 +457,6 @@
 
         /// <summary>
         /// 鍒犻櫎鍦烘櫙
-        /// todo
         /// </summary>
         public void DeleteScene(Scene scene,bool upSevser)
         {

--
Gitblit v1.8.0