瀏覽代碼

Align functions.

sangwq 1 年之前
父節點
當前提交
3e445737a6

+ 3 - 1
Venus/Venus_RT/Config/SequenceFormat.xml

@@ -3,7 +3,7 @@
   <TableSequenceFormat RecipeVersion="Cluster">
     <Catalog Type="Position">
       <Item Name="Position" DisplayName="Position" InputType="ReadOnlySelection" >
-        <Selection Name="Aligner" DisplayName="Aligner" Parameter="AlignerSelection" />
+        <Selection Name="Aligner" DisplayName="Aligner" Parameter="AlignerSelection,AlignAngle" />
         <Selection Name="LL" DisplayName="LL" Parameter="LLSelection" />
         <Selection Name="PM" DisplayName="PM" Parameter="PMSelection,PMARecipe,PMBRecipe,PMCRecipe,PMDRecipe" />
         <!--<Selection Name="Cooling" DisplayName="Cooling" Parameter="CoolingSelection,CoolingTime" />-->
@@ -52,6 +52,8 @@
       <Item Name="PMCRecipe" DisplayName="PMC Recipe" InputType="RecipeSelection" Parameter="PMC"    Min="0" Max="999999"  />
       <Item Name="PMDRecipe" DisplayName="PMD Recipe" InputType="RecipeSelection" Parameter="PMD"    Min="0" Max="999999"  />
 
+      <Item Name="AlignAngle" DisplayName="Align Angle" InputType="NumInput"   Min="0" Max="359"  />
+
 
 		<!--<Item Name="CoolingTime" DisplayName="Cooling Time(s)" InputType="NumInput"   Min="0" Max="360"  />-->
 

+ 67 - 1
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -45,6 +45,11 @@ namespace Venus_RT.Modules
         WaitProcess,
         StartProcess,
         Processing,
