Index: sources/drydemo/StateControllerTreatment.cpp =================================================================== diff -u -r0deaf8f3e192a0ecde953ab65efc1ded1c06269b -r521f29cb7dcd0de352dd744292488380e07cb9e3 --- sources/drydemo/StateControllerTreatment.cpp (.../StateControllerTreatment.cpp) (revision 0deaf8f3e192a0ecde953ab65efc1ded1c06269b) +++ sources/drydemo/StateControllerTreatment.cpp (.../StateControllerTreatment.cpp) (revision 521f29cb7dcd0de352dd744292488380e07cb9e3) @@ -111,25 +111,29 @@ void StateController::handleFluidBolusRequestMessage() { - if (!_treatmentRcvdMessages[ID_UI_FLUID_BOLUS_RQST].isNull()){ + if (!_treatmentRcvdMessages[ID_UI_FLUID_BOLUS_RQST].isNull()) { quint32 fluidBolusCmd = extractU32DataFromReceivedMessage(ID_UI_FLUID_BOLUS_RQST, 0); // Regardless of starting or stoping the bolus, widen the range handleSignalInitiatePressureStabilization(USE_NORMAL_STABILIZATION_PERIOD); // Assume the fluid bolus is not in progress _treatmentSubStates.fluidBolusState = FLUID_BOLUS_IDLE_STATE; - if (fluidBolusCmd == FLUID_BOLUS_START_CMD){ - _treatmentSubStates.fluidBolusState = FLUID_BOLUS_SALINE_IN_PROGRESS_STATE; - _treatmentSubStates.dialysisSubState = DIALYSIS_UF_PAUSED_STATE; //DIALYSIS_UF_FLUID_BOLUS_STATE; // TODO UI goes to pause + if (fluidBolusCmd == FLUID_BOLUS_START_CMD) { + _treatmentSubStates.prevDialysisSubState = _treatmentSubStates.dialysisSubState; + _treatmentSubStates.fluidBolusState = FLUID_BOLUS_SALINE_IN_PROGRESS_STATE; + _treatmentSubStates.dialysisSubState = DIALYSIS_UF_PAUSED_STATE; //DIALYSIS_UF_FLUID_BOLUS_STATE; // TODO UI goes to pause } - else { _treatmentStatus.totalFluidBolusDeliveredML += _treatmentStatus.accumFluidBolusDeliveredML; } + else { + _treatmentStatus.totalFluidBolusDeliveredML += _treatmentStatus.accumFluidBolusDeliveredML; + _treatmentSubStates.dialysisSubState = _treatmentSubStates.prevDialysisSubState; + } _treatmentRcvdMessages[ID_UI_FLUID_BOLUS_RQST].clear(); handleUIResponseMessage(ID_TD_FLUID_BOLUS_RESP, ACCEPT_VALUE, {static_cast(REQUEST_REJECT_REASON_NONE), _treatmentParams.fluidBlousVolumeML}); } - if (!_treatmentRcvdMessages[ID_UI_BOLUS_VOLUME_CHANGE_RQST].isNull()){ + if (!_treatmentRcvdMessages[ID_UI_BOLUS_VOLUME_CHANGE_RQST].isNull()) { quint32 fluidBolusVolML = extractU32DataFromReceivedMessage(ID_UI_BOLUS_VOLUME_CHANGE_RQST, 0); // TODO Check the range of the requested bolus volume @@ -149,7 +153,7 @@ if (_treatmentStatus.accumFluidBolusDeliveredML >= _treatmentParams.fluidBlousVolumeML) { _treatmentSubStates.fluidBolusState = FLUID_BOLUS_IDLE_STATE; - _treatmentSubStates.dialysisSubState = DIALYSIS_UF_STATE; + _treatmentSubStates.dialysisSubState = _treatmentSubStates.prevDialysisSubState; _treatmentStatus.totalFluidBolusDeliveredML += _treatmentStatus.accumFluidBolusDeliveredML; _treatmentStatus.accumFluidBolusDeliveredML = 0.0; // Immediately broadcast the results to be updated @@ -657,47 +661,6 @@ handleVitalsBroadcastData(); } -// TREATMENT PAUSE -void StateController::handleDryBicartActionRequest() -{ - if (_treatmentRcvdMessages[ID_UI_DRY_BICART_DISCONNECT_RQST].isNull()) { return; } - - quint32 dryBicartAction = extractU32DataFromReceivedMessage(ID_UI_DRY_BICART_DISCONNECT_RQST, 0); - _treatmentStatus.bicartAction = static_cast(dryBicartAction); - - switch (_treatmentStatus.bicartAction) { - case DRY_BICART_ACTION_DRAIN: - // If either of drain or depressurization commands were selected, set the progress to 0 as it is a new start - _treatmentStatus.bicartDrainInProgress = DRY_BICART_DRIN_IN_PROGRESS; - _treatmentStatus.bicartProgress = 0; - break; - - case DRY_BICART_ACTION_DEPRESSURIZE: - _treatmentStatus.bicartDepresInProgress = DRY_BICART_DEPRES_IN_PROGRESS; - _treatmentStatus.bicartProgress = 0; - break; - - case DRY_BICART_ACTION_CANCEL: - // If cancel is selected cancel both (in case cancle was selected) - // Set the progress to 0 - _treatmentStatus.bicartDrainInProgress = DRY_BICART_DRIN_NOT_IN_PROGRESS; - _treatmentStatus.bicartDepresInProgress = DRY_BICART_DEPRES_NOT_IN_PROGRESS; - _treatmentStatus.bicartProgress = 0; - break; - - case DRY_BICART_ACTION_DONE: - default: - // Do nothing - break; - } - - // Broadcast the results of the action immediately - handleDryBicartBroadcastData(BC_IMMEDIATELY); - - _treatmentRcvdMessages[ID_UI_DRY_BICART_DISCONNECT_RQST].clear(); - handleUIResponseMessage(ID_TD_DRY_BICART_DISCONNECT_RESP, ACCEPT_VALUE); -} - // TREATMENT END void StateController::handleTreatmentEndRequestMessage(State_Status &status) {