1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- 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 AlignerHomeRoutine : ModuleRoutineBase, IStepRoutine
- {
- enum RoutineStep
- {
- ClearError,
- Home,
- QueryStatus,
- End,
- }
- private int _timeout = 0;
- AlignerBase _aligner = null;
- public AlignerHomeRoutine(AlignerModuleBase module) : base(module.Module)
- {
- Name = "Home";
- }
- public bool Initalize()
- {
- return true;
- }
- public RState Start(params object[] objs)
- {
- Reset();
- _aligner = DEVICE.GetDevice<AlignerBase>($"{Module}.{Module}");
-
- _timeout = SC.GetValue<int>("EFEM.Aligner.HomeTimeout");
- if (_aligner.Name == "Cooling1" || _aligner.Name == "Cooling2")
- {
- _timeout = SC.GetValue<int>("EFEM.Cooling.HomeTimeout");
- }
- return Runner.Start(_aligner.Module, Name);
- }
- public RState Monitor()
- {
- Runner.Run(RoutineStep.Home, Home, CheckHome, _timeout * 1000)
- .End(RoutineStep.End, NullFun, _delay_50ms);
- return Runner.Status;
- }
- bool Home()
- {
- string reason;
- Notify($"Start home {_aligner.Name}");
- if (!_aligner.Home(out reason))
- {
- Stop(reason);
- return false;
- }
- return true;
- }
- bool CheckHome()
- {
- return !(_aligner.IsError || _aligner.IsBusy);
- }
- public void Abort()
- {
- }
- }
- }
|