Index: sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r767367e5779764bec1c1857f32eaf3d86089d5d9 --- sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp (.../VTreatmentAdjustmentSaline.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp (.../VTreatmentAdjustmentSaline.cpp) (revision 767367e5779764bec1c1857f32eaf3d86089d5d9) @@ -20,7 +20,6 @@ VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentSaline, AdjustSalineResponseData) void VTreatmentAdjustmentSaline::initConnections() { - ACTION_VIEW_CONNECTION(TreatmentStatesData ); ACTION_VIEW_CONNECTION(AdjustSalineResponseData); ADJUST_VIEW_CONNECTION(AdjustSalineRequestData ); } @@ -31,38 +30,25 @@ adjustment_Reason ( vData.mReason ); target ( vData.mTarget ); - if (adjustment_Accepted()) { - // the response doesn't have the state so the requested state which has been accepted is used. - isStarted ( _data.requestedState == AdjustSalineRequestData::eStart ); - } + state ( vData.mState ); // *** has to be the last to let the information to be set and then emit the signal *** // *** otherwise will use the previous values before being set. *** adjustment ( true ); } /*! - * \brief VTreatmentAdjustmentSaline::onActionReceive - * \details This is the message handler of when the Saline is done - * the state of the Saline in the SalineState of the TreatmentStates message will change at anytime - * and so the state of the UI should change in regards to that field and affect the isStarted - * after the saline start request has been accepted. - * \param vData - data of the Treatment State Message. - */ -void VTreatmentAdjustmentSaline::onActionReceive(const TreatmentStatesData &vData) -{ - isStarted ( vData.mSalineState == GuiSalineStates::SALINE_BOLUS_STATE_IN_PROGRESS ); - isDisabled( vData.mSalineState == GuiSalineStates::SALINE_BOLUS_STATE_MAX_DELIVERED ); -} - -/*! * \brief View::VTreatmentAdjustmentSaline::doAdjustment * \details the invocable slot to adjust(start/stop) the treatment saline bolus state */ void View::VTreatmentAdjustmentSaline::doAdjustment() { - if (isStarted()) { - _data.requestedState = AdjustSalineRequestData::eStop; + // if it's accepted or rejected we have the last/current state of saline + // so decide on last received/response state + // be careful the response enum (GuiSalineStates) is + // different than request enum (AdjustSalineRequestData) + if ( state() == GuiSalineStates::SALINE_BOLUS_STATE_IN_PROGRESS ) { + _data.requestedState = AdjustSalineRequestData::eStop; } else { _data.requestedState = AdjustSalineRequestData::eStart;