| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | 
							- 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.Common.Equipment;
 
- using PunkHPX8_Core;
 
- namespace PunkHPX8_RT.Modules.LPs
 
- {
 
-     class LoadPortHomeRoutine :  ModuleRoutineBase, IRoutine
 
-     {
 
-         enum RoutineStep
 
-         {
 
-              
 
-             Home,
 
-             End,
 
-              
 
-         }
 
-         private int _timeout = 0;
 
-  
 
-         private LoadPortModule _lpModule;
 
-         public LoadPortHomeRoutine(LoadPortModule lpModule) : base(ModuleHelper.Converter( lpModule.Module))
 
-         {
 
-             _lpModule = lpModule;
 
-             Name = "Home";
 
-  
 
-         }
 
-  
 
-         public RState Start(params object[] objs)
 
-         {
 
-             Reset();
 
-             _timeout = SC.GetValue<int>("EFEM.LoadPort.HomeTimeout");
 
-             Notify($"Start");
 
-             return Runner.Start(Module, Name);
 
-         }
 
-         public RState Monitor()
 
-         {
 
-             Runner.Run(RoutineStep.Home, Home, CheckDevice, _timeout * 1000)
 
-                 .End(RoutineStep.End, NullFun, _delay_1s);
 
-             return Runner.Status;
 
-         }
 
-  
 
-         public bool Home()
 
-         {
 
-             Notify($"Start home {_lpModule.Name}");
 
-             _lpModule.LPDevice.Home();
 
-             return true;
 
-         }
 
-         bool CheckDevice()
 
-         {
 
-             if (_lpModule.LPDevice.IsError)
 
-                 return false;
 
-             if (_lpModule.LPDevice.IsBusy)
 
-                 return false;
 
-             return true;
 
-         }
 
-  
 
-         public void Abort()
 
-         {
 
-         }
 
-     }
 
- }
 
 
  |