Sfoglia il codice sorgente

PMProcessRoutine naming conventions & Lot id record adjustment

hecl 1 anno fa
parent
commit
db7e4fc9d5
1 ha cambiato i file con 57 aggiunte e 78 eliminazioni
  1. 57 78
      Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

+ 57 - 78
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -21,12 +21,12 @@ namespace Venus_RT.Modules.PMs
         private enum ProcessStep
         {
             PreparePressure,
-            PrepareTemperature,
-            RunProcessRecipes,
+            PrepareTemperature,                      
+            RunChuckRecipe,
+            RunProcessRecipe,
+            RunDechuckRecipe,
+            RunCleanRecipe,
             End,
-            RunCleanRecipes,
-            RunChuckRecipes,
-            RunDechuckRecipes,
         }
         public string CurrentRunningRecipe { get; set; }
         public string ProcessRecipeName { get; set; }
@@ -39,7 +39,7 @@ namespace Venus_RT.Modules.PMs
         public string WaferId { get; set; }
         public string SlotID { get; set; }
         public string LotID { get; set; }
-        public string GuidAllStep { get; set; }
+        public string RecipeId { get; set; }
 
         //public bool CurrentRecipeType { get; set; }
         //int Timeall;
@@ -69,10 +69,10 @@ namespace Venus_RT.Modules.PMs
         private Recipe ChuckRecipe;
         private Recipe DechuckRecipe;
         private Recipe CleanRecipe;
-        private bool isprocess;
-        private bool isdechuck;
-        private bool ischuck;
-        private bool isclean;
+        private bool needprocess;
+        private bool needdechuck;
+        private bool needchuck;
+        private bool needclean;
         private double ChillerTemp
         {
             get
@@ -142,10 +142,10 @@ namespace Venus_RT.Modules.PMs
         }
         public RState Start(params object[] objs)
         {
-            isprocess = false;
-            ischuck = false;
-            isclean = false;
-            isdechuck = false;
+            needprocess = false;
+            needchuck = false;
+            needclean = false;
+            needdechuck = false;
             Recipelist.Clear();
             string recipeName = (string)objs[0];
             if (objs.Length >= 2)
@@ -160,6 +160,14 @@ namespace Venus_RT.Modules.PMs
                     _withWafer = true;
                 }
             }
+            if (objs.Length >= 4)
+            {
+                LotID = objs[3].ToString();
+            }
+            else
+            {
+                LotID = "";
+            }
 
             if (_withWafer && WaferManager.Instance.CheckNoWafer(Module, 0))
             {
@@ -209,11 +217,11 @@ namespace Venus_RT.Modules.PMs
                         if (ChuckRecipe != null)
                         {
                             ChuckRecipeName = recipe.Header.ChuckRecipe;
-                            ischuck = true;
+                            needchuck = true;
                             Recipelist.Add(ChuckRecipe);
                         }
                     }
-                    isprocess = true;
+                    needprocess = true;
                     ProcessRecipeHead = recipe.Header;
                     ProcessRecipe = recipe;
                     ProcessRecipeName = recipeName;
@@ -229,7 +237,7 @@ namespace Venus_RT.Modules.PMs
                         if (DechuckRecipe != null)
                         {
                             DechuckRecipeName = recipe.Header.DechuckRecipe;
-                            isdechuck = true;
+                            needdechuck = true;
                             Recipelist.Add(DechuckRecipe);
                         }
                     }
@@ -238,19 +246,19 @@ namespace Venus_RT.Modules.PMs
                     ChuckRecipeName = recipeName;
                     ChuckRecipe = recipe;
                     Recipelist.Add(ChuckRecipe);
-                    ischuck = true;
+                    needchuck = true;
                     break;
                 case RecipeType.DeChuck:
                     DechuckRecipeName = recipeName;
                     Recipelist.Add(DechuckRecipe);
                     DechuckRecipe = recipe;
