Sic03-8inch/Modules/Mainframe/Aligners/Routines/AlignerAlignRoutine.cs

69 lines
1.9 KiB
C#
Raw Normal View History

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,
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<int>("HiWinAligner.AlignerTimeout");
Notify("Start");
return Result.RUN;
}
public override Result Monitor()
{
try
{
// 如果在模拟器模式,并且不允许连接到模拟器,则使用延时模拟寻边过程。
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);
AlignerMove((int)RoutineStep.Aligner, _alignerTimeOut);
2023-03-03 15:42:13 +08:00
}
catch (RoutineBreakException)
{
return Result.RUN;
}
catch (RoutineFaildException)
{
return Result.FAIL;
}
Notify($"Finished ! Elapsed time: {(int)(_swTimer.ElapsedMilliseconds / 1000)} s");
return Result.DONE;
}
}
}