IntelliWizard© - UML StateWizard

An open source software under LGPL license.


Start Page

Introduction ...
What State Machine
Why State Machine
Running Environment
License Policy

Features


Product Family
API Set
Demo & Manual

Downloads

Installation
Engine Source Code

Users & Partners


User Stories
Forums



Demo & Quick User Manual

StateWizard is a popup menu driven add-in for an IDE like Visual Studio. After installing StateWizard, in VC6/EVC4 open add-in manager through Tool/Customize/Add-ins. If you have the Toolbar already, close the current open workspace. Then reopen a VC6 workspace to get the StateTree tab window. The StateWizard creates StateTree tab window upon workspace creation.

For VS2003/VS2005, this add-in is automatically enabled. And it will provide a tool bar for you. Click "Show" button in the StateWizard tool bar, StateWizard will show the StateTree window. In the StateTree window, you can create a new state machine application into the selected project. You can add a new state into the selected application or state. Futher more you can construct a state machine using the StateChart too.

The StateWizard VC++ add-in can assist users to develop state machine applications based on the application framework API set. The add-in provides user-friendly visual presentation for state machine applications through the structured StateWizard API, the State Tree, the State Chart, and the State Tracking.

For installation information, please visit http://www.intelliwizard.com/installation.htm .

For example, a player state machine application is comprised of (PowerDown, PowerUp (Pause, Playing), Cond1, Join1) states.

  • The State Chart

The State Chart graphically displays the state hierarchy, with child states nested within their parent state. The arrow from one state to another state represents the state's transitions. Click an arrow, a state transition. Clicking an arrow will display a state transition table between these two states.

The State Chart provides the following commands:

  • New state
  • Add an event handler
  • Go to state entry/exit function
  • Go to an event handler function
  • Save the state chart as a bitmap file
  • Save the state chart as a text file

Figure: The State Chart

  • The StateWizard API

The StateWizard API is for defining Statecharts. This API set is easy to use and very straight forward. It is a very simple task to manually convert a statechart drawing to the set of tables required by the StateWizard in order to run the state machine. The state machine definitions can be generated by the StateWizard too.

#ifdef SME_CURR_DEFAULT_PARENT
#undef SME_CURR_DEFAULT_PARENT
#endif
#define SME_CURR_DEFAULT_PARENT Player

SME_BEGIN_ROOT_COMP_STATE_DEF(Player, PlayerEntry, PlayerExit)
SME_ON_INIT_STATE(SME_NULL_ACTION, PowerDown)
SME_END_STATE_DEF

SME_BEGIN_LEAF_STATE_DEF_P(PowerDown, PowerDownEntry, PowerDownExit)
SME_ON_EVENT_WITH_GUARD(EXT_EVENT_ID_POWER, Guard1_func, OnPowerDownEXT_EVENT_ID_POWER, Join1)
SME_END_STATE_DEF

SME_BEGIN_SUB_STATE_DEF_P(PowerUp)
SME_ON_EVENT(EXT_EVENT_ID_POWER,OnPowerUpEXT_EVENT_ID_POWER,PowerDown)
SME_END_STATE_DEF

enum {COND_EV_COND1, COND_EV_COND2};
SME_BEGIN_COND_STATE_DEF_P(Cond1, Cond1_func)
SME_ON_EVENT(COND_EV_COND1, CondAct1, Playing)
SME_ON_EVENT(COND_EV_COND2, CondAct2, Pause)
SME_ON_EVENT(SME_EVENT_COND_ELSE, CondActElse, PowerUp)
SME_END_STATE_DEF

SME_BEGIN_JOIN_STATE_DEF_P(Join1)
SME_ON_JOIN_TRAN(JoinAct, Cond1)
SME_END_STATE_DEF

#ifdef SME_CURR_DEFAULT_PARENT
#undef SME_CURR_DEFAULT_PARENT
#endif
#define SME_CURR_DEFAULT_PARENT PowerUp

SME_BEGIN_COMP_STATE_DEF(PowerUp, Player, PowerUpEntry, PowerUpExit)
SME_ON_INIT_STATE(SME_NULL_ACTION, Playing)
SME_END_STATE_DEF

SME_BEGIN_LEAF_STATE_DEF_P(Playing, PlayingEntry, PlayingExit)
SME_ON_EVENT(EXT_EVENT_ID_PAUSE_RESUME,OnPlayingEXT_EVENT_ID_PAUSE_RESUME,Pause)
SME_ON_INTERNAL_TRAN_WITH_GUARD(SME_EVENT_TIMER,GuardTimer2_func,OnTimer2Proc)
SME_END_STATE_DEF

SME_BEGIN_LEAF_STATE_DEF_P(Pause, PauseEntry, PauseExit)
SME_ON_EVENT(EXT_EVENT_ID_PAUSE_RESUME,OnPauseEXT_EVENT_ID_PAUSE_RESUME,Playing)
SME_END_STATE_DEF

  • The State Tree

The StateWizard provided in the State Tree is a tool that helps you create and manage the state machines in your program. The StateWizard works with the state machines you create initially. The StateWizard also lets you browse and edit the state machines in your program. You can create state machines, construct state hierarchy, define event handlers and navigate through your files, and more.

The State Tree provides the following commands:

  • Create a state machine application
  • New a state
  • Add an event handler
  • Go to the state definition in source file by double-clicking a state item
  • Go to the state declaration in header file
  • Go to an event handler function

Figure: The State Tree

  • The State Tracking

The StateTree can highlight the application state transitions while a program is running. Meanwhile the StateWizard directs the state tracking log data to the output window in VC and a text file whose name is defined by the macro SME_DEF_DBGLOG_FILE. More than one object can be derived from a state machine. Only the state transitions of one object derived from a state machine can be highlighted in the StateTree at a time. SME_HIGHLIGHT_OBJECT(root,object) is used to highlight a specified object's state transitions.

Figure: The State Tracking

Figure: State Tracking Data Log to VS2005

Figure: State Tracking Data Log to VC6

  • The State Machine Parser

When a workspace is open, or a source file is saved, the state machine parser will scan the source code and then update the State Tree. If errors are identified, the Parser will report them into the output window in VC++.

Figure: The State Machine Parser

  • New State

By selecting a state and right clicking it, you can open the state dialog. Using the state dialog, you can

  • New a leaf state
  • New a composite state
  • New a orthogonal state
  • New a join pseudo state
  • New a conditional pseudo state

 

Figure: New State

  • Add an Event Handler

By selecting a state and right clicking it, you can open the event handler dialog. Using the event handler dialog, you can

  • Add a built-in state timer
  • Add an event handler
  • Add an event handler with a guard
  • Add an internal transition

 

Figure: New Event Handler


Copyright 2007 IntelliWizard Inc. All Rights Reserved.