DeviceManager.cs 668 B

123456789101112131415161718192021222324
  1. using System.Reflection;
  2. using Aitex.Core.RT.Device;
  3. namespace Aitex.Triton160.RT.Device
  4. {
  5. public class DeviceManager : DeviceManagerBase
  6. {
  7. public override bool Initialize()
  8. {
  9. FieldInfo[] fi = typeof(DeviceModel).GetFields();
  10. foreach (FieldInfo p in fi)
  11. {
  12. p.SetValue(null, GetDevice(p.Name));
  13. }
  14. AddCustomDevice(new IoSignalTower("System", "SignalTower", "SignalTower", "SignalTower"), "SignalTower",
  15. typeof(IoSignalTower));
  16. DeviceModel.SignalTower = GetDevice<IoSignalTower>("SignalTower");
  17. return true;
  18. }
  19. }
  20. }