PMHomeRoutine.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using Aitex.Core.RT.Routine;
  3. using Venus_RT.Devices;
  4. using MECF.Framework.Common.Routine;
  5. using Venus_Core;
  6. namespace Venus_RT.Modules.PMs
  7. {
  8. class PMHomeRoutine : PMRoutineBase, IRoutine
  9. {
  10. enum RoutineStep
  11. {
  12. Home,
  13. End,
  14. }
  15. public PMHomeRoutine(JetPM chamber) : base(chamber)
  16. {
  17. Name = "PM Home";
  18. }
  19. public RState Init()
  20. {
  21. return RState.End;
  22. }
  23. public RState Start(params object[] objs)
  24. {
  25. Reset();
  26. return Runner.Start(Module, Name);
  27. }
  28. public RState Monitor()
  29. {
  30. Runner.Run((int)RoutineStep.Home, HOFs.WrapAction(_chamber.Home), IsHomed, 50000)
  31. .End((int)RoutineStep.End, () => { return true; });
  32. return Runner.Status;
  33. }
  34. public void Abort()
  35. {
  36. }
  37. private bool IsHomed()
  38. {
  39. return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down && _chamber.PVN22ValveIsOpen && _chamber.IsLoadlockArmRetract;
  40. }
  41. }
  42. }