From cda2410f9c29f2fadc16e9de38ccae95b75a89dd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 09 六月 2021 10:51:13 +0800
Subject: [PATCH] 1

---
 HDL_ON/Entity/FunctionList.cs |   83 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index d0cb2e8..62b1fee 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -101,7 +101,6 @@
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
     
-      
         /// <summary>
         /// 绾㈠瀹濆垪琛�
         /// </summary>
@@ -109,8 +108,19 @@
         {
             return Functions.FindAll((obj) => obj.spk == SPK.IrModule);
         }
-
         #endregion
+
+        /// <summary>
+        /// 闊充箰鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<Function> GetMusicList()
+        {
+            var spkList = SPK.MusicSpkList();
+            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
+        }
+
+
         /// <summary>
         /// 鐜浼犳劅鍣ㄥ垪琛�
         /// </summary>
@@ -128,7 +138,39 @@
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
 
+        /// <summary>
+        /// 鍙瀵硅鍒楄〃
+        /// </summary>
+        public UI.UI2.FuntionControlView.Video.VideoClouds videoIntercom;
+
+        List<Function> _OtherBrandFunction;
+        /// <summary>
+        /// 绗笁鏂瑰搧鐗屽姛鑳�
+        /// </summary>
+        public List<Function> OtherBrandFunction
+        {
+            get
+            {
+                if(_OtherBrandFunction == null)
+                {
+                    _OtherBrandFunction = new List<Function>();
+                    var spkList = SPK.GetAll3tySPK();
+                    _OtherBrandFunction = Functions.FindAll((obj) => spkList.Contains(obj.spk));
+                }
+                return _OtherBrandFunction;
+            }
+        }
+
+
+        /// <summary>
+        /// 鍦烘櫙鍒楄〃
+        /// </summary>
         public List<Scene> scenes = new List<Scene>();
+
+        /// <summary>
+        /// 瀹夐槻鍒楄〃
+        /// </summary>
+        public List<SecurityAlarm> securities = new List<SecurityAlarm>();
 
         /// <summary>
         /// 鍔犺浇鍔熻兘鍒楄〃
@@ -152,6 +194,11 @@
                     FileUtlis.Files.DeleteFile(filePath);
                     return;
                 }
+                //闊充箰閮ㄥ垎瑕佷慨鏀�
+                //if(tempFunction.spk.ToString() == SPK.MusicStandard)
+                //{
+                //    UI.Music.A31MusicModel.A31MusicModelList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<UI.Music.A31MusicModel>(functionDataString));
+                //}
                 if (checkRepeat == true)
                 {
                     //妫�娴嬮噸澶�
@@ -168,12 +215,39 @@
                 }
                 Functions.Add(tempFunction);
             }
-            if (filePath.StartsWith("SceneData_"))
+            else if (filePath.StartsWith("SceneData_"))
             {
                 var sceneDataBytes = FileUtlis.Files.ReadFile(filePath);
                 var sceneDataString = System.Text.Encoding.UTF8.GetString(sceneDataBytes);
                 var tempScene = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene>(sceneDataString);
                 List.scenes.Add(tempScene);
+            }
+            else if (filePath.StartsWith("SecurityData_"))
+            {
+                var dataBytes = FileUtlis.Files.ReadFile(filePath);
+                var dataString = System.Text.Encoding.UTF8.GetString(dataBytes);
+                var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString);
+                if (temp == null)
+                {
+                    MainPage.Log("null");
+                    FileUtlis.Files.DeleteFile(filePath);
+                    return;
+                }
+                if (checkRepeat == true)
+                {
+                    //妫�娴嬮噸澶�
+                    for (int i = 0; i < securities.Count; i++)
+                    {
+                        if (securities[i].sid == temp.sid)
+                        {
+                            //鍏堢Щ闄ゆ帀鍐嶅姞
+                            securities.RemoveAt(i);
+                            securities.Add(temp);
+                            return;
+                        }
+                    }
+                }
+                securities.Add(temp);
             }
         }
 
@@ -216,6 +290,9 @@
             return Functions;
         }
 
+
+
+
         /// <summary>
         /// 娓呯┖璁惧鍔熻兘鍒楄〃
         /// </summary>

--
Gitblit v1.8.0