Index: denali.pro =================================================================== diff -u -r805119c460b4a266d6401c8705f4427e7fbe270f -r296e0e140bfeb193a9f571873afa6934143b1075 --- denali.pro (.../denali.pro) (revision 805119c460b4a266d6401c8705f4427e7fbe270f) +++ denali.pro (.../denali.pro) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -1,6 +1,7 @@ QT += widgets qml quick serialbus concurrent CONFIG += c++17 warn_on QMAKE_CXXFLAGS += -Wall -Werror +# -save-temps #CONFIG += disable_crc disable_crc { @@ -27,8 +28,10 @@ INCLUDEPATH += \ sources \ + sources/model \ sources/storage \ sources/gui \ + sources/gui/view \ sources/canbus \ sources/utility \ sources/abstract @@ -48,8 +51,10 @@ sources/gui/guiglobals.h \ sources/gui/guiview.h \ sources/gui/guicontroller.h \ + sources/gui/view/vtreatmentflows.h \ sources/main.h \ sources/maintimer.h \ + sources/model/model.h \ sources/storage/filehandler.h \ sources/storage/logger.h \ # sources/storage/settings.h \ @@ -75,7 +80,9 @@ sources/gui/guiglobals.cpp \ sources/gui/guiview.cpp \ sources/gui/guicontroller.cpp \ + sources/gui/view/vtreatmentflows.cpp \ sources/maintimer.cpp \ + sources/model/model.cpp \ sources/storage/filehandler.cpp \ sources/storage/logger.cpp \ # sources/storage/settings.cpp \ Index: sources/applicationcontroller.cpp =================================================================== diff -u -rc478cd2996c772529cc43606d35157f54ea8de7d -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision c478cd2996c772529cc43606d35157f54ea8de7d) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -97,6 +97,12 @@ connect(&_MessageDispatcher, SIGNAL(didActionReceive(GuiActionType, const QVariantList &)), this , SLOT( onActionReceive(GuiActionType, const QVariantList &))); + connect(&_MessageDispatcher, SIGNAL(didActionReceive(const BloodFlowData &)), + this , SLOT( onActionReceive(const BloodFlowData &))); + connect(&_MessageDispatcher, SIGNAL(didActionReceive(const DialysateFlowData &)), + this , SLOT( onActionReceive(const DialysateFlowData &))); + + connect(&_GuiController , SIGNAL(didUSBDriveUmount()), this , SLOT( onUSBDriveUmount())); connect(&_USBWatcher , SIGNAL(didUSBDriveMount ()), @@ -109,6 +115,8 @@ connect(&_Logger , SIGNAL(didExport()), this , SLOT( onExport())); + + } /*! @@ -157,6 +165,14 @@ emit didActionTransmit(vAction, vData); } +void ApplicationController::onActionReceive(const BloodFlowData &vData){ + emit didActionReceive(vData); +} + +void ApplicationController::onActionReceive(const DialysateFlowData &vData){ + emit didActionReceive(vData); +} + /*! * \brief An action has been confirmed * \details GUI requested an action. Index: sources/applicationcontroller.h =================================================================== diff -u -rbb8f39a014644c70b832dd2a784f62fa9f6b6106 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision bb8f39a014644c70b832dd2a784f62fa9f6b6106) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -20,6 +20,7 @@ #include "main.h" #include "guiglobals.h" #include "applicationpost.h" +#include "model.h" // define #define _ApplicationController ApplicationController::I() @@ -61,6 +62,9 @@ void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void onActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG + void onActionReceive (const BloodFlowData &vData); + void onActionReceive (const DialysateFlowData &vData); + void onMainTimerTimeout(); void onUSBDriveMount (); @@ -74,6 +78,10 @@ void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG + void didActionReceive (const BloodFlowData &vData); // UI <= HD/DG + void didActionReceive (const DialysateFlowData &vData); // UI <= HD/DG + + void didUSBDriveMount (); void didUSBDriveUmount(); void didUSBDriveRemove(); Index: sources/canbus/messagedispatcher.cpp =================================================================== diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision a9c98aee00fd5339b969b353926dccf72b0d496f) +++ sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -102,6 +102,12 @@ connect(&_MessageAcknowModel , SIGNAL(didFailedTransmit( Sequence )), this , SLOT( onFailedTransmit( Sequence ))); + + // From HD -> Message interpreter + connect(&_interpreter , SIGNAL(didActionReceive ( const BloodFlowData &)), + this , SIGNAL(didActionReceive ( const BloodFlowData &))); + connect(&_interpreter , SIGNAL(didActionReceive ( const DialysateFlowData &)), + this , SIGNAL(didActionReceive ( const DialysateFlowData &))); } /*! Index: sources/canbus/messagedispatcher.h =================================================================== diff -u -r805119c460b4a266d6401c8705f4427e7fbe270f -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 805119c460b4a266d6401c8705f4427e7fbe270f) +++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -142,6 +142,9 @@ */ void didActionReceive (GuiActionType vAction , const QVariantList &vData); + void didActionReceive (const BloodFlowData &vData); + void didActionReceive (const DialysateFlowData &vData); + /*! * \brief didActionReceive * \details Emits when a message requires Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -rbb8f39a014644c70b832dd2a784f62fa9f6b6106 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision bb8f39a014644c70b832dd2a784f62fa9f6b6106) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -270,21 +270,11 @@ * \brief MessageInterpreter::getBloodFlowData * \details This is the method which interprets the Blood Flow message data in vMessage of type Message * to its elements of data. - * \param vMessage - The vMessage of type Message which contains all the data, require to be interpreted. - * \param vFlowSetPoint - Flow Set Point value of type signed int extracted out - * \param vMeasuredFlow - Measured Flow value of type float extracted out - * \param vRotorSpeed - Rotor Speed value of type float extracted out - * \param vMotorSpeed - Motor Speed value of type float extracted out - * \param vMotorCtlSpeed - Motor Controller Speed value of type float extracted out - * \param vMotorCtlCurrent - Motor Controller Current value of type float extracted out - * \param vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out + * \param vMessage - The vMessage of type Message which contains all the data, require to be interpreted. + * \param vData - The BloodFlow data * \return true if the message can be successfully converted to the Blood Flow data elements. */ -bool MessageInterpreter::getBloodFlowData( - const Message &vMessage , - Types::S32 &vFlowSetPoint , - Types::F32 &vMeasuredFlow , Types::F32 &vRotorSpeed , Types::F32 &vMotorSpeed, - Types::F32 &vMotorCtlSpeed , Types::F32 &vMotorCtlCurrent , Types::F32 &vPWMDtCycle) +bool MessageInterpreter::getBloodFlowData(const Message &vMessage, Model::BloodFlow &vData) { if ( vMessage.actionId != Gui::GuiActionType::BloodFlow ) { return false; @@ -295,14 +285,7 @@ return false; } - int index = 0; // message data start position - Types::getValue<>(vMessage.data, index, vFlowSetPoint ); - Types::getValue<>(vMessage.data, index, vMeasuredFlow ); - Types::getValue<>(vMessage.data, index, vRotorSpeed ); - Types::getValue<>(vMessage.data, index, vMotorSpeed ); - Types::getValue<>(vMessage.data, index, vMotorCtlSpeed ); - Types::getValue<>(vMessage.data, index, vMotorCtlCurrent); - Types::getValue<>(vMessage.data, index, vPWMDtCycle ); + vData.fromByteArray(vMessage.data); return true; } @@ -318,39 +301,13 @@ */ bool MessageInterpreter::bloodFlowData(const Message &vMessage, QVariantList &vData) { - bool ok; - Types::S32 mFlowSetPoint ; - Types::F32 mMeasuredFlow ; - Types::F32 mRotorSpeed ; - Types::F32 mMotorSpeed ; - Types::F32 mMotorCtlSpeed ; - Types::F32 mMotorCtlCurrent ; - Types::F32 mPWMDtCycle ; - ok = getBloodFlowData(vMessage , - mFlowSetPoint , - mMeasuredFlow , - mRotorSpeed , - mMotorSpeed , - mMotorCtlSpeed , - mMotorCtlCurrent , - mPWMDtCycle ); - LOG_DATUM(QString("Blood Flow(%1, %2, %3, %4, %5, %6, %7)") - .arg(mFlowSetPoint .value) - .arg(mMeasuredFlow .value) - .arg(mRotorSpeed .value) - .arg(mMotorSpeed .value) - .arg(mMotorCtlSpeed .value) - .arg(mMotorCtlCurrent .value) - .arg(mPWMDtCycle .value) - ); + bool ok; + Model::BloodFlow mData; + ok = getBloodFlowData(vMessage, mData); + LOG_DATUM(mData.toString()); if (ok) { - vData += mFlowSetPoint .value; - vData += mMeasuredFlow .value; - vData += mRotorSpeed .value; - vData += mMotorSpeed .value; - vData += mMotorCtlSpeed .value; - vData += mMotorCtlCurrent.value; - vData += mPWMDtCycle .value; + mData.toVariantList(vData); + emit didActionReceive(mData.data()); } return ok; } @@ -359,22 +316,11 @@ * \brief MessageInterpreter::getDialysateInletFlowData * \details This is the method which interprets the Dialysate Inlet Flow message data in vMessage of type Message * to its elements of data. - * \param vMessage - The vMessage of type Message which contains all the data, require to be interpreted. - * \param vFlowSetPoint - Flow Set Point value of type signed int extracted out - * \param vMeasuredFlow - Measured Flow value of type float extracted out - * \param vRotorSpeed - Rotor Speed value of type float extracted out - * \param vMotorSpeed - Motor Speed value of type float extracted out - * \param vMotorCtlSpeed - Motor Controller Speed value of type float extracted out - * \param vMotorCtlCurrent - Motor Controller Current value of type float extracted out - * \param vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out + * \param vMessage - The vMessage of type Message which contains all the data, require to be interpreted. + * \param vData - The dialydate flow data * \return true if the message can be successfully converted to the Blood Flow data elements. */ -bool MessageInterpreter::getDialysateInletFlowData( - const Message &vMessage , - Types::S32 &vFlowSetPoint , - Types::F32 &vMeasuredFlow , Types::F32 &vRotorSpeed , Types::F32 &vMotorSpeed, - Types::F32 &vMotorCtlSpeed , Types::F32 &vMotorCtlCurrent , Types::F32 &vPWMDtCycle) - +bool MessageInterpreter::getDialysateInletFlowData(const Message &vMessage, Model::DialysateFlow &vData) { if ( vMessage.actionId != Gui::GuiActionType::DialysateInletFlow ) { return false; @@ -385,14 +331,7 @@ return false; } - int index = 0; // message data start position - Types::getValue<>(vMessage.data, index, vFlowSetPoint ); - Types::getValue<>(vMessage.data, index, vMeasuredFlow ); - Types::getValue<>(vMessage.data, index, vRotorSpeed ); - Types::getValue<>(vMessage.data, index, vMotorSpeed ); - Types::getValue<>(vMessage.data, index, vMotorCtlSpeed ); - Types::getValue<>(vMessage.data, index, vMotorCtlCurrent); - Types::getValue<>(vMessage.data, index, vPWMDtCycle ); + vData.fromByteArray(vMessage.data); return true; } @@ -408,39 +347,13 @@ */ bool MessageInterpreter::dialysateInletFlowData(const Message &vMessage, QVariantList &vData) { - bool ok; - Types::S32 mFlowSetPoint ; - Types::F32 mMeasuredFlow ; - Types::F32 mRotorSpeed ; - Types::F32 mMotorSpeed ; - Types::F32 mMotorCtlSpeed ; - Types::F32 mMotorCtlCurrent ; - Types::F32 mPWMDtCycle ; - ok = getDialysateInletFlowData(vMessage , - mFlowSetPoint , - mMeasuredFlow , - mRotorSpeed , - mMotorSpeed , - mMotorCtlSpeed , - mMotorCtlCurrent , - mPWMDtCycle ); - LOG_DATUM(QString("Dialysate Inlet Flow(%1, %2, %3, %4, %5, %6, %7)") - .arg(mFlowSetPoint .value) - .arg(mMeasuredFlow .value) - .arg(mRotorSpeed .value) - .arg(mMotorSpeed .value) - .arg(mMotorCtlSpeed .value) - .arg(mMotorCtlCurrent .value) - .arg(mPWMDtCycle .value) - ); + bool ok; + Model::DialysateFlow mData; + ok = getDialysateInletFlowData(vMessage, mData); + LOG_DATUM(mData.toString()); if (ok) { - vData += mFlowSetPoint .value; - vData += mMeasuredFlow .value; - vData += mRotorSpeed .value; - vData += mMotorSpeed .value; - vData += mMotorCtlSpeed .value; - vData += mMotorCtlCurrent.value; - vData += mPWMDtCycle .value; + mData.toVariantList(vData); + emit didActionReceive(mData.data()); } return ok; } @@ -489,38 +402,6 @@ } /*! - * \brief MessageInterpreter::getDialysateOutletFlowData - * \param vMessage - The vMessage of type Message which contains all the data, require to be interpreted. - * \param vTotal - Total treatment time in sec - * \param vElapsed - Elapsed treatment time in sec - * \param vRemaining - Remaining treatment time in sec - * \return true if the message can be successfully converted to the Blood Flow data elements. - */ -bool MessageInterpreter::getTreatmentTime( - const Message &vMessage , - Types::U32 &vTotal , - Types::U32 &vElapsed , - Types::U32 &vRemaining ) - -{ - if ( vMessage.actionId != Gui::GuiActionType::TreatmentTime ) { - return false; - } - if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::TreatmentTime] ) { - QString mActionIdHexString = Format::toHexString(vMessage.actionId); - LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); - return false; - } - - int index = 0; // message data start position - Types::getValue<>(vMessage.data, index, vTotal ); - Types::getValue<>(vMessage.data, index, vElapsed ); - Types::getValue<>(vMessage.data, index, vRemaining ); - - return true; -} - -/*! * \brief MessageInterpreter::dialysateOutletFlowData * \details Used the getDialysateOutletFlowData method and converts each parameter * in vData of type QVaranitList, to be used in the GUI @@ -570,6 +451,38 @@ } /*! + * \brief MessageInterpreter::getDialysateOutletFlowData + * \param vMessage - The vMessage of type Message which contains all the data, require to be interpreted. + * \param vTotal - Total treatment time in sec + * \param vElapsed - Elapsed treatment time in sec + * \param vRemaining - Remaining treatment time in sec + * \return true if the message can be successfully converted to the Blood Flow data elements. + */ +bool MessageInterpreter::getTreatmentTime( + const Message &vMessage , + Types::U32 &vTotal , + Types::U32 &vElapsed , + Types::U32 &vRemaining ) + +{ + if ( vMessage.actionId != Gui::GuiActionType::TreatmentTime ) { + return false; + } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::TreatmentTime] ) { + QString mActionIdHexString = Format::toHexString(vMessage.actionId); + LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); + return false; + } + + int index = 0; // message data start position + Types::getValue<>(vMessage.data, index, vTotal ); + Types::getValue<>(vMessage.data, index, vElapsed ); + Types::getValue<>(vMessage.data, index, vRemaining ); + + return true; +} + +/*! * \brief MessageInterpreter::treatmentTime * \details Used the getTreatmentTime method and converts each parameter * in vData of type QVaranitList, to be used in the GUI Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -r426208cdb707400759bdc663b871ece9d1208aed -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 426208cdb707400759bdc663b871ece9d1208aed) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -18,6 +18,7 @@ // Project #include "messageglobals.h" +#include "model.h" namespace Can { @@ -40,18 +41,12 @@ bool getPowerOffData (const Message &vMessage , quint8 &vShowHide) __attribute_warn_unused_result__; // ---- BloodFlowData - bool getBloodFlowData (const Message &vMessage , - Types::S32 &vFlowSetPoint , - Types::F32 &vMeasuredFlow , Types::F32 &vRotorSpeed , Types::F32 &vMotorSpeed, - Types::F32 &vMotorCtlSpeed , Types::F32 &vMotorCtlCurrent , Types::F32 &vPWMDtCycle) __attribute_warn_unused_result__; - bool bloodFlowData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool getBloodFlowData (const Message &vMessage , Model::BloodFlow &vData) __attribute_warn_unused_result__; + bool bloodFlowData (const Message &vMessage , QVariantList &vData) __attribute_warn_unused_result__; // ---- Dialysate Inlet FlowData bool getDialysateInletFlowData - (const Message &vMessage , - Types::S32 &vFlowSetPoint , - Types::F32 &vMeasuredFlow , Types::F32 &vRotorSpeed , Types::F32 &vMotorSpeed, - Types::F32 &vMotorCtlSpeed , Types::F32 &vMotorCtlCurrent , Types::F32 &vPWMDtCycle) __attribute_warn_unused_result__; + (const Message &vMessage , Model::DialysateFlow &vData) __attribute_warn_unused_result__; bool dialysateInletFlowData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; @@ -85,7 +80,10 @@ bool interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload) __attribute_warn_unused_result__; signals: + void didActionReceive(const BloodFlowData &vData); + void didActionReceive(const DialysateFlowData &vData); + public slots: }; Index: sources/gui/guicontroller.cpp =================================================================== diff -u -r805119c460b4a266d6401c8705f4427e7fbe270f -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 805119c460b4a266d6401c8705f4427e7fbe270f) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -71,6 +71,11 @@ connect(&_ApplicationController, SIGNAL(didActionReceive (GuiActionType, const QVariantList &)), this , SLOT( onActionReceive (GuiActionType, const QVariantList &))); + connect(&_ApplicationController, SIGNAL(didActionReceive (const BloodFlowData &)), + this , SLOT( onActionReceive (const BloodFlowData &))); + connect(&_ApplicationController, SIGNAL(didActionReceive (const DialysateFlowData &)), + this , SLOT( onActionReceive (const DialysateFlowData &))); + // From OS : USB Drive has been removed physically. connect(&_ApplicationController, SIGNAL(didUSBDriveMount ()), this , SLOT( onUSBDriveMount ())); @@ -205,6 +210,9 @@ emit didActionReceive (vAction, vData); } +void GuiController::onActionReceive(const BloodFlowData &vData){ emit didActionReceive(vData); } +void GuiController::onActionReceive(const DialysateFlowData &vData){ emit didActionReceive(vData); } + /*! * \brief GuiController::onUSBDriveMount * \details emits didUSBDriveMount signal to notify other classes (GuiView) Index: sources/gui/guicontroller.h =================================================================== diff -u -rc6a09899d2e46dc0bda5a6b994aa257953626f97 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/guicontroller.h (.../guicontroller.h) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -19,6 +19,7 @@ // Project #include "main.h" #include "guiglobals.h" +#include "model.h" // define #define _GuiController GuiController::I() @@ -61,6 +62,10 @@ private slots: // Should be private for thread safety and is connected internally. void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG + void onActionReceive (const BloodFlowData &vData); // UI <= HD/DG + void onActionReceive (const DialysateFlowData &vData); // UI <= HD/DG + + void onUSBDriveMount (); // OS => UI void onUSBDriveRemove(); // OS => UI @@ -70,6 +75,9 @@ void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG + void didActionReceive (const BloodFlowData &vData); // UI <= HD/DG + void didActionReceive (const DialysateFlowData &vData); // UI <= HD/DG + void didUSBDriveMount (); void didUSBDriveUmount(); void didUSBDriveRemove(); Index: sources/gui/guiglobals.cpp =================================================================== diff -u -rc6a09899d2e46dc0bda5a6b994aa257953626f97 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision c6a09899d2e46dc0bda5a6b994aa257953626f97) +++ sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -19,6 +19,8 @@ // Project #include "logger.h" #include "guiview.h" +// Project - View +#include "vtreatmentflows.h" namespace Gui { QQuickView *_viewer = nullptr; @@ -35,6 +37,10 @@ qRegisterMetaType ("GuiAlarmID" ); qRegisterMetaType ("GuiAlarmPriority"); + + qRegisterMetaType < BloodFlowData >( "BloodFlowData" ); + qRegisterMetaType ("DialysateFlowData" ); + } /*! @@ -45,6 +51,8 @@ { qmlRegisterType ("Gui.View" , 0, 1, "GuiView"); qmlRegisterUncreatableType ("Gui.Actions", 0, 1, "GuiActions", QStringLiteral("Used only for enumerations no need to have an object")); + + qmlRegisterType ("Gui.VTreatmentFlows", 0, 1, "VTreatmentFlows"); } /*! Index: sources/gui/guiview.cpp =================================================================== diff -u -rbb8f39a014644c70b832dd2a784f62fa9f6b6106 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/guiview.cpp (.../guiview.cpp) (revision bb8f39a014644c70b832dd2a784f62fa9f6b6106) +++ sources/gui/guiview.cpp (.../guiview.cpp) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -15,7 +15,6 @@ // Project #include "guicontroller.h" -#include "guiglobals.h" // namespace using namespace Gui; @@ -42,7 +41,7 @@ connect(&_GuiController, SIGNAL(didActionReceive (GuiActionType, const QVariantList &)), this , SLOT( onActionReceive (GuiActionType, const QVariantList &))); - // since we don't have access to GuiView object because it is created in Qml. + // since we don't have access to this object because it is created in Qml. // Connection to the GuiController made here // It should be defined in the class which wants to connect to signal. connect(this , SIGNAL(didActionTransmit(GuiActionType,const QVariantList &)), Index: sources/gui/qml/main.qml =================================================================== diff -u -r56eea041fb0995182b3d3ea0c0ac19e4933a2d3d -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/qml/main.qml (.../main.qml) (revision 56eea041fb0995182b3d3ea0c0ac19e4933a2d3d) +++ sources/gui/qml/main.qml (.../main.qml) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -20,6 +20,11 @@ // C++ imports import Gui.View 0.1; import Gui.Actions 0.1; + +// TODO : When Testing data on Setting screen is removed +// This needs to be moved into the TreatmentFlows.qml +import Gui.VTreatmentFlows 0.1; + // Qml imports import "qrc:/globals" import "qrc:/pages" @@ -66,6 +71,10 @@ } } + // TODO : When Testing data on Setting screen is removed + // This needs to be moved into the TreatmentFlows.qml + VTreatmentFlows { id: vTreatmentFlows } + // ----- Follow the below Z order ----- // 1 - Screens // 1 - 1 Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -r732bc047743c99a157cf147f5313194867c1f5e3 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 732bc047743c99a157cf147f5313194867c1f5e3) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -79,62 +79,24 @@ font.pixelSize: Fonts.fontPixelTitle font.underline: true } - Text { - id: _BloodFlow_S32 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle + Repeater { + model: [ + vTreatmentFlows.bloodFlow_FlowSetPoint , + vTreatmentFlows.bloodFlow_MeasuredFlow .toFixed(2) , + vTreatmentFlows.bloodFlow_RotorSpeed .toFixed(2) , + vTreatmentFlows.bloodFlow_MotorSpeed .toFixed(2) , + vTreatmentFlows.bloodFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentFlows.bloodFlow_MotorCtlCurrent .toFixed(2) , + "%" + vTreatmentFlows.bloodFlow_PWMDutyCycle .toFixed(2) + ] + Text { + text: modelData + width: _BloodFlowColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } } - Text { - id: _BloodFlow_F32_1 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _BloodFlow_F32_2 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _BloodFlow_F32_3 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _BloodFlow_F32_4 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _BloodFlow_F32_5 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _BloodFlow_F32_6 - text: qsTr("") - width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } } Column { id: _DialysateInletFlowColumn @@ -151,62 +113,25 @@ font.pixelSize: Fonts.fontPixelTitle font.underline: true } - Text { - id: _DialysateInletFlow_S32 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle + Repeater { + model: [ + vTreatmentFlows.dialysateFlow_FlowSetPoint , + vTreatmentFlows.dialysateFlow_MeasuredFlow .toFixed(2) , + vTreatmentFlows.dialysateFlow_RotorSpeed .toFixed(2) , + vTreatmentFlows.dialysateFlow_MotorSpeed .toFixed(2) , + vTreatmentFlows.dialysateFlow_MotorCtlSpeed .toFixed(2) , + vTreatmentFlows.dialysateFlow_MotorCtlCurrent.toFixed(2) , + "%" + vTreatmentFlows.dialysateFlow_PWMDutyCycle .toFixed(2) + ] + Text { + id: _DialysateInletFlow_S32 + text: modelData + width: _DialysateInletFlowColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } } - Text { - id: _DialysateInletFlow_F32_1 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _DialysateInletFlow_F32_2 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _DialysateInletFlow_F32_3 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _DialysateInletFlow_F32_4 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _DialysateInletFlow_F32_5 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { - id: _DialysateInletFlow_F32_6 - text: qsTr("") - width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignRight - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } } Column { id: _DialysateOutletFlowColumn @@ -402,26 +327,6 @@ onDidActionReceive: { if ( ! visible ) return; switch(vAction) { - case GuiActions.BloodFlow: - _BloodFlow_S32 .text = vData[GuiActions.BloodFlow_FlowSetPoint ]; - _BloodFlow_F32_1.text = vData[GuiActions.BloodFlow_MeasuredFlow ].toFixed(2); - _BloodFlow_F32_2.text = vData[GuiActions.BloodFlow_RotorSpeed ].toFixed(2); - _BloodFlow_F32_3.text = vData[GuiActions.BloodFlow_MotorSpeed ].toFixed(2); - _BloodFlow_F32_4.text = vData[GuiActions.BloodFlow_MotorCtlSpeed ].toFixed(2); - _BloodFlow_F32_5.text = vData[GuiActions.BloodFlow_MotorCtlCurrent].toFixed(2); - _BloodFlow_F32_6.text = "%" + vData[GuiActions.BloodFlow_PWMDtCycle ].toFixed(2); - break; - - case GuiActions.DialysateInletFlow: - _DialysateInletFlow_S32 .text = vData[GuiActions.DialysateInletFlow_FlowSetPoint ]; - _DialysateInletFlow_F32_1.text = vData[GuiActions.DialysateInletFlow_MeasuredFlow ].toFixed(2); - _DialysateInletFlow_F32_2.text = vData[GuiActions.DialysateInletFlow_RotorSpeed ].toFixed(2); - _DialysateInletFlow_F32_3.text = vData[GuiActions.DialysateInletFlow_MotorSpeed ].toFixed(2); - _DialysateInletFlow_F32_4.text = vData[GuiActions.DialysateInletFlow_MotorCtlSpeed ].toFixed(2); - _DialysateInletFlow_F32_5.text = vData[GuiActions.DialysateInletFlow_MotorCtlCurrent ].toFixed(2); - _DialysateInletFlow_F32_6.text = "%" + vData[GuiActions.DialysateInletFlow_PWMDtCycle ].toFixed(2); - break; - case GuiActions.DialysateOutletFlow: _DialysateOutletFlow_F32_0.text = vData[GuiActions.DialysateOutletFlow_RefUFVol ].toFixed(2); _DialysateOutletFlow_F32_1.text = vData[GuiActions.DialysateOutletFlow_MeasUFVol ].toFixed(2); Index: sources/gui/qml/pages/treatment/TreatmentStart.qml =================================================================== diff -u -r94f7349bd073a732dba5295250fc0e26f740743c -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/qml/pages/treatment/TreatmentStart.qml (.../TreatmentStart.qml) (revision 94f7349bd073a732dba5295250fc0e26f740743c) +++ sources/gui/qml/pages/treatment/TreatmentStart.qml (.../TreatmentStart.qml) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -75,12 +75,6 @@ onDidActionReceive: { if ( ! visible ) return; switch(vAction) { - case GuiActions.BloodFlow: - _flowsTouchArea.textRectBloodFlow.label = vData[GuiActions.BloodFlow_MeasuredFlow].toFixed(bloodFlow_MeasuredFlow_Precision); - break - case GuiActions.DialysateInletFlow: - _flowsTouchArea.textRectDialysateInletFlow.label = vData[GuiActions.DialysateInletFlow_MeasuredFlow].toFixed(dialysateInletFlow_MeasuredFlow_Precision); - break case GuiActions.DialysateOutletFlow: _ultrafiltrationTouchArea.value = vData[GuiActions.DialysateOutletFlow_MeasUFVol].toFixed(2); break; Index: sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml =================================================================== diff -u -r9e57e4c990afab0996def98521d4f9fee83f96d8 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml (.../TreatmentFlows.qml) (revision 9e57e4c990afab0996def98521d4f9fee83f96d8) +++ sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml (.../TreatmentFlows.qml) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -17,7 +17,6 @@ import QtQuick.Controls 2.12 // Project -import Gui.Actions 0.1; // Qml imports import "qrc:/globals" @@ -26,23 +25,21 @@ /*! * \brief Treatment Screen Flows section */ -TouchArea { id: _flowsTouchArea - property alias textRectBloodFlow : _bloodFlow - property alias textRectDialysateInletFlow : _dialysateInletFlow +TouchArea { id: _root x: leftColumnX y: row1Y title: qsTr("FLOWS") components: [ TextRect { id: _bloodFlow title: qsTr("Blood") - label: "600" // value + label: vTreatmentFlows.bloodFlow_MeasuredFlow extra: qsTr("mL") // unit labelFont.weight: Font.ExtraLight } , TextRect { id: _dialysateInletFlow title: qsTr("Dialysate") - label: "500" // value + label: vTreatmentFlows.dialysateFlow_MeasuredFlow extra: qsTr("mL") // unit labelFont.weight: Font.ExtraLight } Index: sources/gui/view/vtreatmentflows.cpp =================================================================== diff -u --- sources/gui/view/vtreatmentflows.cpp (revision 0) +++ sources/gui/view/vtreatmentflows.cpp (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -0,0 +1,56 @@ +/*! + * + * 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 vtreatmentflows.cpp + * date 3/3/2020 + * author Behrouz NematiPour + * + */ +#include "vtreatmentflows.h" + +// Project +#include "guicontroller.h" + +// namespace +using namespace Gui; + +VTreatmentFlows::VTreatmentFlows(QObject *parent) : QObject(parent) +{ + Q_UNUSED(parent) + initConnections(); +} + +void VTreatmentFlows::initConnections() +{ + connect(&_GuiController, SIGNAL(didActionReceive (const BloodFlowData &)), + this , SLOT( onActionReceive (const BloodFlowData &))); + connect(&_GuiController, SIGNAL(didActionReceive (const DialysateFlowData &)), + this , SLOT( onActionReceive (const DialysateFlowData &))); +} + +void VTreatmentFlows::onActionReceive(const BloodFlowData &vData) +{ + bloodFlow_FlowSetPoint (vData.mFlowSetPoint ); + bloodFlow_MeasuredFlow (vData.mMeasuredFlow ); + bloodFlow_RotorSpeed (vData.mRotorSpeed ); + bloodFlow_MotorSpeed (vData.mMotorSpeed ); + bloodFlow_MotorCtlSpeed (vData.mMotorCtlSpeed ); + bloodFlow_MotorCtlCurrent (vData.mMotorCtlCurrent); + bloodFlow_PWMDutyCycle (vData.mPWMDutyCycle ); +} + +void VTreatmentFlows::onActionReceive(const DialysateFlowData &vData) +{ + dialysateFlow_FlowSetPoint (vData.mFlowSetPoint ); + dialysateFlow_MeasuredFlow (vData.mMeasuredFlow ); + dialysateFlow_RotorSpeed (vData.mRotorSpeed ); + dialysateFlow_MotorSpeed (vData.mMotorSpeed ); + dialysateFlow_MotorCtlSpeed (vData.mMotorCtlSpeed ); + dialysateFlow_MotorCtlCurrent (vData.mMotorCtlCurrent); + dialysateFlow_PWMDutyCycle (vData.mPWMDutyCycle ); +} Index: sources/gui/view/vtreatmentflows.h =================================================================== diff -u --- sources/gui/view/vtreatmentflows.h (revision 0) +++ sources/gui/view/vtreatmentflows.h (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -0,0 +1,59 @@ +/*! + * + * 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 vtreatmentflows.h + * date 3/3/2020 + * author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "main.h" +#include "model.h" + +// namespace +namespace Gui { + +class VTreatmentFlows : public QObject +{ + Q_OBJECT + + PROPERTY( qint32 , bloodFlow_FlowSetPoint , 0) + PROPERTY( float , bloodFlow_MeasuredFlow , 0) + PROPERTY( float , bloodFlow_RotorSpeed , 0) + PROPERTY( float , bloodFlow_MotorSpeed , 0) + PROPERTY( float , bloodFlow_MotorCtlSpeed , 0) + PROPERTY( float , bloodFlow_MotorCtlCurrent, 0) + PROPERTY( float , bloodFlow_PWMDutyCycle , 0) + + PROPERTY( qint32 , dialysateFlow_FlowSetPoint , 0) + PROPERTY( float , dialysateFlow_MeasuredFlow , 0) + PROPERTY( float , dialysateFlow_RotorSpeed , 0) + PROPERTY( float , dialysateFlow_MotorSpeed , 0) + PROPERTY( float , dialysateFlow_MotorCtlSpeed , 0) + PROPERTY( float , dialysateFlow_MotorCtlCurrent, 0) + PROPERTY( float , dialysateFlow_PWMDutyCycle , 0) + +private: + void initConnections(); + +public: + explicit VTreatmentFlows(QObject *parent = nullptr); + +private slots: + void onActionReceive (const BloodFlowData &vData); // UI <= HD/DG + void onActionReceive (const DialysateFlowData &vData); // UI <= HD/DG + +signals: + +}; +} Index: sources/main.h =================================================================== diff -u -rbb8f39a014644c70b832dd2a784f62fa9f6b6106 -r296e0e140bfeb193a9f571873afa6934143b1075 --- sources/main.h (.../main.h) (revision bb8f39a014644c70b832dd2a784f62fa9f6b6106) +++ sources/main.h (.../main.h) (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -39,9 +39,31 @@ static vCLASS &I() { \ static vCLASS _instance; \ return _instance; \ - } + } \ + extern int gFakeInterval; extern QByteArray gFakeData; extern const char*gFakeData_default; extern bool gSendEmptyKeepAwake; + +#define PROPERTY(vTYPE , vVARIABLE , vDEFVALUE) \ + Q_PROPERTY(vTYPE vVARIABLE \ + READ vVARIABLE \ + WRITE vVARIABLE \ + NOTIFY vVARIABLE##Changed) \ + Q_SIGNALS: \ + void vVARIABLE##Changed \ + ( const vTYPE & v##vVARIABLE ); \ + private: \ + vTYPE _##vVARIABLE = vDEFVALUE; \ + vTYPE vVARIABLE () const { \ + return _##vVARIABLE ; \ + } \ + void vVARIABLE ( const vTYPE & v##vVARIABLE ) { \ + if ( _##vVARIABLE != v##vVARIABLE ) { \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Changed( _##vVARIABLE ); \ + } \ + } \ + Index: sources/model/model.cpp =================================================================== diff -u --- sources/model/model.cpp (revision 0) +++ sources/model/model.cpp (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -0,0 +1,77 @@ +/*! + * + * 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 model.cpp + * date 3/4/2020 + * author Behrouz NematiPour + * + */ +#include "model.h" + +using namespace Model; + +QString Flow::toString() { + return QString(stringPrefix + "(%1, %2, %3, %4, %5, %6, %7)") + .arg(_data.mFlowSetPoint .value) + .arg(_data.mMeasuredFlow .value) + .arg(_data.mRotorSpeed .value) + .arg(_data.mMotorSpeed .value) + .arg(_data.mMotorCtlSpeed .value) + .arg(_data.mMotorCtlCurrent .value) + .arg(_data.mPWMDutyCycle .value); +} + +void Flow::toVariantList(QVariantList &vData) { + vData += _data.mFlowSetPoint .value; + vData += _data.mMeasuredFlow .value; + vData += _data.mRotorSpeed .value; + vData += _data.mMotorSpeed .value; + vData += _data.mMotorCtlSpeed .value; + vData += _data.mMotorCtlCurrent .value; + vData += _data.mPWMDutyCycle .value; +} + +void Flow::fromByteArray(const QByteArray &vByteArray) { + int index = 0; // message data start position + Types::getValue<>(vByteArray, index, _data.mFlowSetPoint ); + Types::getValue<>(vByteArray, index, _data.mMeasuredFlow ); + Types::getValue<>(vByteArray, index, _data.mRotorSpeed ); + Types::getValue<>(vByteArray, index, _data.mMotorSpeed ); + Types::getValue<>(vByteArray, index, _data.mMotorCtlSpeed ); + Types::getValue<>(vByteArray, index, _data.mMotorCtlCurrent ); + Types::getValue<>(vByteArray, index, _data.mPWMDutyCycle ); +} + +const Flow::Data &Flow::data() const +{ + return _data; +} + +BloodFlow::Data BloodFlow::data() const { + Data data; + data.mFlowSetPoint = Flow::data().mFlowSetPoint .value; + data.mMeasuredFlow = Flow::data().mMeasuredFlow .value; + data.mRotorSpeed = Flow::data().mRotorSpeed .value; + data.mMotorSpeed = Flow::data().mMotorSpeed .value; + data.mMotorCtlSpeed = Flow::data().mMotorCtlSpeed .value; + data.mMotorCtlCurrent = Flow::data().mMotorCtlCurrent.value; + data.mPWMDutyCycle = Flow::data().mPWMDutyCycle .value; + return data; +} + +DialysateFlow::Data DialysateFlow::data() const { + Data data; + data.mFlowSetPoint = Flow::data().mFlowSetPoint .value; + data.mMeasuredFlow = Flow::data().mMeasuredFlow .value; + data.mRotorSpeed = Flow::data().mRotorSpeed .value; + data.mMotorSpeed = Flow::data().mMotorSpeed .value; + data.mMotorCtlSpeed = Flow::data().mMotorCtlSpeed .value; + data.mMotorCtlCurrent = Flow::data().mMotorCtlCurrent.value; + data.mPWMDutyCycle = Flow::data().mPWMDutyCycle .value; + return data; +} Index: sources/model/model.h =================================================================== diff -u --- sources/model/model.h (revision 0) +++ sources/model/model.h (revision 296e0e140bfeb193a9f571873afa6934143b1075) @@ -0,0 +1,86 @@ +/*! + * + * 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 models.h + * date 3/4/2020 + * author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +namespace Model { + +/*! + * \brief The Flow Data class + */ +class Flow { + +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 _data; +public: + Flow () : _data {0, 0, 0, 0, 0, 0, 0} { } + + QString toString ( ); + void toVariantList ( QVariantList &vData ); + void fromByteArray (const QByteArray &vByteArray ); + + const Data &data() const ; +}; + +class BloodFlow : public Flow { +public: + struct Data { + qint32 mFlowSetPoint ; /*!< vFlowSetPoint - Flow Set Point value of type signed int extracted out */ + float mMeasuredFlow ; /*!< vMeasuredFlow - Measured Flow value of type float extracted out */ + float mRotorSpeed ; /*!< vRotorSpeed - Rotor Speed value of type float extracted out */ + float mMotorSpeed ; /*!< vMotorSpeed - Motor Speed value of type float extracted out */ + float mMotorCtlSpeed ; /*!< vMotorCtlSpeed - Motor Controller Speed value of type float extracted out */ + float mMotorCtlCurrent ; /*!< vMotorCtlCurrent - Motor Controller Current value of type float extracted out */ + float mPWMDutyCycle ; /*!< vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out */ + }; + BloodFlow() { stringPrefix = "Blood Flow"; } + Data data() const; +}; + +class DialysateFlow : public Flow { +public: + struct Data { + qint32 mFlowSetPoint ; /*!< vFlowSetPoint - Flow Set Point value of type signed int extracted out */ + float mMeasuredFlow ; /*!< vMeasuredFlow - Measured Flow value of type float extracted out */ + float mRotorSpeed ; /*!< vRotorSpeed - Rotor Speed value of type float extracted out */ + float mMotorSpeed ; /*!< vMotorSpeed - Motor Speed value of type float extracted out */ + float mMotorCtlSpeed ; /*!< vMotorCtlSpeed - Motor Controller Speed value of type float extracted out */ + float mMotorCtlCurrent ; /*!< vMotorCtlCurrent - Motor Controller Current value of type float extracted out */ + float mPWMDutyCycle ; /*!< vPWMDtCycle - PWM Duty Cycle in % value of type float extracted out */ + }; + DialysateFlow() { stringPrefix = "Dialysate Flow"; } + Data data() const; +}; + +} + +typedef Model:: BloodFlow::Data BloodFlowData; +typedef Model::DialysateFlow::Data DialysateFlowData;