Index: denali.pro =================================================================== diff -u -rd07ec81c7002ed2ac60c1dfc3101fb820e88211c -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- denali.pro (.../denali.pro) (revision d07ec81c7002ed2ac60c1dfc3101fb820e88211c) +++ denali.pro (.../denali.pro) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -42,6 +42,7 @@ sources/main.h \ sources/maintimer.h \ sources/model/mtreatmentadjustblooddialysateresponse.h \ + sources/model/mtreatmentadjustdurationresponse.h \ sources/model/mtreatmentpressureocclusion.h \ sources/model/mtreatmentranges.h \ sources/threads.h \ @@ -88,6 +89,7 @@ main.cpp \ sources/maintimer.cpp \ sources/model/mtreatmentadjustblooddialysateresponse.cpp \ + sources/model/mtreatmentadjustdurationresponse.cpp \ sources/model/mtreatmentpressureocclusion.cpp \ sources/model/mtreatmentranges.cpp \ sources/threads.cpp \ Index: sources/applicationcontroller.cpp =================================================================== diff -u -r93d7ff58cd6fd2fea5d00587ee712a637fc941bf -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 93d7ff58cd6fd2fea5d00587ee712a637fc941bf) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -114,6 +114,9 @@ connect(&_GuiController , SIGNAL(didAdjustBloodDialysateFlows(quint32, quint32)), this , SLOT( onAdjustBloodDialysateFlows(quint32, quint32))); + connect(&_GuiController , SIGNAL(didAdjustDuration(quint32)), + this , SLOT( onAdjustDuration(quint32))); + ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_MessageDispatcher) } @@ -248,6 +251,13 @@ } // coco end +/*! + * \brief ApplicationController::onAdjustBloodDialysateFlows + * \details This method transmits the Blood/Dialysate Adjustment Denali message. + * \param vBloodFlow - Blood Flow Rate + * \param vDialysateFlow - Dialysate Flow Rate + * \return void + */ void ApplicationController::onAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) { QVariantList mData; @@ -257,6 +267,19 @@ } /*! + * \brief ApplicationController::onAdjustDuration + * \details This method transmits the Blood/Dialysate Adjustment Denali message. + * \param vDuration - Treatment duration adjustment value in minuts + * \return void + */ +void ApplicationController::onAdjustDuration(quint32 vDuration) +{ + QVariantList mData; + mData += vDuration; + onActionTransmit(GuiActionType::AdjustDurationReq, mData); +} + +/*! * \brief ApplicationController::keepAlive * \details This is the message which has to be send over the CANBUS * as an monitor for other nodes on the bus to notify UI is alive Index: sources/applicationcontroller.h =================================================================== diff -u -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -79,6 +79,7 @@ void onExport (); void onAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); + void onAdjustDuration (quint32 vDuration); ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS @@ -93,5 +94,6 @@ void didExport (); void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); + void didAdjustDuration(quint32 vDuration); }; Index: sources/canbus/messagedispatcher.h =================================================================== diff -u -r5626bf604947efe5a80c9ca51802aab1a70a6939 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 5626bf604947efe5a80c9ca51802aab1a70a6939) +++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -102,7 +102,8 @@ bool _init = false; QList _needsAcknow { - GuiActionType::AdjustBloodDialysateReq + GuiActionType::AdjustBloodDialysateReq , + GuiActionType::AdjustDurationReq , }; // no action needs Acknow for now // Singleton Index: sources/canbus/messageglobals.h =================================================================== diff -u -r5626bf604947efe5a80c9ca51802aab1a70a6939 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 5626bf604947efe5a80c9ca51802aab1a70a6939) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -43,28 +43,33 @@ */ const QHash payloadLen { // ---- - {Gui::GuiActionType::PowerOff , 1 }, - {Gui::GuiActionType::PowerOffBroadcast , 0 }, - {Gui::GuiActionType::KeepAlive , 255 }, // 0 => 255 to be able to run a multi-frame test. - {Gui::GuiActionType::BloodFlow , 7 * 4 }, // 7 parameters each 4bytes - {Gui::GuiActionType::DialysateInletFlow , 7 * 4 }, // 7 parameters each 4bytes - {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::PowerOff , 1 }, + {Gui::GuiActionType::PowerOffBroadcast , 0 }, + {Gui::GuiActionType::KeepAlive , 255 }, // 0 => 255 to be able to run a multi-frame test. + {Gui::GuiActionType::BloodFlow , 7 * 4 }, // 7 parameters each 4bytes + {Gui::GuiActionType::DialysateInletFlow , 7 * 4 }, // 7 parameters each 4bytes + {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::AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes + {Gui::GuiActionType::AlarmStatus , 4 * 4 + 2 }, // 4 parameters each 4bytes + 1 parameter 2bytes // ---- - {Gui::GuiActionType::AdjustBloodDialysateReq , 2 * 4 }, // 2 parameters each 4bytes - {Gui::GuiActionType::AdjustBloodDialysateRsp , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes // ---- - {Gui::GuiActionType::TreatmentRanges , 6 * 4 }, // 6 parameters each 4bytes + {Gui::GuiActionType::AdjustBloodDialysateReq , 2 * 4 }, // 2 parameters each 4bytes + {Gui::GuiActionType::AdjustBloodDialysateRsp , 4 * 4 }, // 4 parameters each 4bytes // ---- - {Gui::GuiActionType::String , 255 }, - {Gui::GuiActionType::Acknow , 0 }, + {Gui::GuiActionType::AdjustDurationReq , 1 * 4 }, // 1 parameters each 4bytes + {Gui::GuiActionType::AdjustDurationRsp , 4 * 4 }, // 4 parameters each 4bytes + + + // ---- + {Gui::GuiActionType::String , 255 }, + {Gui::GuiActionType::Acknow , 0 }, }; /*! Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r028d387c263ec7d991263db45bebabc27223c379 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 028d387c263ec7d991263db45bebabc27223c379) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -20,7 +20,6 @@ #include "logger.h" #include "format.h" - using namespace Can; /*! @@ -106,6 +105,12 @@ } break; + case Gui::GuiActionType::AdjustDurationReq: + if (count) { + vPayload = Format::fromVariant(vData); + } + break; + default: QString mActionIdHexString = Format::toHexString(vActionId); LOG_ERROR(tr("Unknown Message ID (UI) '%1'").arg(mActionIdHexString)); @@ -236,12 +241,16 @@ ok = pressureOcclusionData (vMessage, vData); break; + case Gui::GuiActionType::TreatmentRanges: + ok = treatmentRangesData (vMessage, vData); + break; + case Gui::GuiActionType::AdjustBloodDialysateRsp: ok = adjustBloodDialysateData (vMessage, vData); break; - case Gui::GuiActionType::TreatmentRanges: - ok = treatmentRangesData (vMessage, vData); + case Gui::GuiActionType::AdjustDurationRsp: + ok = adjustDurationData (vMessage, vData); break; default: @@ -619,6 +628,32 @@ } /*! + * \brief MessageInterpreter::getTreatmentRangesData + * \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, + * require to be interpreted. + * \param vData - Treatment Ranges data + * \return true if the data can be extracted as defined for Treatment Ranges Message ID + */ +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; +} + +/*! * \brief MessageInterpreter::adjustBloodDialysateData * \details This method interprets AdjustBlood Dialysate Response message data * in vMessage of type Message. @@ -645,22 +680,21 @@ } /*! - * \brief MessageInterpreter::getTreatmentRangesData - * \details This method interprets Treatment Ranges message data + * \brief MessageInterpreter::adjustDurationData + * \details This method interprets Treatment Duration Adjustment Response 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 - Treatment Ranges data - * \return true if the data can be extracted as defined for Treatment Ranges Message ID + * \param vData - Treatment Duration Adjustment Response data + * \return true if the data can be extracted as defined for Treatment Duration Adjustment Response Message ID */ -bool MessageInterpreter::treatmentRangesData(const Message &vMessage, QVariantList &vData) +bool MessageInterpreter::adjustDurationData(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; + if ( ! isType (vMessage, Gui::GuiActionType::AdjustDurationRsp) ) return ok; + if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::AdjustDurationRsp) ) return ok; - Model::MTreatmentRanges mData; + Model::MAdjustDurationResponse mData; ok = mData.fromByteArray(vMessage.data); LOG_DATUM(mData.toString()); @@ -669,3 +703,4 @@ return ok; } + Index: sources/canbus/messageinterpreter.h =================================================================== diff -u -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -78,11 +78,14 @@ bool getPressureOcclusionData(const Message &vMessage, Model::MPressureOcclusion &vData) __attribute_warn_unused_result__; bool pressureOcclusionData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Treatment Ranges + bool treatmentRangesData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Treatment Adjust response for Blood/Dialysate Flow Rate - bool adjustBloodDialysateData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + bool adjustBloodDialysateData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ---- Treatment Ranges - bool treatmentRangesData(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Treatment Adjust response for Treatment Duration + bool adjustDurationData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; public: explicit MessageInterpreter(QObject *parent = nullptr); Index: sources/gui/guicontroller.cpp =================================================================== diff -u -r93d7ff58cd6fd2fea5d00587ee712a637fc941bf -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 93d7ff58cd6fd2fea5d00587ee712a637fc941bf) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -281,3 +281,8 @@ { emit didAdjustBloodDialysateFlows(vBloodFlow, vDialysateFlow); } + +void GuiController::doAdjustDuration(quint32 vDuration) +{ + emit didAdjustDuration(vDuration); +} Index: sources/gui/guicontroller.h =================================================================== diff -u -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/guicontroller.h (.../guicontroller.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -86,6 +86,11 @@ signals: void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); +//// ----- Adjust Duration +public slots: + void doAdjustDuration(quint32 vDuration); +signals: + void didAdjustDuration(quint32 vDuration); }; Index: sources/gui/guiglobals.h =================================================================== diff -u -r5ff0e21667deda23a6bd7b4e95dabf5b480dc593 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision 5ff0e21667deda23a6bd7b4e95dabf5b480dc593) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -63,6 +63,9 @@ AdjustBloodDialysateReq = 0x1700, // 23 AdjustBloodDialysateRsp = 0x1800, // 24 + AdjustDurationReq = 0x1600, // 22 + AdjustDurationRsp = 0x1B00, // 27 + TreatmentRanges = 0x1A00, // 26 String = 0xFFFE, Index: sources/gui/guiview.cpp =================================================================== diff -u -reea63d68fc0fb269f8dec64d99f488bcad117220 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/guiview.cpp (.../guiview.cpp) (revision eea63d68fc0fb269f8dec64d99f488bcad117220) +++ sources/gui/guiview.cpp (.../guiview.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -66,6 +66,10 @@ // ----- Adjust Blood/Dialysate Flows connect(this , SIGNAL(didAdjustBloodDialysateFlows(quint32, quint32)), &_GuiController, SLOT( doAdjustBloodDialysateFlows(quint32, quint32))); + // ----- Adjust Treatment Duration + connect(this , SIGNAL(didAdjustDuration(quint32)), + &_GuiController, SLOT( doAdjustDuration(quint32))); + } /*! Index: sources/gui/guiview.h =================================================================== diff -u -r9d2940c9f09ace35e4e0501a61d46b6bdf789dab -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/guiview.h (.../guiview.h) (revision 9d2940c9f09ace35e4e0501a61d46b6bdf789dab) +++ sources/gui/guiview.h (.../guiview.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -60,12 +60,18 @@ void didExportLog(); void didExport (); -// ----- Adjust Blood/Dialysate Flows public slots: - void doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) { - emit didAdjustBloodDialysateFlows(vBloodFlow, vDialysateFlow); + // ----- Adjust Blood/Dialysate Flows + void doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) { + emit didAdjustBloodDialysateFlows( vBloodFlow, vDialysateFlow); } + // ----- Adjust Duration + void doAdjustDuration (quint32 vDuratoin ) { + emit didAdjustDuration ( vDuratoin); + } signals: void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); + void didAdjustDuration (quint32 vDuration ); + }; } Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -r45617764a63d5573bfb942b039f2854ed25ba15d -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 45617764a63d5573bfb942b039f2854ed25ba15d) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -48,4 +48,7 @@ readonly property int fontPixelSliderMarker : 17 readonly property int fontPixelNotification : 24 + + readonly property int fontPixelDurationCurTime : 89 + readonly property int fontPixelDurationAdjTime : 28 } Index: sources/gui/qml/main.qml =================================================================== diff -u -r34471900489397f483e052870ddc46059cef49fb -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/qml/main.qml (.../main.qml) (revision 34471900489397f483e052870ddc46059cef49fb) +++ sources/gui/qml/main.qml (.../main.qml) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -61,12 +61,13 @@ // TODO : When Testing data on Setting screen is removed // This needs to be moved into the TreatmentFlows.qml -import VTreatmentBloodFlow 0.1; -import VTreatmentDialysateFlow 0.1; -import VTreatmentUltrafiltration 0.1; -import VTreatmentTime 0.1; -import VAlarmStatus 0.1; -import VPowerOff 0.1; +import VTreatmentAdjustmentsResponse 0.1; +import VTreatmentBloodFlow 0.1; +import VTreatmentDialysateFlow 0.1; +import VTreatmentUltrafiltration 0.1; +import VTreatmentTime 0.1; +import VAlarmStatus 0.1; +import VPowerOff 0.1; // Qml imports import "qrc:/globals" @@ -101,13 +102,14 @@ // TODO : When Testing data on Setting screen is removed // This needs to be moved into the Treatment______.qml - VTreatmentBloodFlow { id: vTreatmentBloodFlow } - VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } - VTreatmentUltrafiltration { id: vTreatmentUltrafiltration } - VTreatmentTime { id: vTreatmentTime } - VAlarmStatus { id: vAlarmStatus } - VPowerOff { id: vPowerOff - onPoweroff_statusChanged: { + VTreatmentAdjustmentsResponse { id: vTreatmentAdjustmentsResponse } + VTreatmentBloodFlow { id: vTreatmentBloodFlow } + VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } + VTreatmentUltrafiltration { id: vTreatmentUltrafiltration } + VTreatmentTime { id: vTreatmentTime } + VAlarmStatus { id: vAlarmStatus } + VPowerOff { id: vPowerOff + onPoweroff_statusChanged: { switch (vpoweroff_status) { case GuiActions.Command: _powerOffDialog.open() Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml =================================================================== diff -u -r34471900489397f483e052870ddc46059cef49fb -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 34471900489397f483e052870ddc46059cef49fb) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -21,60 +21,55 @@ import "qrc:/globals" import "qrc:/components" -// import VTreatmentAdjustmentsResponse 0.1; - /*! * \brief TreatmentAdjustmentDuration.qml is the screen * To adjust the treatment duration */ TreatmentAdjustmentBase { id: _root + property alias durationValue : _durationSlider.value + property alias durationMinimum : _durationSlider.minimum + property alias durationMaximum : _durationSlider.maximum + property alias durationStep : _durationSlider.step - property int durationValue : 0 - property alias durationMinimum : _durationSlider.minimum - property alias durationMaximum : _durationSlider.maximum - property alias durationStep : _durationSlider.step + property alias currentTime : _currentTimeText.seconds + property alias durationTime : _durationText.seconds - property alias currentTime : _currentTimeText.seconds - property alias durationTime : _durationText.seconds + property int textWidth : 200 - property int textWidth : 200 - - titleText: qsTr("TREATMENT DURATION") - // VTreatmentAdjustmentsResponse { id: vTreatmentAdjustmentsResponse - // onAdjustment_TriggeredChanged: { - // if ( adjustment_Accepted ) { - // accept() - // } else { - // _bloodFlowSlider .value = vTreatmentAdjustmentsResponse. bloodFlow_FlowSetPoint; - // _dialysateFlowSlider.value = vTreatmentAdjustmentsResponse.dialysateFlow_FlowSetPoint; - // notificationText = vTreatmentAdjustmentsResponse.text(); - // } - // } - // } + Connections { target: vTreatmentAdjustmentsResponse + onAdjustment_Duration_TriggeredChanged: { + if ( adjustment_Accepted ) { + accept() + } else { + _durationSlider .value = vTreatmentAdjustmentsResponse.duration; + notificationText = vTreatmentAdjustmentsResponse.text(); + } + } + } Column { id : _column spacing: 65 anchors.centerIn: parent TimeText { id: _currentTimeText seconds: vTreatmentTime.time_Elapsed secondsVisible: false - textPixelSize: 89 // TODO : Variables + textPixelSize: Fonts.fontPixelDurationCurTime anchors.horizontalCenter: parent.horizontalCenter } Slider { id : _durationSlider anchors.horizontalCenter: parent.horizontalCenter width : 880 - height : 5 - minimum : 0 // TODO : From ranges model - maximum : 8 * 60 // TODO : From ranges model + height : 5 + minimum : 60 * vTreatmentRanges.treatmentRanges_Duration_Min // to Minutes + maximum : 60 * vTreatmentRanges.treatmentRanges_Duration_Max // to Minutes step : Variables.durationResolution minText.visible: false maxText.visible: false TimeText { id: _durationText - seconds: _durationSlider.value * 60 + seconds: 60 * _durationSlider.value // to Seconds secondsVisible: false - textPixelSize: 28 // TODO : Variables + textPixelSize: Fonts.fontPixelDurationAdjTime textWeight: Font.Medium anchors { top : _durationSlider.handler.bottom Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml =================================================================== diff -u -r34471900489397f483e052870ddc46059cef49fb -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision 34471900489397f483e052870ddc46059cef49fb) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -21,8 +21,6 @@ import "qrc:/globals" import "qrc:/components" -import VTreatmentAdjustmentsResponse 0.1; - /*! * \brief TreatmentAdjustmentFlow.qml is the screen * To adjust the treatment blood/dialysate flow @@ -51,8 +49,8 @@ dialysateFlowRateValue = vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint } - VTreatmentAdjustmentsResponse { id: vTreatmentAdjustmentsResponse - onAdjustment_TriggeredChanged: { + Connections { target: vTreatmentAdjustmentsResponse + onAdjustment_Flow_TriggeredChanged: { if ( adjustment_Accepted ) { accept() } else { Index: sources/model/mmodel.h =================================================================== diff -u -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/model/mmodel.h (.../mmodel.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) +++ sources/model/mmodel.h (.../mmodel.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -24,6 +24,7 @@ #include "mtreatmentoutletflow.h" #include "mtreatmentpressureocclusion.h" #include "mtreatmentadjustblooddialysateresponse.h" +#include "mtreatmentadjustdurationresponse.h" #include "mtreatmentranges.h" /*! @@ -115,7 +116,8 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRangesData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \ @@ -127,7 +129,8 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRangesData ) \ - ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) //--------------------------------------------------------------------------------// #define REGISTER_MODEL_METATYPES \ REGISTER_METATYPE( BloodFlowData ) \ @@ -139,7 +142,8 @@ REGISTER_METATYPE( AlarmStatusFlag ) \ REGISTER_METATYPE( PowerOffData ) \ REGISTER_METATYPE( TreatmentRangesData ) \ - REGISTER_METATYPE( AdjustBloodDialysateResponseData ) + REGISTER_METATYPE( AdjustBloodDialysateResponseData ) \ + REGISTER_METATYPE( AdjustDurationResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_INTERPRETER_CONNECTIONS \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, BloodFlowData ) \ @@ -150,7 +154,8 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PowerOffData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, TreatmentRangesData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustBloodDialysateResponseData ) + ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustBloodDialysateResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustDurationResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_SIGNALS \ ACTION_RECEIVE_SIGNAL( BloodFlowData ) \ @@ -161,6 +166,7 @@ ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \ ACTION_RECEIVE_SIGNAL( PowerOffData ) \ ACTION_RECEIVE_SIGNAL( TreatmentRangesData ) \ - ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) + ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustDurationResponseData ) //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// Index: sources/model/mtreatmentadjustblooddialysateresponse.cpp =================================================================== diff -u -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/model/mtreatmentadjustblooddialysateresponse.cpp (.../mtreatmentadjustblooddialysateresponse.cpp) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) +++ sources/model/mtreatmentadjustblooddialysateresponse.cpp (.../mtreatmentadjustblooddialysateresponse.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -6,7 +6,7 @@ * IN PART OR IN WHOLE, * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * file mtreatmentpressureocclusion.cpp + * file mtreatmentadjustblooddialysateresponse.cpp * date 3/23/2020 * author Behrouz NematiPour * Index: sources/model/mtreatmentadjustblooddialysateresponse.h =================================================================== diff -u -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/model/mtreatmentadjustblooddialysateresponse.h (.../mtreatmentadjustblooddialysateresponse.h) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) +++ sources/model/mtreatmentadjustblooddialysateresponse.h (.../mtreatmentadjustblooddialysateresponse.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -6,7 +6,7 @@ * IN PART OR IN WHOLE, * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * file mtreatmentpressureocclusion.h + * file mtreatmentadjustblooddialysateresponse.h * date 3/23/2020 * author Behrouz NematiPour * Index: sources/model/mtreatmentadjustdurationresponse.cpp =================================================================== diff -u --- sources/model/mtreatmentadjustdurationresponse.cpp (revision 0) +++ sources/model/mtreatmentadjustdurationresponse.cpp (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -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 mtreatmentpressureocclusion.cpp + * date 3/23/2020 + * author Behrouz NematiPour + * + */ +#include "mtreatmentadjustdurationresponse.h" + +using namespace Model; + +QString MAdjustDurationResponse::toString() const { + return QString(stringPrefix + "(%1, %2, %3, %4)") + .arg(_data.mAccepted .value) + .arg(_data.mReason .value) + .arg(_data.mDuration .value) + .arg(_data.mUFVolume .value); +} + +void MAdjustDurationResponse::toVariantList(QVariantList &vData) const { + vData += _data.mAccepted .value; + vData += _data.mReason .value; + vData += _data.mDuration .value; + vData += _data.mUFVolume .value; +} + +bool MAdjustDurationResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + if (GetValue(vByteArray, index, _data.mDuration )) + if (GetValue(vByteArray, index, _data.mUFVolume )) + 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; } +} + +AdjustDurationResponseData MAdjustDurationResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted .value; + data.mReason = _data.mReason .value; + data.mDuration = _data.mDuration .value; + data.mUFVolume = _data.mUFVolume .value; + return data; +} Index: sources/model/mtreatmentadjustdurationresponse.h =================================================================== diff -u --- sources/model/mtreatmentadjustdurationresponse.h (revision 0) +++ sources/model/mtreatmentadjustdurationresponse.h (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -0,0 +1,61 @@ +/*! + * + * 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 mtreatmentadjustduration.h + * date 4/27/2020 + * author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +class MAdjustDurationResponse { + + // friends + friend class ::tst_models; + +public: + QString stringPrefix = "Adjust Duration"; + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mDuration = 0; /*!< Duration value of type quint32 extracted out */ + float mUFVolume = 0; /*!< UF Volume value of type quint32 extracted out */ + }; + +private: + struct { + Types::U32 mAccepted ; + Types::U32 mReason ; + Types::U32 mDuration ; + Types::F32 mUFVolume ; + } _data; + +public: + MAdjustDurationResponse () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; + +} + +typedef Model::MAdjustDurationResponse::Data AdjustDurationResponseData; Index: sources/utility/format.cpp =================================================================== diff -u -r4295d12645b607b7c0cca8733c3d9eb5f538b418 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/utility/format.cpp (.../format.cpp) (revision 4295d12645b607b7c0cca8733c3d9eb5f538b418) +++ sources/utility/format.cpp (.../format.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -44,8 +44,9 @@ * \details This static method converts the defined types into QByteArray * \param vData - The value * \return The QByteAttay of the value vData if can't be converted 0x00 will be returned - * \note Regarding the QVariant type conversion, if cannot be cionverted 0 will be returned + * \note Regarding the QVariant type conversion, if cannot be converted 0 will be returned * This rule has been used and also to be consistent followed the sae rule. + * \note This method converts both float and double to F32 and returnds its QByteArray representation. */ QByteArray Format::fromVariant(const QVariant &vData) { Index: sources/view/vtreatmentadjustmentsresponse.cpp =================================================================== diff -u -rd07ec81c7002ed2ac60c1dfc3101fb820e88211c -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/view/vtreatmentadjustmentsresponse.cpp (.../vtreatmentadjustmentsresponse.cpp) (revision d07ec81c7002ed2ac60c1dfc3101fb820e88211c) +++ sources/view/vtreatmentadjustmentsresponse.cpp (.../vtreatmentadjustmentsresponse.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -30,9 +30,21 @@ // *** has to be the last to let the information to be set and then emit the signal *** // *** otherwise will use the previous values before being set. *** - adjustment_Triggered ( true ); + adjustment_Flow_Triggered( true ); } +void VTreatmentAdjustmentsResponse::onActionReceive(const AdjustDurationResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + duration ( vData.mDuration ); + UFVolume ( vData.mUFVolume ); + + // *** has to be the last to let the information to be set and then emit the signal *** + // *** otherwise will use the previous values before being set. *** + adjustment_Duration_Triggered( true ); +} + /*! * \brief VTreatmentAdjustmentsResponse::reasonText * \details this code is the place holder for the alarms description mapping Index: sources/view/vtreatmentadjustmentsresponse.h =================================================================== diff -u -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/view/vtreatmentadjustmentsresponse.h (.../vtreatmentadjustmentsresponse.h) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) +++ sources/view/vtreatmentadjustmentsresponse.h (.../vtreatmentadjustmentsresponse.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -45,10 +45,14 @@ PROPERTY( quint32 , bloodFlow_FlowSetPoint , 0, false) PROPERTY( quint32 , dialysateFlow_FlowSetPoint , 0, false) + PROPERTY( quint32 , duration , 0, false) + PROPERTY( float , UFVolume , 0, false) + // coco begin validated: The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI // has been manually tested that it works perfectly fine - PROPERTY( bool , adjustment_Triggered , 0, true ) + PROPERTY( bool , adjustment_Flow_Triggered , 0, true ) + PROPERTY( bool , adjustment_Duration_Triggered , 0, true ) // coco end VIEW_DEC_CLASS(VTreatmentAdjustmentsResponse) Index: sources/view/vview.h =================================================================== diff -u -r8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 --- sources/view/vview.h (.../vview.h) (revision 8f6f7c11390e3ed6d918f1717d8e8b7ae5b7e5c6) +++ sources/view/vview.h (.../vview.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) @@ -84,10 +84,12 @@ REGISTER_TYPE( VPowerOff ) //--------------------------------------------------------------------------------// #define VIEW_DEF_CONNECTION_ADJUSTMENTS \ - ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustBloodDialysateResponseData); + ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustBloodDialysateResponseData); \ + ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustDurationResponseData); //--------------------------------------------------------------------------------// #define VIEW_DEC_SLOT_ADJUSTMENTS \ - VIEW_DEC_SLOT(AdjustBloodDialysateResponseData) + VIEW_DEC_SLOT(AdjustBloodDialysateResponseData) \ + VIEW_DEC_SLOT(AdjustDurationResponseData) //--------------------------------------------------------------------------------// #include "vtreatmentbloodflow.h" #include "vtreatmentdialysateflow.h"