Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -r074b32b5cc08f41f2d9ce0d021f2151b76bba5ad -ra51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1 --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision 074b32b5cc08f41f2d9ce0d021f2151b76bba5ad) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision a51b1ec80d65c7cf9f7f3b86f45a637a6d42efc1) @@ -32,7 +32,6 @@ this, SLOT(onStartTreatmentResponse(StartTreatmentResponseData))); loadTreatmentParameterRanges(); - } /** @@ -54,74 +53,43 @@ { QJsonValue value = obj.value(key); - if (key == GET_VARIABLE_NAME(bloodFlowRateMin)) - _bloodFlowRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(bloodFlowRateMax)) - _bloodFlowRateMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(dialysateFlowRateMin)) - _dialysateFlowRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(dialysateFlowRateMax)) - _dialysateFlowRateMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(durationMin)) - _durationMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(durationMax)) - _durationMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinDispensingRateMin)) - _heparinDispensingRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinDispensingRateMax)) - _heparinDispensingRateMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMin)) - _heparinBolusVolumeMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMax)) - _heparinBolusVolumeMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinStopTimeMin)) - _heparinStopTimeMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(heparinStopTimeMax)) - _heparinStopTimeMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(salineBolusVolumeMin)) - _salineBolusVolumeMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(salineBolusVolumeMax)) - _salineBolusVolumeMax = value.toInt(); - //options - else if (key == GET_VARIABLE_NAME(acidConcentrateOptions)) - _acidConcentrateOptions = jsonArrayToStringList(value.toArray()); - else if (key == GET_VARIABLE_NAME(bicarbonateConcentrateOptions)) - _bicarbonateConcentrateOptions = jsonArrayToStringList(value.toArray()); - else if (key == GET_VARIABLE_NAME(dialyzerTypeOptions)) - _dialyzerTypeOptions = jsonArrayToStringList(value.toArray()); + if (key == GET_VARIABLE_NAME(bloodFlowRateMin)) _bloodFlowRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(bloodFlowRateMax)) _bloodFlowRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateFlowRateMin)) _dialysateFlowRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateFlowRateMax)) _dialysateFlowRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(durationMin)) _durationMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(durationMax)) _durationMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinDispensingRateMin)) _heparinDispensingRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinDispensingRateMax)) _heparinDispensingRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMin)) _heparinBolusVolumeMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinBolusVolumeMax)) _heparinBolusVolumeMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinStopTimeMin)) _heparinStopTimeMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(heparinStopTimeMax)) _heparinStopTimeMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(salineBolusVolumeMin)) _salineBolusVolumeMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(salineBolusVolumeMax)) _salineBolusVolumeMax = value.toInt(); + // options + else if (key == GET_VARIABLE_NAME(acidConcentrateOptions)) _acidConcentrateOptions = jsonArrayToStringList(value.toArray()); + else if (key == GET_VARIABLE_NAME(bicarbonateConcentrateOptions)) _bicarbonateConcentrateOptions = jsonArrayToStringList(value.toArray()); + else if (key == GET_VARIABLE_NAME(dialyzerTypeOptions)) _dialyzerTypeOptions = jsonArrayToStringList(value.toArray()); - else if (key == GET_VARIABLE_NAME(dialysateTempMin)) - _dialysateTempMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(dialysateTempMax)) - _dialysateTempMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateTempMin)) _dialysateTempMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(dialysateTempMax)) _dialysateTempMax = value.toInt(); // arterial - else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMin)) - _arterialPressureLimitLowMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMax)) - _arterialPressureLimitLowMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMin)) - _arterialPressureLimitHighMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMax)) - _arterialPressureLimitHighMax = value.toInt(); - //venous - else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMin)) - _venousPressureLimitLowMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMax)) - _venousPressureLimitLowMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMin)) - _venousPressureLimitHighMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMax)) - _venousPressureLimitHighMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMin)) _arterialPressureLimitLowMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitLowMax)) _arterialPressureLimitLowMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMin)) _arterialPressureLimitHighMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(arterialPressureLimitHighMax)) _arterialPressureLimitHighMax = value.toInt(); + // venous + else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMin)) _venousPressureLimitLowMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(venousPressureLimitLowMax)) _venousPressureLimitLowMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMin)) _venousPressureLimitHighMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(venousPressureLimitHighMax)) _venousPressureLimitHighMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMin)) - _bloodPressureMeasureIntervalMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMax)) - _bloodPressureMeasureIntervalMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMin)) _bloodPressureMeasureIntervalMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(bloodPressureMeasureIntervalMax)) _bloodPressureMeasureIntervalMax = value.toInt(); - else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMin)) - _rinsebackFlowRateMin = value.toInt(); - else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMax)) - _rinsebackFlowRateMax = value.toInt(); + else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMin)) _rinsebackFlowRateMin = value.toInt(); + else if (key == GET_VARIABLE_NAME(rinsebackFlowRateMax)) _rinsebackFlowRateMax = value.toInt(); else { qDebug() << "Invalid treatment parameter range: " << key; @@ -277,8 +245,8 @@ if (actionType != GuiActionType::ID_CreateTreatmentRsp) return false; - Model::TreatmentParametersResp response; - TreatmentParametersRespData data = response.fromVariantList(messageData); + Model::MTreatmentParametersResponse response; + AdjustTreatmentParametersResponseData data = response.fromVariantList(messageData); bool success = true; if (data.bloodFlowRate != Gui::GuiRequestReasons::REQUEST_REJECT_REASON_NONE) { @@ -377,7 +345,6 @@ goToNextPage(true); return success; - } /** @@ -505,7 +472,6 @@ // no FW response required goToNextPage(true); - } /** @@ -526,7 +492,6 @@ QString filename = QString("%0treatment%1.json").arg(dir).arg(i); _FileSaver.concurrentSave(filename, document.toJson(), false); return filename; - } /** @@ -620,10 +585,10 @@ /** * \brief VCreateTreatment::validate * Validates the create new treatment input. - * \param vData - the selected TreatmentData + * \param vData - the selected TreatmentParametersData * \return true on success, false otherwise. */ -bool VTreatmentCreate::validate(const TreatmentData &vData) +bool VTreatmentCreate::validate(const AdjustTreatmentParametersRequestData &vData) { bool success = true; @@ -787,7 +752,6 @@ } return success; - } /** @@ -803,7 +767,6 @@ return false; else return true; - } /** @@ -816,7 +779,6 @@ continueEnabled(validate(treatmentData)); emit continueEnabledChanged(continueEnabled()); - } /*!