mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-02-04 06:13:00 +08:00
63 lines
1.8 KiB
C++
63 lines
1.8 KiB
C++
//.$file${.::worker.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
//
|
|
// Model: start-stop.qm
|
|
// File: ${.::worker.hpp}
|
|
//
|
|
// This code has been generated by QM 5.1.3 <www.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.
|
|
//
|
|
//.$endhead${.::worker.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
#ifndef WORKER_HPP
|
|
#define WORKER_HPP
|
|
|
|
using namespace QP;
|
|
|
|
enum DPPSignals {
|
|
DONE_SIG = Q_USER_SIG, // to signal when Worker is done
|
|
// ...
|
|
MAX_PUB_SIG, // the last published signal
|
|
|
|
TIMEOUT_SIG, // for timeouts
|
|
// ...
|
|
MAX_SIG // the last signal
|
|
};
|
|
|
|
//.$declare${AOs::Worker} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
//.${AOs::Worker} ............................................................
|
|
class Worker : public QP::QActive {
|
|
public:
|
|
static Worker inst;
|
|
|
|
private:
|
|
QP::QTimeEvt m_te;
|
|
|
|
public:
|
|
uint8_t m_counter;
|
|
|
|
public:
|
|
Worker();
|
|
virtual ~Worker();
|
|
|
|
protected:
|
|
Q_STATE_DECL(initial);
|
|
Q_STATE_DECL(active);
|
|
Q_STATE_DECL(off);
|
|
Q_STATE_DECL(on);
|
|
Q_STATE_DECL(final);
|
|
};
|
|
//.$enddecl${AOs::Worker} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
//.$declare${AOs::AO_Launcher} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
extern QP::QActive * const AO_Launcher;
|
|
//.$enddecl${AOs::AO_Launcher} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
#endif // WORKER_HPP
|