Index: sources/gui/qml/dialogs/HeparinRxAdjustment.qml =================================================================== diff -u -r1132f049e169cc87a059261f72fca0ceb7d739f1 -r63d974e3d2d03c93e0398de17bd6ca2d2e039982 --- sources/gui/qml/dialogs/HeparinRxAdjustment.qml (.../HeparinRxAdjustment.qml) (revision 1132f049e169cc87a059261f72fca0ceb7d739f1) +++ sources/gui/qml/dialogs/HeparinRxAdjustment.qml (.../HeparinRxAdjustment.qml) (revision 63d974e3d2d03c93e0398de17bd6ca2d2e039982) @@ -127,22 +127,22 @@ onDidActiveChange: function(vState) { vTreatmentCreate.heparinDispensingRateSet = vState } onDidChange : function(vValue) { if ( ! _heparinDispensingRate.valid ) { vTreatmentCreate.heparinDispensingRateRejectReason = Variables.noRejectReason } - // set heparin time to clear when set OFF to value - if ( ! vTreatmentCreate.heparinDispensingRate && vValue ) { _heparinDeliveryDuration.clear() } - value = vValue + // set heparin time to clear when set OFF to value + if ( value ) { _heparinDeliveryDuration.clear() } + // if set to OFF set heparin stop time 0 - if ( ! vTreatmentCreate.heparinDispensingRate ) { + if ( ! value ) { vTreatmentCreate.heparinDeliveryDurationSet = true - vTreatmentCreate.heparinDeliveryDuration = 0 + _heparinDeliveryDuration.value = 0 } } onIsActiveChanged: { - if ( ! vTreatmentCreate.heparinDispensingRate && isActive ) { + if ( ! value && isActive ) { vTreatmentCreate.heparinDeliveryDurationSet = true - vTreatmentCreate.heparinDeliveryDuration = 0 + _heparinDeliveryDuration.value = 0 } } } @@ -159,7 +159,7 @@ step : vTreatmentRanges.treatmentDurationRes defaultValue : vTreatmentCreate.treatmentDuration value : vTreatmentCreate.heparinDeliveryDuration - enabled : vTreatmentCreate.heparinDispensingRate + enabled : _heparinDispensingRate.value canOff : true isActive : vTreatmentCreate.heparinDeliveryDurationSet onDidActiveChange: function(vState) { vTreatmentCreate.heparinDeliveryDurationSet = vState } Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateTreatmentSettings.qml =================================================================== diff -u -r1a46e7e1fd9da0fcfa8359a194610c55adfff04f -r63d974e3d2d03c93e0398de17bd6ca2d2e039982 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateTreatmentSettings.qml (.../PreTreatmentCreateTreatmentSettings.qml) (revision 1a46e7e1fd9da0fcfa8359a194610c55adfff04f) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateTreatmentSettings.qml (.../PreTreatmentCreateTreatmentSettings.qml) (revision 63d974e3d2d03c93e0398de17bd6ca2d2e039982) @@ -334,9 +334,6 @@ vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.currentIndex vTreatmentCreate.acidConcentrateSet = true vTreatmentCreate.acidConcentrateConversionFactor = vTreatmentRanges.acidConcentrateModel.get(vTreatmentCreate.acidConcentrate).value - - print( vTreatmentCreate.acidConcentrateConversionFactor ) - } } } Index: sources/model/MListModel.cpp =================================================================== diff -u -rf433eeefae34530e7cc3dc4e5576e43729b236f2 -r63d974e3d2d03c93e0398de17bd6ca2d2e039982 --- sources/model/MListModel.cpp (.../MListModel.cpp) (revision f433eeefae34530e7cc3dc4e5576e43729b236f2) +++ sources/model/MListModel.cpp (.../MListModel.cpp) (revision 63d974e3d2d03c93e0398de17bd6ca2d2e039982) @@ -107,6 +107,20 @@ } /*! + * \brief Return a list of roles from each row of model + * \param[in] vRole Role of model to populate list + */ +QStringList View::MListModel::getAllByRole( int vRole ) const +{ + QStringList result; + + for (int row = 0; row < rowCount(); ++row) { + result.append(data(index(row), vRole).toString()); + } + return result; +} + +/*! * \brief Clear any data contained in this list model. */ void View::MListModel::clear() { Index: sources/model/MListModel.h =================================================================== diff -u -r56381aae237db191956aff493907cd1f0801216b -r63d974e3d2d03c93e0398de17bd6ca2d2e039982 --- sources/model/MListModel.h (.../MListModel.h) (revision 56381aae237db191956aff493907cd1f0801216b) +++ sources/model/MListModel.h (.../MListModel.h) (revision 63d974e3d2d03c93e0398de17bd6ca2d2e039982) @@ -30,18 +30,11 @@ void appendRow (const QHash &vData ); void insertRow (const int vRow, const QHash &vData ); void updateData (const int vRow, const int vRole, const QVariant& vValue ); + QStringList getAllByRole(int vRole ) const; public slots: QVariantMap get (int vRow ) const; // Exposed to QML - Q_INVOKABLE QStringList getRoleNames() const { - QStringList keys; - for (const auto &roleName : roleNames()) { - keys << QString(roleName); - } - return keys; - } - private: QList> _data; QHash _roleNames; Index: sources/view/td/data/VTreatmentRanges.cpp =================================================================== diff -u -r1a46e7e1fd9da0fcfa8359a194610c55adfff04f -r63d974e3d2d03c93e0398de17bd6ca2d2e039982 --- sources/view/td/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 1a46e7e1fd9da0fcfa8359a194610c55adfff04f) +++ sources/view/td/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 63d974e3d2d03c93e0398de17bd6ca2d2e039982) @@ -243,7 +243,6 @@ FROMVARIANT_WITHRETURN ( salineBolusVolumeRes , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Res" , UInt , isConfigsOk ); heparinTypeOptions ( _Settings.keys(mCategory , "Heparin Type Options" )); - acidConcentrateOptions ( _Settings.keys(mCategory , "Acid Concentrate Options" )); bicarbonateConcentrateOptions ( _Settings.keys(mCategory , "Bicarbonate Concentrate Options" )); dialyzerTypeOptions ( _Settings.keys(mCategory , "Dialyzer Type Options" )); bloodPressureMeasureInterval ( _Settings.keys(mCategory , "Vitals Measurement Interval Options" )); @@ -252,23 +251,17 @@ dryBicabCartridgeSizeOptions ( _Settings.keys(mCategory , "Dry Bicarb Cartridge Size" )); waterSampleTestResultRequired ( _Settings.keys(mCategory , "Water Sample Test Result Required" )); hepatitisStatus ( _Settings.keys(mCategory , "Hepatitis Status" )); - QVariantList mAcidConcentrateValues = _Settings.values(mCategory , "Acid Concentrate Options" ); + QStringList mAcidConcentrateKeys = _Settings.keys(mCategory , "Acid Concentrate Options" ); + QVariantList mAcidConcentrateValues = _Settings.values(mCategory , "Acid Concentrate Options" ); -// for (int i = 0; i < _acidConcentrateValues.size(); ++i) { -// bool ok = false; -// _acidConcentrateValues[i] = _Settings.value(mCategory, "Acid Concentrate Options" , _acidConcentrateOptions[i] ).toFloat(&ok); -// isConfigsOk = isConfigsOk && ok; -// } - - - for (int i = 0; i < _acidConcentrateOptions.size(); ++i) { + for (int i = 0; i < mAcidConcentrateKeys.size(); ++i) { bool ok = false; -// _acidConcentrateValues[i] = _Settings.value(mCategory, "Acid Concentrate Options" , _acidConcentrateOptions[i] ).toFloat(&ok); - _acidConcentrateModel.insertRow( i, {{ eRole_Key, _acidConcentrateOptions[i]}, { eRole_Value, mAcidConcentrateValues[i].toFloat(&ok) }}); - + _acidConcentrateModel.insertRow( i, {{ eRole_Key, mAcidConcentrateKeys[i]}, { eRole_Value, mAcidConcentrateValues[i].toFloat(&ok) }}); isConfigsOk = isConfigsOk && ok; } + acidConcentrateOptions (_acidConcentrateModel.getAllByRole(eRole_Key)); + isConfigsOk = isConfigsOk && !_heparinTypeOptions .isEmpty(); if ( _heparinTypeOptions.isEmpty() ) { heparinTypeOptions({"-- --"}); } isConfigsOk = isConfigsOk && !_acidConcentrateOptions .isEmpty();