Ejemplo n.º 1
0
        /// <summary>
        ///     Update the information stored in the position handler according to the time line
        /// </summary>
        protected override void UpdatePositionHandler()
        {
            PositionHandler.CleanPositions();
            if (TimeLine != null)
            {
                List <ModelEvent> events = new List <ModelEvent>(TimeLine.Events);
                foreach (ModelEvent evt in events)
                {
                    if (FilterConfiguration.VisibleEvent(evt) || evt is SubStepActivated)
                    {
                        PositionHandler.RegisterEvent(evt);
                    }
                }
            }

            base.UpdatePositionHandler();

            // Scroll to the end of the execution
            int drawWidth = DrawArea.Size.Width;

            if (VScroll)
            {
                drawWidth = drawWidth + SystemInformation.VerticalScrollBarWidth;
            }
            int val = drawWidth - Size.Width;

            val = Math.Max(HorizontalScroll.Minimum, val);
            val = Math.Min(HorizontalScroll.Maximum, val);
            HorizontalScroll.Value = Math.Max(0, val);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Update the information stored in the position handler according to the test case
        /// </summary>
        protected override void UpdatePositionHandler()
        {
            Util.DontNotify(() =>
            {
                PositionHandler.CleanPositions();
                if ((TestCase != null) || SubSequence != null)
                {
                    double currentTime = 0.0;
                    foreach (Step step in Steps)
                    {
                        if (step.SubSteps.Count > 0)
                        {
                            foreach (SubStep subStep in step.SubSteps)
                            {
                                PositionSubStep(currentTime, subStep);
                                currentTime += 1;
                            }
                        }
                        else
                        {
                            StepActivation stepActivated = new StepActivation(step)
                            {
                                Time = currentTime
                            };
                            PositionHandler.RegisterEvent(stepActivated);
                            currentTime += 1;
                        }
                    }
                }
                else if (Translation != null)
                {
                    double currentTime = 0.0;
                    if (Translation.SubSteps.Count > 0)
                    {
                        foreach (SubStep subStep in Translation.SubSteps)
                        {
                            PositionSubStep(currentTime, subStep);
                            currentTime += 1;
                        }
                    }
                }
            });

            base.UpdatePositionHandler();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Positions a substep in the time line
        /// </summary>
        /// <param name="currentTime"></param>
        /// <param name="subStep"></param>
        /// <returns></returns>
        private void PositionSubStep(double currentTime, SubStep subStep)
        {
            SubStepActivated subStepActivated = new SubStepActivated(subStep, null)
            {
                Time = currentTime
            };

            PositionHandler.RegisterEvent(subStepActivated);
            foreach (Action action in subStep.Actions)
            {
                VariableUpdate variableUpdate = new VariableUpdate(action, action, null);
                PositionHandler.RegisterEvent(variableUpdate);
            }
            foreach (Expectation expectation in subStep.Expectations)
            {
                Expect expect = new Expect(expectation, null);
                PositionHandler.RegisterEvent(expect);
            }
        }