Browse Source

Clean Recipe functions, include IdleClean/PreJobClean/WTWJobClean/PostJobClean.

sangwq 1 year ago
parent
commit
b4c441532d

+ 2 - 0
Venus/Framework/Common/Jobs/ControlJob.cs

@@ -19,6 +19,8 @@ namespace MECF.Framework.Common.Jobs
 
         public EnumControlJobState State { get; set; }
 
+        public EnumJetCtrlJobState JetState { get; set; }
+
         public string LotName { get; set; }
         public Guid LotInnerId { get; set; }
         public List<WaferInfo> LotWafers { get; set; }

+ 19 - 0
Venus/Framework/Common/Jobs/EnumControlJobState.cs

@@ -21,4 +21,23 @@ namespace MECF.Framework.Common.Jobs
 
         Completed,
     }
+
+    // keep EnumControlJobState for compatibility with E94, and
+    // define EnumJetCtrlJobState for enchance constrol job dispatch algorithm
+    public enum EnumJetCtrlJobState
+    {
+        Created,
+
+        Quequed,
+
+        PreJobClean,
+
+        Processing,
+
+        PostJobClean,
+
+        Paused,
+
+        Completed,
+    }
 }

+ 7 - 1
Venus/Framework/Common/Jobs/SequenceInfo.cs

