Example #1
0
        public override StateMachine createStateMachine()
        {
            StateMachine retVal = new Types.StateMachine();

            _defaultValueSetter.SetDefaultValue(retVal);

            return(retVal);
        }
Example #2
0
            /// <summary>
            ///     Creates the unified state machine
            /// </summary>
            /// <param name="obj"></param>
            /// <param name="visitSubNodes"></param>
            public override void visit(Generated.StateMachine obj, bool visitSubNodes)
            {
                StateMachine stateMachine = obj as StateMachine;

                if (stateMachine != null)
                {
                    stateMachine.ComputeUnifiedStateMachine();
                }

                base.visit(obj, visitSubNodes);
            }
Example #3
0
            /// <summary>
            ///     Updates the state machine : initial state has been moved to the default value
            /// </summary>
            /// <param name="obj"></param>
            /// <param name="visitSubNodes"></param>
            public override void visit(StateMachine obj, bool visitSubNodes)
            {
                Types.StateMachine stateMachine = (Types.StateMachine)obj;

                if (string.IsNullOrEmpty(stateMachine.getDefault()))
                {
                    stateMachine.setDefault(stateMachine.getInitialState());
                }
                stateMachine.setInitialState(null);

                base.visit(obj, visitSubNodes);
            }
Example #4
0
        public override void visit(BaseModelElement obj, bool visitSubNodes)
        {
            IExpressionable expressionable = obj as IExpressionable;

            if (expressionable != null)
            {
                // In case of rebuild, cleans the previously constructed tree
                if (Options.Rebuild)
                {
                    expressionable.CleanCompilation();
                }
                // Ensures that the expressionable is compiled
                expressionable.Compile();

                Structure structure = expressionable as Structure;
                if (structure != null)
                {
                    if (structure != structure.UnifiedStructure)
                    {
                        visit(structure.UnifiedStructure, visitSubNodes);
                    }
                }

                StateMachine stateMachine = expressionable as StateMachine;
                if (stateMachine != null)
                {
                    if (stateMachine != stateMachine.UnifiedStateMachine)
                    {
                        visit(stateMachine.UnifiedStateMachine, visitSubNodes);
                    }
                }
            }

            ITypedElement typedElement = obj as ITypedElement;

            if (typedElement != null)
            {
                // Ensures that the type of the corresponding element is cached
                Type type = typedElement.Type;
            }

            Function function = obj as Function;

            if (function != null)
            {
                Type returnType = function.ReturnType;
            }

            base.visit(obj, visitSubNodes);
        }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="panel"></param>
 /// <param name="model"></param>
 public StateMachineModelControl(ModelDiagramPanel panel, StateMachine model)
     : base(panel, model)
 {
 }
        public override StateMachine createStateMachine()
        {
            StateMachine retVal = new Types.StateMachine();

            _defaultValueSetter.SetDefaultValue(retVal);

            return retVal;
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="stateMachine"></param>
 public TransitionFinder(StateMachine stateMachine)
 {
     Utils.FinderRepository.INSTANCE.ClearCache();
     Transitions.Clear();
     StateMachine = stateMachine;
     Constants.State initialState = StateMachine.DefaultValue as Constants.State;
     if (initialState != null)
     {
         Transitions.Add(new Rules.Transition(null, null, null, initialState));
     }
 }