IRoutine.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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_50ms = 50;
  43. protected readonly int _delay_1s = 1000;
  44. protected readonly int _delay_2s = 2000;
  45. protected readonly int _delay_3s = 3000;
  46. protected readonly int _delay_4s = 4000;
  47. protected readonly int _delay_5s = 5000;
  48. protected readonly int _delay_10s = 10000;
  49. protected readonly int _delay_20s = 20000;
  50. protected readonly int _delay_30s = 30000;
  51. protected readonly int _delay_60s = 60000;
  52. protected readonly int _delay_2m = 120000;
  53. protected readonly int _delay_3m = 180000;
  54. protected readonly int _delay_5m = 300000;
  55. public ModuleRoutineBase(ModuleName module)
  56. {
  57. Module = module;
  58. Runner.Reset();
  59. }
  60. protected void Notify(string message)
  61. {
  62. LOG.Write(eEvent.EV_ROUTINE_NOTIFY, Module, Name, message);
  63. }
  64. protected void Stop(string failReason)
  65. {
  66. LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, failReason);
  67. }
  68. public void Reset()
  69. {
  70. Runner.Reset();
  71. }
  72. }
  73. }