1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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 AlignerAlignRoutine : ModuleRoutineBase, IStepRoutine
- {
- enum Align
- {
- Align,
- End,
- }
- private int _timeout = 0;
- private double _angle = 0.0;
- private AlignerBase _aligner;
- public AlignerAlignRoutine(AlignerModuleBase module) : base(module.Module)
- {
- Name = "Align";
- _aligner = DEVICE.GetDevice<AlignerBase>($"{Module}.{Module}");
- _angle = SC.GetValue<double>("EFEM.Aligner.DefaultNotchDegree");
- }
- public bool Initalize()
- {
- return true;
- }
- public void Init(double notch)
- {
- _angle = notch;
- }
- public RState Start(params object[] objs)
- {
- Reset();
- _timeout = SC.GetValue<int>("EFEM.Aligner.AlignTimeout");
- Notify($"Start align to {_angle} degree");
- //AlignersState.IsAligning = true;
- return Runner.Start(_aligner.Module, Name);
- }
- public RState Monitor()
- {
- Runner.Run(Align.Align, AlignWafer, CheckAlignDone, _timeout * 1000)
- .End(Align.End, NullFun, _delay_50ms);
- return Runner.Status;
- }
- bool AlignWafer()
- {
- Notify($"Start align to {_angle} degree");
- string reason;
- if (!_aligner.Align(_angle, out reason))
- {
- Stop(reason);
- return false;
- }
- return true;
- }
- bool CheckAlignDone()
- {
- return !(_aligner.IsError || _aligner.IsBusy);
- }
- public void Abort()
- {
- //AlignersState.IsAligning = false;
- Notify("Abort");
- }
- }
- }
|