QM Session FileCurrent Item
As described in the QM™ introduction, the code generated by QM™ is licensed under the same dual-license model↑ as the underlying QP™ framework↑, for which the code has been generated.
By default, the QM code generator assumes that the underlying QP™ framework is used under the open source GNU General Public License (GPL)↑, and for compliance with the GPL, QM generates the required top-level file comments. Additionally, starting with QM version 7, in the default unlicensed mode the QM Code Generator is limited to 20 states. The following screen shot shows a QM code generation attempt that exceeds the number of states limit:
QM code generation exceeding the number of states limitTo replace the GPL-compliant comments and remove 20 states limitation, the QM modeling tool requires a QP License Certificate↑, which must be registered with a given QM model.
Registering QP License Certificate
When the underlying QP Framework is licensed commercially, the Licensee receives a QP License Certificate↑, which can be registered with QM by means of the Code Generation License Dialog Box. After registering a commercial license, QM generates top-level file comments that reflect the commercial license terms. Also, the code generation is unlimited with respect to the number of generated states.
- Note
- If you are a commercial licensee and for some reason you did not receive your QP License Certificate file, please send email with your license number to support@state-machine.com↑ to request your copy.
Code Generation License Dialog (Commercial License)- Note
- The QP License Certificate is validated against the current date and the certificate is marked as expired if it is no longer valid.
Also, the QP License Certificate is validated against the QP Framework type and is marked as not covering the selected framework if that framework is not listed among the licensed "Framewrok(s)".
- Attention
- After registering a QP License Certificate, it is stored in the QM Model File. If the QP License Certificate file is updated (e.g., Support Term for the commercial license is extended), the QP License Certificate must be re-registered by means of the Code Generation License Dialog Box.
Generated Code
After registering the QP License Certificate, the QM tool will generate top-level file comments with the commercial license information.
The following code snippet shows the top-level file comment generated from the QP License Certificate example discussed above.
#include "qpc.h"
#include "egizmo.h"
typedef struct {
QActive super;
QTimeEvt timeEvt;
} Blinky;
static QState Blinky_initial(Blinky * const me, void const * const par);
static QState Blinky_off(Blinky * const me, QEvt const * const e);
static QState Blinky_on(Blinky * const me, QEvt const * const e);
static Blinky l_blinky;
QActive * const AO_Blinky = &l_blinky.super;
#if (QP_VERSION < 750U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
#error qpc version 7.5.0 or higher required
#endif
void Blinky_ctor(void) {
Blinky *me = (Blinky *)AO_Blinky;
QActive_ctor(&me->super, Q_STATE_CAST(&Blinky_initial));
QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
}
static QState Blinky_initial(Blinky * const me, void const * const par) {
(void)par;
QTimeEvt_armX(&me->timeEvt,
BSP_TICKS_PER_SEC/2,
BSP_TICKS_PER_SEC/2);
return Q_TRAN(&Blinky_off);
}
static QState Blinky_off(Blinky * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
case Q_ENTRY_SIG: {
BSP_ledOff();
status_ = Q_HANDLED();
break;
}
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Blinky_on);
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
static QState Blinky_on(Blinky * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
case Q_ENTRY_SIG: {
BSP_ledOn();
status_ = Q_HANDLED();
break;
}
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Blinky_off);
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
- Note
- The top-level comments generated with a registered QP License Certificate contain no references to any open-source license because the code will be proprietary.
QM Session FileCurrent Item