using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using JetVirgoPM.Devices; using MECF.Framework.Common.Routine; namespace JetVirgoPM.PMs.Routines { class CyclePurgeRoutine : PMRoutineBase { private enum RoutineStep { CheckRfOff, CheckPumping, CloseAllValves, Loop, Pump, PumpDelay, Vent, VentDelay, EndLoop, PumpDefault, End, }; // ----------------------------Fields-------------------------- // private int _purgeCycleCount; private int _purgeVentPressure; private int _purgePumpPressure; private int _purgeVentTimeLimit; private int _purgePumpTimeLimit; private int _purgeVentStableTime; private int _purgePumpStableTime; // --------------------------Constructor----------------------- // public CyclePurgeRoutine(JetDualPM chamber) : base(chamber) { Name = "Cycle purge"; bUINotify = true; } public RState Start(params object[] objs) { if (_chamber.IsGenerator1ON|| _chamber.IsGenerator2ON) { Stop("射频必须关闭"); return RState.Failed; } if (!_chamber.IsPumpRunning || !_chamber.IsFastPumpOpened) { Stop("泵组状态不正确"); return RState.Failed; } Reset(); _purgeCycleCount = (int)SC.GetValue($"{Module}.Purge.PurgeCycleCount"); _purgeVentPressure = (int)SC.GetValue($"{Module}.Purge.PurgeVentPressure"); _purgePumpPressure = (int)SC.GetValue($"{Module}.Purge.PurgePumpPressure"); _purgeVentTimeLimit = (int)SC.GetValue($"{Module}.Purge.PurgeVentTimeLimit"); _purgePumpTimeLimit = (int)SC.GetValue($"{Module}.Purge.PurgePumpTimeLimit"); _purgeVentStableTime = (int)SC.GetValue($"{Module}.Purge.PurgeVentStableTime"); _purgePumpStableTime = (int)SC.GetValue($"{Module}.Purge.PurgePumpStableTime"); //关闭所有阀门 _chamber.CloseValves(); return Runner.Start(_chamber.Module.ToString(), Name); } public RState Monitor() { Runner.LoopStart(RoutineStep.Pump, "腔体 Cycle Purge", _purgeCycleCount, HOFs.Apply(Pump, _purgePumpPressure), HOFs.Apply(CheckPump, _purgePumpPressure, true), _purgePumpTimeLimit * 1000) .LoopDelay(RoutineStep.PumpDelay, _purgePumpStableTime * 1000) .LoopRun(RoutineStep.Vent, HOFs.Apply(Vent, _purgeVentPressure), HOFs.Apply(CheckVent, _purgeVentPressure, true), _purgeVentTimeLimit * 1000) .LoopDelay(RoutineStep.VentDelay, _purgeVentStableTime * 1000) .LoopEnd(RoutineStep.EndLoop, NullFun, _delay_50ms) .Run(RoutineStep.PumpDefault, HOFs.Apply(Pump, _purgePumpPressure), HOFs.Apply(CheckPump, _purgePumpPressure, true), _purgePumpTimeLimit * 1000) .End(RoutineStep.End, EndFunc, _delay_0s); return Runner.Status; } public override void Abort() { _chamber.CloseValves(); } } }