| 
															
																@@ -1255,7 +1255,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (ModuleHelper.IsLoadPort(mod.Key)) 
															 | 
															
															 | 
															
																                 if (ModuleHelper.IsLoadPort(mod.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     continue; 
															 | 
															
															 | 
															
																                     continue; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (!mod.Value.IsIdle) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (!mod.Value.Scheduler.IsIdle) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     LOG.Write(eEvent.ERR_ROUTER, mod.Key, $"{mod.Key} is not ready for return wafer."); 
															 | 
															
															 | 
															
																                     LOG.Write(eEvent.ERR_ROUTER, mod.Key, $"{mod.Key} is not ready for return wafer."); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     return RState.Failed; 
															 | 
															
															 | 
															
																                     return RState.Failed; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1630,7 +1630,6 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         private bool ActiveControlJob(ControlJobInfo cj) 
															 | 
															
															 | 
															
																         private bool ActiveControlJob(ControlJobInfo cj) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         { 
															 | 
															
															 | 
															
																         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             cj.JetState = EnumJetCtrlJobState.Processing; 
															 | 
															
															 | 
															
																             cj.JetState = EnumJetCtrlJobState.Processing; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             foreach (var pjName in cj.ProcessJobNameList) 
															 | 
															
															 | 
															
																             foreach (var pjName in cj.ProcessJobNameList) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 var pj = _lstProcessJobs.Find(x => x.Name == pjName); 
															 | 
															
															 | 
															
																                 var pj = _lstProcessJobs.Find(x => x.Name == pjName); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1766,15 +1765,15 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																         private ModuleName GetComingAvailablePM(ControlJobInfo cj) 
															 | 
															
															 | 
															
																         private ModuleName GetComingAvailablePM(ControlJobInfo cj) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         { 
															 | 
															
															 | 
															
																         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            var cjPMs = new List<ModuleName>(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            foreach (var pj in _lstProcessJobs) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            var lstInProcessPMs = new List<ModuleName>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            foreach (var wafer in cj.LotWafers) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if(pj.ControlJobName == cj.Name) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if(!wafer.IsEmpty && wafer.NextSequenceStep == 0 && wafer.ProcessJob != null) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    foreach(var pm in pj.Sequence.PMs) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    foreach(var pm in wafer.ProcessJob.Sequence.PMs) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        if (!cjPMs.Contains(pm)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            cjPMs.Add(pm); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        if (!lstInProcessPMs.Contains(pm)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            lstInProcessPMs.Add(pm); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1782,7 +1781,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             Dictionary<ModuleName, int> pmAssociatedWaferCount = new Dictionary<ModuleName, int>(); 
															 | 
															
															 | 
															
																             Dictionary<ModuleName, int> pmAssociatedWaferCount = new Dictionary<ModuleName, int>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             foreach (var mod in _dictModuleTask) 
															 | 
															
															 | 
															
																             foreach (var mod in _dictModuleTask) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (ModuleHelper.IsPm(mod.Key) && mod.Value.Scheduler.IsOnline && cjPMs.Contains(mod.Key)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (ModuleHelper.IsPm(mod.Key) && mod.Value.Scheduler.IsOnline && lstInProcessPMs.Contains(mod.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     pmAssociatedWaferCount[mod.Key] = 0; 
															 | 
															
															 | 
															
																                     pmAssociatedWaferCount[mod.Key] = 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1791,14 +1790,14 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var unprocessedWafer = _lstWaferTasks.Where(task => ModuleHelper.IsPm(task.destMod)); 
															 | 
															
															 | 
															
																             var unprocessedWafer = _lstWaferTasks.Where(task => ModuleHelper.IsPm(task.destMod)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             foreach (var wafer in unprocessedWafer) 
															 | 
															
															 | 
															
																             foreach (var wafer in unprocessedWafer) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (ModuleHelper.IsPm(wafer.destMod) && _dictModuleTask[wafer.destMod].Scheduler.IsOnline) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (ModuleHelper.IsPm(wafer.destMod) && _dictModuleTask[wafer.destMod].Scheduler.IsOnline && lstInProcessPMs.Contains(wafer.destMod)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     pmAssociatedWaferCount[wafer.destMod]++; 
															 | 
															
															 | 
															
																                     pmAssociatedWaferCount[wafer.destMod]++; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var oderedPMCount = pmAssociatedWaferCount.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value); 
															 | 
															
															 | 
															
																             var oderedPMCount = pmAssociatedWaferCount.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if (oderedPMCount.First().Value < 2) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (oderedPMCount.Count > 0 && oderedPMCount.First().Value < 2) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return oderedPMCount.First().Key; 
															 | 
															
															 | 
															
																                 return oderedPMCount.First().Key; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             return ModuleName.System; 
															 | 
															
															 | 
															
																             return ModuleName.System; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2097,16 +2096,19 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 // ready to push in  
															 | 
															
															 | 
															
																                 // ready to push in  
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 var readyLLs = _dictModuleTask.Where(mod => ModuleHelper.IsLoadLock(mod.Key) && 
															 | 
															
															 | 
															
																                 var readyLLs = _dictModuleTask.Where(mod => ModuleHelper.IsLoadLock(mod.Key) && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        ((mod.Key != ModuleName.LLA && LLInOutPath == SequenceLLInOutPath.BInBOut) || (mod.Key != ModuleName.LLB && LLInOutPath == SequenceLLInOutPath.AInAOut)) && 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        ((mod.Key == ModuleName.LLA && LLInOutPath != SequenceLLInOutPath.BInBOut) || (mod.Key == ModuleName.LLB && LLInOutPath != SequenceLLInOutPath.AInAOut)) && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         mod.Value.TimeToReady <= 10 && 
															 | 
															
															 | 
															
																                         mod.Value.TimeToReady <= 10 && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         !IsLLReservedByTM(mod.Key) && 
															 | 
															
															 | 
															
																                         !IsLLReservedByTM(mod.Key) && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        GetLLReadyInOutSlots(mod.Key).emptySlot.Count > 1). 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        GetLLReadyInOutSlots(mod.Key).emptySlot.Count >= 1). 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
															
															 | 
															
																                         OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (readyLLs.Count > 0 && atmWaferCount >= 1) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (atmWaferCount >= 1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (ExchangeWaferWithLL(readyLLs.First().Key)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        return; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    foreach(var ll in readyLLs) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        if (ExchangeWaferWithLL(ll.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 // forward wafer to system 
															 | 
															
															 | 
															
																                 // forward wafer to system 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2119,15 +2121,16 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (_efemSchdActions.Count == 0) 
															 | 
															
															 | 
															
																                 if (_efemSchdActions.Count == 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     var readyReturnLL = _dictModuleTask.Where(mod => ModuleHelper.IsLoadLock(mod.Key) && 
															 | 
															
															 | 
															
																                     var readyReturnLL = _dictModuleTask.Where(mod => ModuleHelper.IsLoadLock(mod.Key) && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            ((mod.Key != ModuleName.LLA && LLInOutPath == SequenceLLInOutPath.BInBOut) || (mod.Key != ModuleName.LLB && LLInOutPath == SequenceLLInOutPath.AInAOut)) && 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            ((mod.Key == ModuleName.LLA && LLInOutPath != SequenceLLInOutPath.BInBOut) || (mod.Key == ModuleName.LLB && LLInOutPath != SequenceLLInOutPath.AInAOut)) && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             mod.Value.TimeToReady <= 5 && 
															 | 
															
															 | 
															
																                             mod.Value.TimeToReady <= 5 && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             !IsLLReservedByTM(mod.Key) && 
															 | 
															
															 | 
															
																                             !IsLLReservedByTM(mod.Key) && 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             GetLLReadyInOutSlots(mod.Key).outSlot.Count >= 1). 
															 | 
															
															 | 
															
																                             GetLLReadyInOutSlots(mod.Key).outSlot.Count >= 1). 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             OrderByDescending(mod => GetLLReadyInOutSlots(mod.Key).outSlot.Count).ToList(); 
															 | 
															
															 | 
															
																                             OrderByDescending(mod => GetLLReadyInOutSlots(mod.Key).outSlot.Count).ToList(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (readyReturnLL.Count > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    foreach(var ll in readyReturnLL) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        ExchangeWaferWithLL(readyReturnLL.First().Key); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        if (ExchangeWaferWithLL(readyReturnLL.First().Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2140,9 +2143,10 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         GetLLReadyInOutSlots(mod.Key).outSlot.Count > 1). 
															 | 
															
															 | 
															
																                         GetLLReadyInOutSlots(mod.Key).outSlot.Count > 1). 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
															
															 | 
															
																                         OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (readyDoubleReturnLL.Count > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                foreach(var ll in readyDoubleReturnLL) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (ExchangeWaferWithLL(readyDoubleReturnLL.First().Key)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (ExchangeWaferWithLL(ll.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         return; 
															 | 
															
															 | 
															
																                         return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2153,9 +2157,9 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         GetLLReadyInOutSlots(mod.Key).outSlot.Count == 1). 
															 | 
															
															 | 
															
																                         GetLLReadyInOutSlots(mod.Key).outSlot.Count == 1). 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
															
															 | 
															
																                         OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (readySingleReturnLL.Count > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                foreach (var ll in readySingleReturnLL) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (ExchangeWaferWithLL(readySingleReturnLL.First().Key)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (ExchangeWaferWithLL(ll.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         return; 
															 | 
															
															 | 
															
																                         return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2169,9 +2173,10 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             GetLLReadyInOutSlots(mod.Key).emptySlot.Count > 1). 
															 | 
															
															 | 
															
																                             GetLLReadyInOutSlots(mod.Key).emptySlot.Count > 1). 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
															
															 | 
															
																                             OrderBy(mod => mod.Value.TimeToReady).ToList(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (readyLLs.Count > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    foreach(var ll in readyLLs) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        ForwardATMWafers(readyLLs.First().Key); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        if (ForwardATMWafers(ll.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2508,7 +2513,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         } 
															 | 
															
															 | 
															
																                         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    llValues[ll] = returnWafers[ll].Count * 2 + llSwapActions[ll].Count + (_dictModuleTask[ll].Scheduler.IsVac ? 3 : 0); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    llValues[ll] = returnWafers[ll].Count * 2 + llSwapActions[ll].Count + (_dictModuleTask[ll].Scheduler.IsVac && returnWafers[ll].Count > 0 ? 2 : 0); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -3487,27 +3492,19 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if (_lstControlJobs.Count == 0) 
															 | 
															
															 | 
															
																             if (_lstControlJobs.Count == 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return; 
															 | 
															
															 | 
															
																                 return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            List<SequenceLLInOutPath> inOutPaths = new List<SequenceLLInOutPath>(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            foreach (var cj in _lstControlJobs) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            var inOutPaths = new List<SequenceLLInOutPath>();  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            foreach(var wt in _lstWaferTasks) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (cj.State == EnumControlJobState.Executing) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    foreach (var pjName in cj.ProcessJobNameList) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        var pj = _lstProcessJobs.Find(x => x.Name == pjName); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        if (pj == null || pj.State != EnumProcessJobState.Processing) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            continue; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        if (!inOutPaths.Exists(item => item == pj.Sequence.LLInOutPath)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            inOutPaths.Add(pj.Sequence.LLInOutPath); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (!inOutPaths.Contains(wt.llInOutPath)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    inOutPaths.Add(wt.llInOutPath); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if (inOutPaths.Count == 1) 
															 | 
															
															 | 
															
																             if (inOutPaths.Count == 1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 _LLInOutPath = inOutPaths[0]; 
															 | 
															
															 | 
															
																                 _LLInOutPath = inOutPaths[0]; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            else 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                _LLInOutPath = SequenceLLInOutPath.DInDOut; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																         #endregion 
															 | 
															
															 | 
															
																         #endregion 
															 |