using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using Venus_RT.Devices; using MECF.Framework.Common.Routine; using Venus_Core; namespace Venus_RT.Modules.PMs { class StartTurboPumpRoutine : PMRoutineBase, IRoutine { private enum TurboPumpStep { kStart, kEnd, } private readonly int FORELINE_PRESSURE_THRESHOLD = 500; private readonly int START_TURBO_PUMP_TIMEOUT = 30000; public StartTurboPumpRoutine(JetPMBase chamber) : base(chamber) { Name = "Start TurboPump"; } public RState Start(params object[] objs) { if (_chamber.IsTurboPumpRunning) { Stop("Turbo Pump 已经运行"); return RState.Failed; } if(!_chamber.IsPumpRunning) { Stop("干泵没有启动, 请先启动干泵"); return RState.Failed; } if(_chamber.ForelinePressure >= FORELINE_PRESSURE_THRESHOLD) { Stop($"Foreline:{_chamber.ForelinePressure} 压力太高, 不能启动 Turbo Pump"); return RState.Failed; } Reset(); _chamber.OpenValve(ValveType.FastPump, false); if (_chamber.ChamberType != JetChamber.VenusDE) { _chamber.OpenValve(ValveType.SoftPump, false); } _chamber.TurnTurboPump(true); return Runner.Start(Module, Name); } public RState Monitor() { Runner.Wait(TurboPumpStep.kStart, () => { return _chamber.IsTurboPumpRunning; }, START_TURBO_PUMP_TIMEOUT) .End(TurboPumpStep.kEnd, NullFun, _delay_50ms); return Runner.Status; } public void Abort() { _chamber.CloseValves(); _chamber.TurnTurboPump(false); } } }