Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -r723c692a3a1de3b780d90bcc73a370beb22d73ab -r9dedf7365588ad0124e35ac9cdbe25903488f609 --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 723c692a3a1de3b780d90bcc73a370beb22d73ab) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 9dedf7365588ad0124e35ac9cdbe25903488f609) @@ -62,96 +62,95 @@ public: explicit VTreatmentCreate(QObject *parent = nullptr); -private: - + // TODO: these values shall be moved to the Model. // mL/min - const quint32 bloodFlowRate_Min = 100 ; // PRS 30 - const quint32 bloodFlowRate_Max = 500 ; // PRS 30 - const quint32 bloodFlowRate_Res = 25 ; // PRS 30 - const quint32 bloodFlowRate_Def = bloodFlowRate_Min ; // PRS 30 + 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 = bloodFlowRate_Min ; // PRS 30 // mL/min - const quint32 dialysateFlowRate_Min = 100 ; // PRS 345 - const quint32 dialysateFlowRate_Max = 600 ; // PRS 345 - const quint32 dialysateFlowRate_Res = 50 ; // PRS 345 - const quint32 dialysateFlowRate_Def = dialysateFlowRate_Min ; // PRS 345 + 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 = dialysateFlowRate_Min ; // PRS 345 // minutes - const quint32 duration_Min = 60 ; // PRS 346 - const quint32 duration_Max = 480 ; // PRS 346 - const quint32 duration_Res = 15 ; // PRS 346 - const quint32 duration_Def = duration_Min ; // PRS 346 + 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 = duration_Min ; // PRS 346 // mL/hr (0 = off) - const qreal heparinDispensingRate_Min = 0.0 ; // PRS 347 - const qreal heparinDispensingRate_Max = 1.0 ; // PRS 347 - const qreal heparinDispensingRate_Res = 0.1 ; // PRS 347 - const qreal heparinDispensingRate_Def = heparinDispensingRate_Min ; // PRS 347 + static constexpr qreal heparinDispensingRate_Min = 0.0 ; // 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 = heparinDispensingRate_Min ; // PRS 347 // mL - const qreal heparinBolusVolume_Min = 0.0 ; // PRS 348 - const qreal heparinBolusVolume_Max = 2.0 ; // PRS 348 - const qreal heparinBolusVolume_Res = 0.1 ; // PRS 348 - const qreal heparinBolusVolume_Def = heparinBolusVolume_Min ; // PRS 348 + static constexpr qreal heparinBolusVolume_Min = 0.0 ; // 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 = heparinBolusVolume_Min ; // PRS 348 // min - const quint32 heparinStopTime_Min = 0 ; // PRS 464 - const quint32 heparinStopTime_Max = 470 ; // PRS 464 - const quint32 heparinStopTime_Res = 10 ; // PRS 464 - const quint32 heparinStopTime_Def = heparinStopTime_Min ; // PRS 464 + static constexpr quint32 heparinStopTime_Min = 0 ; // PRS 464 + static constexpr quint32 heparinStopTime_Max = 470 ; // PRS 464 + static constexpr quint32 heparinStopTime_Res = 10 ; // PRS 464 + static constexpr quint32 heparinStopTime_Def = heparinStopTime_Min ; // PRS 464 // mL - const quint32 salineBolusVolume_Min = 100 ; // PRS 350 - const quint32 salineBolusVolume_Max = 300 ; // PRS 350 - const quint32 salineBolusVolume_Res = 100 ; // PRS 350 - const quint32 salineBolusVolume_Def = salineBolusVolume_Min ; // PRS 350 + 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 = salineBolusVolume_Min ; // PRS 350 - const quint32 heparinType_Res = 1 ; // PRS ??? - const quint32 acidConcentrate_Res = 1 ; // PRS 35 - const quint32 bicarbonateConcentrate_Res = 1 ; // PRS 351 - const quint32 dialyzerType_Res = 1 ; // PRS 352 + 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 - const qreal dialysateTemp_Min = 35 ; // PRS 353 - const qreal dialysateTemp_Max = 38 ; // PRS 353 - const qreal dialysateTemp_Res = 0.5 ; // PRS 353 - const qreal dialysateTemp_Def = dialysateTemp_Min ; // PRS 353 + static constexpr qreal dialysateTemp_Min = 35 ; // PRS 353 + static constexpr qreal dialysateTemp_Max = 38 ; // PRS 353 + static constexpr qreal dialysateTemp_Res = 0.5 ; // PRS 353 + static constexpr qreal dialysateTemp_Def = dialysateTemp_Min ; // PRS 353 // mmHg - const qint32 arterialPressureLimitLow_Min = -300 ; // PRS 354 - const qint32 arterialPressureLimitLow_Max = -30 ; // PRS 354 - const qint32 arterialPressureLimitLow_Res = 10 ; // PRS 354 - const qint32 arterialPressureLimitLow_Def = arterialPressureLimitLow_Min ; // PRS 354 + static constexpr qint32 arterialPressureLimitLow_Min = -300 ; // PRS 354 + static constexpr qint32 arterialPressureLimitLow_Max = -30 ; // PRS 354 + static constexpr qint32 arterialPressureLimitLow_Res = 10 ; // PRS 354 + static constexpr qint32 arterialPressureLimitLow_Def = arterialPressureLimitLow_Min ; // PRS 354 // mmHg - const qint32 arterialPressureLimitHigh_Min = -270 ; // PRS 355 - const qint32 arterialPressureLimitHigh_Max = 0 ; // PRS 355 - const qint32 arterialPressureLimitHigh_Res = 10 ; // PRS 355 - const qint32 arterialPressureLimitHigh_Def = arterialPressureLimitHigh_Min ; // PRS 355 + static constexpr qint32 arterialPressureLimitHigh_Min = -270 ; // PRS 355 + static constexpr qint32 arterialPressureLimitHigh_Max = 0 ; // PRS 355 + static constexpr qint32 arterialPressureLimitHigh_Res = 10 ; // PRS 355 + static constexpr qint32 arterialPressureLimitHigh_Def = arterialPressureLimitHigh_Min ; // PRS 355 // mmHg - const qint32 venousPressureLimitLow_Min = 20 ; // PRS 356 - const qint32 venousPressureLimitLow_Max = 570 ; // PRS 356 - const qint32 venousPressureLimitLow_Res = 10 ; // PRS 356 - const qint32 venousPressureLimitLow_Def = venousPressureLimitLow_Min ; // PRS 356 + 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 = venousPressureLimitLow_Min ; // PRS 356 // mmHg - const qint32 venousPressureLimitHigh_Min = 50 ; // PRS 357 - const qint32 venousPressureLimitHigh_Max = 600 ; // PRS 357 - const qint32 venousPressureLimitHigh_Res = 10 ; // PRS 357 - const qint32 venousPressureLimitHigh_Def = venousPressureLimitHigh_Min ; // PRS 357 + 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 = venousPressureLimitHigh_Min ; // PRS 357 // min - const quint32 bloodPressureMeasureInterval_Min = 0 ; // PRS 358 - const quint32 bloodPressureMeasureInterval_Max = 60 ; // PRS 358 - const quint32 bloodPressureMeasureInterval_Res = 5 ; // PRS 358 - const quint32 bloodPressureMeasureInterval_Def = bloodPressureMeasureInterval_Min ; // PRS 358 + 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 = bloodPressureMeasureInterval_Min ; // PRS 358 // mL/min - const quint32 rinsebackFlowRate_Min = 50 ; // PRS 359 - const quint32 rinsebackFlowRate_Max = 150 ; // PRS 359 - const quint32 rinsebackFlowRate_Res = 25 ; // PRS 359 - const quint32 rinsebackFlowRate_Def = rinsebackFlowRate_Min ; // PRS 359 + 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 = rinsebackFlowRate_Min ; // PRS 359 enum ACID_ENUM { eAcidUnset = 9999, Index: sources/view/hd/data/VTreatmentRanges.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r9dedf7365588ad0124e35ac9cdbe25903488f609 --- sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/hd/data/VTreatmentRanges.cpp (.../VTreatmentRanges.cpp) (revision 9dedf7365588ad0124e35ac9cdbe25903488f609) @@ -13,6 +13,7 @@ * */ #include "VTreatmentRanges.h" +#include "VTreatmentCreate.h" // Project #include "GuiController.h" @@ -21,10 +22,10 @@ void VTreatmentRanges::onActionReceive(const TreatmentRangesData &vData) { - treatmentRanges_Duration_Min ( vData.mDuration_Min ); - treatmentRanges_Duration_Max ( vData.mDuration_Max ); + 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 ); - treatmentRanges_Dialysate_Flow_Max ( vData.mDialysate_Flow_Max ); + 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 ) ); }