wjc
2022-07-25 23c9d1577fd0c02ca6976c874855ad60268646b8
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -183,7 +183,7 @@
        public List<HDL_ON.Entity.Function> GetGatewayDeviceList()
        {
            var list = Entity.FunctionList.List.GetDeviceFunctionList();
            //return GetTestDevice(list, true);
            //GetTestDevice(ref list, true);
            return list;
        }
        /// <summary>
@@ -1023,20 +1023,25 @@
        /// </summary>
        /// <param name="isBool">是否开启</param>
        /// <returns></returns>
        private List<Entity.Function> GetTestDevice(List<HDL_ON.Entity.Function> list, bool isBool)
        private List<Entity.Function> GetTestDevice(ref List<HDL_ON.Entity.Function> list, bool isBool)
        {
            if (isBool)
            {
                Entity.Function function = new Entity.Function { sid = "0123456789", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic };
                var device = list.Find((o) => { return o.sid == function.sid; });
                if (device == null)
                //模拟设备
                var functions = new List<Function> {
                 new Entity.Function { sid = "0123456789", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic },
                 };
                foreach (var function in functions)
                {
                    list.Add(function);
                    var device = list.Find((o) => { return o.sid == function.sid; });
                    if (device == null)
                    {
                        list.Add(function);
                    }
                }
            }
            return list;
        }