123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- 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,
- kCheckCrossPressure,
- kCheckVAC,
- kCheckForelinePressure,
- kCheckThrottleValveStatus,
- kCheckATM,
- kOpenSoftPumpValve,
- kCloseSoftPumpValve,
- kFastPumpValve,
- kPumpDelay,
- kCloseFastPumpValve,
- kCheckChamberPressure,
- kCheckVACSignal,
- kEnd
- }
- private int _basePressure;
- private int _crossPressure;
- private int _pumpValveDelay;
- private int _overPumpDelay;
- 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<int>($"{Module}.Pump.PressureTrip1") * 1000;
- _basePressure = (objs.Length == 1) ? Convert.ToInt32(objs[0]) : SC.GetValue<int>($"{Module}.Pump.PumpBasePressure");
- _pumpTimeLimit = SC.GetValue<double>($"{Module}.Pump.PumpTimeLimit");
- _pumpValveDelay = SC.GetValue<int>($"{Module}.Pump.PumpValveDelay");
- _overPumpDelay = SC.GetValue<int>($"{Module}.Pump.OverPumpDelay") * 1000;
- _crossPressure = SC.GetValue<int>($"{Module}.Pump.CrossPressure");
- 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, OpenSoftPump, CheckSoftPumpIsOn, _delay_1s)
- .Run(PumpSequence.kCheckThrottleValveStatus, FullOpenTV, CheckFullOpenTV, _delay_20s)
- .Delay(PumpSequence.kDelay, _pumpValveDelay * 1000)
- .Wait(PumpSequence.kCheckCrossPressure, CheckCrossPressure)
- .Run(PumpSequence.kFastPumpValve, HOFs.Apply(OpenValve, ValveType.FAST_PUMP, true), HOFs.Apply(CheckValve, ValveType.FAST_PUMP, true), _delay_1s)
- .Delay(PumpSequence.kPumpDelay, _overPumpDelay)
- .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 bool CheckCrossPressure()
- {
- EV.PostInfoLog(Module,$"Pressure:{_chamber.ChamberPressure} && Cross:{_crossPressure}");
- return _chamber.ChamberPressurePressure <= _crossPressure;
- }
- public bool OpenSoftPump()
- {
- //if (!_chamber.IsVAC)
- // return OpenValve(ValveType.SOFT_PUMP, true);
- //else
- // return true;
- return OpenValve(ValveType.SOFT_PUMP, true);
- }
- public bool CheckSoftPumpIsOn()
- {
- //if (!_chamber.IsVAC)
- // return CheckValve(ValveType.SOFT_PUMP, true);
- //else
- // return true;
- return CheckValve(ValveType.SOFT_PUMP, true);
- }
- public override void Abort()
- {
- _chamber.CloseValves();
- }
- }
- }
|