From 73cd2b147d98acb3a945b7b5daad39103fd4377d Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期六, 12 十二月 2020 19:07:38 +0800
Subject: [PATCH] 20201212-1

---
 HDL_ON/Entity/Room.cs |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/Entity/Room.cs b/HDL_ON/Entity/Room.cs
index bcd9ea2..60c8e35 100644
--- a/HDL_ON/Entity/Room.cs
+++ b/HDL_ON/Entity/Room.cs
@@ -261,6 +261,7 @@
                     if(addFloor!= null)
                     {
                         CurrentSpatial.FloorList.Add(addFloor);
+                        floor = addFloor;
                     }
                 }
                 var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(CurrentSpatial.FloorList));
@@ -415,8 +416,14 @@
 
         public void ClearRooms()
         {
-            floors.Clear();
-            rooms.Clear();
+            if (floors != null)
+            {
+                floors.Clear();
+            }
+            if (rooms != null)
+            {
+                rooms.Clear();
+            }
         }
 
         /// <summary>
@@ -531,7 +538,7 @@
             }
             if (functions.Count == 0)
             {
-                foreach (var f in DB_ResidenceData.functionList.GetAllFunction())
+                foreach (var f in FunctionList.List.GetDeviceFunctionList())
                 {
                     if (f.roomIds.Contains(roomId) && roomId != null)
                     {
@@ -573,7 +580,7 @@
             }
             if (scenes.Count == 0)
             {
-                foreach (var s in DB_ResidenceData.functionList.scenes)
+                foreach (var s in FunctionList.List.scenes)
                 {
                     if (s.roomIds.Contains(roomId) && roomId != null)
                     {

--
Gitblit v1.8.0