wei
2020-12-23 35c4bc03ee8da50317cd3f33e9f52f0a4259affd
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -5,7 +5,7 @@
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
    public  class  LogicMethod
    public class LogicMethod
    {
        /// <summary>
        /// 表示是条件
@@ -141,8 +141,9 @@
            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)
                {
@@ -202,8 +203,9 @@
        {
            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;
@@ -222,8 +224,9 @@
        {
            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;
@@ -242,8 +245,10 @@
            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)
                {
@@ -409,14 +414,17 @@
        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>