/*! * * Copyright (c) 2019-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 MTreatmentFlowsData.h * \author (last) Michael Garthwaite * \date (last) 09-Feb-2022 * \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 MDialysateFlow class * \details The dialysate flow data model * * | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | * |:----:|:------:|:---:|:------:|:---:|:---:|:---:|:-----------: | * |0x0800| 0x040 | 7 | 1 Hz | N | HD | All | Dialysate Flow Data | * * | Payload || * | || * | #1:(S32) | \ref Data::mFlowSetPoint | * | #2:(F32) | \ref Data::mMeasuredFlow | * | #3:(F32) | \ref Data::mRotorSpeed | * | #4:(F32) | \ref Data::mMotorSpeed | * | #5:(F32) | \ref Data::mMotorCtlSpeed | * | #6:(F32) | \ref Data::mMotorCtlCurrent | * | #7:(F32) | \ref Data::mPWMDutyCycle | * * \sa Data * *

Logging info

* | || * | || * | typeText | Datum | * | unitText | HD | * | infoText | DialysateFlow | * */ class MDialysateFlow : public MAbstract { // friends friend class ::tst_models; QVariantList parameters() const override; struct { Types::S32 mFlowSetPoint ; ///< Flow Set Point Types::F32 mMeasuredFlow ; ///< Measured Flow Types::F32 mRotorSpeed ; ///< Rotor Speed Types::F32 mMotorSpeed ; ///< Motor Speed Types::F32 mMotorCtlSpeed ; ///< Motor Controller Speed Types::F32 mMotorCtlCurrent ; ///< Motor Controller Current Types::F32 mPWMDutyCycle ; ///< PWM Duty Cycle in % } _data; public: Type_Enum typeText () const override { return Type_Enum::eDatum; } Unit_Enum unitText () const override { return Unit_Enum::eHD ; } QString infoText () const override { return QString("DialysateFlow"); } struct Data { qint32 mFlowSetPoint = 0; ///< Flow Set Point float mMeasuredFlow = 0; ///< Measured Flow float mRotorSpeed = 0; ///< Rotor Speed float mMotorSpeed = 0; ///< Motor Speed float mMotorCtlSpeed = 0; ///< Motor Controller Speed float mMotorCtlCurrent = 0; ///< Motor Controller Current float mPWMDutyCycle = 0; ///< PWM Duty Cycle in % }; MDialysateFlow() { } bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr) override; Data data() const; }; } typedef Model::MDialysateFlow::Data DialysateFlowData;