Index: sources/view/hd/data/VHDTreatmentStatesData.cpp =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r13a086a989174b90594c7aa7cad69d12eab1d975 --- sources/view/hd/data/VHDTreatmentStatesData.cpp (.../VHDTreatmentStatesData.cpp) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/view/hd/data/VHDTreatmentStatesData.cpp (.../VHDTreatmentStatesData.cpp) (revision 13a086a989174b90594c7aa7cad69d12eab1d975) @@ -17,9 +17,28 @@ // Project #include "GuiController.h" -VIEW_DEF(VHDTreatmentStates, TreatmentStatesData) +VIEW_DEF_CLASS(VHDTreatmentStates) /*! + * \brief VTreatmentAdjustmentSaline::initConnections + * \details Initializes the message(s) connection + * \note This class not only listens to its dedicated message TreatmentStatesData, + * But also listens to other messages which affect ultrafiltration and saline bolus state. + * These extra messages are AdjustSalineResponseData , AdjustUltrafiltrationStateResponseData. + * Which ever comes first will set its related properties. + * Since the properties wont set twice if they have the same value it doesn't affect performance so much. + * Also FW suppose to send the TreatmentStatesData related message immediately after the two others. + */ +void VHDTreatmentStates::initConnections() { + ACTION_VIEW_CONNECTION(TreatmentStatesData ); + // these messages sending the same states as in message 15 (TreatmentStates above) + // it is redundant and with a better messaging protocol + // the one in the Adjustment messages should be removed since it is not sent on each state change + // and will be sent only once to the request. + ACTION_VIEW_CONNECTION(AdjustUltrafiltrationStateResponseData ); +} + +/*! * \brief VHDTreatmentStates::onActionReceive * \details sets the properties for the received data of Treatment States * \param vData - Treatment States data @@ -111,3 +130,16 @@ } txStop ( mTreatmentStop ); } + +/*! + * \brief VHDTreatmentStates::onActionReceive + * \details message handler for the message AdjustUltrafiltrationStateResponse data + * \param vData - AdjustUltrafiltrationStateResponse data + */ +void VHDTreatmentStates::onActionReceive(const AdjustUltrafiltrationStateResponseData &vData) +{ + // Ultrafiltration states + ufStart ( vData.mState == GuiUFStates ::UF_START_STATE ); + ufPaused ( vData.mState == GuiUFStates ::UF_PAUSED_STATE ); + ufRunning ( vData.mState == GuiUFStates ::UF_RUNNING_STATE ); +}