Index: leahi.qrc =================================================================== diff -u -r56c2adbc6e724c09d5ca9d61cb0a1581d46daf02 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- leahi.qrc (.../leahi.qrc) (revision 56c2adbc6e724c09d5ca9d61cb0a1581d46daf02) +++ leahi.qrc (.../leahi.qrc) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -173,6 +173,7 @@ sources/gui/qml/compounds/CheckListView.qml sources/gui/qml/compounds/TouchGrid.qml sources/gui/qml/compounds/BPHREntry.qml + sources/gui/qml/compounds/PreTreatmentCreateItem.qml qtquickcontrols2.conf @@ -237,7 +238,7 @@ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml - sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateItem.qml + sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml sources/gui/qml/pages/pretreatment/connection/PreTreatmentUltrafiltration.qml Index: sources/gui/qml/components/ValueControl.qml =================================================================== diff -u -r8b84749609138274fb1b899c7862239f12ea2f41 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/components/ValueControl.qml (.../ValueControl.qml) (revision 8b84749609138274fb1b899c7862239f12ea2f41) +++ sources/gui/qml/components/ValueControl.qml (.../ValueControl.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -32,7 +32,6 @@ property bool canIncrement : active ? value > minimum : true property bool canDecrement : active ? value < maximum : true - property int holdInterval : 600 onActiveChanged : if ( active ) { _root.value = _root.defaultValue } @@ -83,21 +82,28 @@ property bool grabbed: false anchors.fill : parent - pressAndHoldInterval: _root.holdInterval + pressAndHoldInterval: 0 onClicked: { - if ( _root.editable ) { active = focus = true } + if ( _root.editable ) { + active = true + focus = true + } _slider.opacity = 0 } onReleased: { - grabbed = false + _sliderMouseArea.grabbed = true +. grabbed = false _slider.opacity = 0 } onPressAndHold: { - if ( _root.editable ) { _root.active = focus = true } + if ( _root.editable ) { + active = true + focus = true + } _sliderMouseArea.grabbed = true } @@ -125,8 +131,8 @@ target : _slider from : 0 to : 1 - duration: _root.holdInterval - running : _sliderMouseArea.pressed + duration: 350 + running : _sliderMouseArea.grabbed } Behavior on opacity { NumberAnimation { duration: 200 } } Index: sources/gui/qml/compounds/PreTreatmentCreateItem.qml =================================================================== diff -u --- sources/gui/qml/compounds/PreTreatmentCreateItem.qml (revision 0) +++ sources/gui/qml/compounds/PreTreatmentCreateItem.qml (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -0,0 +1,90 @@ +/*! + * + * Copyright (c) 2021-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 PreTreatmentCreateItem.qml + * \author (last) Nico Ramirez + * \date (last) 21-Aug-2025 + * \author (original) Nico Ramirez + * \date (original) 21-Aug-2025 + * + */ + +// Qt +import QtQuick 2.12 + +// Qml +import "qrc:/globals" +import "qrc:/components" +import "qrc:/pages/pretreatment" + +Rectangle { id: _root + property Item contentItem : null + property alias contentArea : _contentArea + + property alias text : _title.text + property string unitText: "" + property bool valid : true + property bool showUnit : true + property bool showEdit : false + + height : cellHeight + width : cellWidth + radius : 8.5 + color : Colors.panelBackgroundColor + + border { + width: 1 + color: valid ? Colors.panelBorderColor : Colors.panelInvalidBorderColor + } + + signal editClicked + + Row { id: _titleRow + anchors { + verticalCenter : parent.verticalCenter + left : parent.left + leftMargin : Variables.defaultMargin + } + spacing : 10 + + Text { id: _title + anchors.verticalCenter : _titleRow.verticalCenter + color : Colors.offWhite + font.pixelSize : 28 + } + + Text { id: _unit + anchors.bottom : _title.bottom + text : ("(%1)").arg(_root.unitText) + color : Colors.offWhite + font.pixelSize : 22 + font.weight : Font.Thin + visible : _root.showUnit + } + + IconButton { id : _editButton + anchors.verticalCenter : _title.verticalCenter + anchors.verticalCenterOffset : 5 + visible : _root.showEdit + iconImageSource : "qrc:/images/iEdit" + onPressed : _root.editClicked() + iconSize : Variables.iconsDiameter + } + } + + ContentArea { id : _contentArea + anchors { + top : _root.top + left : _root.left + leftMargin : _root.width / 2 + right : _root.right + bottom : _root.bottom + } + + contentItem: _root.contentItem + } +} Index: sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml =================================================================== diff -u -r53ec19e12772f2a73190323438106dc93e4a12df -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml (.../AcidConcentrateAdjustment.qml) (revision 53ec19e12772f2a73190323438106dc93e4a12df) +++ sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml (.../AcidConcentrateAdjustment.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -21,13 +21,16 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" import "qrc:/pages/pretreatment/create" ModalDialog { id : _root property int controlWidth : 770 property int controlHeight : 86 - readonly property string adjustment: ("%1 K, %2 Ca, 1 Mg") .arg(_potassiumVolumeControl.value.toFixed(Variables.potassiumPrecision)) - .arg(_calciumVolumeControl.value.toFixed(Variables.calciumPrecision)) + readonly property string adjustment: ("%1 %2, %3 %4, 1 Mg") .arg(_potassiumVolumeControl.value.toFixed(Variables.potassiumPrecision)) + .arg(Variables.unitTextPotassium) + .arg(_calciumVolumeControl.value.toFixed(Variables.calciumPrecision)) + .arg(Variables.unitTextCalcium) width : 1000 height : 600 @@ -74,10 +77,10 @@ height : _root.controlHeight contentItem : ValueControl { id: _potassiumVolumeControl - minimum : 0.0 // TODO: NR - Update to .conf values when available - maximum : 4.0 // LEAHI-PRS-660 , LEAHI-PRS-241 - step : 1.0 - defaultValue : 2.0 + minimum : Variables.potassiumMin // TODO: NR - Update to .conf values when available + maximum : Variables.potassiumMax // LEAHI-PRS-660 , LEAHI-PRS-241 + step : Variables.potassiumResolution + defaultValue : Variables.potassiumDefault decimal : Variables.potassiumPrecision } } @@ -95,10 +98,10 @@ height : _root.controlHeight contentItem : ValueControl { id: _calciumVolumeControl - minimum : 0.0 // TODO: NR - Update to .conf values when available - maximum : 3.5 // LEAHI-PRS-660 , LEAHI-PRS-241 - step : 0.25 - defaultValue : 2.5 + minimum : Variables.calciumMin // TODO: NR - Update to .conf values when available + maximum : Variables.calciumMax // LEAHI-PRS-660 , LEAHI-PRS-241 + step : Variables.calciumResolution + defaultValue : Variables.calciumDefault decimal : Variables.calciumPrecision } } Index: sources/gui/qml/dialogs/diagnostics/DiagnosticsDialog.qml =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/dialogs/diagnostics/DiagnosticsDialog.qml (.../DiagnosticsDialog.qml) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/gui/qml/dialogs/diagnostics/DiagnosticsDialog.qml (.../DiagnosticsDialog.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -28,7 +28,6 @@ width : Variables.applicationWidth height : Variables.applicationHeight - 60 - showGradient : true DiagnosticsSwipe { id: _diagnosticsSwipe anchors.fill: parent Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r53ec19e12772f2a73190323438106dc93e4a12df -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 53ec19e12772f2a73190323438106dc93e4a12df) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -221,9 +221,17 @@ // Potassium readonly property int potassiumPrecision : 1 + readonly property int potassiumMin : 0 + readonly property int potassiumMax : 4 + readonly property int potassiumResolution : 1 + readonly property int potassiumDefault : 2 // Calcium - readonly property int calciumPrecision : 2 + readonly property int calciumPrecision : 2 + readonly property real calciumMin : 0.0 + readonly property real calciumMax : 3.5 + readonly property real calciumResolution : 0.25 + readonly property real calciumDefault : 2.5 function sizeConverted(vSize, vSizePowers, vRound = 2) { return ( vSize Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -46,7 +46,7 @@ // Standby / Disinfection DisinfectStack { id: _disinfectStack } // Pre Treatment - PreTreatmentCreate { id: _preTreatmentCreate } + PreTreatmentCreateStack { id: _preTreatmentCreateStack } PreTreatmentStack { id: _preTreatmentStack } // In TreatmentStack TreatmentStack { id: _treatmentStack } @@ -139,8 +139,8 @@ function onStandbyWaitTreatmentChanged ( vValue ) { if ( vValue ) vDisinfectAdjustDisinfect.hasCancel = false } function onStandbyWaitDisinfectChanged ( vValue ) { page( _disinfectStack , vValue )} - function onValidateParametersChanged ( vValue ) { _preTreatmentCreate.clear ( vValue ) // vValue == true if enterig the state ( clear only on entering). - page( _preTreatmentCreate , vValue )} + function onValidateParametersChanged ( vValue ) { _preTreatmentCreateStack.clear ( vValue ) // vValue == true if enterig the state ( clear only on entering). + page( _preTreatmentCreateStack , vValue )} function onPreTreatmentChanged ( vValue ) { page( _preTreatmentStack , vValue )} function onInTreatmentChanged ( vValue ) { page( _treatmentStack , vValue )} function onPostTreatmentChanged ( vValue ) { page( _postTreatmentStack , vValue )} Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -28,7 +28,6 @@ */ PreTreatmentBase { id: _root objectName: "_PreTreatmentCreate" // SquishQt testability - property int stackStepIndex : 0 header.backVisible : false header.confirmVisible : true Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r53ec19e12772f2a73190323438106dc93e4a12df -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 53ec19e12772f2a73190323438106dc93e4a12df) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -20,6 +20,7 @@ // Qml import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" import "qrc:/dialogs" import "qrc:/pages/pretreatment" @@ -256,7 +257,10 @@ maximum : vTreatmentRanges.treatmentDurationMax step : vTreatmentRanges.treatmentDurationRes defaultValue : vTreatmentRanges.treatmentDurationDef - onValueChanged : vTreatmentCreate.treatmentDuration = value + onValueChanged : { + vTreatmentCreate.treatmentDuration = value + if (_heparinStopTimeControl.value > value) { _heparinStopTimeControl.value = value } + } } } @@ -300,9 +304,9 @@ contentItem : ValueControl { id: _heparinStopTimeControl editable : _root.editingEnabled minimum : vTreatmentRanges.heparinStopTimeMin - maximum : vTreatmentRanges.heparinStopTimeMax - step : vTreatmentRanges.heparinStopTimeRes - defaultValue : vTreatmentRanges.heparinStopTimeDef + maximum : _durationControl.value + step : _durationControl.step + defaultValue : _durationControl.value onValueChanged : vTreatmentCreate.heparinStopTime = value } } Fisheye: Tag 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec refers to a dead (removed) revision in file `sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateItem.qml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 16a8f25568b4636ebc31e76c86a8031940cc4ad7 refers to a dead (removed) revision in file `sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/settings/MSettings.cpp =================================================================== diff -u -r9de37dc1a1e423fe5798c76313d1574a8b638047 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 9de37dc1a1e423fe5798c76313d1574a8b638047) +++ sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -142,20 +142,6 @@ } } -/*! - * \brief MSettings::remove - * \details The function to be used to remove elements in the settings - * \param vGroup - the group of the settings - * \param vKey - the key to be removed under the group vGroup - * \param vValue - the value of the key to be removed under group vGroup for the key vKey - */ -void MSettings::remove (const QString &vCategory, const QString &vGroup, const QString &vKey, const QVariant &vValue) -{ - const TKeyValue keyValue (vKey, vValue); - const int index = _settings[vCategory][vGroup].indexOf(keyValue); - _settings[vCategory][vGroup].removeAt(index); -} - QString MSettings::systemLocale () { return value(Storage::Settings_Category_Locale, "Localization", "Locale" ).toString(); } QString MSettings::systemLanguage () { return value(Storage::Settings_Category_Locale, "Localization", "Language" ).toString(); } Index: sources/model/settings/MSettings.h =================================================================== diff -u -r53ec19e12772f2a73190323438106dc93e4a12df -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/model/settings/MSettings.h (.../MSettings.h) (revision 53ec19e12772f2a73190323438106dc93e4a12df) +++ sources/model/settings/MSettings.h (.../MSettings.h) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -83,7 +83,6 @@ QVariant value (const QString &vCategory, const QString &vGroup , const QString &vKey); void add (const QString &vCategory, const QString &vGroup , const QString &vKey, const QVariant &vValue, bool vEnableDuplicateKeys); - void remove (const QString &vCategory, const QString &vGroup , const QString &vKey, const QVariant &vValue); QString systemLocale (); QString systemLanguage (); Index: sources/view/hd/data/VTreatmentRanges.cpp =================================================================== diff -u -r9de37dc1a1e423fe5798c76313d1574a8b638047 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 9de37dc1a1e423fe5798c76313d1574a8b638047) +++ sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -54,16 +54,16 @@ */ void View::VTreatmentRanges::doSaveAcidConcentrate (const QString &vOption) { - const QString mCategory = Storage::Settings_Category_DataList; + // check if unique + if ( _acidConcentrateOptions.contains(vOption) ) { return; } - _Settings.add(mCategory, - "Acid Concentrate Options", - vOption, - QVariant("temp"), // set temp string to know to remove later - false ); + if ( ! _acidConcentrate.isEmpty() ) { _acidConcentrateOptions.removeLast(); } + _acidConcentrateOptions.append(vOption); + acidConcentrate(vOption); + // update - acidConcentrateOptions ( _Settings.keys(mCategory, "Acid Concentrate Options" )); + emit acidConcentrateOptionsChanged(_acidConcentrateOptions); } /** @@ -75,21 +75,11 @@ { if ( ! vSet ) { return; } - const QString mCategory = Storage::Settings_Category_DataList; - const int size = _Settings.keys(mCategory, "Acid Concentrate Options" ).size(); + if ( ! _acidConcentrate.isEmpty() ) { _acidConcentrateOptions.removeLast(); } + acidConcentrate(""); - for ( int i = size - 1; i >= 0; --i ) { - // remove any populated values. The original from .config are empty strings - if ( ! _Settings.values(mCategory, "Acid Concentrate Options" )[i].toString().isEmpty() ) { - _Settings.remove(mCategory, - "Acid Concentrate Options", - _Settings.keys(mCategory, "Acid Concentrate Options")[i], - _Settings.values(mCategory, "Acid Concentrate Options" )[i]); - } - } - // update - acidConcentrateOptions ( _Settings.keys(mCategory, "Acid Concentrate Options" )); + emit acidConcentrateOptionsChanged(_acidConcentrateOptions); } /*! @@ -133,9 +123,10 @@ FROMVARIANT_WITHRETURN ( heparinBolusVolumeRes , "Heparin Bolus Volume Ranges" , "Heparin_Bolus_Volume_Res" , Float , isConfigsOk ); FROMVARIANT_WITHRETURN ( heparinStopTimeMin , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Min" , UInt , isConfigsOk ); - FROMVARIANT_WITHRETURN ( heparinStopTimeMax , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Max" , UInt , isConfigsOk ); - FROMVARIANT_WITHRETURN ( heparinStopTimeRes , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Res" , UInt , isConfigsOk ); - FROMVARIANT_WITHRETURN ( heparinStopTimeDef , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Def" , UInt , isConfigsOk ); +// These were removed to ensure the check on the Heparin stop time matches the Treatment Duration. +// FROMVARIANT_WITHRETURN ( heparinStopTimeMax , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Max" , UInt , isConfigsOk ); +// FROMVARIANT_WITHRETURN ( heparinStopTimeRes , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Res" , UInt , isConfigsOk ); +// FROMVARIANT_WITHRETURN ( heparinStopTimeDef , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Def" , UInt , isConfigsOk ); FROMVARIANT_WITHRETURN ( salineBolusVolumeDef , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Def" , UInt , isConfigsOk ); FROMVARIANT_WITHRETURN ( salineBolusVolumeMin , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Min" , UInt , isConfigsOk ); Index: sources/view/hd/data/VTreatmentRanges.h =================================================================== diff -u -r9de37dc1a1e423fe5798c76313d1574a8b638047 -r7d2122a9a4330ebc2ff4c22be36f32e9a82417ec --- sources/view/hd/data/VTreatmentRanges.h (.../VTreatmentRanges.h) (revision 9de37dc1a1e423fe5798c76313d1574a8b638047) +++ sources/view/hd/data/VTreatmentRanges.h (.../VTreatmentRanges.h) (revision 7d2122a9a4330ebc2ff4c22be36f32e9a82417ec) @@ -58,6 +58,8 @@ READONLY( QStringList , bicarbonateConcentrateOptions ,{}) READONLY( QStringList , dialyzerTypeOptions ,{}) + PROPERTY( QString , acidConcentrate ,"") + RANGESET( float , dialysateTemp , 0) RANGESET( qint32 , trancembrncPressureLimitWindow , 0) RANGESET( qint32 , arterialPressureLimitWindow , 0)