Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -r3b4b381d23c267fbc5af29f29e231f03e26ca23b -r4d969a04e6d80a6d2f6b756a4b87aecd6356e6a9 --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 3b4b381d23c267fbc5af29f29e231f03e26ca23b) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 4d969a04e6d80a6d2f6b756a4b87aecd6356e6a9) @@ -2,11 +2,10 @@ * * Copyright (c) 2019-2020 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. + * 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 mtreatmentadjustrequests.h + * \file MTreatmentAdjustRequests.h * \date 2020/06/08 * \author Behrouz NematiPour * @@ -15,10 +14,10 @@ #pragma once // Qt -#include +#include //project -#include "guiglobals.h" +#include "GuiGlobals.h" namespace Model { @@ -30,16 +29,37 @@ * Otherwise the parameters are so tiny models. */ -#include - class MModel { protected: + /*! + * \brief toString + * \details the global toString function for all the request message models + * which is mainly used for logging and debugging. + * \param vStringPrefix - a prefix string to be inserted after senderID (UI) and parameter values list. + * This is comma separated. + * \param vParameters - list of parameter values of the model as a comma separated string. + * \return QString + */ static QString toString (const QString &vStringPrefix, const QVariant &vParameters) { QString senderID = "UI,"; return QString(senderID + vStringPrefix + "," + vParameters.toStringList().join(',')); } }; +/*! + * \brief The MAdjustPowerOffReq class + * \details The power off request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x0100| 0x020 | 6 | Cmd | N | HD | UI | Power Off | + * + * | Payload || + * | || + * | #1:(U08) | \ref state | + * + * + */ class MAdjustPowerOffReq : public MModel { public: quint8 state; @@ -56,6 +76,21 @@ } }; +/*! + * \brief The MAdjustBloodDialysateReq class + * \details The blood/dialysate rate change request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1700| 0x100 | 9 | Req | Y | UI | HD | Blood/dialysate rate Change | + * + * | Payload || + * | || + * | #1:(U32) | \ref bloodFlow | + * | #2:(U32) | \ref dialysateFlow | + * + * + */ class MAdjustBloodDialysateReq : public MModel { public: quint32 bloodFlow = 0; @@ -71,6 +106,19 @@ } }; +/*! + * \brief The MAdjustDurationReq class + * \details The treatment duration change request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1600| 0x100 | 9 | Req | Y | UI | HD | Treatment Duration Change Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref duration | + * + */ class MAdjustDurationReq : public MModel { public: quint32 duration = 0; @@ -85,12 +133,26 @@ } }; +/*! + * \brief The MAdjustUltrafiltrationStateReq class + * \details The ultrafiltration pause/resume request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1000| 0x100 | 9 | Req | Y | UI | HD | UF Pause/Resume | + * + * | Payload || + * | || + * | #1:(U32) | \ref requestedState | + * + */ class MAdjustUltrafiltrationStateReq : public MModel { public: enum State{ ePaused = 0, eRunning = 1, - }; + }; + State requestedState = ePaused; // the requested state. Initially it's running => paused. // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. @@ -103,6 +165,19 @@ } }; +/*! + * \brief The MAdjustUltrafiltrationEditReq class + * \details The ultrafiltration volume change request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1100| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Change Request | + * + * | Payload || + * | || + * | #1:(F32) | \ref volume | + * + */ class MAdjustUltrafiltrationEditReq : public MModel { public: float volume = 0; @@ -117,12 +192,29 @@ } }; +/*! + * \brief The MAdjustUltrafiltrationConfirmReq class + * \details The ultrafiltration volume change user confirm request model + * + * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | + * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | + * |0x1500| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Change User Confirm | + * + * | Payload || + * | || + * | #1:(F32) | \ref volume | + * | #2:(U32) | \ref option | + * + * \sa Options + * + */ class MAdjustUltrafiltrationConfirmReq : public MModel { public: enum Options : quint32 { eDuration = Gui::GuiActions::UF_ADJ_TREATMENT_TIME, eRate = Gui::GuiActions::UF_ADJ_UF_RATE, - }; + }; + float volume = 0; Options option = eDuration; // coco begin validated : Has been validated manually. @@ -136,12 +228,30 @@ } }; +/*! + * \brief The MAdjustSalineReq class + * \details The model to request the Saline Bolus state + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| + * | 18 | 0x100 | 9 | Req | Y | UI | HD | Saline Bolus Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref requestedState | + * + * \sa State + * \sa MTreatmentSaline : Saline Bolus Data + * \sa MAdjustSalineResponse : Saline Bolus Response + * + */ class MAdjustSalineReq : public MModel { public: enum State { eStop = 0, eStart = 1, - }; + }; + State requestedState = eStop; // the requested state. Initially it's Stop => start. // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. @@ -154,6 +264,19 @@ } }; +/*! + * \brief The MAlarmSilenceReq class + * \details The model to request alarm silent + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| + * | | | | Req | Y | UI | HD | Alarm Silent Request | + * + * | Payload || + * | || + * | #1:(U32) | TBD | + * + */ class MAlarmSilenceReq : public MModel { public: bool state = 0;