using System; using Aitex.Core.RT.Device; using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using MECF.Framework.Common.Equipment; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners; using MECF.Framework.RT.ModuleLibrary.AlignerModules; namespace JetEfemLib.Aligners { class AlignerLiftRoutine : ModuleRoutineBase, IStepRoutine { enum Lift { Lift, End, } private int _timeout = 0; private bool _isUp; private AlignerBase _aligner; public AlignerLiftRoutine(AlignerModuleBase module) : base(module.Module) { Name = "Lift"; _aligner = DEVICE.GetDevice($"{Module}.{Module}"); } public bool Initalize() { return true; } public void Init(bool isUp) { _isUp = isUp; } public RState Start(params object[] objs) { Reset(); _timeout = SC.GetValueOrDefault("EFEM.Aligner.LiftTimeout"); if(_aligner.Name=="Cooling1"|| _aligner.Name == "Cooling2") { _timeout = SC.GetValue("EFEM.Cooling.LiftTimeout"); } Notify($"Start Lift to {(_isUp?"Up":"Down")} "); //AlignersState.IsAligning = true; return Runner.Start(_aligner.Module, Name); } public RState Monitor() { Runner.Run(Lift.Lift, LiftWafer, CheckLiftWafer, _timeout * 1000) .End(Lift.End, NullFun, _delay_50ms); return Runner.Status; } bool LiftWafer() { string reason; if (!_aligner.Lift(_isUp ? "UP" : "DOWN", out reason)) { Stop(reason); return false; } return true; } bool CheckLiftWafer() { return !(_aligner.IsError || _aligner.IsBusy); } public void Abort() { //AlignersState.IsAligning = false; Notify("Abort"); } } }