MiceOnABeam Product Documentation

Modified: 4/26/2013 3:49 PM
Recently changed articles You can subscribe to this wiki article using an RSS feed reader.

Tutorial - Step 10

Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Next



 

  • At this point we are going to make use of one of the signature modeling features of MiceOnABeam, and that is the ability to create a Composite State by breaking down a state into one or more substates. To get started, right-click on the state On and select Open State

 

  • A new State Editor is then opened showing the decomposition of the state On. Note the title bar of this window shows the state name qualified by the state it is contained in; in this case the top-level state of the state machine which takes on the name of the script, TriColorLight.

  • Using the techniques learned earlier, create three states, GreenLight, RedLight, and BlueLight and arrange them as above. You will need to enlarge the State Editor window by click-dragging on the bottom side to make room for all three states.
  • Then create the following three transitions:
    • Initial Point to the GreenLight state;
    • GreenLight state to the RedLight state;
    • RedLight state to the BlueLight state;
  • Set the event on the latter two transitions to the timer event.
  • Note that we are not connecting any transition to either the Entry or Exit Points. An unconnected Entry Point invokes the Default Entry action, which tells the model to take the transition from the Initial Point to the default state for the decomposition.
  • An Exit Point, with no internal connection, operates as a Group Transition, another powerful modeling feature. The Group Transition here acts just as if a transition had been drawn from every substate of the Composite State to the Exit Point. The event that is used for these implied transitions is the one that is defined on the transition named touch_end leading out from the On state to the Off state.

Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Next

Tags:
Home: MiceOnABeam Product Documentation Copyright © 2010-2018 MiceOnABeam Software