Index: leahi.pro =================================================================== diff -u -r66ed4277f1a2219554e1920f3701c1eb438e9a0a -r99d10909ee4ee821cd4ab6dc323c3798d9090b39 --- leahi.pro (.../leahi.pro) (revision 66ed4277f1a2219554e1920f3701c1eb438e9a0a) +++ leahi.pro (.../leahi.pro) (revision 99d10909ee4ee821cd4ab6dc323c3798d9090b39) @@ -63,6 +63,7 @@ sources/model/td/alarm \ sources/model/td/adjustment \ sources/model/td/adjustment/settings \ + sources/model/td/adjustment/treatment \ sources/model/dd \ sources/model/dd/data \ sources/model/dd/adjustment \ @@ -71,6 +72,7 @@ sources/view/td \ sources/view/td/data \ sources/view/td/data/treatment \ + sources/view/td/adjustment/treatment \ sources/view/dd \ sources/view/dd/data \ sources/view/confirm \ @@ -202,6 +204,10 @@ sources/view/td/data/VTDBatteryData.h \ sources/view/td/data/VTDEjectorData.h \ sources/view/td/data/VTDOpModeData.h \ + \ # ---------- Views - TD - Adjustment - In-Treatment + sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.h \ + \ # ---------- Models - TD - Adjustment - In-Treatment + sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.h \ \ # ---------- Models - confirm sources/model/confirm/MDuetConfirmHDi.h \ \ # ---------- Models - POST @@ -253,7 +259,6 @@ sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.h \ - sources/model/hd/adjustment/treatment/MTreatmentAdjustSalineResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustHeparinResponse.h \ sources/model/hd/adjustment/treatment/MTreatmentAdjustPressuresLimitsResponse.h \ \ # ---------- Models - HD - Adjustment - End-Treatment @@ -371,7 +376,6 @@ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.h \ - sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.h \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.h \ \ # ---------- Views - HD - Adjustment - End-Treatment @@ -526,6 +530,8 @@ \ # ---------- Models - Data - States sources/model/hd/data/pretreatment/MPreTreatmentStatesData.cpp \ sources/model/hd/data/posttreatment/MPostTreatmentStatesData.cpp \ + \ # ---------- Models - TD - Adjustment - In-Treatment + sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp \ \ # ---------- Models - HD - Adjustment sources/model/hd/adjustment/MAdjustPowerOff.cpp \ \ # ---------- Models - HD - Adjustment - Settings @@ -547,7 +553,6 @@ sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationStateResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationEditResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustUltrafiltrationConfirmResponse.cpp \ - sources/model/hd/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustHeparinResponse.cpp \ sources/model/hd/adjustment/treatment/MTreatmentAdjustPressuresLimitsResponse.cpp \ \ # ---------- Models - HD - Adjustment - End-Treatment @@ -625,6 +630,8 @@ sources/view/td/data/VTDBatteryData.cpp \ sources/view/td/data/VTDEjectorData.cpp \ sources/view/td/data/VTDOpModeData.cpp \ + \ # ---------- Views - TD - Adjustment - In-Treatment + sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.cpp \ \ # ---------- Views - CONFIRM sources/view/confirm/VConfirm.cpp \ \ # ---------- Views - POST @@ -666,7 +673,6 @@ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationState.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationEdit.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp \ - sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentHeparin.cpp \ sources/view/hd/adjustment/treatment/VTreatmentAdjustmentPressuresLimits.cpp \ \ # ---------- Views - HD - Adjustment - End-Treatment Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r47b25a76644ca44b81b5a4a728346f8e72e1dc3b -r99d10909ee4ee821cd4ab6dc323c3798d9090b39 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 47b25a76644ca44b81b5a4a728346f8e72e1dc3b) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 99d10909ee4ee821cd4ab6dc323c3798d9090b39) @@ -234,8 +234,8 @@ ID_AdjustPressuresLimitsReq = 0x4600, // 70 ID_AdjustPressuresLimitsRsp = 0x4700, // 71 - ID_AdjustSalineReq = 0x1200, // 18 - ID_AdjustSalineRsp = 0x1400, // 20 + ID_AdjustSalineReq = 0x5E00, // 94 + ID_AdjustSalineRsp = 0x5F00, // 95 ID_AdjustHeparinReq = 0x4B00, // 75 ID_AdjustHeparinRsp = 0x4C00, // 76 Fisheye: Tag 99d10909ee4ee821cd4ab6dc323c3798d9090b39 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 99d10909ee4ee821cd4ab6dc323c3798d9090b39 refers to a dead (removed) revision in file `sources/model/hd/adjustment/treatment/MTreatmentAdjustSalineResponse.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.cpp (revision 99d10909ee4ee821cd4ab6dc323c3798d9090b39) @@ -0,0 +1,52 @@ +/*! + * + * 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 MTreatmentAdjustSalineResponse.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "MTreatmentAdjustSalineResponse.h" + +using namespace Model; + +QVariantList MAdjustSalineResponse::parameters() const { + return { + _data.mAccepted.value, + _data.mReason .value, + _data.mTarget .value, + }; +} + +bool MAdjustSalineResponse::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.mTarget )) goto lError; + + return true ; + +lError: + if(vIndex) { *vIndex = index; } + + return false ; +} + +/*! + * \brief MAdjustSalineResponse::data + * \details Provides model's Data from the received messages data values + * \return Data + */ +AdjustSalineResponseData MAdjustSalineResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + data.mTarget = _data.mTarget .value; + return data; +} Index: sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.h =================================================================== diff -u --- sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.h (revision 0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustSalineResponse.h (revision 99d10909ee4ee821cd4ab6dc323c3798d9090b39) @@ -0,0 +1,87 @@ +/*! + * + * 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 MTreatmentAdjustSalineResponse.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 "MAbstract.h" +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +/*! + * \brief The MAdjustSalineResponse class + * \details The Saline Bolus adjustment response model + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------:| + * |0x1400| 0x020 | 6 | Rsp | Y | HD | UI | Saline Bolus Response | + * + * | Payload || + * | || + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | #3:(U32) | \ref Data::mTarget | + * + * \sa Data + * \sa MAdjustSalineReq : Saline Bolus Request + * \sa MTreatmentSaline : Saline Bolus Data + * + *

