Browse Source

Keep on enhance routing algorithm.

sangwq 9 months ago
parent
commit
c7ca9fa97d
2 changed files with 55 additions and 20 deletions
  1. 1 12
      Venus/Venus_RT/Modules/LLs/LLEntity.cs
  2. 54 8
      Venus/Venus_RT/Modules/SystemDispatcher.cs

+ 1 - 12
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -472,11 +472,6 @@ namespace Venus_RT.Modules
                 return false;
             }
 
-
-            if (IsATM && _coolingFlag && Singleton<RouteManager>.Instance.IsAutoRunning && _coolingTime>0)
-            {
-                PostMsg(MSG.AutoCooling);
-            }
             if(ret == RState.End)
             {           
                 MarkStateTime();
@@ -737,6 +732,7 @@ namespace Venus_RT.Modules
 
             if(_coolingStopWatch.ElapsedMilliseconds > _coolingTime)
             {
+                MarkStateTime();
                 _ventingRoutine.Abort();
                 return true;
             }
@@ -751,13 +747,6 @@ namespace Venus_RT.Modules
         }
         private bool FnTMExchange(object[] param)
         {
-            var needcooling = (bool)param[0];
-            _coolingFlag=needcooling;
-            if (needcooling)
-            { 
-                PostMsg(MSG.AutoVent);
-            }
-
             return true;
         }
         //private bool FnEFEMExchange(object[] param)

+ 54 - 8
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -2115,7 +2115,7 @@ namespace Venus_RT.Modules
                 return;
 
             var oderedPMs = onDutyPms.OrderBy(kv => kv.Value).OrderBy(kv => _dictModuleTask[kv.Key].TimeToReady);
-            if(oderedPMs.First().Value < 1)
+            if (oderedPMs.First().Value < 1)
             {
                 foreach(var runningJob in runningJobs)
                 {
@@ -2132,6 +2132,26 @@ namespace Venus_RT.Modules
                     }
                 }
             }
+
+            // keep two raw atm wafer, try match a double place to LL
+            var atmWaferCount = _lstWaferTasks.Count(wt => ModuleHelper.IsPm(wt.destMod) && (ModuleHelper.IsLoadPort(wt.currentMod) || ModuleHelper.IsAligner(wt.currentMod) || ModuleHelper.IsEFEMRobot(wt.currentMod)));
+            if (atmWaferCount < 2)
+            {
+                foreach (var runningJob in runningJobs)
+                {
+                    foreach (var wafer in runningJob.LotWafers)
+                    {
+                        if (wafer.IsEmpty || wafer.ProcessJob == null)
+                            continue;
+
+                        if (wafer.ProcessJob.Sequence.PMs.Contains(oderedPMs.First().Key) && wafer.NextSequenceStep == 0 && !_lstWaferTasks.Exists(task => task.sourceMod == (ModuleName)wafer.OriginStation && task.sourceSlot == wafer.OriginSlot))
+                        {
+                            CreateWaferTasks(wafer, oderedPMs.First().Key);
+                            return;
+                        }
+                    }
+                }
+            }
         }
 
         private void CreateWaferTasks(WaferInfo wafer, ModuleName pm)
