123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using System.Collections.Generic;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.RT.ModuleLibrary.SystemModules;
- namespace EfemDualSchedulerLib
- {
- public class HomeAll:IRoutine
- {
- List<List<IModuleDevice>> _lstModules = new List<List<IModuleDevice>>();
- List<IModuleDevice> _homingModules = new List<IModuleDevice>();
- public HomeAll()
- {
- }
- public Result Start(params object[] objs)
- {
- _lstModules.Clear();
- _lstModules.Add(new List<IModuleDevice>()
- {
- EquipmentManager.Modules[ModuleName.EFEM] as IModuleDevice,
- EquipmentManager.Modules[ModuleName.TM] as IModuleDevice,
- });
- var lstModules = new List<IModuleDevice>()
- {
- EquipmentManager.Modules[ModuleName.PMA] as IModuleDevice,
- EquipmentManager.Modules[ModuleName.PMB] as IModuleDevice,
- EquipmentManager.Modules[ModuleName.Aligner] as IModuleDevice,
- EquipmentManager.Modules[ModuleName.LP1] as IModuleDevice,
- EquipmentManager.Modules[ModuleName.LP2] as IModuleDevice,
- EquipmentManager.Modules[ModuleName.LP3] as IModuleDevice,
- };
- _lstModules.Add(lstModules);
- _homingModules.Clear();
- return Result.RUN;
- }
- public Result Monitor( )
- {
- if (_homingModules.Count == 0 && _lstModules.Count == 0)
- return Result.DONE;
- if (_homingModules.Count > 0)
- {
- foreach (var module in _homingModules)
- {
- if (module.IsError)
- return Result.FAIL;
- if (!module.IsReady)
- return Result.RUN;
- }
- _homingModules.Clear();
- if (_lstModules.Count == 0)
- return Result.DONE;
- }
- if (_homingModules.Count == 0)
- {
- foreach (var moduleEntity in _lstModules[0])
- {
- if (!moduleEntity.Home(out string reason))
- return Result.FAIL;
- _homingModules.Add(moduleEntity);
- }
- _lstModules.RemoveAt(0);
- }
- return Result.RUN;
- }
- public void Abort()
- {
- Clear();
- }
- public void Clear()
- {
- _lstModules.Clear();
- _homingModules.Clear();
- }
- }
- }
|