Browse Source

handle the Scheduler wafers while destination PM unexpected offline.

sangwq 10 months ago
parent
commit
1b11b89cd6
1 changed files with 31 additions and 1 deletions
  1. 31 1
      Venus/Venus_RT/Modules/SystemDispatcher.cs

+ 31 - 1
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -124,6 +124,7 @@ namespace Venus_RT.Modules
 
                     if (!ModuleHelper.IsTMRobot(nextMod) && !ModuleHelper.IsEFEMRobot(nextMod))
                     {
+                        _scheduledTime = DateTime.Now;
                         wafer.NextSequenceStep++;
                         OnWaferArrived(this, new MoveItem(currentMod, currentSlot, nextMod, nextSlot, hand));
                     }
@@ -156,6 +157,12 @@ namespace Venus_RT.Modules
             }
         }
 
+        public void ReAssignPM(ModuleName pm, int slot)
+        {
+            destMod = pm; 
+            destSlot = slot;
+        }
+
         public void Return()
         {
             destMod = sourceMod;
@@ -1470,6 +1477,8 @@ namespace Venus_RT.Modules
 
             CreateNewWaferTask();
             _lstWaferTasks.RemoveAll(item => ModuleHelper.IsLoadPort(item.destMod) && ModuleHelper.IsLoadPort(item.currentMod) && item.pressureStatus == RState.End);
+
+            ReDispatchBlockingWafers();
         }
 
         private void RunWaferTask()
@@ -2007,6 +2016,26 @@ namespace Venus_RT.Modules
             _lstWaferTasks.Add(waferTask);
         }
 
+        private void ReDispatchBlockingWafers()
+        {
+            foreach (var wt in _lstWaferTasks)
+            {
+                if (ModuleHelper.IsPm(wt.destMod) && !ModuleHelper.IsPm(wt.currentMod) && !ModuleHelper.IsLoadPort(wt.currentMod))
+                {
+                    if (!_dictModuleTask[wt.destMod].Scheduler.IsOnline && wt.elapseTime > 120)
+                    {
+                        var wafer = WaferManager.Instance.GetWafer(wt.currentMod, wt.currentSlot);
+                        var otherPMs = _dictModuleTask.Where(mod => wafer.ProcessJob.Sequence.PMs.Contains(mod.Key) && mod.Value.Scheduler.IsOnline).OrderBy(mod => _lstWaferTasks.Where(task => task.destMod == mod.Key).Count()).ToList();
+                        if(otherPMs.Count > 0)
+                        {
+                            LOG.Write(eEvent.WARN_ROUTER, wt.currentMod, $"Re-assign process chamber {otherPMs.First().Key} for {wafer.WaferOrigin} as {wt.destMod} unexpected offline");
+                            wt.ReAssignPM(otherPMs.First().Key, 0);
+                        }
+                    }
+                }
+            }
+        }
+
         private bool ForwardATMWafers(ModuleName ll)
         {
             var emptySlots = _LLSlotInOutOption == LLSlotInOutOpt.AllInAllOut ? GetLLReadyInOutSlots(ll).emptySlot : GetLLFixedReadyInOutSlots(ll).eInSlot;
@@ -3048,7 +3077,7 @@ namespace Venus_RT.Modules
                     if (_tmSchdActions.Count == 0 && _tmRobotSingleArmOption == 0)
                     {
                         // try push in one wafer
-                        if (!IsLLReservedByEFEM(inLL) && _dictModuleTask[inLL].Scheduler.IsVac && inLLWaferStatus.inSlot.Count > 0)
+                        if (!IsLLReservedByEFEM(inLL) && _dictModuleTask[inLL].TimeToReady < 5 && inLLWaferStatus.inSlot.Count > 0)
                         {
                             foreach (var slot in inLLWaferStatus.inSlot)
                             {
@@ -4141,6 +4170,7 @@ namespace Venus_RT.Modules
 
             if (_tmRobotStatus != RState.End)
                 return;
+
             var hands = GetTMFreeHand();
             var lls = _dictModuleTask.Where(mod => ModuleHelper.IsLoadLock(mod.Key) && !IsLLReservedByEFEM(mod.Key) && mod.Value.Scheduler.IsIdle  && mod.Value.Scheduler.IsInclude && GetLLWaferExistance(mod.Key).emptySlots.Count > 0).OrderByDescending(mod => GetLLReadyInOutSlots(mod.Key).emptySlot.Count);
             if(lls.Count() > 0)