From 0cda02c07a2f43e1641a1533c8bc43f59e00a877 Mon Sep 17 00:00:00 2001 From: QL Date: Thu, 22 Mar 2018 09:33:35 -0400 Subject: [PATCH] 6.2.0 --- examples/qt/dpp-gui/dpp-gui.pro | 9 ++-- examples/qt/dpp/dpp.pro | 8 ++-- examples/qt/game-gui/game-gui.pro | 8 ++-- examples/qt/pelican-gui/pelican-gui.pro | 8 ++-- include/qep.h | 3 +- ports/qt/guiapp.cpp | 55 ++++++++++++++----------- ports/qt/qep_port.h | 12 +++--- src/qf/qf_defer.cpp | 6 +-- src/qf_pkg.h | 16 +++++-- 9 files changed, 71 insertions(+), 54 deletions(-) diff --git a/examples/qt/dpp-gui/dpp-gui.pro b/examples/qt/dpp-gui/dpp-gui.pro index 93ac5d5e..3f4e0ebf 100644 --- a/examples/qt/dpp-gui/dpp-gui.pro +++ b/examples/qt/dpp-gui/dpp-gui.pro @@ -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 . # # 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) { diff --git a/examples/qt/dpp/dpp.pro b/examples/qt/dpp/dpp.pro index 34b7f3d3..33816aae 100644 --- a/examples/qt/dpp/dpp.pro +++ b/examples/qt/dpp/dpp.pro @@ -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 . # # 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) { diff --git a/examples/qt/game-gui/game-gui.pro b/examples/qt/game-gui/game-gui.pro index 793e315d..b1233e85 100644 --- a/examples/qt/game-gui/game-gui.pro +++ b/examples/qt/game-gui/game-gui.pro @@ -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 . # # 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) { diff --git a/examples/qt/pelican-gui/pelican-gui.pro b/examples/qt/pelican-gui/pelican-gui.pro index 90424aae..5d9c43aa 100644 --- a/examples/qt/pelican-gui/pelican-gui.pro +++ b/examples/qt/pelican-gui/pelican-gui.pro @@ -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 . # # 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) { diff --git a/include/qep.h b/include/qep.h index b14367a6..dcf100a0 100644 --- a/include/qep.h +++ b/include/qep.h @@ -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); diff --git a/ports/qt/guiapp.cpp b/ports/qt/guiapp.cpp index 08d17e2f..3bb32cdd 100644 --- a/ports/qt/guiapp.cpp +++ b/ports/qt/guiapp.cpp @@ -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 . /// /// 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(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(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(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(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(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(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(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(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 + diff --git a/ports/qt/qep_port.h b/ports/qt/qep_port.h index bf76c190..bfa1ac83 100644 --- a/ports/qt/qep_port.h +++ b/ports/qt/qep_port.h @@ -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 . /// /// 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 + diff --git a/src/qf/qf_defer.cpp b/src/qf/qf_defer.cpp index 353d7b7a..8a4ec8d0 100644 --- a/src/qf/qf_defer.cpp +++ b/src/qf/qf_defer.cpp @@ -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 diff --git a/src/qf_pkg.h b/src/qf_pkg.h index 2facfbd3..902218c5 100644 --- a/src/qf_pkg.h +++ b/src/qf_pkg.h @@ -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 . /// /// 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_;