Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml =================================================================== diff -u -r0785a7f6a49fb8b520b280390bb26ec73606d653 -rf4766c84a469cd19746ce09b74f808a316eb8788 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision 0785a7f6a49fb8b520b280390bb26ec73606d653) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -40,9 +40,9 @@ signal confirmClicked() signal backClicked() - width: Variables.adjustmentDialogWidth - height: Variables.adjustmentDialogHeight - y: Math.round((Variables.applicationHeight - height) / 2) - Variables.headerHeight + width : Variables.adjustmentDialogWidth + height : Variables.adjustmentDialogHeight + y : Math.round((Variables.applicationHeight - height) / 2) - Variables.headerHeight onVisibleChanged: { notificationText = "" @@ -53,19 +53,19 @@ // TODO: remove ConfirmButton later once it is moved out into screens that inherit this ConfirmButton { id : _confirmButton anchors { - right: parent.right - verticalCenter: _backButton.verticalCenter - margins: Variables.adjustmentButtonMargin + right : parent.right + verticalCenter : _backButton.verticalCenter + margins : Variables.adjustmentButtonMargin } visible: _root.confirmVisible onClicked : confirmClicked() } BackButton { id : _backButton anchors { - top: parent.top - left: parent.left - margins: Variables.adjustmentButtonMargin + top : parent.top + left : parent.left + margins : Variables.adjustmentButtonMargin } visible: _root.backVisible onClicked : backClicked() @@ -74,24 +74,24 @@ TitleText { id : _titleText text: titleText font { - pixelSize: Fonts.fontPixelTitle - weight: Font.Medium + pixelSize : Fonts.fontPixelTitle + weight : Font.Medium } - color: Colors.textMain - width: contentWidth - height: contentHeight + color : Colors.textMain + width : contentWidth + height : contentHeight anchors { - bottom: parent.bottom - horizontalCenter: parent.horizontalCenter - margins: Variables.defaultMargin + bottom : parent.bottom + horizontalCenter : parent.horizontalCenter + margins : Variables.defaultMargin } } CloseButton { id : _closeButton anchors { - right: parent.right - verticalCenter: _backButton.verticalCenter - margins: Variables.adjustmentButtonMargin + right : parent.right + verticalCenter : _backButton.verticalCenter + margins : Variables.adjustmentButtonMargin } visible: _root.closeVisible onClicked : { Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml =================================================================== diff -u -r54b940806bb1acdbdeef6ff7b61cd13418d578e7 -rf4766c84a469cd19746ce09b74f808a316eb8788 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml (.../TreatmentAdjustmentUltrafiltrationEdit.qml) (revision 54b940806bb1acdbdeef6ff7b61cd13418d578e7) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml (.../TreatmentAdjustmentUltrafiltrationEdit.qml) (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -31,9 +31,9 @@ QtObject { id: _private readonly property real minimum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Min readonly property real maximum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max - property int decimal : Variables.ultrafiltrationPrecision - property real setVolume : vTreatmentUltrafiltration.setVolume - property real volumeRemoved : vTreatmentUltrafiltration.volumeRemoved + property int decimal : Variables.ultrafiltrationPrecision + property real setVolume : vTreatmentUltrafiltration.setVolume + property real volumeRemoved : vTreatmentUltrafiltration.volumeRemoved } signal continueClicked(real vVolume) Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml =================================================================== diff -u -r54b940806bb1acdbdeef6ff7b61cd13418d578e7 -rf4766c84a469cd19746ce09b74f808a316eb8788 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml (.../TreatmentAdjustmentUltrafiltrationStart.qml) (revision 54b940806bb1acdbdeef6ff7b61cd13418d578e7) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml (.../TreatmentAdjustmentUltrafiltrationStart.qml) (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -32,8 +32,8 @@ QtObject { id: _private readonly property real minimum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Min readonly property real maximum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max - property real setVolume : vTreatmentUltrafiltration.setVolume - property real volumeRemoved : vTreatmentUltrafiltration.volumeRemoved + property real setVolume : vTreatmentUltrafiltration.setVolume + property real volumeRemoved : vTreatmentUltrafiltration.volumeRemoved } signal editClicked() @@ -114,7 +114,7 @@ anchors.bottomMargin: marker.valueOnTop ? 13 : 0 font { pixelSize: Fonts.fontPixelUltrafiltrationRangeMarker - weight: Font.DemiBold + weight : Font.DemiBold } } } @@ -170,7 +170,7 @@ width : Variables.ultrafiltrationButtonWidth height : Variables.ultrafiltrationButtonHeight text { - text : qsTr("Resume Ultrafiltration") + text : qsTr("Resume Ultrafiltration") font { pixelSize : Fonts.fontPixelUltrafiltrationAdjustmentButton weight : Font.DemiBold @@ -217,8 +217,8 @@ } anchors { - bottom: _pauseButton.top - bottomMargin: 25 + bottom : _pauseButton.top + bottomMargin : 25 horizontalCenter: parent.horizontalCenter } visible: _pauseButton.visible Index: sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h =================================================================== diff -u -r9f558b81ef69d1b43a75c390b5faadce0a891df1 -rf4766c84a469cd19746ce09b74f808a316eb8788 --- sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 9f558b81ef69d1b43a75c390b5faadce0a891df1) +++ sources/model/hd/adjustment/treatment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -170,7 +170,7 @@ * * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | - * |0x1100| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Change Request | + * |0x4100| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Change Request | * * | Payload || * | || @@ -194,7 +194,7 @@ * * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | - * |0x4100| 0x041 | 9 | Req | Y | UI | HD | UF Vol. Change User Confirm | + * |0x6600| 0x041 | 9 | Req | Y | UI | HD | UF Vol. Change User Confirm | * * | Payload || * | || Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.cpp (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,67 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentAdjustUltrafiltrationConfirmResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" + +using namespace Model; + +QString MAdjustUltrafiltrationConfirmResponse::toString() const { + return QString(stringPrefix + ",%1,%2,%3,%4,%5") + .arg(_data.mAccepted .value) + .arg(_data.mReason .value) + .arg(_data.mVolume .value) + .arg(_data.mDuration .value) + .arg(_data.mRate .value) + ; +} + +void MAdjustUltrafiltrationConfirmResponse::toVariantList(QVariantList &vData) const { + vData += _data.mAccepted .value; + vData += _data.mReason .value; + vData += _data.mVolume .value; + vData += _data.mDuration .value; + vData += _data.mRate .value; +} + +bool MAdjustUltrafiltrationConfirmResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mVolume )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mDuration )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mRate )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; + +} + +/*! + * \brief MAdjustUltrafiltrationConfirmResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustUltrafiltrationConfirmResponseData MAdjustUltrafiltrationConfirmResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted .value; + data.mReason = _data.mReason .value; + data.mVolume = _data.mVolume .value; + data.mDuration = _data.mDuration .value; + data.mRate = _data.mRate .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,92 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentAdjustUltrafiltrationConfirmResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustUltrafiltrationConfirmResponse class + * \details The UF vol. change confirmation response model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x6700| 0x040 | 6 | Rsp | Y | HD | UI | UF Vol. Change Confirmation Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | | | + * | #3:(F32) | \ref Data::mVolume | + * | #4:(U32) | \ref Data::mDuration | + * | #5:(F32) | \ref Data::mRate | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustUFConfirm | + * + */ +class MAdjustUltrafiltrationConfirmResponse { + + // friends + friend class ::tst_models; + +public: + QString stringPrefix = "AdjustUFConfirm"; + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + + float mVolume = 0; /*!< volume value of type float extracted out */ + quint32 mDuration = 0; /*!< duration value of type quint32 extracted out */ + float mRate = 0; /*!< rate value of type float extracted out */ + }; + +protected: + struct _Data { + Types::U32 mAccepted ; + Types::U32 mReason ; + + Types::F32 mVolume ; + Types::U32 mDuration ; + Types::F32 mRate ; + } _data; + +public: + MAdjustUltrafiltrationConfirmResponse () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; +} + +typedef Model::MAdjustUltrafiltrationConfirmResponse::Data AdjustUltrafiltrationConfirmResponseData; Index: sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.cpp (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,78 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentAdjustUltrafiltrationEditResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MTreatmentAdjustUltrafiltrationEditResponse.h" + +using namespace Model; + +QString MAdjustUltrafiltrationEditResponse::toString() const { + return QString(stringPrefix + ",%1,%2,%3,%4,%5,%6,%7,%8") + .arg(_data.mAccepted .value) + .arg(_data.mReason .value) + .arg(_data.mVolume .value) + .arg(_data.mDuration .value) + .arg(_data.mDurationDiff.value) + .arg(_data.mRate .value) + .arg(_data.mRateDiff .value) + .arg(_data.mRateOld .value) + ; +} + +void MAdjustUltrafiltrationEditResponse::toVariantList(QVariantList &vData) const { + vData += _data.mAccepted .value; + vData += _data.mReason .value; + vData += _data.mVolume .value; + vData += _data.mDuration .value; + vData += _data.mDurationDiff.value; + vData += _data.mRate .value; + vData += _data.mRateDiff .value; + vData += _data.mRateOld .value; +} + +bool MAdjustUltrafiltrationEditResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mVolume )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mDuration )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mDurationDiff )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mRate )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mRateDiff )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mRateOld )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustUltrafiltrationEditResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustUltrafiltrationEditResponseData MAdjustUltrafiltrationEditResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted .value; + data.mReason = _data.mReason .value; + data.mVolume = _data.mVolume .value; + data.mDuration = _data.mDuration .value; + data.mDurationDiff = _data.mDurationDiff.value; + data.mRate = _data.mRate .value; + data.mRateDiff = _data.mRateDiff .value; + data.mRateOld = _data.mRateOld .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,95 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentAdjustUltrafiltrationEditResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 22-Mar-2023 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustUltrafiltrationEditResponse class + * \details The UF vol. change response model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x4200| 0x040 | 6 | Rsp | Y | HD | UI | UF Vol. Change Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | | | + * | #3:(F32) | \ref Data::mVolume | + * | #4:(U32) | \ref Data::mDuration | + * | #5:(S32) | \ref Data::mDurationDiff | + * | | | + * | #6:(F32) | \ref Data::mRate | + * | #7:(F32) | \ref Data::mRateDiff | + * | #8:(F32) | \ref Data::mRateOld | + * + * \sa Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustUFEdit | + * + */ +class MAdjustUltrafiltrationEditResponse : public MAdjustUltrafiltrationConfirmResponse +{ + + // friends + friend class ::tst_models; + +public: + QString stringPrefix = "AdjustUFEdit"; + //NOTE: The correct order is followed in cpp to fill in the values regarding the payload byte orders. + // The struct here is just the values not in correct order + // since has been inherited from the confirm to borrow some struct variables. + struct Data : public MAdjustUltrafiltrationConfirmResponse::Data { + qint32 mDurationDiff= 0; /*!< durationDiff value of type quint32 extracted out */ + float mRateDiff = 0; /*!< rateDiff value of type float extracted out */ + float mRateOld = 0; /*!< rateOld value of type float extracted out */ + }; + +private: + struct : public MAdjustUltrafiltrationConfirmResponse::_Data { + Types::S32 mDurationDiff ; + Types::F32 mRateDiff ; + Types::F32 mRateOld ; + } _data; + +public: + MAdjustUltrafiltrationEditResponse () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; +} + +typedef Model::MAdjustUltrafiltrationEditResponse::Data AdjustUltrafiltrationEditResponseData; Index: sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.cpp (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,49 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentAdjustUltrafiltrationStateResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MTreatmentAdjustUltrafiltrationStateResponse.h" + +using namespace Model; + +QVariantList MAdjustUltrafiltrationStateResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + }; +} + +bool MAdjustUltrafiltrationStateResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if ( ! GetValue(vByteArray, index, _data.mAccepted )) goto lError; + if ( ! GetValue(vByteArray, index, _data.mReason )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustUltrafiltrationStateResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustUltrafiltrationStateResponseData MAdjustUltrafiltrationStateResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.h (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,82 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file MTreatmentAdjustUltrafiltrationStateResponse.h + * \author (last) Behrouz NematiPour + * \date (last) 11-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +// Qt +#include + +// Project +#include "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustUltrafiltrationStateResponse class + * \details The ultrafiltration adjustment state response model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:------------------------:| + * |0x4800| 0x040 | 6 | Rsp | Y | HD | UI | UF Pause/Resume Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * + * \sa Data + * \sa MAdjustUltrafiltrationStateReq : Ultrafiltration state change Request + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustUFState | + * + */ +class MAdjustUltrafiltrationStateResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + } _data; + +public: + Type_Enum typeText () const override { return Type_Enum::eEvent ; } + Unit_Enum unitText () const override { return Unit_Enum::eTD ; } + QString infoText () const override { return QString("AdjustUFState"); } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + }; + + MAdjustUltrafiltrationStateResponse() { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustUltrafiltrationStateResponse::Data AdjustUltrafiltrationStateResponseData; Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag f4766c84a469cd19746ce09b74f808a316eb8788 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,58 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentAdjustmentUltrafiltrationConfirm.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VTreatmentAdjustmentUltrafiltrationConfirm.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationConfirm) + +/*! \brief Connection Initializer + \details All the class signal/slot connections are defined here. +*/ +void VTreatmentAdjustmentUltrafiltrationConfirm::initConnections() { + ACTION_VIEW_CONNECTION(AdjustUltrafiltrationConfirmResponseData); + ADJUST_VIEW_CONNECTION( AdjustUltrafiltrationConfirmRequestData); +} + +/*! + * \brief VTreatmentAdjustmentUltrafiltrationEdit::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void VTreatmentAdjustmentUltrafiltrationConfirm::onActionReceive(const AdjustUltrafiltrationConfirmResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + volume ( vData.mVolume / 1000 ); // mL => L + duration ( vData.mDuration ); + rate ( vData.mRate ); + + // *** 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 View::VTreatmentAdjustmentUltrafiltrationConfirm::doOptionRate + * \details the invocable slot to adjust the ultrafiltration set volume + * \param vVolume - the new ultrafiltration volume + */ +void View::VTreatmentAdjustmentUltrafiltrationConfirm::doConfirm(float vVolume) +{ + _data.volume = int(vVolume * 1000); // cast to int to truncate the float after convert to mL + emit didAdjustment(_data); +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,65 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentAdjustmentUltrafiltrationConfirm.h + * \author (last) Behrouz NematiPour + * \date (last) 18-Apr-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VAdjustmentResponseBase.h" +#include "MTreatmentAdjustUltrafiltrationConfirmResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentUltrafiltrationConfirm class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustUltrafiltrationConfirmResponse + * + */ +class VTreatmentAdjustmentUltrafiltrationConfirm : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustUltrafiltrationConfirmRequestData _data; + + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + TRIGGER( bool , adjustment , 0) + + // Treatment Ultrafiltration data + PROPERTY( float , volume , 0) + PROPERTY( quint32 , duration , 0) + PROPERTY( float , rate , 0) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationConfirm, AdjustUltrafiltrationConfirmResponseData) + + // ----------- Adjust Ultrafiltration +public slots: + void doConfirm (float vVolume); + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to confirm the the treatment ultrafiltration adjustment + * \param vData - data model for confirm the the treatment ultrafiltration adjustment request + */ + void didAdjustment(const AdjustUltrafiltrationConfirmRequestData &vData); +}; +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.cpp (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,60 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentAdjustmentUltrafiltrationEdit.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VTreatmentAdjustmentUltrafiltrationEdit.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationEdit) + +/*! \brief Connection Initializer + \details All the class signal/slot connections are defined here. +*/ +void VTreatmentAdjustmentUltrafiltrationEdit::initConnections() { + ACTION_VIEW_CONNECTION(AdjustUltrafiltrationEditResponseData); + ADJUST_VIEW_CONNECTION( AdjustUltrafiltrationEditRequestData); +} + +/*! + * \brief VTreatmentAdjustmentUltrafiltrationEdit::onActionReceive + * \details received response model data handler + * \param vData - model data + */ +void VTreatmentAdjustmentUltrafiltrationEdit::onActionReceive(const AdjustUltrafiltrationEditResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + volume ( vData.mVolume / 1000 ); // mL => L + duration ( vData.mDuration ); + durationDiff ( vData.mDurationDiff ); + rate ( vData.mRate ); + rateDiff ( vData.mRateDiff ); + rateOld ( vData.mRateOld ); + + // *** 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 View::VTreatmentAdjustmentUltrafiltrationEdit::doAdjustment + * \details the invocable slot to adjust the treatment ultrafiltration volume + * \param vVolume - requested ultrafiltration volume + */ +void View::VTreatmentAdjustmentUltrafiltrationEdit::doAdjustment(float vVolume) { + _data.volume = vVolume * 1000; // L => mL + emit didAdjustment(_data); +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,68 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentAdjustmentUltrafiltrationEdit.h + * \author (last) Behrouz NematiPour + * \date (last) 18-Apr-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VAdjustmentResponseBase.h" +#include "MTreatmentAdjustUltrafiltrationEditResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentUltrafiltrationEdit class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustUltrafiltrationEditResponse + * + */ +class VTreatmentAdjustmentUltrafiltrationEdit : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustUltrafiltrationEditRequestData _data; + + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + TRIGGER( bool , adjustment , 0) + + // Treatment Ultrafiltration data + PROPERTY( float , volume , 0) + PROPERTY( quint32 , duration , 0) + PROPERTY( qint32 , durationDiff , 0) + PROPERTY( float , rate , 0) + PROPERTY( float , rateDiff , 0) + PROPERTY( float , rateOld , 0) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationEdit, AdjustUltrafiltrationEditResponseData) + + // ----------- Adjust Ultrafiltration +public slots: + void doAdjustment(float vVolume); + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to adjust the treatment ultrafiltration volume + * \param vData - data model for edit the treatment ultrafiltration volume adjustment request + */ + void didAdjustment(const AdjustUltrafiltrationEditRequestData &vData); +}; +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,56 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentAdjustmentUltrafiltrationState.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Sep-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VTreatmentAdjustmentUltrafiltrationState.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationState) + +void VTreatmentAdjustmentUltrafiltrationState::initConnections() { + ACTION_VIEW_CONNECTION(AdjustUltrafiltrationStateResponseData); + ADJUST_VIEW_CONNECTION( AdjustUltrafiltrationStateRequestData); +} + +void VTreatmentAdjustmentUltrafiltrationState::onActionReceive(const AdjustUltrafiltrationStateResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + // *** 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 *** + adjustment ( true ); +} + +/*! + * \brief View::VTreatmentAdjustmentUltrafiltrationState::doPause + * \details request to pause the ultrafiltration + */ +void View::VTreatmentAdjustmentUltrafiltrationState::doPause() +{ + _data.requestedState = GuiUFCommands::UF_CMD_PAUSE; + emit didAdjustment(_data); // notify the controllers to do the adjustment +} + +/*! + * \brief View::VTreatmentAdjustmentUltrafiltrationState::doResume + * \details request to resume the ultrafiltration + */ +void View::VTreatmentAdjustmentUltrafiltrationState::doResume() +{ + _data.requestedState = GuiUFCommands::UF_CMD_RESUME; + emit didAdjustment(_data); // notify the controllers to do the adjustment +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h (revision f4766c84a469cd19746ce09b74f808a316eb8788) @@ -0,0 +1,56 @@ +/*! + * + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file VTreatmentAdjustmentUltrafiltrationState.h + * \author (last) Behrouz NematiPour + * \date (last) 18-Apr-2022 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#pragma once + +#include + +// Project +#include "main.h" // Doxygen : do not remove +#include "VAdjustmentResponseBase.h" +#include "MTreatmentAdjustUltrafiltrationStateResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentUltrafiltrationState class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustUltrafiltrationStateResponse + * + */ +class VTreatmentAdjustmentUltrafiltrationState : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustUltrafiltrationStateRequestData _data; + + // The property adjustment_Triggered has to be always true + // and to always trigger the change event to work as a notifier for GUI + TRIGGER( bool , adjustment , 0) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationState, AdjustUltrafiltrationStateResponseData) + + // ---------- Pause Ultrafiltration +public slots: + void doPause (); + void doResume(); + +signals: + void didAdjustment(const AdjustUltrafiltrationStateRequestData &vData); +}; +}