Index: sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml =================================================================== diff -u -r40b1d61161d8a6d918d54de0c82923458f901d9b -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml (.../AcidConcentrateAdjustment.qml) (revision 40b1d61161d8a6d918d54de0c82923458f901d9b) +++ sources/gui/qml/dialogs/AcidConcentrateAdjustment.qml (.../AcidConcentrateAdjustment.qml) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -26,8 +26,8 @@ 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(1)) - .arg(_calciumVolumeControl.value.toFixed(1)) + readonly property string adjustment: ("%1 K, %2 Ca, 1 Mg") .arg(_potassiumVolumeControl.value.toFixed(Variables.potassiumPrecision)) + .arg(_calciumVolumeControl.value.toFixed(Variables.calciumPrecision)) width : 1000 height : 600 @@ -78,7 +78,7 @@ maximum : 4.0 // LEAHI-PRS-660 , LEAHI-PRS-241 step : 1.0 defaultValue : 2.0 - decimal : 1 + decimal : Variables.potassiumPrecision } } @@ -99,7 +99,7 @@ maximum : 3.5 // LEAHI-PRS-660 , LEAHI-PRS-241 step : 0.25 defaultValue : 2.5 - decimal : 2 + decimal : Variables.calciumPrecision } } Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -219,6 +219,12 @@ // Dialysate Conductivity readonly property int dialysateCondPrecision : 1 + // Potassium + readonly property int potassiumPrecision : 1 + + // Calcium + readonly property int calciumPrecision : 2 + function sizeConverted(vSize, vSizePowers, vRound = 2) { return ( vSize / vSizePowers // convert from byte to Giga byte Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r3604ca12ed47f4c60a12bb42efa4949ef01b7d95 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 3604ca12ed47f4c60a12bb42efa4949ef01b7d95) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -347,7 +347,11 @@ enabled : _root.editingEnabled currentIndex : vTreatmentCreate.acidConcentrate model : vTreatmentRanges.acidConcentrateOptions - onClear : vTreatmentCreate.acidConcentrateSet = false + onClear : { + vTreatmentRanges.doClearAcidConcentrate(vTreatmentCreate.acidConcentrateSet) + vTreatmentCreate.acidConcentrateSet = false + } + onActivated : { vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.currentIndex vTreatmentCreate.acidConcentrateSet = true Index: sources/model/settings/MSettings.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/model/settings/MSettings.cpp (.../MSettings.cpp) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -142,6 +142,20 @@ } } +/*! + * \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) +{ + TKeyValue keyValue (vKey, vValue); + 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 -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/model/settings/MSettings.h (.../MSettings.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/model/settings/MSettings.h (.../MSettings.h) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -83,6 +83,7 @@ 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 -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -54,19 +54,44 @@ */ void View::VTreatmentRanges::doSaveAcidConcentrate (const QString &vOption) { - QString mCategory = ::Settings_Category_DataList; + QString mCategory = Storage::Settings_Category_DataList; _Settings.add(mCategory, "Acid Concentrate Options", vOption, - QVariant(), + QVariant("temp"), // set temp string to know to remove later false ); // update -// emit acidConcentrateOptionsChanged(); acidConcentrateOptions ( _Settings.keys(mCategory, "Acid Concentrate Options" )); } +/** + * \brief VTreatmentRanges::doClearAcidConcentrate + * \param vSet - Bool to only clear options list if combobox is active + * \details Clear any custum Acid Concentrate entered by user + */ +void View::VTreatmentRanges::doClearAcidConcentrate (const bool &vSet) +{ + if ( ! vSet ) { return; } + + QString mCategory = Storage::Settings_Category_DataList; + int size = _Settings.keys(mCategory, "Acid Concentrate Options" ).size(); + + 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" )); +} + /*! * \brief VTreatmentCreate::onSettingsDone * \details fills the items below, read from the settings file, when the reading is notified done by ApplicationController. Index: sources/view/hd/data/VTreatmentRanges.h =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r53ec19e12772f2a73190323438106dc93e4a12df --- sources/view/hd/data/VTreatmentRanges.h (.../VTreatmentRanges.h) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/view/hd/data/VTreatmentRanges.h (.../VTreatmentRanges.h) (revision 53ec19e12772f2a73190323438106dc93e4a12df) @@ -79,6 +79,7 @@ void didTreatmentRangesDone(bool vPass); public slots: - void doSaveAcidConcentrate (const QString &vOption); + void doSaveAcidConcentrate (const QString &vOption); + void doClearAcidConcentrate (const bool &vSet); }; }