IRoutine.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. protected readonly int _delay_10d = 1000 * 60 * 60 * 24 * 10;
  57. public ModuleRoutineBase(ModuleName module)
  58. {
  59. Module = module;
  60. Runner.Reset();
  61. }
  62. protected void Notify(string message)
  63. {
  64. LOG.Write(eEvent.EV_ROUTINE_NOTIFY, Module, Name, message);
  65. }
  66. protected void Warn(string warningMessage)
  67. {
  68. LOG.Write(eEvent.WARN_ROUTER, Module, Name, warningMessage);
  69. }
  70. protected void Stop(string failReason)
  71. {
  72. LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, failReason);
  73. }
  74. public void Reset()
  75. {
  76. Runner.Reset();
  77. }
  78. }
  79. }