/*! * * Copyright (c) 2022-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 MTreatmentBloodFlowData.h * \author (last) Dara Navaei * \date (last) 08-May-2024 * \author (original) Michael Garthwaite * \date (original) 09-Feb-2022 * */ #pragma once // Qt #include // Project #include "MAbstract.h" #include "types.h" // forward declarations class tst_models; namespace Model { /*! * \brief The MBloodFlow class * \details The blood flow data model * * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | * |0x1100| 0x100 | 7 | 1 Hz | N | TD | All | Blood Flow Data | * * | Payload || * | || * | #1 :(S32) | \ref Data:: mH4SetFlowRate | * | #2 :(F32) | \ref Data:: mH4MeasFlow | * | #3 :(F32) | \ref Data:: mH4MeasRotorSpd | * | #4 :(F32) | \ref Data:: mH4MeasPumpSpd | * | #5 :(F32) | \ref Data:: mH4MeasCurr | * | #6 :(F32) | \ref Data:: mH4SetRPM | * | #7 :(U32) | \ref Data:: mH4RotorCount | * | #8 :(U32) | \ref Data:: mH4PresFlow | * | #9 :(U32) | \ref Data:: mH6RotorHallState | * * \sa Data * *

Logging info

* | || * | || * | typeText | Datum | * | unitText | TD | * | infoText | BloodFlow | * */ class MBloodFlow : public MAbstract { // friends friend class ::tst_models; struct { Types::S32 mH4SetFlowRate ; ///< Set flow rate in mL/min. Types::F32 mH4MeasFlow ; ///< Measured flow rate in mL/min. Types::F32 mH4MeasRotorSpd ; ///< Measured rotor speed in RPM. Types::F32 mH4MeasPumpSpd ; ///< Measured pump speed in RPM. Types::F32 mH4MeasCurr ; ///< Measure motor current in Amps. Types::F32 mH4SetRPM ; ///< Set motor speed in RPM. Types::U32 mH4RotorCount ; ///< Rotor count. Types::U32 mH4PresFlow ; ///< Prescribed blood flow in mL/min. Types::U32 mH6RotorHallState ; ///< Rotor hall state (1=home, 0=not home) } _data; QVariantList parameters() const override; public: Type_Enum typeText () const override { return Type_Enum::eDatum ; } Unit_Enum unitText () const override { return Unit_Enum::eTD ; } QString infoText () const override { return QString("BloodFlow"); } struct Data { qint32 mSetFlowRate = 0; ///< Set flow rate in mL/min. float mMeasFlow = 0; ///< Measured flow rate in mL/min. float mMeasRotorSpd = 0; ///< Measured rotor speed in RPM. float mMeasPumpSpd = 0; ///< Measured pump speed in RPM. float mMeasCurr = 0; ///< Measure motor current in Amps. float mSetRPM = 0; ///< Set motor speed in RPM. quint32 mRotorCount = 0; ///< Rotor count. quint32 mPresFlow = 0; ///< Prescribed blood flow in mL/min. quint32 mRotorHallState = 0; ///< Rotor hall state (1=home, 0=not home) }; MBloodFlow() { } bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data() const; }; } typedef Model:: MBloodFlow::Data BloodFlowData;