Further code generation for .ino files
Real-Time Event Frameworks based on active objects & state machines
Brought to you by:
quantum-leaps
In qpn-Arduino examples (I haven’t tried with other ones), I have to maintain the following lines (MyAO is an example for an active object created on a diagram)
$declare${AOs::MyAO}MyAO AO_ MyAO;static QEvt l_MyAO_QSto[10]; // Event queue storage for MyAO{ (QActive *)&AO_MyAO, l_MyAO_QSto, Q_DIM(l_MyAO_QSto) },QActive_ctor(&AO_ MyAO.super, Q_STATE_CAST(&MyAO_initial));$define${AOs::MyAO}MY_EVENT_SIG from of a MY_EVENT used in the graphical model.They are closely related to code generation. Could all be maintained by the modeler?
Anonymous
Diff:
There is a tradeoff between the flexibility of the code generated by QM and the amount of automation of the process. If you automate more, you don't need to type all these directives, but you also lose flexibility in what kind of code is geneated.
The general philosophy of the QM tool is to leave a lot of flexibiltiy to the user. The few simple code-generation directives that you need to type are not that complicated, if you understand what they do.
Regarding the generation of the enumerations for event signals, this will be incorporated in a more comprehensive signal and event-type management feature planned for QM.
--MMS