using System.Diagnostics; using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using MECF.Framework.Common.Equipment; using SicModules.Aligners.Routines.Base; namespace SicModules.Aligners.Routines { public class AlignerAlignRoutine :AlignerBaseRoutine { enum RoutineStep { CheckWafer, OpenVacuum, MoveToMeasure, Aligner, CloseVacuum, TimeDelay1, } private Stopwatch _swTimer = new Stopwatch(); private int _alignerTimeOut = 60; public AlignerAlignRoutine() { Module = ModuleName.Aligner.ToString(); Name = "Align"; } public override Result Start(params object[] objs) { Reset(); _swTimer.Restart(); _alignerTimeOut= SC.GetValue("HiWinAligner.AlignerTimeout"); Notify("Start"); return Result.RUN; } public override Result Monitor() { try { // 如果在模拟器模式,并且不允许连接到模拟器,则使用延时模拟寻边过程。 if (SC.GetValue($"System.IsSimulatorMode") && SC.GetValue("HiWinAligner.UseDelayToSimulate")) { TimeDelay((int)RoutineStep.TimeDelay1, 3); return Result.DONE; } CheckHaveWafer((int)RoutineStep.CheckWafer, 10); AlignerMove((int)RoutineStep.Aligner, _alignerTimeOut); } catch (RoutineBreakException) { return Result.RUN; } catch (RoutineFaildException) { return Result.FAIL; } Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s"); return Result.DONE; } } }