| | |
| | | public List<HDL_ON.Entity.Function> GetGatewayDeviceList() |
| | | { |
| | | var list = Entity.FunctionList.List.GetDeviceFunctionList(); |
| | | //return GetTestDevice(list, true); |
| | | //GetTestDevice(ref list, true); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | |
| | | /// </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; |
| | | |
| | | |
| | | } |
| | | |