@@ -80,7 +80,8 @@ namespace MECF.Framework.Common.Jobs
         public static SequenceInfo GetInfo(string seqFile)
         {
             SequenceInfo info = new SequenceInfo(seqFile);
- 
+            info.PMs = new List<ModuleName>();
+
             string content = RecipeFileManager.Instance.GetSequenceAndTryAppendLL(seqFile, false);
             if (!string.IsNullOrEmpty(content))
             {
@@ -129,6 +130,11 @@ namespace MECF.Framework.Common.Jobs
                                     if (po.IsEmpty())
                                         continue;
 
+                                    if(attr.Name == "PMSelection")
+                                    {
+                                        info.PMs.Add(ModuleHelper.Converter(po));
+                                    }
+
                                     if (po == "Cooling" )
                                     { 
                                         stepInfo.StepModules.AddIfNotContains(ModuleName.Cooling1);

+ 1 - 1
Venus/Venus_Core/RtState.cs

@@ -77,7 +77,7 @@ namespace Venus_Core
         LiftpinMoving,
         LiftpinWaiting,
         GuidePinMoving,
-        PreClean,
+        Clean,
         LoadProcessRecipe,
         PreProcess,
         Processing,

File diff suppressed because it is too large
+ 497 - 274
Venus/Venus_RT/Modules/AutoCycle.cs


+ 5 - 42
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -490,6 +490,11 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.Processing,      FSM_MSG.TIMER,      FnProcessTimeout,           PMState.Idle);
             Transition(PMState.Processing,      MSG.Abort,          FnAbortProcess,             PMState.Idle);
 
+            // Process
+            Transition(PMState.Idle,            MSG.Clean,          FnRunRecipe,                PMState.Clean);
+            Transition(PMState.Clean,           FSM_MSG.TIMER,      FnProcessTimeout,           PMState.Idle);
+            Transition(PMState.Clean,           MSG.Abort,          FnAbortProcess,             PMState.Idle);
+
             // Gas Flow sequence
             Transition(PMState.Idle,            MSG.GasFlow,        FnStartGasFlow,             PMState.GasFlowing);
             Transition(PMState.GasFlowing,      MSG.GasFlow,        FnAbortGasFlow,             PMState.Idle);
@@ -538,48 +543,6 @@ namespace Venus_RT.Modules.PMs
             // Swap Wafer With PM
             Transition(PMState.DropDownReady,   MSG.PreparePlace,   FnStartSwapPlace,       PMState.PreparePlace);
 
-            #region
-            //Transition(PMState.Idle, MSG.PartialPressure, (a) => 
-            //{
-            //    return _pmPartialPressureRoutine.Start(a) == RState.Running;
-            //}, PMState.PartialPressureTesting);
-            //Transition(PMState.PartialPressureTesting, FSM_MSG.TIMER, (a) => 
-            //{
-            //    RState ret = _pmPartialPressureRoutine.Monitor();
-            //    if (ret == RState.Failed || ret == RState.Timeout)
-            //    {
-            //        PostMsg(MSG.Error);
-            //        return false;
-            //    }
-            //    return ret == RState.End;
-            //}, PMState.Idle);
-            //Transition(PMState.PartialPressureTesting, MSG.Abort, (a) => 
-            //{
-            //    _pmPartialPressureRoutine.Abort();
-            //    return true;
-            //}, PMState.Idle);
-
-            //Transition(PMState.Idle, MSG.VATPerformance, (a) =>
-            //{
-            //    return _pmVATPerformanceRoutine.Start(a) == RState.Running;
-            //}, PMState.VATPerformanceTesting);
-            //Transition(PMState.VATPerformanceTesting, FSM_MSG.TIMER, (a) =>
-            //{
-            //    RState ret = _pmVATPerformanceRoutine.Monitor();
-            //    if (ret == RState.Failed || ret == RState.Timeout)
-            //    {
-            //        PostMsg(MSG.Error);
-            //        return false;
-            //    }
-            //    return ret == RState.End;
-            //}, PMState.Idle);
-            //Transition(PMState.VATPerformanceTesting, MSG.Abort, (a) =>
-            //{
-            //    _pmVATPerformanceRoutine.Abort();
-            //    return true;
-            //}, PMState.Idle);
-            #endregion
-
             Transition(PMState.Idle,                    MSG.PartialPressure,    FnStartPartialPressure,     PMState.PartialPressureTesting);
             Transition(PMState.PartialPressureTesting,  FSM_MSG.TIMER,          FnPartialPressureTimeout,   PMState.Idle);
             Transition(PMState.PartialPressureTesting,  MSG.Abort,              FnAbortPartialPressure,     PMState.Idle);

+ 11 - 3
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -131,13 +131,20 @@ namespace Venus_RT.Modules.PMs
 
         public RState Start(params object[] objs)
         {
-
-            if (_withWafer && WaferManager.Instance.CheckNoWafer(Module.ToString(), 0))
+            string recipeName = (string)objs[0];
+            _withWafer = (bool)objs[2];
+            if (_withWafer && WaferManager.Instance.CheckNoWafer(Module, 0))
             {
                 Stop($"can not run process, no wafer at {Module}");
                 FaEvent.FaPostAlarm(Module.ToString(), $"can not run process, no wafer at {Module}");
                 return RState.Failed;
             }
+            else if(!_withWafer && WaferManager.Instance.CheckHasWafer(Module, 0))
+            {
+                Stop($"can not run clean recipe{recipeName}, a wafer at {Module}");
+                FaEvent.FaPostAlarm(Module.ToString(), $"can not run clean recipe, a wafer at {Module}");
+                return RState.Failed;
+            }
 
             if (!_chamber.IsRFGInterlockOn)
             {
@@ -150,10 +157,11 @@ namespace Venus_RT.Modules.PMs
             {
                 return RState.Failed;
             }
+
             RecipeStartTime = DateTime.Now;
+
             // Load/Validate Recipe
             _qeRecipes.Clear();
-            string recipeName = (string)objs[0];
             currentRecipeResult = new RecipeResult();
             currentRecipeResult.RecipeName = recipeName;
 

+ 9 - 5
Venus/Venus_RT/Modules/Schedulers/SchedulerLoadPort.cs

@@ -16,19 +16,27 @@ namespace Venus_RT.Modules.Schedulers
     {
         public override bool IsAvailable
         {
-            get { return _entity.IsIdle /*&& _entity.IsOnline*/ && CheckTaskDone(); }
+            get { return _entity.IsIdle && IsLoaded && CheckTaskDone(); }
 
         }
+
         public override bool IsOnline
         {
             get { return true; }
 
         }
+
         public override bool IsError
         {
             get { return _entity.IsError; }
 
         }
+
+        public bool IsLoaded
+        {
+            get { return _entity.EfemDevice[Module].IsLoaded; }
+        }
+
         private EfemEntity _entity = null;
 
         public SchedulerLoadPort(ModuleName module) : base(module.ToString())
@@ -56,7 +64,6 @@ namespace Venus_RT.Modules.Schedulers
 
         public bool Monitor()
         {
-
             return true;
         }
 
@@ -120,8 +127,5 @@ namespace Venus_RT.Modules.Schedulers
         {
             _entity.NoteJobComplete(ModuleHelper.Converter(_module));
         }
-
     }
-
-
 }

+ 26 - 1
Venus/Venus_RT/Modules/Schedulers/SchedulerPM.cs

@@ -209,7 +209,15 @@ namespace Venus_RT.Scheduler
             }
             else
             {
-                _entityTaskToken = _entity.InvokeProcess(recipeName, wafer.WaferOrigin, withWafer);
+                if(isCleanRecipe)
+                {
+                    _entityTaskToken = _entity.InvokeClean(recipeName, "", false);
+                }
+                else
+                {
+                    _entityTaskToken = _entity.InvokeProcess(recipeName,  wafer.WaferOrigin, true);
+                }
+                
                 return _entityTaskToken != (int)FSM_MSG.NONE;
 
             }
@@ -422,6 +430,23 @@ namespace Venus_RT.Scheduler
             return false;
         }
 
+        public bool RunJobCleanTask(string jobCleanRecipe)
+        {
+            // validate the job clean recipe name
+            string recipeContent = RecipeFileManager.Instance.LoadRecipe(Module.ToString(), jobCleanRecipe, false);
+            if(recipeContent.Length == 0)
+            {
+                return false;
+            }
+
+            Recipe recipe = Recipe.Load(recipeContent);
+            if (recipe == null)
+            {
+                return false;
+            }
+
+            return Process(jobCleanRecipe, true, false, null);
+        }
 
         #endregion