-                    isdechuck = true;
+                    needdechuck = true;
                     break;
                 case RecipeType.Clean:
                     CleanRecipe = recipe;
                     CleanRecipeName = recipeName;
                     Recipelist.Add(CleanRecipe);
-                    isclean = true;
+                    needclean = true;
                     break;
             }
             foreach (Recipe rcp in Recipelist)
@@ -280,11 +288,11 @@ namespace Venus_RT.Modules.PMs
         {
             Runner
                   .Run(ProcessStep.PreparePressure, PreparePressure, IsPressureReady)
-                  .Run(ProcessStep.PrepareTemperature, PrepareTemp, IsTempReady)
-                  .RunIf(ProcessStep.RunCleanRecipes, isclean, StartNewCleanRecipe, RunRecipes, 5 * 60 * 60 * 1000)
-                  .RunIf(ProcessStep.RunChuckRecipes, ischuck, StartNewChuckRecipe, RunRecipes, 5 * 60 * 60 * 1000)
-                  .RunIf(ProcessStep.RunProcessRecipes, isprocess, StartNewProcessRecipe, RunRecipes, 5 * 60 * 60 * 1000)
-                  .RunIf(ProcessStep.RunDechuckRecipes, isdechuck, StartNewDechuckRecipe, RunRecipes, 5 * 60 * 60 * 1000)
+                  .Run(ProcessStep.PrepareTemperature, PrepareTemp, IsTempReady)                  
+                  .RunIf(ProcessStep.RunChuckRecipe, needchuck, StartChuckRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
+                  .RunIf(ProcessStep.RunProcessRecipe, needprocess, StartProcessRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
+                  .RunIf(ProcessStep.RunDechuckRecipe, needdechuck, StartDechuckRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
+                  .RunIf(ProcessStep.RunCleanRecipe, needclean, StartCleanRecipe, CheckRecipeDone, 5 * 60 * 60 * 1000)
                   .End(ProcessStep.End, ProcessDone, _delay_1s);
 
             return Runner.Status;
@@ -351,7 +359,7 @@ namespace Venus_RT.Modules.PMs
 
         public RState StartNewStep()
         {
-            ProcessDataRecorder.StepStart(GuidAllStep, _currentRecipe.Steps[_currentStep].StepNo, $"{Module}:{_currentRecipe.Header.Name}:{_currentRecipe.Steps[_currentStep].Description}", _currentRecipe.Steps[_currentStep].Time);
+            ProcessDataRecorder.StepStart(RecipeId, _currentRecipe.Steps[_currentStep].StepNo, $"{Module}:{_currentRecipe.Header.Name}:{_currentRecipe.Steps[_currentStep].Description}", _currentRecipe.Steps[_currentStep].Time);
             _stepTime.Restart();
             var state = _currentRecipe.Steps[_currentStep].Start();
             if (state != RState.Running)
@@ -384,71 +392,39 @@ namespace Venus_RT.Modules.PMs
 
             return RState.Running;
         }
-        private bool StartNewProcessRecipe()
+        private bool startRecipe(Recipe _recipe)
         {
-            if (ProcessRecipe != null)
+            _currentRecipe = _recipe;
+            if (_currentRecipe != null)
             {
-                _currentRecipe = ProcessRecipe;
                 _currentStep = 0;
                 CurrentRunningRecipe = _currentRecipe.Header.Name;
-                GuidAllStep = Guid.NewGuid().ToString();
+                RecipeId = Guid.NewGuid().ToString();
                 RecipeStartTime = DateTime.Now;
                 Recipetime.Restart();
                 Notify($"Recipe:{CurrentRunningRecipe} start");
                 _chamber.EPDRecipeStart(CurrentRunningRecipe);
                 return StartNewStep() == RState.Running;
             }
-            return false;
+            else { return false; }
         }
-        private bool StartNewChuckRecipe()
+        private bool StartProcessRecipe()
         {
-            if (ChuckRecipe != null)
-            {
-                _currentRecipe = ChuckRecipe;
-                _currentStep = 0;
-                CurrentRunningRecipe = _currentRecipe.Header.Name;
-                GuidAllStep = Guid.NewGuid().ToString();
-                RecipeStartTime = DateTime.Now;
-                Recipetime.Restart();
-                Notify($"Recipe:{CurrentRunningRecipe} start");
-                _chamber.EPDRecipeStart(CurrentRunningRecipe);
-                return StartNewStep() == RState.Running;
-            }
-            return false;
+            return startRecipe(ProcessRecipe);
         }
-        private bool StartNewDechuckRecipe()
+        private bool StartChuckRecipe()
         {
-            if (DechuckRecipe != null)
-            {
-                _currentRecipe = DechuckRecipe;
-                _currentStep = 0;
-                CurrentRunningRecipe = _currentRecipe.Header.Name;
-                GuidAllStep = Guid.NewGuid().ToString();
-                RecipeStartTime = DateTime.Now;
-                Recipetime.Restart();
-                Notify($"Recipe:{CurrentRunningRecipe} start");
-                _chamber.EPDRecipeStart(CurrentRunningRecipe);
-                return StartNewStep() == RState.Running;
-            }
-            return false;
+            return startRecipe(ChuckRecipe);
+        }       
+        private bool StartDechuckRecipe()
+        {
+            return startRecipe(DechuckRecipe);
         }
-        private bool StartNewCleanRecipe()
+        private bool StartCleanRecipe()
         {
-            if (CleanRecipe != null)
-            {
-                _currentRecipe = CleanRecipe;
-                _currentStep = 0;
-                CurrentRunningRecipe = _currentRecipe.Header.Name;
-                GuidAllStep = Guid.NewGuid().ToString();
-                RecipeStartTime = DateTime.Now;
-                Recipetime.Restart();
-                Notify($"Recipe:{CurrentRunningRecipe} start");
-                _chamber.EPDRecipeStart(CurrentRunningRecipe);
-                return StartNewStep() == RState.Running;
-            }
-            return false;
+            return startRecipe(CleanRecipe);
         }
-        private bool RunRecipes()
+        private bool CheckRecipeDone()
         {
             var step = _currentRecipe.Steps[_currentStep];
             currentRecipeResult.RecipeStepCount = _currentRecipe.Steps.Count;
@@ -531,18 +507,18 @@ namespace Venus_RT.Modules.PMs
             {
                 WaferId = waferInfo.InnerId.ToString();
                 SlotID = waferInfo.OriginSlot.ToString();
-                LotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
+                //LotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
             }
             RecipeEndTime = RecipeStartTime + Recipetime.Elapsed;
             switch (_currentRecipe.Header.Type)
             {
                 case RecipeType.Clean:
-                    ProcessDataRecorder.RecordPrecess(GuidAllStep, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, "", _chamber.Name, "", "", _currentRecipe.Header.Type.ToString());
+                    ProcessDataRecorder.RecordPrecess(RecipeId, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, "", _chamber.Name, "", "", _currentRecipe.Header.Type.ToString());
                     break;
                 case RecipeType.Chuck:
                 case RecipeType.DeChuck:
                 case RecipeType.Process:
-                    ProcessDataRecorder.RecordPrecess(GuidAllStep, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, WaferId, _chamber.Name, LotID, SlotID, _currentRecipe.Header.Type.ToString());
+                    ProcessDataRecorder.RecordPrecess(RecipeId, RecipeStartTime, RecipeEndTime, _currentRecipe.Header.Name, result, WaferId, _chamber.Name, LotID, SlotID, _currentRecipe.Header.Type.ToString());
                     break;
             }
         }
@@ -597,7 +573,10 @@ namespace Venus_RT.Modules.PMs
 
         public async void Abort()
         {
-            RecipeDone("Abort");
+            if (_currentRecipe!=null) 
+            {
+                RecipeDone("Abort");
+            }            
             _chamber.GeneratorBiasPowerOn(false);
             _chamber.GeneratorPowerOn(false);
             _chamber.TurnPendulumValve(false);