Index: sources/drydemo/StateController.cpp =================================================================== diff -u -r38521851fd3271aa9a8965067d15daaba0db4b2e -r3a1edf1c2dc6f68d32af3adeeee4a59bbac739c5 --- sources/drydemo/StateController.cpp (.../StateController.cpp) (revision 38521851fd3271aa9a8965067d15daaba0db4b2e) +++ sources/drydemo/StateController.cpp (.../StateController.cpp) (revision 3a1edf1c2dc6f68d32af3adeeee4a59bbac739c5) @@ -14,7 +14,8 @@ startTimer(QOBJECT_TIMER_TIMEOUT_MS); connect(&_ApplicationController, SIGNAL(didUnhandledMsgAppController(const QVariantList &)), this , SLOT(doStateControllerUnhandledMsgReceived(const QVariantList &))); - + // Reset the elapsed time counter + _elapsedTimeCtr = 0; // State machine methods _dryDemo.connectToState("Standby" , this, &StateController::onStandbyStateChange ); _dryDemo.connectToState("Pre_Tx" , this, &StateController::onPretreatmentStateChange ); @@ -142,6 +143,8 @@ void StateController::timerEvent(QTimerEvent *) { + _elapsedTimeCtr++; + if (!_dryDemo.isRunning()){ _dryDemo.start(); } _dryDemo.submitEvent("TimeoutEvent"); @@ -292,8 +295,9 @@ handleBackToStandbyEvent(status); handleBloodPrimePauseResume(resume); handleSetPointBloodFlowChange(currBloodFlowMLPM, hasFlowChngeRequested); - handleTDPressureBroadcastData(BC_DELAYED); handlePressureLimitState(); + handleTDPressureBroadcastData(BC_DELAYED); + handleDeterminePressureLimits(); handleFluidBolusRequestMessage(); if (_treatmentSubStates.fluidBolusState == FLUID_BOLUS_SALINE_IN_PROGRESS_STATE){ handleFluidBolusFluidDelivery(currBloodFlowMLPM); @@ -440,11 +444,14 @@ handleAlarmUserAction(status, true); handleTDOpModeTransitionBroadcastData(MODE_TREA, 0, BC_DELAYED); handlePressureLimitState(); - handleTreatmentStatesBroadcastData(BC_DELAYED); + handleTDPressureBroadcastData(BC_DELAYED); + handleDeterminePressureLimits(); }; auto onExit = [=](){ qDebug() << "Tx pasue in exit"; + // Set the pressure to close upon exiting the treatment pause + handleSignalInitiatePressureStabilization(USE_NORMAL_STABILIZATION_PERIOD); _dryDemo.submitEvent(_treatmentStatus.stateTransitionEvent); status = STATE_ON_ENTRY; }; @@ -461,7 +468,9 @@ auto onEntry = [=](){ // Start with UF state in dialysis + _treatmentSubStates.txState = TREAT_START_STATE; _treatmentSubStates.dialysisSubState = DIALYSIS_UF_PAUSED_STATE; + handleTreatmentStatesBroadcastData(BC_IMMEDIATELY); _treatmentSubStates.txState = TREAT_RINSEBACK_STATE; _treatmentSubStates.rinsebackState = RINSEBACK_STOP_INIT_STATE; handleTDOpModeTransitionBroadcastData(MODE_TREA, 0, BC_IMMEDIATELY); @@ -482,6 +491,7 @@ handleRinsebackBroadcastData(BC_DELAYED); handlePressureLimitState(); handleTDPressureBroadcastData(BC_DELAYED); + handleDeterminePressureLimits(); handleUIConfirmMessage(GENERIC_CONFIRM_ID_TREATMENT_END, status); if (_treatmentStatus.hasRecircBeenRequested) { _treatmentStatus.stateTransitionEvent = "T_RB_2_RC";