2023-04-13 15:35:13 +08:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using Aitex.Core.RT.Routine;
|
2023-03-03 15:42:13 +08:00
|
|
|
|
using Aitex.Core.RT.SCCore;
|
|
|
|
|
using MECF.Framework.Common.Equipment;
|
2023-04-13 15:35:13 +08:00
|
|
|
|
using SicModules.Aligners.Routines.Base;
|
2023-03-03 15:42:13 +08:00
|
|
|
|
|
2023-04-13 15:35:13 +08:00
|
|
|
|
namespace SicModules.Aligners.Routines
|
2023-03-03 15:42:13 +08:00
|
|
|
|
{
|
|
|
|
|
public class AlignerAlignRoutine :AlignerBaseRoutine
|
|
|
|
|
{
|
|
|
|
|
enum RoutineStep
|
|
|
|
|
{
|
|
|
|
|
CheckWafer,
|
|
|
|
|
OpenVacuum,
|
|
|
|
|
MoveToMeasure,
|
2023-05-18 18:33:11 +08:00
|
|
|
|
Align,
|
2023-03-03 15:42:13 +08:00
|
|
|
|
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<int>("HiWinAligner.AlignerTimeout");
|
|
|
|
|
Notify("Start");
|
|
|
|
|
return Result.RUN;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Result Monitor()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-05-18 11:06:06 +08:00
|
|
|
|
// 如果在模拟器模式,并且不允许连接到模拟器,则使用延时模拟寻边过程。
|
|
|
|
|
if (SC.GetValue<bool>($"System.IsSimulatorMode") && SC.GetValue<bool>("HiWinAligner.UseDelayToSimulate"))
|
|
|
|
|
{
|
|
|
|
|
TimeDelay((int)RoutineStep.TimeDelay1, 3);
|
|
|
|
|
return Result.DONE;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-03 15:42:13 +08:00
|
|
|
|
CheckHaveWafer((int)RoutineStep.CheckWafer, 10);
|
|
|
|
|
|
2023-05-18 18:33:11 +08:00
|
|
|
|
MoveToMeasurementCenter((int)RoutineStep.MoveToMeasure, _alignerTimeOut);
|
|
|
|
|
|
|
|
|
|
AlignerMove((int)RoutineStep.Align, _alignerTimeOut);
|
2023-03-03 15:42:13 +08:00
|
|
|
|
}
|
|
|
|
|
catch (RoutineBreakException)
|
|
|
|
|
{
|
|
|
|
|
return Result.RUN;
|
|
|
|
|
}
|
|
|
|
|
catch (RoutineFaildException)
|
|
|
|
|
{
|
|
|
|
|
return Result.FAIL;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-18 18:33:11 +08:00
|
|
|
|
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000):F1} s");
|
2023-03-03 15:42:13 +08:00
|
|
|
|
return Result.DONE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|