Quellcode durchsuchen

1 revise dummy rinse start bug
2 revise dep routine time calculate

chenzk vor 1 Tag
Ursprung
Commit
c4594c6a55

+ 8 - 1
PunkHPX8_RT/Modules/PlatingCell/DummyRinseRunRecipeRoutine.cs

@@ -294,7 +294,14 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             _platingCellEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellEntity>(Module);
             //获取match的platingcell的dep recipe
             _matchPlatingCellEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellEntity>(MatchModule);
-            _matchPlatingCellDepDeprecipe = (DepRecipe)SequenceRecipeManager.Instance.LoadSequenceTypeRecipe("Production", _recipe.LinkedDepRecipeName, MECF.Framework.Common.RecipeCenter.RecipeType.DEP);
+            if (_matchPlatingCellEntity.IsAuto)
+            {
+                _matchPlatingCellDepDeprecipe = (DepRecipe)SequenceRecipeManager.Instance.LoadSequenceTypeRecipe("Production", _recipe.LinkedDepRecipeName, MECF.Framework.Common.RecipeCenter.RecipeType.DEP);
+            }
+            else
+            {
+                _matchPlatingCellDepDeprecipe = (DepRecipe)SequenceRecipeManager.Instance.LoadSequenceTypeRecipe("Engineering", _recipe.LinkedDepRecipeName, MECF.Framework.Common.RecipeCenter.RecipeType.DEP);
+            }
             //获取对应reservoir eneity
             string reservoir = ReservoirItemManager.Instance.GetReservoirByPlatingCell(Module);
             _reservoirEntity = Singleton<RouteManager>.Instance.GetModule<ReservoirEntity>(reservoir);

+ 8 - 8
PunkHPX8_RT/Modules/PlatingCell/PlatingCellDepositionRoutine.cs

@@ -33,6 +33,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             LoopRecordRotationStartTime,
             LoopRotationStartIfCurrentIsStoped,//如果当前电机是停止状态,启动起来
             LoopRotationChangeSpeed,
+            LoopCalculateRotationDelayTime,
             LoopRotationDelay,
 
             LoopRotationStopIfCurrentIsRuning, //如果当前电机是启动状态,则停止
@@ -85,9 +86,9 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         private RotationBiDirectionRoutine _rotationBiDirectionRoutine;
         /// <summary>
-        /// Plating启动时间
+        /// 电镀单步延迟等待时间(recipe的时间减去rotation启动的时间,单位ms)
         /// </summary>
-        private DateTime _platingStartTime;
+        private int _singalStepDelayTime;
         /// <summary>
         /// 当前执行到电镀步骤的索引
         /// </summary>
@@ -131,7 +132,8 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 .LoopRunIf(RunRecipeStep.LoopRotationStartIfCurrentIsStoped, CheckRotationIsIdle() && !_recipe.DepSteps[_depositionStepIndex].BiDireaction,
                    () => { return StartRotation(ROTATION_FAR_POSITION, _recipe.DepSteps[_depositionStepIndex].PlatingSpeed); }, _delay_1ms)
                 .LoopRunIf(RunRecipeStep.LoopRotationChangeSpeed, !_recipe.DepSteps[_depositionStepIndex].BiDireaction && !CheckRotationIsIdle(), () => ChangeRotationSpeed(_recipe.DepSteps[_depositionStepIndex].PlatingSpeed),_delay_1ms)
-                .LoopDelayIf(RunRecipeStep.LoopRotationDelay, !_recipe.DepSteps[_depositionStepIndex].BiDireaction, CalculateActualDepStepTime(_recipe.DepSteps[_depositionStepIndex].DurartionSeconds * 1000))
+                .LoopRunIf(RunRecipeStep.LoopCalculateRotationDelayTime, !_recipe.DepSteps[_depositionStepIndex].BiDireaction , CalculateActualDepStepTime, _delay_1ms)
+                .LoopDelayIf(RunRecipeStep.LoopRotationDelay, !_recipe.DepSteps[_depositionStepIndex].BiDireaction, _recipe.DepSteps[_depositionStepIndex].DurartionSeconds * 1000 - _singalStepDelayTime)
                 
                 //带双向旋转,启动双向旋转的routine(如果当前电机是启动状态,则停止)
                 .LoopRunIf(RunRecipeStep.LoopRotationStopIfCurrentIsRuning, checkRotationIsRunning() && _recipe.DepSteps[_depositionStepIndex].BiDireaction,
@@ -163,12 +165,11 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// </summary>
         /// <returns>返回值单位ms</returns>
         /// <param name="recipetime"> 单位ms</param>
-        private int CalculateActualDepStepTime(int recipetime)
+        private bool CalculateActualDepStepTime()
         {
-            int actualTime = 0;
             _stopwatch.Stop();
-            actualTime = recipetime - (int)_stopwatch.ElapsedMilliseconds;
-            return actualTime;
+            _singalStepDelayTime =  (int)_stopwatch.ElapsedMilliseconds;
+            return true;
         }
         /// <summary>
         /// 判断当前电机是否在转
@@ -218,7 +219,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 _device.PowerSupplier.DisableOperation("", null);
                 return false;
             }
-            _platingStartTime = DateTime.Now;
             return true;
         }
         /// <summary>