Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -rc15ce613e372838316d42c40a86953e6f0aa05d3 -re0412efcf85964a18ec52ad80f233c45998eb45a --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision c15ce613e372838316d42c40a86953e6f0aa05d3) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision e0412efcf85964a18ec52ad80f233c45998eb45a) @@ -19,6 +19,7 @@ #include //project +#include "MAdjustRequestsBase.h" #include "GuiGlobals.h" #include "MessageGlobals.h" using namespace Gui; @@ -32,32 +33,6 @@ * Otherwise the parameters are so tiny models. */ -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(',')); - } - -public: - /*! - * \brief canid returns the default channel id of the message. - * it can be modified by the specific message which inherits the MModel. - * \return Can::Can_Id - */ - static Can::Can_Id canid () { return Can::Can_Id::eChlid_UI_HD; } - -}; - /*! * \brief The MAdjustPowerOffReq class * \details The power off request model @@ -146,33 +121,6 @@ }; /*! - * \brief The MAdjustUltrafiltrationEditReq class - * \details The ultrafiltration volume change request model - * - * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | - * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | - * |0x4F00| 0x100 | 9 | Req | Y | UI | HD | UF Vol. Initial Adjustment Request | - * - * | Payload || - * | || - * | #1:(F32) | \ref volume | - * - */ -class MAdjustUltrafiltrationInitReq : public MModel { -public: - float volume = 0; - // coco begin validated : Has been validated manually. - // This object is used statically for now, kept the logic for later usage. - QString toString() { - return toString({volume}); - } - // coco end - static QString toString(const QVariantList &vParameters) { - return MModel::toString("AdjustUFInit", vParameters); - } -}; - -/*! * \brief The MAdjustUltrafiltrationStateReq class * \details The ultrafiltration pause/resume request model * @@ -554,6 +502,7 @@ } }; // coco end + /*! * \brief The MAlarmUserActionReq class * \details The model to tell HD an alarm action has been made by user @@ -581,154 +530,11 @@ } }; -/*! - * \brief The MStartTreatmentReq class - * \details The model to request starting a treatment - * - * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | - * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| - * |0x3800| 0x100 | 9 | Req | Y | UI | HD | Start Treatment Request | - * - * | Payload || - * | || - * | #1:(U32) | \ref request | - * - */ -class MStartTreatmentReq : public MModel { -public: - enum Options { - eSelectParams = 0, - eCancel = 1, - eStartTreatment = 2 - }; - Options request = eSelectParams; - // coco begin validated : Has been validated manually. - // This object is used statically for now, kept the logic for later usage. - QString toString() { - return toString({request}); - } - // coco end - static QString toString(const QVariantList &vParameters) { - return MModel::toString("StartTreatment", vParameters); - } -}; - -/*! - * \brief The MConfirmTreatmentReq class - * \details The model to tell HD treatment parameters have been confirmed - * - * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | - * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| - * | 56 | 0x100 | 9 | Req | Y | UI | HD | Confirm Treatment Request | - * - * | Payload || - * | || - * | #1:(U32) | \ref request | - * - */ -class MConfirmTreatmentReq : public MModel { -public: - enum Options { - eCancel = 0, - eConfirm = 1 - }; - Options request = eConfirm; - // coco begin validated : Has been validated manually. - // This object is used statically for now, kept the logic for later usage. - QString toString() { - return toString({request}); - } - // coco end - static QString toString(const QVariantList &vParameters) { - return MModel::toString("ConfirmTreatment", vParameters); - } -}; - -/*! - * \brief The MAdjustTreatmentParametersReq class - * \details The model used to request treatment parameters validation - * - * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | - * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| - * | 60 | 0x100 | 9 | Req | Y | UI | HD | New Treatment Parameters Request | - * - * | Payload || - * | || - * | #1:(U32) | \ref bloodFlowRate | - * | #2:(U32) | \ref dialysateFlowRate | - * | #3:(U32) | \ref duration | - * | #4:(U32) | \ref heparinStopTime | - * | #5:(U32) | \ref salineBolus | - * | #6:(U32) | \ref acidConcentrate | - * | #7:(U32) | \ref bicarbonateConcentrate | - * | #8:(U32) | \ref dialyzerType | - * | #9:(U32) | \ref bloodPressureMeasureInterval | - * | #10:(U32) | \ref rinsebackFlowRate | - * | #11:(S32) | \ref arterialPressureLimitLow | - * | #12:(S32) | \ref arterialPressureLimitHigh | - * | #13:(S32) | \ref venousPressureLimitLow | - * | #14:(S32) | \ref venousPressureLimitHigh | - * | #15:(F32) | \ref heparinDispensingRate | - * | #16:(F32) | \ref heparinBolusVolume | - * | #17:(F32) | \ref dialysateTemp | - * - */ -class MAdjustTreatmentParametersReq : public MModel { -public: - - quint32 bloodFlowRate = 0; // mL/min - quint32 dialysateFlowRate = 0; // mL/min - quint32 duration = 0; // minutes - quint32 heparinStopTime = 0; // min - quint32 salineBolus = 0; // mL - quint32 acidConcentrate = 0; // - quint32 bicarbonateConcentrate = 0; // - quint32 dialyzerType = 0; // - quint32 bloodPressureMeasureInterval = 0; // minutes - quint32 rinsebackFlowRate = 0; // mL/min - qint32 arterialPressureLimitLow = 0; // mmHg - qint32 arterialPressureLimitHigh = 0; // mmHg - qint32 venousPressureLimitLow = 0; // mmHg - qint32 venousPressureLimitHigh = 0; // mmHg - float heparinDispensingRate = 0; // mL/hr - float heparinBolusVolume = 0; // mL - float dialysateTemp = 0; // Celsius - - // coco begin validated : Has been validated manually. - // This object is used statically for now, kept the logic for later usage. - QString toString() { - return toString({ - bloodFlowRate , - dialysateFlowRate , - duration , - heparinStopTime , - salineBolus , - acidConcentrate , - bicarbonateConcentrate , - dialyzerType , - bloodPressureMeasureInterval , - rinsebackFlowRate , - arterialPressureLimitLow , - arterialPressureLimitHigh , - venousPressureLimitLow , - venousPressureLimitHigh , - heparinDispensingRate , - heparinBolusVolume , - dialysateTemp , - }); - } - // coco end - static QString toString(const QVariantList &vParameters) { - return MModel::toString("AdjustTreatmentParametersRequest", vParameters); - } -}; - } typedef Model:: MAdjustPowerOffReq AdjustPowerOffRequestData; typedef Model:: MAdjustBloodDialysateReq AdjustBloodDialysateRequestData; typedef Model:: MAdjustDurationReq AdjustDurationRequestData; -typedef Model:: MAdjustUltrafiltrationInitReq AdjustUltrafiltrationInitRequestData; typedef Model:: MAdjustUltrafiltrationStateReq AdjustUltrafiltrationStateRequestData; typedef Model:: MAdjustUltrafiltrationEditReq AdjustUltrafiltrationEditRequestData; typedef Model::MAdjustUltrafiltrationConfirmReq AdjustUltrafiltrationConfirmRequestData; @@ -738,9 +544,6 @@ typedef Model:: MAdjustRecirculateReq AdjustRecirculateRequestData; typedef Model:: MAdjustTreatmentEndReq AdjustTreatmentEndRequestData; typedef Model:: MAdjustPressuresLimitsReq AdjustPressuresLimitsRequestData; -typedef Model:: MStartTreatmentReq StartTreatmentRequestData; -typedef Model:: MConfirmTreatmentReq ConfirmTreatmentRequestData; -typedef Model:: MAdjustTreatmentParametersReq AdjustTreatmentParametersRequestData; typedef Model:: MAdjustVersionsReq AdjustVersionsRequestData; // Alarms typedef Model:: MAlarmSilenceReq AlarmSilenceRequestData;