123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using JetEfemLib.Aligners;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners;
- namespace JetEfemLib.Buffers
- {
- class BufferHomeRoutine : ModuleRoutineBase, IStepRoutine
- {
- enum RoutineStep
- {
- ClearError,
- Home,
- QueryStatus,
- End,
- }
- private int _timeout = 0;
- FutureBuffer _buffer = null;
- public BufferHomeRoutine(ModuleName module) : base(module.ToString())
- {
- Name = "Home";
-
- }
- public bool Initalize()
- {
- return true;
- }
-
- public RState Start(params object[] objs)
- {
- Reset();
- _timeout = SC.GetValue<int>("EFEM.Aligner.HomeTimeout");
- _buffer = DEVICE.GetDevice<FutureBuffer>($"{Module}");
- return Runner.Start(Module, Name);
- }
- public RState Monitor()
- {
- Runner.Run(RoutineStep.Home, Home, NullFun, _timeout * 1000)
- .End(RoutineStep.End, NullFun, _delay_50ms);
- return Runner.Status;
- }
- bool Home()
- {
- string reason;
- Notify($"Start home {_buffer.Name}");
- if (!_buffer.Home(out reason))
- {
- Stop(reason);
- return false;
- }
- return true;
- }
- public void Abort()
- {
-
- }
-
- }
- }
|