Index: sources/drydemo/StateControllerPostTreatment.cpp =================================================================== diff -u -r0deaf8f3e192a0ecde953ab65efc1ded1c06269b -r521f29cb7dcd0de352dd744292488380e07cb9e3 --- sources/drydemo/StateControllerPostTreatment.cpp (.../StateControllerPostTreatment.cpp) (revision 0deaf8f3e192a0ecde953ab65efc1ded1c06269b) +++ sources/drydemo/StateControllerPostTreatment.cpp (.../StateControllerPostTreatment.cpp) (revision 521f29cb7dcd0de352dd744292488380e07cb9e3) @@ -2,3 +2,65 @@ #include "StateController.h" #include "ApplicationController.h" #include "types.h" + +void StateController::handlePatientDisconnectRequestMessage() +{ + if (_treatmentRcvdMessages[ID_UI_PATIENT_DISCONNECT_CONFIRM_RQST].isNull()) { return; } + _treatmentRcvdMessages[ID_UI_PATIENT_DISCONNECT_CONFIRM_RQST].clear(); + + // TODo check the reject reasons + handleUIResponseMessage(ID_TD_PATIENT_DISCONNECT_CONFIRM_RESP, ACCEPT_VALUE); +} + +void StateController::handleRemoveDisposablesRequestMessage() +{ + if (_treatmentRcvdMessages[ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_RQST].isNull()) { return; } + _treatmentRcvdMessages[ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_RQST].clear(); + + // TODo check the reject reasons + handleUIResponseMessage(ID_TD_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_RESP, ACCEPT_VALUE); +} + +// TREATMENT PAUSE & POST TREATMENT +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; + _treatmentStatus.bicartShowDialog = DRY_BICART_OPEN_SCREEN; + break; + + case DRY_BICART_ACTION_DEPRESSURIZE: + _treatmentStatus.bicartDepresInProgress = DRY_BICART_DEPRES_IN_PROGRESS; + _treatmentStatus.bicartProgress = 0; + _treatmentStatus.bicartShowDialog = DRY_BICART_OPEN_SCREEN; + 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; + _treatmentStatus.bicartShowDialog = DRY_BICART_OPEN_SCREEN; + break; + + case DRY_BICART_ACTION_DONE: + default: + _treatmentStatus.bicartShowDialog = DRY_BICART_CLOSE_SCREEN; + 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); +}