LLPlaceRoutine.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.RT.SCCore;
  3. using Venus_RT.Devices;
  4. using MECF.Framework.Common.Routine;
  5. using System.Diagnostics;
  6. using System.Collections.Generic;
  7. using Venus_Core;
  8. namespace Venus_RT.Modules.PMs
  9. {
  10. class LLPlaceRoutine : PMRoutineBase, IRoutine
  11. {
  12. private enum LLPlaceStep
  13. {
  14. kPrepareTransfer,
  15. kExtend,
  16. kPinUp,
  17. kRetract,
  18. kPostTransfer,
  19. kOpenFastPump,
  20. }
  21. private int _prepareTransferTimeout = 120;
  22. private int _transferWaferTimeout = 120;
  23. private bool _isATMMode = false;
  24. public LLPlaceRoutine(JetPM chamber) : base(chamber)
  25. {
  26. Name = "PlaceWafer";
  27. }
  28. public RState Start(params object[] objs)
  29. {
  30. _prepareTransferTimeout = SC.GetValue<int>($"{Module}.PrepareTransferTimeout");
  31. _transferWaferTimeout = SC.GetValue<int>($"{Module}.TransferWaferTimeout");
  32. _isATMMode = SC.GetValue<bool>("System.IsATMMode");
  33. if(_isATMMode)
  34. {
  35. if(!_chamber.IsATM || !_chamber.IsATMLoadlock)
  36. {
  37. Stop("腔体非大气状态,请先执行充气动作");
  38. return RState.Failed;
  39. }
  40. }
  41. else
  42. {
  43. if(!_chamber.IsVAC || !_chamber.IsVACLoadLock)
  44. {
  45. Stop("腔体非真空状态,请先执行抽真空动作");
  46. return RState.Failed;
  47. }
  48. }
  49. _chamber.OpenValve(ValveType.FastPump, false);
  50. _chamber.OpenValve(ValveType.LoadlockPumping, false);
  51. Reset();
  52. return Runner.Start(Module, Name);
  53. }
  54. public RState Monitor()
  55. {
  56. Runner.Run((int)LLPlaceStep.kPrepareTransfer, PrepareTransfer, IsPrepareReady, _prepareTransferTimeout * 1000)
  57. .Run((int)LLPlaceStep.kExtend, _chamber.ExtendWafer, () => { return _chamber.IsLoadlockArmExtend; }, _transferWaferTimeout * 1000)
  58. .Run((int)LLPlaceStep.kPinUp, SetLiftPinUp, () => { return _chamber.CheckLiftUp(); })
  59. .Run((int)LLPlaceStep.kRetract, _chamber.RetractWafer, () => { return _chamber.IsLoadlockArmRetract; }, _transferWaferTimeout * 1000)
  60. .Run((int)LLPlaceStep.kPostTransfer, PostTransfer, IsPostTransferReady, _prepareTransferTimeout * 1000)
  61. .End((int)LLPlaceStep.kOpenFastPump, OpenFastPump, _delay_50ms);
  62. return Runner.Status;
  63. }
  64. private bool PrepareTransfer()
  65. {
  66. _chamber.SetLiftPin(MovementPosition.Down, out _);
  67. _chamber.SetSlitDoor(true, out _);
  68. return true;
  69. }
  70. private bool IsPrepareReady()
  71. {
  72. return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorOpen();
  73. }
  74. private bool PostTransfer()
  75. {
  76. _chamber.SetLiftPin(MovementPosition.Down, out _);
  77. _chamber.SetSlitDoor(false, out _);
  78. return true;
  79. }
  80. private bool IsPostTransferReady()
  81. {
  82. return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorClose();
  83. }
  84. private bool SetLiftPinUp()
  85. {
  86. return _chamber.SetLiftPin(MovementPosition.Up, out _);
  87. }
  88. private bool OpenFastPump()
  89. {
  90. if (!_isATMMode)
  91. _chamber.OpenValve(ValveType.FastPump, true);
  92. return true;
  93. }
  94. public void Abort()
  95. {
  96. }
  97. }
  98. }