| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 | 
							- using System;
 
- using System.IO;
 
- using System.Windows.Input;
 
- using Aitex.Core.Common;
 
- 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 PunkHPX8_Core;
 
- using MECF.Framework.Common.SubstrateTrackings;
 
- namespace PunkHPX8_RT.Modules.LPs
 
- {
 
-     class LoadPortLoadRoutine : ModuleRoutineBase, IRoutine
 
-     {
 
-         enum RoutineStep
 
-         {
 
-             WaitEFEMIdle,
 
-             GetWaferSize,
 
-             CheckWaferSize,
 
-             ReWaitEFEMIdle,
 
-             Load,
 
-             ContinueWaitEFEMIdle,
 
-             Map,
 
-             LastWaitEFEMIdle,
 
-             End,
 
-         }
 
-         private int _timeout = 0;
 
-  
 
-         private LoadPortModule _lpModule;
 
-         public LoadPortLoadRoutine(LoadPortModule lpModule) : base(ModuleHelper.Converter(lpModule.Module))
 
-         {
 
-             _lpModule = lpModule;
 
-             Name = "Load";
 
-         }
 
-  
 
-         public RState Start(params object[] objs)
 
-         {
 
-             Reset();
 
-             _timeout = SC.GetValue<int>("EFEM.LoadPort.MotionTimeout");
 
-             if (!_lpModule.LPDevice.HasCassette  )
 
-             {
 
-                 LOG.Write(eEvent.WARN_EFEM_COMMON_WARN, Module, $"{Module} not found carrier, can not load");
 
-                 return RState.Failed;
 
-             }
 
-             Notify($"Start");
 
-             return Runner.Start(Module, Name);
 
-         }
 
-         public RState Monitor()
 
-         {
 
-             Runner.Wait(RoutineStep.WaitEFEMIdle, () => _lpModule.IsRobotIdle)
 
-                 .Run(RoutineStep.GetWaferSize, GetWaferSize, CheckDevice, _timeout * 1000)
 
-                 .Run(RoutineStep.CheckWaferSize, CheckWaferSize, _delay_1ms)
 
-                 .Wait(RoutineStep.ReWaitEFEMIdle, () => _lpModule.IsRobotIdle)
 
-                 .Run(RoutineStep.Load, Load, CheckDevice, _timeout * 1000)
 
-                 .Wait(RoutineStep.ContinueWaitEFEMIdle, () => _lpModule.IsRobotIdle&&WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot,0))
 
-                 .Run(RoutineStep.Map,Map,CheckDevice, _timeout * 1000)
 
-                 .Wait(RoutineStep.LastWaitEFEMIdle, () => _lpModule.IsRobotIdle)
 
-                 .End(RoutineStep.End, NullFun,_delay_1s);
 
-             return Runner.Status;
 
-         }
 
-         public bool Load()
 
-         {
 
-             Notify($"Start Load {_lpModule.Name}");
 
-             return _lpModule.LPDevice.Load();
 
-         }
 
-         public bool GetWaferSize()
 
-         {
 
-             Notify($"Start Get {_lpModule.Name} Wafer Size");
 
-             return _lpModule.LPDevice.GetWaferSize();
 
-         }
 
-         public bool CheckWaferSize()
 
-         {
 
-             Notify($"Start Check {_lpModule.Name} Wafer Size");
 
-             bool restult = (int)_lpModule.LPDevice.WaferSize == SC.GetValue<int>("System.WaferSize");
 
-             if (!restult)
 
-             {
 
-                 LOG.Write(eEvent.ERR_DEVICE_INFO,Module,$"Current WaferSize is {(int)_lpModule.LPDevice.WaferSize}, The Configuration is {SC.GetValue<int>("System.WaferSize")}");
 
-             }
 
-             return restult;
 
-         }
 
-         public bool Map()
 
-         {
 
-             Notify($"Start Map {_lpModule.Name}");
 
-             _lpModule.LPDevice.Map();
 
-             return true;
 
-         }
 
-         bool CheckDevice()
 
-         {
 
-             if (_lpModule.LPDevice.IsError)
 
-                 return false;
 
-             if (_lpModule.LPDevice.IsBusy)
 
-                 return false;
 
-             return true;
 
-         }
 
-         public void Abort()
 
-         {
 
-             
 
-         }
 
-  
 
-     }
 
- }
 
 
  |