+
+        // Align Status
+        WaitAlign,
+        StartAlign,
+        Aligning,
     }
     class ModuleFlag
     {
@@ -564,6 +569,7 @@ namespace Venus_RT.Modules
         {
             CheckWaferArrived();
             ProcessPMTask();
+            ProcessAlignerTask();
 
             UpdateProcessJobStatus();
             UpdateControlJobStatus();
@@ -1302,7 +1308,7 @@ namespace Venus_RT.Modules
 
         private bool ProcessAlignerEFEMRobotTask(ModuleName aligner)
         {
-            if(WaferManager.Instance.CheckHasWafer(aligner, 0) && IsAtmWaferReadyOut(aligner, 0))
+            if(WaferManager.Instance.CheckHasWafer(aligner, 0) && IsAtmWaferReadyOut(aligner, 0) && _atmModules[aligner].MovingStatus == MovingStatus.Idle)
             {
                 var hand = GetEFEMRobotFreeHand();
                 if(hand != Hand.None)
@@ -1399,6 +1405,61 @@ namespace Venus_RT.Modules
             return Hand.None;
         }
 
+        private void ProcessAlignerTask()
+        {
+            foreach(var align in _atmModules)
+            {
+                if(ModuleHelper.IsAligner(align.Key))
+                {
+                    switch(align.Value.MovingStatus)
+                    {
+                        case MovingStatus.WaitAlign:
+                            if(_efemRobot.IsAvailable)
+                            {
+                                WaferInfo wafer = WaferManager.Instance.GetWafer(align.Key, 0);
+                                if(!wafer.IsEmpty)
+                                {
+                                    string attr = "AlignAngle";
+                                    string angle = string.Empty;
+                                    int step = wafer.NextSequenceStep;
+                                    if (!wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules.Contains(align.Key))
+                                    {
+                                        step = wafer.NextSequenceStep - 1;
+                                    }
+
+                                    if (wafer.ProcessJob.Sequence.Steps[step].StepParameter.ContainsKey(attr))
+                                    {
+                                        angle = (string)wafer.ProcessJob.Sequence.Steps[step].StepParameter[attr];
+                                        if (_efemRobot.Align(float.Parse(angle)))
+                                        {
+                                            align.Value.MovingStatus = MovingStatus.StartAlign;
+                                            return;
+                                        }
+                                    }
+                                }
+                                
+                                align.Value.MovingStatus = MovingStatus.Idle;
+                            }
+                            break;
+                        case MovingStatus.StartAlign:
+                            if(!_efemRobot.IsAvailable)
+                            {
+                                align.Value.MovingStatus = MovingStatus.Aligning;
+                            }
+                            break;
+                        case MovingStatus.Aligning:
+                            {
+                                if(_efemRobot.IsAvailable)
+                                {
+                                    align.Value.MovingStatus = MovingStatus.Idle;
+                                }
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
         #endregion Atm System
 
         #region Sequence validation
@@ -1668,6 +1729,11 @@ namespace Venus_RT.Modules
                             LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
                             // wafer arrive
                             _atmWaferTargets.Remove(tar.Key);
+
+                            if(ModuleHelper.IsAligner(tar.Key.Module))
+                            {
+                                _atmModules[tar.Key.Module].MovingStatus = MovingStatus.WaitAlign;
+                            }
                         }
                     }
                 }

+ 2 - 32
Venus/Venus_RT/Modules/EFEM/EfemEntity.cs

@@ -555,36 +555,6 @@ namespace Venus_RT.Modules
         }
         private bool fnAlign(object[] param)
         {
-            // module
-            //ModuleName unit = ModuleName.EFEM;
-
-            //if (param.Length < 2)
-            //{
-            //    return _efem.Align(unit, 180, 1000, WaferSize.WS12);
-
-            //}
-
-            //if (param[0] is string s1)
-            //    unit = ModuleNameString.ToEnum(s1);
-            //else if (param[0] is ModuleName mod)
-            //    unit = mod;
-            //else
-            //    throw new ArgumentException("Argument error");
-
-            //// wafer size
-            //WaferSize ws1 = WaferSize.WS0;
-            //if (param[1] is string s2)
-            //{
-            //    if (Enum.TryParse(s2, out WaferSize p5))
-            //        ws1 = p5;
-            //}
-            //else if (param[1] is WaferSize p6)
-            //{
-            //    ws1 = p6;
-            //}
-
-            //if (!_efem.Align(unit, 180,1000, ws1))
-            //    return false;
             return _alignRoutine.Start(param) == RState.Running;
         }
 
@@ -664,9 +634,9 @@ namespace Venus_RT.Modules
             }
         }
 
-        public int InvokeAlign(string module, float time)
+        public int InvokeAlign(string module,  int reserv,  float time)
         {
-            if (CheckToPostMessage((int)MSG.Align, module, time))
+            if (CheckToPostMessage((int)MSG.Align, module, reserv, time))
                 return (int)MSG.Align;
 
             return (int)FSM_MSG.NONE;

+ 1 - 1
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -427,7 +427,7 @@ namespace Venus_RT.Modules.PMs
                 lotID = waferInfo.ProcessJob == null || string.IsNullOrEmpty(waferInfo.ProcessJob.ControlJobName) ? "" : waferInfo.ProcessJob.ControlJobName;
                 recipename = string.Format(@"{0}/{1}/{2}", ChuckRecipeName, ProcessRecipeName, DechuckRecipeName);
             }
-            ProcessDataRecorder.RecordPrecess(waferInfo.InnerId.ToString(), RecipeStartTime, DateTime.Now, recipename,"", waferId, _chamber.Name, lotID, slotID);
+            ProcessDataRecorder.RecordPrecess(Guid.NewGuid().ToString(), RecipeStartTime, DateTime.Now, recipename,"", waferId, _chamber.Name, lotID, slotID);
             return true;
         }
 

+ 15 - 1
Venus/Venus_RT/Modules/Schedulers/SchedulerEfemRobot.cs

@@ -99,7 +99,10 @@ namespace Venus_RT.Scheduler
                 case (int)EfemEntity.MSG.Goto:
                     ret = _entity.CheckAcked(_entityTaskToken) && _entity.IsIdle;
                     break;
-                
+                case (int)EfemEntity.MSG.Align:
+                    ret = _entity.CheckAcked(_entityTaskToken) && _entity.IsIdle;
+                    break;
+
             }
 
             if (ret && _task != TaskType.None)
@@ -203,5 +206,16 @@ namespace Venus_RT.Scheduler
                 _currentScheduler.Status = RState.End;
             }
         }
+
+        public override bool Align(float angle)
+        {
+            _task = TaskType.Align;
+
+            LogTaskStart(_task, $"Aligning");
+
+            _entityTaskToken = _entity.InvokeAlign(ModuleName.Aligner1.ToString(),0, angle);
+
+            return _entityTaskToken == (int)EfemEntity.MSG.Align;
+        }
     }
 }

+ 1 - 1
Venus/Venus_Simulator/Devices/EfemSimulator.cs

@@ -74,7 +74,7 @@ namespace Venus_Simulator.Devices
             OnWriteMessage(ack);
 
             // 处理INF
-            var a = OnWork(ack);
+            OnWork(ack);
         }
 
         internal void SetCassetteDoor(bool doorOpen)