| Name | Modified | Size | Downloads / 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.