From aed247d7fa4499665041864479fae82089eafe5f Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 07 一月 2020 09:15:57 +0800
Subject: [PATCH] 2019.1.7

---
 ZigbeeApp/Shared/Common/Room.cs |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs
index 6229f57..7e74cae 100644
--- a/ZigbeeApp/Shared/Common/Room.cs
+++ b/ZigbeeApp/Shared/Common/Room.cs
@@ -805,6 +805,25 @@
             return false;
         }
 
+        /// <summary>
+        /// 鑾峰彇鎴块棿鎵�鍦ㄥ尯鍩�
+        /// 妤煎眰,鎴块棿鍚�
+        /// </summary>
+        /// <returns></returns>
+        public string GetZoneName()
+        {
+            if (string.IsNullOrEmpty(FloorId))
+            {
+                return Name;
+            }
+            var floorName = Config.Instance.Home.GetFloorNameById(FloorId);
+            if (floorName == null)
+            {
+                return Name;
+            }
+            return $"{floorName},{Name}";
+        }
+
         #endregion
 
         #region 鈼� 鏇存柊鎴块棿_________________________
@@ -1104,16 +1123,16 @@
         /// <param name="sceneIconPath">鑳屾櫙鍥剧墖锛屼笉鍖呭惈浣忓畢璺緞 濡傛灉iconPathType=1鎴栬��2 闇�瑕佹嫾鎺ヤ綇瀹� 鍙樻垚 浣忓畢/sceneIconPath</param>
         /// <param name="commons">Commons.</param>
         /// <param name="iconPathType">I鍦烘櫙鑳屾櫙鍥剧墖鏉ユ簮绫诲瀷 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱 榛樿0</param>
-        public async System.Threading.Tasks.Task<int> AddScene(string sceneName, string sceneIconPath, List<ZigBee.Device.Scene.AddSceneMemberData> commons, int iconPathType = 0)
+        public async System.Threading.Tasks.Task<int> AddScene(string sceneName, string sceneIconPath, List<ZigBee.Device.Scene.AddSceneMemberData> commons, int iconPathType)
         {
             var scenes = GetSceneUIsByFloorId(FloorId);
-            if(scenes!=null && scenes.Count>0)
-            {
-                if (scenes.Find(s => s.Name == sceneName) != null)
-                {
-                    return -1;
-                }
-            }
+            //if(scenes!=null && scenes.Count>0)
+            //{
+            //    if (scenes.Find(s => s.Name == sceneName) != null)
+            //    {
+            //        return -1;
+            //    }
+            //}
 
             var getSceneIdAllData = await ZigBee.Device.Scene.GetSceneNewIdAsync(sceneName);
             if (getSceneIdAllData == null || getSceneIdAllData.getSceneIdData == null)
@@ -1153,18 +1172,11 @@
             //鍔犲叆鎴愬姛
             if (result)
             {
-                //iconPathType=0 鐩存帴浼犲�硷紝 iconPathType=1鍜宨conPathType=2闇�瑕佹嫾鎺ヤ綇瀹呰矾寰�
-                var fullPath = sceneIconPath;
-                if (iconPathType == 1 || iconPathType == 2)
-                {
-                    Common.Room.CurrentRoom.MoveBackGroundIamageFileToDirectory(sceneIconPath, $"{Config.Instance.FullPath}/{sceneIconPath}");
-                    fullPath = $"{Config.Instance.FullPath}/{sceneIconPath}";
-                }
                 var sceneUI = new SceneUI
                 {
                     Name = sceneName,
                     Id = getSceneIdData.NewScenesId,
-                    IconPath = fullPath,
+                    IconPath = sceneIconPath,
                     IconPathType = iconPathType,
                     AddSceneMemberDataList= commons
                 };

--
Gitblit v1.8.0