using System; 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 PumpDownRoutine : PMRoutineBase, IStepRoutine { private enum PumpSequence { kCheckLidSignal, kCheckSlitDoor, kCheckDryPumpStatus, kCloseValves, kOpenPumpingValve, kDelay, kCheckVAC, kCheckForelinePressure, kCheckThrottleValveStatus, kCheckATM, kOpenSoftPumpValve, kCloseSoftPumpValve, kFastPumpValve, kCloseFastPumpValve, kCheckChamberPressure, kCheckVACSignal, kEnd } private int _basePressure; private int _pumpValveDelay; private double _pumpTimeLimit; private readonly uint FORELINE_TARGET = 500; public PumpDownRoutine(JetDualPM chamber) : base(chamber) { Name = "PumpDown"; bUINotify = true; } public void Terminate() { } public RState Start(params object[] objs) { // 预检查,必须关盖子 if (CheckLid() == RState.Running && CheckSlitDoor1() == RState.Running && CheckSlitDoor2() == RState.Running) //&& CheckDryPump() == RState.Running) { Reset(); //关闭所有阀门 _chamber.CloseValves(); //_PressureTrip1 = SC.GetValue($"{Module}.Pump.PressureTrip1") * 1000; _basePressure = (objs.Length == 1) ? Convert.ToInt32(objs[0]) : SC.GetValue($"{Module}.Pump.PumpBasePressure"); _pumpTimeLimit = SC.GetValue($"{Module}.Pump.PumpTimeLimit"); _pumpValveDelay = SC.GetValue($"{Module}.Pump.PumpValveDelay"); return Runner.Start(_chamber.Module.ToString(), Name); } return RState.Failed; } public RState Monitor() { Runner.Run(PumpSequence.kCheckForelinePressure, HOFs.Apply(Foreline, FORELINE_TARGET), HOFs.Apply(CheckForeline, FORELINE_TARGET), 15*1000) .Run(PumpSequence.kOpenSoftPumpValve, HOFs.Apply(OpenValve, ValveType.SOFT_PUMP, true), HOFs.Apply(CheckValve, ValveType.SOFT_PUMP, true), _delay_1s) .Run(PumpSequence.kCheckThrottleValveStatus, FullOpenTV, CheckFullOpenTV, _delay_20s) .Delay(PumpSequence.kDelay, _pumpValveDelay * 1000) .Run(PumpSequence.kFastPumpValve, HOFs.Apply(OpenValve, ValveType.FAST_PUMP, true), HOFs.Apply(CheckValve, ValveType.FAST_PUMP, true), _delay_1s) .Run(PumpSequence.kCloseFastPumpValve, HOFs.Apply(OpenValve, ValveType.SOFT_PUMP, false), HOFs.Apply(CheckValve, ValveType.SOFT_PUMP, false), _delay_1s) .Run(PumpSequence.kCheckATM, HOFs.Apply(ATM2, false), HOFs.Apply(CheckATM2, false), _delay_30s) .Run(PumpSequence.kCheckVACSignal, NullFun, CheckVAC, 90*1000) .Run(PumpSequence.kCheckVAC, HOFs.Apply(WaitPressure, _basePressure, false), HOFs.Apply(CheckPressure, _basePressure, false), (int)_pumpTimeLimit * 1000) .End(PumpSequence.kEnd, EndFunc, _delay_0s); return Runner.Status; } public override void Abort() { _chamber.CloseValves(); } } }