VCEHomeRoutine.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using Aitex.Core.RT.Routine;
  2. using Aitex.Core.Util;
  3. using MECF.Framework.Common.Equipment;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Venus_Core;
  10. using Venus_RT.Devices.VCE;
  11. namespace Venus_RT.Modules.VCE
  12. {
  13. public class VCEHomeRoutine : ModuleRoutineBase, IRoutine
  14. {
  15. private enum homestep
  16. {
  17. VCEHOME,
  18. VCEGotoLP
  19. }
  20. VCEModuleBase _vce;
  21. //2024-06-05 09:12:23 支伟星 执行home动作后下降到LP位置 原因vent空间的压缩
  22. public VCEHomeRoutine(ModuleName module, VCEModuleBase vce) : base(module)
  23. {
  24. _vce = vce;
  25. }
  26. public RState Start(params object[] objs)
  27. {
  28. Reset();
  29. return Runner.Start(Module, "Vce Load Routine");
  30. }
  31. public RState Monitor()
  32. {
  33. Runner.Run(homestep.VCEHOME, HomeAll, VceIsIdle)
  34. .End(homestep.VCEGotoLP, GotoLP, VceIsIdle);
  35. return Runner.Status;
  36. }
  37. public bool HomeAll()
  38. {
  39. return _vce.HomeALL();
  40. }
  41. public bool GotoLP()
  42. {
  43. return _vce.GotoLP();
  44. }
  45. public bool VceIsIdle()
  46. {
  47. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  48. {
  49. Singleton<RouteManager>.Instance.GetVCE(Module).PostMsg(VceMSG.Error);
  50. return false;
  51. }
  52. return _vce.Status == RState.End;
  53. }
  54. public void Abort()
  55. {
  56. }
  57. }
  58. }