IRoutine.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 MECF.Framework.Common.Jobs;
  9. using Venus_Core;
  10. namespace Aitex.Core.RT.Routine
  11. {
  12. public interface IRoutine
  13. {
  14. RState Start(params object[] objs);
  15. RState Monitor();
  16. void Abort();
  17. }
  18. public interface ICycle : IRoutine
  19. {
  20. SequenceLLInOutPath LLInOutPath { get; }
  21. bool HasJobRunning { get; }
  22. RState CycleState { get; }
  23. bool AbortJob(string jobName,out string reason);
  24. bool StopJob(string jobName,out string reason);
  25. bool ResumeJob(string jobName,out string reason);
  26. bool PauseJob(string jobName,out string reason);
  27. bool StartJob(string jobName,out string reason);
  28. bool CreateJob(Dictionary<string, object> param,out string reason);
  29. void Clear();
  30. bool ManualReturnWafer(object[] objs);
  31. RState CheckManualReturnWafer();
  32. RState ReturnAllWafers();
  33. bool CheckJobJustDone(out string sJobName);
  34. bool CheckAllJobDone();
  35. }
  36. public class ModuleRoutineBase
  37. {
  38. public ModuleName Module { get; set; }
  39. public string Name { get; set; }
  40. public bool NullFun() => true;
  41. protected RoutineRunner Runner = new RoutineRunner();
  42. protected readonly int _delay_5ms = 5;
  43. protected readonly int _delay_50ms = 50;
  44. protected readonly int _delay_1s = 1000;
  45. protected readonly int _delay_2s = 2000;
  46. protected readonly int _delay_3s = 3000;
  47. protected readonly int _delay_4s = 4000;
  48. protected readonly int _delay_5s = 5000;
  49. protected readonly int _delay_10s = 10000;
  50. protected readonly int _delay_20s = 20000;
  51. protected readonly int _delay_30s = 30000;
  52. protected readonly int _delay_60s = 60000;
  53. protected readonly int _delay_2m = 120000;
  54. protected readonly int _delay_3m = 180000;
  55. protected readonly int _delay_5m = 300000;
  56. public ModuleRoutineBase(ModuleName module)
  57. {
  58. Module = module;
  59. Runner.Reset();
  60. }
  61. protected void Notify(string message)
  62. {
  63. LOG.Write(eEvent.EV_ROUTINE_NOTIFY, Module, Name, message);
  64. }
  65. protected void Warn(string warningMessage)
  66. {
  67. LOG.Write(eEvent.WARN_ROUTER, Module, Name, warningMessage);
  68. }
  69. protected void Stop(string failReason)
  70. {
  71. LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, failReason);
  72. }
  73. public void Reset()
  74. {
  75. Runner.Reset();
  76. }
  77. }
  78. }