瀏覽代碼

fix the manual move wafer bug while single arm option bigger than 2.

sangwq 11 月之前
父節點
當前提交
1b2d4bb89d
共有 2 個文件被更改,包括 18 次插入7 次删除
  1. 9 0
      Venus/Venus_RT/Modules/ManualTransfer.cs
  2. 9 7
      Venus/Venus_RT/Modules/SystemDispatcher.cs

+ 9 - 0
Venus/Venus_RT/Modules/ManualTransfer.cs

@@ -50,6 +50,15 @@ namespace Venus_RT.Modules
 
         public RState Start(params object[] objs)
         {
+            _tmRobotSingleArmOption = SC.GetValue<int>("TM.SingleArmOption");
+            _efemRobotSingleArmOption = SC.GetValue<int>("EFEM.SingleArmOption");
+
+            // rounding the single arm option
+            if (_tmRobotSingleArmOption > 2)
+                _tmRobotSingleArmOption = 0;
+            if (_efemRobotSingleArmOption > 2)
+                _efemRobotSingleArmOption = 0;
+
             // RESET
             _moveTaskQueue.Clear();
             _moving_status = MovingStatus.Idle;

+ 9 - 7
Venus/Venus_RT/Modules/SystemDispatcher.cs

@@ -2415,15 +2415,20 @@ namespace Venus_RT.Modules
 
         private bool IsMovingActionsDone(List<MoveItem> actions)
         {
+            bool CheckWaferExistence(ModuleName mod, int slot)
+            {
+                return ModuleHelper.IsLoadPort(mod) ? WaferManager.Instance.CheckHasWafer(mod, slot) : _lstWaferTasks.Exists(wt => wt.currentMod == mod && wt.currentSlot == slot);
+            }
+
             if(actions.Count == 1)
             {
-                if (_lstWaferTasks.Exists(wt => wt.currentMod == actions.First().SourceModule && wt.currentSlot == actions.First().SourceSlot) || 
-                    !_lstWaferTasks.Exists(wt => wt.currentMod == actions.First().DestinationModule && wt.currentSlot == actions.First().DestinationSlot) && 
-                    !ModuleHelper.IsLoadPort(actions.First().DestinationModule))
+                if ( CheckWaferExistence(actions.First().SourceModule, actions.First().SourceSlot) ||
+                    !CheckWaferExistence(actions.First().DestinationModule, actions.First().DestinationSlot) )
                     return false;
             }
             else
             {
+                // initialize all the wafer existance before move
                 var slotWafers = new Dictionary<KeyValuePair<ModuleName, int>, bool>();
                 foreach (var ac in actions)
                 {
@@ -2468,10 +2473,7 @@ namespace Venus_RT.Modules
 
                 foreach (var slot in slotWafers)
                 {
-                    if (ModuleHelper.IsLoadPort(slot.Key.Key) && slot.Value)
-                        continue;
-
-                    if (slot.Value != _lstWaferTasks.Exists(wt => wt.currentMod == slot.Key.Key && wt.currentSlot == slot.Key.Value))
+                    if (slot.Value != CheckWaferExistence(slot.Key.Key, slot.Key.Value))
                         return false;
                 }
             }