From 3793a9a38ac6c4c4111c2bba3a35a71c30601e82 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 13 四月 2020 19:38:24 +0800
Subject: [PATCH] 上传个东西

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs |   34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
index f0ea83f..4f3a0c7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
@@ -307,10 +307,19 @@
         /// </summary>
         /// <returns>鎴块棿鍚�</returns>
         /// <param name="device">璁惧瀵硅薄</param>
-        /// <param name="append">鍦ㄦゼ灞傚拰鎴块棿鍚嶅瓧鐨勪腑闂存坊鍔犵殑瀛楃(浠呴檺鏈夋ゼ灞傜殑鏃跺�欐湁鏁�)</param>
-        public string GetRoomNameByDevice(CommonDevice device, string append = " ")
+        public string GetRoomNameByDevice(CommonDevice device)
         {
             var room = this.GetRoomByDevice(device);
+            return this.GetFloorRoomName(room);
+        }
+
+        /// <summary>
+        /// 鑾峰彇鎴块棿鍚嶅瓧(妤煎眰+鎴块棿鍚�)
+        /// </summary>
+        /// <returns>鎴块棿鍚�</returns>
+        /// <param name="room">鎴块棿瀵硅薄</param>
+        public string GetFloorRoomName(Room room)
+        {
             if (room == null)
             {
                 //鏈垎閰嶅尯鍩�
@@ -319,7 +328,7 @@
             if (Config.Instance.Home.FloorDics.ContainsKey(room.FloorId) == true)
             {
                 //(妤煎眰+鎴块棿鍚�)
-                return Config.Instance.Home.FloorDics[room.FloorId] + append + room.Name;
+                return Config.Instance.Home.FloorDics[room.FloorId] + " " + room.Name;
             }
             return room.Name;
         }
@@ -510,6 +519,13 @@
         /// <param name="saveRealRoom">鏄惁淇敼鐪熷疄鐗╃悊璁惧鐨勬埧闂�,涓嶅嚭鎰忓,杩欎釜鍊奸粯璁や负true鍗冲彲</param>
         public void ChangedRoom(CommonDevice device, string roomId, bool saveRealRoom = true)
         {
+            //閫夋嫨鐨勬槸鏈垎閰�
+            if (roomId == string.Empty)
+            {
+                //浠庡師鏉ョ殑鎴块棿绉婚櫎璁惧
+                this.DeleteDevice(device);
+                return;
+            }
             //鎴块棿鏄惁淇敼
             if (this.IsRoomChanged(device, roomId) == false)
             {
@@ -763,6 +779,11 @@
             var listEsxit = new HashSet<string>();
             foreach (var room in this.dicRooms.Values)
             {
+                if (room.IsLove == true)
+                {
+                    //涓嶅寘鍚敹钘忔埧闂�
+                    continue;
+                }
                 foreach (string mainkeys in room.ListDevice)
                 {
                     if (listEsxit.Contains(mainkeys) == false)
@@ -776,6 +797,11 @@
             var commonDeviceList = LocalDevice.Current.listAllDevice;
             foreach (var device in commonDeviceList)
             {
+                //鍒ゆ柇璇ヨ澶囪兘鍚︽樉绀哄湪涓婚〉
+                if (LocalDevice.Current.CanShowInHomeHomeMainPage(device) == false)
+                {
+                    continue;
+                }
                 string mainkeys = LocalDevice.Current.GetDeviceMainKeys(device);
                 if (listEsxit.Contains(mainkeys) == false)
                 {
@@ -1010,7 +1036,7 @@
             if (Config.Instance.Home.ListRooms.Contains("Favorite") == false)
             {
                 //榛樿娣诲姞鍠滅埍鐨勬埧闂�--绂佹淇敼鎴块棿鍚�
-                var love = new Room { Name = Language.StringByID(R.MyInternationalizationString.Favorite), BackgroundImage = "RoomIcon/0.JPG", Id = "Favorite" };
+                var love = new Room { Name = Language.StringByID(R.MyInternationalizationString.Favorite), BackgroundImage = "RoomIcon/0.jpg", Id = "Favorite" };
                 love.Save(false);
                 //娣诲姞鍒癶ouse 鎴块棿璺緞鍒楄〃
                 var currentHome = Config.Instance.Home;

--
Gitblit v1.8.0