VCEHomeRoutine.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. VCEServerUp,
  18. VCEHOME,
  19. VCEGotoLP
  20. }
  21. VCEModuleBase _vce;
  22. //2024-06-05 09:12:23 支伟星 执行home动作后下降到LP位置 原因vent空间的压缩
  23. public VCEHomeRoutine(ModuleName module, VCEModuleBase vce) : base(module)
  24. {
  25. _vce = vce;
  26. }
  27. public RState Start(params object[] objs)
  28. {
  29. Reset();
  30. return Runner.Start(Module, "Vce Load Routine");
  31. }
  32. public RState Monitor()
  33. {
  34. Runner.Run(homestep.VCEServerUp, ServerUp, VceIsIdle)
  35. .Run(homestep.VCEHOME, HomeAll, VceIsIdle)
  36. .End(homestep.VCEGotoLP, GotoLP, VceIsIdle);
  37. return Runner.Status;
  38. }
  39. public bool ServerUp()
  40. {
  41. return _vce.ServerUp();
  42. }
  43. public bool HomeAll()
  44. {
  45. return _vce.HomeALL();
  46. }
  47. public bool GotoLP()
  48. {
  49. return _vce.GotoLP();
  50. }
  51. public bool VceIsIdle()
  52. {
  53. if (_vce.Status == RState.Timeout || _vce.Status == RState.Failed)
  54. {
  55. Singleton<RouteManager>.Instance.GetVCE(Module).PostMsg(VceMSG.Error);
  56. return false;
  57. }
  58. return _vce.Status == RState.End;
  59. }
  60. public void Abort()
  61. {
  62. }
  63. }
  64. }