瀏覽代碼

update vertical position

chenkui 4 天之前
父節點
當前提交
8891b24643

+ 40 - 26
PunkHPX8_RT/Modules/PlatingCell/PlatingCellEntity.cs

@@ -91,10 +91,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// 工艺当前执行小步骤
         /// </summary>
         private string _currentStepState = "Init";
-        /// <summary>
-        /// 当前是否在跑dummy recipe
-        /// </summary>
-        private bool _isCurrentRunDummyRecipe;
         #endregion
 
         #region 属性
@@ -205,16 +201,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// 当前工步
         /// </summary>
         public string CurrentStepState { get { return _currentStepState; } }
-        /// <summary>
-        /// 是否正在跑dummy recipe
-        /// </summary>
-        public bool IsCurrentRunDummyRecipe
-        {
-            get
-            {
-                return _isCurrentRunDummyRecipe;
-            }
-        }
         #endregion
 
         /// <summary>
@@ -344,8 +330,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             //Cycle Manual Process
             Transition(PlatingCellState.Idle, PlatingCellMsg.RunRecipe, CycleManualProcess, PlatingCellState.RunReciping);
             Transition(PlatingCellState.RunReciping, FSM_MSG.TIMER, CycleManualMonitor, PlatingCellState.Idle);
-            Transition(PlatingCellState.RunReciping, PlatingCellMsg.Abort, RunRecipeAbort, PlatingCellState.Idle);
-            Transition(PlatingCellState.RunReciping, PlatingCellMsg.Abort, AbortRecipe, PlatingCellState.Abort);
+            Transition(PlatingCellState.RunReciping, PlatingCellMsg.Abort, AbortRecipe, PlatingCellState.Idle);
             //Unload
             Transition(PlatingCellState.Idle, PlatingCellMsg.Unload, Unload, PlatingCellState.Unloading);
             Transition(PlatingCellState.Unloading, FSM_MSG.TIMER, UnloadMonitor, PlatingCellState.Idle);
@@ -370,13 +355,21 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 return 0;
             }
             int remainTime = 0;
-            if(_recipeTime != 0 && !_isCurrentRunDummyRecipe)
+            if (WaferInfo == null || WaferInfo.IsEmpty)
             {
-                remainTime = (int)(_recipeTime - Math.Round((double)_runRecipeRoutine.ElapsedMilliseconds / 1000));
+                return 0;
             }
-            if (_recipeTime != 0 &&  _isCurrentRunDummyRecipe)
+
+            if (_recipeTime != 0)
             {
-                remainTime = (int)(_recipeTime - Math.Round((double)_dummyRinseRunRecipeRoutine.ElapsedMilliseconds / 1000));
+                if (WaferInfo.WaferType == WaferType.Production)
+                {
+                    remainTime = (int)(_recipeTime - Math.Round((double)_runRecipeRoutine.ElapsedMilliseconds / 1000));
+                }
+                else
+                {
+                    remainTime = (int)(_recipeTime - Math.Round((double)_dummyRinseRunRecipeRoutine.ElapsedMilliseconds / 1000));
+                }
             }
             return remainTime;
 
@@ -388,8 +381,12 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         public bool AbortRecipe(object[] param)
         {
+            if (WaferInfo == null || WaferInfo.IsEmpty)
+            {
+                return true;
+            }
             //后续还要增加lottrack相关
-            if (!_isCurrentRunDummyRecipe)
+            if (WaferInfo.WaferType==WaferType.Production)
             {
                 _runRecipeRoutine.Abort();
                
@@ -565,10 +562,21 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         private bool CycleManualProcess(object[] param)
         {
+            if (WaferInfo == null || WaferInfo.IsEmpty)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module.ToString(), "Wafer is empty");
+                return false;
+            }
             bool _isDummyLoad = (bool)param[1];
+
+            if (_isDummyLoad && WaferInfo.WaferType == WaferType.Production)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module.ToString(), "production wafer cannot execute dummy recipe");
+                return false;
+            }
+
             if (!_isDummyLoad)
             {
-                _isCurrentRunDummyRecipe = false;
                 bool result = _runRecipeRoutine.Start(param) == RState.Running;
                 _currentStepState = "";
                 DepRecipe recipe = param[0] as DepRecipe;
@@ -583,7 +591,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             }
             else
             {
-                _isCurrentRunDummyRecipe = true;
                 bool result = _dummyRinseRunRecipeRoutine.Start(param) == RState.Running;
                 _currentStepState = "";
                 DqdrRecipe recipe = param[0] as DqdrRecipe;
@@ -603,7 +610,15 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         private bool CycleManualMonitor(object[] param)
         {
-            if (!_isCurrentRunDummyRecipe)
+            if (WaferInfo == null || WaferInfo.IsEmpty)
+            {
+                PostMsg(PlatingCellMsg.Error);
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module.ToString(), "Wafer is empty");
+                _currentStepState = "";
+                _currentRecipe = null;
+                return false;
+            }
+            if (WaferInfo.WaferType==WaferType.Production)
             {
                 RState state = _runRecipeRoutine.Monitor();
                 _currentStepState = _runRecipeRoutine.CurrentStep;
@@ -644,8 +659,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                     _currentRecipe = null;
                 }
                 return result;
-            }
-           
+            }           
         }
         /// <summary>
         /// 中止

+ 1 - 1
PunkHPX8_RT/Modules/PlatingCell/PlatingCellVerticalEntity.cs

@@ -99,7 +99,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <summary>
         /// 是否在Load位置
         /// </summary>
-        public bool IsInLoad { get { return _verticalAxis.CheckPositionIsInStation(_verticalAxis.MotionData.MotorPosition, "Load"); } }
+        public bool IsInLoad { get { return _verticalAxis.CheckPositionIsInStation("Load"); } }
         /// <summary>
         /// 电机是否Home
         /// </summary>

+ 2 - 13
PunkHPX8_RT/Modules/PlatingCell/PlatingCellVerticalPositionRoutine.cs

@@ -119,7 +119,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
 
             string firstCurrentStep = _cellEntities[0].CurrentStepState;
             string secondCurrentStep = _cellEntities[1].CurrentStepState;
-            if(_cellEntities[0].IsCurrentRunDummyRecipe || _cellEntities[1].IsCurrentRunDummyRecipe)
+            if(firstWafer.WaferType==WaferType.Assit || secondWafer.WaferType==WaferType.Assit)
             {
                 //其中一个是dummy recipe,直接返回true
                 return true;
@@ -129,18 +129,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             {
                 return firstCurrentStep == secondCurrentStep;
             }
-            else
-            {
-                //dummy reclaim/rinse/dry与生产片一致
-                if (secondCurrentStep.StartsWith("Reclaim") || secondCurrentStep.StartsWith("Rinse") || secondCurrentStep.StartsWith("Dry"))
-                {
-                    return firstCurrentStep==secondCurrentStep;
-                }
-                else
-                {
-                    return true;
-                }
-            }
+            return true;
         }
         /// <summary>
         /// vertical 运动到位置