using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using JetVirgoPM.Devices; using MECF.Framework.Common.Routine; namespace JetVirgoPM.PMs.Routines { class VentRoutine : PMRoutineBase, IStepRoutine { private enum VentSequence { kCloseValves, kOpenSoftVentValve, kOpenFastVentValve, kVentToPrecision, kVentDelay, kCloseVentValve, kEnd, kCheckLidSignal, kCheckSlitDoor, kCheckThrottleValveStatus, kCheckN2, kOpenProcessValve, kOpenN2Supply, kCheckChamberPressure, kCheckATM } private int _ventTime; private int _ventTimeDelay = 1; //执行Vent程序时(自动或手动Vent),先关闭PV2,延时2秒后打开PV3。 private int _checkATMTimeout = 90; public VentRoutine(JetDualPM chamber) : base(chamber) { Name = "vent"; bUINotify = true; } public RState Start(params object[] objs) { // 预检查 if (!SC.IsATMMode && _chamber.IsSlitDoor1Closed && _chamber.IsSlitDoor2Closed && _chamber.CheckAtm()) { Notify($"ATM 信号 ON,{_chamber.IsATM},此时腔体压力{_chamber.ChamberPressurePressure}"); return RState.End; } if (CheckLid() == RState.Running && CheckSlitDoor1() == RState.Running && CheckSlitDoor2() == RState.Running) { Reset(); _chamber.CloseValves(); //_PressureTrip1 = SC.GetValue($"{Module}.Pump.PressureTrip1") * 1000; _ventTime = (int)SC.GetValue($"{Module}.VentTime"); _checkATMTimeout = SC.GetValue($"{Module}.CheckATMTimeout"); _ventTimeDelay = SC.GetValue($"{Module}.VentTimeDelay"); return Runner.Start(_chamber.Module.ToString(), Name); } return RState.Failed; } public RState Monitor() { Runner.Run(VentSequence.kOpenN2Supply, HOFs.Apply(OpenValve, ValveType.N2, true), HOFs.Apply(CheckValve, ValveType.N2, true), 500) .Run(VentSequence.kOpenFastVentValve, HOFs.Apply(OpenValve, ValveType.FAST_VENT, true), HOFs.Apply(CheckValve, ValveType.FAST_VENT, true), 500) .Run(VentSequence.kCheckATM, HOFs.Apply(ATM2, true), HOFs.Apply(CheckATM2, true), _checkATMTimeout * 1000) .Delay(VentSequence.kVentDelay, _ventTimeDelay * 1000) .Wait(VentSequence.kCloseValves, CloseAllValve, _delay_50ms) .End(VentSequence.kEnd, EndFunc, _delay_0s); if (Runner.Status == RState.Failed) { _chamber.OpenValve(ValveType.FAST_VENT, false); _chamber.OpenValve(ValveType.PURGE, false); _chamber.OpenValve(ValveType.PROCESS, false); _chamber.OpenValve(ValveType.N2, false); Notify("出错"); } return Runner.Status; } public override void Abort() { _chamber.CloseValves(); } } }