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-2.0.0
Name Modified Size InfoDownloads / Week
Parent folder
fsmc-template-2.0.0.zip 2018-02-15 62.0 kB
Readme.mdown 2018-02-15 1.2 kB
fsme-2.0.0.dmg 2018-02-15 10.2 MB
fsme-windows-2.0.0.zip 2018-02-15 19.5 MB
Totals: 4 Items   29.8 MB 7

This is a new major release, depending on Qt 5.x. Except of new look and feel, new templates have been added to template generator system. Generate Java Script, Scala, Objective C and Swift code from single FSM file. 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 2018-02-15