From 145b157ba183ebf877c93ed2dbb01ec737c993d3 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 08 十二月 2020 18:59:33 +0800
Subject: [PATCH] Merge branch 'WJC'

---
 HDL_ON/Entity/DB_ResidenceData.cs |   69 ++++++++++++----------------------
 1 files changed, 24 insertions(+), 45 deletions(-)

diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs
index f733b0e..5cb0446 100644
--- a/HDL_ON/Entity/DB_ResidenceData.cs
+++ b/HDL_ON/Entity/DB_ResidenceData.cs
@@ -134,25 +134,6 @@
                             instance.SaveResidenceData();
                         }
 
-                        new Light()
-                        {
-                            sid = "030101123456780202010005ABCD",
-                            name = "鐏厜1",
-                            attributes = new List<FunctionAttributes>() {
-                                        new FunctionAttributes { key="on_off", max=100,min = 0, value= new List<string> { "on","off"} },
-                                        },
-                            roomIds = new List<string>() { "0001" },
-                            bus_Data = new BusData
-                            {
-                                addresses = "2A06",
-                                loopId = 1,
-                            },
-                        }.SaveFunctionData();
-
-
-                       
-                       
-
 
                     }
                     catch (Exception ex)
@@ -287,7 +268,22 @@
         public List<Room> Rooms = SpatialInfo.CurrentSpatial.RoomList;
 
         #region 鍔熻兘鏁版嵁
-        public static FunctionList functionList = FunctionList.List;
+        static FunctionList _functionList;
+        public static FunctionList functionList
+        {
+            get
+            {
+                if (_functionList == null)
+                {
+                    _functionList = FunctionList.List;
+                }
+                return _functionList;
+            }
+            set
+            {
+                _functionList = value;
+            }
+        }
 
         /// <summary>
         /// 鍒锋柊浣忓畢閲岄潰鐨勬悳绱㈣澶囩姸鎬�
@@ -296,34 +292,17 @@
         {
             new Thread(() =>
             {
-                try
+                if(_functionList == null)
                 {
-                    foreach (var function in functionList.GetAllDeviceFunctionList())
-                    {
-                        Thread.Sleep(100);
-                        switch (function.functionCategory)
-                        {
-                            case FunctionCategory.Light:
-                            case FunctionCategory.Electrical:
-                            case FunctionCategory.SwitchDevice:
-                            case FunctionCategory.Curtain:
-                            case FunctionCategory.Thermostat:
-                                if (DB_ResidenceData.residenceData.GatewayType == 0)
-                                {
-                                    DriverLayer.Control.Ins.SendReadCommand(function);
-                                }
-                                break;
-                        }
-                    }
+                    _functionList = FunctionList.List;
                 }
-                catch (Exception ex)
-                {
-                    MainPage.Log($"Refresh Residence Function Status Error : {ex.Message}");
-                }
-            })
-            { IsBackground = true }.Start();
+                return _functionList;
+            }
+            set
+            {
+                _functionList = value;
+            }
         }
-
 
         #endregion
 

--
Gitblit v1.8.0