2015-12-31 14:56:37 -05:00
|
|
|
class Calc : public QHsm { // derived from QHsm
|
2012-08-14 18:00:48 -04:00
|
|
|
private:
|
|
|
|
double m_operand1;
|
|
|
|
double m_operand2;
|
|
|
|
char m_display[DISP_WIDTH + 1];
|
|
|
|
uint8_t m_len;
|
|
|
|
uint8_t m_opKey;
|
|
|
|
|
|
|
|
public:
|
2015-12-31 14:56:37 -05:00
|
|
|
Calc() : QHsm(Q_STATE_CAST(&QCalc::initial)) { // ctor
|
2012-08-14 18:00:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2015-12-31 14:56:37 -05:00
|
|
|
static QState initial (Calc * const me, QEvt const *e);
|
|
|
|
static QState on (Calc * const me, QEvt const *e);
|
|
|
|
static QState error (Calc * const me, QEvt const *e);
|
|
|
|
static QState ready (Calc * const me, QEvt const *e);
|
|
|
|
static QState result (Calc * const me, QEvt const *e);
|
|
|
|
static QState begin (Calc * const me, QEvt const *e);
|
2013-10-10 20:01:51 -04:00
|
|
|
. . .
|
2012-08-14 18:00:48 -04:00
|
|
|
};
|