| 
															
																@@ -171,7 +171,6 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             DATA.Subscribe("Scheduler.PjIdList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.InnerId.ToString()).ToList()); 
															 | 
															
															 | 
															
																             DATA.Subscribe("Scheduler.PjIdList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.InnerId.ToString()).ToList()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             DATA.Subscribe("Scheduler.PjNameList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.LotName.ToString()).ToList()); 
															 | 
															
															 | 
															
																             DATA.Subscribe("Scheduler.PjNameList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.LotName.ToString()).ToList()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -469,7 +468,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName); 
															 | 
															
															 | 
															
																             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if (cj == null) 
															 | 
															
															 | 
															
																             if (cj == null) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"resume job rejected, not found job with id {jobName}"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                //LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"resume job rejected, not found job with id {jobName}"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return; 
															 | 
															
															 | 
															
																                 return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -487,7 +486,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName); 
															 | 
															
															 | 
															
																             ControlJobInfo cj = _lstControlJobs.Find(x => x.Name == jobName); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if (cj == null) 
															 | 
															
															 | 
															
																             if (cj == null) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"pause job rejected, not found job with id {jobName}"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                //LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"pause job rejected, not found job with id {jobName}"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return; 
															 | 
															
															 | 
															
																                 return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -497,7 +496,9 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             _faCallback.JobPaused(cj, GetFirstProcessJob(cj)); 
															 | 
															
															 | 
															
																             _faCallback.JobPaused(cj, GetFirstProcessJob(cj)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            _cycleState = RState.Paused; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (!_lstControlJobs.Exists(job => job.State == EnumControlJobState.Executing)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                _cycleState = RState.Paused; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -585,13 +586,13 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if(WaferManager.Instance.CheckNoWafer(SourceModule, SourceSlot)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (WaferManager.Instance.CheckNoWafer(SourceModule, SourceSlot)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"Can not return wafer as {SourceModule} {SourceSlot} has no wafer"); 
															 | 
															
															 | 
															
																                 LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"Can not return wafer as {SourceModule} {SourceSlot} has no wafer"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if(!_vacSchedulers.Keys.Contains(SourceModule) || !_vacSchedulers[SourceModule].IsIdle) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (!_vacSchedulers.Keys.Contains(SourceModule) || !_vacSchedulers[SourceModule].IsIdle) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"The module: {SourceModule} is not ready for return wafer"); 
															 | 
															
															 | 
															
																                 LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"The module: {SourceModule} is not ready for return wafer"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -599,7 +600,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var wafer = WaferManager.Instance.GetWafer(SourceModule, SourceSlot); 
															 | 
															
															 | 
															
																             var wafer = WaferManager.Instance.GetWafer(SourceModule, SourceSlot); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"Manual return  wafer: {wafer.WaferOrigin} at {SourceModule} {SourceSlot} while system is auto running"); 
															 | 
															
															 | 
															
																             LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"Manual return  wafer: {wafer.WaferOrigin} at {SourceModule} {SourceSlot} while system is auto running"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-             
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             _lstReturnWafers.Add(wafer.InnerId); 
															 | 
															
															 | 
															
																             _lstReturnWafers.Add(wafer.InnerId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             return true; 
															 | 
															
															 | 
															
																             return true; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1029,7 +1030,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 for (int i = 0; i < 2; i++) 
															 | 
															
															 | 
															
																                 for (int i = 0; i < 2; i++) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, i)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, i) && IsWaferCtrlJobRuning(ModuleName.TMRobot, i)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         if (SearchWaferDestination(new SlotItem(ModuleName.TMRobot, i), out SlotItem destSlot)) 
															 | 
															
															 | 
															
																                         if (SearchWaferDestination(new SlotItem(ModuleName.TMRobot, i), out SlotItem destSlot)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         { 
															 | 
															
															 | 
															
																                         { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1237,7 +1238,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (ModuleHelper.IsPm(module.Key) && _vacSchedulers[module.Key].IsAvailable && _vacModules[module.Key].MovingStatus == MovingStatus.Idle) 
															 | 
															
															 | 
															
																                 if (ModuleHelper.IsPm(module.Key) && _vacSchedulers[module.Key].IsAvailable && _vacModules[module.Key].MovingStatus == MovingStatus.Idle) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if (WaferManager.Instance.CheckHasWafer(module.Key, 0)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (IsWaferCtrlJobRuning(module.Key, 0)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         if (SearchOutLLSlot(module.Key, ll, out SlotItem outSlot)) 
															 | 
															
															 | 
															
																                         if (SearchOutLLSlot(module.Key, ll, out SlotItem outSlot)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         { 
															 | 
															
															 | 
															
																                         { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1263,7 +1264,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (inWaferCount >= 2) 
															 | 
															
															 | 
															
																                 if (inWaferCount >= 2) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     break; 
															 | 
															
															 | 
															
																                     break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (SearchValidInPM(ll, slot, out SlotItem inSlot)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (IsWaferCtrlJobRuning(ll, slot) && SearchValidInPM(ll, slot, out SlotItem inSlot)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     inWaferCount++; 
															 | 
															
															 | 
															
																                     inWaferCount++; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     _movingItems.Add(new MoveItem(ll, slot, inSlot.Module, inSlot.Slot, Hand.None)); 
															 | 
															
															 | 
															
																                     _movingItems.Add(new MoveItem(ll, slot, inSlot.Module, inSlot.Slot, Hand.None)); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1286,24 +1287,24 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             Queue<SlotItem> returnSlots = new Queue<SlotItem>(); 
															 | 
															
															 | 
															
																             Queue<SlotItem> returnSlots = new Queue<SlotItem>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            for(int i = 0;  i< 2; i++) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            for (int i = 0; i < 2; i++) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if(WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, i)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, i)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     var wafer_id = WaferManager.Instance.GetWafer(ModuleName.TMRobot, 0).InnerId; 
															 | 
															
															 | 
															
																                     var wafer_id = WaferManager.Instance.GetWafer(ModuleName.TMRobot, 0).InnerId; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if(_lstReturnWafers.FindIndex(item => item == wafer_id) != -1) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (_lstReturnWafers.FindIndex(item => item == wafer_id) != -1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         returnSlots.Enqueue(new SlotItem(ModuleName.TMRobot, i)); 
															 | 
															
															 | 
															
																                         returnSlots.Enqueue(new SlotItem(ModuleName.TMRobot, i)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            foreach(var mod in _vacModules) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            foreach (var mod in _vacModules) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if(ModuleHelper.IsPm(mod.Key) && WaferManager.Instance.CheckHasWafer(mod.Key, 0) && _vacSchedulers[mod.Key].IsIdle) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (ModuleHelper.IsPm(mod.Key) && WaferManager.Instance.CheckHasWafer(mod.Key, 0) && _vacSchedulers[mod.Key].IsIdle) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     var wafer_id = WaferManager.Instance.GetWafer(mod.Key, 0).InnerId; 
															 | 
															
															 | 
															
																                     var wafer_id = WaferManager.Instance.GetWafer(mod.Key, 0).InnerId; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if(_lstReturnWafers.FindIndex(item => item == wafer_id) != -1) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (_lstReturnWafers.FindIndex(item => item == wafer_id) != -1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         returnSlots.Enqueue(new SlotItem(mod.Key, 0)); 
															 | 
															
															 | 
															
																                         returnSlots.Enqueue(new SlotItem(mod.Key, 0)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1321,17 +1322,17 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 destLL = ModuleName.LLA; 
															 | 
															
															 | 
															
																                 destLL = ModuleName.LLA; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            else if(IsLoadReadyForTM(ModuleName.LLB) && llbSlotStatus.empty > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            else if (IsLoadReadyForTM(ModuleName.LLB) && llbSlotStatus.empty > 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 destLL = ModuleName.LLB; 
															 | 
															
															 | 
															
																                 destLL = ModuleName.LLB; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if(destLL != ModuleName.System) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (destLL != ModuleName.System) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 int slotNumber = destLL == ModuleName.LLA ? _LLASlotNumber : _LLBSlotNumber; 
															 | 
															
															 | 
															
																                 int slotNumber = destLL == ModuleName.LLA ? _LLASlotNumber : _LLBSlotNumber; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                for(int i = 0; i < slotNumber; i++) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                for (int i = 0; i < slotNumber; i++) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if(WaferManager.Instance.CheckNoWafer(destLL, i)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (WaferManager.Instance.CheckNoWafer(destLL, i)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         if (_movingItems.Count >= 2 || returnSlots.Count == 0) 
															 | 
															
															 | 
															
																                         if (_movingItems.Count >= 2 || returnSlots.Count == 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             break; 
															 | 
															
															 | 
															
																                             break; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1359,31 +1360,31 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var llaSlotStatus = GetLLProcessStatusCount(ModuleName.LLA); 
															 | 
															
															 | 
															
																             var llaSlotStatus = GetLLProcessStatusCount(ModuleName.LLA); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var llbSlotStatus = GetLLProcessStatusCount(ModuleName.LLB); 
															 | 
															
															 | 
															
																             var llbSlotStatus = GetLLProcessStatusCount(ModuleName.LLB); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if(LLInOutPath == SequenceLLInOutPath.AInBOut || LLInOutPath == SequenceLLInOutPath.BInAOut) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (LLInOutPath == SequenceLLInOutPath.AInBOut || LLInOutPath == SequenceLLInOutPath.BInAOut) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 ModuleName InModule = LLInOutPath == SequenceLLInOutPath.AInBOut ? ModuleName.LLA : ModuleName.LLB; 
															 | 
															
															 | 
															
																                 ModuleName InModule = LLInOutPath == SequenceLLInOutPath.AInBOut ? ModuleName.LLA : ModuleName.LLB; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 ModuleName OutModule = LLInOutPath == SequenceLLInOutPath.AInBOut ? ModuleName.LLB : ModuleName.LLA; 
															 | 
															
															 | 
															
																                 ModuleName OutModule = LLInOutPath == SequenceLLInOutPath.AInBOut ? ModuleName.LLB : ModuleName.LLA; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 int InNumber = Math.Min(InModule == ModuleName.LLA ? llaSlotStatus.unprocessed : llbSlotStatus.unprocessed, pmSlotStaus.Empty); 
															 | 
															
															 | 
															
																                 int InNumber = Math.Min(InModule == ModuleName.LLA ? llaSlotStatus.unprocessed : llbSlotStatus.unprocessed, pmSlotStaus.Empty); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                int OutNumber = Math.Min(OutModule == ModuleName.LLA ? llaSlotStatus.empty : llbSlotStatus.empty,  pmSlotStaus.Processed); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                int OutNumber = Math.Min(OutModule == ModuleName.LLA ? llaSlotStatus.empty : llbSlotStatus.empty, pmSlotStaus.Processed); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (InNumber + OutNumber == 0) 
															 | 
															
															 | 
															
																                 if (InNumber + OutNumber == 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     return; 
															 | 
															
															 | 
															
																                     return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if(IsLoadReadyForTM(InModule) && (!IsLoadReadyForTM(OutModule) || (!_vacSchedulers[OutModule].IsVac && InNumber == OutNumber) || InNumber > OutNumber)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (IsLoadReadyForTM(InModule) && (!IsLoadReadyForTM(OutModule) || (!_vacSchedulers[OutModule].IsVac && InNumber == OutNumber) || InNumber > OutNumber)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     // move in wafer 
															 | 
															
															 | 
															
																                     // move in wafer 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ForwardLLWaferToPMs(InModule); 
															 | 
															
															 | 
															
																                     ForwardLLWaferToPMs(InModule); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                else if(IsLoadReadyForTM(OutModule) && OutNumber > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                else if (IsLoadReadyForTM(OutModule) && OutNumber > 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     // move out wafer 
															 | 
															
															 | 
															
																                     // move out wafer 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ForwardPMsWaferToLL(OutModule); 
															 | 
															
															 | 
															
																                     ForwardPMsWaferToLL(OutModule); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            else if(LLInOutPath == SequenceLLInOutPath.AInAOut || LLInOutPath == SequenceLLInOutPath.BInBOut) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            else if (LLInOutPath == SequenceLLInOutPath.AInAOut || LLInOutPath == SequenceLLInOutPath.BInBOut) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 ModuleName loadlock = LLInOutPath == SequenceLLInOutPath.AInAOut ? ModuleName.LLA : ModuleName.LLB; 
															 | 
															
															 | 
															
																                 ModuleName loadlock = LLInOutPath == SequenceLLInOutPath.AInAOut ? ModuleName.LLA : ModuleName.LLB; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if(IsLoadReadyForTM(loadlock)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (IsLoadReadyForTM(loadlock)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     // switch wafer 
															 | 
															
															 | 
															
																                     // switch wafer 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ExchangeLLWafersWithPMs(loadlock); 
															 | 
															
															 | 
															
																                     ExchangeLLWafersWithPMs(loadlock); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1399,13 +1400,13 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 int llbInNumber = Math.Min(Math.Min(llbSlotStatus.unprocessed, 2), pmSlotStaus.Empty + llbOutNumber); 
															 | 
															
															 | 
															
																                 int llbInNumber = Math.Min(Math.Min(llbSlotStatus.unprocessed, 2), pmSlotStaus.Empty + llbOutNumber); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 int llbExchangeNumber = llbOutNumber + llbInNumber; 
															 | 
															
															 | 
															
																                 int llbExchangeNumber = llbOutNumber + llbInNumber; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (IsLoadReadyForTM(ModuleName.LLA) && ((!_vacSchedulers[ModuleName.LLB].IsVac && llaExchangeNumber == llbExchangeNumber) ||  
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                                                        (llaExchangeNumber > llbExchangeNumber) ||  
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (IsLoadReadyForTM(ModuleName.LLA) && ((!_vacSchedulers[ModuleName.LLB].IsVac && llaExchangeNumber == llbExchangeNumber) || 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                                                        (llaExchangeNumber > llbExchangeNumber) || 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                                                         (!IsLoadReadyForTM(ModuleName.LLB) && llaExchangeNumber > 0))) 
															 | 
															
															 | 
															
																                                                                         (!IsLoadReadyForTM(ModuleName.LLB) && llaExchangeNumber > 0))) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ExchangeLLWafersWithPMs(ModuleName.LLA); 
															 | 
															
															 | 
															
																                     ExchangeLLWafersWithPMs(ModuleName.LLA); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                else if(IsLoadReadyForTM(ModuleName.LLB) && llbExchangeNumber > 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                else if (IsLoadReadyForTM(ModuleName.LLB) && llbExchangeNumber > 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     ExchangeLLWafersWithPMs(ModuleName.LLB); 
															 | 
															
															 | 
															
																                     ExchangeLLWafersWithPMs(ModuleName.LLB); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 } 
															 | 
															
															 | 
															
																                 } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1458,7 +1459,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     var pmScheduler = _vacSchedulers[mod.Key] as SchedulerPM; 
															 | 
															
															 | 
															
																                                     var pmScheduler = _vacSchedulers[mod.Key] as SchedulerPM; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     string WTWCleanRecipe = string.Empty; 
															 | 
															
															 | 
															
																                                     string WTWCleanRecipe = string.Empty; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     var wtwJob = _lstControlJobs.Find(cj => cj.JetState == EnumJetCtrlJobState.Processing && IsCtrlJobNeedWTWClean(cj, mod.Key, out WTWCleanRecipe) && !IsAllJobWaferProcessedOrProcessing(cj)); 
															 | 
															
															 | 
															
																                                     var wtwJob = _lstControlJobs.Find(cj => cj.JetState == EnumJetCtrlJobState.Processing && IsCtrlJobNeedWTWClean(cj, mod.Key, out WTWCleanRecipe) && !IsAllJobWaferProcessedOrProcessing(cj)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                    if(wtwJob != null && WTWCleanRecipe.Length > 0)  
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                    if (wtwJob != null && WTWCleanRecipe.Length > 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     { 
															 | 
															
															 | 
															
																                                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         _waitWTWCleanPMs.Add(mod.Key); 
															 | 
															
															 | 
															
																                                         _waitWTWCleanPMs.Add(mod.Key); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     } 
															 | 
															
															 | 
															
																                                     } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1477,15 +1478,15 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     var pmScheduler = _vacSchedulers[mod.Key] as SchedulerPM; 
															 | 
															
															 | 
															
																                                     var pmScheduler = _vacSchedulers[mod.Key] as SchedulerPM; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     if (IsPMKeepEmpty(mod.Key)) 
															 | 
															
															 | 
															
																                                     if (IsPMKeepEmpty(mod.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     { 
															 | 
															
															 | 
															
																                                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                        if(_waitPreCleanPMs.Contains(mod.Key)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                        if (_waitPreCleanPMs.Contains(mod.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         { 
															 | 
															
															 | 
															
																                                         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                             mod.Value.MovingStatus = MovingStatus.WaitPreJobClean; 
															 | 
															
															 | 
															
																                                             mod.Value.MovingStatus = MovingStatus.WaitPreJobClean; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         } 
															 | 
															
															 | 
															
																                                         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                        else if(_lstControlJobs.FindIndex(cj => cj.JetState == EnumJetCtrlJobState.PostJobClean) != -1 &&  _waitPostCleanPMs.Contains(mod.Key)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                        else if (_lstControlJobs.FindIndex(cj => cj.JetState == EnumJetCtrlJobState.PostJobClean) != -1 && _waitPostCleanPMs.Contains(mod.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         { 
															 | 
															
															 | 
															
																                                         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                             mod.Value.MovingStatus = MovingStatus.WaitPostJobClean; 
															 | 
															
															 | 
															
																                                             mod.Value.MovingStatus = MovingStatus.WaitPostJobClean; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         } 
															 | 
															
															 | 
															
																                                         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                        else if(pmScheduler.RunIdleCleanTask())  // Check Idle Clean 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                        else if (pmScheduler.RunIdleCleanTask())  // Check Idle Clean 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         { 
															 | 
															
															 | 
															
																                                         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                             mod.Value.MovingStatus = MovingStatus.StartIdleClean; 
															 | 
															
															 | 
															
																                                             mod.Value.MovingStatus = MovingStatus.StartIdleClean; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         } 
															 | 
															
															 | 
															
																                                         } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1536,7 +1537,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     { 
															 | 
															
															 | 
															
																                                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         string WTWCleanRecipe = string.Empty; 
															 | 
															
															 | 
															
																                                         string WTWCleanRecipe = string.Empty; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         var wtwJob = _lstControlJobs.Find(cj => cj.JetState == EnumJetCtrlJobState.Processing && IsCtrlJobNeedWTWClean(cj, mod.Key, out WTWCleanRecipe) && !IsAllJobWaferProcessedOrProcessing(cj)); 
															 | 
															
															 | 
															
																                                         var wtwJob = _lstControlJobs.Find(cj => cj.JetState == EnumJetCtrlJobState.Processing && IsCtrlJobNeedWTWClean(cj, mod.Key, out WTWCleanRecipe) && !IsAllJobWaferProcessedOrProcessing(cj)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                        if (wtwJob != null && WTWCleanRecipe.Length > 0)  
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                        if (wtwJob != null && WTWCleanRecipe.Length > 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                         { 
															 | 
															
															 | 
															
																                                         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                             if (pmScheduler.RunJobCleanTask(WTWCleanRecipe)) 
															 | 
															
															 | 
															
																                                             if (pmScheduler.RunJobCleanTask(WTWCleanRecipe)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                             { 
															 | 
															
															 | 
															
																                                             { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1624,7 +1625,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         #region Atm System 
															 | 
															
															 | 
															
																         #region Atm System 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         private void driveAtmSystem() 
															 | 
															
															 | 
															
																         private void driveAtmSystem() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         { 
															 | 
															
															 | 
															
																         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if(_efemMovingItems.Count == 0 && _efemRobot.IsAvailable && _efemRobot.RobotStatus != RState.Running) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (_efemMovingItems.Count == 0 && _efemRobot.IsAvailable && _efemRobot.RobotStatus != RState.Running) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 PumpingEFEMRobotTask(); 
															 | 
															
															 | 
															
																                 PumpingEFEMRobotTask(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 RuningEFEMRobotTask(); 
															 | 
															
															 | 
															
																                 RuningEFEMRobotTask(); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1651,14 +1652,14 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var lls = _atmSchedulers.Where(x => ModuleHelper.IsLoadLock(x.Key) && x.Value.IsAvailable && !IsLoadLockReservedByTM(x.Key)).ToDictionary(k => k.Key, v => v.Value); 
															 | 
															
															 | 
															
																             var lls = _atmSchedulers.Where(x => ModuleHelper.IsLoadLock(x.Key) && x.Value.IsAvailable && !IsLoadLockReservedByTM(x.Key)).ToDictionary(k => k.Key, v => v.Value); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            foreach(var ll in lls) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            foreach (var ll in lls) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (ProcessLLEFEMRobotTask(ll.Key)) 
															 | 
															
															 | 
															
																                 if (ProcessLLEFEMRobotTask(ll.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     return; 
															 | 
															
															 | 
															
																                     return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var lps = _atmSchedulers.Where(x => ModuleHelper.IsLoadPort(x.Key) && x.Value.IsAvailable).ToDictionary(k => k.Key, v => v.Value); 
															 | 
															
															 | 
															
																             var lps = _atmSchedulers.Where(x => ModuleHelper.IsLoadPort(x.Key) && x.Value.IsAvailable).ToDictionary(k => k.Key, v => v.Value); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            foreach(var lp in lps) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            foreach (var lp in lps) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (ProcessLPEFEMRobotTask(lp.Key)) 
															 | 
															
															 | 
															
																                 if (ProcessLPEFEMRobotTask(lp.Key)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     return; 
															 | 
															
															 | 
															
																                     return; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1698,13 +1699,10 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																         bool IsAtmWaferReadyOut(ModuleName mod, int slot) 
															 | 
															
															 | 
															
																         bool IsAtmWaferReadyOut(ModuleName mod, int slot) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         { 
															 | 
															
															 | 
															
																         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            var wafer = WaferManager.Instance.GetWafer(mod, slot); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																- 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if (wafer.IsEmpty) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (!IsWaferCtrlJobRuning(mod, slot)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                return false; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            var wafer = WaferManager.Instance.GetWafer(mod, slot); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if (_lstReturnWafers.Contains(wafer.InnerId)) 
															 | 
															
															 | 
															
																             if (_lstReturnWafers.Contains(wafer.InnerId)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1793,7 +1791,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             List<ModuleName> usedPMs = GetPmUsedInRunningPj(); 
															 | 
															
															 | 
															
																             List<ModuleName> usedPMs = GetPmUsedInRunningPj(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             foreach (var module in _vacModules) 
															 | 
															
															 | 
															
																             foreach (var module in _vacModules) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                if (ModuleHelper.IsPm(module.Key) && ((_vacSchedulers[module.Key].IsOnline && usedPMs.Contains(module.Key)) || _cycleState == RState.End )) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                if (ModuleHelper.IsPm(module.Key) && ((_vacSchedulers[module.Key].IsOnline && usedPMs.Contains(module.Key)) || _cycleState == RState.End)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     if (WaferManager.Instance.CheckHasWafer(module.Key, 0)) 
															 | 
															
															 | 
															
																                     if (WaferManager.Instance.CheckHasWafer(module.Key, 0)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         exist++; 
															 | 
															
															 | 
															
																                         exist++; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -1815,11 +1813,11 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (ModuleHelper.IsPm(module.Key) && usedPMs.Contains(module.Key) && _vacSchedulers[module.Key].IsAvailable && _vacModules[module.Key].MovingStatus == MovingStatus.Idle) 
															 | 
															
															 | 
															
																                 if (ModuleHelper.IsPm(module.Key) && usedPMs.Contains(module.Key) && _vacSchedulers[module.Key].IsAvailable && _vacModules[module.Key].MovingStatus == MovingStatus.Idle) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     var wafer = WaferManager.Instance.GetWafer(module.Key, 0); 
															 | 
															
															 | 
															
																                     var wafer = WaferManager.Instance.GetWafer(module.Key, 0); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if(wafer.IsEmpty) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (wafer.IsEmpty) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         Empty++; 
															 | 
															
															 | 
															
																                         Empty++; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    else if(wafer.ProcessState == EnumWaferProcessStatus.Completed) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    else if (wafer.ProcessState == EnumWaferProcessStatus.Completed) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         Processed++; 
															 | 
															
															 | 
															
																                         Processed++; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2295,7 +2293,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             if (_lstReturnWafers.Count == 0) 
															 | 
															
															 | 
															
																             if (_lstReturnWafers.Count == 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 return false; 
															 | 
															
															 | 
															
																                 return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            for(int i = 0; i < 2; i++) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            for (int i = 0; i < 2; i++) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, i)) 
															 | 
															
															 | 
															
																                 if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, i)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2315,12 +2313,12 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             foreach (var ll in lls) 
															 | 
															
															 | 
															
																             foreach (var ll in lls) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 int slotNumber = ll.Key == ModuleName.LLA ? _LLASlotNumber : _LLBSlotNumber; 
															 | 
															
															 | 
															
																                 int slotNumber = ll.Key == ModuleName.LLA ? _LLASlotNumber : _LLBSlotNumber; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                for(int i = 0; i < slotNumber; i++) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                for (int i = 0; i < slotNumber; i++) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 { 
															 | 
															
															 | 
															
																                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     if (_efemMovingItems.Count >= 2) 
															 | 
															
															 | 
															
																                     if (_efemMovingItems.Count >= 2) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         return true; 
															 | 
															
															 | 
															
																                         return true; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    if(WaferManager.Instance.CheckHasWafer(ll.Key, i)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    if (WaferManager.Instance.CheckHasWafer(ll.Key, i)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         var wafer = WaferManager.Instance.GetWafer(ll.Key, i); 
															 | 
															
															 | 
															
																                         var wafer = WaferManager.Instance.GetWafer(ll.Key, i); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         var robotHand = GetEFEMRobotFreeHand(); 
															 | 
															
															 | 
															
																                         var robotHand = GetEFEMRobotFreeHand(); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2392,7 +2390,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             if (!string.IsNullOrEmpty(recipeName)) 
															 | 
															
															 | 
															
																                             if (!string.IsNullOrEmpty(recipeName)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             { 
															 | 
															
															 | 
															
																                             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 var recipeContent = 
															 | 
															
															 | 
															
																                                 var recipeContent = 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                    RecipeFileManager.Instance.LoadRecipe($"{module}", recipeName, false,"Process"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                    RecipeFileManager.Instance.LoadRecipe($"{module}", recipeName, false, "Process"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 if (string.IsNullOrEmpty(recipeContent)) 
															 | 
															
															 | 
															
																                                 if (string.IsNullOrEmpty(recipeContent)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 { 
															 | 
															
															 | 
															
																                                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     reason = $"Can not find recipe file{recipeName}"; 
															 | 
															
															 | 
															
																                                     reason = $"Can not find recipe file{recipeName}"; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2522,13 +2520,13 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         else 
															 | 
															
															 | 
															
																                         else 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         { 
															 | 
															
															 | 
															
																                         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             var curItem = _movingItems.Find(item => item.DestinationModule == tar.Key.Module && item.DestinationSlot == tar.Key.Slot); 
															 | 
															
															 | 
															
																                             var curItem = _movingItems.Find(item => item.DestinationModule == tar.Key.Module && item.DestinationSlot == tar.Key.Slot); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            if(ModuleHelper.IsPm(curItem.SourceModule) && _movingItems.FindIndex(item => item.DestinationModule == curItem.SourceModule) == -1) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                            if (ModuleHelper.IsPm(curItem.SourceModule) && _movingItems.FindIndex(item => item.DestinationModule == curItem.SourceModule) == -1) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             { 
															 | 
															
															 | 
															
																                             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                if(_waitPostCleanPMs.Contains(curItem.SourceModule)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                if (_waitPostCleanPMs.Contains(curItem.SourceModule)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 { 
															 | 
															
															 | 
															
																                                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     _vacModules[curItem.SourceModule].MovingStatus = MovingStatus.WaitPostJobClean; 
															 | 
															
															 | 
															
																                                     _vacModules[curItem.SourceModule].MovingStatus = MovingStatus.WaitPostJobClean; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 } 
															 | 
															
															 | 
															
																                                 } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                                else if(_waitWTWCleanPMs.Contains(curItem.SourceModule)) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                                else if (_waitWTWCleanPMs.Contains(curItem.SourceModule)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 { 
															 | 
															
															 | 
															
																                                 { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                     _vacModules[curItem.SourceModule].MovingStatus = MovingStatus.WaitWTWClean; 
															 | 
															
															 | 
															
																                                     _vacModules[curItem.SourceModule].MovingStatus = MovingStatus.WaitWTWClean; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                                 } 
															 | 
															
															 | 
															
																                                 } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2665,9 +2663,9 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     { 
															 | 
															
															 | 
															
																                     { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         startJob.JetState = EnumJetCtrlJobState.PreJobClean; 
															 | 
															
															 | 
															
																                         startJob.JetState = EnumJetCtrlJobState.PreJobClean; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         _waitPreCleanPMs.Clear(); 
															 | 
															
															 | 
															
																                         _waitPreCleanPMs.Clear(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                             
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         var PMs = GetWaitPreCleanPMsByCtrlJob(startJob); 
															 | 
															
															 | 
															
																                         var PMs = GetWaitPreCleanPMsByCtrlJob(startJob); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        foreach(var pm in PMs) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                        foreach (var pm in PMs) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         { 
															 | 
															
															 | 
															
																                         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                             _waitPreCleanPMs.Add(pm); 
															 | 
															
															 | 
															
																                             _waitPreCleanPMs.Add(pm); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         } 
															 | 
															
															 | 
															
																                         } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2696,7 +2694,7 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             } 
															 | 
															
															 | 
															
																             } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																             var preJobClean = _lstControlJobs.Find(job => job.JetState == EnumJetCtrlJobState.PreJobClean); 
															 | 
															
															 | 
															
																             var preJobClean = _lstControlJobs.Find(job => job.JetState == EnumJetCtrlJobState.PreJobClean); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            if(preJobClean != null && _waitPreCleanPMs.Count == 0) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (preJobClean != null && _waitPreCleanPMs.Count == 0) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             { 
															 | 
															
															 | 
															
																             { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                 preJobClean.JetState = EnumJetCtrlJobState.Processing; 
															 | 
															
															 | 
															
																                 preJobClean.JetState = EnumJetCtrlJobState.Processing; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -2740,6 +2738,22 @@ namespace Venus_RT.Modules 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             return false; 
															 | 
															
															 | 
															
																             return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         } 
															 | 
															
															 | 
															
																         } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        private bool IsWaferCtrlJobRuning(ModuleName mod, int slot) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            var wafer = WaferManager.Instance.GetWafer(mod, slot); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if (wafer.IsEmpty || wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            var waferCtrlJob = _lstControlJobs.Find(item => (int)ModuleHelper.Converter(item.Module) == wafer.OriginStation); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            if(waferCtrlJob != null) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                return waferCtrlJob.State == EnumControlJobState.Executing; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+            return false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         private bool CheckAllWaferReturned(ProcessJobInfo pj, bool checkAllProcessed) 
															 | 
															
															 | 
															
																         private bool CheckAllWaferReturned(ProcessJobInfo pj, bool checkAllProcessed) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         { 
															 | 
															
															 | 
															
																         { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             bool allWaferReturn = true; 
															 | 
															
															 | 
															
																             bool allWaferReturn = true; 
															 |