PMHomeRoutine.cs 1.0 KB

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