| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- using System;
 
- using Aitex.Core.RT.Device;
 
- using Aitex.Core.RT.Event;
 
- using Aitex.Core.RT.Log;
 
- using Aitex.Core.RT.Routine;
 
- using Aitex.Core.RT.SCCore;
 
- using MECF.Framework.Common.Equipment;
 
- using Venus_Core;
 
- namespace Venus_RT.Modules.LPs
 
- {
 
-     class LoadPortUnloadRoutine : ModuleRoutineBase,  IRoutine
 
-     {
 
-         enum RoutineStep
 
-         {
 
-             Unload,
 
-             End,
 
-         }
 
-         private int _timeout = 0;
 
-  
 
-         private LoadPortModule _lpModule;
 
-         public LoadPortUnloadRoutine(LoadPortModule lpModule) : base(ModuleHelper.Converter(lpModule.Module))
 
-         {
 
-             _lpModule = lpModule;
 
-             Name = "Unload";
 
-  
 
-         }
 
-  
 
-         public RState Start(params object[] objs)
 
-         {
 
-             Reset();
 
-             _timeout = SC.GetValue<int>("EFEM.LoadPort.MotionTimeout");
 
-             //if (!_lp.IsPresent || !_lp.IsPlacement)
 
-             //{
 
-             //    EV.PostWarningLog(Module, $"{Module} not found carrier, can not load");
 
-             //    return Result.FAIL;
 
-             //}
 
-             Notify($"Start");
 
-             return Runner.Start(Module, Name);
 
-         }
 
-         public RState Monitor()
 
-         {
 
-             Runner.Run((int)RoutineStep.Unload, Unload, CheckDevice, _timeout * 1000)
 
-                             .End((int)RoutineStep.End, NullFun, _delay_1s);
 
-             return Runner.Status;
 
-         }
 
-         public bool Unload()
 
-         {
 
-             Notify($"Start Unload {_lpModule.Name}");
 
-             _lpModule.LPDevice.Unload();
 
-             return true;
 
-         }
 
-         bool CheckDevice()
 
-         {
 
-             if (_lpModule.LPDevice.IsError)
 
-                 return false;
 
-             if (_lpModule.LPDevice.IsBusy)
 
-                 return false;
 
-             return true;
 
-         }
 
-         public void Abort()
 
-         {
 
-             
 
-         }
 
-  
 
-     }
 
- }
 
 
  |