12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- 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.Buffers
- {
- class BufferLiftRoutine : ModuleRoutineBase, IStepRoutine
- {
- enum Lift
- {
- Lift,
- End,
- }
- private int _timeout = 0;
- private bool _isUp;
- private AlignerBase _aligner;
- public BufferLiftRoutine(AlignerModuleBase module) : base(module.ToString())
- {
- Name = "Lift";
- _aligner = DEVICE.GetDevice<AlignerBase>($"{Module}.{Module}");
-
- }
- public bool Initalize()
- {
- return true;
- }
- public void Init(bool isUp)
- {
- _isUp = isUp;
- }
- public RState Start(params object[] objs)
- {
- Reset();
- _timeout = SC.GetValue<int>("EFEM.Aligner.LiftTimeout");
- Notify($"Start Lift to {(_isUp ? "Up" : "Down")} ");
- //AlignersState.IsAligning = true;
- return Runner.Start(Module, Name);
- }
- public RState Monitor()
- {
- Runner.Run(Lift.Lift, LiftWafer, CheckLiftWafer, _timeout * 1000)
- .End(Lift.Lift, 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");
- }
- }
- }
|