old mode 100755
new mode 100644
| | |
| | | { |
| | | get |
| | | { |
| | | return GetFloorNameById(FloorId); |
| | | return Config.Instance.Home.GetFloorNameById(FloorId); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// 楼层--备用 |
| | | /// </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> |
| | | /// 当前选择的房间 |
| | |
| | | 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> |
| | |
| | | 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 |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region ◆ 删除设备_________________________ |
| | | |
| | | /// <summary> |
| | | /// 删除功能-设备 |
| | | /// </summary> |
| | |
| | | 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 |
| | |
| | | //克隆属性
|
| | | 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;
|
| | |
| | | }
|
| | |
|
| | | #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 |
| | | |
| | | |
| | | } |
| | | } |