12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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<double>($"{Module}.Purge.PurgeCycleCount");
- _purgeVentPressure = (int)SC.GetValue<double>($"{Module}.Purge.PurgeVentPressure");
- _purgePumpPressure = (int)SC.GetValue<double>($"{Module}.Purge.PurgePumpPressure");
- _purgeVentTimeLimit = (int)SC.GetValue<double>($"{Module}.Purge.PurgeVentTimeLimit");
- _purgePumpTimeLimit = (int)SC.GetValue<double>($"{Module}.Purge.PurgePumpTimeLimit");
- _purgeVentStableTime = (int)SC.GetValue<double>($"{Module}.Purge.PurgeVentStableTime");
- _purgePumpStableTime = (int)SC.GetValue<double>($"{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, false), _purgePumpTimeLimit * 1000)
- .End(RoutineStep.End, EndFunc, _delay_0s);
- return Runner.Status;
- }
- public override void Abort()
- {
- _chamber.CloseValves();
- }
- }
- }
|