|
@@ -1,12 +1,189 @@
|
|
|
-using System;
|
|
|
+using Aitex.Core.RT.Routine;
|
|
|
+using Aitex.Core.RT.SCCore;
|
|
|
+using Aitex.Sorter.Common;
|
|
|
+using Venus_RT.Devices;
|
|
|
+using MECF.Framework.Common.Routine;
|
|
|
+using MECF.Framework.Common.Equipment;
|
|
|
+using MECF.Framework.Common.SubstrateTrackings;
|
|
|
+using Venus_Core;
|
|
|
+using Aitex.Core.RT.Log;
|
|
|
+using Aitex.Core.Util;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
+using Venus_RT.Modules.Schedulers;
|
|
|
+using Venus_RT.Scheduler;
|
|
|
+using System;
|
|
|
+using MECF.Framework.Common.Schedulers;
|
|
|
+using Aitex.Core.RT.Fsm;
|
|
|
|
|
|
namespace Venus_RT.Modules
|
|
|
{
|
|
|
- class AutoCycle
|
|
|
+ enum ModulePriority
|
|
|
{
|
|
|
+ High,
|
|
|
+ Middle,
|
|
|
+ Low,
|
|
|
+ Stop,
|
|
|
+ }
|
|
|
+ class ModuleFlag
|
|
|
+ {
|
|
|
+ public ModulePriority priority;
|
|
|
+
|
|
|
+ public ModuleFlag(ModulePriority _priority)
|
|
|
+ {
|
|
|
+ priority = _priority;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ class AutoCycle : IRoutine
|
|
|
+ {
|
|
|
+ private RState _cycleState = RState.Init;
|
|
|
+
|
|
|
+ Dictionary<ModuleName, SchedulerModule> _atmSchedulers = new Dictionary<ModuleName, SchedulerModule>();
|
|
|
+ Dictionary<ModuleName, ModuleFlag> _atmModules = new Dictionary<ModuleName, ModuleFlag>();
|
|
|
+
|
|
|
+ Dictionary<ModuleName, SchedulerModule> _vacSchedulers = new Dictionary<ModuleName, SchedulerModule>();
|
|
|
+ Dictionary<ModuleName, ModuleFlag> _vacModules = new Dictionary<ModuleName, ModuleFlag>();
|
|
|
+
|
|
|
+ public AutoCycle()
|
|
|
+ {
|
|
|
+ InitModules();
|
|
|
+ }
|
|
|
+
|
|
|
+ public RState Start(params object[] objs)
|
|
|
+ {
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ public RState Monitor()
|
|
|
+ {
|
|
|
+ prelude();
|
|
|
+ driveAtmSystem();
|
|
|
+ driveVacSystem();
|
|
|
+ epilogue();
|
|
|
+ return _cycleState;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void Abort()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ private void InitModules()
|
|
|
+ {
|
|
|
+ foreach(var module in new ModuleName[]{ ModuleName.LP1, ModuleName.LP2, ModuleName.LP3,
|
|
|
+ ModuleName.Aligner1, ModuleName.Aligner2, ModuleName.Cooling1, ModuleName.Cooling2})
|
|
|
+ {
|
|
|
+ if(ModuleHelper.IsInstalled(module))
|
|
|
+ {
|
|
|
+ if(ModuleHelper.IsLoadPort(module))
|
|
|
+ {
|
|
|
+ _atmSchedulers[module] = new SchedulerLoadPort(module);
|
|
|
+ _atmModules[module] = new ModuleFlag(ModulePriority.Middle);
|
|
|
+ }
|
|
|
+ else if(ModuleHelper.IsAligner(module) || ModuleHelper.IsCooling(module))
|
|
|
+ {
|
|
|
+ _atmSchedulers[module] = new SchedulerAligner(module);
|
|
|
+ _atmModules[module] = new ModuleFlag(ModulePriority.Middle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var module in new ModuleName[] { ModuleName.PMA, ModuleName.PMB, ModuleName.PMC,
|
|
|
+ ModuleName.PMD, ModuleName.PME, ModuleName.PMF})
|
|
|
+ {
|
|
|
+ if (ModuleHelper.IsInstalled(module))
|
|
|
+ {
|
|
|
+ _vacSchedulers[module] = new SchedulerPM(module);
|
|
|
+ _vacModules[module] = new ModuleFlag(ModulePriority.Middle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var module in new ModuleName[] { ModuleName.LLA, ModuleName.LLB })
|
|
|
+ {
|
|
|
+ if (ModuleHelper.IsInstalled(module))
|
|
|
+ {
|
|
|
+ var llScheduler = new SchedulerLoadLock(module);
|
|
|
+ _vacSchedulers[module] = llScheduler;
|
|
|
+ _vacModules[module] = new ModuleFlag(ModulePriority.Middle);
|
|
|
+
|
|
|
+ _atmSchedulers[module] = llScheduler;
|
|
|
+ _atmModules[module] = new ModuleFlag(ModulePriority.Middle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void prelude()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ private void epilogue()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ private void driveVacSystem()
|
|
|
+ {
|
|
|
+ PumpingTMRobotTask();
|
|
|
+ ProcessTMRobotTask();
|
|
|
+ }
|
|
|
+
|
|
|
+ #region Vacuum System
|
|
|
+ private void PumpingTMRobotTask()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ProcessTMRobotTask()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private Hand GetTMRobotFreeHand()
|
|
|
+ {
|
|
|
+ var blade1HasWafer = WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, 0);
|
|
|
+ var blade2HasWafer = WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, 1);
|
|
|
+ if (blade1HasWafer && blade2HasWafer)
|
|
|
+ return Hand.None;
|
|
|
+ else if (!blade1HasWafer && !blade2HasWafer)
|
|
|
+ return Hand.Both;
|
|
|
+ else if (blade1HasWafer)
|
|
|
+ return Hand.Blade2;
|
|
|
+ else
|
|
|
+ return Hand.Blade1;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion Vacuum System
|
|
|
+
|
|
|
+ #region Atm System
|
|
|
+ private void driveAtmSystem()
|
|
|
+ {
|
|
|
+ PumpingEFEMRobotTask();
|
|
|
+ ProcessEFEMRobotTask();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void PumpingEFEMRobotTask()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ProcessEFEMRobotTask()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private Hand GetEFEMRobotFreeHand()
|
|
|
+ {
|
|
|
+ var blade1HasWafer = WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0);
|
|
|
+ var blade2HasWafer = WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 1);
|
|
|
+ if (blade1HasWafer && blade2HasWafer)
|
|
|
+ return Hand.None;
|
|
|
+ else if (!blade1HasWafer && !blade2HasWafer)
|
|
|
+ return Hand.Both;
|
|
|
+ else if (blade1HasWafer)
|
|
|
+ return Hand.Blade2;
|
|
|
+ else
|
|
|
+ return Hand.Blade1;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion Atm System
|
|
|
}
|
|
|
}
|