using System; using System.Collections.Generic; using Aitex.Core.RT.Event; using Aitex.Core.RT.Log; using Aitex.Core.RT.RecipeCenter; using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using JetVirgoPM.Devices; using JetVirgoPM.PMs.Routines; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.Routine; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs; using MECF.Framework.RT.ModuleLibrary.PMModules; namespace JetVirgoPM.PMs.RecipeExecutors { class PMATMProcessRoutine : PMRoutineBase { public enum Routine { SetLiftPin1, SetSlitDoor1, Delay, SetLiftPin2, SetSlitDoor2, SetLiftPinBoth, SetSlitDoorBoth, End, } //--------------------------------Constructor------------------------------------ // public PMATMProcessRoutine(JetDualPM chamber) : base(chamber) { Name = "ATM Process"; } private int ATMProcessDelayTime; public void Terminate() { } public RState Start(params object[] param) { Reset(); if (!SC.IsATMMode) { EV.PostWarningLog(Module.ToString(), $"can not run ATM process,sc config System.IsATMMode = false"); return RState.Failed; } ATMProcessDelayTime = SC.GetValue("System.ATMProcessDelayTime"); return Runner.Start(_chamber.Module.ToString(), Name); } public RState Monitor() { var hasWafer0 = WaferManager.Instance.CheckHasWafer(Module, 0); var hasWafer1 = WaferManager.Instance.CheckHasWafer(Module, 1); if (hasWafer0 && hasWafer1) { Runner.Run(Routine.SetSlitDoorBoth, HOFs.Apply(SetSlitDoor, EnumDualPM.Both, false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Both, false), _delay_5s) .Run(Routine.SetLiftPinBoth, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Both, false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Both, false), _delay_5s) .Delay(Routine.Delay, ATMProcessDelayTime * 1000) .Run(Routine.SetSlitDoor1, HOFs.Apply(SetSlitDoor, EnumDualPM.Both, true), HOFs.Apply(CheckSlitDoor, EnumDualPM.Both, true), _delay_5s) .Run(Routine.SetLiftPin1, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Both, true), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Both, true), _delay_5s) .End(Routine.End, EndFunc, _delay_0s); } else if (hasWafer0 || hasWafer1) { Runner.Run(Routine.SetSlitDoorBoth, HOFs.Apply(SetSlitDoor, EnumDualPM.Both, false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Both, false), _delay_5s) .Run(Routine.SetLiftPinBoth, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Both, false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Both, false), _delay_5s) .Delay(Routine.Delay, ATMProcessDelayTime * 1000) .Run(Routine.SetSlitDoor1, HOFs.Apply(SetSlitDoor, EnumDualPM.Left, hasWafer0 ? true : false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Left, hasWafer0 ? true : false), _delay_5s) .Run(Routine.SetLiftPin1, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Left, hasWafer0 ? true : false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Left, hasWafer0 ? true : false), _delay_5s) .Run(Routine.SetSlitDoor2, HOFs.Apply(SetSlitDoor, EnumDualPM.Right, hasWafer1 ? true:false), HOFs.Apply(CheckSlitDoor, EnumDualPM.Right, hasWafer1 ? true : false), _delay_5s) .Run(Routine.SetLiftPin2, HOFs.Apply(SetLiftPinUpDown, EnumDualPM.Right, hasWafer1 ? true : false), HOFs.Apply(ChecktLiftPinUpDown, EnumDualPM.Right, hasWafer1 ? true : false), _delay_5s) .End(Routine.End, EndFunc, _delay_0s); } return Runner.Status; } public void Exit() { } } }