Index: denali.pro =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- denali.pro (.../denali.pro) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ denali.pro (.../denali.pro) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -40,6 +40,7 @@ sources/maintimer.h \ sources/model/mtreatmentadjustblooddialysateresponse.h \ sources/model/mtreatmentpressureocclusion.h \ + sources/model/mtreatmentranges.h \ sources/threads.h \ sources/applicationcontroller.h \ sources/applicationpost.h \ @@ -63,6 +64,7 @@ sources/model/mtreatmenttime.h \ sources/view/vtreatmentadjustmentsresponse.h \ sources/view/vtreatmentpressureocclusion.h \ + sources/view/vtreatmentranges.h \ sources/view/vview.h \ sources/view/vpoweroff.h \ sources/view/vtreatmentbloodflow.h \ @@ -84,6 +86,7 @@ sources/maintimer.cpp \ sources/model/mtreatmentadjustblooddialysateresponse.cpp \ sources/model/mtreatmentpressureocclusion.cpp \ + sources/model/mtreatmentranges.cpp \ sources/threads.cpp \ sources/applicationcontroller.cpp \ sources/applicationpost.cpp \ @@ -108,6 +111,7 @@ sources/view/vtreatmentbloodflow.cpp \ sources/view/vtreatmentdialysateflow.cpp \ sources/view/vtreatmentpressureocclusion.cpp \ + sources/view/vtreatmentranges.cpp \ sources/view/vtreatmentultrafiltration.cpp \ sources/view/vtreatmenttime.cpp \ sources/view/valarmstatus.cpp \ Index: sources/applicationcontroller.cpp =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -110,8 +110,8 @@ connect(&_Logger , SIGNAL(didExport()), this , SLOT( onExport())); - connect(&_GuiController , SIGNAL(didAdjustBloodDialysateFlows(float,float)), - this , SLOT( onAdjustBloodDialysateFlows(float,float))); + connect(&_GuiController , SIGNAL(didAdjustBloodDialysateFlows(quint32, quint32)), + this , SLOT( onAdjustBloodDialysateFlows(quint32, quint32))); ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_MessageDispatcher) } @@ -232,7 +232,7 @@ emit didExport(); } -void ApplicationController::onAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow) +void ApplicationController::onAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) { QVariantList mData; mData += vBloodFlow; Index: sources/applicationcontroller.h =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -72,7 +72,7 @@ void onExportLog (); void onExport (); - void onAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow); + void onAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS @@ -86,6 +86,6 @@ void didExport (); - void didAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow); + void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); }; Index: sources/canbus/messagedispatcher.h =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -100,7 +100,7 @@ bool _init = false; QList _needsAcknow { - // GuiActionType::AdjustBloodDialysateReq + GuiActionType::AdjustBloodDialysateReq }; // no action needs Acknow for now // Singleton Index: sources/canbus/messageglobals.h =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -57,6 +57,9 @@ {Gui::GuiActionType::AdjustBloodDialysateRsp , 4 * 4 }, // 4 parameters each 4bytes // ---- + {Gui::GuiActionType::TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes + + // ---- {Gui::GuiActionType::String , 255 }, {Gui::GuiActionType::Acknow , 0 }, }; Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -244,6 +244,9 @@ ok = adjustBloodDialysateData (vMessage, vData); break; + case Gui::GuiActionType::TreatmentRanges: + ok = treatmentRangesData (vMessage, vData); + break; default: @@ -618,3 +621,20 @@ return ok; } + +bool MessageInterpreter::treatmentRangesData(const Message &vMessage, QVariantList &vData) +{ + // TODO : review other methods + bool ok = false; + if ( ! isType (vMessage, Gui::GuiActionType::TreatmentRanges) ) return ok; + if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::TreatmentRanges) ) return ok; + + Model::MTreatmentRanges mData; + ok = mData.fromByteArray(vMessage.data); + LOG_DATUM(mData.toString()); + + mData.toVariantList(vData); + emit didActionReceive(mData.data()); + + return ok; +} Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -73,6 +73,9 @@ // ---- Treatment Adjust response for Blood/Dialysate Flow Rate bool adjustBloodDialysateData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Treatment Ranges + bool treatmentRangesData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + public: explicit MessageInterpreter(QObject *parent = nullptr); Index: sources/gui/guicontroller.cpp =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -274,7 +274,7 @@ } // coco end -void GuiController::doAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow) +void GuiController::doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) { emit didAdjustBloodDialysateFlows(vBloodFlow, vDialysateFlow); } Index: sources/gui/guicontroller.h =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/guicontroller.h (.../guicontroller.h) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -82,9 +82,9 @@ //// ----- Adjust Blood/Dialysate Flows public slots: - void doAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow); + void doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); signals: - void didAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow); + void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); }; Index: sources/gui/guiglobals.h =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -44,9 +44,11 @@ PressureOcclusion = 0x0900, // message 9 - AdjustBloodDialysateReq = 0x1700, - AdjustBloodDialysateRsp = 0x1800, + AdjustBloodDialysateReq = 0x1700, // 23 + AdjustBloodDialysateRsp = 0x1800, // 24 + TreatmentRanges = 0x1A00, // 26 + String = 0xFFFE, Acknow = 0xFFFF, Index: sources/gui/guiview.cpp =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/guiview.cpp (.../guiview.cpp) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/gui/guiview.cpp (.../guiview.cpp) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -64,8 +64,8 @@ &_GuiController, SLOT( doExportLog())); // ----- Adjust Blood/Dialysate Flows - connect(this , SIGNAL(didAdjustBloodDialysateFlows(float, float)), - &_GuiController, SLOT( doAdjustBloodDialysateFlows(float, float))); + connect(this , SIGNAL(didAdjustBloodDialysateFlows(quint32, quint32)), + &_GuiController, SLOT( doAdjustBloodDialysateFlows(quint32, quint32))); } /*! Index: sources/gui/guiview.h =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/guiview.h (.../guiview.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/gui/guiview.h (.../guiview.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -62,11 +62,11 @@ // ----- Adjust Blood/Dialysate Flows public slots: - void doAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow) { + void doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) { emit didAdjustBloodDialysateFlows(vBloodFlow, vDialysateFlow); } signals: - void didAdjustBloodDialysateFlows(float vBloodFlow, float vDialysateFlow); + void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); }; Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -16,6 +16,7 @@ import QtQuick 2.12 // Project +import VTreatmentRanges 0.1 // Qml imports import "qrc:/globals" @@ -30,7 +31,9 @@ StackItem { id : _root stackView.initialItem : _treatmentHome - MainMenu { id: _treatmentMenu + VTreatmentRanges { id: vTreatmentRanges } + + MainMenu { id: _treatmentMenu y : -Variables.mainMenuHeight position : MainMenu.Position.Top hidden : true @@ -55,6 +58,9 @@ } TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow + dialysateFlowRateMinimum: vTreatmentRanges.treatmentRanges_Dialysate_Flow_Min + dialysateFlowRateMaximum: vTreatmentRanges.treatmentRanges_Dialysate_Flow_Max + onCloseClicked : close() onConfirmClicked : _GuiView.doAdjustBloodDialysateFlows(bloodFlowRateValue, dialysateFlowRateValue) } Index: sources/gui/qml/pages/treatment/TreatmentStart.qml =================================================================== diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/qml/pages/treatment/TreatmentStart.qml (.../TreatmentStart.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca) +++ sources/gui/qml/pages/treatment/TreatmentStart.qml (.../TreatmentStart.qml) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -62,17 +62,28 @@ } Line { x: 0; y: row2LineY; length: lineLength } TreatmentPressure { id: _pressureTouchArea - x : leftColumnX - y : row3Y - width : _flowsTouchArea.width + arterialMinimum : -400 + arterialLowerBound : -300 + arterialUpperBound : 100 + arterialMaximum : 400 + + venousMinimum : -100 + venousLowerBound : -100 + venousUpperBound : 500 + venousMaximum : 800 + + x : leftColumnX + y : row3Y + width : _flowsTouchArea.width } // ---------- COLUMN RIGHT TreatmentUltrafiltration { id: _ultrafiltrationTouchArea; x : rightColumnX y : row1Y width : _flowsTouchArea.width - maximum : 1000 // TEST : this is a test has to be read form the prescreprion values + minimum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Min.toFixed(2) + maximum : vTreatmentRanges.treatmentRanges_Ultrafiltration_Volume_Max.toFixed(2) value : vTreatmentUltrafiltration.ultrafiltration_MeasUFVol.toFixed(2); valueEx : 0 } Index: sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml =================================================================== diff -u -r3676cd80ff97ac0785547e29e63f54b95b53f9f8 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision 3676cd80ff97ac0785547e29e63f54b95b53f9f8) +++ sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -26,6 +26,17 @@ * \brief Treatment Screen Pressure section */ TouchArea { id: _root + property int arterialMinimum : -400 + property int arterialLowerBound : -300 + property int arterialUpperBound : 100 + property int arterialMaximum : 400 + + property int venousMinimum : -100 + property int venousLowerBound : -100 + property int venousUpperBound : 500 + property int venousMaximum : 800 + + clip: false x : 0 y : 0 @@ -47,10 +58,10 @@ value : vTreatmentPressureOcclusion.pressureocclusion_ArterialPressure // TEST : simulation code - minimum : -400 - maximum : 400 - lowerBound: -300 - upperBound: 100 + minimum : _root.arterialMinimum + lowerBound : _root.arterialLowerBound + upperBound : _root.arterialUpperBound + maximum : _root.arterialMaximum Text { id: _arterialText anchors { @@ -74,10 +85,10 @@ value : vTreatmentPressureOcclusion.pressureocclusion_VenousPressure // TEST : simulation code - minimum: -100 - maximum: 800 - lowerBound: -100 - upperBound: 500 + minimum : _root.venousMinimum + lowerBound : _root.venousLowerBound + upperBound : _root.venousUpperBound + maximum : _root.venousMaximum Text { id: _venousText anchors { Index: sources/model/mmodel.h =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/model/mmodel.h (.../mmodel.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/model/mmodel.h (.../mmodel.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -24,6 +24,7 @@ #include "mtreatmentoutletflow.h" #include "mtreatmentpressureocclusion.h" #include "mtreatmentadjustblooddialysateresponse.h" +#include "mtreatmentranges.h" /*! * \brief Message interpretation instruction @@ -113,6 +114,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PressureOcclusionData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRangesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) //--------------------------------------------------------------------------------// @@ -124,6 +126,7 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( PressureOcclusionData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRangesData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) //--------------------------------------------------------------------------------// #define REGISTER_MODEL_METATYPES \ @@ -135,6 +138,7 @@ REGISTER_METATYPE( AlarmStatusData ) \ REGISTER_METATYPE( AlarmStatusFlag ) \ REGISTER_METATYPE( PowerOffData ) \ + REGISTER_METATYPE( TreatmentRangesData ) \ REGISTER_METATYPE( AdjustBloodDialysateResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_INTERPRETER_CONNECTIONS \ @@ -145,6 +149,7 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PressureOcclusionData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PowerOffData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, TreatmentRangesData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustBloodDialysateResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_SIGNALS \ @@ -155,6 +160,7 @@ ACTION_RECEIVE_SIGNAL( PressureOcclusionData ) \ ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \ ACTION_RECEIVE_SIGNAL( PowerOffData ) \ + ACTION_RECEIVE_SIGNAL( TreatmentRangesData ) \ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// Index: sources/model/mtreatmentranges.cpp =================================================================== diff -u --- sources/model/mtreatmentranges.cpp (revision 0) +++ sources/model/mtreatmentranges.cpp (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -0,0 +1,64 @@ +/*! + * + * 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 mtreatmentranges.cpp + * date 3/30/2020 + * author Behrouz NematiPour + * + */ +#include "mtreatmentranges.h" + +using namespace Model; + +QString MTreatmentRanges::toString() const { + return QString(stringPrefix + "(%1, %2, %3, %4, %5, %6)") + .arg(_data.mDuration_Min .value) + .arg(_data.mDuration_Max .value) + .arg(_data.mUltrafiltration_Volume_Min .value) + .arg(_data.mUltrafiltration_Volume_Max .value) + .arg(_data.mDialysate_Flow_Min .value) + .arg(_data.mDialysate_Flow_Max .value); +} + +void MTreatmentRanges::toVariantList(QVariantList &vData) const { + vData += _data.mDuration_Min .value; + vData += _data.mDuration_Max .value; + vData += _data.mUltrafiltration_Volume_Min .value; + vData += _data.mUltrafiltration_Volume_Max .value; + vData += _data.mDialysate_Flow_Min .value; + vData += _data.mDialysate_Flow_Max .value; +} + +bool MTreatmentRanges::fromByteArray(const QByteArray &vByteArray) { + int index = 0; // message data start position + if (Types::getValue<>(vByteArray, index, _data.mDuration_Min )) + if (Types::getValue<>(vByteArray, index, _data.mDuration_Max )) + if (Types::getValue<>(vByteArray, index, _data.mUltrafiltration_Volume_Min )) + if (Types::getValue<>(vByteArray, index, _data.mUltrafiltration_Volume_Max )) + if (Types::getValue<>(vByteArray, index, _data.mDialysate_Flow_Min )) + if (Types::getValue<>(vByteArray, index, _data.mDialysate_Flow_Max )) + return true ; + else return false; + else return false; + else return false; + else return false; + else return false; + else return false; + +} + +MTreatmentRanges::Data MTreatmentRanges::data() const { + Data data; + data.mDuration_Min = _data.mDuration_Min .value; + data.mDuration_Max = _data.mDuration_Max .value; + data.mUltrafiltration_Volume_Min = _data.mUltrafiltration_Volume_Min .value; + data.mUltrafiltration_Volume_Max = _data.mUltrafiltration_Volume_Max .value; + data.mDialysate_Flow_Min = _data.mDialysate_Flow_Min .value; + data.mDialysate_Flow_Max = _data.mDialysate_Flow_Max .value; + return data; +} Index: sources/model/mtreatmentranges.h =================================================================== diff -u --- sources/model/mtreatmentranges.h (revision 0) +++ sources/model/mtreatmentranges.h (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -0,0 +1,58 @@ +/*! + * + * 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 mtreatmentranges.h + * date 3/30/2020 + * author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +namespace Model { + +class MTreatmentRanges { +public: + QString stringPrefix = "Treatment Ranges"; + struct Data { + quint32 mDuration_Min = 0; /*!< mDuration_Min value of type U32 extracted out */ + quint32 mDuration_Max = 0; /*!< mDuration_Max value of type U32 extracted out */ + float mUltrafiltration_Volume_Min = 0; /*!< mUltrafiltration_Volume_Min value of type float extracted out */ + float mUltrafiltration_Volume_Max = 0; /*!< mUltrafiltration_Volume_Max value of type float extracted out */ + quint32 mDialysate_Flow_Min = 0; /*!< mDialysate_Flow_Min value of type U32 extracted out */ + quint32 mDialysate_Flow_Max = 0; /*!< mDialysate_Flow_Max value of type U32 extracted out */ + }; + +private: + struct { + Types::U32 mDuration_Min ; + Types::U32 mDuration_Max ; + Types::F32 mUltrafiltration_Volume_Min ; + Types::F32 mUltrafiltration_Volume_Max ; + Types::U32 mDialysate_Flow_Min ; + Types::U32 mDialysate_Flow_Max ; + } _data; + +public: + MTreatmentRanges () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray ); + + Data data() const; +}; + +} + +typedef Model::MTreatmentRanges::Data TreatmentRangesData; Index: sources/utility/format.cpp =================================================================== diff -u -rfef563aa317eb3e025e2dab0264e854f05a216d6 -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/utility/format.cpp (.../format.cpp) (revision fef563aa317eb3e025e2dab0264e854f05a216d6) +++ sources/utility/format.cpp (.../format.cpp) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -66,6 +66,34 @@ return mData; } + if ( vData.type() == QVariant::UInt ) { + Types::U32 u32; + quint32 value; + bool ok = false; + value = vData.toUInt(&ok); + if (ok) { + u32.value = value; + } else { + u32.value = 0; + } + Types::setValue(u32, mData); + return mData; + } + + if ( vData.type() == QVariant::Int ) { + Types::S32 s32; + qint32 value; + bool ok = false; + value = vData.toInt(&ok); + if (ok) { + s32.value = value; + } else { + s32.value = 0; + } + Types::setValue(s32, mData); + return mData; + } + if ( vData.type() == QVariant::List ) { QVariantList list = vData.toList(); for(auto item: list) { Index: sources/view/vtreatmentranges.cpp =================================================================== diff -u --- sources/view/vtreatmentranges.cpp (revision 0) +++ sources/view/vtreatmentranges.cpp (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -0,0 +1,29 @@ +/*! + * + * 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 vtreatmentranges.cpp + * date 3/31/2020 + * author Behrouz NematiPour + * + */ +#include "vtreatmentranges.h" + +// Project +#include "guicontroller.h" + +VIEW_DEF(VTreatmentRanges, TreatmentRangesData) + +void VTreatmentRanges::onActionReceive(const TreatmentRangesData &vData) +{ + treatmentRanges_Duration_Min ( vData.mDuration_Min ); + treatmentRanges_Duration_Max ( vData.mDuration_Max ); + treatmentRanges_Ultrafiltration_Volume_Min ( vData.mUltrafiltration_Volume_Min ); + treatmentRanges_Ultrafiltration_Volume_Max ( vData.mUltrafiltration_Volume_Max ); + treatmentRanges_Dialysate_Flow_Min ( vData.mDialysate_Flow_Min ); + treatmentRanges_Dialysate_Flow_Max ( vData.mDialysate_Flow_Max ); +} Index: sources/view/vtreatmentranges.h =================================================================== diff -u --- sources/view/vtreatmentranges.h (revision 0) +++ sources/view/vtreatmentranges.h (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -0,0 +1,40 @@ +/*! + * + * 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 vtreatmentranges.h + * date 3/31/2020 + * author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "mmodel.h" +#include "vview.h" + +// namespace +namespace View { + +class VTreatmentRanges : public QObject +{ + Q_OBJECT + + PROPERTY( quint32, treatmentRanges_Duration_Min , 0, false) + PROPERTY( quint32, treatmentRanges_Duration_Max , 0, false) + PROPERTY( float , treatmentRanges_Ultrafiltration_Volume_Min, 0, false) + PROPERTY( float , treatmentRanges_Ultrafiltration_Volume_Max, 0, false) + PROPERTY( quint32, treatmentRanges_Dialysate_Flow_Min , 0, false) + PROPERTY( quint32, treatmentRanges_Dialysate_Flow_Max , 0, false) + + VIEW_DEC(VTreatmentRanges, TreatmentRangesData) + +}; +} Index: sources/view/vview.h =================================================================== diff -u -rf148379112a69d1c52027f2667e95f3f96d948ad -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 --- sources/view/vview.h (.../vview.h) (revision f148379112a69d1c52027f2667e95f3f96d948ad) +++ sources/view/vview.h (.../vview.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) @@ -79,6 +79,7 @@ REGISTER_TYPE( VTreatmentPressureOcclusion ) \ REGISTER_TYPE( VTreatmentTime ) \ REGISTER_TYPE( VTreatmentAdjustmentsResponse ) \ + REGISTER_TYPE( VTreatmentRanges ) \ REGISTER_TYPE( VAlarmStatus ) \ REGISTER_TYPE( VPowerOff ) //--------------------------------------------------------------------------------// @@ -94,5 +95,6 @@ #include "vtreatmentpressureocclusion.h" #include "vtreatmenttime.h" #include "vtreatmentadjustmentsresponse.h" +#include "vtreatmentranges.h" #include "valarmstatus.h" #include "vpoweroff.h"