Ver código fonte

fix the bug which missing calling RouteTo on Vac side.

sangwq 1 ano atrás
pai
commit
89d1b63b12
1 arquivos alterados com 36 adições e 41 exclusões
  1. 36 41
      Venus/Venus_RT/Modules/SystemDispatcher.cs

+ 36 - 41
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -134,17 +134,6 @@ namespace Venus_RT.Modules
                 }
             }
 
-            // remove heating function
-            //if (ModuleHelper.IsPm(destMod) && temperatureStatus == RState.Init)
-            //{
-            //    var pmScheduler = Singleton<TransferModule>.Instance.GetScheduler(destMod) as SchedulerPM;
-            //    if (pmScheduler != null && pmScheduler.IsAvailable)
-            //    {
-            //        pmScheduler.Preheating(temperature);
-            //        temperatureStatus = RState.Running;
-            //    }
-            //}
-
             return RState.Running;
         }
 
@@ -160,6 +149,11 @@ namespace Venus_RT.Modules
             nextMod = mod;
             nextSlot = slot;
             movingStatus = RState.Running;
+
+            if(ModuleHelper.IsLoadLock(currentMod) && ModuleHelper.IsTMRobot(nextMod) && ModuleHelper.IsLoadLock(routedMod))
+            {
+                routedMod = ModuleName.TMRobot; // fix the bug which missing call RouteTo() on Vac side
+            }
         }
 
         public void Return()
@@ -1950,7 +1944,7 @@ namespace Venus_RT.Modules
 
         private bool ForwardATMWafers(ModuleName ll)
         {
-            var waferStaus = GetLLReadyInOutSlots(ll);
+            var emptySlots = _LLSlotInOutOption == LLSlotInOutOpt.AllInAllOut ? GetLLReadyInOutSlots(ll).emptySlot : GetLLFixedReadyInOutSlots(ll).eInSlot;
             var atmWafers = _lstWaferTasks.Where(wafer => (wafer.movingStatus == RState.End ||wafer.movingStatus == RState.Init) && (ModuleHelper.IsEFEMRobot(wafer.currentMod) || ModuleHelper.IsAligner(wafer.currentMod))).ToList();
             var notAlignedWafer = atmWafers.Where(wafer => !wafer.IsAligned).ToList();
             var readyInWafers = _lstWaferTasks.Where(wafer => ModuleHelper.IsLoadPort(wafer.currentMod) && wafer.movingStatus == RState.Init && wafer.pressureStatus == RState.Init && CanWaferGotoLL(wafer, ll)).OrderBy(wafer => wafer.currentSlot).ToArray();
@@ -1966,7 +1960,7 @@ namespace Venus_RT.Modules
                 _efemSchdActions.Enqueue(new List<MoveItem> { new MoveItem(notAlignedWafer.First().currentMod, notAlignedWafer.First().currentSlot, ModuleName.Aligner1, 0, (Hand)notAlignedWafer.First().currentSlot) });
             }
             // forward one wafer
-            else if ((readyInWafers.Length > 0) && (atmWafers.Count == 0 || (atmWafers.Count == 1 && _lstWaferTasks.Count(wafer => ModuleHelper.IsAligner(wafer.currentMod)) == 0 && waferStaus.emptySlot.Count >= 2)))
+            else if ((readyInWafers.Length > 0) && (atmWafers.Count == 0 || (atmWafers.Count == 1 && _lstWaferTasks.Count(wafer => ModuleHelper.IsAligner(wafer.currentMod)) == 0 && emptySlots.Count >= 2)))
             {
                 readyInWafers[0].RouteTo(ModuleName.Aligner1, 0);
 
@@ -1977,7 +1971,7 @@ namespace Venus_RT.Modules
                 _efemSchdActions.Enqueue(new List<MoveItem> { new MoveItem(ModuleName.EfemRobot, (int)freeHands[0], ModuleName.Aligner1, 0, freeHands[0]) });
             }
             // forward aligner wafer
