Index: denali.pro =================================================================== diff -u -rf2fbd5c69ca884f59bcc5c40f43eba39e287a13a -re591b135f821c1b1e13c2db8429dc63648c2452c --- denali.pro (.../denali.pro) (revision f2fbd5c69ca884f59bcc5c40f43eba39e287a13a) +++ denali.pro (.../denali.pro) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -43,6 +43,7 @@ common/MsgDefs.h \ sources/main.h \ sources/maintimer.h \ + sources/model/mloadcellreadings.h \ sources/model/mtreatmentadjustblooddialysateresponse.h \ sources/model/mtreatmentadjustdurationresponse.h \ sources/model/mtreatmentadjustrequests.h \ @@ -72,6 +73,7 @@ sources/model/mtreatmentflows.h \ sources/model/mtreatmentoutletflow.h \ sources/model/mtreatmenttime.h \ + sources/view/vloadcellreadings.h \ sources/view/vtreatmentadjustmentduration.h \ sources/view/vtreatmentadjustmentflows.h \ sources/view/vtreatmentadjustmentresponsebase.h \ @@ -99,6 +101,7 @@ SOURCES += \ main.cpp \ sources/maintimer.cpp \ + sources/model/mloadcellreadings.cpp \ sources/model/mtreatmentadjustblooddialysateresponse.cpp \ sources/model/mtreatmentadjustdurationresponse.cpp \ sources/model/mtreatmentadjustultrafiltrationconfirmresponse.cpp \ @@ -125,6 +128,7 @@ sources/model/mtreatmentoutletflow.cpp \ sources/model/mtreatmenttime.cpp \ sources/model/malarmstatus.cpp \ + sources/view/vloadcellreadings.cpp \ sources/view/vpoweroff.cpp \ sources/view/vtreatmentadjustmentduration.cpp \ sources/view/vtreatmentadjustmentflows.cpp \ Index: denali.pro.user =================================================================== diff -u -rf2fbd5c69ca884f59bcc5c40f43eba39e287a13a -re591b135f821c1b1e13c2db8429dc63648c2452c --- denali.pro.user (.../denali.pro.user) (revision f2fbd5c69ca884f59bcc5c40f43eba39e287a13a) +++ denali.pro.user (.../denali.pro.user) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/canbus/messageglobals.h =================================================================== diff -u -r6616f7b9b88efffa42ab605833d296afb76d3cb1 -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 6616f7b9b88efffa42ab605833d296afb76d3cb1) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -51,6 +51,7 @@ {Gui::GuiActionType::DialysateOutletFlow , 7 * 4 }, // 7 parameters each 4bytes {Gui::GuiActionType::TreatmentTime , 3 * 4 }, // 3 parameters each 4bytes {Gui::GuiActionType::PressureOcclusion , 5 * 4 }, // 5 parameters each 4bytes + {Gui::GuiActionType::LoadCellReadings , 4 * 4 }, // 4 parameters each 4bytes // ---- {Gui::GuiActionType::AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes @@ -78,6 +79,7 @@ {Gui::GuiActionType::AdjustUltrafiltrationConfirmRsp , 5 * 4 }, // ---- + {Gui::GuiActionType::CanBUSFaultCount , 1 }, {Gui::GuiActionType::String , 255 }, {Gui::GuiActionType::Acknow , 0 }, {Gui::GuiActionType::AcknowGeneric , 1 }, Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r5734e6289c18ec3cfe4749de8e3a6043f98dbcff -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 5734e6289c18ec3cfe4749de8e3a6043f98dbcff) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -168,7 +168,7 @@ // coco begin validated: Is a placeholder and There is no definition/implementation of DG communication with UI. case eChlid_DG_UI: //case eChlid_DG_Alarm: - //case eChlid_DG_Sync: + case eChlid_DG_Sync: ok = interpretMessage_DG(vMessage, vData); break; @@ -192,7 +192,7 @@ QString mActionIdHexString = Format::toHexString(vMessage.actionId, false, eLenMessageIDDigits); QString logMessage = tr("Unhandled Message ID (HD)") + '\n' + QString("%1 # %2 %3") - .arg(vMessage.can_id, 3, 16, QChar('0')) + .arg(int(vMessage.can_id), 3, 16, QChar('0')) .arg(mActionIdHexString) .arg(QString(vMessage.data.toHex('.'))); LOG_ERROR(logMessage); @@ -215,8 +215,12 @@ { bool ok = false; vData.clear(); - + //qDebug() << vMessage.actionId; switch (vMessage.actionId) { // notice we are in receive mode + case Gui::GuiActionType::CanBUSFaultCount: + ok = canbusFaultCountData (vMessage, vData); + break; + case Gui::GuiActionType::PowerOff: { ok = powerOffData (vMessage, vData); break; @@ -316,10 +320,19 @@ */ bool MessageInterpreter::interpretMessage_DG(const Message &vMessage, QVariantList &vData) { - // coco begin validated: No data have been interpreted from DG yet - Q_UNUSED(vMessage ); - Q_UNUSED(vData ); - return false; + bool ok = false; + vData.clear(); + + switch (vMessage.actionId) { // notice we are in receive mode + case Gui::GuiActionType::LoadCellReadings: + ok = loadCellReadingsData (vMessage, vData); + break; + + default: + printUnhandled (vMessage); + break; + } + return ok; } // coco end @@ -668,7 +681,7 @@ } /*! - * \brief MessageInterpreter::getTreatmentRangesData + * \brief MessageInterpreter::treatmentRangesData * \details This method interprets Treatment Ranges message data * in vMessage of type Message. * \param vMessage - The vMessage of type Message which contains all the data, @@ -694,6 +707,60 @@ } /*! + * \brief MessageInterpreter::loadCellReadingsData + * \details This method interprets LoadCellReadings message data + * in vMessage of type Message. + * \param vMessage - The vMessage of type Message which contains all the data, + * require to be interpreted. + * \param vData - Load Cell Readings data + * \return true if the data can be extracted as defined for LoadCellReadings Message ID + */ +bool MessageInterpreter::loadCellReadingsData(const Message &vMessage, QVariantList &vData) +{ + // TODO : review other methods + bool ok = false; + if ( ! isType (vMessage, Gui::GuiActionType::LoadCellReadings) ) return ok; + if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::LoadCellReadings) ) return ok; + + Model::MLoadCellReadings mData; + ok = mData.fromByteArray(vMessage.data); + LOG_DATUM(mData.toString()); + + mData.toVariantList(vData); + emit didActionReceive(mData.data()); + + return ok; +} + +/*! + * \brief MessageInterpreter::loadCellReadingsData + * \details This method interprets LoadCellReadings message data + * in vMessage of type Message. + * \param vMessage - The vMessage of type Message which contains all the data, + * require to be interpreted. + * \param vData - Load Cell Readings data + * \return true if the data can be extracted as defined for LoadCellReadings Message ID + */ +bool MessageInterpreter::canbusFaultCountData(const Message &vMessage, QVariantList &vData) +{ + // TODO : review other methods + bool ok = false; + if ( ! isType (vMessage, Gui::GuiActionType::CanBUSFaultCount) ) return ok; + if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::CanBUSFaultCount) ) return ok; + + QVariantList mData; + if (vMessage.data.count()) { + int index = 0; + Types::U32 mCanBUSFaultCount; + ok = GetValue(vMessage.data, index, mCanBUSFaultCount); + if (ok) { + vData += mCanBUSFaultCount .value; + } + } + return ok; +} + +/*! * \brief MessageInterpreter::adjustBloodDialysateData * \details This method interprets AdjustBlood Dialysate Response message data * in vMessage of type Message. Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -r6616f7b9b88efffa42ab605833d296afb76d3cb1 -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 6616f7b9b88efffa42ab605833d296afb76d3cb1) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -80,6 +80,12 @@ // ---- Treatment Ranges bool treatmentRangesData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Load Cell Readings + bool loadCellReadingsData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + + // ---- Load Cell Readings + bool canbusFaultCountData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ~~~~ Adjustments ~~~~ // ---- Treatment Adjust response for Blood/Dialysate Flow Rate bool adjustBloodDialysateData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; Index: sources/gui/guiglobals.cpp =================================================================== diff -u -r5734e6289c18ec3cfe4749de8e3a6043f98dbcff -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision 5734e6289c18ec3cfe4749de8e3a6043f98dbcff) +++ sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -24,22 +24,24 @@ #include "mmodel.h" #include "vview.h" +#include "valarmstatus.h" +#include "vpoweroff.h" + #include "vtreatmentbloodflow.h" #include "vtreatmentdialysateflow.h" #include "vtreatmentultrafiltration.h" #include "vtreatmentadjustmentultrafiltrationstate.h" #include "vtreatmentpressureocclusion.h" #include "vtreatmenttime.h" #include "vtreatmentranges.h" -#include "valarmstatus.h" -#include "vpoweroff.h" +#include "vloadcellreadings.h" + #include "vtreatmentadjustmentduration.h" #include "vtreatmentadjustmentflows.h" #include "vtreatmentadjustmentultrafiltrationedit.h" #include "vtreatmentadjustmentultrafiltrationconfirm.h" - namespace Gui { QQuickView *_viewer = nullptr; Index: sources/gui/guiglobals.h =================================================================== diff -u -rf160ef9c259a75e8d6120ad962cda648e8f7a9b3 -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/gui/guiglobals.h (.../guiglobals.h) (revision f160ef9c259a75e8d6120ad962cda648e8f7a9b3) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -53,6 +53,8 @@ AlarmTriggered = 0x0300, AlarmCleared = 0x0400, + LoadCellReadings = 0x0C00, + PressureOcclusion = 0x0900, AdjustBloodDialysateReq = 0x1700, // 23 @@ -74,6 +76,8 @@ TreatmentState = 0x0F00, // 15 + CanBUSFaultCount = 0x9909, + String = 0xFFFE, Acknow = 0xFFFF, Index: sources/gui/qml/main.qml =================================================================== diff -u -r5734e6289c18ec3cfe4749de8e3a6043f98dbcff -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/gui/qml/main.qml (.../main.qml) (revision 5734e6289c18ec3cfe4749de8e3a6043f98dbcff) +++ sources/gui/qml/main.qml (.../main.qml) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -24,6 +24,7 @@ // This needs to be moved into the TreatmentFlows.qml import VTreatmentBloodFlow 0.1; import VTreatmentDialysateFlow 0.1; +import VTreatmentPressureOcclusion 0.1; import VTreatmentUltrafiltration 0.1; import VTreatmentTime 0.1; import VAlarmStatus 0.1; @@ -35,6 +36,8 @@ import VTreatmentAdjustmentUltrafiltrationEdit 0.1; import VTreatmentAdjustmentUltrafiltrationConfirm 0.1; +import VLoadCellReadings 0.1; + // Qml imports import "qrc:/globals" import "qrc:/pages" @@ -53,34 +56,38 @@ GuiView { id: _GuiView onDidActionReceive: { - //console.debug(vData) + //console.debug(vAction, vData) switch(vAction) { case GuiActions.PowerOffBroadcast: _autoHideInfo.showDialog( qsTr("System is shutting down"), 5000 // if any error happens and shutdown is not successful then after 5 seconds dialog hides. ) break; - } } } // TODO : When Testing data on Setting screen is removed // This needs to be moved into the Treatment______.qml - VTreatmentAdjustmentDuration { id: vTreatmentAdjustmentDuration } - VTreatmentAdjustmentFlows { id: vTreatmentAdjustmentFlows } + + VAlarmStatus { id: vAlarmStatus } + VPowerOff { id: vPowerOff } + + VTreatmentBloodFlow { id: vTreatmentBloodFlow } + VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } + VTreatmentPressureOcclusion { id: vTreatmentPressureOcclusion } + VTreatmentUltrafiltration { id: vTreatmentUltrafiltration } + VTreatmentTime { id: vTreatmentTime } + + VLoadCellReadings { id: vLoadCellReadings } + + VTreatmentAdjustmentDuration { id: vTreatmentAdjustmentDuration } + VTreatmentAdjustmentFlows { id: vTreatmentAdjustmentFlows } VTreatmentAdjustmentUltrafiltrationState { id: vTreatmentAdjustmentUltrafiltrationState } VTreatmentAdjustmentUltrafiltrationEdit { id: vTreatmentAdjustmentUltrafiltrationEdit } VTreatmentAdjustmentUltrafiltrationConfirm { id: vTreatmentAdjustmentUltrafiltrationConfirm } - VTreatmentBloodFlow { id: vTreatmentBloodFlow } - VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } - VTreatmentUltrafiltration { id: vTreatmentUltrafiltration } - VTreatmentTime { id: vTreatmentTime } - VAlarmStatus { id: vAlarmStatus } - VPowerOff { id: vPowerOff } - // ----- Follow the below Z order ----- // 1 - Screens // 1 - 1 @@ -115,7 +122,6 @@ } } - NotificationBar { id: _alarm anchors.bottom: _mainMenu.top level : vAlarmStatus.alarm_Priority Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -64,16 +64,39 @@ } } + Text { id : _canbusFaultCountText + property int count: 0 + visible: true + anchors { + top : parent.top + left : parent.left + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + leftMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + text: qsTr("CAN Faults : %1").arg(count) + horizontalAlignment: Text.AlignLeft + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } + + Connections { target: _GuiView + onDidActionReceive: { + if (vAction === GuiActions.CanBUSFaultCount ) { + _canbusFaultCountText.count = vData[0] + } + } + } + Column { id: _BloodFlowColumn width: 150 spacing: 20 topPadding: 100 leftPadding: 10 Text { id: _BloodFlow_Title - text: qsTr(" Blood ") + text: qsTr(" Blood ") width: _BloodFlowColumn.width - horizontalAlignment: Text.AlignHCenter + horizontalAlignment: Text.AlignRight color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle font.underline: true @@ -99,15 +122,15 @@ } Column { id: _DialysateInletFlowColumn - width: 150 - spacing: 20 - topPadding: 100 - leftPadding: 180 + width : 150 + spacing : 20 + topPadding : 100 + leftPadding : 200 Text { id: _DialysateInletFlow_Title - text: qsTr(" Dialysate I ") + text: qsTr(" Dlyst I ") width: _DialysateInletFlowColumn.width - horizontalAlignment: Text.AlignLeft + horizontalAlignment: Text.AlignRight color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle font.underline: true @@ -133,15 +156,15 @@ } Column { id: _DialysateOutletFlowColumn - width: 150 - spacing: 20 - topPadding: 100 - leftPadding: 400 + width : 150 + spacing : 20 + topPadding : 100 + leftPadding : 400 Text { id: _DialysateOutletFlow_Title - text: qsTr(" Dialysate O ") + text: qsTr(" Dlyst O ") width: _DialysateOutletFlowColumn.width - horizontalAlignment: Text.AlignLeft + horizontalAlignment: Text.AlignRight color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle font.underline: true @@ -165,4 +188,67 @@ } } } + + Column { id: _PressureOcclusionColumn + width : 150 + spacing : 20 + topPadding : 100 + leftPadding : 600 + Text { + id: _PressureOcclusion_Title + text: qsTr(" Prsr Oc ") + width: _PressureOcclusionColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + font.underline: true + } + Repeater { + model: [ + vTreatmentPressureOcclusion.pressureocclusion_ArterialPressure .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_VenousPressure .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_BloodPumpOcclusion .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_DialysateInletPumpOcclusion .toFixed(2) , + vTreatmentPressureOcclusion.pressureocclusion_DialysateOutletPumpOcclusion .toFixed(2) + ] + Text { + text: modelData + width: _PressureOcclusionColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } + } + } + + Column { id: _LoadCellReadingColumn + width : 150 + spacing : 20 + topPadding : 100 + leftPadding : 800 + Text { + id: _LoadCellReading_Title + text: qsTr(" LoadCl ") + width: _LoadCellReadingColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + font.underline: true + } + Repeater { + model: [ + vLoadCellReadings.reservoir1Prim .toFixed(2) , + vLoadCellReadings.reservoir1Bkup .toFixed(2) , + vLoadCellReadings.reservoir2Prim .toFixed(2) , + vLoadCellReadings.reservoir2Bkup .toFixed(2) + ] + Text { + text: modelData + width: _LoadCellReadingColumn.width + horizontalAlignment: Text.AlignRight + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + } + } + } } Index: sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml =================================================================== diff -u -rf160ef9c259a75e8d6120ad962cda648e8f7a9b3 -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision f160ef9c259a75e8d6120ad962cda648e8f7a9b3) +++ sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -16,7 +16,6 @@ import QtQuick 2.12 // Project -import VTreatmentPressureOcclusion 0.1; // Qml imports import "qrc:/globals" @@ -46,8 +45,6 @@ isTouchable: true title: qsTr("PRESSURE") + " " + qsTr("(mmHg)") - VTreatmentPressureOcclusion { id: vTreatmentPressureOcclusion } - RangeBar { id: _arterialRangeBar x: 0 y: 80 Index: sources/model/mloadcellreadings.cpp =================================================================== diff -u --- sources/model/mloadcellreadings.cpp (revision 0) +++ sources/model/mloadcellreadings.cpp (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -0,0 +1,53 @@ +/*! + * + * 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 mloadcellreadings.cpp + * \date 6/10/2020 + * \author Behrouz NematiPour + * + */ +#include "mloadcellreadings.h" + +using namespace Model; + +QString MLoadCellReadings::toString() const { + return QString(stringPrefix + "(%1, %2, %3, %4)") + .arg(_data.mReservoir1Prim .value) + .arg(_data.mReservoir1Bkup .value) + .arg(_data.mReservoir2Prim .value) + .arg(_data.mReservoir2Bkup .value); +} + +void MLoadCellReadings::toVariantList(QVariantList &vData) const { + vData += _data.mReservoir1Prim .value; + vData += _data.mReservoir1Bkup .value; + vData += _data.mReservoir2Prim .value; + vData += _data.mReservoir2Bkup .value; +} + +bool MLoadCellReadings::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mReservoir1Prim )) + if (GetValue(vByteArray, index, _data.mReservoir1Bkup )) + if (GetValue(vByteArray, index, _data.mReservoir2Prim )) + if (GetValue(vByteArray, index, _data.mReservoir2Bkup )) + return true ; + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +MLoadCellReadings::Data MLoadCellReadings::data() const { + Data data; + data.mReservoir1Prim = _data.mReservoir1Prim .value; + data.mReservoir1Bkup = _data.mReservoir1Bkup .value; + data.mReservoir2Prim = _data.mReservoir2Prim .value; + data.mReservoir2Bkup = _data.mReservoir2Bkup .value; + return data; +} Index: sources/model/mloadcellreadings.h =================================================================== diff -u --- sources/model/mloadcellreadings.h (revision 0) +++ sources/model/mloadcellreadings.h (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -0,0 +1,54 @@ +/*! + * + * 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 mloadcellreadings.h + * \date 6/10/2020 + * \author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +namespace Model { + +class MLoadCellReadings { +public: + QString stringPrefix = "Load Cell Readings"; + struct Data { + float mReservoir1Prim = 0; /*!< ArterialPressure value of type float extracted out */ + float mReservoir1Bkup = 0; /*!< VenousPressure value of type float extracted out */ + float mReservoir2Prim = 0; /*!< BloodPumpOcclusion value of type float extracted out */ + float mReservoir2Bkup = 0; /*!< DialysateInletPumpOcclusion value of type float extracted out */ + }; + +private: + struct { + Types::F32 mReservoir1Prim ; + Types::F32 mReservoir1Bkup ; + Types::F32 mReservoir2Prim ; + Types::F32 mReservoir2Bkup ; + } _data; + +public: + MLoadCellReadings () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; + +} + +typedef Model::MLoadCellReadings::Data LoadCellReadingsData; Index: sources/model/mmodel.h =================================================================== diff -u -r9cfaddcf21cf36ab5a948b65dd8ef659598a4ed7 -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/model/mmodel.h (.../mmodel.h) (revision 9cfaddcf21cf36ab5a948b65dd8ef659598a4ed7) +++ sources/model/mmodel.h (.../mmodel.h) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -24,6 +24,9 @@ #include "mtreatmentoutletflow.h" #include "mtreatmentpressureocclusion.h" #include "mtreatmentranges.h" + +#include "mloadcellreadings.h" + #include "mtreatmentadjustblooddialysateresponse.h" #include "mtreatmentadjustdurationresponse.h" #include "mtreatmentadjustultrafiltrationstateresponse.h" @@ -129,6 +132,8 @@ REGISTER_METATYPE( PowerOffData ) \ REGISTER_METATYPE( TreatmentRangesData ) \ \ + REGISTER_METATYPE( LoadCellReadingsData ) \ + \ REGISTER_METATYPE( AdjustBloodDialysateRequestData ) \ REGISTER_METATYPE( AdjustDurationRequestData ) \ REGISTER_METATYPE( AdjustUltrafiltrationStateRequestData ) \ @@ -152,6 +157,8 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRangesData ) \ \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, LoadCellReadingsData ) \ + \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) \ @@ -175,6 +182,8 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRangesData ) \ \ + ACTION_RECEIVE_BRIDGE_DEFINITION( LoadCellReadingsData ) \ + \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) \ @@ -211,6 +220,9 @@ ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \ ACTION_RECEIVE_SIGNAL( PowerOffData ) \ ACTION_RECEIVE_SIGNAL( TreatmentRangesData ) \ + \ + ACTION_RECEIVE_SIGNAL( LoadCellReadingsData ) \ + \ ACTION_RECEIVE_SIGNAL( AdjustUltrafiltrationStateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) \ ACTION_RECEIVE_SIGNAL( AdjustDurationResponseData ) \ Index: sources/view/vloadcellreadings.cpp =================================================================== diff -u --- sources/view/vloadcellreadings.cpp (revision 0) +++ sources/view/vloadcellreadings.cpp (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -0,0 +1,27 @@ +/*! + * + * 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 vloadcellreadings.cpp + * \date 6/10/2020 + * \author Behrouz NematiPour + * + */ +#include "vloadcellreadings.h" + +// Project +#include "guicontroller.h" + +VIEW_DEF(VLoadCellReadings, LoadCellReadingsData) + +void VLoadCellReadings::onActionReceive(const LoadCellReadingsData &vData) +{ + reservoir1Prim ( vData.mReservoir1Prim ); + reservoir1Bkup ( vData.mReservoir1Bkup ); + reservoir2Prim ( vData.mReservoir2Prim ); + reservoir2Bkup ( vData.mReservoir2Bkup ); +} Index: sources/view/vloadcellreadings.h =================================================================== diff -u --- sources/view/vloadcellreadings.h (revision 0) +++ sources/view/vloadcellreadings.h (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -0,0 +1,38 @@ +/*! + * + * 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 vloadcellreadings.h + * \date 6/10/2020 + * \author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "mmodel.h" +#include "vview.h" + +// namespace +namespace View { + +class VLoadCellReadings : public QObject +{ + Q_OBJECT + + PROPERTY( float , reservoir1Prim , 0) + PROPERTY( float , reservoir1Bkup , 0) + PROPERTY( float , reservoir2Prim , 0) + PROPERTY( float , reservoir2Bkup , 0) + + VIEW_DEC(VLoadCellReadings, LoadCellReadingsData) + +}; +} Index: sources/view/vview.h =================================================================== diff -u -r5734e6289c18ec3cfe4749de8e3a6043f98dbcff -re591b135f821c1b1e13c2db8429dc63648c2452c --- sources/view/vview.h (.../vview.h) (revision 5734e6289c18ec3cfe4749de8e3a6043f98dbcff) +++ sources/view/vview.h (.../vview.h) (revision e591b135f821c1b1e13c2db8429dc63648c2452c) @@ -91,17 +91,22 @@ //--------------------------------------------------------------------------------// #define REGISTER_VIEW_TYPES \ using namespace View; \ + \ + REGISTER_TYPE( VAlarmStatus ) \ + REGISTER_TYPE( VPowerOff ) \ + \ REGISTER_TYPE( VTreatmentBloodFlow ) \ REGISTER_TYPE( VTreatmentDialysateFlow ) \ REGISTER_TYPE( VTreatmentUltrafiltration ) \ - REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentPressureOcclusion ) \ REGISTER_TYPE( VTreatmentTime ) \ REGISTER_TYPE( VTreatmentRanges ) \ - REGISTER_TYPE( VAlarmStatus ) \ - REGISTER_TYPE( VPowerOff ) \ + \ + REGISTER_TYPE( VLoadCellReadings ) \ + \ REGISTER_TYPE( VTreatmentAdjustmentDuration ) \ REGISTER_TYPE( VTreatmentAdjustmentFlows ) \ + REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationState ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationEdit ) \ REGISTER_TYPE( VTreatmentAdjustmentUltrafiltrationConfirm )