using Aitex.Core.RT.Routine; using VirgoRT.Devices; namespace VirgoRT.Modules.PMs { class PMAllMfcVerificationRoutine : PMRoutineBase { enum RoutineStep { MFC1, MFC2, MFC3, MFC4 } private PumpDownRoutine _pumpdownRoutine; private string[] _normalMfc; private bool[] _isCheckMfcs; private float _normalMfcFlow; private PMMfcVerificationRoutine mfc1; private PMMfcVerificationRoutine mfc2; private PMMfcVerificationRoutine mfc3; private PMMfcVerificationRoutine mfc4; public PMAllMfcVerificationRoutine(JetPM chamber, PumpDownRoutine pumpDownRoutine) : base(chamber) { Name = "All MFC Verification"; bUINotify = true; _pumpdownRoutine = pumpDownRoutine; } internal void Init(string[] normalMfc, bool[] IsCheckMfc) { _normalMfc = normalMfc; _normalMfcFlow = 200; _isCheckMfcs = IsCheckMfc; } public Result Start(params object[] objs) { Reset(); mfc1 = null; mfc2 = null; mfc3 = null; mfc4 = null; if (_isCheckMfcs[0]) { mfc1 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine); mfc1.Init(_normalMfc[0], _normalMfcFlow, 10); } if (_isCheckMfcs[1]) { mfc2 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine); mfc2.Init(_normalMfc[1], _normalMfcFlow, 10); } if (_isCheckMfcs[2]) { mfc3 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine); mfc3.Init(_normalMfc[2], _normalMfcFlow, 10); } if (_isCheckMfcs[3]) { mfc4 = new PMMfcVerificationRoutine(_chamber, _pumpdownRoutine); mfc4.Init(_normalMfc[3], _normalMfcFlow, 10); } return Result.RUN; } public Result Monitor() { try { if (mfc1 != null) ExecuteRoutine((int)RoutineStep.MFC1, mfc1); if (mfc2 != null) ExecuteRoutine((int)RoutineStep.MFC2, mfc2); if (mfc3 != null) ExecuteRoutine((int)RoutineStep.MFC3, mfc3); if (mfc4 != null) ExecuteRoutine((int)RoutineStep.MFC4, mfc4); } catch (RoutineBreakException) { return Result.RUN; } catch (RoutineFaildException) { _chamber.StopAllGases(); _chamber.SetValveOnOff(ValveType.PROCESS, false); return Result.FAIL; } return Result.DONE; } public new void Abort() { _chamber.StopAllGases(); _chamber.SetValveOnOff(ValveType.PROCESS, false); } } }