Index: sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.cpp =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r13a086a989174b90594c7aa7cad69d12eab1d975 --- sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.cpp (.../MTreatmentAdjustUltrafiltrationStateResponse.cpp) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.cpp (.../MTreatmentAdjustUltrafiltrationStateResponse.cpp) (revision 13a086a989174b90594c7aa7cad69d12eab1d975) @@ -20,16 +20,19 @@ return { _data.mAccepted.value, _data.mReason .value, + _data.mState .value, }; } bool MAdjustUltrafiltrationStateResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position if (GetValue(vByteArray, index, _data.mAccepted )) if (GetValue(vByteArray, index, _data.mReason )) + if (GetValue(vByteArray, index, _data.mState )) return true ; else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } } /*! @@ -41,5 +44,6 @@ Data data; data.mAccepted = _data.mAccepted.value; data.mReason = _data.mReason .value; + data.mState = _data.mState .value; return data; } Index: sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.h =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r13a086a989174b90594c7aa7cad69d12eab1d975 --- sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.h (.../MTreatmentAdjustUltrafiltrationStateResponse.h) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.h (.../MTreatmentAdjustUltrafiltrationStateResponse.h) (revision 13a086a989174b90594c7aa7cad69d12eab1d975) @@ -38,6 +38,7 @@ * | || * | #1:(U32) | \ref Data::mAccepted | * | #2:(U32) | \ref Data::mReason | + * | #3:(U32) | \ref Data::mState | * * \sa Data * \sa MAdjustUltrafiltrationStateReq : Ultrafiltration state change Request @@ -60,6 +61,7 @@ struct { Types::U32 mAccepted; Types::U32 mReason ; + Types::U32 mState ; } _data; public: @@ -70,6 +72,7 @@ struct Data { bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mState = 0; /*!< UF State value of type quint32 extracted out */ }; MAdjustUltrafiltrationStateResponse() { } Index: sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r13a086a989174b90594c7aa7cad69d12eab1d975 --- sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp (.../VTreatmentAdjustmentUltrafiltrationState.cpp) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp (.../VTreatmentAdjustmentUltrafiltrationState.cpp) (revision 13a086a989174b90594c7aa7cad69d12eab1d975) @@ -29,6 +29,8 @@ adjustment_Accepted ( vData.mAccepted ); adjustment_Reason ( vData.mReason ); + 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. *** // *** use this trigger to make sure you have all the properties with updated values *** Index: sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r13a086a989174b90594c7aa7cad69d12eab1d975 --- sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h (.../VTreatmentAdjustmentUltrafiltrationState.h) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h (.../VTreatmentAdjustmentUltrafiltrationState.h) (revision 13a086a989174b90594c7aa7cad69d12eab1d975) @@ -46,6 +46,14 @@ TRIGGER( bool , adjustment , 0) // coco end + // coco begin validated: Manually tested + // This property should not be used in QML since it need exposed enum + // exposed enum usage in QML is not suggested since QML will not error out on any issue + // kept for consistency and debugging use cases + // Look at the VHDTreatmentStates ultrafiltration properties + PROPERTY( qint32 , state , 0) + // coco end + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationState, AdjustUltrafiltrationStateResponseData) // ---------- Pause Ultrafiltration 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 ); +} Index: sources/view/hd/data/VHDTreatmentStatesData.h =================================================================== diff -u -r6581def57942b1c1ef56a2f2feb74559946517b9 -r13a086a989174b90594c7aa7cad69d12eab1d975 --- sources/view/hd/data/VHDTreatmentStatesData.h (.../VHDTreatmentStatesData.h) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) +++ sources/view/hd/data/VHDTreatmentStatesData.h (.../VHDTreatmentStatesData.h) (revision 13a086a989174b90594c7aa7cad69d12eab1d975) @@ -117,6 +117,10 @@ PROPERTY( bool , tsRecirculateNo , false) ///< TREATMENT_STOP_NO_RECIRC_STATE = 1 # No dialysate re-circulation state of the treatment stop sub-mode state machine // class definition - VIEW_DEC(VHDTreatmentStates, TreatmentStatesData) + VIEW_DEC_CLASS(VHDTreatmentStates) + + // slots for received data messages (onActionReceive) + VIEW_DEC_SLOT (TreatmentStatesData ) // Treatment States Broadcast messages (This class original receiver) + VIEW_DEC_SLOT (AdjustUltrafiltrationStateResponseData ) // Ultrafiltration state Adjustment response message }; }