Download Latest Version fsmc-template-2.0.0.zip (62.0 kB)
Email in envelope

Get an email when there's a new version of Finite State Machine Editor

Home / fsme / fsme-1.0.5
Name Modified Size InfoDownloads / Week
Parent folder
README.mdown 2011-08-30 1.1 kB
fsmc-template-1.0.5.zip 2011-08-30 55.1 kB
fsme-1.0.5.dmg 2011-08-29 15.4 MB
fsme-1.0.5.tar.bz2 2011-08-29 352.5 kB
Totals: 4 Items   15.9 MB 0

In this release, I introduce a new template-based code generator. To use it, unpack fsmc-template-1.0.5.zip and issue the following command:

python mkfsm.py -t fsmheader.mako -o SampleFSM.h SampleFSM.fsm

Replace that Sample.fsm with your FSM name and you will get a header file. Then issue the following command:

python mkfsm.py -t fsmbody.mako -o SampleFSM.cpp SampleFSM.fsm

and you will get an implementation of your FSM in SampleFSM.cpp. In your code, you will need to do the following:

class YourClass : public SampleFSM::Delegate {
    SampleFSM fsm;
public:
    // you will need to override inputs and outputs here
    bool sampleInput() const;
    void sampleOutput();
};

And in the implementation you will need to initialize FSM in a constructor:

YourClass::YourClass()
    : fsm(this) {}

After that, you can issue events to your FSM:

void YourClass::someMethod()
{
    fsm.processEvent(SampleFSM::SampleEvent, QVariantMap());
}

Please feel free to add your own templates according to your needs. With this template-based generator, all generation restrictions are gone.

Source: README.mdown, updated 2011-08-30