Index: leahi.qrc =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- leahi.qrc (.../leahi.qrc) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ leahi.qrc (.../leahi.qrc) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -164,6 +164,7 @@ sources/gui/qml/components/AlarmButtonRow.qml sources/gui/qml/components/BaseComboBox.qml sources/gui/qml/components/VitalsButton.qml + sources/gui/qml/components/IdleTimer.qml sources/gui/qml/compounds/PressureRangeSlider.qml Index: sources/gui/qml/components/IdleTimer.qml =================================================================== diff -u --- sources/gui/qml/components/IdleTimer.qml (revision 0) +++ sources/gui/qml/components/IdleTimer.qml (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -0,0 +1,43 @@ +/*! + * + * Copyright (c) 2025-2025 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file BaseComboBox.qml + * \author (last) Nico Ramirez + * \date (last) 2-Dec-2025 + * \author (original) Nico Ramirez + * \date (original) 2-Dec-2025 + * + */ + +// Qt +import QtQuick 2.15 + +Item { id: _root + property int timeout: 1000 * 60 // 1000 ms * 60 sec = 1 min + signal idle() // emitted when user is inactive + + focus : true + Keys.onPressed : reset() + + // Call this whenever user interacts + function reset() { + _idleTimer.restart() + } + + Timer {id: _idleTimer + interval : _root.timeout + repeat : false + onTriggered : _root.idle() + } + + MouseArea { // Mouse + touch + anchors.fill : parent + onPressed : _root.reset() + onReleased : _root.reset() + onPositionChanged : _root.reset() + } +} Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -59,7 +59,7 @@ ListModel { id: _mainTreatmentModel ListElement { text: qsTr("Treatment"); visible: true; screen: 0 } // MainMenu.Treatment ListElement { text: qsTr("Trends"); visible: true; screen: 1 } // MainMenu.Trends - ListElement { text: qsTr("Heparin"); visible: true; /*vSettings.heparinSyringePump */ screen: 2 } // MainMenu.Heparin + ListElement { text: qsTr("Heparin"); visible: true; /*TODO: vSettings.heparinSyringePump */ screen: 2 } // MainMenu.Heparin ListElement { text: qsTr("HDF"); visible: true; screen: 3 } // MainMenu.HDF } Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -56,16 +56,16 @@ onHeaderMenuIndexChanged: { switch( _headerBar.currentScreen ) { case MainMenu.Treatment: - pop(null) // unwind stack + page( _treatmentHome ) break case MainMenu.Trends: - page(_treatmentTrends) + page( _treatmentTrends ) break; case MainMenu.Heparin: - page(_treatmentHeparin) + page( _treatmentHeparin ) break case MainMenu.HDF: // TODO - page(_treatmentHDF) + page( _treatmentHDF ) break default: pop(null) @@ -99,9 +99,14 @@ ScreenItem { id: _treatmentTrends } // TODO: make me! TreatmentHeparin { id: _treatmentHeparin } + Connections { target: _treatmentHeparin + function onIdleTimeout ( ) { + _headerBar.headerMenuIndex = MainMenu.Treatment // on heparin idle timeout go to main treatment + } + } + ScreenItem { id: _treatmentHDF } // TODO: make me! - //// Treatment Adjustment Dialogs TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow } TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } Index: sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml (.../TreatmentHeparin.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/gui/qml/pages/treatment/sections/TreatmentHeparin.qml (.../TreatmentHeparin.qml) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. + * Copyright (c) 2025-2025 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file TreatmentHeparin.qml - * \author (last) Vy - * \date (last) 17-May-2023 - * \author (original) Behrouz NematiPour - * \date (original) 20-Nov-2020 + * \file BaseComboBox.qml + * \author (last) Nico Ramirez + * \date (last) 2-Dec-2025 + * \author (original) Nico Ramirez + * \date (original) 2-Dec-2025 * */ @@ -36,7 +36,6 @@ readonly property bool isCompleted : vTDTreatmentStates.hpCompleted readonly property bool isEmpty : vTDTreatmentStates.hpEmpty readonly property bool isRejected : vTreatmentAdjustmentHeparin.adjustment_Accepted -// readonly property bool displayReason : _private.displayReason readonly property bool isTxRunning : vTDTreatmentStates.txDialysis readonly property color heparinColor : _root.deliveryOff ? Colors.transparent : @@ -55,10 +54,11 @@ readonly property var units : [ Variables.unitHeparinType, Variables.unitTextDispensingRate, Variables.unitTextDispensingRate, Variables.unitTextDuration ] readonly property var values : [ "Unfractionated 1000", vTreatmentCreate.heparinDispensingRate, vTreatmentCreate.heparinBolusVolume, vTreatmentCreate.heparinStopTime ] - readonly property real cumulative : 0.23 // vTreatmentHeparin.cumulative - readonly property real target : 1.0 // vTreatmentHeparin.target - readonly property string timeRemaining : "01:39" // vTreatmentHeparin.timeRemaining + readonly property real cumulative : vTreatmentHeparin.cumulative + readonly property real target : vTreatmentHeparin.target + readonly property string timeRemaining : vTreatmentHeparin.timeRemaining + signal idleTimeout() onHeparinColorChanged : _headerBar.statusColor = heparinColor @@ -92,8 +92,23 @@ } } + Connections { target: vTreatmentAdjustmentHeparin + function onAdjustmentTriggered ( vValue ) { + _notification.text = vTreatmentAdjustmentHeparin.adjustment_Accepted ? "" : + vTreatmentAdjustmentHeparin.adjustment_ReasonText + } + } + + IdleTimer {id: _idleTimer + anchors.fill : parent + + onIdle: { + _root.idleTimeout() + } + } + Row { id: _row - objectName : "_row" + objectName : "_row" spacing : Variables.defaultMargin * 5 anchors { @@ -181,6 +196,7 @@ onPressed : { if ( _root.isPaused ) vTreatmentAdjustmentHeparin.doResume() if ( _root.isDispensing ) vTreatmentAdjustmentHeparin.doPause () + _idleTimer.reset() } } @@ -241,7 +257,7 @@ left : parent.left leftMargin : 5 } - width : _timeRemaining.contentWidth / 2 + width : 70 text : Variables.unitTextHrs color : Colors.white font.pixelSize : Fonts.fontPixelContainerUnit @@ -326,14 +342,14 @@ } } - Connections { target: vTreatmentAdjustmentHeparin - function onAdjustmentTriggered ( vValue ) { -// _private.displayReason = ! vTreatmentAdjustmentHeparin.adjustment_Accepted - } + NotificationBarSmall { id: _notification + visible : text + color : Colors.transparent + textColor : Colors.white + imageSource : "" + text : "" + anchors.bottomMargin: _root.notificationMargin } - Connections { target: vTDTreatmentStates - function onHeparinChanged ( vValue ) { -// _private.displayReason = false - } - } + + } Index: sources/model/hd/data/treatment/MTreatmentHeparinData.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/model/hd/data/treatment/MTreatmentHeparinData.cpp (.../MTreatmentHeparinData.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/model/hd/data/treatment/MTreatmentHeparinData.cpp (.../MTreatmentHeparinData.cpp) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -18,15 +18,17 @@ QVariantList MTreatmentHeparin::parameters() const { return { - _data.mCumulative .value, - _data.mTarget .value + _data.mCumulative .value, + _data.mTarget .value, + _data.mTimeRemaining.value }; } bool MTreatmentHeparin::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position - if ( ! GetValue(vByteArray, index, _data.mCumulative )) goto lError; - if ( ! GetValue(vByteArray, index, _data.mTarget )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mCumulative )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mTarget )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mTimeRemaining )) goto lError; return true ; @@ -43,7 +45,8 @@ */ MTreatmentHeparin::Data MTreatmentHeparin::data() const { Data data; - data.mCumulative = _data.mCumulative .value; - data.mTarget = _data.mTarget .value; + data.mCumulative = _data.mCumulative .value; + data.mTarget = _data.mTarget .value; + data.mTimeRemaining = _data.mTimeRemaining .value; return data; } Index: sources/model/hd/data/treatment/MTreatmentHeparinData.h =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/model/hd/data/treatment/MTreatmentHeparinData.h (.../MTreatmentHeparinData.h) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/model/hd/data/treatment/MTreatmentHeparinData.h (.../MTreatmentHeparinData.h) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -38,7 +38,7 @@ * | || * | #1:(F32) | \ref Data::mCumulative | * | #2:(F32) | \ref Data::mTarget | - * | #2:(F32) | \ref Data::mTimeRemaining | + * | #2:(U32) | \ref Data::mTimeRemaining | * * \sa Data * \sa MAdjustHeparinReq : Heparin Request @@ -62,7 +62,7 @@ struct { Types::F32 mCumulative ; Types::F32 mTarget ; - Types::F32 mTimeRemaining ; + Types::U32 mTimeRemaining ; } _data; public: @@ -74,7 +74,7 @@ struct Data { float mCumulative = 0; ///< Cumulative volume of all Heparin deliveries during current treatment float mTarget = 0; ///< Target volume of all Heparin deliveries during current treatment - float mTimeRemaining = 0; ///< Time remaining heparing time remaining + int mTimeRemaining = 0; ///< Time remaining heparing time remaining }; public: Index: sources/view/hd/data/treatment/VTreatmentHeparinData.cpp =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/view/hd/data/treatment/VTreatmentHeparinData.cpp (.../VTreatmentHeparinData.cpp) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/view/hd/data/treatment/VTreatmentHeparinData.cpp (.../VTreatmentHeparinData.cpp) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -23,5 +23,9 @@ { cumulative (vData.mCumulative ); target (vData.mTarget ); - timeRemaining (vData.mTimeRemaining ); + + int hours = vData.mTimeRemaining / 3600; + int minutes = (vData.mTimeRemaining % 3600) / 60; + timeRemaining (QString("%1:%2") .arg(hours, 2, 10, QChar('0')) + .arg(minutes, 2, 10, QChar('0')) ); } Index: sources/view/hd/data/treatment/VTreatmentHeparinData.h =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r8ff1852fbcf348761fd30f878f31fa43ffa9e37c --- sources/view/hd/data/treatment/VTreatmentHeparinData.h (.../VTreatmentHeparinData.h) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/view/hd/data/treatment/VTreatmentHeparinData.h (.../VTreatmentHeparinData.h) (revision 8ff1852fbcf348761fd30f878f31fa43ffa9e37c) @@ -36,11 +36,10 @@ { Q_OBJECT - PROPERTY( float , cumulative , 0) - PROPERTY( float , target , 0) - PROPERTY( float , timeRemaining , 0) + PROPERTY( float , cumulative , 0) + PROPERTY( float , target , 0) + PROPERTY( QString , timeRemaining , 0) - VIEW_DEC(VTreatmentHeparin, TreatmentHeparinData) }; }