@@ -3218,7 +3238,7 @@ namespace Venus_RT.Modules
                 {
                     foreach(var robotWafer in robotWafers)
                     {
-                        if(ModuleHelper.IsPm(robotWafer.destMod))
+                        if (ModuleHelper.IsPm(robotWafer.destMod))
                         {
                             if (_dictModuleTask[robotWafer.destMod].TimeToReady < 5)
                             {
@@ -3242,6 +3262,34 @@ namespace Venus_RT.Modules
                                     return;
                                 }
                             }
+                            else if (_dictModuleTask[robotWafer.destMod].TimeToReady > 20 && freeHands.Count > 0)
+                            {
+                                if (outLLWaferStatus.emptySlot.Count > 0 && outLLModule.ReayForTMInTime(10) && _lstWaferTasks.Count(wt => ModuleHelper.IsPm(wt.currentMod) && ModuleHelper.IsLoadPort(wt.destMod)) > 0)
+                                {
+                                    // try to return one wafer from PM to LL
+                                    var readyOutWafer = _lstWaferTasks.Find(wt => ModuleHelper.IsPm(wt.currentMod) && ModuleHelper.IsLoadPort(wt.destMod));
+                                    if (readyOutWafer != null && _dictModuleTask[readyOutWafer.currentMod].TimeToReady < 5)
+                                    {
+                                        _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(readyOutWafer.currentMod, 0, ModuleName.TMRobot, (int)freeHands[0], freeHands[0]) });
+                                        _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(ModuleName.TMRobot, (int)freeHands[0], outLL, outLLWaferStatus.emptySlot[0], freeHands[0]) });
+                                        return;
+                                    }
+                                }
+
+                                if (inLLModule.ReayForTMInTime(5) && inLLWaferStatus.inSlot.Count > 0)
+                                {
+                                    var inLLWafers = _lstWaferTasks.FindAll(wt => wt.currentMod == inLL).OrderBy(wt => _dictModuleTask[wt.destMod].TimeToReady);
+                                    foreach (var inWafer in inLLWafers)
+                                    {
+                                        if (!_dictModuleTask[inWafer.destMod].HasWafer && _dictModuleTask[inWafer.destMod].TimeToReady < 10)
+                                        {
+                                            _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(inLL, inWafer.currentSlot, ModuleName.TMRobot, (int)freeHands[0], freeHands[0]) });
+                                            _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(ModuleName.TMRobot, (int)freeHands[0], inWafer.destMod, 0, freeHands[0]) });
+                                            return;
+                                        }
+                                    }
+                                }
+                            }
                         }
                         else
                         {
@@ -4206,10 +4254,9 @@ namespace Venus_RT.Modules
                         schdPumpingLLs.Add(ModuleName.LLB);
                 }
                 else if ((llbWaferStatus.outSlot.Count == _LLBSlotNumber) || 
-                         (llbWaferStatus.outSlot.Count > 0 && llbWaferStatus.outSlot.Count < _LLBSlotNumber && _lstWaferTasks.Count(wt => ModuleHelper.IsPm(wt.currentMod)) == 0))
+                         (llbWaferStatus.outSlot.Count > 0 && llbWaferStatus.outSlot.Count < _LLBSlotNumber && _lstWaferTasks.Count(wt => ModuleHelper.IsPm(wt.currentMod) || ModuleHelper.IsTMRobot(wt.currentMod)) == 0))
                 {
-                    if (!schdVentingLLs.Contains(ModuleName.LLB))
-                        schdCoolingLLs.Add(ModuleName.LLB);
+                    schdCoolingLLs.Add(ModuleName.LLB);
                 }
             }
             else if(_LLInOutPath == SequenceLLInOutPath.BInAOut)
@@ -4234,8 +4281,7 @@ namespace Venus_RT.Modules
                 else if ((llaWaferStatus.outSlot.Count == _LLASlotNumber) ||
                          (llaWaferStatus.outSlot.Count > 0 && llaWaferStatus.outSlot.Count < _LLASlotNumber && _lstWaferTasks.Count(wt => ModuleHelper.IsPm(wt.currentMod)) == 0))
                 {
-                    if (!schdVentingLLs.Contains(ModuleName.LLA))
-                        schdCoolingLLs.Add(ModuleName.LLA);
+                    schdCoolingLLs.Add(ModuleName.LLA);
                 }
             }
             else
@@ -4269,7 +4315,7 @@ namespace Venus_RT.Modules
 
             foreach (var ventLL in schdVentingLLs)
             {
-                if (_dictModuleTask[ventLL].Scheduler.IsAvailable && !_dictModuleTask[ventLL].Scheduler.IsAtm)
+                if (_dictModuleTask[ventLL].Scheduler.IsAvailable && !_dictModuleTask[ventLL].Scheduler.IsAtm && !schdCoolingLLs.Contains(ventLL))
                     (_dictModuleTask[ventLL] as LoadlockTask).PreVent();
             }