This commit is contained in:
QL 2018-03-22 09:33:35 -04:00
parent 3f49eefef8
commit 0cda02c07a
9 changed files with 71 additions and 54 deletions

View File

@ -1,7 +1,7 @@
#-----------------------------------------------------------------------------
# Product: DPP-GUI exampe for Qt5
# Last Updated for Version: QP/C++ 5.9.1/Qt 5.x
# Date of the Last Update: 2017-05-26
# Last Updated for Version: QP/C++ 6.2.0/Qt 5.x
# Date of the Last Update: 2018-03-21
#
# Q u a n t u m L e a P s
# ---------------------------
@ -28,7 +28,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact information:
# https://state-machine.com
# https://www.state-machine.com
# mailto:info@state-machine.com
#-----------------------------------------------------------------------------
@ -58,7 +58,6 @@ HEADERS += \
FORMS += gui.ui
RESOURCES = gui.qrc
win32:RC_FILE = gui.rc
@ -99,7 +98,7 @@ SOURCES += \
$$QPCPP/src/qf/qf_qmact.cpp \
$$QPCPP/src/qf/qf_time.cpp
INCLUDEPATH += $$QPCPP/source
INCLUDEPATH += $$QPCPP/src
CONFIG(debug, debug|release) {

View File

@ -1,7 +1,7 @@
#-----------------------------------------------------------------------------
# Product: DPP console exampe for Qt (console)
# Last Updated for Version: QP/C++ 5.9.1/Qt 5.x
# Date of the Last Update: 2017-05-26
# Last Updated for Version: QP/C++ 6.2.0/Qt 5.x
# Date of the Last Update: 2018-03-21
#
# Q u a n t u m L e a P s
# ---------------------------
@ -28,7 +28,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact information:
# https://state-machine.com
# https://www.state-machine.com
# mailto:info@state-machine.com
#-----------------------------------------------------------------------------
@ -96,7 +96,7 @@ SOURCES += \
$$QPCPP/src/qf/qf_qmact.cpp \
$$QPCPP/src/qf/qf_time.cpp
INCLUDEPATH += $$QPCPP/source
INCLUDEPATH += $$QPCPP/src
CONFIG(debug, debug|release) {

View File

@ -1,7 +1,7 @@
#-----------------------------------------------------------------------------
# Product: Game-GUI exampe for Qt5
# Last Updated for Version: QP/C++ 5.9.1/Qt 5.x
# Date of the Last Update: 2017-05-26
# Last Updated for Version: QP/C++ 6.2.0/Qt 5.x
# Date of the Last Update: 2018-03-21
#
# Q u a n t u m L e a P s
# ---------------------------
@ -28,7 +28,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact information:
# https://state-machine.com
# https://www.state-machine.com
# mailto:info@state-machine.com
#-----------------------------------------------------------------------------
@ -101,7 +101,7 @@ SOURCES += \
$$QPCPP/src/qf/qf_qmact.cpp \
$$QPCPP/src/qf/qf_time.cpp
INCLUDEPATH += $$QPCPP/source
INCLUDEPATH += $$QPCPP/src
CONFIG(debug, debug|release) {

View File

@ -1,7 +1,7 @@
#-----------------------------------------------------------------------------
# Product: PELICAN-GUI exampe for Qt5
# Last Updated for Version: QP/C++ 5.9.1/Qt 5.x
# Date of the Last Update: 2017-05-26
# Last Updated for Version: QP/C++ 6.2.0/Qt 5.x
# Date of the Last Update: 2018-03-21
#
# Q u a n t u m L e a P s
# ---------------------------
@ -28,7 +28,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Contact information:
# https://state-machine.com
# https://www.state-machine.com
# mailto:info@state-machine.com
#-----------------------------------------------------------------------------
@ -97,7 +97,7 @@ SOURCES += \
$$QPCPP/src/qf/qf_qmact.cpp \
$$QPCPP/src/qf/qf_time.cpp
INCLUDEPATH += $$QPCPP/source
INCLUDEPATH += $$QPCPP/src
CONFIG(debug, debug|release) {

View File

@ -191,7 +191,8 @@ extern char_t const versionStr[6];
friend class QMActive;
friend class QTimeEvt;
friend class QEQueue;
//friend class QTicker;
friend class QTicker;
friend uint8_t QF_EVT_POOL_ID_ (QEvt const * const e);
friend uint8_t QF_EVT_REF_CTR_ (QEvt const * const e);
friend void QF_EVT_REF_CTR_INC_(QEvt const * const e);
friend void QF_EVT_REF_CTR_DEC_(QEvt const * const e);

View File

@ -2,8 +2,8 @@
/// @brief QP/C++ port to Qt
/// @cond
///***************************************************************************
/// Last Updated for Version: QP 5.4.0/Qt 5.x
/// Last updated on 2017-09-20
/// Last Updated for Version: QP 6.2.0/Qt 5.x
/// Last updated on 2018-03-21
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -30,7 +30,7 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// https://state-machine.com
/// https://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond
@ -117,7 +117,13 @@ bool GuiQActive::post_(QEvt const * const e, uint_fast16_t const /*margin*/,
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_OBJ_(sender); // the sender object
QS_SIG_(e->sig); // the signal of the event
@ -128,10 +134,6 @@ bool GuiQActive::post_(QEvt const * const e, uint_fast16_t const /*margin*/,
QS_EQC_(0); // min number of free entries (not used)
QS_END_NOCRIT_()
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// QCoreApplication::postEvent() is thread-safe per Qt documentation
@ -143,7 +145,13 @@ void GuiQActive::postLIFO(QEvt const * const e) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_LIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_LIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_SIG_(e->sig); // the signal of this event
QS_OBJ_(this); // this active object
@ -153,10 +161,6 @@ void GuiQActive::postLIFO(QEvt const * const e) {
QS_EQC_(0); // min number of free entries (not used)
QS_END_NOCRIT_()
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// QCoreApplication::postEvent() is thread-safe per Qt documentation
@ -193,7 +197,13 @@ bool GuiQMActive::post_(QEvt const * const e, uint_fast16_t const /*margin*/,
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_OBJ_(sender); // the sender object
QS_SIG_(e->sig); // the signal of the event
@ -204,10 +214,6 @@ bool GuiQMActive::post_(QEvt const * const e, uint_fast16_t const /*margin*/,
QS_EQC_(0); // min number of free entries (not used)
QS_END_NOCRIT_()
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// QCoreApplication::postEvent() is thread-safe per Qt documentation
@ -219,7 +225,13 @@ void GuiQMActive::postLIFO(QEvt const * const e) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_LIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_LIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_SIG_(e->sig); // the signal of this event
QS_OBJ_(this); // this active object
@ -229,10 +241,6 @@ void GuiQMActive::postLIFO(QEvt const * const e) {
QS_EQC_(0); // min number of free entries (not used)
QS_END_NOCRIT_()
// is it a dynamic event?
if (QF_EVT_POOL_ID_(e) != static_cast<uint8_t>(0)) {
QF_EVT_REF_CTR_INC_(e); // increment the reference counter
}
QF_CRIT_EXIT_();
// QCoreApplication::postEvent() is thread-safe per Qt documentation
@ -241,3 +249,4 @@ void GuiQMActive::postLIFO(QEvt const * const e) {
}
} // namespace QP

View File

@ -2,8 +2,8 @@
/// @brief QEP/C++ port to Qt
/// @cond
///***************************************************************************
/// Last Updated for Version: QP 5.4.0/Qt 5.x
/// Last updated on 2015-05-03
/// Last Updated for Version: QP 6.2.0/Qt 5.x
/// Last updated on 2018-03-21
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -30,17 +30,14 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// https://www.state-machine.com
/// mailtp:info@state-machine.com
///***************************************************************************
/// @endcond
#ifndef qep_port_h
#define qep_port_h
// don't define QEvent to avoid conflict with Qt
#define Q_NQEVENT 1
// provide QEvt constructors
#define Q_EVT_CTOR 1
@ -51,3 +48,4 @@
#include "qep.h" // QEP platform-independent public interface
#endif // qep_port_h

View File

@ -4,7 +4,7 @@
/// @cond
///***************************************************************************
/// Last updated for version 6.2.0
/// Last updated on 2018-03-19
/// Last updated on 2018-03-21
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -149,8 +149,8 @@ bool QActive::recall(QEQueue * const eq) {
else {
QS_CRIT_STAT_
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_RECALL_ATTEMPT,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_BEGIN_(QS_QF_ACTIVE_RECALL_ATTEMPT,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // time stamp
QS_OBJ_(this); // this active object
QS_OBJ_(eq); // the deferred queue

View File

@ -3,8 +3,8 @@
/// @brief Internal (package scope) QF/C++ interface.
/// @cond
///***************************************************************************
/// Last updated for version 5.9.7
/// Last updated on 2017-08-25
/// Last updated for version 6.2.0
/// Last updated on 2018-03-21
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -31,7 +31,7 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// https://state-machine.com
/// https://www.state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond
@ -101,6 +101,16 @@ struct QFreeBlock {
//****************************************************************************
// internal helper inline functions
//! return the Pool-ID of an event @p e
inline uint8_t QF_EVT_POOL_ID_ (QEvt const * const e) {
return e->poolId_;
}
//! return the Reference Conter of an event @p e
inline uint8_t QF_EVT_REF_CTR_ (QEvt const * const e) {
return e->refCtr_;
}
//! increment the refCtr_ of an event @p e
inline void QF_EVT_REF_CTR_INC_(QEvt const * const e) {
++(QF_EVT_CONST_CAST_(e))->refCtr_;