Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -r3454906bbb35aa2976572145068980bf691daf1c -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 3454906bbb35aa2976572145068980bf691daf1c) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -102,6 +102,7 @@ #include "VTDSwitchesData.h" #include "VTDEjectorData.h" #include "VTDTemperatureData.h" +#include "VTreatmentTrends.h" // DG data #include "VDGDrainPumpData.h" #include "VDDHeatersData.h" Index: sources/gui/qml/main.qml =================================================================== diff -u -rafd1d028227b4f58f864aa814fc4d4e286cb873b -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/gui/qml/main.qml (.../main.qml) (revision afd1d028227b4f58f864aa814fc4d4e286cb873b) +++ sources/gui/qml/main.qml (.../main.qml) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -386,23 +386,6 @@ function onStandbyWaitDisinfectChanged ( vValue ) { _mainMenu.isTreatment() } } - Connections { target: vTreatmentVitals - function onDidTimeout() { - // interval set to OFF so just record without vitals - if ( ! vTreatmentVitals.interval ) { - vTreatmentTrends.onNoVitalsRecord() - } - // interval is set and BP cuff is available - else if ( vTreatmentVitals.enableBPCuff ) { - vTreatmentTrends.onIntervalRequestVitals() - } - } - } - - Connections { target: vTreatmentAdjustmentVitals - function onDidTimeout() { vTreatmentTrends.onIntervalTimeoutVitals() } - } - Connections { target: _mainStack function onIsCreateRx ( vState ) { _headerBar.isCreateRx = vState } } Index: sources/gui/qml/pages/treatment/TreatmentTrends.qml =================================================================== diff -u -r3f45841f8e2fa936666f8de8e2a02fe19fb39a8d -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/gui/qml/pages/treatment/TreatmentTrends.qml (.../TreatmentTrends.qml) (revision 3f45841f8e2fa936666f8de8e2a02fe19fb39a8d) +++ sources/gui/qml/pages/treatment/TreatmentTrends.qml (.../TreatmentTrends.qml) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -47,25 +47,6 @@ readonly property int historyTimeWidth : 50 } - component ScrollButton: TouchRect { id: _scrollButton - objectName : "_scrollButton" - property alias iconSource : _iconImage.source - anchors.verticalCenter : parent.verticalCenter - width : _private.scrollButtonWidth - height : _private.scrollButtonWidth - border.color : Colors.transparent - backgroundColor : Colors.transparent - - Image { id: _iconImage - objectName : "_iconImage" - anchors.centerIn : parent - height : 35 - width : 35 - fillMode : Image.PreserveAspectFit - source : "qrc:/images/iArrowLeft" - } - } - component Header: Rectangle { id: _header objectName : "_header" property alias label : _labelText.text @@ -365,11 +346,11 @@ ListView { id: _paramList objectName: "_paramList" readonly property int visibleParamCount: _paramArea.isExpanded ? 7 : 5 - readonly property int modelCount: model.count ?? 0 + readonly property int modelCount: _paramList.count ?? 0 anchors { fill : parent - rightMargin : (Math.max(0, visibleParamCount - model.count) * _private.paramWidth) + rightMargin : (Math.max(0, visibleParamCount - _paramList.count) * _private.paramWidth) } orientation : ListView.Horizontal layoutDirection : Qt.RightToLeft @@ -474,20 +455,22 @@ direction : ScrollBar2.Horizontal scrollColor : "#606060" flickable : _paramList - opacity : _paramList.model.count > _paramList.visibleParamCount + opacity : _paramList.count > _paramList.visibleParamCount || _paramList.flicking || _paramList.dragging ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 200 } } } - ScrollButton { id: _leftScrollButton + ArrowButton { id: _leftScrollButton objectName: "_leftScrollButton" anchors { right : _paramListArea.left verticalCenter : _paramTopHeader.verticalCenter } touchable : _paramList.atXBeginning === false - iconSource : touchable ? "qrc:/images/iArrowLeft" : "qrc:/images/iArrowLeftDisabled" + iconImage : touchable ? "qrc:/images/iArrowLeft" : "qrc:/images/iArrowLeftDisabled" + isDefault : false + borderColor : Colors.transparent onClicked: { if (_paramList.atXBeginning === false) { @@ -496,15 +479,17 @@ } } - ScrollButton { id: _rightScrollButton + ArrowButton { id: _rightScrollButton objectName: "_rightScrollButton" anchors { right : parent.right rightMargin : _private.paramAreaRightMargin // Variables.defaultMargin verticalCenter : _paramTopHeader.verticalCenter } touchable : _paramList.atXEnd === false - iconSource : touchable ? "qrc:/images/iArrowRight" : "qrc:/images/iArrowRightDisabled" + iconImage : touchable ? "qrc:/images/iArrowRight" : "qrc:/images/iArrowRightDisabled" + isDefault : false + borderColor : Colors.transparent onClicked: { if (_paramList.atXEnd === false) { @@ -623,7 +608,7 @@ ListView { id: _historyList objectName: "_historyList" - readonly property int modelCount: model.count ?? 0 + readonly property int modelCount: _paramList.count ?? 0 anchors { top : _timeArea.bottom Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml =================================================================== diff -u -rafd1d028227b4f58f864aa814fc4d4e286cb873b -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision afd1d028227b4f58f864aa814fc4d4e286cb873b) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -179,11 +179,13 @@ function onDidTimeout () { // interval set to OFF but 15 min default timer still running if ( ! vTreatmentVitals.interval ) { + vTreatmentTrends.onNoVitalsRecord() return } // On Timeout request vitals if BP cuff is enabled or show popup for manual entry if ( vTreatmentVitals.enableBPCuff ) { + vTreatmentTrends.onIntervalRequestVitals() vTreatmentAdjustmentVitals.doRequest() } else { @@ -215,7 +217,10 @@ } // FW no response timeout - function onDidTimeout ( ) { vTreatmentVitals.doSkip(); } + function onDidTimeout ( ) { + vTreatmentTrends.onIntervalTimeoutVitals() + vTreatmentVitals.doSkip() + } } Behavior on x { NumberAnimation { duration: Variables.keybardAnimationDuration } } Index: sources/model/MListModel.cpp =================================================================== diff -u -rc1e50347c78096b626b2cd1ef32a33b439e88bdd -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/model/MListModel.cpp (.../MListModel.cpp) (revision c1e50347c78096b626b2cd1ef32a33b439e88bdd) +++ sources/model/MListModel.cpp (.../MListModel.cpp) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -1,17 +1,6 @@ #include "MListModel.h" /*! - * \brief Constructor - * \param[in] parent - Parent of this object. - */ -View::MListModel::MListModel(QObject *parent) - : QAbstractListModel(parent) -{ - connect(this, &MListModel::rowsInserted, this, &MListModel::countChanged); - connect(this, &MListModel::rowsRemoved, this, &MListModel::countChanged); -} - -/*! * \brief Retrieve the role names set for this list model. * \return Role names used for this model. */ Index: sources/model/MListModel.h =================================================================== diff -u -rc1e50347c78096b626b2cd1ef32a33b439e88bdd -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/model/MListModel.h (.../MListModel.h) (revision c1e50347c78096b626b2cd1ef32a33b439e88bdd) +++ sources/model/MListModel.h (.../MListModel.h) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -17,10 +17,8 @@ { Q_OBJECT - Q_PROPERTY(int count READ rowCount NOTIFY countChanged STORED false) - public: - explicit MListModel(QObject *parent = nullptr); + explicit MListModel(QObject *parent = nullptr) : QAbstractListModel (parent) { } QHash roleNames ( ) const override; int rowCount (const QModelIndex & = QModelIndex() ) const override; @@ -33,12 +31,9 @@ void updateData (const int vRow, const int vRole, const QVariant& vValue ); MListModel &operator = (const QList> &src ); -public Q_SLOTS: +public slots: QVariantMap get (int vRow ) const; // Exposed to QML -Q_SIGNALS: - void countChanged(); - private: QList> _data; QHash _roleNames; Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -rcde103b58b55aa638697152111d3fa5325afd2e7 -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision cde103b58b55aa638697152111d3fa5325afd2e7) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -142,15 +142,15 @@ * \param vShowID - flag indicting whether to include the alarm ID in the returned title or not * \return the alarm title */ -QString TreatmentLog::alarmTitle(quint32 vID, const bool vShowID) { +QString TreatmentLog::alarmTitle(quint32 vID) { QString str = "%1-%2"; QString title = "undefined"; if ( _treatmentLogAlarmTitles.contains(vID) ) { title = _treatmentLogAlarmTitles[vID] .replace("," , "-") // the Txr is a csv file and any ',' in the title will break it. .replace("\n" , "-"); // removing any new line since this will break the Txr as well. } - return vShowID ? str.arg(vID, 3).arg(title) : title; + return str.arg(vID, 3).arg(title); } /*! @@ -160,19 +160,53 @@ * \param vShowID - flag indicting whether to include the alarm ID in the returned title or not * \return the event title */ -QString TreatmentLog::eventTitle(quint32 vID, const bool vShowID) { +QString TreatmentLog::eventTitle(quint32 vID) { QString str = "%1 - %2"; QString title = "undefined"; if ( _treatmentLogEventTitles.contains(vID) ) { title = _treatmentLogEventTitles[vID] .replace("," , "-") // the Txr is a csv file and any ',' in the title will break it. .replace("\n" , "-"); // removing any new line since this will break the Txr as well. } - return vShowID ? str.arg(vID, 3).arg(title) : title; + return str.arg(vID, 3).arg(title); } +/*! + * \brief TreatmentLog::trendsAlarmTitle + * \details prepares the trends alarm title and returns. + * \param vID - the alarm ID + * \return the alarm title + */ +QString TreatmentLog::trendsAlarmTitle(quint32 vID) { + QString str = "%1-%2"; + QString title = "undefined"; + if ( _treatmentLogAlarmTitles.contains(vID) ) { + title = _treatmentLogAlarmTitles[vID] + .replace("," , "-") // the Txr is a csv file and any ',' in the title will break it. + .replace("\n" , "-"); // removing any new line since this will break the Txr as well. + } + return title; +} /*! + * \brief TreatmentLog::trendsEventTitle + * \details prepares the trends event title and returns. + * \param vID - the event ID + * \return the event title + */ +QString TreatmentLog::trendsEventTitle(quint32 vID) { + QString str = "%1 - %2"; + QString title = "undefined"; + if ( _treatmentLogEventTitles.contains(vID) ) { + title = _treatmentLogEventTitles[vID] + .replace("," , "-") // the Txr is a csv file and any ',' in the title will break it. + .replace("\n" , "-"); // removing any new line since this will break the Txr as well. + } + return title; +} + + +/*! * \brief TreatmentLog::timerEvent * \details The overloaded method of the main class to capture the QObject timer. */ Index: sources/storage/TreatmentLog.h =================================================================== diff -u -rcde103b58b55aa638697152111d3fa5325afd2e7 -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision cde103b58b55aa638697152111d3fa5325afd2e7) +++ sources/storage/TreatmentLog.h (.../TreatmentLog.h) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -226,8 +226,10 @@ void readAlarmTitles ( ); void readEventTitles ( ); - QString alarmTitle (quint32 vID, const bool vShowID = true); - QString eventTitle (quint32 vID, const bool vShowID = true); + QString alarmTitle (quint32 vID); + QString eventTitle (quint32 vID); + QString trendsAlarmTitle (quint32 vID); + QString trendsEventTitle (quint32 vID); void initConnections(); Index: sources/view/VView.h =================================================================== diff -u -r3454906bbb35aa2976572145068980bf691daf1c -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/view/VView.h (.../VView.h) (revision 3454906bbb35aa2976572145068980bf691daf1c) +++ sources/view/VView.h (.../VView.h) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -248,6 +248,7 @@ REGISTER_TYPE( VTreatmentAdjustmentSetPoints ) \ REGISTER_TYPE( VTreatmentCreate ) \ REGISTER_TYPE( VTreatmentIsolatedUF ) \ + REGISTER_TYPE( VTreatmentTrends ) \ /* Post-Treatment */ \ REGISTER_TYPE( VPostTreatmentAdjustmentPatientDisconnectionConfirm ) \ REGISTER_TYPE( VPostTreatmentAdjustmentDisposablesRemovalConfirm ) \ Index: sources/view/td/data/treatment/VTreatmentTrends.cpp =================================================================== diff -u -r3f45841f8e2fa936666f8de8e2a02fe19fb39a8d -raacca8cc53f5e4ff5abb6d7df3d5ad48c915645c --- sources/view/td/data/treatment/VTreatmentTrends.cpp (.../VTreatmentTrends.cpp) (revision 3f45841f8e2fa936666f8de8e2a02fe19fb39a8d) +++ sources/view/td/data/treatment/VTreatmentTrends.cpp (.../VTreatmentTrends.cpp) (revision aacca8cc53f5e4ff5abb6d7df3d5ad48c915645c) @@ -23,15 +23,6 @@ using namespace View; /*! - * \brief Function called during startup to register this class with the QMetaObject system - */ -static void qRegister() -{ - qmlRegisterType ("VTreatmentTrends", 0, 1, "VTreatmentTrends"); -} -Q_COREAPP_STARTUP_FUNCTION(qRegister) - -/*! * \brief View::VTreatmentTrends * \details Constructor * \param parent - parent of this object @@ -41,7 +32,6 @@ _data(this), _history(this) { - QQmlEngine::setObjectOwnership(&_data, QQmlEngine::CppOwnership); _data.setRoleNames({ { eDataRole_Timestamp, "timestamp" }, { eDataRole_Systolic, "systolic" }, @@ -131,7 +121,7 @@ entry[eHistoryRole_Timestamp] = QDateTime::currentDateTime(); entry[eHistoryRole_EntryID] = vData.mAlarmID; entry[eHistoryRole_Priority] = 0; - entry[eHistoryRole_Message] = _TreatmentLog.alarmTitle(vData.mAlarmID, false); + entry[eHistoryRole_Message] = _TreatmentLog.trendsAlarmTitle(vData.mAlarmID); _history.insertRow(0, entry); } @@ -147,7 +137,7 @@ entry[eHistoryRole_Timestamp] = QDateTime::currentDateTime(); entry[eHistoryRole_EntryID] = vData.mEventID; entry[eHistoryRole_Priority] = 0; - entry[eHistoryRole_Message] = _TreatmentLog.eventTitle(vData.mEventID, false); + entry[eHistoryRole_Message] = _TreatmentLog.trendsEventTitle(vData.mEventID); _history.insertRow(0, entry); }