/*! * * Copyright (c) 2021-2022 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 MTreatmentAdjustRequests.h * \author (last) Behrouz NematiPour * \date (last) 07-Oct-2022 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * */ #pragma once // Qt #include //project #include "MAdjustRequestsBase.h" #include "GuiGlobals.h" #include "MessageGlobals.h" using namespace Gui; namespace Model { /*! * Simple request models * These are models to send the request for the doAdjustment * The the only reason thy have been defined to help overloading the adjustment methods * Otherwise the parameters are so tiny models. */ /*! * \brief The MAdjustPowerOffReq class * \details The power off request model * * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | * |0x0100| 0x020 | 6 | Cmd | N | UI | HD | Power Off | * * | Payload || * | || * | #1:(U08) | \ref state | * * */ class MAdjustPowerOffReq : public MModel { public: quint8 state; // disabled 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}); } // disabled coco end explicit MAdjustPowerOffReq(quint8 vState) : state(vState) { } static QString toString(const QVariantList &vParameters) { return MModel::toString("PowerOff", vParameters); } }; /*! * \brief The MDuetConfirmUIr class * \details The power off request model * * | MSG | CAN ID | Type | Ack | Src | Dst | Description | * |:----:|:------:|:------:|:---:|:---:|:---:|:-----------: | * |0x0100| 0x020 | Rsp | Y | UI | HD | Confirm | * * | Payload || * | || * | #1:(U08) | \ref state | * * */ class MDuetConfirmUIr : public MModel { public: quint32 mId = 0; /*!< Request ID */ quint32 mConfirm = 0; /*!< user confirm */ // disabled coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({mId, mConfirm}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("Confirm", vParameters); } }; /*! * \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; quint32 dialysateFlow = 0; // disabled coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({bloodFlow , dialysateFlow}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustBloodDialysate", vParameters); } }; /*! * \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; // disabled coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({duration}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustDuration", vParameters); } }; /*! * \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: GuiUFCommands requestedState = GuiUFCommands::UF_CMD_PAUSE; // the requested state. Initially it's running => paused. // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFState", vParameters); } }; /*! * \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; // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFEdit", vParameters); } }; /*! * \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; // disabled 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 , option}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustUFConfirm", vParameters); } }; /*! * \brief The MAdjustSalineReq class * \details The model to request the Saline Bolus state * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:--------------------:| * |0x1200| 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: GuiSalineCommands requestedState = GuiSalineCommands::SALINE_CMD_STOP; // the requested state. Initially it's Stop => start. // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustSaline", vParameters); } }; /*! * \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. // disabled 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}); } // disabled 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 = 0; // PRS355 manufacturing default static const qint32 VenousLimitLowDef = +20; // 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) // disabled 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 }); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustPressuresLimits", vParameters); } }; /*! * \brief The MAdjustRinsebackReq class * \details The model to request the Rinseback state * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------: | * |0x5200| 0x100 | 9 | Req | Y | UI | HD | Rinseback Request | * * | Payload || * | || * | #1:(U32) | \ref requestedState | * * \sa State * \sa MTreatmentRinseback : Rinseback Data * \sa MAdjustRinsebackResponse : Rinseback Response * */ class MAdjustRinsebackReq : public MModel { public: GuiRinsebackCommands requestedState = GuiRinsebackCommands::REQUESTED_USER_ACTION_RINSEBACK_CONFIRM_START; // the requested state. // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustRinseback", vParameters); } }; /*! * \brief The MAdjustRecirculateReq class * \details The model to request the Recirculate state * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------: | * |0x5400| 0x100 | 9 | Req | Y | UI | HD | Recirculate Request | * * | Payload || * | || * | #1:(U32) | \ref requestedState | * * \sa State * \sa MTreatmentRecirculate : Recirculate Data * \sa MAdjustRecirculateResponse : Recirculate Response * */ class MAdjustRecirculateReq : public MModel { public: GuiRecirculateCommands requestedState = GuiRecirculateCommands::REQUESTED_USER_ACTION_TX_RECIRC_RECONNECT; // the requested state. // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustRecirculate", vParameters); } }; /*! * \brief The MAdjustTreatmentEndReq class * \details The model to request the Rinseback state * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:---------------: | * |0x5700| 0x100 | 9 | Req | Y | UI | HD | Treatment End Request | * * | Payload || * | || * | #1:(U32) | \ref requestedState | * * \sa State * \sa MTreatmentEnd : Treatment End Data * \sa MAdjustTreatmentEndResponse : Treatment End Response * */ class MAdjustTreatmentEndReq : public MModel { public: GuiTreatmentEndCommands requestedState = GuiTreatmentEndCommands::REQUESTED_USER_ACTION_TX_END_RINSEBACK_START; // the requested state. // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AdjustTxEnd", vParameters); } }; //// ---------- Alarms /*! * \brief The MAlarmSilenceReq class * \details The model to request alarm silent * * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-----------------------:| * |0x3200| 0x100 | 9 | Req | Y | UI | HD | Alarm (de)Silent Request | * * | Payload || * | || * | #1:(U32) | silence | * */ class MAlarmSilenceReq : public MModel { public: quint32 silence = 1; // disabled coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { return toString({silence}); } // disabled 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 | * */ // disabled 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; // disabled 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}); } // disabled coco end // coco begin validate : static QString toString(const QVariantList &vParameters) { return MModel::toString("AlarmCondition", vParameters); } }; // disabled 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; // disabled 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}); } // disabled coco end static QString toString(const QVariantList &vParameters) { return MModel::toString("AlarmUserAction", vParameters); } }; } typedef Model:: MDuetConfirmUIr DuetConfirmUIrData; typedef Model:: MAdjustPowerOffReq AdjustPowerOffRequestData; typedef Model:: MAdjustBloodDialysateReq AdjustBloodDialysateRequestData; typedef Model:: MAdjustDurationReq AdjustDurationRequestData; typedef Model:: MAdjustUltrafiltrationStateReq AdjustUltrafiltrationStateRequestData; typedef Model:: MAdjustUltrafiltrationEditReq AdjustUltrafiltrationEditRequestData; typedef Model::MAdjustUltrafiltrationConfirmReq AdjustUltrafiltrationConfirmRequestData; typedef Model:: MAdjustSalineReq AdjustSalineRequestData; typedef Model:: MAdjustHeparinReq AdjustHeparinRequestData; typedef Model:: MAdjustRinsebackReq AdjustRinsebackRequestData; typedef Model:: MAdjustRecirculateReq AdjustRecirculateRequestData; typedef Model:: MAdjustTreatmentEndReq AdjustTreatmentEndRequestData; typedef Model:: MAdjustPressuresLimitsReq AdjustPressuresLimitsRequestData; // Alarms typedef Model:: MAlarmSilenceReq AlarmSilenceRequestData; typedef Model:: MAlarmClearedConditionReq AlarmClearedConditionRequestData; typedef Model:: MAlarmUserActionReq AlarmUserActionRequestData;