Click here to Skip to main content
15,881,173 members
Articles / Programming Languages / C#
Article

StateProto Beta - State Chart Designer for Qf4Net

Rate me:
Please Sign up or sign in to vote.
4.27/5 (5 votes)
5 Jul 20062 min read 33.9K   1.2K   36   2
Drawing state diagrams, and C# code generation for the modified QF4Net.

StateProto

Introduction

StateProto is a .NET application that provides a design surface on which you can draw State Diagrams. If the diagram is sufficiently detailed, then it becomes possible to generate C# code to run against the QF4Net State Engine.

Background

Qf4net is a C#/.NET port by Dr. Rainer Hessmer of the Quantum Hierarchichal State Machine Framework by Miro Samek.

Both of these frameworks are mainly the core State Machine execution engines. The advantage of the Quantum based frameworks is that they implement a Method-Per-State State Machine architecture which keeps the required boiler plate code both to a minimum and understandable. Even for this understandability, it still takes effort to write up the code manually, which led me to search for a diagramming tool. While a number of tools do already exist, I found that each required quite a bit of work to do the code generation and to work in a way that made sense to me. And thus, as a typical developer, I decided to write one myself.

There is still much to do with regards to multiple state machine interactions, etcetera, but the application is demo-able for single state machine implementations.

Using the code

Included in the downloads above is a code sample that can be found in StateProto_WatchSample_Demo.zip. If you extract this file, you will find a directory tree rooted at Hsm. In there, you will find the current version of the StateProto.exe. Also, the sample code for a Watch Demo is in Samples/SampleWatch, with the full state machine file in Samples/SampleWatch_b.sm1.

Hsm/bin/debug contains a precompiled release of SampleWatch.exe. Run it, click on "Create Watch", and then click on "SetEvt" a couple of times. When you're bored, click on "ModeEvt" to see what it does differently.

Watch Demo

Points of interest

The diagram displays states with a different colour at each nesting level. Big items still to work on are undo/redo and a graphical tree layout algorithm.

History

The first beta release with the Watch Sample, white paper and the Watch Sample documentation.

References

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralTo much limited w/o source code Pin
leeloo9999-Jul-06 21:24
leeloo9999-Jul-06 21:24 
GeneralRe: To much limited w/o source code Pin
statedriven10-Jul-06 10:56
statedriven10-Jul-06 10:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.