コード例 #1
0
        private void waitForCommand(Node node, IList <StageVariable> executionVariables)
        {
            this.executingNode = node;

            Boolean exerciseHasFinished = ExpressionResolver.ResolveBoolen(
                ExpressionResolver.GetSentenceToEvaluate(executionVariables, new CultureInfo("en-US"), "T > TF")
                );

            if (!this.executingNode.canBeDebugged && !this.subDiagramHasStarted)
            {
                this.jumpToNextNode = true;
            }
            else
            {
                if (this.debugCommand.Equals(Mode.Continue))
                {
                    this.jumpToNextNode = this.executingNode.HasBreakPoint ? false : true;
                }
                if (this.debugCommand.Equals(Mode.ConditionedContinue))
                {
                    if (exerciseHasFinished)
                    {
                        this.conditionResult = false;
                        this.jumpToNextNode  = false;
                    }
                    else
                    {
                        string replacedCondition = ExpressionResolver.GetSentenceToEvaluate(executionVariables, new CultureInfo("en-US"), this.conditionExpresion.ToUpper());

                        if (!this.conditionResult)
                        {
                            this.conditionResult = ExpressionResolver.ResolveBoolen(replacedCondition);
                            this.jumpToNextNode  = true;
                        }
                        else
                        {
                            if (this.executingNode.HasBreakPoint)
                            {
                                this.conditionResult = false;
                                this.jumpToNextNode  = false;
                            }
                        }
                    }
                }
            }

            if (exerciseHasFinished)
            {
                this.debugCommand   = Debug.Mode.Finished;
                this.jumpToNextNode = false;
            }


            //Tengo que esperar hasta que se se tome una accion si estoy en debug (stepOver,StepInto,etc)
            while (!this.jumpToNextNode)
            {
                this.colorSignalEvent.Set();
                this.colorSignalEvent.Reset();
            }


            if (this.debugCommand.Equals(Mode.StepOver))
            {
                if (this.executingNode.GetType().ToString() == "Victoria.Shared.NodeDiagram")
                {
                    this.subDiagramHasStarted = true;
                    this.jumpToNextNode       = true;
                }
                else
                {
                    if (!this.subDiagramHasStarted)
                    {
                        this.jumpToNextNode = false;
                    }
                    else
                    {
                        //if (this.executingNode.NextNode == null)
                        if (this.executingNode.GetType().ToString() == "Victoria.Shared.Node")
                        {
                            this.subDiagramHasStarted = false;
                            this.jumpToNextNode       = false;
                        }
                    }
                }
            }
            if (this.debugCommand.Equals(Mode.StepInto))
            {
                this.jumpToNextNode = false;
            }
        }