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. 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. return Runner.Start(Module, Name);
  26. }
  27. public RState Monitor()
  28. {
  29. Runner.Run((int)RoutineStep.Home, HOFs.WrapAction(_chamber.Home), IsHomed, 50000)
  30. .End((int)RoutineStep.End, () => { return true; });
  31. return Runner.Status;
  32. }
  33. public void Abort()
  34. {
  35. }
  36. private bool IsHomed()
  37. {
  38. return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down;
  39. }
  40. }
  41. }