Index: cppcheck.err =================================================================== diff -u -r7823da721f8041d6d39c37cd040e162ea9d35e7f -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- cppcheck.err (.../cppcheck.err) (revision 7823da721f8041d6d39c37cd040e162ea9d35e7f) +++ cppcheck.err (.../cppcheck.err) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -69,10 +69,10 @@ } When you see this message it is always safe to reduce the variable scope 1 level. [sources/view/VEventSpy.cpp]: (information) The configuration 'DEBUG_BCUFF_MIMIC' was not checked because its code equals another one. -[sources/view/VTreatmentCreate.cpp:132]: (style) The function 'doCancel' is never used. +[sources/view/VTreatmentCreate.cpp:83]: (style) The function 'doCancel' is never used. [sources/view/settings/VNetworkModel.cpp:238]: (style) The function 'doCheckIfConnected' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:95]: (style) The function 'doClearCondition' is never used. -[sources/view/VTreatmentCreate.cpp:121]: (style) The function 'doConfirm' is never used. +[sources/view/VTreatmentCreate.cpp:72]: (style) The function 'doConfirm' is never used. [sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:88]: (style) The function 'doDisinfectCancel' is never used. [sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:127]: (style) The function 'doDisinfectChemical' is never used. [sources/view/hd/adjustment/disinfect/VDisinfectAdjustDisinfect.cpp:99]: (style) The function 'doDisinfectClear' is never used. @@ -82,17 +82,14 @@ [sources/gui/GuiView.cpp:250]: (style) The function 'doExportListInsert' is never used. [sources/gui/GuiView.cpp:293]: (style) The function 'doExportListPercent' is never used. [sources/gui/GuiView.cpp:281]: (style) The function 'doExportListSelect' is never used. -[sources/view/VTreatmentCreate(legacy).cpp:520]: (style) The function 'doGetOperatingParameterNames' is never used. [sources/view/VTreatmentCreate(legacy).cpp:539]: (style) The function 'doGetOperatingParameterValues' is never used. -[sources/view/VTreatmentCreate(legacy).cpp:487]: (style) The function 'doGetPrescriptionParameterNames' is never used. [sources/view/VTreatmentCreate(legacy).cpp:504]: (style) The function 'doGetPrescriptionParameterValues' is never used. [sources/view/settings/VDateTime.cpp:44]: (style) The function 'doInit' is never used. [sources/view/VEventSpy.cpp:149]: (style) The function 'doMouseReset' is never used. [sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp:66]: (style) The function 'doOptionDuration' is never used. [sources/view/hd/adjustment/treatment/VTreatmentAdjustmentRecirculate.cpp:51]: (style) The function 'doReconnect' is never used. [sources/view/hd/alarm/VAlarmActiveList.cpp:106]: (style) The function 'doRequest' is never used. [sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp:99]: (style) The function 'doReset' is never used. -[sources/view/VTreatmentCreate(legacy).cpp:111]: (style) The function 'doResetCreateTreatment' is never used. [sources/view/hd/adjustment/pretreatment/VPreTreatmentAdjustmentWaterSample.cpp:64]: (style) The function 'doResult' is never used. [sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.cpp:51]: (style) The function 'doResume' is never used. [sources/view/settings/VNetworkModel.cpp:362]: (style) The function 'doSetDNS' is never used. @@ -108,7 +105,7 @@ [sources/view/hd/alarm/VAlarmStatus.cpp:67]: (style) The function 'doUserActionOk' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:37]: (style) The function 'doUserActionResume' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:47]: (style) The function 'doUserActionRinseback' is never used. -[sources/view/VTreatmentCreate.cpp:101]: (style) The function 'doValidation' is never used. +[sources/view/VTreatmentCreate.cpp:40]: (style) The function 'doValidation' is never used. [sources/utility/types.cpp:28]: (style) The function 'floatCompare' is never used. [sources/utility/types.cpp:44]: (style) The function 'getBits' is never used. [sources/bluetooth/BluetoothInterface.cpp:1159]: (style) The function 'mimic' is never used. Index: denali.pro.user =================================================================== diff -u -r7823da721f8041d6d39c37cd040e162ea9d35e7f -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- denali.pro.user (.../denali.pro.user) (revision 7823da721f8041d6d39c37cd040e162ea9d35e7f) +++ denali.pro.user (.../denali.pro.user) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -r16bd55822fa77e5bea6fdfa7b54abf123c1da8bb -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- en_US.udic (.../en_US.udic) (revision 16bd55822fa77e5bea6fdfa7b54abf123c1da8bb) +++ en_US.udic (.../en_US.udic) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -210,3 +210,4 @@ MVC Jahnavi txr +pre Index: imake.sh =================================================================== diff -u -r16bd55822fa77e5bea6fdfa7b54abf123c1da8bb -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- imake.sh (.../imake.sh) (revision 16bd55822fa77e5bea6fdfa7b54abf123c1da8bb) +++ imake.sh (.../imake.sh) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -6,7 +6,7 @@ # 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 alarmMapping.sh +# @file imake.sh # # @author (last) Behrouz NematiPour # @date (last) 13-Oct-2022 Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r16bd55822fa77e5bea6fdfa7b54abf123c1da8bb -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 16bd55822fa77e5bea6fdfa7b54abf123c1da8bb) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -525,7 +525,7 @@ QVariantList mData; mData += vData.bloodFlowRate ; mData += vData.dialysateFlowRate ; - mData += vData.duration ; + mData += vData.treatmentDuration ; mData += vData.heparinStopTime ; mData += vData.salineBolus ; mData += vData.acidConcentrate ; Index: sources/gui/qml/components/ConfirmTreatmentTable.qml =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/gui/qml/components/ConfirmTreatmentTable.qml (.../ConfirmTreatmentTable.qml) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/gui/qml/components/ConfirmTreatmentTable.qml (.../ConfirmTreatmentTable.qml) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -100,15 +100,31 @@ anchors.bottom: parent.bottom width: parent.width - 2*Variables.createTreatmentMargin height: _root.height - _header.height - prescriptionKeys : vTreatmentCreate.doGetPrescriptionParameterNames() + prescriptionKeys : [ qsTr("Blood Flow Rate" ), + qsTr("Dialysate Flow Rate" ), + qsTr("Duration" ), + qsTr("Heparin Dispensing Rate" ), + qsTr("Heparin Bolus Volume" ), + qsTr("Heparin Stop Time" ), + qsTr("Saline Bolus Volume" )] + operatingKeys : [ qsTr("Heparin Type" ), + qsTr("Acid Concentrate" ), + qsTr("Bicarbonate Concentrate" ), + qsTr("Dialyzer Type" ), + qsTr("Dialysate Temperature" ), + qsTr("Arterial Pressure Limit Low" ), + qsTr("Arterial Pressure Limit High" ), + qsTr("Venous Pressure Limit Low" ), + qsTr("Venous Pressure Limit High" ), + qsTr("Blood Pressure Measure Interval" ), + qsTr("Rinseback Rate" )] prescriptionValues : vTreatmentCreate.doGetPrescriptionParameterValues() - operatingKeys : vTreatmentCreate.doGetOperatingParameterNames() operatingValues : vTreatmentCreate.doGetOperatingParameterValues() onVisibleChanged: { if (visible) { - prescriptionKeys = vTreatmentCreate.doGetPrescriptionParameterNames() + // prescriptionKeys = vTreatmentCreate.doGetPrescriptionParameterNames() prescriptionValues = vTreatmentCreate.doGetPrescriptionParameterValues() - operatingKeys = vTreatmentCreate.doGetOperatingParameterNames() + // operatingKeys = vTreatmentCreate.doGetOperatingParameterNames() operatingValues = vTreatmentCreate.doGetOperatingParameterValues() } } Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -36,6 +36,7 @@ property alias handler : _handler property alias handlerColor : _handler.color + property alias handlerVisible : _handler.visible property alias diameter : _handler.diameter Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -27,7 +27,7 @@ Rectangle { id: _root property Flickable flickable: null - property alias adjustable : _slider.enabled + property bool adjustable : true property alias label : _label.text property alias decimal : _slider.decimal property alias minimum : _slider.minimum @@ -105,13 +105,15 @@ Slider { id : _slider objectName : _root.objectName + "Slider" + enabled : _root.adjustable anchors.horizontalCenter: parent.horizontalCenter anchors.bottom : parent.bottom width : Variables.createTreatmentSliderWidth diameter : Variables.sliderCircleDiameter touchMargin : Variables.createTreatmentSliderMargin color : Colors.createTreatmentInactive handlerColor : Colors.createTreatmentInactive + handlerVisible : _root.adjustable height : Variables.progressbarFluidHeight isActive : _root.active ticks : true Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -94,10 +94,11 @@ label : qsTr("Blood Flow Rate") flickable : _flickable unit : Variables.unitTextFlowRate - value : vTreatmentCreate.bloodFlowRate - minimum : vTreatmentCreate.bloodFlowRateMin - maximum : vTreatmentCreate.bloodFlowRateMax - step : vTreatmentCreate.bloodFlowRateRes + minimum : vTreatmentRanges.bloodFlowRateMin + maximum : vTreatmentRanges.bloodFlowRateMax + step : vTreatmentRanges.bloodFlowRateRes + value : vTreatmentRanges.bloodFlowRateDef + onPressed : vTreatmentCreate.bloodFlowRate = value onReleased : vTreatmentCreate.bloodFlowRate = value } @@ -107,10 +108,10 @@ label : qsTr("Dialysate Flow Rate") flickable : _flickable unit : Variables.unitTextFlowRate - value : vTreatmentCreate.dialysateFlowRate - minimum : vTreatmentCreate.dialysateFlowRateMin - maximum : vTreatmentCreate.dialysateFlowRateMax - step : vTreatmentCreate.dialysateFlowRateRes + minimum : vTreatmentRanges.dialysateFlowRateMin + maximum : vTreatmentRanges.dialysateFlowRateMax + step : vTreatmentRanges.dialysateFlowRateRes + value : vTreatmentRanges.dialysateFlowRateDef onPressed : vTreatmentCreate.dialysateFlowRate = value onReleased : vTreatmentCreate.dialysateFlowRate = value } @@ -120,12 +121,12 @@ label : qsTr("Duration") flickable : _flickable unit : Variables.unitTextDuration - value : vTreatmentCreate.duration - minimum : vTreatmentCreate.durationMin - maximum : vTreatmentCreate.durationMax - step : vTreatmentCreate.durationRes - onPressed : vTreatmentCreate.duration = value - onReleased : vTreatmentCreate.duration = value + minimum : vTreatmentRanges.treatmentDurationMin + maximum : vTreatmentRanges.treatmentDurationMax + step : vTreatmentRanges.treatmentDurationRes + value : vTreatmentRanges.treatmentDurationDef + onPressed : vTreatmentCreate.treatmentDuration = value + onReleased : vTreatmentCreate.treatmentDuration = value } // ToDo: create a component for this, @@ -177,11 +178,12 @@ zeroLabel : qsTr("OFF") flickable : _flickable unit : Variables.unitTextDispensingRate - value : vTreatmentCreate.heparinDispensingRate decimal : Variables.heparinPrecision - minimum : vTreatmentCreate.heparinDispensingRateMin - maximum : vTreatmentCreate.heparinDispensingRateMax - step : vTreatmentCreate.heparinDispensingRateRes + minimum : vTreatmentRanges.heparinDispensingRateMin + maximum : vTreatmentRanges.heparinDispensingRateMax + step : vTreatmentRanges.heparinDispensingRateRes + value : vTreatmentRanges.heparinDispensingRateDef + onPressed : vTreatmentCreate.heparinDispensingRate = value onReleased : vTreatmentCreate.heparinDispensingRate = value adjustable : _heparinDispensingRateSwitch.checked @@ -245,11 +247,12 @@ zeroLabel : qsTr("OFF") flickable : _flickable unit : Variables.unitTextFluid - value : vTreatmentCreate.heparinBolusVolume decimal : Variables.heparinPrecision - minimum : vTreatmentCreate.heparinBolusVolumeMin - maximum : vTreatmentCreate.heparinBolusVolumeMax - step : vTreatmentCreate.heparinBolusVolumeRes + minimum : vTreatmentRanges.heparinBolusVolumeMin + maximum : vTreatmentRanges.heparinBolusVolumeMax + step : vTreatmentRanges.heparinBolusVolumeRes + value : vTreatmentRanges.heparinBolusVolumeDef + onPressed : vTreatmentCreate.heparinBolusVolume = value onReleased : vTreatmentCreate.heparinBolusVolume = value adjustable : _heparinBolusVolumeSwitch.checked @@ -313,10 +316,10 @@ label : qsTr("Heparin Stop Time") flickable : _flickable unit : Variables.unitTextDuration - value : vTreatmentCreate.heparinStopTime - minimum : vTreatmentCreate.heparinStopTimeMin - maximum : vTreatmentCreate.heparinStopTimeMax - step : vTreatmentCreate.heparinStopTimeRes + minimum : vTreatmentRanges.heparinStopTimeMin + maximum : vTreatmentRanges.heparinStopTimeMax + step : vTreatmentRanges.heparinStopTimeRes + value : vTreatmentRanges.heparinStopTimeDef onPressed : vTreatmentCreate.heparinStopTime = value onReleased : vTreatmentCreate.heparinStopTime = value } @@ -326,10 +329,10 @@ label : "Saline Bolus" flickable : _flickable unit : Variables.unitTextFluid - value : vTreatmentCreate.salineBolusVolume - minimum : vTreatmentCreate.salineBolusVolumeMin - maximum : vTreatmentCreate.salineBolusVolumeMax - step : vTreatmentCreate.salineBolusVolumeRes + minimum : vTreatmentRanges.salineBolusVolumeMin + maximum : vTreatmentRanges.salineBolusVolumeMax + step : vTreatmentRanges.salineBolusVolumeRes + value : vTreatmentRanges.salineBolusVolumeDef onPressed : vTreatmentCreate.salineBolusVolume = value onReleased : vTreatmentCreate.salineBolusVolume = value } @@ -345,29 +348,29 @@ GridSelection { id : _heparinType objectName : "_heparinTypeRect" title : qsTr("Heparin Type") - labels : vTreatmentCreate.heparinTypeOptions - onClicked : vTreatmentCreate.heparinType = curIndex + labels : vTreatmentRanges.heparinTypeOptions + onClicked :{vTreatmentCreate.heparinType = curIndex ; vTreatmentCreate.heparinTypeSet = true; } } GridSelection { id : _acidConcentrate objectName : "_acidConcentrateRect" title : qsTr("Acid Concentrate") - labels : vTreatmentCreate.acidConcentrateOptions - onClicked : vTreatmentCreate.acidConcentrate = curIndex + labels : vTreatmentRanges.acidConcentrateOptions + onClicked :{vTreatmentCreate.acidConcentrate = curIndex ; vTreatmentCreate.acidConcentrateSet = true; } } - GridSelection { id: _bicarbonateConcentrate - objectName : "_bicarbonateConcentrateRect" - title : qsTr("Bicarbonate Concentrate") - labels : vTreatmentCreate.bicarbonateConcentrateOptions - onClicked : vTreatmentCreate.bicarbonateConcentrate = curIndex + GridSelection { id : _bicarbonateConcentrate + objectName : "_bicarbonateConcentrateRect" + title : qsTr("Bicarbonate Concentrate") + labels : vTreatmentRanges.bicarbonateConcentrateOptions + onClicked :{vTreatmentCreate.bicarbonateConcentrate = curIndex ; vTreatmentCreate.bicarbonateConcentrateSet = true; } } - GridSelection { id: _dialyzerType - objectName : "_dialyzerTypeRect" - title : qsTr("Dialyzer Type") - labels : vTreatmentCreate.dialyzerTypeOptions - onClicked : vTreatmentCreate.dialyzerType = curIndex + GridSelection { id : _dialyzerType + objectName : "_dialyzerTypeRect" + title : qsTr("Dialyzer Type") + labels : vTreatmentRanges.dialyzerTypeOptions + onClicked :{vTreatmentCreate.dialyzerType = curIndex ; vTreatmentCreate.dialyzerTypeSet = true; } } Item { height: 1; width: 1 /* TODO : there is a design flaw in here, this is a workaround */ } @@ -377,10 +380,10 @@ label : qsTr("Dialysate Temperature") flickable : _flickable unit : Variables.unitTextTemperature - value : vTreatmentCreate.dialysateTemp - minimum : vTreatmentCreate.dialysateTempMin - maximum : vTreatmentCreate.dialysateTempMax - step : vTreatmentCreate.dialysateTempRes + minimum : vTreatmentRanges.dialysateTempMin + maximum : vTreatmentRanges.dialysateTempMax + step : vTreatmentRanges.dialysateTempRes + value : 36 // vTreatmentRanges.dialysateTempDef onPressed : vTreatmentCreate.dialysateTemp = value onReleased : vTreatmentCreate.dialysateTemp = value } @@ -452,14 +455,14 @@ // Ranges step : Variables.arterialLimitStep gapValue : Variables.arterialLimitGap - minimum : vTreatmentCreate.arterialPressureLimitLowMin - maximum : vTreatmentCreate.arterialPressureLimitHighMax - minValue : vTreatmentCreate.arterialPressureLimitLowMin - maxValue : vTreatmentCreate.arterialPressureLimitHighMax - minValueLowerBound : vTreatmentCreate.arterialPressureLimitLowMin - minValueUpperBound : vTreatmentCreate.arterialPressureLimitLowMax - maxValueLowerBound : vTreatmentCreate.arterialPressureLimitHighMin - maxValueUpperBound : vTreatmentCreate.arterialPressureLimitHighMax + minimum : vTreatmentRanges.arterialPressureLimitLowMin + maximum : vTreatmentRanges.arterialPressureLimitHighMax + minValue : vTreatmentRanges.arterialPressureLimitLowMin + maxValue : vTreatmentRanges.arterialPressureLimitHighMax + minValueLowerBound : vTreatmentRanges.arterialPressureLimitLowMin + minValueUpperBound : vTreatmentRanges.arterialPressureLimitLowMax + maxValueLowerBound : vTreatmentRanges.arterialPressureLimitHighMin + maxValueUpperBound : vTreatmentRanges.arterialPressureLimitHighMax // scroll handling and value updates onPressed : { setInteractive(false) } onDragged : { setInteractive(false) } @@ -538,14 +541,14 @@ // Ranges step : Variables.arterialLimitStep gapValue : Variables.arterialLimitGap - minimum : vTreatmentCreate.venousPressureLimitLowMin - maximum : vTreatmentCreate.venousPressureLimitHighMax - minValue : vTreatmentCreate.venousPressureLimitLowMin - maxValue : vTreatmentCreate.venousPressureLimitHighMax - minValueLowerBound : vTreatmentCreate.venousPressureLimitLowMin - minValueUpperBound : vTreatmentCreate.venousPressureLimitLowMax - maxValueLowerBound : vTreatmentCreate.venousPressureLimitHighMin - maxValueUpperBound : vTreatmentCreate.venousPressureLimitHighMax + minimum : vTreatmentRanges.venousPressureLimitLowMin + maximum : vTreatmentRanges.venousPressureLimitHighMax + minValue : vTreatmentRanges.venousPressureLimitLowMin + maxValue : vTreatmentRanges.venousPressureLimitHighMax + minValueLowerBound : vTreatmentRanges.venousPressureLimitLowMin + minValueUpperBound : vTreatmentRanges.venousPressureLimitLowMax + maxValueLowerBound : vTreatmentRanges.venousPressureLimitHighMin + maxValueUpperBound : vTreatmentRanges.venousPressureLimitHighMax // scroll handling and value updates onPressed : { setInteractive(false) } onDragged : { setInteractive(false) } @@ -563,10 +566,10 @@ zeroLabel : qsTr("OFF") flickable : _flickable unit : Variables.unitTextDuration - value : vTreatmentCreate.bloodPressureMeasureInterval - minimum : vTreatmentCreate.bloodPressureMeasureIntervalMin - maximum : vTreatmentCreate.bloodPressureMeasureIntervalMax - step : vTreatmentCreate.bloodPressureMeasureIntervalRes + minimum : vTreatmentRanges.bloodPressureMeasureIntervalMin + maximum : vTreatmentRanges.bloodPressureMeasureIntervalMax + step : vTreatmentRanges.bloodPressureMeasureIntervalRes + value : vTreatmentRanges.bloodPressureMeasureIntervalDef onPressed : vTreatmentCreate.bloodPressureMeasureInterval = value onReleased : vTreatmentCreate.bloodPressureMeasureInterval = value } @@ -576,10 +579,10 @@ label : qsTr("Rinseback Flow Rate") flickable : _flickable unit : Variables.unitTextFlowRate - value : vTreatmentCreate.rinsebackFlowRate - minimum : vTreatmentCreate.rinsebackFlowRateMin - maximum : vTreatmentCreate.rinsebackFlowRateMax - step : vTreatmentCreate.rinsebackFlowRateRes + minimum : vTreatmentRanges.rinsebackFlowRateMin + maximum : vTreatmentRanges.rinsebackFlowRateMax + step : vTreatmentRanges.rinsebackFlowRateRes + value : vTreatmentRanges.rinsebackFlowRateDef onPressed : vTreatmentCreate.rinsebackFlowRate = value onReleased : vTreatmentCreate.rinsebackFlowRate = value } @@ -589,133 +592,4 @@ } } } - - Connections { target: vTreatmentCreate - onResetCreateTreatment: { - _bloodFlowRate .active = false - _dialysateFlowRate .active = false - _duration .active = false - _heparinDispensingRate .active = false - - _heparinBolusVolume .active = false - _heparinStopTime .active = false - - _salineBolus .active = false - _acidConcentrate .setActive(false) - _bicarbonateConcentrate .setActive(false) - _dialyzerType .setActive(false) - - _dialysateTemperature .active = false - _bloodPressureInterval .active = false - _rinsebackFlowRate .active = false - - // TODO : Will be addressed in sub-task DEN-6686. - // _arterialPressureLimits.isLowActive = false - // _arterialPressureLimits.isHighActive = false - // _venousPressureLimits.isLowActive = false - // _venousPressureLimits.isHighActive = false - - } - - onFwValidationSuccess: { - _bloodFlowRate .valid = true - _dialysateFlowRate .valid = true - _duration .valid = true - _heparinDispensingRate .valid = true - - _heparinBolusVolume .valid = true - _heparinStopTime .valid = true - - _salineBolus .valid = true - //_acidConcentrate .setValid (true) - // _bicarbonateConcentrate .setValid (true) - // _dialyzerType .setValid (true) - // - // _dialysateTemperature .setValid (true) - // _bloodPressureInterval .setValid (true) - // _rinsebackFlowRate .setValid (true) - - // TODO : Will be addressed in sub-task DEN-6686. - // _arterialPressureLimits .setLowValid (true) - // _arterialPressureLimits .setHighValid(true) - // _venousPressureLimits .setLowValid (true) - // _venousPressureLimits .setHighValid(true) - } - - onFwValidationFailed : { } - onBloodFlowRate_ValidationFailed : _bloodFlowRate .valid = false - onDialysateFlowRate_ValidationFailed : _dialysateFlowRate .valid = false - onDuration_ValidationFailed : _duration .valid = false - onHeparinDispensingRate_ValidationFailed : _heparinDispensingRate .valid = false - onHeparinBolusVolume_ValidationFailed : _heparinBolusVolume .valid = false - onHeparinStopTime_ValidationFailed : _heparinStopTime .valid = false - onSalineBolusVolume_ValidationFailed : _salineBolus .valid = false - onAcidConcentrate_ValidationFailed : _acidConcentrate .valid = false - onBicarbonateConcentrate_ValidationFailed : _bicarbonateConcentrate .valid = false - onDialyzerType_ValidationFailed : _dialyzerType .valid = false - onDialysateTemp_ValidationFailed : _dialysateTemperature .valid = false -// onArterialPressureLimitLow_ValidationFailed : _arterialPressureLimits .setLowValid ( false ) -// onArterialPressureLimitHigh_ValidationFailed : _arterialPressureLimits .setHighValid ( false ) -// onVenousPressureLimitLow_ValidationFailed : _venousPressureLimits .setLowValid ( false ) -// onVenousPressureLimitHigh_ValidationFailed : _venousPressureLimits .setHighValid ( false ) - onBloodPressureMeasureInterval_ValidationFailed : _bloodPressureInterval .valid = false - onRinsebackFlowRate_ValidationFailed : _rinsebackFlowRate .valid = false - onScrollToParameter: { - let prefix = "data." - let contentYMargin = 80 - let newContentY = 0 - - if (parameter === prefix+"bloodFlowRate") { - newContentY = _bloodFlowRate.mapToItem(_bloodFlowRate.parent, 0, 0).y - } - else if (parameter === prefix+"dialysateFlowRate") { - newContentY = _dialysateFlowRate.mapToItem(_dialysateFlowRate.parent, 0, 0).y - } - else if (parameter === prefix+"duration") { - newContentY = _duration.mapToItem(_duration.parent, 0, 0).y - } - else if (parameter === prefix+"heparinDispensingRate") { - newContentY = _heparinDispensingRate.mapToItem(_heparinDispensingRate.parent, 0, 0).y - } - else if (parameter === prefix+"heparinBolusVolume") { - newContentY = _heparinBolusVolume.mapToItem(_heparinBolusVolume.parent, 0, 0).y - } - else if (parameter === prefix+"heparinStopTime") { - newContentY = _heparinStopTime.mapToItem(_heparinStopTime.parent, 0, 0).y - } - else if (parameter === prefix+"salineBolus") { - newContentY = _salineBolus.mapToItem(_salineBolus.parent, 0, 0).y - } - else if (parameter === prefix+"acidConcentrate") { - newContentY = _acidConcentrate.mapToItem(_acidConcentrate.parent, 0, 0).y - } - else if (parameter === prefix+"bicarbonateConcentrate") { - newContentY = _bicarbonateConcentrate.mapToItem(_bicarbonateConcentrate.parent, 0, 0).y - } - else if (parameter === prefix+"dialyzerType") { - newContentY = _dialyzerType.mapToItem(_dialyzerType.parent, 0, 0).y - } - else if (parameter === prefix+"dialysateTemp") { - newContentY = _dialysateTemperature.mapToItem(_dialysateTemperature.parent, 0, 0).y - } - else if (parameter === prefix+"arterialPressureLimitLow" || - parameter === prefix+"arterialPressureLimitHigh") { - newContentY = _arterialPressureLimits.mapToItem(_arterialPressureLimits.parent, 0, 0).y - } - else if (parameter === prefix+"venousPressureLimitLow" || - parameter === prefix+"venousPressureLimitHigh") { - newContentY = _venousPressureLimits.mapToItem(_venousPressureLimits.parent, 0, 0).y - } - else if (parameter === prefix+"bloodPressureMeasureInterval") { - newContentY = _bloodPressureInterval.mapToItem(_bloodPressureInterval.parent, 0, 0).y - } - else if (parameter === prefix+"rinsebackFlowRate") { - newContentY = _rinsebackFlowRate.mapToItem(_rinsebackFlowRate.parent, 0, 0).y - } - else { - return - } - _flickable.contentY = newContentY - contentYMargin - } - } } Index: sources/main.h =================================================================== diff -u -r981e534e5b3174aab7ec47de3b1ead1511dbb6ef -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/main.h (.../main.h) (revision 981e534e5b3174aab7ec47de3b1ead1511dbb6ef) +++ sources/main.h (.../main.h) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -273,25 +273,35 @@ //--------------------------------------------------------------------------------// #define READONLY( vTYPE , vVARIABLE , vDEFVALUE ) \ READONLY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ - PROPERTY_SLOT( vTYPE , vVARIABLE) + PROPERTY_SLOT( vTYPE , vVARIABLE ) //--------------------------------------------------------------------------------// #define PROPERTY( vTYPE , vVARIABLE , vDEFVALUE ) \ PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Changed ) \ - PROPERTY_SLOT( vTYPE , vVARIABLE) + PROPERTY_SLOT( vTYPE , vVARIABLE ) //--------------------------------------------------------------------------------// #define TRIGGER( vTYPE , vVARIABLE , vDEFVALUE ) \ PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Triggered) \ - TRIGGER_SLOT ( vTYPE , vVARIABLE) + TRIGGER_SLOT ( vTYPE , vVARIABLE ) //--------------------------------------------------------------------------------// #define STATE( vTYPE , vVARIABLE , vDEFVALUE ) \ PROPERTY_BASE( vTYPE , vVARIABLE , vDEFVALUE , Entered ) \ - STATE_SLOT ( vTYPE , vVARIABLE) + STATE_SLOT ( vTYPE , vVARIABLE ) //--------------------------------------------------------------------------------// - -#define IDBASED( vTYPE , vVARIABLE , vDEFAULT , vLIST , vID ) \ - IDBASED_BASE ( vTYPE , vVARIABLE , vDEFAULT , vLIST , vID ) \ - PROPERTY_SLOT( vTYPE , vVARIABLE ) +#define IDBASED( vTYPE , vVARIABLE , vDEFVALUE , vLIST , vID ) \ + IDBASED_BASE ( vTYPE , vVARIABLE , vDEFVALUE , vLIST , vID ) \ + PROPERTY_SLOT( vTYPE , vVARIABLE ) //--------------------------------------------------------------------------------// +#define VALUESET( vTYPE , vVARIABLE , vDEFVALUE ) \ + PROPERTY( vTYPE , vVARIABLE , vDEFVALUE ) \ + PROPERTY( bool , vVARIABLE##Set , false ) +//--------------------------------------------------------------------------------// +#define RANGESET( vTYPE , vVARIABLE , vDEFVALUE ) \ + READONLY( vTYPE , vVARIABLE##Min , vDEFVALUE ) \ + READONLY( vTYPE , vVARIABLE##Max , vDEFVALUE ) \ + READONLY( vTYPE , vVARIABLE##Res , vDEFVALUE ) \ + READONLY( vTYPE , vVARIABLE##Def , vDEFVALUE ) \ + READONLY( vTYPE , vVARIABLE##Gap , vDEFVALUE ) +//--------------------------------------------------------------------------------// #define CONSTANT( vTYPE , vVARIABLE , vDEFVALUE ) \ /*! \brief Qt Constant Property declaration \details The Qt Property definition by Q_PROPERTY documentation. @@ -526,62 +536,4 @@ //--------------------------------------------------------------------------------// #define REGISTER_TYPE(vTYPE) \ qmlRegisterType < vTYPE > (#vTYPE, 0, 1, #vTYPE); -#define GET_VARIABLE_NAME(VARIABLE) (#VARIABLE) -#define DEBUG_TREATMENT_PARAMETER(NAME, VARIABLE) // qDebug() << NAME << VARIABLE; -#define TREATMENT_PARAMETER(TYPE, NAME, DEFVALUE, MIN, MAX, RES) \ -private: \ - TYPE _##NAME = DEFVALUE; \ - TYPE _##NAME##Min = MIN; \ - TYPE _##NAME##Max = MAX; \ - TYPE _##NAME##Res = RES; \ - bool is##NAME##Set = false; \ -protected: \ - Q_PROPERTY(TYPE NAME \ - READ NAME \ - WRITE NAME \ - NOTIFY NAME##Changed) \ - Q_PROPERTY(TYPE NAME##Min \ - READ NAME##Min \ - WRITE NAME##Min \ - NOTIFY NAME##MinChanged) \ - Q_PROPERTY(TYPE NAME##Max \ - READ NAME##Max \ - WRITE NAME##Max \ - NOTIFY NAME##MaxChanged) \ - Q_PROPERTY(TYPE NAME##Res \ - READ NAME##Res \ - WRITE NAME##Res \ - NOTIFY NAME##ResChanged) \ - void NAME(const TYPE &v##NAME) { \ - if ( !is##NAME##Set || _##NAME != v##NAME ) { \ - _##NAME = v##NAME; \ - is##NAME##Set = true; \ - emit NAME##Changed(_##NAME); \ - doUserModifiedParameters(); \ - } \ - DEBUG_TREATMENT_PARAMETER(#NAME, _##NAME) \ - } \ - TYPE NAME##Min() const { return _##NAME##Min; } \ - void NAME##Min(const TYPE &v##NAME##Min) \ - { _##NAME##Min = v##NAME##Min; emit NAME##MinChanged(_##NAME##Min);} \ - TYPE NAME##Max() const { return _##NAME##Max; } \ - void NAME##Max(const TYPE &v##NAME##Max) \ - { _##NAME##Max = v##NAME##Max; emit NAME##MaxChanged(_##NAME##Max);} \ - TYPE NAME##Res() const { return _##NAME##Res; } \ - void NAME##Res(const TYPE &v##NAME##Res) \ - { _##NAME##Res = v##NAME##Res; emit NAME##ResChanged(_##NAME##Res);} \ - TYPE NAME() const { \ - return _##NAME; \ - } \ - void reset_##NAME() { \ - _##NAME = DEFVALUE; \ - is##NAME##Set = false; \ - emit NAME##Changed(_##NAME); \ - } \ -Q_SIGNALS: \ - void NAME##Changed(const TYPE &v##NAME); \ - void NAME##MinChanged(const TYPE &v##NAME); \ - void NAME##MaxChanged(const TYPE &v##NAME); \ - void NAME##ResChanged(const TYPE &v##NAME); \ - void NAME##_ValidationFailed(const QString &reason); - +//--------------------------------------------------------------------------------// Index: sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h =================================================================== diff -u -r79a6cfcb10472261f3ec26eaf0baf6f1245cd311 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision 79a6cfcb10472261f3ec26eaf0baf6f1245cd311) +++ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -77,7 +77,7 @@ * | || * | #01:(U32) | \ref bloodFlowRate | * | #02:(U32) | \ref dialysateFlowRate | - * | #03:(U32) | \ref duration | + * | #03:(U32) | \ref treatmentDuration | * | #04:(U32) | \ref heparinStopTime | * | #05:(U32) | \ref salineBolus | * | #06:(U32) | \ref acidConcentrate | @@ -100,7 +100,7 @@ quint32 bloodFlowRate = 0; // mL/min quint32 dialysateFlowRate = 0; // mL/min - quint32 duration = 0; // minutes + quint32 treatmentDuration = 0; // minutes quint32 heparinStopTime = 0; // min quint32 salineBolus = 0; // mL quint32 acidConcentrate = 0; // @@ -123,7 +123,7 @@ return toString({ bloodFlowRate , dialysateFlowRate , - duration , + treatmentDuration , heparinStopTime , salineBolus , acidConcentrate , Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r7823da721f8041d6d39c37cd040e162ea9d35e7f -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 7823da721f8041d6d39c37cd040e162ea9d35e7f) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 16-Oct-2022 + * \date (last) 20-Oct-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 * Index: sources/storage/Settings.cpp =================================================================== diff -u -r16bd55822fa77e5bea6fdfa7b54abf123c1da8bb -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/storage/Settings.cpp (.../Settings.cpp) (revision 16bd55822fa77e5bea6fdfa7b54abf123c1da8bb) +++ sources/storage/Settings.cpp (.../Settings.cpp) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -130,6 +130,7 @@ // ----- remove inline comment if ( commentPosition > 0 ) line.truncate(commentPosition); + line = line.trimmed(); // ----- find group if (line.contains("[") && line.contains("]")) { Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -r40c09957821fb3779fa06214a856c20cca110e56 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 40c09957821fb3779fa06214a856c20cca110e56) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -27,89 +27,40 @@ VTreatmentCreate::VTreatmentCreate(QObject *parent) : QObject(parent) { - ADJUST_VIEW_CONNECTION(AdjustParametersValidationRequestData ) - ACTION_VIEW_CONNECTION(AdjustParametersValidationResponseData) - ADJUST_VIEW_CONNECTION( AdjustParametersConfirmRequestData) - - connect(&_ApplicationController , SIGNAL(didSettingsDone()), - this , SLOT( onSettingsDone())); - + ADJUST_VIEW_CONNECTION(AdjustParametersValidationRequestData ) + ACTION_VIEW_CONNECTION(AdjustParametersValidationResponseData ) + ADJUST_VIEW_CONNECTION(AdjustParametersConfirmRequestData ) } -/** - * \brief VCreateTreatment::onResetCreateTreatment - * Resets the create treatment page to the default values. - * Disables the continue button. - */ -void VTreatmentCreate::doResetCreateTreatment() -{ - reset_bloodFlowRate(); - reset_dialysateFlowRate(); - reset_duration(); - reset_heparinDispensingRate(); - reset_heparinBolusVolume(); - reset_heparinStopTime(); - reset_salineBolusVolume(); - reset_heparinType(); - reset_acidConcentrate(); - reset_bicarbonateConcentrate(); - reset_dialyzerType(); - reset_dialysateTemp(); - reset_arterialPressureLimitLow(); - reset_arterialPressureLimitHigh(); - reset_venousPressureLimitLow(); - reset_venousPressureLimitHigh(); - reset_bloodPressureMeasureInterval(); - reset_rinsebackFlowRate(); - continueEnabled(false); - - emit resetCreateTreatment(); -} - /** - * \brief VCreateTreatment::setTreatmentData - * Assigns treatment parameters to the treatment data structure. - */ -void VTreatmentCreate::setTreatmentData() { - - treatmentData.bloodFlowRate = _bloodFlowRate; - treatmentData.dialysateFlowRate = _dialysateFlowRate; - treatmentData.duration = _duration; - treatmentData.heparinDispensingRate = _heparinDispensingRate; - treatmentData.heparinBolusVolume = _heparinBolusVolume; - treatmentData.heparinStopTime = _heparinStopTime; - treatmentData.salineBolus = _salineBolusVolume; - - treatmentData.heparinType = _heparinType; - treatmentData.acidConcentrate = _acidConcentrate; - treatmentData.bicarbonateConcentrate = _bicarbonateConcentrate; - treatmentData.dialyzerType = _dialyzerType; - treatmentData.dialysateTemp = _dialysateTemp; - treatmentData.arterialPressureLimitLow = _arterialPressureLimitLow; - treatmentData.arterialPressureLimitHigh = _arterialPressureLimitHigh; - treatmentData.venousPressureLimitLow = _venousPressureLimitLow; - treatmentData.venousPressureLimitHigh = _venousPressureLimitHigh; - treatmentData.bloodPressureMeasureInterval = _bloodPressureMeasureInterval; - treatmentData.rinsebackFlowRate = _rinsebackFlowRate; -} - -/** * \brief VCreateTreatment::doValidation * Validates the treatment profile locally, then requests validation of it with FW */ void VTreatmentCreate::doValidation() { - setTreatmentData(); + AdjustParametersValidationRequestData data; - // if (!validate(treatmentData)) - // { - // LOG_DEBUG("Local create treatment validation failed."); - // return; - // } + data.bloodFlowRate = _bloodFlowRate; + data.dialysateFlowRate = _dialysateFlowRate; + data.treatmentDuration = _treatmentDuration; + data.heparinDispensingRate = _heparinDispensingRate; + data.heparinBolusVolume = _heparinBolusVolume; + data.heparinStopTime = _heparinStopTime; + data.salineBolus = _salineBolusVolume; + data.heparinType = _heparinType; + data.acidConcentrate = _acidConcentrate; + data.bicarbonateConcentrate = _bicarbonateConcentrate; + data.dialyzerType = _dialyzerType; + data.dialysateTemp = _dialysateTemp; + data.arterialPressureLimitLow = _arterialPressureLimitLow; + data.arterialPressureLimitHigh = _arterialPressureLimitHigh; + data.venousPressureLimitLow = _venousPressureLimitLow; + data.venousPressureLimitHigh = _venousPressureLimitHigh; + data.bloodPressureMeasureInterval = _bloodPressureMeasureInterval; + data.rinsebackFlowRate = _rinsebackFlowRate; - // Request that FW validates the selected parameters - emit didAdjustment(treatmentData); + emit didAdjustment(data); } /** @@ -154,174 +105,16 @@ * \param messageData The message data must contain the reject reason codes for all parameters * \returns True if FW OK's treatment parameters, false otherwise */ -bool VTreatmentCreate::onActionReceive(AdjustParametersValidationResponseData data) { - bool success = true; - if (data.bloodFlowRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - emit scrollToParameter(GET_VARIABLE_NAME(data.bloodFlowRate)); - success = false; - emit bloodFlowRate_ValidationFailed(enumToString(static_cast(data.bloodFlowRate))); - } - if (data.dialysateFlowRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.dialysateFlowRate)); - success = false; - emit dialysateFlowRate_ValidationFailed(enumToString(static_cast(data.dialysateFlowRate))); - } - if (data.duration != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.duration)); - success = false; - emit duration_ValidationFailed(enumToString(static_cast(data.duration))); - } - if (data.heparinDispensingRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.heparinDispensingRate)); - success = false; - emit heparinDispensingRate_ValidationFailed(enumToString(static_cast(data.heparinDispensingRate))); - } - if (data.heparinBolusVolume != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.heparinBolusVolume)); - success = false; - emit heparinBolusVolume_ValidationFailed(enumToString(static_cast(data.heparinBolusVolume))); - } - if (data.heparinStopTime != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.heparinStopTime)); - success = false; - emit heparinStopTime_ValidationFailed(enumToString(static_cast(data.heparinStopTime))); - } - if (data.salineBolus != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.salineBolus)); - success = false; - emit salineBolusVolume_ValidationFailed(enumToString(static_cast(data.salineBolus))); - } - if (data.acidConcentrate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.acidConcentrate)); - success = false; - emit acidConcentrate_ValidationFailed(enumToString(static_cast(data.acidConcentrate))); - } - if (data.bicarbonateConcentrate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.bicarbonateConcentrate)); - success = false; - emit bicarbonateConcentrate_ValidationFailed(enumToString(static_cast(data.bicarbonateConcentrate))); - } - if (data.dialyzerType != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.dialyzerType)); - success = false; - emit dialyzerType_ValidationFailed(enumToString(static_cast(data.dialyzerType))); - } - if (data.heparinType != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.heparinType)); - success = false; - emit heparinType_ValidationFailed(enumToString(static_cast(data.heparinType))); - } - if (data.dialysateTemp != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.dialysateTemp)); - success = false; - emit dialysateTemp_ValidationFailed(enumToString(static_cast(data.dialysateTemp))); - } - if (data.arterialPressureLimitLow != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.arterialPressureLimitLow)); - success = false; - emit arterialPressureLimitLow_ValidationFailed(enumToString(static_cast(data.arterialPressureLimitLow))); - } - if (data.arterialPressureLimitHigh != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.arterialPressureLimitHigh)); - success = false; - emit arterialPressureLimitHigh_ValidationFailed(enumToString(static_cast(data.arterialPressureLimitHigh))); - } - if (data.venousPressureLimitLow != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.venousPressureLimitLow)); - success = false; - emit venousPressureLimitLow_ValidationFailed(enumToString(static_cast(data.venousPressureLimitLow))); - } - if (data.venousPressureLimitHigh != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.venousPressureLimitHigh)); - success = false; - emit venousPressureLimitHigh_ValidationFailed(enumToString(static_cast(data.venousPressureLimitHigh))); - } - if (data.bloodPressureMeasureInterval != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.bloodPressureMeasureInterval)); - success = false; - emit bloodPressureMeasureInterval_ValidationFailed(enumToString(static_cast(data.bloodPressureMeasureInterval))); - } - if (data.rinsebackFlowRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { - if (success) emit scrollToParameter(GET_VARIABLE_NAME(data.rinsebackFlowRate)); - success = false; - emit rinsebackFlowRate_ValidationFailed(enumToString(static_cast(data.rinsebackFlowRate))); - } - +void VTreatmentCreate::onActionReceive(const AdjustParametersValidationResponseData &data) { if (! data.mAccepted) { - success = false; emit fwValidationFailed(""); } - - // DEBUG: qDebug() << "fw validation success = " << success; - - if (success) - { + else { emit fwValidationSuccess(); } - - return success; } -/** - * \brief VCreateTreatment::validate - * \details Validates the create new treatment input. - * \param vData - the selected TreatmentParametersData - * \return true on success, false otherwise. - */ -bool VTreatmentCreate::validate(const AdjustParametersValidationRequestData &vData) -{ - Q_UNUSED(vData) - if (!isbloodFlowRateSet ) return false; - if (!isdialysateFlowRateSet ) return false; - if (!isdurationSet ) return false; - if (!isheparinDispensingRateSet ) return false; - if (!isheparinBolusVolumeSet ) return false; - if (!isheparinStopTimeSet ) return false; - if (!issalineBolusVolumeSet ) return false; - if (!isheparinTypeSet ) return false; - if (!isacidConcentrateSet ) return false; - if (!isbicarbonateConcentrateSet ) return false; - if (!isdialyzerTypeSet ) return false; - if (!isdialysateTempSet ) return false; - if (!isarterialPressureLimitLowSet ) return false; - if (!isarterialPressureLimitHighSet ) return false; - if (!isvenousPressureLimitLowSet ) return false; - if (!isvenousPressureLimitHighSet ) return false; - if (!isbloodPressureMeasureIntervalSet ) return false; - if (!isrinsebackFlowRateSet ) return false; - return true; -} - -/** - * \brief VCreateTreatment::doUserModifiedParameters - * Manages enabling / disabling the continue button - */ -void VTreatmentCreate::doUserModifiedParameters() -{ - setTreatmentData(); - - continueEnabled(validate(treatmentData)); - emit continueEnabledChanged(continueEnabled()); -} - /*! - * \brief VCreateTreatment::doGetPrescriptionParameterNames - * \details Gets a list of the prescription parameter names. - * \return (QStringList) A list of the prescription parameter names - */ -QStringList VTreatmentCreate::doGetPrescriptionParameterNames() -{ - return QStringList() << "Blood Flow Rate" - << "Dialysate Flow Rate" - << "Duration" - << "Heparin Dispensing Rate" - << "Heparin Bolus Volume" - << "Heparin Stop Time" - << "Saline Bolus Volume"; - -} - -/*! * \brief VCreateTreatment::doGetPrescriptionParameterValues * \details Gets a list of the prescription parameter values * \return (QStringList) The list of parameter values with units @@ -330,91 +123,62 @@ { return QStringList() << QString("%0 mL/min").arg(_bloodFlowRate) << QString("%0 mL/min").arg(_dialysateFlowRate) - << QString("%0 min").arg(_duration) - << QString("%0 mL/hr").arg(_heparinDispensingRate) - << QString("%0 mL").arg(_heparinBolusVolume) + << QString("%0 min").arg(_treatmentDuration) + << ( _heparinDispensingRate ? QString("%0 mL/hr").arg(_heparinDispensingRate) : tr("OFF") ) + << ( _heparinBolusVolume ? QString("%0 mL" ).arg(_heparinBolusVolume ) : tr("OFF") ) << QString("%0 min").arg(_heparinStopTime) << QString("%0 mL").arg(_salineBolusVolume); } /*! - * \brief VCreateTreatment::doGetOperatingParameterNames - * Gets a list of the operating parameter names - * \return (QStringList) The list of operating parameter names - */ -QStringList VTreatmentCreate::doGetOperatingParameterNames() -{ - return QStringList() << "Heparin Type" - << "Acid Concentrate" - << "Bicarbonate Concentrate" - << "Dialyzer Type" - << "Dialysate Temperature" - << "Arterial Pressure Limit Low" - << "Arterial Pressure Limit High" - << "Venous Pressure Limit Low" - << "Venous Pressure Limit High" - << "Blood Pressure Measure Interval" - << "Rinseback Rate"; -} - -/*! * \brief VCreateTreatment::doGetOperatingParameterValues * \details Gets the operating parameter values * \return (QStringList) The list of operating parameter values with units where applicable */ QStringList VTreatmentCreate::doGetOperatingParameterValues() { - QString heparinType; - QString acidConcentrate; - QString bicarbConcentrate; - QString dialyzerType; - if ((heparinTypeOptions().length() - 1 < (int)_heparinType)) - heparinType = "None"; - else - heparinType = heparinTypeOptions().at(_heparinType); + QString mHeparinType ; + QString mAcidConcentrate ; + QString mBicarbonateConcentrate ; + QString mDialyzerType ; - if ((acidConcentrateOptions().length() - 1 < (int)_acidConcentrate)) - acidConcentrate = "None"; - else - acidConcentrate = acidConcentrateOptions().at(_acidConcentrate); + QStringList mHeparinTypeOptions ; + QStringList mAcidConcentrateOptions ; + QStringList mBicarbonateConcentrateOptions ; + QStringList mDialyzerTypeOptions ; - if ((bicarbonateConcentrateOptions().length() - 1 < (int)_bicarbonateConcentrate)) - bicarbConcentrate = "None"; - else - bicarbConcentrate = bicarbonateConcentrateOptions().at(_bicarbonateConcentrate); + QString mCategory = Storage::Settings_Category_ConfigurationsDataList; - if ((dialyzerTypeOptions().length() - 1 < (int)_dialyzerType) || ((int)_dialyzerType < 0)) - dialyzerType = "None"; - else - dialyzerType = dialyzerTypeOptions().at(_dialyzerType); + if ( heparinTypeSet () ) { + mHeparinTypeOptions = _Settings.keys(mCategory, "Heparin Type Options" ); + if ((int) _heparinType < mHeparinTypeOptions .length()) mHeparinType = mHeparinTypeOptions .at( _heparinType ); + } else { mHeparinType = tr("NONE"); } - return QStringList() << heparinType - << acidConcentrate - << bicarbConcentrate - << dialyzerType - << QString("%0 °C").arg(_dialysateTemp) - << QString("%0 mmHg").arg(_arterialPressureLimitLow) - << QString("%0 mmHg").arg(_arterialPressureLimitHigh) - << QString("%0 mmHg").arg(_venousPressureLimitLow) - << QString("%0 mmHg").arg(_venousPressureLimitHigh) - << QString("%0 min").arg(_bloodPressureMeasureInterval) - << QString("%0 mL/min").arg(_rinsebackFlowRate); -} + if ( acidConcentrateSet () ) { + mAcidConcentrateOptions = _Settings.keys(mCategory, "Acid Concentrate Options" ); + if ((int) _acidConcentrate < mAcidConcentrateOptions .length()) mAcidConcentrate = mAcidConcentrateOptions .at( _acidConcentrate ); + } else { mAcidConcentrate = tr("NONE"); } -/*! - * \brief VTreatmentCreate::onSettingsDone - * \details fills the items below, read from the settings file, when the reading is notified done by ApplicationController. - * acidConcentrateOptions - * bicarbonateConcentrateOptions - * dialyzerTypeOptions - * heparinTypeOptions - * - */ -void VTreatmentCreate::onSettingsDone() -{ - QString mCategory = Storage::Settings_Category_ConfigurationsDataList; - heparinTypeOptions ( _Settings.keys(mCategory, "Heparin Type" )); - acidConcentrateOptions ( _Settings.keys(mCategory, "Acid Concentrate" )); - bicarbonateConcentrateOptions ( _Settings.keys(mCategory, "Bicarbonate Concentrate" )); - dialyzerTypeOptions ( _Settings.keys(mCategory, "Dialyzer Type" )); + if ( bicarbonateConcentrateSet () ) { + mBicarbonateConcentrateOptions = _Settings.keys(mCategory, "Bicarbonate Concentrate Options" ); + if ((int) _bicarbonateConcentrate < mBicarbonateConcentrateOptions .length()) mBicarbonateConcentrate = mBicarbonateConcentrateOptions .at( _bicarbonateConcentrate ); + } else { mBicarbonateConcentrate = tr("NONE"); } + + if ( dialyzerTypeSet () ) { + mDialyzerTypeOptions = _Settings.keys(mCategory, "Dialyzer Type Options" ); + if ((int) _dialyzerType < mDialyzerTypeOptions .length()) mDialyzerType = mDialyzerTypeOptions .at( _dialyzerType ); + } else { mDialyzerType = tr("NONE"); } + + + return QStringList() << mHeparinType + << mAcidConcentrate + << mBicarbonateConcentrate + << mDialyzerType + << QString("%0 °C" ).arg(_dialysateTemp ) + << QString("%0 mmHg" ).arg(_arterialPressureLimitLow ) + << QString("%0 mmHg" ).arg(_arterialPressureLimitHigh ) + << QString("%0 mmHg" ).arg(_venousPressureLimitLow ) + << QString("%0 mmHg" ).arg(_venousPressureLimitHigh ) + << QString("%0 min" ).arg(_bloodPressureMeasureInterval ) + << QString("%0 mL/min" ).arg(_rinsebackFlowRate ); } Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -26,6 +26,7 @@ #include "MPreTreatmentAdjustParametersValidationResponse.h" #include "GuiController.h" #include "StorageGlobals.h" +#include "VView.h" // forward declaration class tst_views; @@ -73,184 +74,50 @@ // friends friend class::tst_views; -public: - explicit VTreatmentCreate(QObject *parent = nullptr); + VALUESET(quint32 , bloodFlowRate , 0) + VALUESET(quint32 , dialysateFlowRate , 0) + VALUESET(quint32 , treatmentDuration , 0) + VALUESET(float , heparinDispensingRate , 0) + VALUESET(float , heparinBolusVolume , 0) + VALUESET(quint32 , heparinStopTime , 0) + VALUESET(quint32 , salineBolusVolume , 0) - // TODO: these values shall be moved to the Model. - // mL/min - static constexpr quint32 bloodFlowRate_Min = 100 ; // PRS 30 - static constexpr quint32 bloodFlowRate_Max = 500 ; // PRS 30 - static constexpr quint32 bloodFlowRate_Res = 25 ; // PRS 30 - static constexpr quint32 bloodFlowRate_Def = 100 ; // PRS 30 + VALUESET(quint32 , heparinType , 0) + VALUESET(quint32 , acidConcentrate , 0) + VALUESET(quint32 , bicarbonateConcentrate , 0) + VALUESET(quint32 , dialyzerType , 0) - // mL/min - static constexpr quint32 dialysateFlowRate_Min = 100 ; // PRS 345 - static constexpr quint32 dialysateFlowRate_Max = 600 ; // PRS 345 - static constexpr quint32 dialysateFlowRate_Res = 50 ; // PRS 345 - static constexpr quint32 dialysateFlowRate_Def = 100 ; // PRS 345 + VALUESET(qreal , dialysateTemp , 0) + VALUESET(qint32 , arterialPressureLimitLow , 0) + VALUESET(qint32 , arterialPressureLimitHigh , 0) + VALUESET(qint32 , venousPressureLimitLow , 0) + VALUESET(qint32 , venousPressureLimitHigh , 0) + VALUESET(quint32 , bloodPressureMeasureInterval , 0) + VALUESET(quint32 , rinsebackFlowRate , 0) - // minutes - static constexpr quint32 duration_Min = 60 ; // PRS 346 - static constexpr quint32 duration_Max = 480 ; // PRS 346 - static constexpr quint32 duration_Res = 15 ; // PRS 346 - static constexpr quint32 duration_Def = 60 ; // PRS 346 + VALUESET(QString , patientID ,"") + VALUESET(bool , continueEnabled , 0) - // mL/hr (0 = off) - static constexpr qreal heparinDispensingRate_Min = 0.2 ; // PRS 347 - static constexpr qreal heparinDispensingRate_Max = 1.0 ; // PRS 347 - static constexpr qreal heparinDispensingRate_Res = 0.1 ; // PRS 347 - static constexpr qreal heparinDispensingRate_Def = 0.0 ; // PRS 347 + VIEW_DEC_CLASS(VTreatmentCreate) + VIEW_DEC_SLOT(AdjustParametersValidationResponseData) - // mL - static constexpr qreal heparinBolusVolume_Min = 0.2 ; // PRS 348 - static constexpr qreal heparinBolusVolume_Max = 2.0 ; // PRS 348 - static constexpr qreal heparinBolusVolume_Res = 0.1 ; // PRS 348 - static constexpr qreal heparinBolusVolume_Def = 0.0 ; // PRS 348 - - // min - static constexpr quint32 heparinStopTime_Min = 0 ; // PRS 464 - static constexpr quint32 heparinStopTime_Max = 480 ; // PRS 464 - static constexpr quint32 heparinStopTime_Res = 10 ; // PRS 464 - static constexpr quint32 heparinStopTime_Def = 0 ; // PRS 464 - - // mL - static constexpr quint32 salineBolusVolume_Min = 100 ; // PRS 350 - static constexpr quint32 salineBolusVolume_Max = 300 ; // PRS 350 - static constexpr quint32 salineBolusVolume_Res = 100 ; // PRS 350 - static constexpr quint32 salineBolusVolume_Def = 100 ; // PRS 350 - - static constexpr quint32 heparinType_Res = 1 ; // PRS ??? - static constexpr quint32 acidConcentrate_Res = 1 ; // PRS 35 - static constexpr quint32 bicarbonateConcentrate_Res = 1 ; // PRS 351 - static constexpr quint32 dialyzerType_Res = 1 ; // PRS 352 - - // Celsius - static constexpr qreal dialysateTemp_Min = 35 ; // PRS 353 - static constexpr qreal dialysateTemp_Max = 37 ; // PRS 353 - static constexpr qreal dialysateTemp_Res = 0.5 ; // PRS 353 - static constexpr qreal dialysateTemp_Def = 35 ; // PRS 353 - - // mmHg - static constexpr qint32 arterialPressureLimitLow_Min = -300 ; // PRS 354 - static constexpr qint32 arterialPressureLimitLow_Max = +70 ; // PRS 354 - static constexpr qint32 arterialPressureLimitLow_Res = 10 ; // PRS 354 - static constexpr qint32 arterialPressureLimitLow_Def = 100 ; // PRS 354 - - // mmHg - static constexpr qint32 arterialPressureLimitHigh_Min = -270 ; // PRS 355 - static constexpr qint32 arterialPressureLimitHigh_Max = 100 ; // PRS 355 - static constexpr qint32 arterialPressureLimitHigh_Res = 10 ; // PRS 355 - static constexpr qint32 arterialPressureLimitHigh_Def = 100 ; // PRS 355 - - // mmHg - static constexpr qint32 venousPressureLimitLow_Min = 20 ; // PRS 356 - static constexpr qint32 venousPressureLimitLow_Max = 570 ; // PRS 356 - static constexpr qint32 venousPressureLimitLow_Res = 10 ; // PRS 356 - static constexpr qint32 venousPressureLimitLow_Def = 20 ; // PRS 356 - - // mmHg - static constexpr qint32 venousPressureLimitHigh_Min = 50 ; // PRS 357 - static constexpr qint32 venousPressureLimitHigh_Max = 600 ; // PRS 357 - static constexpr qint32 venousPressureLimitHigh_Res = 10 ; // PRS 357 - static constexpr qint32 venousPressureLimitHigh_Def = 400 ; // PRS 357 - - // min - static constexpr quint32 bloodPressureMeasureInterval_Min = 0 ; // PRS 358 - static constexpr quint32 bloodPressureMeasureInterval_Max = 60 ; // PRS 358 - static constexpr quint32 bloodPressureMeasureInterval_Res = 5 ; // PRS 358 - static constexpr quint32 bloodPressureMeasureInterval_Def = 0 ; // PRS 358 - - // mL/min - static constexpr quint32 rinsebackFlowRate_Min = 50 ; // PRS 359 - static constexpr quint32 rinsebackFlowRate_Max = 150 ; // PRS 359 - static constexpr quint32 rinsebackFlowRate_Res = 25 ; // PRS 359 - static constexpr quint32 rinsebackFlowRate_Def = 50 ; // PRS 359 - - enum ACID_ENUM { - eAcidUnset = 9999, - eAcid01 = 0, - eAcid02 , - eAcid03 , - }; - - enum BICARBONATE_ENUM { - eBicarbUnset= 9999, - eBicarb01 = 0, - }; - - enum DIALYZER_ENUM { - eDialyzerUnset = 9999, - eDialyzer01 = 0, - eDialyzer02 , - eDialyzer03 , - }; - - enum HEPARIN_ENUM { - eHeparinUnset = 9999, - eHeparin01 = 0, - }; - -protected: - TREATMENT_PARAMETER(quint32, bloodFlowRate, bloodFlowRate_Def, bloodFlowRate_Min, bloodFlowRate_Max, bloodFlowRate_Res) - TREATMENT_PARAMETER(quint32, dialysateFlowRate, dialysateFlowRate_Def, dialysateFlowRate_Min, dialysateFlowRate_Max, dialysateFlowRate_Res) - TREATMENT_PARAMETER(quint32, duration, duration_Def, duration_Min, duration_Max, duration_Res) - TREATMENT_PARAMETER(qreal, heparinDispensingRate, heparinDispensingRate_Def, heparinDispensingRate_Min, heparinDispensingRate_Max, heparinDispensingRate_Res) - TREATMENT_PARAMETER(qreal, heparinBolusVolume, heparinBolusVolume_Def, heparinBolusVolume_Min, heparinBolusVolume_Max, heparinBolusVolume_Res) - TREATMENT_PARAMETER(quint32, heparinStopTime, heparinStopTime_Def, heparinStopTime_Min, heparinStopTime_Max, heparinStopTime_Res) - TREATMENT_PARAMETER(quint32, salineBolusVolume, salineBolusVolume_Def, salineBolusVolume_Min, salineBolusVolume_Max, salineBolusVolume_Res) - - TREATMENT_PARAMETER(quint32, heparinType, eHeparinUnset, eHeparin01, eHeparin01, heparinType_Res) - TREATMENT_PARAMETER(quint32, acidConcentrate, eAcidUnset, eAcid01, eAcid03, acidConcentrate_Res) - TREATMENT_PARAMETER(quint32, bicarbonateConcentrate, eBicarbUnset, eBicarb01, eBicarb01, bicarbonateConcentrate_Res) - TREATMENT_PARAMETER(quint32, dialyzerType, eDialyzerUnset, eDialyzer01, eDialyzer03, dialyzerType_Res) - - TREATMENT_PARAMETER(qreal, dialysateTemp, dialysateTemp_Def, dialysateTemp_Min, dialysateTemp_Max, dialysateTemp_Res) - TREATMENT_PARAMETER(qint32, arterialPressureLimitLow, arterialPressureLimitLow_Def, arterialPressureLimitLow_Min, arterialPressureLimitLow_Max, arterialPressureLimitLow_Res) - TREATMENT_PARAMETER(qint32, arterialPressureLimitHigh, arterialPressureLimitHigh_Def, arterialPressureLimitHigh_Min, arterialPressureLimitHigh_Max, arterialPressureLimitHigh_Res) - TREATMENT_PARAMETER(qint32, venousPressureLimitLow, venousPressureLimitLow_Def, venousPressureLimitLow_Min, venousPressureLimitLow_Max, venousPressureLimitLow_Res) - TREATMENT_PARAMETER(qint32, venousPressureLimitHigh, venousPressureLimitHigh_Def, venousPressureLimitHigh_Min, venousPressureLimitHigh_Max, venousPressureLimitHigh_Res) - TREATMENT_PARAMETER(quint32, bloodPressureMeasureInterval, bloodPressureMeasureInterval_Def, bloodPressureMeasureInterval_Min, bloodPressureMeasureInterval_Max, bloodPressureMeasureInterval_Res) - TREATMENT_PARAMETER(quint32, rinsebackFlowRate, rinsebackFlowRate_Def, rinsebackFlowRate_Min, rinsebackFlowRate_Max, rinsebackFlowRate_Res) - -protected: - PROPERTY(QString , patientID , "") - PROPERTY(QStringList, heparinTypeOptions , {}) - PROPERTY(QStringList, acidConcentrateOptions , {}) - PROPERTY(QStringList, bicarbonateConcentrateOptions , {}) - PROPERTY(QStringList, dialyzerTypeOptions , {}) - PROPERTY(bool , continueEnabled , false) - - AdjustParametersValidationRequestData treatmentData; // OK - - bool validate(const AdjustParametersValidationRequestData &vData); - void setTreatmentData(); - private: QString enumToString(GuiRequestReasons vEnum); signals: void didAdjustment(const AdjustParametersValidationRequestData &data); void didAdjustment(const AdjustParametersConfirmRequestData &data); - void resetCreateTreatment(); void fwValidationFailed(QString reason); void fwValidationSuccess(); void scrollToParameter(QString parameter); -private slots: - bool onActionReceive(AdjustParametersValidationResponseData data); - void onSettingsDone(); - public slots: - void doResetCreateTreatment(); - void doValidation(); - void doConfirm(); - void doCancel(); - void doUserModifiedParameters(); + void doValidation (); + void doConfirm (); + void doCancel (); - QStringList doGetPrescriptionParameterNames(); QStringList doGetPrescriptionParameterValues(); - QStringList doGetOperatingParameterNames(); QStringList doGetOperatingParameterValues(); }; } Index: sources/view/hd/data/VTreatmentRanges.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -16,16 +16,123 @@ #include "VTreatmentCreate.h" // Project +#include "ApplicationController.h" #include "GuiController.h" +#include "StorageGlobals.h" -VIEW_DEF(VTreatmentRanges, TreatmentRangesData) +VIEW_DEF_CLASS(VTreatmentRanges) -void VTreatmentRanges::onActionReceive(const TreatmentRangesData &vData) +void VTreatmentRanges::initConnections() { + ACTION_VIEW_CONNECTION(TreatmentRangesData); + ACTION_VIEW_CONNECTION(SettingsData); +} + +void View::VTreatmentRanges::onActionReceive(const TreatmentRangesData &vData) { treatmentRanges_Duration_Min ( vData.mDuration_Min ); treatmentRanges_Duration_Max ( vData.mDuration_Max ); treatmentRanges_Ultrafiltration_Volume_Min ( vData.mUltrafiltration_Volume_Min / 1000 ); // mL => L treatmentRanges_Ultrafiltration_Volume_Max ( vData.mUltrafiltration_Volume_Max / 1000 ); // mL => L - treatmentRanges_Dialysate_Flow_Min ( vData.mDialysate_Flow_Min - ( vData.mDialysate_Flow_Min % VTreatmentCreate::dialysateFlowRate_Res ) ); - treatmentRanges_Dialysate_Flow_Max ( vData.mDialysate_Flow_Max - ( vData.mDialysate_Flow_Max % VTreatmentCreate::dialysateFlowRate_Res ) ); + treatmentRanges_Dialysate_Flow_Min ( vData.mDialysate_Flow_Min - ( vData.mDialysate_Flow_Min % dialysateFlowRateRes() ) ); + treatmentRanges_Dialysate_Flow_Max ( vData.mDialysate_Flow_Max - ( vData.mDialysate_Flow_Max % dialysateFlowRateRes() ) ); } + +/*! + * \brief VTreatmentCreate::onSettingsDone + * \details fills the items below, read from the settings file, when the reading is notified done by ApplicationController. + * acidConcentrateOptions + * bicarbonateConcentrateOptions + * dialyzerTypeOptions + * heparinTypeOptions + * + */ +void View::VTreatmentRanges::onActionReceive(const SettingsData &) +{ + QString mCategory = Storage::Settings_Category_ConfigurationsDataList; + + #define FROMVARIANT(vVARIABLE, vGROUP, vKEY, vCONVERSION) \ + { \ + bool ok = false; \ + vVARIABLE( _Settings.value(mCategory, vGROUP, vKEY).to##vCONVERSION(&ok) ); \ + if ( !ok ) LOG_DEBUG("incorrect configuration value for " #vVARIABLE); \ + } + + FROMVARIANT ( bloodFlowRateMin , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Min" , UInt ); + FROMVARIANT ( bloodFlowRateMax , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Max" , UInt ); + FROMVARIANT ( bloodFlowRateRes , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Res" , UInt ); + FROMVARIANT ( bloodFlowRateDef , "Blood Flow Rate Ranges" , "Blood_Flow_Rate_Def" , UInt ); + + FROMVARIANT ( dialysateFlowRateMin , "Dialysate Flow Rate Ranges" , "Dialysate_Flow_Rate_Min" , UInt ); + FROMVARIANT ( dialysateFlowRateMax , "Dialysate Flow Rate Ranges" , "Dialysate_Flow_Rate_Max" , UInt ); + FROMVARIANT ( dialysateFlowRateRes , "Dialysate Flow Rate Ranges" , "Dialysate_Flow_Rate_Res" , UInt ); + FROMVARIANT ( dialysateFlowRateDef , "Dialysate Flow Rate Ranges" , "Dialysate_Flow_Rate_Def" , UInt ); + + FROMVARIANT ( treatmentDurationMin , "Treatment Duration Ranges" , "Treatment_Duration_Min" , UInt ); + FROMVARIANT ( treatmentDurationMax , "Treatment Duration Ranges" , "Treatment_Duration_Max" , UInt ); + FROMVARIANT ( treatmentDurationRes , "Treatment Duration Ranges" , "Treatment_Duration_Res" , UInt ); + FROMVARIANT ( treatmentDurationDef , "Treatment Duration Ranges" , "Treatment_Duration_Def" , UInt ); + + FROMVARIANT ( heparinDispensingRateMin , "Heparin Dispensing Rate Ranges" , "Heparin_Dispensing_Rate_Min" , Float ); + FROMVARIANT ( heparinDispensingRateMax , "Heparin Dispensing Rate Ranges" , "Heparin_Dispensing_Rate_Max" , Float ); + FROMVARIANT ( heparinDispensingRateRes , "Heparin Dispensing Rate Ranges" , "Heparin_Dispensing_Rate_Res" , Float ); + FROMVARIANT ( heparinDispensingRateDef , "Heparin Dispensing Rate Ranges" , "Heparin_Dispensing_Rate_Def" , Float ); + + FROMVARIANT ( heparinBolusVolumeMin , "Heparin Bolus Volume Ranges" , "Heparin_Bolus_Volume_Min" , Float ); + FROMVARIANT ( heparinBolusVolumeMax , "Heparin Bolus Volume Ranges" , "Heparin_Bolus_Volume_Max" , Float ); + FROMVARIANT ( heparinBolusVolumeRes , "Heparin Bolus Volume Ranges" , "Heparin_Bolus_Volume_Res" , Float ); + FROMVARIANT ( heparinBolusVolumeDef , "Heparin Bolus Volume Ranges" , "Heparin_Bolus_Volume_Def" , Float ); + + FROMVARIANT ( heparinStopTimeMin , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Min" , UInt ); + FROMVARIANT ( heparinStopTimeMax , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Max" , UInt ); + FROMVARIANT ( heparinStopTimeRes , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Res" , UInt ); + FROMVARIANT ( heparinStopTimeDef , "Heparin Stop Time Ranges" , "Heparin_Stop_Time_Def" , UInt ); + + FROMVARIANT ( salineBolusVolumeMin , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Min" , UInt ); + FROMVARIANT ( salineBolusVolumeMax , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Max" , UInt ); + FROMVARIANT ( salineBolusVolumeRes , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Res" , UInt ); + FROMVARIANT ( salineBolusVolumeDef , "Saline Bolus Volume Ranges" , "Saline_Bolus_Volume_Def" , UInt ); + + 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" )); + + FROMVARIANT ( dialysateTempMin , "Dialysate Temperature" , "Dialysate_Temperature_Min" , Float ); + FROMVARIANT ( dialysateTempMax , "Dialysate Temperature" , "Dialysate_Temperature_Max" , Float ); + FROMVARIANT ( dialysateTempRes , "Dialysate Temperature" , "Dialysate_Temperature_Res" , Float ); + FROMVARIANT ( dialysateTempDef , "Dialysate Temperature" , "Dialysate_Temperature_Def" , Float ); + + FROMVARIANT ( arterialPressureLimitLowMin , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_Low_Min" , Int ); + FROMVARIANT ( arterialPressureLimitLowMax , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_Low_Max" , Int ); + FROMVARIANT ( arterialPressureLimitLowRes , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_Low_Res" , Int ); + FROMVARIANT ( arterialPressureLimitLowDef , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_Low_Def" , Int ); + FROMVARIANT ( arterialPressureLimitLowGap , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_Low_Gap" , Int ); + + FROMVARIANT ( arterialPressureLimitHighMin , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_High_Min" , Int ); + FROMVARIANT ( arterialPressureLimitHighMax , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_High_Max" , Int ); + FROMVARIANT ( arterialPressureLimitHighRes , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_High_Res" , Int ); + FROMVARIANT ( arterialPressureLimitHighDef , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_High_Def" , Int ); + FROMVARIANT ( arterialPressureLimitHighGap , "Arterial Blood Pressure Ranges" , "Arterial_Adjust_High_Gap" , Int ); + + FROMVARIANT ( venousPressureLimitLowMin , "Venous Blood Pressure Ranges" , "Venous_Adjust_Low_Min" , Int ); + FROMVARIANT ( venousPressureLimitLowMax , "Venous Blood Pressure Ranges" , "Venous_Adjust_Low_Max" , Int ); + FROMVARIANT ( venousPressureLimitLowRes , "Venous Blood Pressure Ranges" , "Venous_Adjust_Low_Res" , Int ); + FROMVARIANT ( venousPressureLimitLowDef , "Venous Blood Pressure Ranges" , "Venous_Adjust_Low_Def" , Int ); + FROMVARIANT ( venousPressureLimitLowGap , "Venous Blood Pressure Ranges" , "Venous_Adjust_Low_Gap" , Int ); + + FROMVARIANT ( venousPressureLimitHighMin , "Venous Blood Pressure Ranges" , "Venous_Adjust_High_Min" , Int ); + FROMVARIANT ( venousPressureLimitHighMax , "Venous Blood Pressure Ranges" , "Venous_Adjust_High_Max" , Int ); + FROMVARIANT ( venousPressureLimitHighRes , "Venous Blood Pressure Ranges" , "Venous_Adjust_High_Res" , Int ); + FROMVARIANT ( venousPressureLimitHighDef , "Venous Blood Pressure Ranges" , "Venous_Adjust_High_Def" , Int ); + FROMVARIANT ( venousPressureLimitHighGap , "Venous Blood Pressure Ranges" , "Venous_Adjust_High_Gap" , Int ); + + FROMVARIANT ( bloodPressureMeasureIntervalMin , "Blood Pressure Measure Interval Ranges" , "Blood_Pressure_Measure_Interval_Min" , UInt ); + FROMVARIANT ( bloodPressureMeasureIntervalMax , "Blood Pressure Measure Interval Ranges" , "Blood_Pressure_Measure_Interval_Max" , UInt ); + FROMVARIANT ( bloodPressureMeasureIntervalRes , "Blood Pressure Measure Interval Ranges" , "Blood_Pressure_Measure_Interval_Res" , UInt ); + FROMVARIANT ( bloodPressureMeasureIntervalDef , "Blood Pressure Measure Interval Ranges" , "Blood_Pressure_Measure_Interval_Def" , UInt ); + + FROMVARIANT ( rinsebackFlowRateMin , "Rinseback Flow Rate Ranges" , "Rinseback_Flow_Rate_Min" , UInt ); + FROMVARIANT ( rinsebackFlowRateMax , "Rinseback Flow Rate Ranges" , "Rinseback_Flow_Rate_Max" , UInt ); + FROMVARIANT ( rinsebackFlowRateRes , "Rinseback Flow Rate Ranges" , "Rinseback_Flow_Rate_Res" , UInt ); + FROMVARIANT ( rinsebackFlowRateDef , "Rinseback Flow Rate Ranges" , "Rinseback_Flow_Rate_Def" , UInt ); +} Index: sources/view/hd/data/VTreatmentRanges.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/view/hd/data/VTreatmentRanges.h (.../VTreatmentRanges.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/view/hd/data/VTreatmentRanges.h (.../VTreatmentRanges.h) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -21,7 +21,7 @@ #include "main.h" // Doxygen : do not remove #include "VView.h" #include "MTreatmentRangesData.h" - +#include "MSettings.h" // namespace namespace View { @@ -36,13 +36,40 @@ { Q_OBJECT - PROPERTY( quint32, treatmentRanges_Duration_Min , 0) - PROPERTY( quint32, treatmentRanges_Duration_Max , 0) - PROPERTY( float , treatmentRanges_Ultrafiltration_Volume_Min, 0) - PROPERTY( float , treatmentRanges_Ultrafiltration_Volume_Max, 0) - PROPERTY( quint32, treatmentRanges_Dialysate_Flow_Min , 0) - PROPERTY( quint32, treatmentRanges_Dialysate_Flow_Max , 0) + // Real-time properties received from HD + READONLY( quint32 , treatmentRanges_Duration_Min , 0) + READONLY( quint32 , treatmentRanges_Duration_Max , 0) + READONLY( float , treatmentRanges_Ultrafiltration_Volume_Min , 0) + READONLY( float , treatmentRanges_Ultrafiltration_Volume_Max , 0) + READONLY( quint32 , treatmentRanges_Dialysate_Flow_Min , 0) + READONLY( quint32 , treatmentRanges_Dialysate_Flow_Max , 0) - VIEW_DEC(VTreatmentRanges, TreatmentRangesData) + // constant properties coming from the settings + RANGESET( quint32 , bloodFlowRate , 0) + RANGESET( quint32 , dialysateFlowRate , 0) + RANGESET( quint32 , treatmentDuration , 0) + RANGESET( float , heparinDispensingRate , 0) + RANGESET( float , heparinBolusVolume , 0) + RANGESET( quint32 , heparinStopTime , 0) + RANGESET( quint32 , salineBolusVolume , 0) + + READONLY( QStringList , heparinTypeOptions ,{}) + READONLY( QStringList , acidConcentrateOptions ,{}) + READONLY( QStringList , bicarbonateConcentrateOptions ,{}) + READONLY( QStringList , dialyzerTypeOptions ,{}) + + RANGESET( float , dialysateTemp , 0) + RANGESET( qint32 , arterialPressureLimitLow , 0) + RANGESET( qint32 , arterialPressureLimitHigh , 0) + RANGESET( qint32 , venousPressureLimitLow , 0) + RANGESET( qint32 , venousPressureLimitHigh , 0) + RANGESET( quint32 , bloodPressureMeasureInterval , 0) + RANGESET( quint32 , rinsebackFlowRate , 0) + + + VIEW_DEC_CLASS(VTreatmentRanges) + VIEW_DEC_SLOT(TreatmentRangesData) + VIEW_DEC_SLOT(SettingsData) + }; } Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -r16bd55822fa77e5bea6fdfa7b54abf123c1da8bb -r5e03d3f26ea0c88562e430c4b8192dd745fa1011 --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 16bd55822fa77e5bea6fdfa7b54abf123c1da8bb) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 5e03d3f26ea0c88562e430c4b8192dd745fa1011) @@ -24,7 +24,7 @@ VIEW_DEF_CLASS(VSettings) void VSettings::initConnections() { - ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, SettingsData); + ACTION_VIEW_CONNECTION (SettingsData ); PROPERTY_POST_CONNECTION(VSettings, servicePass ); PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); PROPERTY_POST_CONNECTION(VSettings, noCANBus ); @@ -73,7 +73,7 @@ } else { //TODO: Since it is global system settings, move this to the settings controller so the C++ backend can also use it. like Date/Time formats. for (const auto &key : keys) { - // DEBUG: qDebug() << " ~~~~~~~~~~ " << key << _Settings.value(group, key).toString (); + // DEBUG: qDebug() << " ~~~~~~~~~~ " << category << group << key << _Settings.value(category, group, key).toString (); QVariantMap keyValue; if ( isservicePass (category, group, key) ) { QString mServicePass;