123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using System;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
- namespace JetEfemLib.LPs
- {
- class LoadPortDockRoutine : ModuleRoutineBase, IStepRoutine
- {
- enum RoutineStep
- {
- Dock,
- QueryStatus,
- End,
- }
- private int _timeout = 0;
- private LoadPortModule _lpModule;
- public LoadPortDockRoutine(LoadPortModule lpModule) : base(lpModule.Module)
- {
- _lpModule = lpModule;
- Name = "Dock";
- }
- public bool Initalize()
- {
- return true;
- }
-
- public RState Start(params object[] objs)
- {
- Reset();
- _timeout = SC.GetValue<int>("EFEM.LoadPort.MotionTimeout");
- return Runner.Start(_lpModule.Module, Name);
- }
- public RState Monitor()
- {
- Runner.Run(RoutineStep.Dock, Dock, CheckDevice, _timeout * 1000)
- .End(RoutineStep.QueryStatus, QueryStatus, CheckDevice, _timeout * 1000);
- return Runner.Status;
- }
- bool Dock()
- {
- string reason;
- if (!_lpModule.LPDevice.Dock(out reason))
- {
- Stop(reason);
- return false;
- }
- return true;
- }
- bool CheckDevice()
- {
- return !(_lpModule.LPDevice.Error || _lpModule.LPDevice.IsBusy);
- }
- bool QueryStatus()
- {
- string reason;
- if (!_lpModule.LPDevice.QueryState(out reason))
- {
- Stop(reason);
- return false;
- }
- return true;
- }
- public void Abort()
- {
-
- }
-
- }
- }
|