Menu

#147 Further code generation for .ino files

QM
pending
1
2018-11-01
2018-10-31
No

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)

  1. In region “// declare all AO classes...”
    $declare${AOs::MyAO}
  2. In region “// AO instances and event queue buffers for them...”
    MyAO AO_ MyAO;
    static QEvt l_MyAO_QSto[10]; // Event queue storage for MyAO
  3. In region “// QF_active[] array defines all active object control blocks ----------------”
    { (QActive *)&AO_MyAO, l_MyAO_QSto, Q_DIM(l_MyAO_QSto) },
  4. In function setup(), in region “// initialize all AOs...”
    QActive_ctor(&AO_ MyAO.super, Q_STATE_CAST(&MyAO_initial));
  5. In the last portion of the .ino file
    $define${AOs::MyAO}
  6. Auto generation of signal enumerations, e.g. 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?

Discussion

  • Emin Cetinbas

    Emin Cetinbas - 2018-10-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,5 +11,6 @@
         •  `QActive_ctor(&AO_ MyAO.super, Q_STATE_CAST(&MyAO_initial));`
    
     5. In the last portion of the .ino file
         •  `$define${AOs::MyAO}`
    + 6. Auto generation of signal enumerations, e.g. `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?
    
     
  • Quantum Leaps

    Quantum Leaps - 2018-11-01
    • status: open --> pending
     
  • Quantum Leaps

    Quantum Leaps - 2018-11-01

    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

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB