old mode 100755
new mode 100644
| | |
| | | return sceneList; |
| | | } |
| | | |
| | | /// <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);
|
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取房间设备类型 |
| | | /// </summary> |
| | | /// <param name="room"></param> |
| | | /// <returns></returns> |
| | | public static List<DeviceType> GetdeviceTypes(Room room) |
| | | { |
| | | List<DeviceType> typeList = new List<DeviceType> { }; |
| | | foreach (var deviceUI in room.DeviceUIList) |
| | | { |
| | | if (deviceUI == null || deviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!typeList.Contains(deviceUI.CommonDevice.Type)) |
| | | { |
| | | typeList.Add(deviceUI.CommonDevice.Type); |
| | | } |
| | | } |
| | | return typeList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取该类型的设备 |
| | | /// </summary> |
| | | /// <param name="room"></param> |
| | | /// <param name="deviceType"></param> |
| | | /// <returns></returns> |
| | | public static List<DeviceUI> GetDeviceUIs(Room room ,DeviceType deviceType) |
| | | { |
| | | List<DeviceUI> typeList = new List<DeviceUI> { }; |
| | | foreach (var deviceUI in room.DeviceUIList) |
| | | { |
| | | if (deviceUI == null || deviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | if(deviceUI.CommonDevice.Type!=deviceType) |
| | | { |
| | | continue; |
| | | } |
| | | if (!typeList.Contains(deviceUI)) |
| | | { |
| | | typeList.Add(deviceUI); |
| | | } |
| | | } |
| | | return typeList; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 添加场景_________________________ |