IRoutine.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Core.RT.Log;
  6. using MECF.Framework.Common.Routine;
  7. using MECF.Framework.Common.Equipment;
  8. using Venus_Core;
  9. namespace Aitex.Core.RT.Routine
  10. {
  11. public interface IRoutine
  12. {
  13. RState Start(params object[] objs);
  14. RState Monitor();
  15. void Abort();
  16. }
  17. public class ModuleRoutineBase
  18. {
  19. public ModuleName Module { get; set; }
  20. public string Name { get; set; }
  21. public bool NullFun() => true;
  22. protected RoutineRunner Runner = new RoutineRunner();
  23. protected readonly int _delay_50ms = 50;
  24. protected readonly int _delay_1s = 1000;
  25. protected readonly int _delay_2s = 2000;
  26. protected readonly int _delay_3s = 3000;
  27. protected readonly int _delay_4s = 4000;
  28. protected readonly int _delay_5s = 5000;
  29. protected readonly int _delay_10s = 10000;
  30. protected readonly int _delay_20s = 20000;
  31. public ModuleRoutineBase(ModuleName module)
  32. {
  33. Module = module;
  34. Runner.Reset();
  35. }
  36. protected void Notify(string message)
  37. {
  38. LOG.Write(eEvent.EV_ROUTINE_NOTIFY, Module, Name, message);
  39. }
  40. protected void Stop(string failReason)
  41. {
  42. LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, failReason);
  43. }
  44. public void Reset()
  45. {
  46. Runner.Reset();
  47. }
  48. }
  49. }