瀏覽代碼

enhance the routing algorithm avoid blocking issue while single arm and single PM run.

sangwq 6 月之前
父節點
當前提交
81e78398e6
共有 1 個文件被更改,包括 38 次插入6 次删除
  1. 38 6
      Venus/Venus_RT/Modules/SystemDispatcher.cs

+ 38 - 6
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -328,6 +328,9 @@ namespace Venus_RT.Modules
         {
             get
             {
+                if (!Scheduler.IsOnline)
+                    return int.MaxValue / 2;
+
                 switch (Status)
                 {
                     case ModuleStatus.Idle:
@@ -3500,20 +3503,49 @@ namespace Venus_RT.Modules
                     if (inLLModule.ReayForTMInTime(10) && inLLWaferStatus.inSlot.Count > 0)
                     {
                         var pickActions = new List<MoveItem>();
+                        var placeActions = new List<MoveItem>();
                         var inLLWafers = _lstWaferTasks.FindAll(wt => wt.currentMod == inLL).ToList();
-                        if (inLLWaferStatus.inSlot.Count < 2 || inLLWafers.Exists(wt => !_dictModuleTask[wt.destMod].HasWafer && _dictModuleTask[wt.destMod].TimeToReady < 20))
+
+                        int pickCount = 0;
+                        foreach(var inWafer in inLLWafers)
                         {
-                            for (int i = 0; i < Math.Min(inLLWaferStatus.inSlot.Count, freeHands.Count); i++)
+                            if (!_dictModuleTask[inWafer.destMod].HasWafer && _dictModuleTask[inWafer.destMod].TimeToReady < 20 && pickCount < freeHands.Count)
                             {
-                                pickActions.Add(new MoveItem(inLL, inLLWaferStatus.inSlot[i], ModuleName.TMRobot, (int)freeHands[i], freeHands[i]));
+                                pickActions.Add(new MoveItem(inWafer.currentMod, inWafer.currentSlot, ModuleName.TMRobot, (int)freeHands[pickCount], freeHands[pickCount]));
+                                placeActions.Add(new MoveItem(ModuleName.TMRobot, (int)freeHands[pickCount], inWafer.destMod, 0, freeHands[pickCount]));
+                                pickCount++;
                             }
                         }
 
-                        if (pickActions.Count > 0)
+                        if(pickCount == 2)
                         {
-                            //LOG.Write(eEvent.INFO_TROUGHPUT_ENHANCE_TRACE, inLL, $"{inLL} will be ready in {inLLModule.TimeToReady} seconds");
                             _tmSchdActions.Enqueue(pickActions);
-                            return;
+                            foreach(var ac in placeActions)
+                            {
+                                _tmSchdActions.Enqueue(new List<MoveItem> { ac });
+                            }
+                        }
+                        else if(pickCount == 1)
+                        {
+                            if(inLLWafers.Count == 2 && freeHands.Count == 2)
+                            {
+                                var peerSlot = 1 - pickActions.First().SourceSlot;
+                                var peerWafer = inLLWafers.Find(wt => wt.currentSlot == peerSlot);
+                                if(peerWafer != null && _dictModuleTask[peerWafer.destMod].TimeToReady < 60)
+                                {
+                                    pickActions.Add(new MoveItem(peerWafer.currentMod, peerWafer.currentSlot, ModuleName.TMRobot, (int)freeHands[pickCount], freeHands[pickCount]));
+                                }
+
+                                _tmSchdActions.Enqueue(pickActions);
+                                _tmSchdActions.Enqueue(placeActions);
+                            }
+                        }
+                        else
+                        {
+                            if (inLLWafers.Count == 1 && _dictModuleTask[inLLWafers.First().destMod].TimeToReady < 60 && freeHands.Count == 2)
+                            {
+                                _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem(inLL, inLLWafers.First().currentSlot, inLLWafers.First().destMod, 0, freeHands[0]) });
+                            }
                         }
                     }
                 }