PMHomeRoutine.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using Aitex.Core.RT.Routine;
  3. using JetVirgoPM.Devices;
  4. namespace JetVirgoPM.PMs.Routines
  5. {
  6. class PMHomeRoutine : PMRoutineBase, IStepRoutine
  7. {
  8. enum RoutineStep
  9. {
  10. Home,
  11. End,
  12. }
  13. public PMHomeRoutine(JetDualPM chamber) : base(chamber)
  14. {
  15. Name = "Homing";
  16. }
  17. public Result Init()
  18. {
  19. return Result.DONE;
  20. }
  21. public RState Start(params object[] objs)
  22. {
  23. Reset();
  24. return Runner.Start(_chamber.Module.ToString(), Name);
  25. }
  26. public RState Monitor()
  27. {
  28. if (_chamber != null && _chamber.IsInstalled)
  29. {
  30. Runner.Run(RoutineStep.Home, Home, NullFun, _delay_10s)
  31. .End(RoutineStep.End, NullFun, _delay_1s);
  32. }
  33. else
  34. Runner.End(RoutineStep.End, NullFun, _delay_1s);
  35. return Runner.Status;
  36. }
  37. public override void Abort()
  38. {
  39. }
  40. public bool Home()
  41. {
  42. Notify($"Run {_chamber.Name} home");
  43. _chamber.Home();
  44. return true;
  45. }
  46. }
  47. }