From 23c9d1577fd0c02ca6976c874855ad60268646b8 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期一, 25 七月 2022 10:31:16 +0800 Subject: [PATCH] 2022年07月25日10:31:11 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 2c645ad..60eb6a9 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/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 = "瓒呭0娉紶鎰熷櫒", 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 = "瓒呭0娉紶鎰熷櫒", 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; - } -- Gitblit v1.8.0