Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 -r741b1c70f851810f2c265cdd38dfa158b7ee0c37 --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 741b1c70f851810f2c265cdd38dfa158b7ee0c37) @@ -25,7 +25,6 @@ namespace Model { - /*! * Simple request models * These are models to send the request for the doAdjustment @@ -232,9 +231,9 @@ * \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 | + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| + * |0x1200| 0x100 | 9 | Req | Y | UI | HD | Saline Bolus Request | * * | Payload || * | || @@ -247,17 +246,7 @@ */ class MAdjustSalineReq : public MModel { public: - /*! - * \brief The State enum - * \details The saline bolus requested state. - * There is no FW shared enum for this so has been defined here as documented in "Messages List". - */ - enum State { - eStop = 0, - eStart = 1, - }; - - State requestedState = eStop; // the requested state. Initially it's Stop => start. + GuiSalineCommands requestedState = GuiSalineCommands::SALINE_CMD_STOP; // 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. QString toString() { @@ -270,32 +259,337 @@ }; /*! + * \brief The MAdjustHeparinReq class + * \details The model to request the Heparin state + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------:| + * |0x4B00| 0x100 | 9 | Req | Y | UI | HD | Heparin Request | + * + * | Payload || + * | || + * | #1:(U32) | \ref requestedState | + * + * \sa State + * \sa MTreatmentHeparin : Heparin Data + * \sa MAdjustHeparinResponse : Heparin Response + * + */ +class MAdjustHeparinReq : public MModel { +public: + GuiHeparinCommands requestedState = GuiHeparinCommands::HEPARIN_CMD_PAUSE ; // the requested state. Initially it's running with Initial Bolus. + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({requestedState}); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustHeparin", vParameters); + } +}; + +/*! + * \brief The MAdjustPressuresLimitsReq class + * \details The model to request the pressures limits adjustment + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------------------:| + * |0x4600| 0x100 | 9 | Req | Y | UI | HD | A/V BP Limit Change Request | + * + * | Payload ||| + * | ||| + * | #1:(S32) | \ref mArterialLimitLow | (mmHg) | + * | #2:(S32) | \ref mArterialLimitHigh | (mmHg) | + * | #3:(S32) | \ref mVenousLimitLow | (mmHg) | + * | #4:(S32) | \ref mVenousLimitHigh | (mmHg) | + * + * \sa MPressureOcclusion : Pressure data broadcast + * \sa MAdjustPressuresResponse : Pressures limit adjustment response + * + */ +class MAdjustPressuresLimitsReq : public MModel { + +public: + static const qint32 ArterialLimitLowDef = -300; // PRS354 manufacturing default + static const qint32 ArterialLimitHighDef = +100; // PRS355 manufacturing default + static const qint32 VenousLimitLowDef = -100; // PRS356 manufacturing default + static const qint32 VenousLimitHighDef = +400; // PRS357 manufacturing default + +public: + qint32 mArterialLimitLow = ArterialLimitLowDef ; ///< (S32) Arterial Pressure Limit Low (mmHg) + qint32 mArterialLimitHigh = ArterialLimitHighDef; ///< (S32) Arterial Pressure Limit High (mmHg) + qint32 mVenousLimitLow = VenousLimitLowDef ; ///< (S32) Venous Pressure Limit Low (mmHg) + qint32 mVenousLimitHigh = VenousLimitHighDef ; ///< (S32) Venous Pressure Limit High (mmHg) + + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString + ({ mArterialLimitLow , + mArterialLimitHigh , + mVenousLimitLow , + mVenousLimitHigh + }); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AdjustPressuresLimits", vParameters); + } +}; + +/*! * \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 | + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-----------------------:| + * |0x3200| 0x100 | 9 | Req | Y | UI | HD | Alarm (de)Silent Request | * * | Payload || * | || - * | #1:(U32) | TBD | + * | #1:(U08) | silence | * */ class MAlarmSilenceReq : public MModel { public: - bool state = 0; + quint8 silence = 1; // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { - return toString({state}); + return toString({silence}); } // coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AlarmSilence", vParameters); } }; +/*! + * \brief The MAlarmClearedConditionReq class + * \details The model to tell HD an alarm has been acknowledged + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:----------:|:-----:|:----:|:---:|:---:|:----:|:------------------------:| + * |0x3F00| 0x001,2,4 | N/A | Cmd | Y | UI | HD | Alarm Condition Cleared | + * + * | Payload || + * | || + * | #1:(U32) | \ref alarmID | + * + */ +// coco begin validated: Manually tested. This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. +class MAlarmClearedConditionReq : public MModel { +public: + GuiAlarmID alarmID = GuiAlarmID::ALARM_ID_NO_ALARM; + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({alarmID}); + } + // coco end + // coco begin validate : + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AlarmCondition", vParameters); + } +}; +// coco end +/*! + * \brief The MAlarmUserActionReq class + * \details The model to tell HD an alarm action has been made by user + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:------------------:| + * |0x4000| 0x100 | N/A | Cmd | Y | UI | HD | Alarm User Action | + * + * | Payload || + * | || + * | #1:(U32) | \ref action | + * + */ +class MAlarmUserActionReq : public MModel { +public: + GuiAlarmUserActions action; + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({action}); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("AlarmUserAction", vParameters); + } +}; + +/*! + * \brief The MStartTreatmentReq class + * \details The model to request starting a treatment + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| + * | 56 | 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 MEndTreatmentReq class + * \details The model to request an end to treatment + * + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:-------------------------:| + * | 60 | 0x100 | 9 | Req | Y | UI | HD | End Treatment Request | + * + * | Payload || + * | || + * | N/A || + * + */ +class MEndTreatmentReq : public MModel { +public: + + // coco begin validated : Has been validated manually. + // This object is used statically for now, kept the logic for later usage. + QString toString() { + return toString({}); + } + // coco end + static QString toString(const QVariantList &vParameters) { + return MModel::toString("EndTreatment", 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; @@ -305,5 +599,12 @@ typedef Model:: MAdjustUltrafiltrationEditReq AdjustUltrafiltrationEditRequestData; typedef Model::MAdjustUltrafiltrationConfirmReq AdjustUltrafiltrationConfirmRequestData; typedef Model:: MAdjustSalineReq AdjustSalineRequestData; - +typedef Model:: MAdjustHeparinReq AdjustHeparinRequestData; +typedef Model:: MAdjustPressuresLimitsReq AdjustPressuresLimitsRequestData; +typedef Model:: MStartTreatmentReq StartTreatmentRequestData; +typedef Model:: MConfirmTreatmentReq ConfirmTreatmentRequestData; +typedef Model:: MEndTreatmentReq EndTreatmentRequestData; +typedef Model:: MAdjustTreatmentParametersReq AdjustTreatmentParametersRequestData; typedef Model:: MAlarmSilenceReq AlarmSilenceRequestData; +typedef Model:: MAlarmClearedConditionReq AlarmClearedConditionRequestData; +typedef Model:: MAlarmUserActionReq AlarmUserActionRequestData;