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> _lstModules = new List>(); List _homingModules = new List(); public HomeAll() { } public Result Start(params object[] objs) { _lstModules.Clear(); _lstModules.Add(new List() { EquipmentManager.Modules[ModuleName.EFEM] as IModuleDevice, EquipmentManager.Modules[ModuleName.TM] as IModuleDevice, }); var lstModules = new List() { 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(); } } }