Logging info

+ * | || + * | || + * | typeText | Event | + * | unitText | HD | + * | infoText | AdjustSaline | + * + */ +class MAdjustSalineResponse : public MAbstract { + + // friends + friend class ::tst_models; + + QVariantList parameters() const override; + + struct { + Types::U32 mAccepted; + Types::U32 mReason ; + Types::U32 mTarget ; + } _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("AdjustSaline") ; } + + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mTarget = 0; /*!< Target Volume value of type quint32 extracted out */ + }; + + MAdjustSalineResponse () { } + + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; + Data data ( ) const ; +}; +} + +typedef Model::MAdjustSalineResponse::Data AdjustSalineResponseData; Fisheye: Tag 99d10909ee4ee821cd4ab6dc323c3798d9090b39 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 99d10909ee4ee821cd4ab6dc323c3798d9090b39 refers to a dead (removed) revision in file `sources/view/hd/adjustment/treatment/VTreatmentAdjustmentSaline.h'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.cpp =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.cpp (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.cpp (revision 99d10909ee4ee821cd4ab6dc323c3798d9090b39) @@ -0,0 +1,62 @@ +/*! + * + * 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 VTreatmentAdjustmentSaline.cpp + * \author (last) Behrouz NematiPour + * \date (last) 11-Apr-2021 + * \author (original) Behrouz NematiPour + * \date (original) 11-Apr-2021 + * + */ +#include "VTreatmentAdjustmentSaline.h" + +// Project +#include "GuiController.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentSaline) + +void VTreatmentAdjustmentSaline::initConnections() { + ACTION_VIEW_CONNECTION(AdjustSalineResponseData); + ADJUST_VIEW_CONNECTION(AdjustSalineRequestData ); +} + +void VTreatmentAdjustmentSaline::onActionReceive(const AdjustSalineResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + target ( vData.mTarget ); + + // *** 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::VTreatmentAdjustmentSaline::doAdjustment + * \details the invocable slot to adjust(start/stop) the treatment saline bolus state + * \param vStart - if true sets the requestedState to 1(SALINE_CMD_START) otherwise to 0(SALINE_CMD_STOP) + */ + +/*! + * \brief View::VTreatmentAdjustmentSaline::doStart + * \details sends the start saline request + */ +void View::VTreatmentAdjustmentSaline::doStart() +{ + _data.requestedState = GuiSalineCommands::SALINE_CMD_START; + emit didAdjustment(_data); +} + +/*! + * \brief View::VTreatmentAdjustmentSaline::doStop + * \details sends the stop saline request + */ +void View::VTreatmentAdjustmentSaline::doStop() +{ + _data.requestedState = GuiSalineCommands::SALINE_CMD_STOP; + emit didAdjustment(_data); +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.h =================================================================== diff -u --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.h (revision 0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentSaline.h (revision 99d10909ee4ee821cd4ab6dc323c3798d9090b39) @@ -0,0 +1,63 @@ +/*! + * + * 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 VTreatmentAdjustmentSaline.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 "MTreatmentAdjustSalineResponse.h" + +namespace View { + +/*! + * \brief The VTreatmentAdjustmentSaline class + * \details View for Model's Data representation. + * + * \sa Model::MAdjustSalineResponse + * + */ +class VTreatmentAdjustmentSaline : public VAdjustmentResponseBase +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + AdjustSalineRequestData _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 ) + + PROPERTY( qint32 , target , 0 ) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentSaline, AdjustSalineResponseData) + +// ---------- Start/Stop Saline Bolus +public slots: + void doStart(); + void doStop (); + +signals: + /*! + * \brief didAdjustment + * \details the notification signal to adjust the saline bolus state + * \param vData - data model for the duration adjustment request + */ + void didAdjustment(const AdjustSalineRequestData &vData); +}; +}