PMATMProcessRoutine.cs 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Collections.Generic;
  3. using Aitex.Core.RT.Event;
  4. using Aitex.Core.RT.Log;
  5. using Aitex.Core.RT.RecipeCenter;
  6. using Aitex.Core.RT.Routine;
  7. using Aitex.Core.RT.SCCore;
  8. using JetVirgoPM.Devices;
  9. using JetVirgoPM.PMs.Routines;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.Routine;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  14. using MECF.Framework.RT.ModuleLibrary.PMModules;
  15. namespace JetVirgoPM.PMs.RecipeExecutors
  16. {
  17. class PMATMProcessRoutine : PMRoutineBase
  18. {
  19. public enum Routine
  20. {
  21. SetLiftPin1,
  22. SetSlitDoor1,
  23. Delay,
  24. SetLiftPin2,
  25. SetSlitDoor2,
  26. SetLiftPinBoth,
  27. SetSlitDoorBoth,
  28. End,
  29. }
  30. //--------------------------------Constructor------------------------------------
  31. //
  32. public PMATMProcessRoutine(JetDualPM chamber) : base(chamber)
  33. {
  34. Name = "ATM Process";
  35. }
  36. private int ATMProcessDelayTime;
  37. public void Terminate()
  38. {
  39. }
  40. public RState Start(params object[] param)
  41. {
  42. Reset();
  43. if (!SC.IsATMMode)
  44. {
  45. EV.PostWarningLog(Module.ToString(), $"can not run ATM process,sc config System.IsATMMode = false");
  46. return RState.Failed;
  47. }
  48. ATMProcessDelayTime = SC.GetValue<int>("System.ATMProcessDelayTime");
  49. return Runner.Start(_chamber.Module.ToString(), Name);
  50. }
  51. public RState Monitor()
  52. {
  53. var hasWafer0 = WaferManager.Instance.CheckHasWafer(Module, 0);
  54. var hasWafer1 = WaferManager.Instance.CheckHasWafer(Module, 1);
  55. if (hasWafer0 && hasWafer1)
  56. {
  57. Runner.Run(Routine.SetSlitDoorBoth, HOFs.Apply(SetSlitDoor, EnumDualPM.Both, false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Both, false), _delay_5s)
  58. .Run(Routine.SetLiftPinBoth, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Both, false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Both, false), _delay_5s)
  59. .Delay(Routine.Delay, ATMProcessDelayTime * 1000)
  60. .Run(Routine.SetSlitDoor1, HOFs.Apply(SetSlitDoor, EnumDualPM.Both, true), HOFs.Apply(CheckSlitDoor, EnumDualPM.Both, true), _delay_5s)
  61. .Run(Routine.SetLiftPin1, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Both, true), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Both, true), _delay_5s)
  62. .End(Routine.End, EndFunc, _delay_0s);
  63. }
  64. else if (hasWafer0 || hasWafer1)
  65. {
  66. Runner.Run(Routine.SetSlitDoorBoth, HOFs.Apply(SetSlitDoor, EnumDualPM.Both, false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Both, false), _delay_5s)
  67. .Run(Routine.SetLiftPinBoth, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Both, false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Both, false), _delay_5s)
  68. .Delay(Routine.Delay, ATMProcessDelayTime * 1000)
  69. .Run(Routine.SetSlitDoor1, HOFs.Apply(SetSlitDoor, EnumDualPM.Left, hasWafer0 ? true : false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Left, hasWafer0 ? true : false), _delay_5s)
  70. .Run(Routine.SetLiftPin1, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Left, hasWafer0 ? true : false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Left, hasWafer0 ? true : false), _delay_5s)
  71. .Run(Routine.SetSlitDoor2, HOFs.Apply(SetSlitDoor, EnumDualPM.Right, hasWafer1 ? true:false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Right, hasWafer1 ? true : false), _delay_5s)
  72. .Run(Routine.SetLiftPin2, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Right, hasWafer1 ? true : false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Right, hasWafer1 ? true : false), _delay_5s)
  73. .End(Routine.End, EndFunc, _delay_0s);
  74. }
  75. return Runner.Status;
  76. }
  77. public void Exit()
  78. { }
  79. }
  80. }