123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- 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,
- kOpenGasFinal,
- 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<int>($"{Module}.Pump.PressureTrip1") * 1000;
- _ventTime = (int)SC.GetValue<double>($"{Module}.VentTime");
- _checkATMTimeout = SC.GetValue<int>($"{Module}.CheckATMTimeout");
- _ventTimeDelay = SC.GetValue<int>($"{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.kOpenGasFinal, OpenGasFinal, CheckGasFinal, 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 bool OpenGasFinal()
- {
- if (_chamber.IsPlus)
- {
- return OpenValve(ValveType.PROCESS, true);
- }
- return true;
- }
- public bool CheckGasFinal()
- {
- if (_chamber.IsPlus)
- {
- return CheckValve(ValveType.PROCESS, true);
- }
- return true;
- }
-
- public override void Abort()
- {
- _chamber.CloseValves();
- }
- }
- }
|