Index: main.cpp =================================================================== diff -u -r561055268da68e24fe91a1148b76bf1785dae14d -r2fdeb1c461dde1b7b8bffcc5b814736190f98988 --- main.cpp (.../main.cpp) (revision 561055268da68e24fe91a1148b76bf1785dae14d) +++ main.cpp (.../main.cpp) (revision 2fdeb1c461dde1b7b8bffcc5b814736190f98988) @@ -25,7 +25,7 @@ #include #include #include -#include +#include // Project #include "maintimer.h" @@ -51,9 +51,13 @@ // Qt Core Application Initialization QApplication app(argc, argv); - QCoreApplication::setApplicationName(QLatin1String("Denali")); - QCoreApplication::setOrganizationName(QLatin1String("Diality Inc.")); + QApplication::setApplicationName(QLatin1String("Denali")); + QApplication::setOrganizationName(QLatin1String("Diality Inc.")); + + //! - Check the required font(s) present and can be loaded + QApplication::setFont(QFont("Barlow")); + // Test code for debugging can messages bool _consoleoutFrameInterface = false; bool _consoleoutCanInterface = false; Index: sources/canbus/messageglobals.h =================================================================== diff -u -r9392f5be540bb428dc64757ef2e50a4d4e5090a8 -r2fdeb1c461dde1b7b8bffcc5b814736190f98988 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 9392f5be540bb428dc64757ef2e50a4d4e5090a8) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision 2fdeb1c461dde1b7b8bffcc5b814736190f98988) @@ -28,10 +28,10 @@ * So the data collector has to collect this amount of bytes as payload of a message. */ const QHash payloadLen { - {GuiActionType::PowerOff , 1}, - {GuiActionType::KeepAlive , 0}, - {GuiActionType::BloodFlow , 24}, - {GuiActionType::String , 255}, + {GuiActionType::PowerOff , 1 }, + {GuiActionType::KeepAlive , 0 }, + {GuiActionType::BloodFlow , 7 * 4 } , // 6 parameters each 4bytes + {GuiActionType::String , 255 }, }; /*! Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r9392f5be540bb428dc64757ef2e50a4d4e5090a8 -r2fdeb1c461dde1b7b8bffcc5b814736190f98988 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 9392f5be540bb428dc64757ef2e50a4d4e5090a8) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 2fdeb1c461dde1b7b8bffcc5b814736190f98988) @@ -140,14 +140,16 @@ types::F32 mMotorSpeed ; types::F32 mMotorCtlSpeed ; types::F32 mMotorCtlCurrent ; - ok = getBloodFlowData(vMessage, mFlowSetPoint, mMeasuredFlow, mRotorSpeed, mMotorSpeed, mMotorCtlSpeed, mMotorCtlCurrent); + types::F32 mPWMDtCycle ; + ok = getBloodFlowData(vMessage, mFlowSetPoint, mMeasuredFlow, mRotorSpeed, mMotorSpeed, mMotorCtlSpeed, mMotorCtlCurrent, mPWMDtCycle); if (ok) { vData += mFlowSetPoint .value; vData += mMeasuredFlow .value; vData += mRotorSpeed .value; vData += mMotorSpeed .value; vData += mMotorCtlSpeed .value; vData += mMotorCtlCurrent.value; + vData += mPWMDtCycle .value; } break; } @@ -204,9 +206,14 @@ * \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 * \return true if the message can be successfully converted to the Blood Flow data elements. */ -bool MessageInterpreter::getBloodFlowData(const Message &vMessage, types::U32 &vFlowSetPoint, types::F32 &vMeasuredFlow, types::F32 &vRotorSpeed, types::F32 &vMotorSpeed, types::F32 &vMotorCtlSpeed, types::F32 &vMotorCtlCurrent) +bool MessageInterpreter::getBloodFlowData( + const Message &vMessage , + types::U32 &vFlowSetPoint , + types::F32 &vMeasuredFlow , types::F32 &vRotorSpeed , types::F32 &vMotorSpeed, + types::F32 &vMotorCtlSpeed , types::F32 &vMotorCtlCurrent , types::F32 &vPWMDtCycle) { if ( vMessage.actionId != GuiActionType::BloodFlow ) { return false; @@ -268,6 +275,14 @@ i++; } + p += 4; + j = 0; + while (i < p) { + vPWMDtCycle.bytes[j] = vMessage.data[i]; + j++; + i++; + } + return true; } Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -rc5389647e2259e67f8e6d923f3481d7d3f4eab68 -r2fdeb1c461dde1b7b8bffcc5b814736190f98988 --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision c5389647e2259e67f8e6d923f3481d7d3f4eab68) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 2fdeb1c461dde1b7b8bffcc5b814736190f98988) @@ -38,10 +38,10 @@ bool interpretMessage_HD(const Message &vMessage, GuiActionType &vActionId, QVariantList &vData) __attribute_warn_unused_result__; bool interpretMessage_DG(const Message &vMessage, GuiActionType &vActionId, QVariantList &vData) __attribute_warn_unused_result__; - bool getBloodFlowData (const Message &vMessage, - types::U32 &vFlowSetPoint, - types::F32 &vMeasuredFlow, types::F32 &vRotorSpeed, types::F32 &vMotorSpeed, - types::F32 &vMotorCtlSpeed, types::F32 &vMotorCtlCurrent ) __attribute_warn_unused_result__; + bool getBloodFlowData (const Message &vMessage , + types::U32 &vFlowSetPoint , + types::F32 &vMeasuredFlow , types::F32 &vRotorSpeed , types::F32 &vMotorSpeed, + types::F32 &vMotorCtlSpeed , types::F32 &vMotorCtlCurrent , types::F32 &vPWMDtCycle) __attribute_warn_unused_result__; bool getPowerOffData (const Message &vMessage, quint8 &vShowHide) __attribute_warn_unused_result__; void printUnhandled (const Message &vMessage); Index: sources/gui/guiglobals.h =================================================================== diff -u -rfee7fabf49befb065c89248c19e15efc9ca194e4 -r2fdeb1c461dde1b7b8bffcc5b814736190f98988 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision fee7fabf49befb065c89248c19e15efc9ca194e4) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision 2fdeb1c461dde1b7b8bffcc5b814736190f98988) @@ -41,8 +41,17 @@ }; enum class GuiActionsIndx_Enum { - PowerOff_ShowHide = 0, - PowerOff_Response = 0, + PowerOff_ShowHide = 0, + PowerOff_Response = 0, + + BloodFlow_FlowSetPoint = 0, + BloodFlow_MeasuredFlow , + BloodFlow_RotorSpeed , + BloodFlow_MotorSpeed , + BloodFlow_MotorCtlSpeed , + BloodFlow_MotorCtlCurrent , + BloodFlow_PWMDtCycle , + }; enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { @@ -62,7 +71,6 @@ Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) Q_ENUM(GuiActionsIndx_Enum) - }; // to be able to use the enum as signal/slot parameter Index: sources/gui/qml/pages/TreatmentStart.qml =================================================================== diff -u -rfee7fabf49befb065c89248c19e15efc9ca194e4 -r2fdeb1c461dde1b7b8bffcc5b814736190f98988 --- sources/gui/qml/pages/TreatmentStart.qml (.../TreatmentStart.qml) (revision fee7fabf49befb065c89248c19e15efc9ca194e4) +++ sources/gui/qml/pages/TreatmentStart.qml (.../TreatmentStart.qml) (revision 2fdeb1c461dde1b7b8bffcc5b814736190f98988) @@ -94,6 +94,14 @@ color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle } + Text { + id: _F32_6 + text: qsTr("") + width: 250 + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } } Connections { target: _GuiView @@ -102,12 +110,13 @@ switch(vAction) { case GuiActions.BloodFlow: //console.debug(vData) - _U32 .text = vData[0]; - _F32_1.text = vData[1].toFixed(2); - _F32_2.text = vData[2].toFixed(2); - _F32_3.text = vData[3].toFixed(2); - _F32_4.text = vData[4].toFixed(2); - _F32_5.text = vData[5].toFixed(2); + _U32 .text = vData[GuiActions.BloodFlow_FlowSetPoint ]; + _F32_1.text = vData[GuiActions.BloodFlow_MeasuredFlow ].toFixed(2); + _F32_2.text = vData[GuiActions.BloodFlow_RotorSpeed ].toFixed(2); + _F32_3.text = vData[GuiActions.BloodFlow_MotorSpeed ].toFixed(2); + _F32_4.text = vData[GuiActions.BloodFlow_MotorCtlSpeed ].toFixed(2); + _F32_5.text = vData[GuiActions.BloodFlow_MotorCtlCurrent].toFixed(2); + _F32_6.text = vData[GuiActions.BloodFlow_PWMDtCycle ].toFixed(2) + "%"; break; } }