IoSetConfig.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Diagnostics;
  3. using System.Xml;
  4. using Aitex.Core.Common.DeviceData;
  5. using Aitex.Core.RT.DataCenter;
  6. using Aitex.Core.RT.Device;
  7. using Aitex.Core.RT.Event;
  8. using Aitex.Core.RT.IOCore;
  9. using Aitex.Core.RT.OperationCenter;
  10. using Aitex.Core.RT.SCCore;
  11. using Aitex.Core.RT.Tolerance;
  12. using Aitex.Core.Util;
  13. using SorterRT.Modules;
  14. namespace VirgoRT.Devices.IODevices
  15. {
  16. public class IoSetConfig : BaseDevice, IDevice
  17. {
  18. private AOAccessor _aoPressureOffset = null;
  19. private DeviceTimer _timer = new DeviceTimer();
  20. public IoSetConfig(string module, XmlElement node, string ioModule = "")
  21. {
  22. base.Module = module;
  23. base.Name = node.GetAttribute("id");
  24. base.Display = node.GetAttribute("display");
  25. base.DeviceID = node.GetAttribute("schematicId");
  26. _aoPressureOffset = ParseAoNode("aoPressureOffset", node, ioModule);
  27. }
  28. public bool Initialize()
  29. {
  30. return true;
  31. }
  32. public void Terminate()
  33. {
  34. }
  35. public void Monitor()
  36. {
  37. if (_timer.IsTimeout())
  38. {
  39. _aoPressureOffset.Value = 0;
  40. }
  41. }
  42. public void Reset()
  43. {
  44. _timer.Start(5000);
  45. _aoPressureOffset.Value = 0;
  46. }
  47. }
  48. }