Browse Source

fix the bug in SEMFSwapRoutine

zhouhr 10 months ago
parent
commit
01f4eaa5de

+ 2 - 0
Venus/Venus_MainPages/ViewModels/DETMOperationViewModel.cs

@@ -409,6 +409,8 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"DETM.PMCSlitDoorClosed");
             m_RtDataKeys.Add($"DETM.PMDSlitDoorClosed");
             m_RtDataKeys.Add($"DETM.TMVACSensor.Value");
+            m_RtDataKeys.Add($"LP1.CassettePlaced");
+            m_RtDataKeys.Add($"LP2.CassettePlaced");
 
             m_RtDataKeys.Add($"DETM.TMIsATM");
             m_RtDataKeys.Add($"DETM.VCEAIsATM");

+ 2 - 2
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFSwapRoutine.cs

@@ -168,11 +168,11 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _currentAction = _actionList.Peek();
             if (ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.SourceModule)) && ModuleHelper.IsTMRobot(_currentAction.DestinationModule))
             {
-                return _vceModule.IsIdle && _vceModule.CurrentSlot == _currentAction.SourceSlot;
+                return _vceModule.IsIdle && _vceModule.MoveSlot == (_currentAction.SourceSlot);
             }
             if (ModuleHelper.IsTMRobot(_currentAction.SourceModule) && ModuleHelper.IsVCE(VCE2LP.QueryLP2VCE(_currentAction.DestinationModule)))
             {
-                return _vceModule.IsIdle && _vceModule.CurrentSlot == _currentAction.DestinationSlot;
+                return _vceModule.IsIdle && _vceModule.MoveSlot == (_currentAction.DestinationSlot);
             }
             return false;
         }

+ 16 - 3
Venus/Venus_RT/Modules/VCE/VceEntity.cs

@@ -119,12 +119,13 @@ namespace Venus_RT.Modules.VCE
         public bool CassetteArrive => _CassetteArrive;
 
         public int CurrentSlot => _vce.CurrentSlot;
+        public int MoveSlot => moveSlot;
 
         public VCEModuleBase VCEDevice => _vce;
 
-
         //public int CurrentSlot => currentSlot;
-        private int targetSlot;
+        private int targetSlot = -1;
+        private int moveSlot = -1;
         private VCEHomeRoutine _homeRoutine;
         private LoadRoutine _loadRoutine;
         private LoadPrepareRoutine _prepareRoutine;
@@ -403,6 +404,10 @@ namespace Venus_RT.Modules.VCE
                 PostMsg(VceMSG.Error);
                 return false;
             }
+            if (_vce.Status == RState.End)
+            {
+                moveSlot = -1;
+            }
             return _vce.Status == RState.End;
         }
 
@@ -627,7 +632,10 @@ namespace Venus_RT.Modules.VCE
                 PostMsg(VceMSG.Error);
                 return false;
             }
-            
+            if (_vce.Status == RState.End)
+            {
+                moveSlot = targetSlot;
+            }
             return _vce.Status == RState.End;
         }
 
@@ -649,6 +657,11 @@ namespace Venus_RT.Modules.VCE
                 PostMsg(VceMSG.Error);
                 return false;
             }
+            if (ret == RState.End)
+            {
+                moveSlot = -1;
+            }
+
             return ret == RState.End;
         }