IRoutine.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. protected readonly int _delay_30s = 30000;
  32. protected readonly int _delay_60s = 60000;
  33. protected readonly int _delay_2m = 120000;
  34. protected readonly int _delay_3m = 180000;
  35. protected readonly int _delay_5m = 300000;
  36. public ModuleRoutineBase(ModuleName module)
  37. {
  38. Module = module;
  39. Runner.Reset();
  40. }
  41. protected void Notify(string message)
  42. {
  43. LOG.Write(eEvent.EV_ROUTINE_NOTIFY, Module, Name, message);
  44. }
  45. protected void Stop(string failReason)
  46. {
  47. LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, failReason);
  48. }
  49. public void Reset()
  50. {
  51. Runner.Reset();
  52. }
  53. }
  54. }