From 43b0d5870d528f23ecd6aeceb6cfd4325188b46f Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 七月 2021 15:50:43 +0800
Subject: [PATCH] Revert "1"

---
 HDL_ON/Entity/FunctionList.cs |  134 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 119 insertions(+), 15 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index fe72790..1f2fe17 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -70,6 +70,27 @@
             var spkList = SPK.FhSpkList();
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
+
+        /// <summary>
+        /// 鏂伴鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<Function> GetAirFreshList()
+        {
+            var spkList = SPK.AirFreshSpkList();
+            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
+        }
+
+        /// <summary>
+        /// 鑳芥簮鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public List<Function> GetEnergyList()
+        {
+            var spkList = SPK.EnergySpkList();
+            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
+        }
+
         #region 瀹剁數鍒楄〃 electricals
         /// <summary>
         /// 瀹剁數鍒楄〃
@@ -88,15 +109,26 @@
         {
             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>
         public List<Function> GetEnvirSensorsList()
         {
             var spkList = SPK.EnvironSpkList();
-            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
+            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
         /// <summary>
         /// 瀹夐槻璁惧鍒楄〃
@@ -107,7 +139,40 @@
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
 
+        /// <summary>
+        /// 鍙瀵硅鍒楄〃,褰撲负null鎴杝ize涓�0鍒欎笉鏄剧ず鍙瀵硅icon
+        /// </summary>
+        // public UI.UI2.FuntionControlView.Video.VideoClouds videoIntercom;
+        public List<UI.UI2.FuntionControlView.Video.Video> videoIntercom = new List<UI.UI2.FuntionControlView.Video.Video>();
+
+        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>
         /// 鍔犺浇鍔熻兘鍒楄〃
@@ -119,6 +184,7 @@
         /// <para>false:鐩存帴鏃犳潯浠舵坊鍔�</para></param>
         public void IniFunctionList(string filePath, bool checkRepeat = false)
         {
+            //MainPage.Log("12346890sdkxghjkl");
             // todo 澧炲姞璁惧锛屽鍔犲姛鑳借繘鍔熻兘鍒楄〃
             if (filePath.StartsWith("FunctionData_"))
             {
@@ -127,22 +193,28 @@
                 var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
                 if (tempFunction == null)
                 {
+                    MainPage.Log("null");
                     FileUtlis.Files.DeleteFile(filePath);
                     return;
                 }
-                if (checkRepeat == true)
-                {
-                    //妫�娴嬮噸澶�
-                    for (int i = 0; i < Functions.Count; i++)
-                    {
-                        if (Functions[i].deviceId == tempFunction.deviceId)
-                        {
-                            //鍏堢Щ闄ゆ帀鍐嶅姞
-                            Functions.RemoveAt(i);
-                            Functions.Add(tempFunction);
-                            return;
-                        }
-                    }
+                //闊充箰閮ㄥ垎瑕佷慨鏀�
+                //if(tempFunction.spk.ToString() == SPK.MusicStandard)
+                //{
+                //    UI.Music.A31MusicModel.A31MusicModelList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<UI.Music.A31MusicModel>(functionDataString));
+                //}
+                if (checkRepeat == true)
+                {
+                    //妫�娴嬮噸澶�
+                    for (int i = 0; i < Functions.Count; i++)
+                    {
+                        if (Functions[i].deviceId == tempFunction.deviceId)
+                        {
+                            //鍏堢Щ闄ゆ帀鍐嶅姞
+                            Functions.RemoveAt(i);
+                            Functions.Add(tempFunction);
+                            return;
+                        }
+                    }
                 }
                 Functions.Add(tempFunction);
             }
@@ -152,6 +224,33 @@
                 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);
             }
         }
 
@@ -193,6 +292,9 @@
 
             return Functions;
         }
+
+
+
 
         /// <summary>
         /// 娓呯┖璁惧鍔熻兘鍒楄〃
@@ -247,6 +349,7 @@
                 List.scenes.Remove(scene);
             }
         }
+
         /// <summary>
         /// 鍒犻櫎鏈湴鍔熻兘鍙婃枃浠�
         /// </summary>
@@ -364,6 +467,7 @@
             })
             { IsBackground = true }.Start();
         }
+
         #region 鍦烘櫙鐩稿叧
         /// <summary>
         /// 娣诲姞鍦烘櫙

--
Gitblit v1.8.0