IoReset.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.Xml;
  2. using Aitex.Core.RT.IOCore;
  3. using Aitex.Core.Util;
  4. namespace Aitex.Core.RT.Device.Unit
  5. {
  6. public class IoReset : BaseDevice, IDevice
  7. {
  8. private DOAccessor _doReset = null;
  9. private DeviceTimer _timer = new DeviceTimer();
  10. public IoReset(string module, XmlElement node, string ioModule = "")
  11. {
  12. base.Module = module;
  13. base.Name = node.GetAttribute("id");
  14. base.Display = node.GetAttribute("display");
  15. base.DeviceID = node.GetAttribute("schematicId");
  16. _doReset = ParseDoNode("doReset", node, ioModule);
  17. }
  18. public bool Initialize()
  19. {
  20. return true;
  21. }
  22. public void Terminate()
  23. {
  24. }
  25. public void Monitor()
  26. {
  27. if (_timer.IsTimeout())
  28. {
  29. _doReset.Value = false;
  30. }
  31. }
  32. public void Reset()
  33. {
  34. _timer.Start(5000);
  35. _doReset.Value = true;
  36. }
  37. }
  38. }