/***************************************************************************** * Model: calc2.qm * File: ./calc2.c * * This code has been generated by QM tool (see state-machine.com/qm). * DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost. * * This program is open source software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. *****************************************************************************/ /*${.::calc2.c} ............................................................*/ #include "qpc.h" /* QP/C */ #include "bsp.h" /* board support package */ #include "calc2.h" /* application */ /*${SMs::Calc2} ............................................................*/ typedef struct { /* protected: */ QMsm super; /* private: */ double operand1; uint8_t operator; } Calc2; /* protected: */ static QState Calc2_initial(Calc2 * const me, QEvt const * const e); static QState Calc2_on (Calc2 * const me, QEvt const * const e); static QState Calc2_on_e(Calc2 * const me); static QState Calc2_on_x(Calc2 * const me); static QState Calc2_on_i(Calc2 * const me); static QMState const Calc2_on_s = { (QMState const *)0, /* superstate (top) */ Q_STATE_CAST(&Calc2_on), Q_ACTION_CAST(&Calc2_on_e), Q_ACTION_CAST(&Calc2_on_x), Q_ACTION_CAST(&Calc2_on_i) }; static QState Calc2_error (Calc2 * const me, QEvt const * const e); static QState Calc2_error_e(Calc2 * const me); static QState Calc2_error_x(Calc2 * const me); static QMState const Calc2_error_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_error), Q_ACTION_CAST(&Calc2_error_e), Q_ACTION_CAST(&Calc2_error_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_negated1 (Calc2 * const me, QEvt const * const e); static QState Calc2_negated1_e(Calc2 * const me); static QState Calc2_negated1_x(Calc2 * const me); static QMState const Calc2_negated1_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_negated1), Q_ACTION_CAST(&Calc2_negated1_e), Q_ACTION_CAST(&Calc2_negated1_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_ready (Calc2 * const me, QEvt const * const e); static QState Calc2_ready_e(Calc2 * const me); static QState Calc2_ready_x(Calc2 * const me); static QState Calc2_ready_i(Calc2 * const me); static QMState const Calc2_ready_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_ready), Q_ACTION_CAST(&Calc2_ready_e), Q_ACTION_CAST(&Calc2_ready_x), Q_ACTION_CAST(&Calc2_ready_i) }; static QState Calc2_result (Calc2 * const me, QEvt const * const e); static QState Calc2_result_e(Calc2 * const me); static QState Calc2_result_x(Calc2 * const me); static QMState const Calc2_result_s = { &Calc2_ready_s, /* superstate */ Q_STATE_CAST(&Calc2_result), Q_ACTION_CAST(&Calc2_result_e), Q_ACTION_CAST(&Calc2_result_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_begin (Calc2 * const me, QEvt const * const e); static QState Calc2_begin_e(Calc2 * const me); static QState Calc2_begin_x(Calc2 * const me); static QMState const Calc2_begin_s = { &Calc2_ready_s, /* superstate */ Q_STATE_CAST(&Calc2_begin), Q_ACTION_CAST(&Calc2_begin_e), Q_ACTION_CAST(&Calc2_begin_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_operand1 (Calc2 * const me, QEvt const * const e); static QState Calc2_operand1_e(Calc2 * const me); static QState Calc2_operand1_x(Calc2 * const me); static QMState const Calc2_operand1_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_operand1), Q_ACTION_CAST(&Calc2_operand1_e), Q_ACTION_CAST(&Calc2_operand1_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_zero1 (Calc2 * const me, QEvt const * const e); static QState Calc2_zero1_e(Calc2 * const me); static QState Calc2_zero1_x(Calc2 * const me); static QMState const Calc2_zero1_s = { &Calc2_operand1_s, /* superstate */ Q_STATE_CAST(&Calc2_zero1), Q_ACTION_CAST(&Calc2_zero1_e), Q_ACTION_CAST(&Calc2_zero1_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_int1 (Calc2 * const me, QEvt const * const e); static QState Calc2_int1_e(Calc2 * const me); static QState Calc2_int1_x(Calc2 * const me); static QMState const Calc2_int1_s = { &Calc2_operand1_s, /* superstate */ Q_STATE_CAST(&Calc2_int1), Q_ACTION_CAST(&Calc2_int1_e), Q_ACTION_CAST(&Calc2_int1_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_frac1 (Calc2 * const me, QEvt const * const e); static QState Calc2_frac1_e(Calc2 * const me); static QState Calc2_frac1_x(Calc2 * const me); static QMState const Calc2_frac1_s = { &Calc2_operand1_s, /* superstate */ Q_STATE_CAST(&Calc2_frac1), Q_ACTION_CAST(&Calc2_frac1_e), Q_ACTION_CAST(&Calc2_frac1_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_opEntered (Calc2 * const me, QEvt const * const e); static QState Calc2_opEntered_e(Calc2 * const me); static QState Calc2_opEntered_x(Calc2 * const me); static QMState const Calc2_opEntered_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_opEntered), Q_ACTION_CAST(&Calc2_opEntered_e), Q_ACTION_CAST(&Calc2_opEntered_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_negated2 (Calc2 * const me, QEvt const * const e); static QState Calc2_negated2_e(Calc2 * const me); static QState Calc2_negated2_x(Calc2 * const me); static QMState const Calc2_negated2_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_negated2), Q_ACTION_CAST(&Calc2_negated2_e), Q_ACTION_CAST(&Calc2_negated2_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_operand2 (Calc2 * const me, QEvt const * const e); static QState Calc2_operand2_e(Calc2 * const me); static QState Calc2_operand2_x(Calc2 * const me); static QMState const Calc2_operand2_s = { &Calc2_on_s, /* superstate */ Q_STATE_CAST(&Calc2_operand2), Q_ACTION_CAST(&Calc2_operand2_e), Q_ACTION_CAST(&Calc2_operand2_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_zero2 (Calc2 * const me, QEvt const * const e); static QState Calc2_zero2_e(Calc2 * const me); static QState Calc2_zero2_x(Calc2 * const me); static QMState const Calc2_zero2_s = { &Calc2_operand2_s, /* superstate */ Q_STATE_CAST(&Calc2_zero2), Q_ACTION_CAST(&Calc2_zero2_e), Q_ACTION_CAST(&Calc2_zero2_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_int2 (Calc2 * const me, QEvt const * const e); static QState Calc2_int2_e(Calc2 * const me); static QState Calc2_int2_x(Calc2 * const me); static QMState const Calc2_int2_s = { &Calc2_operand2_s, /* superstate */ Q_STATE_CAST(&Calc2_int2), Q_ACTION_CAST(&Calc2_int2_e), Q_ACTION_CAST(&Calc2_int2_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_frac2 (Calc2 * const me, QEvt const * const e); static QState Calc2_frac2_e(Calc2 * const me); static QState Calc2_frac2_x(Calc2 * const me); static QMState const Calc2_frac2_s = { &Calc2_operand2_s, /* superstate */ Q_STATE_CAST(&Calc2_frac2), Q_ACTION_CAST(&Calc2_frac2_e), Q_ACTION_CAST(&Calc2_frac2_x), Q_ACTION_CAST(0) /* no intitial tran. */ }; static QState Calc2_final (Calc2 * const me, QEvt const * const e); static QState Calc2_final_e(Calc2 * const me); static QMState const Calc2_final_s = { (QMState const *)0, /* superstate (top) */ Q_STATE_CAST(&Calc2_final), Q_ACTION_CAST(&Calc2_final_e), Q_ACTION_CAST(0), /* no exit action */ Q_ACTION_CAST(0) /* no intitial tran. */ }; static Calc2 l_calc2; /* the only instance of the Calc class */ /* global-scope definitions ---------------------------------------*/ QMsm * const the_calc = &l_calc2.super; /* "opaque" pointer to MSM */ /*${SMs::Calc2_ctor} .......................................................*/ void Calc2_ctor(void) { Calc2 *me = &l_calc2; QMsm_ctor(&me->super, Q_STATE_CAST(&Calc2_initial)); } /*${SMs::Calc2} ............................................................*/ /*${SMs::Calc2::SM} ........................................................*/ static QState Calc2_initial(Calc2 * const me, QEvt const * const e) { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_on_s, /* target state */ { Q_ACTION_CAST(&Calc2_on_e), /* entry */ Q_ACTION_CAST(&Calc2_on_i), /* init.tran. */ Q_ACTION_CAST(0) /* zero terminator */ } }; /* ${SMs::Calc2::SM::initial} */ BSP_clear(); (void)e; /* avoid compiler warning about unused parameter */ return QM_TRAN_INIT(&tatbl_); } /*${SMs::Calc2::SM::on} ....................................................*/ /* ${SMs::Calc2::SM::on} */ static QState Calc2_on_e(Calc2 * const me) { BSP_message("on-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_on_s); } /* ${SMs::Calc2::SM::on} */ static QState Calc2_on_x(Calc2 * const me) { BSP_message("on-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_on_s); } /* ${SMs::Calc2::SM::on::initial} */ static QState Calc2_on_i(Calc2 * const me) { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_ready_s, /* target state */ { Q_ACTION_CAST(&Calc2_ready_e), /* entry */ Q_ACTION_CAST(&Calc2_ready_i), /* init.tran. */ Q_ACTION_CAST(0) /* zero terminator */ } }; /* ${SMs::Calc2::SM::on::initial} */ BSP_message("on-INIT;"); return QM_TRAN_INIT(&tatbl_); } /* ${SMs::Calc2::SM::on} */ static QState Calc2_on(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::C} */ case C_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_on_s, /* target state */ { Q_ACTION_CAST(&Calc2_on_x), /* exit */ Q_ACTION_CAST(&Calc2_on_e), /* entry */ Q_ACTION_CAST(&Calc2_on_i), /* init.tran. */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::OFF} */ case OFF_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_final_s, /* target state */ { Q_ACTION_CAST(&Calc2_on_x), /* exit */ Q_ACTION_CAST(&Calc2_final_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::error} .............................................*/ /* ${SMs::Calc2::SM::on::error} */ static QState Calc2_error_e(Calc2 * const me) { BSP_message("error-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_error_s); } /* ${SMs::Calc2::SM::on::error} */ static QState Calc2_error_x(Calc2 * const me) { BSP_message("error-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_error_s); } /* ${SMs::Calc2::SM::on::error} */ static QState Calc2_error(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::negated1} ..........................................*/ /* ${SMs::Calc2::SM::on::negated1} */ static QState Calc2_negated1_e(Calc2 * const me) { BSP_message("negated1-ENTRY;"); BSP_negate(); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_negated1_s); } /* ${SMs::Calc2::SM::on::negated1} */ static QState Calc2_negated1_x(Calc2 * const me) { BSP_message("negated1-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_negated1_s); } /* ${SMs::Calc2::SM::on::negated1} */ static QState Calc2_negated1(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::negated1::DIGIT_0} */ case DIGIT_0_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_zero1_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated1_x), /* exit */ Q_ACTION_CAST(&Calc2_operand1_e), /* entry */ Q_ACTION_CAST(&Calc2_zero1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::negated1::DIGIT_1_9} */ case DIGIT_1_9_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_int1_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated1_x), /* exit */ Q_ACTION_CAST(&Calc2_operand1_e), /* entry */ Q_ACTION_CAST(&Calc2_int1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::negated1::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_frac1_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated1_x), /* exit */ Q_ACTION_CAST(&Calc2_operand1_e), /* entry */ Q_ACTION_CAST(&Calc2_frac1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::negated1::OPER} */ case OPER_SIG: { /* ${SMs::Calc2::SM::on::negated1::OPER::[e->key=='-']} */ if (Q_EVT_CAST(CalcEvt)->key_code == KEY_MINUS) { ; status_ = QM_HANDLED(); } /* ${SMs::Calc2::SM::on::negated1::OPER::[else]} */ else { status_ = QM_HANDLED(); } break; } /* ${SMs::Calc2::SM::on::negated1::CE} */ case CE_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_begin_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated1_x), /* exit */ Q_ACTION_CAST(&Calc2_ready_e), /* entry */ Q_ACTION_CAST(&Calc2_begin_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::ready} .............................................*/ /* ${SMs::Calc2::SM::on::ready} */ static QState Calc2_ready_e(Calc2 * const me) { BSP_message("ready-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_ready_s); } /* ${SMs::Calc2::SM::on::ready} */ static QState Calc2_ready_x(Calc2 * const me) { BSP_message("ready-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_ready_s); } /* ${SMs::Calc2::SM::on::ready::initial} */ static QState Calc2_ready_i(Calc2 * const me) { static struct { QMState const *target; QActionHandler act[2]; } const tatbl_ = { /* transition-action table */ &Calc2_begin_s, /* target state */ { Q_ACTION_CAST(&Calc2_begin_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; /* ${SMs::Calc2::SM::on::ready::initial} */ BSP_message("ready-INIT;"); return QM_TRAN_INIT(&tatbl_); } /* ${SMs::Calc2::SM::on::ready} */ static QState Calc2_ready(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::ready::DIGIT_0} */ case DIGIT_0_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_zero1_s, /* target state */ { Q_ACTION_CAST(&Calc2_ready_x), /* exit */ Q_ACTION_CAST(&Calc2_operand1_e), /* entry */ Q_ACTION_CAST(&Calc2_zero1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::ready::DIGIT_1_9} */ case DIGIT_1_9_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_int1_s, /* target state */ { Q_ACTION_CAST(&Calc2_ready_x), /* exit */ Q_ACTION_CAST(&Calc2_operand1_e), /* entry */ Q_ACTION_CAST(&Calc2_int1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::ready::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_frac1_s, /* target state */ { Q_ACTION_CAST(&Calc2_ready_x), /* exit */ Q_ACTION_CAST(&Calc2_operand1_e), /* entry */ Q_ACTION_CAST(&Calc2_frac1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); BSP_insert((int)'0'); BSP_insert((int)'.'); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::ready::OPER} */ case OPER_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_opEntered_s, /* target state */ { Q_ACTION_CAST(&Calc2_ready_x), /* exit */ Q_ACTION_CAST(&Calc2_opEntered_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; me->operand1 = BSP_get_value(); me->operator = Q_EVT_CAST(CalcEvt)->key_code; status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::ready::result} .....................................*/ /* ${SMs::Calc2::SM::on::ready::result} */ static QState Calc2_result_e(Calc2 * const me) { BSP_message("result-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_result_s); } /* ${SMs::Calc2::SM::on::ready::result} */ static QState Calc2_result_x(Calc2 * const me) { BSP_message("result-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_result_s); } /* ${SMs::Calc2::SM::on::ready::result} */ static QState Calc2_result(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::ready::begin} ......................................*/ /* ${SMs::Calc2::SM::on::ready::begin} */ static QState Calc2_begin_e(Calc2 * const me) { BSP_message("begin-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_begin_s); } /* ${SMs::Calc2::SM::on::ready::begin} */ static QState Calc2_begin_x(Calc2 * const me) { BSP_message("begin-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_begin_s); } /* ${SMs::Calc2::SM::on::ready::begin} */ static QState Calc2_begin(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::ready::begin::OPER} */ case OPER_SIG: { /* ${SMs::Calc2::SM::on::ready::begin::OPER::[e->key=='-']} */ if (Q_EVT_CAST(CalcEvt)->key_code == KEY_MINUS) { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_negated1_s, /* target state */ { Q_ACTION_CAST(&Calc2_begin_x), /* exit */ Q_ACTION_CAST(&Calc2_ready_x), /* exit */ Q_ACTION_CAST(&Calc2_negated1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } /* ${SMs::Calc2::SM::on::ready::begin::OPER::[else]} */ else { status_ = QM_HANDLED(); } break; } default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::operand1} ..........................................*/ /* ${SMs::Calc2::SM::on::operand1} */ static QState Calc2_operand1_e(Calc2 * const me) { BSP_message("operand1-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_operand1_s); } /* ${SMs::Calc2::SM::on::operand1} */ static QState Calc2_operand1_x(Calc2 * const me) { BSP_message("operand1-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_operand1_s); } /* ${SMs::Calc2::SM::on::operand1} */ static QState Calc2_operand1(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand1::CE} */ case CE_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_begin_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand1_x), /* exit */ Q_ACTION_CAST(&Calc2_ready_e), /* entry */ Q_ACTION_CAST(&Calc2_begin_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand1::OPER} */ case OPER_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_opEntered_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand1_x), /* exit */ Q_ACTION_CAST(&Calc2_opEntered_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; me->operand1 = BSP_get_value(); me->operator = Q_EVT_CAST(CalcEvt)->key_code; status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand1::EQUALS} */ case EQUALS_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_result_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand1_x), /* exit */ Q_ACTION_CAST(&Calc2_ready_e), /* entry */ Q_ACTION_CAST(&Calc2_result_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::operand1::zero1} ...................................*/ /* ${SMs::Calc2::SM::on::operand1::zero1} */ static QState Calc2_zero1_e(Calc2 * const me) { BSP_message("zero1-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_zero1_s); } /* ${SMs::Calc2::SM::on::operand1::zero1} */ static QState Calc2_zero1_x(Calc2 * const me) { BSP_message("zero1-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_zero1_s); } /* ${SMs::Calc2::SM::on::operand1::zero1} */ static QState Calc2_zero1(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand1::zero1::DIGIT_0} */ case DIGIT_0_SIG: { ; status_ = QM_HANDLED(); break; } /* ${SMs::Calc2::SM::on::operand1::zero1::DIGIT_1_9} */ case DIGIT_1_9_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_int1_s, /* target state */ { Q_ACTION_CAST(&Calc2_zero1_x), /* exit */ Q_ACTION_CAST(&Calc2_int1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand1::zero1::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_frac1_s, /* target state */ { Q_ACTION_CAST(&Calc2_zero1_x), /* exit */ Q_ACTION_CAST(&Calc2_frac1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert((int)'0'); BSP_insert((int)'.'); status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::operand1::int1} ....................................*/ /* ${SMs::Calc2::SM::on::operand1::int1} */ static QState Calc2_int1_e(Calc2 * const me) { BSP_message("int1-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_int1_s); } /* ${SMs::Calc2::SM::on::operand1::int1} */ static QState Calc2_int1_x(Calc2 * const me) { BSP_message("int1-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_int1_s); } /* ${SMs::Calc2::SM::on::operand1::int1} */ static QState Calc2_int1(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand1::int1::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_frac1_s, /* target state */ { Q_ACTION_CAST(&Calc2_int1_x), /* exit */ Q_ACTION_CAST(&Calc2_frac1_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert((int)'.'); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand1::int1::DIGIT_0, DIGIT_1_9} */ case DIGIT_0_SIG: /* intentionally fall through */ case DIGIT_1_9_SIG: { BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_HANDLED(); break; } default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::operand1::frac1} ...................................*/ /* ${SMs::Calc2::SM::on::operand1::frac1} */ static QState Calc2_frac1_e(Calc2 * const me) { BSP_message("frac1-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_frac1_s); } /* ${SMs::Calc2::SM::on::operand1::frac1} */ static QState Calc2_frac1_x(Calc2 * const me) { BSP_message("frac1-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_frac1_s); } /* ${SMs::Calc2::SM::on::operand1::frac1} */ static QState Calc2_frac1(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand1::frac1::POINT} */ case POINT_SIG: { ; status_ = QM_HANDLED(); break; } /* ${SMs::Calc2::SM::on::operand1::frac1::DIGIT_0, DIGIT_1_9} */ case DIGIT_0_SIG: /* intentionally fall through */ case DIGIT_1_9_SIG: { BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_HANDLED(); break; } default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::opEntered} .........................................*/ /* ${SMs::Calc2::SM::on::opEntered} */ static QState Calc2_opEntered_e(Calc2 * const me) { BSP_message("opEntered-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_opEntered_s); } /* ${SMs::Calc2::SM::on::opEntered} */ static QState Calc2_opEntered_x(Calc2 * const me) { BSP_message("opEntered-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_opEntered_s); } /* ${SMs::Calc2::SM::on::opEntered} */ static QState Calc2_opEntered(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::opEntered::DIGIT_0} */ case DIGIT_0_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_zero2_s, /* target state */ { Q_ACTION_CAST(&Calc2_opEntered_x), /* exit */ Q_ACTION_CAST(&Calc2_operand2_e), /* entry */ Q_ACTION_CAST(&Calc2_zero2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::opEntered::DIGIT_1_9} */ case DIGIT_1_9_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_int2_s, /* target state */ { Q_ACTION_CAST(&Calc2_opEntered_x), /* exit */ Q_ACTION_CAST(&Calc2_operand2_e), /* entry */ Q_ACTION_CAST(&Calc2_int2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::opEntered::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_frac2_s, /* target state */ { Q_ACTION_CAST(&Calc2_opEntered_x), /* exit */ Q_ACTION_CAST(&Calc2_operand2_e), /* entry */ Q_ACTION_CAST(&Calc2_frac2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); BSP_insert((int)'0'); BSP_insert((int)'.'); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::opEntered::OPER} */ case OPER_SIG: { /* ${SMs::Calc2::SM::on::opEntered::OPER::[e->key=='-']} */ if (Q_EVT_CAST(CalcEvt)->key_code == KEY_MINUS) { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_negated2_s, /* target state */ { Q_ACTION_CAST(&Calc2_opEntered_x), /* exit */ Q_ACTION_CAST(&Calc2_negated2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } /* ${SMs::Calc2::SM::on::opEntered::OPER::[else]} */ else { status_ = QM_HANDLED(); } break; } default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::negated2} ..........................................*/ /* ${SMs::Calc2::SM::on::negated2} */ static QState Calc2_negated2_e(Calc2 * const me) { BSP_message("negated2-ENTRY;"); BSP_negate(); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_negated2_s); } /* ${SMs::Calc2::SM::on::negated2} */ static QState Calc2_negated2_x(Calc2 * const me) { BSP_message("negated2-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_negated2_s); } /* ${SMs::Calc2::SM::on::negated2} */ static QState Calc2_negated2(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::negated2::DIGIT_0} */ case DIGIT_0_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_zero2_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated2_x), /* exit */ Q_ACTION_CAST(&Calc2_operand2_e), /* entry */ Q_ACTION_CAST(&Calc2_zero2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::negated2::DIGIT_1_9} */ case DIGIT_1_9_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_int2_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated2_x), /* exit */ Q_ACTION_CAST(&Calc2_operand2_e), /* entry */ Q_ACTION_CAST(&Calc2_int2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::negated2::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_frac2_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated2_x), /* exit */ Q_ACTION_CAST(&Calc2_operand2_e), /* entry */ Q_ACTION_CAST(&Calc2_frac2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::negated2::OPER} */ case OPER_SIG: { /* ${SMs::Calc2::SM::on::negated2::OPER::[e->key=='-']} */ if (Q_EVT_CAST(CalcEvt)->key_code == KEY_MINUS) { ; status_ = QM_HANDLED(); } /* ${SMs::Calc2::SM::on::negated2::OPER::[else]} */ else { status_ = QM_HANDLED(); } break; } /* ${SMs::Calc2::SM::on::negated2::CE} */ case CE_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_opEntered_s, /* target state */ { Q_ACTION_CAST(&Calc2_negated2_x), /* exit */ Q_ACTION_CAST(&Calc2_opEntered_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::operand2} ..........................................*/ /* ${SMs::Calc2::SM::on::operand2} */ static QState Calc2_operand2_e(Calc2 * const me) { BSP_message("operand2-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_operand2_s); } /* ${SMs::Calc2::SM::on::operand2} */ static QState Calc2_operand2_x(Calc2 * const me) { BSP_message("operand2-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_operand2_s); } /* ${SMs::Calc2::SM::on::operand2} */ static QState Calc2_operand2(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand2::CE} */ case CE_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_opEntered_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_opEntered_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_clear(); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand2::EQUALS} */ case EQUALS_SIG: { /* ${SMs::Calc2::SM::on::operand2::EQUALS::[BSP_eval()]} */ if (BSP_eval(me->operand1, me->operator, BSP_get_value())) { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_result_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_ready_e), /* entry */ Q_ACTION_CAST(&Calc2_result_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } /* ${SMs::Calc2::SM::on::operand2::EQUALS::[else]} */ else { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_error_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_error_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } break; } /* ${SMs::Calc2::SM::on::operand2::OPER} */ case OPER_SIG: { /* ${SMs::Calc2::SM::on::operand2::OPER::[BSP_eval()]} */ if (BSP_eval(me->operand1, me->operator, BSP_get_value())) { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_opEntered_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_opEntered_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } /* ${SMs::Calc2::SM::on::operand2::OPER::[else]} */ else { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_error_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_error_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } break; } /* ${SMs::Calc2::SM::on::operand2::PERCENT} */ case PERCENT_SIG: { double operand2 = 0.0; switch (me->operator) { case KEY_PLUS: case KEY_MINUS: { operand2 = (me->operand1 * BSP_get_value())/100.0; break; } case KEY_MULT: case KEY_DIVIDE: { operand2 = BSP_get_value()/100.0; break; } } /* ${SMs::Calc2::SM::on::operand2::PERCENT::[BSP_eval()]} */ if (BSP_eval(me->operand1, me->operator, operand2)) { static struct { QMState const *target; QActionHandler act[4]; } const tatbl_ = { /* transition-action table */ &Calc2_result_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_ready_e), /* entry */ Q_ACTION_CAST(&Calc2_result_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } /* ${SMs::Calc2::SM::on::operand2::PERCENT::[else]} */ else { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_error_s, /* target state */ { Q_ACTION_CAST(&Calc2_operand2_x), /* exit */ Q_ACTION_CAST(&Calc2_error_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; status_ = QM_TRAN(&tatbl_); } break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::operand2::zero2} ...................................*/ /* ${SMs::Calc2::SM::on::operand2::zero2} */ static QState Calc2_zero2_e(Calc2 * const me) { BSP_message("zero2-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_zero2_s); } /* ${SMs::Calc2::SM::on::operand2::zero2} */ static QState Calc2_zero2_x(Calc2 * const me) { BSP_message("zero2-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_zero2_s); } /* ${SMs::Calc2::SM::on::operand2::zero2} */ static QState Calc2_zero2(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand2::zero2::DIGIT_0} */ case DIGIT_0_SIG: { ; status_ = QM_HANDLED(); break; } /* ${SMs::Calc2::SM::on::operand2::zero2::DIGIT_1_9} */ case DIGIT_1_9_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_int2_s, /* target state */ { Q_ACTION_CAST(&Calc2_zero2_x), /* exit */ Q_ACTION_CAST(&Calc2_int2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand2::zero2::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_frac2_s, /* target state */ { Q_ACTION_CAST(&Calc2_zero2_x), /* exit */ Q_ACTION_CAST(&Calc2_frac2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert((int)'0'); BSP_insert((int)'.'); status_ = QM_TRAN(&tatbl_); break; } default: { status_ = QM_SUPER(); break; } } return status_; } /*${SMs::Calc2::SM::on::operand2::int2} ....................................*/ /* ${SMs::Calc2::SM::on::operand2::int2} */ static QState Calc2_int2_e(Calc2 * const me) { BSP_message("int2-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_int2_s); } /* ${SMs::Calc2::SM::on::operand2::int2} */ static QState Calc2_int2_x(Calc2 * const me) { BSP_message("int2-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_int2_s); } /* ${SMs::Calc2::SM::on::operand2::int2} */ static QState Calc2_int2(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand2::int2::POINT} */ case POINT_SIG: { static struct { QMState const *target; QActionHandler act[3]; } const tatbl_ = { /* transition-action table */ &Calc2_frac2_s, /* target state */ { Q_ACTION_CAST(&Calc2_int2_x), /* exit */ Q_ACTION_CAST(&Calc2_frac2_e), /* entry */ Q_ACTION_CAST(0) /* zero terminator */ } }; BSP_insert((int)'.'); status_ = QM_TRAN(&tatbl_); break; } /* ${SMs::Calc2::SM::on::operand2::int2::DIGIT_0, DIGIT_1_9} */ case DIGIT_0_SIG: /* intentionally fall through */ case DIGIT_1_9_SIG: { BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_HANDLED(); break; } default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::on::operand2::frac2} ...................................*/ /* ${SMs::Calc2::SM::on::operand2::frac2} */ static QState Calc2_frac2_e(Calc2 * const me) { BSP_message("frac2-ENTRY;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_frac2_s); } /* ${SMs::Calc2::SM::on::operand2::frac2} */ static QState Calc2_frac2_x(Calc2 * const me) { BSP_message("frac2-EXIT;"); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_EXIT(&Calc2_frac2_s); } /* ${SMs::Calc2::SM::on::operand2::frac2} */ static QState Calc2_frac2(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { /* ${SMs::Calc2::SM::on::operand2::frac2::POINT} */ case POINT_SIG: { ; status_ = QM_HANDLED(); break; } /* ${SMs::Calc2::SM::on::operand2::frac2::DIGIT_0, DIGIT_1_9} */ case DIGIT_0_SIG: /* intentionally fall through */ case DIGIT_1_9_SIG: { BSP_insert(Q_EVT_CAST(CalcEvt)->key_code); status_ = QM_HANDLED(); break; } default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; } /*${SMs::Calc2::SM::final} .................................................*/ /* ${SMs::Calc2::SM::final} */ static QState Calc2_final_e(Calc2 * const me) { BSP_message("final-ENTRY;"); BSP_exit(); (void)me; /* avoid compiler warning in case 'me' is not used */ return QM_ENTRY(&Calc2_final_s); } /* ${SMs::Calc2::SM::final} */ static QState Calc2_final(Calc2 * const me, QEvt const * const e) { QState status_; switch (e->sig) { default: { status_ = QM_SUPER(); break; } } (void)me; /* avoid compiler warning in case 'me' is not used */ return status_; }