| | |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | | |
| | | public class LogicMethod |
| | | public class LogicMethod |
| | | { |
| | | /// <summary> |
| | | /// 表示是条件 |
| | |
| | | room1.uid = "全部区域";//默认sid用识别该房间 |
| | | roomList.Add(room1);//默认添加到房间列表里 |
| | | var roomLists = GetGatewayRoomList(); |
| | | foreach (var room in roomLists) |
| | | for (int i = 0; i < roomLists.Count; i++) |
| | | { |
| | | var room = roomLists[i]; |
| | | var devlist = GetRoomDevice(room); |
| | | if (devlist.Count == 0) |
| | | { |
| | |
| | | { |
| | | HDL_ON.Entity.Function device = new Entity.Function() { name = "Unknown" }; |
| | | List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList(); |
| | | foreach (var dev in deviceLists) |
| | | for (int i = 0; i < deviceLists.Count; i++) |
| | | { |
| | | var dev = deviceLists[i]; |
| | | if (dev.sid == sid) |
| | | { |
| | | device = dev; |
| | |
| | | { |
| | | HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown" }; |
| | | List<HDL_ON.Entity.Scene> sceneLists = GetSceneList(); |
| | | foreach (var sce in sceneLists) |
| | | for (int i = 0; i < sceneLists.Count; i++) |
| | | { |
| | | var sce = sceneLists[i]; |
| | | if (sce.sid == sid) |
| | | { |
| | | scene = sce; |
| | |
| | | string roomName = ""; |
| | | List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList(); |
| | | |
| | | foreach (var dev in device.roomIds) |
| | | |
| | | for (int i = 0; i < device.roomIds.Count; i++) |
| | | { |
| | | var dev = device.roomIds[i]; |
| | | var room = roomLists.Find((c) => c.uid == dev); |
| | | if (room != null) |
| | | { |
| | |
| | | public static List<Entity.Function> GetShowDeviceList(List<FunctionType> functionType, List<HDL_ON.Entity.Function> deviceList) |
| | | { |
| | | List<HDL_ON.Entity.Function> devList = new List<Entity.Function>(); |
| | | foreach (var dev in deviceList) |
| | | for (int i = 0; i < deviceList.Count; i++) |
| | | { |
| | | var dev = deviceList[i]; |
| | | if (functionType.Contains(dev.functionType)) |
| | | { |
| | | ///过滤掉不需要显示的设备 |
| | | devList.Add(dev); |
| | | } |
| | | |
| | | } |
| | | |
| | | return devList; |
| | | } |
| | | /// <summary> |