From 76bee0cb59c06d4616d70aace2cff4223c76a469 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期一, 14 十月 2019 20:25:46 +0800 Subject: [PATCH] 2019.10.14 --- ZigbeeApp/Shared/Common/Room.cs | 88 +++++++++++++++++++++++++++++-------------- 1 files changed, 59 insertions(+), 29 deletions(-) diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs old mode 100755 new mode 100644 index c7ef0ed..f0492c4 --- a/ZigbeeApp/Shared/Common/Room.cs +++ b/ZigbeeApp/Shared/Common/Room.cs @@ -44,7 +44,7 @@ { get { - return GetFloorNameById(FloorId); + return Config.Instance.Home.GetFloorNameById(FloorId); } } /// <summary> @@ -66,6 +66,15 @@ /// 妤煎眰--澶囩敤 /// </summary> public Dictionary<string, string> FloorList = new Dictionary<string, string> { }; + + /// <summary> + /// 娓╁害浼犳劅鍣�(璁惧涓婚敭) + /// </summary> + public string TemperatrueDevice = string.Empty; + /// <summary> + /// 婀垮害浼犳劅鍣�(璁惧涓婚敭) + /// </summary> + public string HumidityDevice = string.Empty; /// <summary> /// 褰撳墠閫夋嫨鐨勬埧闂� @@ -453,6 +462,17 @@ return Lists.Find((obj) => obj.Id == roomId); } + + /// <summary> + /// 鏍规嵁鎴块棿鍚嶅瓧锛岃幏鍙栨埧闂村璞� + /// </summary> + /// <returns>The room by name.</returns> + /// <param name="roomName">鎴块棿鍚�</param> + public Room GetRoomByName(string roomName) + { + return Lists.Find((obj) => obj.Name == roomName); + } + /// <summary> /// 鏍规嵁璁惧鑾峰彇鎴块棿鍚嶅瓧(妤煎眰+鎴块棿鍚�) /// </summary> @@ -523,6 +543,20 @@ return null; } + /// <summary> + /// 鑾峰彇澶氫釜鎴块棿鐨勮繛鎺ヨ捣鏉ョ殑鍚嶅瓧 + /// </summary> + /// <param name="listName"></param> + /// <returns></returns> + public string GetRoomName(List<string> listName) + { + if (listName.Count == 0) + { + //鏈垎閰嶅尯鍩� + return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom); + } + return string.Join(",", listName); + } #endregion @@ -693,7 +727,6 @@ #endregion #region 鈼� 鍒犻櫎璁惧_________________________ - /// <summary> /// 鍒犻櫎鍔熻兘-璁惧 /// </summary> @@ -807,6 +840,28 @@ AllRoomDeviceTypeList.Add(deviceUI.CommonDevice.Type); } } + } + + /// <summary> + /// 鑾峰彇褰撳墠鎴块棿涓嬬殑鍏ㄩ儴璁惧 + /// </summary> + /// <returns></returns> + public List<CommonDevice> GetRoomListDevice() + { + var listDevice = new List<CommonDevice>(); + foreach (var device in this.DeviceUIList) + { + if (device == null || device.CommonDevice == null) + { + continue; + } + listDevice.Add(device.CommonDevice); + } + if (listDevice.Count == 0) + { + return listDevice; + } + return Common.LocalDevice.Current.SortDevice(listDevice); } #endregion @@ -1282,6 +1337,8 @@ //鍏嬮殕灞炴�� newRoom.Id = this.Id; newRoom.FloorId = this.FloorId; + newRoom.TemperatrueDevice = this.TemperatrueDevice; + newRoom.HumidityDevice = this.HumidityDevice; newRoom.Name = this.Name; newRoom.BackgroundImage = this.BackgroundImage; newRoom.BackgroundImageType = this.BackgroundImageType; @@ -1290,33 +1347,6 @@ } #endregion - - #region 鈼� 妤煎眰___________________________ - - /// <summary> - /// 鑾峰彇妤煎眰鍚嶇О - /// </summary> - /// <param name="floorId"></param> - /// <returns></returns> - public string GetFloorNameById(string floorId) - { - if (Config.Instance.Home.FloorDics.Count == 0) - { - return null; - } - - foreach (var floor in Config.Instance.Home.FloorDics) - { - if (floorId == floor.Key) - { - return floor.Value; - } - } - return null; - } - - #endregion - } } -- Gitblit v1.8.0