123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using JetVirgoPM.Devices;
- using MECF.Framework.Common.Routine;
- namespace JetVirgoPM.PMs.Routines
- {
- class StartPumpRoutine : PMRoutineBase, IStepRoutine
- {
- private enum StartPumpSequence
- {
- kCheckForelinePressure,
- kCloseSoftPumpValve,
- kFastPumpValve,
- kCloseValves,
- kEnd
- }
- private double _chamberForelinePressureThreshold;
- private int _chamberForelinePressureTimeout;
- public StartPumpRoutine(JetDualPM chamber) : base(chamber)
- {
- Name = "LaunchPump";
- bUINotify = true;
- }
- public void Terminate()
- {
- }
- public RState Start(params object[] objs)
- {
- try
- {
- if (_chamber.IsPumpRunning)
- {
- Stop("泵已经运行");
- return RState.Failed;
- }
- Reset();
- _chamberForelinePressureThreshold = SC.GetValue<double>($"{Module}.DryPump.ChamberForelinePressureThreshold");
- _chamberForelinePressureTimeout = SC.GetValue<int>($"{Module}.DryPump.ChamberForelinePressureTimeout");
- _chamber.StartPump(true);
- _chamber.OpenValve(ValveType.FAST_PUMP, false);
- _chamber.OpenValve(ValveType.SOFT_PUMP, false);
- EV.PostInfoLog(Module, $"will start pump in {_chamberForelinePressureTimeout}s");
- return Runner.Start(_chamber.Module.ToString(), Name);
- }
- catch
- {
- return RState.Failed;
- }
- }
- public RState Monitor()
- {
- Runner.Run(StartPumpSequence.kCheckForelinePressure, HOFs.Apply(Foreline, (uint)_chamberForelinePressureThreshold), HOFs.Apply(CheckForeline, (uint)_chamberForelinePressureThreshold), _chamberForelinePressureTimeout * 1000)
- .End(StartPumpSequence.kEnd, EndFunc, _delay_0s);
- return Runner.Status;
- }
- public override void Abort()
- {
- _chamber.CloseValves();
- _chamber.StartPump(false);
- }
- }
- }
|