-            else if (atmWafers.Count == 1 && waferStaus.emptySlot.Count >= 2 && ModuleHelper.IsAligner(atmWafers.First().currentMod) && freeHands.Count > 1)
+            else if (atmWafers.Count == 1 && emptySlots.Count >= 2 && ModuleHelper.IsAligner(atmWafers.First().currentMod) && freeHands.Count > 1)
             {
                 atmWafers.First().RouteTo(ModuleName.EfemRobot, (int)freeHands[1]);
 
@@ -3363,42 +3357,43 @@ namespace Venus_RT.Modules
                                 return;
                             }
                         }
-                        else
+                    }
+                    else
+                    {
+                        var readySwapLL = lls.Where(ll => CanWaferGotoLL(robotWafers.First(), ll.Key) &&
+                            GetLLFixedReadyInOutSlots(ll.Key).tOutSlot.Count == 1 &&
+                            GetLLFixedReadyInOutSlots(ll.Key).tInSlot.Count == 1 &&
+                            ll.Value.TimeToReady <= 10);
+
+                        if (readySwapLL.Count() > 0)
                         {
-                            var readySwapLL = lls.Where(ll => CanWaferGotoLL(robotWafers.First(), ll.Key) &&
-                                GetLLFixedReadyInOutSlots(ll.Key).tOutSlot.Count == 1 &&
-                                GetLLFixedReadyInOutSlots(ll.Key).tInSlot.Count == 1 &&
-                                ll.Value.TimeToReady <= 10);
-                            if (readySwapLL.Count() > 0)
+                            var destLL = readySwapLL.First().Key;
+                            Hand pickHand = SelectTMPickArm(destLL);
+                            if (pickHand != Hand.None)
                             {
-                                var destLL = readySwapLL.First().Key;
-                                Hand pickHand = SelectTMPickArm(destLL);
-                                if (pickHand != Hand.None)
-                                {
-                                    Hand placeHand = (Hand)robotWafers.First().currentSlot;
-                                    var llSwap = new List<MoveItem>();
-                                    var llSlots = GetLLFixedReadyInOutSlots(destLL);
-                                    llSwap.Add(new MoveItem(destLL, llSlots.tOutSlot.First(), ModuleName.TMRobot, (int)pickHand, pickHand));
-                                    llSwap.Add(new MoveItem(ModuleName.TMRobot, (int)placeHand, destLL, llSlots.tInSlot.First(), placeHand));
-                                    _tmSchdActions.Enqueue(llSwap);
-                                    return;
-                                }
+                                Hand placeHand = (Hand)robotWafers.First().currentSlot;
+                                var llSwap = new List<MoveItem>();
+                                var llSlots = GetLLFixedReadyInOutSlots(destLL);
+                                llSwap.Add(new MoveItem(destLL, llSlots.tOutSlot.First(), ModuleName.TMRobot, (int)pickHand, pickHand));
+                                llSwap.Add(new MoveItem(ModuleName.TMRobot, (int)placeHand, destLL, llSlots.tInSlot.First(), placeHand));
+                                _tmSchdActions.Enqueue(llSwap);
+                                return;
                             }
+                        }
 
-                            var emptyLL = lls.Where(ll => CanWaferGotoLL(robotWafers.First(), ll.Key) &&
-                                                            GetLLFixedReadyInOutSlots(ll.Key).tInSlot.Count == 1 &&
-                                                            ll.Value.TimeToReady <= 2);
-                            if (emptyLL.Count() > 0)
-                            {
-                                var destLL = emptyLL.First().Key;
-                                _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem( ModuleName.TMRobot,
+                        var emptyLL = lls.Where(ll => CanWaferGotoLL(robotWafers.First(), ll.Key) &&
+                                                        GetLLFixedReadyInOutSlots(ll.Key).tInSlot.Count == 1 &&
+                                                        ll.Value.TimeToReady <= 2);
+                        if (emptyLL.Count() > 0)
+                        {
+                            var destLL = emptyLL.First().Key;
+                            _tmSchdActions.Enqueue(new List<MoveItem> { new MoveItem( ModuleName.TMRobot,
                                                                                             robotWafers.First().currentSlot,
                                                                                             destLL,
                                                                                             GetLLFixedReadyInOutSlots(destLL).tInSlot.First(),
                                                                                             (Hand)robotWafers.First().currentSlot) });
 
-                                return;
-                            }
+                            return;
                         }
                     }
                 }