/*! * * Copyright (c) 2019-2020 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 mflows.h * \date 3/9/2020 * \author Behrouz NematiPour * */ #pragma once // Qt #include // Project #include "types.h" namespace Model { /*! * \brief The Flow Data class */ class MFlow { public: QString stringPrefix = ""; private: struct Data { Types::S32 mFlowSetPoint ; /*!< vFlowSetPoint - Flow Set Point value of type signed int extracted out */ Types::F32 mMeasuredFlow ; /*!< vMeasuredFlow - Measured Flow value of type float extracted out */ Types::F32 mRotorSpeed ; /*!< vRotorSpeed - Rotor Speed value of type float extracted out */ Types::F32 mMotorSpeed ; /*!< vMotorSpeed - Motor Speed value of type float extracted out */ Types::F32 mMotorCtlSpeed ; /*!< vMotorCtlSpeed - Motor Controller Speed value of type float extracted out */ Types::F32 mMotorCtlCurrent ; /*!< vMotorCtlCurrent - Motor Controller Current value of type float extracted out */ Types::F32 mPWMDutyCycle ; /*!< vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out */ } _data; public: MFlow () { } QString toString ( ) const ; void toVariantList ( QVariantList &vData ) const ; void fromByteArray (const QByteArray &vByteArray ); const Data &data() const ; }; /*! * \brief The Blood Flow Data class */ class MBloodFlow : public MFlow { public: struct Data { qint32 mFlowSetPoint = 0; /*!< vFlowSetPoint - Flow Set Point value of type signed int extracted out */ float mMeasuredFlow = 0; /*!< vMeasuredFlow - Measured Flow value of type float extracted out */ float mRotorSpeed = 0; /*!< vRotorSpeed - Rotor Speed value of type float extracted out */ float mMotorSpeed = 0; /*!< vMotorSpeed - Motor Speed value of type float extracted out */ float mMotorCtlSpeed = 0; /*!< vMotorCtlSpeed - Motor Controller Speed value of type float extracted out */ float mMotorCtlCurrent = 0; /*!< vMotorCtlCurrent - Motor Controller Current value of type float extracted out */ float mPWMDutyCycle = 0; /*!< vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out */ }; MBloodFlow() { stringPrefix = "Blood Flow"; } Data data() const; }; /*! * \brief The Dialysate Flow Data class */ class MDialysateFlow : public MFlow { public: struct Data { qint32 mFlowSetPoint = 0; /*!< vFlowSetPoint - Flow Set Point value of type signed int extracted out */ float mMeasuredFlow = 0; /*!< vMeasuredFlow - Measured Flow value of type float extracted out */ float mRotorSpeed = 0; /*!< vRotorSpeed - Rotor Speed value of type float extracted out */ float mMotorSpeed = 0; /*!< vMotorSpeed - Motor Speed value of type float extracted out */ float mMotorCtlSpeed = 0; /*!< vMotorCtlSpeed - Motor Controller Speed value of type float extracted out */ float mMotorCtlCurrent = 0; /*!< vMotorCtlCurrent - Motor Controller Current value of type float extracted out */ float mPWMDutyCycle = 0; /*!< vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out */ }; MDialysateFlow() { stringPrefix = "Dialysate Flow"; } Data data() const; }; } typedef Model:: MBloodFlow::Data BloodFlowData; typedef Model::MDialysateFlow::Data DialysateFlowData;