Browse Source

Fixed the routing path blocked bug.

sangwq 1 year ago
parent
commit
22c9fb9a5c
1 changed files with 11 additions and 42 deletions
  1. 11 42
      Venus/Venus_RT/Modules/AutoCycle.cs

+ 11 - 42
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -1557,13 +1557,14 @@ namespace Venus_RT.Modules
             return _efemMovingItems.Count > 0;
         }
 
-        private Tuple<int, int> GetPMWaferExistence()
+        private (int exist, int empty) GetPMWaferExistence()
         {
             int exist = 0;
             int empty = 0;
+            List<ModuleName> usedPMs = GetPmUsedInRunningPj();
             foreach (var module in _vacModules)
             {
-                if (ModuleHelper.IsPm(module.Key) && _vacSchedulers[module.Key].IsOnline)
+                if (ModuleHelper.IsPm(module.Key) && _vacSchedulers[module.Key].IsOnline && usedPMs.Contains(module.Key))
                 {
                     if (WaferManager.Instance.CheckHasWafer(module.Key, 0))
                         exist++;
@@ -1572,7 +1573,7 @@ namespace Venus_RT.Modules
                 }
             }
 
-            return new Tuple<int, int>(exist, empty);
+            return (exist, empty);
         }
 
         private (int Processed, int Empty) GetPMValidSlotsStatus()
@@ -1737,32 +1738,32 @@ namespace Venus_RT.Modules
             if (_LLInOutPath == SequenceLLInOutPath.AInBOut)
             {
                 return llbWaferStatus.Item1 == _LLBSlotNumber ? 0 :
-                    _LLASlotNumber + pmWaferStatus.Item2 - llaWaferStatus.Item1 - llaWaferStatus.Item2
+                    _LLASlotNumber + pmWaferStatus.empty - llaWaferStatus.Item1 - llaWaferStatus.Item2
                     - GetTMRobotWaferCount() - GetAtmInerWaferCount() - GetEfemRoborWaferCount();
             }
             else if (_LLInOutPath == SequenceLLInOutPath.BInAOut)
             {
                 return llaWaferStatus.Item1 == _LLASlotNumber ? 0 :
-                    _LLBSlotNumber + pmWaferStatus.Item2 - llbWaferStatus.Item1 - llbWaferStatus.Item2
+                    _LLBSlotNumber + pmWaferStatus.empty - llbWaferStatus.Item1 - llbWaferStatus.Item2
                     - GetTMRobotWaferCount() - GetAtmInerWaferCount() - GetEfemRoborWaferCount();
             }
             else if (_LLInOutPath == SequenceLLInOutPath.AInAOut || (_LLInOutPath == SequenceLLInOutPath.DInDOut && _vacSchedulers[ModuleName.LLA].IsOnline && !_vacSchedulers[ModuleName.LLB].IsOnline))
             {
                 return llaWaferStatus.Item1 > 0 ? 0 :
-                    _LLASlotNumber / 2 + pmWaferStatus.Item2 - llaWaferStatus.Item2
+                    _LLASlotNumber / 2 + pmWaferStatus.empty - llaWaferStatus.Item2
                     - GetTMRobotWaferCount() - GetEfemRoborWaferCount() - GetAtmInerWaferCount();
 
             }
             else if (_LLInOutPath == SequenceLLInOutPath.BInBOut || (_LLInOutPath == SequenceLLInOutPath.DInDOut && !_vacSchedulers[ModuleName.LLA].IsOnline && _vacSchedulers[ModuleName.LLB].IsOnline))
             {
                 return llbWaferStatus.Item1 > 0 ? 0 :
-                    _LLBSlotNumber / 2 + pmWaferStatus.Item2 - llbWaferStatus.Item2
+                    _LLBSlotNumber / 2 + pmWaferStatus.empty - llbWaferStatus.Item2
                         - GetTMRobotWaferCount() - GetEfemRoborWaferCount() - GetAtmInerWaferCount();
             }
             else if (_LLInOutPath == SequenceLLInOutPath.DInDOut && _vacSchedulers[ModuleName.LLA].IsOnline && _vacSchedulers[ModuleName.LLB].IsOnline)
             {
                 return llaWaferStatus.Item1 + llbWaferStatus.Item1 > 1 ? 0 :
-                    (_LLASlotNumber + _LLBSlotNumber) / 2 + pmWaferStatus.Item2
+                    (_LLASlotNumber + _LLBSlotNumber) / 2 + pmWaferStatus.empty
                     - llaWaferStatus.Item1 - llaWaferStatus.Item2 - llbWaferStatus.Item1 - llbWaferStatus.Item2
                     - GetTMRobotWaferCount() - GetEfemRoborWaferCount() - GetAtmInerWaferCount();
             }
@@ -2149,7 +2150,7 @@ namespace Venus_RT.Modules
             var pmUsed = new List<ModuleName>();
             foreach (var cj in _lstControlJobs)
             {
-                if (cj.State != EnumControlJobState.Executing && cj.State != EnumControlJobState.Paused)
+                if (cj.JetState != EnumJetCtrlJobState.PreJobClean && cj.JetState != EnumJetCtrlJobState.PostJobClean && cj.JetState != EnumJetCtrlJobState.Processing)
                     continue;
 
                 foreach (var pj in _lstProcessJobs)
@@ -2172,38 +2173,6 @@ namespace Venus_RT.Modules
             return pmUsed;
         }
 
-        private List<SchedulerPM> GetPmNeeded(ControlJobInfo cj)
-        {
-            List<SchedulerPM> result = new List<SchedulerPM>();
-
-            foreach (var pj in _lstProcessJobs)
-            {
-                if (pj.ControlJobName != cj.Name)
-                    continue;
-
-                var seq = pj.Sequence;
-                for (int i = 0; i < seq.Steps.Count; i++)
-                {
-                    SequenceStepInfo stepInfo = seq.Steps[i];
-                    foreach (var module in stepInfo.StepModules)
-                    {
-                        if (ModuleHelper.IsPm(module) && _vacSchedulers.ContainsKey(module))
-                        {
-                            var pm = _vacSchedulers[module] as SchedulerPM;
-
-                            if (pm != null && !result.Contains(pm))
-                            {
-                                result.Add(pm);
-                            }
-                        }
-                    }
-                }
-            }
-
-
-            return result;
-        }
-
         private void UpateSequenceStep(List<MoveItem> items)
         {
             foreach (var item in items)
@@ -2353,7 +2322,7 @@ namespace Venus_RT.Modules
 
                 //UpateSequenceStep(_efemMovingItems);
                 _efemMovingItems.Clear();
-                LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"All EFEM commands complete!");
+                //LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"All EFEM commands complete!");
             }
         }