瀏覽代碼

Enhance the routing algorithm.

sangwq 1 年之前
父節點
當前提交
78c3954cfc
共有 2 個文件被更改,包括 33 次插入5 次删除
  1. 32 5
      Venus/Venus_RT/Modules/AutoCycle.cs
  2. 1 0
      Venus/Venus_RT/Modules/LLs/LLEntity.cs

+ 32 - 5
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -154,10 +154,14 @@ namespace Venus_RT.Modules
 
         public RState Monitor()
         {
-            prelude();
-            driveAtmSystem();
-            driveVacSystem();
-            epilogue();
+            if(_cycleState == RState.Running)
+            {
+                prelude();
+                driveAtmSystem();
+                driveVacSystem();
+                epilogue();
+            }
+            
             return _cycleState;
         }
 
@@ -1215,7 +1219,30 @@ namespace Venus_RT.Modules
             }
             else
             {
-                return (_LLASlotNumber + _LLBSlotNumber) / 2 + pmWaferStatus.Item2 - GetTMRobotWaferCount() - GetEfemRoborWaferCount() - GetAtmInerWaferCount(); 
+                if(_vacSchedulers[ModuleName.LLA].IsOnline && !_vacSchedulers[ModuleName.LLB].IsOnline)
+                {
+                    return _LLASlotNumber - llaWaferStatus.Item1 - llaWaferStatus.Item2 
+                        - pmWaferStatus.Item1 - GetTMRobotWaferCount() 
+                        - GetEfemRoborWaferCount() - GetAtmInerWaferCount();
+                }
+                else if(!_vacSchedulers[ModuleName.LLA].IsOnline && _vacSchedulers[ModuleName.LLB].IsOnline)
+                {
+                    return _LLBSlotNumber - llbWaferStatus.Item1 - llbWaferStatus.Item2
+                        - pmWaferStatus.Item1 - GetTMRobotWaferCount()
+                        - GetEfemRoborWaferCount() - GetAtmInerWaferCount();
+                }
+                else if(_vacSchedulers[ModuleName.LLA].IsOnline && _vacSchedulers[ModuleName.LLB].IsOnline)
+                {
+                    return (_LLASlotNumber + _LLBSlotNumber) / 2 + pmWaferStatus.Item2
+                    - llaWaferStatus.Item1 - llaWaferStatus.Item2 - llbWaferStatus.Item1 - llbWaferStatus.Item2
+                    - GetTMRobotWaferCount() - GetEfemRoborWaferCount() - GetAtmInerWaferCount();
+                }
+                else
+                {
+                    _cycleState = RState.Failed;
+                    LOG.Write(eEvent.ERR_ROUTER, ModuleName.System, "Both LLA/LLB offline, stop runing.");
+                    return 0;
+                }
             }
         }
 

+ 1 - 0
Venus/Venus_RT/Modules/LLs/LLEntity.cs

@@ -275,6 +275,7 @@ namespace Venus_RT.Modules
 
         private bool fnHome(object[] param)
         {
+            IsOnline = true;
             return true;
         }