Index: denali.pro =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- denali.pro (.../denali.pro) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ denali.pro (.../denali.pro) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -43,8 +43,10 @@ sources/maintimer.h \ sources/model/mtreatmentadjustblooddialysateresponse.h \ sources/model/mtreatmentadjustdurationresponse.h \ + sources/model/mtreatmentadjustultrafiltrationresponse.h \ sources/model/mtreatmentpressureocclusion.h \ sources/model/mtreatmentranges.h \ + sources/model/mtreatmentultrafiltrationstate.h \ sources/threads.h \ sources/applicationcontroller.h \ sources/applicationpost.h \ @@ -69,8 +71,10 @@ sources/view/vtreatmentadjustmentduration.h \ sources/view/vtreatmentadjustmentflows.h \ sources/view/vtreatmentadjustmentsresponse.h \ + sources/view/vtreatmentadjustmentultrafiltration.h \ sources/view/vtreatmentpressureocclusion.h \ sources/view/vtreatmentranges.h \ + sources/view/vtreatmentultrafiltrationstate.h \ sources/view/vview.h \ sources/view/vpoweroff.h \ sources/view/vtreatmentbloodflow.h \ @@ -92,8 +96,10 @@ sources/maintimer.cpp \ sources/model/mtreatmentadjustblooddialysateresponse.cpp \ sources/model/mtreatmentadjustdurationresponse.cpp \ + sources/model/mtreatmentadjustultrafiltrationresponse.cpp \ sources/model/mtreatmentpressureocclusion.cpp \ sources/model/mtreatmentranges.cpp \ + sources/model/mtreatmentultrafiltrationstate.cpp \ sources/threads.cpp \ sources/applicationcontroller.cpp \ sources/applicationpost.cpp \ @@ -117,13 +123,15 @@ sources/view/vtreatmentadjustmentduration.cpp \ sources/view/vtreatmentadjustmentflows.cpp \ sources/view/vtreatmentadjustmentsresponse.cpp \ + sources/view/vtreatmentadjustmentultrafiltration.cpp \ 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 \ + sources/view/vtreatmentultrafiltrationstate.cpp \ sources/storage/filehandler.cpp \ sources/storage/logger.cpp \ sources/storage/storageglobals.cpp \ Index: denali.pro.user =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- denali.pro.user (.../denali.pro.user) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ denali.pro.user (.../denali.pro.user) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/applicationcontroller.cpp =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/applicationcontroller.cpp (.../applicationcontroller.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -111,12 +111,15 @@ connect(&_Logger , SIGNAL(didExport()), this , SLOT( onExport())); - connect(&_GuiController , SIGNAL(didAdjustBloodDialysateFlows(quint32, quint32)), - this , SLOT( onAdjustBloodDialysateFlows(quint32, quint32))); + connect(&_GuiController , SIGNAL(didAdjustment(quint32, quint32)), + this , SLOT( onAdjustment(quint32, quint32))); - connect(&_GuiController , SIGNAL(didAdjustDuration(quint32)), - this , SLOT( onAdjustDuration(quint32))); + connect(&_GuiController , SIGNAL(didAdjustment(quint32)), + this , SLOT( onAdjustment(quint32))); + connect(&_GuiController , SIGNAL(didUltrafiltrationStateRequest(quint32)), + this , SLOT( onUltrafiltrationStateRequest(quint32))); + ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_MessageDispatcher) } @@ -252,13 +255,13 @@ // coco end /*! - * \brief ApplicationController::onAdjustBloodDialysateFlows + * \brief ApplicationController::onAdjustment * \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) +void ApplicationController::onAdjustment(quint32 vBloodFlow, quint32 vDialysateFlow) { QVariantList mData; mData += vBloodFlow; @@ -267,18 +270,25 @@ } /*! - * \brief ApplicationController::onAdjustDuration + * \brief ApplicationController::onAdjustment * \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) +void ApplicationController::onAdjustment(quint32 vDuration) { QVariantList mData; mData += vDuration; onActionTransmit(GuiActionType::AdjustDurationReq, mData); } +void ApplicationController::onUltrafiltrationStateRequest(quint32 vState) +{ + QVariantList mData; + mData += vState; + onActionTransmit(GuiActionType::UltrafiltrationState, mData); +} + /*! * \brief ApplicationController::keepAlive * \details This is the message which has to be send over the CANBUS Index: sources/applicationcontroller.h =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/applicationcontroller.h (.../applicationcontroller.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/applicationcontroller.h (.../applicationcontroller.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -78,9 +78,11 @@ void onExportLog (); void onExport (); - void onAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); - void onAdjustDuration (quint32 vDuration); + void onAdjustment(quint32 vBloodFlow, quint32 vDialysateFlow); + void onAdjustment(quint32 vDuration); + void onUltrafiltrationStateRequest(quint32 vState); + ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS signals: @@ -93,7 +95,7 @@ void didExport (); - void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); - void didAdjustDuration(quint32 vDuration); + //void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); + //void didAdjustDuration(quint32 vDuration); }; Index: sources/canbus/messagedispatcher.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messagedispatcher.cpp (.../messagedispatcher.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -318,7 +318,7 @@ case GuiActionType::Acknow: LOG_EVENT(tr("HD Ack Bak %1").arg(mSequence)); #ifdef DEBUG_ACKBACK_HD_TO_UI - qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckBak : %1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence); + qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckBak : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence).arg(vMessage.actionId); #endif emit didAcknowReceive(mSequence); break; @@ -327,7 +327,7 @@ if (mSequence < 0) { LOG_EVENT(tr("HD Ack Req %1").arg(mSequence)); #ifdef DEBUG_ACKBACK_HD_TO_UI - qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckReq : %1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence); + qDebug() << tr(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HD AckReq : %1 %2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ").arg(mSequence).arg(vMessage.actionId); #endif // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UI AckBak is immediately handled at the same place. actionTransmit(GuiActionType::Acknow, {}, -mSequence); Index: sources/canbus/messagedispatcher.h =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messagedispatcher.h (.../messagedispatcher.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -104,6 +104,7 @@ QList _needsAcknow { GuiActionType::AdjustBloodDialysateReq , GuiActionType::AdjustDurationReq , + GuiActionType::UltrafiltrationState , }; // no action needs Acknow for now // Singleton Index: sources/canbus/messageglobals.h =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -66,10 +66,13 @@ {Gui::GuiActionType::AdjustDurationReq , 1 * 4 }, // 1 parameters each 4bytes {Gui::GuiActionType::AdjustDurationRsp , 4 * 4 }, // 4 parameters each 4bytes + {Gui::GuiActionType::UltrafiltrationState , 1 * 4 }, // 1 parameters each 4bytes // ---- {Gui::GuiActionType::String , 255 }, {Gui::GuiActionType::Acknow , 0 }, + {Gui::GuiActionType::AcknowGeneric , 1 }, + }; /*! Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -111,6 +111,12 @@ } break; + case Gui::GuiActionType::UltrafiltrationState: + if (count) { + vPayload = Format::fromVariant(vData); + } + break; + default: QString mActionIdHexString = Format::toHexString(vActionId); LOG_ERROR(tr("Unknown Message ID (UI) '%1'").arg(mActionIdHexString)); @@ -243,7 +249,11 @@ ok = adjustDurationData (vMessage, vData); break; - // unhandles messages: these will only be logged as received message + case Gui::GuiActionType::UltrafiltrationState: // AcknowGeneric : Generic Acknow respose + ok = ultrafiltrationState (vMessage, vData); + break; + + // unhandles messages: these will only be logged as received message // there has nothing been defined for these messages. case Gui::GuiActionType::AlarmTriggered: printUnhandled (vMessage); @@ -711,3 +721,28 @@ return ok; } +/*! + * \brief MessageInterpreter::ultrafiltrationState + * \details This method interprets Treatment Ultrafiltration state change 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 Ultrafiltration state change Response data + * \return true if the data can be extracted as defined for Treatment Duration Adjustment Response Message ID + */ +bool MessageInterpreter::ultrafiltrationState(const Message &vMessage, QVariantList &vData) +{ + bool ok = false; + if ( ! isType (vMessage, Gui::GuiActionType::UltrafiltrationState) ) return ok; + if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::AcknowGeneric ) ) return ok; + + Model::MTreatmentUltrafiltrationState 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 -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/messageinterpreter.h (.../messageinterpreter.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -87,6 +87,9 @@ // ---- Treatment Adjust response for Treatment Duration bool adjustDurationData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + // ---- Treatment Adjust response for Treatment Ultrafiltration state (Pause / Resume) change + bool ultrafiltrationState (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; + public: explicit MessageInterpreter(QObject *parent = nullptr); Index: sources/gui/guicontroller.cpp =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -276,13 +276,3 @@ emit didExportLog(); } // coco end - -void GuiController::doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow) -{ - emit didAdjustBloodDialysateFlows(vBloodFlow, vDialysateFlow); -} - -void GuiController::doAdjustDuration(quint32 vDuration) -{ - emit didAdjustDuration(vDuration); -} Index: sources/gui/guicontroller.h =================================================================== diff -u -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/guicontroller.h (.../guicontroller.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guicontroller.h (.../guicontroller.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -82,16 +82,25 @@ //// ----- Adjust Blood/Dialysate Flows public slots: - void doAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); + void doAdjustment(quint32 vBloodFlow, quint32 vDialysateFlow) { + emit didAdjustment( vBloodFlow, vDialysateFlow);} signals: - void didAdjustBloodDialysateFlows(quint32 vBloodFlow, quint32 vDialysateFlow); + void didAdjustment(quint32 vBloodFlow, quint32 vDialysateFlow); //// ----- Adjust Duration public slots: - void doAdjustDuration(quint32 vDuration); + void doAdjustment(quint32 vDuration) { + emit didAdjustment( vDuration);} signals: - void didAdjustDuration(quint32 vDuration); + void didAdjustment(quint32 vDuration); +//// ----- Pause Ultrafiltration +public slots: + void doUltrafiltrationStateRequest(quint32 vState) { + emit didUltrafiltrationStateRequest( vState);} +signals: + void didUltrafiltrationStateRequest(quint32 vState); + }; } Index: sources/gui/guiglobals.cpp =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/gui/guiglobals.cpp (.../guiglobals.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -27,6 +27,7 @@ #include "vtreatmentbloodflow.h" #include "vtreatmentdialysateflow.h" #include "vtreatmentultrafiltration.h" +#include "vtreatmentultrafiltrationstate.h" #include "vtreatmentpressureocclusion.h" #include "vtreatmenttime.h" #include "vtreatmentranges.h" @@ -35,6 +36,7 @@ #include "vtreatmentadjustmentduration.h" #include "vtreatmentadjustmentflows.h" +#include "vtreatmentadjustmentultrafiltration.h" namespace Gui { QQuickView *_viewer = nullptr; Index: sources/gui/guiglobals.h =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/guiglobals.h (.../guiglobals.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/gui/guiglobals.h (.../guiglobals.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -65,9 +65,13 @@ TreatmentState = 0x0F00, // 15 + UltrafiltrationState = 0x1000, // 16 + String = 0xFFFE, Acknow = 0xFFFF, + AcknowGeneric = 0x0000, //< Generic Acknowledgment is not a unique message ID and inherits its Id from the actual message. Zero is a placeholder + }; enum class GuiActionsData_Enum /*: quint8 QML doesn't support*/ { @@ -76,14 +80,19 @@ Command = 0x00, // HD=>UI : should be handled in receive Request = 0x00, // UI=>HD : should be handled in transmit - // Power-Off Data // UI=>HD : should be handled in transmit + // UI=>HD : should be handled in transmit Accepted = 0x01, Rejected = 0x02, + // Ultrafiltration State + Pause = 0x00, + Resume = 0x01, + // Power-Off Data // HD=>UI : should be handled in receive Timeout = 0x01, }; + Q_ENUM(GuiActionsType_Enum) Q_ENUM(GuiActionsData_Enum) @@ -93,6 +102,8 @@ #include "MsgDefs.h" Q_ENUM(Request_Reject_Reasons) + + }; // to be able to use the enum as signal/slot parameter Index: sources/gui/guiview.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/guiview.cpp (.../guiview.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/gui/guiview.cpp (.../guiview.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -62,14 +62,6 @@ // From UI : Export Log connect(this , SIGNAL(didExportLog()), &_GuiController, SLOT( doExportLog())); - - // ----- 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 -r5c5fa01738826261e0b3647db6b7b3fc26b04251 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/guiview.h (.../guiview.h) (revision 5c5fa01738826261e0b3647db6b7b3fc26b04251) +++ sources/gui/guiview.h (.../guiview.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -60,18 +60,5 @@ void didExportLog(); void didExport (); -public slots: - // ----- 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/components/NotificationBar.qml =================================================================== diff -u -r17f0906011de9c97c0950c1ba0ea627a1411bc2e -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 17f0906011de9c97c0950c1ba0ea627a1411bc2e) +++ sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -23,29 +23,34 @@ Rectangle { id: _root objectName: "NotificationBar" // SquishQt - property alias imageSource : _image.source - property alias text : _text.text - property int level : 0 + property alias imageSource : _image.source + property bool imageAutoSize : false + property alias text : _text.text + property alias textColor : _text.color + property alias textfontSize : _text.font.pixelSize + property alias rowAnchors : _row.anchors + property int level : 0 + visible : _text.text height : Variables.notificationHeight color : Colors.textNotificationNoneBg - radius : Variables.dialogRadius + //radius : Variables.dialogRadius anchors { bottom : parent.bottom left : parent.left right : parent.right } - Row { + Row { id: _row anchors.centerIn: parent spacing: 10 Image { id: _image anchors.verticalCenter: parent.verticalCenter - width : Variables.notificationIconSize - height: Variables.notificationIconSize + width : imageAutoSize ? Math.min(_root.height, _root.width) : Variables.notificationIconSize + height: imageAutoSize ? Math.min(_root.height, _root.width) : Variables.notificationIconSize } Text { id: _text color : Colors.textNotificationNoneFg @@ -54,6 +59,7 @@ verticalAlignment : Text.AlignVCenter } } + onLevelChanged: { switch (level) { case GuiActions.ALARM_PRIORITY_HIGH: Index: sources/gui/qml/components/RangeMarker.qml =================================================================== diff -u -rcd7de5f6d239a11615ba8c6c03339a10996486ca -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/components/RangeMarker.qml (.../RangeMarker.qml) (revision cd7de5f6d239a11615ba8c6c03339a10996486ca) +++ sources/gui/qml/components/RangeMarker.qml (.../RangeMarker.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -71,7 +71,7 @@ rightMargin: 5 topMargin : -5 } - color : Colors.textRangeMarker + color : _root.color text : value } } Index: sources/gui/qml/components/TouchArea.qml =================================================================== diff -u -rae97f70129df818530bcb70c934c42fa28eb6034 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/components/TouchArea.qml (.../TouchArea.qml) (revision ae97f70129df818530bcb70c934c42fa28eb6034) +++ sources/gui/qml/components/TouchArea.qml (.../TouchArea.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -27,51 +27,38 @@ * next to the right edge of the component. */ Rectangle { id : _root - enum Orientation { - Horizontal, - Vertical - } - property string title : "" property int titleLetterSpacing : 3 property bool isTouchable : true - property int orientation : TouchArea.Orientation.Horizontal - property list components - property int titleVSpacing : 20 - property int componentsHSpacing : 80 - property int componentsVSpacing : 0 - property int arrowSpacing : 40 + property string notificationText : "" + property string notificationImageSource : "" + signal clicked() color: "transparent" - width : _column.width + arrowSpacing - height: _column.height clip : false - Column { id: _column - width : Math.max(_titleText.width , _grid.width) - height : _titleText.height + _grid.height - spacing : titleVSpacing - Text { id: _titleText - text: _root.title - font.pixelSize: Fonts.fontPixelTouchAreaTitle - font.letterSpacing: titleLetterSpacing - color: Colors.touchTextAreaTitle + Text { id: _titleText + anchors { + top: parent.top + left: parent.left } - Grid { id: _grid - columns : orientation === TouchArea.Orientation.Horizontal ? components.length : 1 - rows : orientation === TouchArea.Orientation.Vertical ? components.length : 1 - spacing : orientation === TouchArea.Orientation.Horizontal ? componentsHSpacing : componentsVSpacing - children: components + text: _root.title + font { + pixelSize: Fonts.fontPixelTouchAreaTitle + letterSpacing: titleLetterSpacing } + color: Colors.touchTextAreaTitle } Image { id: _arrowImage visible: isTouchable - anchors.right: parent.right - anchors.top: parent.top + anchors { + top: parent.top + right: parent.right + } width : Variables.arrowWidth height: Variables.arrowHeight source: "qrc:/images/iArrow" @@ -85,6 +72,23 @@ } } } + Component.onCompleted: { } + + NotificationBar { id: _notification + height : 25 + imageAutoSize: true + color: "transparent" + anchors { + bottom: parent.bottom + left: parent.left + right: parent.right + } + imageSource : notificationImageSource + text : notificationText + textColor : "gray" + textfontSize: 16 + rowAnchors.centerIn: null + } } Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r670f257c9b88d3e5506eccaad111bec914102a72 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 670f257c9b88d3e5506eccaad111bec914102a72) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -65,14 +65,16 @@ readonly property int sliderTextMargin : 20 - readonly property int notificationHeight : 60 + readonly property int notificationHeight : 50 readonly property int notificationIconSize : 36 readonly property int backIconDiameter : 17 readonly property int pauseIconDiameter : 60 // --- PRS --- + readonly property int bloodFlowMin : 100 + readonly property int bloodFlowMax : 500 readonly property int bloodFlowResolution : 25 readonly property int dialysateFlowResolution : 50 Index: sources/gui/qml/main.qml =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/main.qml (.../main.qml) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/gui/qml/main.qml (.../main.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -12,45 +12,6 @@ * */ -/* --Item - Circle - LogoD - MainMenu - PlaceHolderText - ProgressCircle - ScreenItem - StackItem - TextRect - TimeText - TouchArea - RangeMarker - --Text - TitleText - --Rectangle - Line - Background - CloseButton - TouchRect - BackButton - ConfirmButton - ExportButton - USBButton - RangeRect - ProgressBar - ProgressBarEx - ProgressRect - Slider - RangeBar - --Dialog - ModalDialog - AutoHideInfo - PowwerOff -*/ - // Qt import QtQuick 2.12 @@ -61,15 +22,17 @@ // 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 VTreatmentBloodFlow 0.1; +import VTreatmentDialysateFlow 0.1; +import VTreatmentUltrafiltration 0.1; +import VTreatmentUltrafiltrationState 0.1; +import VTreatmentTime 0.1; +import VAlarmStatus 0.1; +import VPowerOff 0.1; -import VTreatmentAdjustmentDuration 0.1; -import VTreatmentAdjustmentFlows 0.1; +import VTreatmentAdjustmentDuration 0.1; +import VTreatmentAdjustmentFlows 0.1; +import VTreatmentAdjustmentUltrafiltration 0.1; // Qml imports @@ -105,15 +68,17 @@ // TODO : When Testing data on Setting screen is removed // This needs to be moved into the Treatment______.qml - VTreatmentAdjustmentDuration { id: vTreatmentAdjustmentDuration } - VTreatmentAdjustmentFlows { id: vTreatmentAdjustmentFlows } + VTreatmentAdjustmentDuration { id: vTreatmentAdjustmentDuration } + VTreatmentAdjustmentFlows { id: vTreatmentAdjustmentFlows } + VTreatmentUltrafiltrationState { id: vTreatmentUltrafiltrationState } + VTreatmentAdjustmentUltrafiltration { id: vTreatmentAdjustmentUltrafiltration } - VTreatmentBloodFlow { id: vTreatmentBloodFlow } - VTreatmentDialysateFlow { id: vTreatmentDialysateFlow } - VTreatmentUltrafiltration { id: vTreatmentUltrafiltration } - VTreatmentTime { id: vTreatmentTime } - VAlarmStatus { id: vAlarmStatus } - VPowerOff { id: vPowerOff } + 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 Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r670f257c9b88d3e5506eccaad111bec914102a72 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 670f257c9b88d3e5506eccaad111bec914102a72) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -59,7 +59,11 @@ _treatmentAdjustmentDuration.open() } onSectionUltrafiltrationClicked: { - _treatmentAdjustmentUltrafiltrationStart.open() + if ( vTreatmentUltrafiltrationState.isPaused ) { + _treatmentAdjustmentUltrafiltrationPaused.open() + } else { + _treatmentAdjustmentUltrafiltrationStart .open() + } } } @@ -69,25 +73,21 @@ //// Treatment Adjustment Dialogs TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow - dialysateFlowRateMinimum: vTreatmentRanges.treatmentRanges_Dialysate_Flow_Min - dialysateFlowRateMaximum: vTreatmentRanges.treatmentRanges_Dialysate_Flow_Max - onCloseClicked : close() - onConfirmClicked : _GuiView.doAdjustBloodDialysateFlows(bloodFlowRateValue, dialysateFlowRateValue) + onConfirmClicked : vTreatmentAdjustmentFlows.doAdjustment(bloodFlowRateValue, dialysateFlowRateValue) } - TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration - // durationMinimum: vTreatmentRanges.treatmentRanges_Duration_Min - // durationMaximum: vTreatmentRanges.treatmentRanges_Duration_Max onCloseClicked : close() - onConfirmClicked : _GuiView.doAdjustDuration(durationValue) + onConfirmClicked : vTreatmentAdjustmentDuration.doAdjustment(durationValue) } TreatmentAdjustmentUltrafiltrationStart { id: _treatmentAdjustmentUltrafiltrationStart onCloseClicked : close() onPauseClicked : { - close() - _treatmentAdjustmentUltrafiltrationPaused.open() + // send pause to HD and wait. + // if accepted close() + // not accepted show error in notification + vTreatmentUltrafiltrationState.doPause() } } @@ -98,9 +98,10 @@ _treatmentAdjustmentUltrafiltrationEdit.open() } onResumeClicked : { - // send HD resume and if accepted close() + // send resume to HD and wait. + // if accepted close() // not accepted show error in notification - close() + vTreatmentUltrafiltrationState.doResume() } } @@ -125,4 +126,21 @@ close() } } + + Connections { target: vTreatmentUltrafiltrationState + onAdjustmentTriggered: { + console.debug(vTreatmentUltrafiltrationState.adjustment_Accepted , vTreatmentUltrafiltrationState.isPaused) + if ( vTreatmentUltrafiltrationState.adjustment_Accepted ) { + if ( vTreatmentUltrafiltrationState.isPaused ) { + _treatmentAdjustmentUltrafiltrationStart .close() + _treatmentAdjustmentUltrafiltrationPaused.open () + } else { + _treatmentAdjustmentUltrafiltrationPaused.close() + } + } else { + // Alert / Notification ?! + } + } + } + } Index: sources/gui/qml/pages/treatment/TreatmentStart.qml =================================================================== diff -u -r7045fd6002bdeb28e23a7af6a708a852d522ad12 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/TreatmentStart.qml (.../TreatmentStart.qml) (revision 7045fd6002bdeb28e23a7af6a708a852d522ad12) +++ sources/gui/qml/pages/treatment/TreatmentStart.qml (.../TreatmentStart.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -30,8 +30,13 @@ property int bloodFlow_MeasuredFlow_Precision: 0 property int dialysateInletFlow_MeasuredFlow_Precision: 0 + property int areaWidth : 400 + property int areaHeightRow1 : 170 + property int areaHeightRow2 : 225 + property int areaHeightRow3 : 200 + property int leftColumnX : 40 - property int rightColumnX : 875 + property int rightColumnX : Variables.applicationWidth - leftColumnX - areaWidth property int row1Y : 100 property int row2Y : 290 // 320 @@ -53,6 +58,8 @@ TreatmentFlows { id: _flowsTouchArea x : leftColumnX y : row1Y + width : areaWidth + height : areaHeightRow1 onClicked: { sectionFlowClicked() } @@ -61,6 +68,8 @@ TreatmentVitals { id: _vitalsTouchArea x : leftColumnX y : row2Y + width : areaWidth + height : areaHeightRow2 } Line { x: 0; y: row2LineY; length: lineLength } TreatmentPressure { id: _pressureTouchArea @@ -76,14 +85,16 @@ x : leftColumnX y : row3Y - width : _flowsTouchArea.width + width : areaWidth + height : areaHeightRow3 } // ---------- COLUMN RIGHT TreatmentUltrafiltration { id: _ultrafiltrationTouchArea; x : rightColumnX y : row1Y - width : _flowsTouchArea.width + width : areaWidth + height : areaHeightRow1 onClicked : { sectionUltrafiltrationClicked() } @@ -95,7 +106,8 @@ x : rightColumnX y : row2Y - width : _flowsTouchArea.width + width : areaWidth + height : areaHeightRow2 title : qsTr("SALINE BOLUS") } Line { x: rightLinesX; y: row2LineY; length: lineLength; } @@ -105,7 +117,8 @@ x : rightColumnX y : row3Y - width : _flowsTouchArea.width + width : areaWidth + height : areaHeightRow3 title : qsTr("HEPARIN") cumulativeVisible: false } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml (.../TreatmentAdjustmentDuration.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -26,20 +26,20 @@ * 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 + readonly property alias durationValue : _durationSlider.value + readonly property alias durationMinimum : _durationSlider.minimum + readonly property alias durationMaximum : _durationSlider.maximum + readonly property alias durationStep : _durationSlider.step - property alias currentTime : _currentTimeText.seconds - property alias durationTime : _durationText.seconds + readonly property alias currentTime : _currentTimeText.seconds + readonly property alias durationTime : _durationText.seconds property int textWidth : 200 titleText: qsTr("TREATMENT DURATION") Connections { target: vTreatmentAdjustmentDuration - onAdjustmentDurationTriggered: { + onAdjustmentTriggered: { if ( vTreatmentAdjustmentDuration.adjustment_Accepted ) { accept() } else { Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -42,20 +42,35 @@ titleText: qsTr("FLOWS") + // Note : The slider values are not bound and will be set by user freely + // and will be used to be sent for adjustment + // if accepted will not changed and + // if rejected then will be reset to the values passed by adjustment response + + // reset the flow values to the current flow values + function currentFlows() { + _bloodFlowSlider .value = vTreatmentBloodFlow. bloodFlow_FlowSetPoint + _dialysateFlowSlider.value = vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint + } + + // reset the flow values to the values of the adjustment response + function resetFlows() { + _bloodFlowSlider .value = vTreatmentAdjustmentFlows. bloodFlow_FlowSetPoint; + _dialysateFlowSlider.value = vTreatmentAdjustmentFlows.dialysateFlow_FlowSetPoint; + } + onAboutToShow: { // TODO : When Testing data on Setting screen is removed // This needs to be moved into the Treatment______.qml - bloodFlowRateValue = vTreatmentBloodFlow. bloodFlow_FlowSetPoint - dialysateFlowRateValue = vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint + currentFlows() } Connections { target: vTreatmentAdjustmentFlows - onAdjustmentFlowTriggered: { + onAdjustmentTriggered: { if ( vTreatmentAdjustmentFlows.adjustment_Accepted ) { accept() } else { - _bloodFlowSlider .value = vTreatmentAdjustmentFlows. bloodFlow_FlowSetPoint; - _dialysateFlowSlider.value = vTreatmentAdjustmentFlows.dialysateFlow_FlowSetPoint; + resetFlows() notificationText = vTreatmentAdjustmentFlows.text(); } } @@ -80,8 +95,8 @@ anchors.verticalCenter: parent.verticalCenter width : 600 height : 5 - minimum : 100 - maximum : 500 + minimum : Variables.bloodFlowMin + maximum : Variables.bloodFlowMax unit : _root.unit step : Variables.bloodFlowResolution ticks : true @@ -108,8 +123,8 @@ anchors.verticalCenter: parent.verticalCenter width : 600 height : 5 - minimum : 100 - maximum : 600 + minimum : vTreatmentRanges.treatmentRanges_Dialysate_Flow_Min + maximum : vTreatmentRanges.treatmentRanges_Dialysate_Flow_Max unit : _root.unit step : Variables.dialysateFlowResolution ticks : true Index: sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml =================================================================== diff -u -reea63d68fc0fb269f8dec64d99f488bcad117220 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml (.../TreatmentFlows.qml) (revision eea63d68fc0fb269f8dec64d99f488bcad117220) +++ sources/gui/qml/pages/treatment/sections/TreatmentFlows.qml (.../TreatmentFlows.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -33,21 +33,26 @@ y : 0 title : qsTr("FLOWS") width : 370 - componentsHSpacing: 15 - components: [ + + Row { + spacing: 40 + anchors.top: _root.top + anchors.topMargin: 40 TextRect { id: _bloodFlow - title: qsTr("Blood") - label: vTreatmentBloodFlow.bloodFlow_FlowSetPoint - extra: unit + title : qsTr("Blood") + label : vTreatmentBloodFlow.bloodFlow_FlowSetPoint + extra : unit labelFont.weight: Font.ExtraLight - width: 180 - } , + width : 180 + height: 200 + } TextRect { id: _dialysateInletFlow title: qsTr("Dialysate") label: vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint extra: unit labelFont.weight: Font.ExtraLight width: 180 + height: 200 } - ] + } } Index: sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml =================================================================== diff -u -r7045fd6002bdeb28e23a7af6a708a852d522ad12 -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml (.../TreatmentFluid.qml) (revision 7045fd6002bdeb28e23a7af6a708a852d522ad12) +++ sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml (.../TreatmentFluid.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -31,7 +31,6 @@ height : 200 isTouchable: false title: qsTr("FLUID MANAGEMENT") - titleVSpacing: 40 property int rowTextSpacing : 10 property int volumeTextWidth: 60 Index: sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml =================================================================== diff -u -r45617764a63d5573bfb942b039f2854ed25ba15d -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision 45617764a63d5573bfb942b039f2854ed25ba15d) +++ sources/gui/qml/pages/treatment/sections/TreatmentPressure.qml (.../TreatmentPressure.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -45,16 +45,13 @@ width : 200 height : 200 isTouchable: true - orientation: TouchArea.Orientation.Horizontal title: qsTr("PRESSURE") + " " + qsTr("(mmHg)") - titleVSpacing: 100 - VTreatmentPressureOcclusion { id: vTreatmentPressureOcclusion } RangeBar { id: _arterialRangeBar x: 0 - y: titleVSpacing + y: 80 width : 175 height : 15 rangebar.color: Colors.pressuresArterialBar @@ -81,7 +78,7 @@ RangeBar { id: _venousRangeBar x: 200 - y: titleVSpacing + y: 80 width : 175 height : 15 rangebar.color: Colors.pressuresVenousBar Index: sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml (.../TreatmentUltrafiltration.qml) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml (.../TreatmentUltrafiltration.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -31,11 +31,23 @@ width : 200 height : 200 isTouchable : true - orientation : TouchArea.Orientation.Vertical title : qsTr("ULTRAFILTRATION VOLUME") + " " + qsTr("(mL)") + notificationImageSource: "qrc:/images/iPauseGray" + Connections { target: vTreatmentUltrafiltrationState + onIsPausedChanged : { + if ( vTreatmentUltrafiltrationState.isPaused ) { + notificationText = qsTr("Ultrafiltration Paused") + _progressbarex.marker.color = "dimgray" + } else { + notificationText = "" + _progressbarex.marker.color = Colors.rangeMarker + } + } + } + Connections { target: vTreatmentAdjustmentDuration - onAdjustmentDurationTriggered: { + onAdjustmentTriggered: { // FIXME : HD units should be consistent(mL or L) but here is Litre _progressbarex.maximum = vTreatmentAdjustmentDuration.ultrafiltration * 1000 } Index: sources/gui/qml/pages/treatment/sections/TreatmentVitals.qml =================================================================== diff -u -r45617764a63d5573bfb942b039f2854ed25ba15d -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/gui/qml/pages/treatment/sections/TreatmentVitals.qml (.../TreatmentVitals.qml) (revision 45617764a63d5573bfb942b039f2854ed25ba15d) +++ sources/gui/qml/pages/treatment/sections/TreatmentVitals.qml (.../TreatmentVitals.qml) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -31,19 +31,19 @@ x: 0 y: 0 isTouchable: false - orientation: TouchArea.Orientation.Vertical title: qsTr("VITALS") - titleVSpacing: 40 - components: [ + Column { + anchors.top: _root.top + anchors.topMargin: 60 TextRect { id: _bloodPressure labelHeight: 60 labelFont.pixelSize: Fonts.fontPixelVitals labelFont.weight: Font.ExtraLight labelAutoSize: true label: "120/80" // value extra: qsTr("mmHg") // unit - } , + } TextRect { id: _heartBeat labelHeight: 40 labelFont.pixelSize: Fonts.fontPixelVitals @@ -52,5 +52,5 @@ label: "130" // value extra: qsTr("BPM") // unit } - ] + } } Index: sources/main.h =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/main.h (.../main.h) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/main.h (.../main.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -77,6 +77,7 @@ void vVARIABLE##vSIGNAL( const vTYPE & v##vVARIABLE ); \ private: \ vTYPE _##vVARIABLE = vDEFVALUE; \ + protected: \ vTYPE vVARIABLE () const { \ return _##vVARIABLE ; \ } @@ -97,6 +98,9 @@ #define ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, vTYPE) \ ACTION_METHOD_BRIDGE_CONNECTION(ActionReceive, vSOURCE, vTYPE) //--------------------------------------------------------------------------------// +#define ACTION_TRANSMT_BRIDGE_CONNECTION(vSOURCE, vTYPE) \ + ACTION_METHOD_BRIDGE_CONNECTION(ActionReceive, vSOURCE, vTYPE) +//--------------------------------------------------------------------------------// #define ACTION_RECEIVE_PRIVATE_SLOT(vTYPE) \ private Q_SLOTS: \ void onActionReceive (const vTYPE &vData) { \ @@ -107,6 +111,10 @@ Q_SIGNALS: \ void didActionReceive (const vTYPE &vData); //--------------------------------------------------------------------------------// +#define ACTION_TRANSMT_SIGNAL(vTYPE) \ +Q_SIGNALS: \ + void didActionTransmit(const vTYPE &vData); +//--------------------------------------------------------------------------------// #define ACTION_RECEIVE_BRIDGE_DEFINITION(vTYPE) \ ACTION_RECEIVE_PRIVATE_SLOT (vTYPE) \ ACTION_RECEIVE_SIGNAL (vTYPE) Index: sources/model/mmodel.h =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/model/mmodel.h (.../mmodel.h) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/model/mmodel.h (.../mmodel.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -23,9 +23,11 @@ #include "mtreatmentflows.h" #include "mtreatmentoutletflow.h" #include "mtreatmentpressureocclusion.h" +#include "mtreatmentranges.h" #include "mtreatmentadjustblooddialysateresponse.h" #include "mtreatmentadjustdurationresponse.h" -#include "mtreatmentranges.h" +#include "mtreatmentultrafiltrationstate.h" +#include "mtreatmentadjustultrafiltrationresponse.h" /*! * \brief Message interpretation instruction @@ -116,8 +118,10 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, PowerOffData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentRangesData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, TreatmentUltrafiltrationStateData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustBloodDialysateResponseData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustDurationResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(vSOURCE, AdjustUltrafiltrationResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS \ @@ -129,8 +133,10 @@ ACTION_RECEIVE_BRIDGE_DEFINITION( AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( PowerOffData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentRangesData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( TreatmentUltrafiltrationStateData ) \ ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustBloodDialysateResponseData ) \ - ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustDurationResponseData ) \ + ACTION_RECEIVE_BRIDGE_DEFINITION( AdjustUltrafiltrationResponseData ) //--------------------------------------------------------------------------------// #define REGISTER_MODEL_METATYPES \ REGISTER_METATYPE( BloodFlowData ) \ @@ -142,8 +148,10 @@ REGISTER_METATYPE( AlarmStatusFlag ) \ REGISTER_METATYPE( PowerOffData ) \ REGISTER_METATYPE( TreatmentRangesData ) \ + REGISTER_METATYPE( TreatmentUltrafiltrationStateData ) \ REGISTER_METATYPE( AdjustBloodDialysateResponseData ) \ - REGISTER_METATYPE( AdjustDurationResponseData ) + REGISTER_METATYPE( AdjustDurationResponseData ) \ + REGISTER_METATYPE( AdjustUltrafiltrationResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_INTERPRETER_CONNECTIONS \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, BloodFlowData ) \ @@ -154,8 +162,10 @@ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AlarmStatusData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, PowerOffData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, TreatmentRangesData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter,TreatmentUltrafiltrationStateData ) \ ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustBloodDialysateResponseData ) \ - ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustDurationResponseData ) + ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter, AdjustDurationResponseData ) \ + ACTION_RECEIVE_BRIDGE_CONNECTION(_interpreter,AdjustUltrafiltrationResponseData ) //--------------------------------------------------------------------------------// #define ACTION_RECEIVE_SIGNALS \ ACTION_RECEIVE_SIGNAL( BloodFlowData ) \ @@ -166,7 +176,9 @@ ACTION_RECEIVE_SIGNAL( AlarmStatusData ) \ ACTION_RECEIVE_SIGNAL( PowerOffData ) \ ACTION_RECEIVE_SIGNAL( TreatmentRangesData ) \ + ACTION_RECEIVE_SIGNAL( TreatmentUltrafiltrationStateData ) \ ACTION_RECEIVE_SIGNAL( AdjustBloodDialysateResponseData ) \ - ACTION_RECEIVE_SIGNAL( AdjustDurationResponseData ) + ACTION_RECEIVE_SIGNAL( AdjustDurationResponseData ) \ + ACTION_RECEIVE_SIGNAL( AdjustUltrafiltrationResponseData ) //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// Index: sources/model/mtreatmentadjustdurationresponse.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/model/mtreatmentadjustdurationresponse.cpp (.../mtreatmentadjustdurationresponse.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/model/mtreatmentadjustdurationresponse.cpp (.../mtreatmentadjustdurationresponse.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -6,8 +6,8 @@ * IN PART OR IN WHOLE, * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file mtreatmentpressureocclusion.cpp - * \date 3/23/2020 + * \file mtreatmentadjustduration.cpp + * \date 4/27/2020 * \author Behrouz NematiPour * */ Index: sources/model/mtreatmentadjustultrafiltrationresponse.cpp =================================================================== diff -u --- sources/model/mtreatmentadjustultrafiltrationresponse.cpp (revision 0) +++ sources/model/mtreatmentadjustultrafiltrationresponse.cpp (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,68 @@ +/*! + * + * 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 mtreatmentadjustmentultrafiltration.cpp + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#include "mtreatmentadjustultrafiltrationresponse.h" + +using namespace Model; + +QString MAdjustUltrafiltrationResponse::toString() const { + return QString(stringPrefix + "(%1, %2, %3, %4, %5, %6, %7)") + .arg(_data.mAccepted .value) + .arg(_data.mReason .value) + .arg(_data.mVolume .value) + .arg(_data.mDuration .value) + .arg(_data.mDurationDiff.value) + .arg(_data.mRate .value) + .arg(_data.mRateDiff .value); +} + +void MAdjustUltrafiltrationResponse::toVariantList(QVariantList &vData) const { + vData += _data.mAccepted .value; + vData += _data.mReason .value; + vData += _data.mVolume .value; + vData += _data.mDuration .value; + vData += _data.mDurationDiff.value; + vData += _data.mRate .value; + vData += _data.mRateDiff .value; +} + +bool MAdjustUltrafiltrationResponse::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.mVolume )) + if (GetValue(vByteArray, index, _data.mDuration )) + if (GetValue(vByteArray, index, _data.mDurationDiff )) + if (GetValue(vByteArray, index, _data.mRate )) + if (GetValue(vByteArray, index, _data.mRateDiff )) + 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; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } +} + +AdjustUltrafiltrationResponseData MAdjustUltrafiltrationResponse::data() const { + Data data; + data.mAccepted = _data.mAccepted .value; + data.mReason = _data.mReason .value; + data.mVolume = _data.mVolume .value; + data.mDuration = _data.mDuration .value; + data.mDurationDiff = _data.mDurationDiff.value; + data.mRate = _data.mRate .value; + data.mRateDiff = _data.mRateDiff .value; + return data; +} Index: sources/model/mtreatmentadjustultrafiltrationresponse.h =================================================================== diff -u --- sources/model/mtreatmentadjustultrafiltrationresponse.h (revision 0) +++ sources/model/mtreatmentadjustultrafiltrationresponse.h (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,70 @@ +/*! + * + * 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 mtreatmentadjustultrafiltration.h + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +class MAdjustUltrafiltrationResponse { + + // friends + friend class ::tst_models; + +public: + QString stringPrefix = "Adjust Ultrafiltration"; + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + + float mVolume = 0; /*!< volume value of type float extracted out */ + quint32 mDuration = 0; /*!< duration value of type quint32 extracted out */ + quint32 mDurationDiff= 0; /*!< durationDiff value of type quint32 extracted out */ + float mRate = 0; /*!< rate value of type float extracted out */ + float mRateDiff = 0; /*!< rateDiff value of type float extracted out */ + }; + +private: + struct { + Types::U32 mAccepted ; + Types::U32 mReason ; + + Types::F32 mVolume ; + Types::U32 mDuration ; + Types::U32 mDurationDiff ; + Types::F32 mRate ; + Types::F32 mRateDiff ; + } _data; + +public: + MAdjustUltrafiltrationResponse () { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + bool fromByteArrayState(const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; + +} + +typedef Model::MAdjustUltrafiltrationResponse::Data AdjustUltrafiltrationResponseData; Index: sources/model/mtreatmentultrafiltrationstate.cpp =================================================================== diff -u --- sources/model/mtreatmentultrafiltrationstate.cpp (revision 0) +++ sources/model/mtreatmentultrafiltrationstate.cpp (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -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 mtreatmentultrafiltrationstate.cpp + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#include "mtreatmentultrafiltrationstate.h" + +using namespace Model; + +QString MTreatmentUltrafiltrationState::toString() const { + return QString(stringPrefix + "(%1)") + .arg(_data.mAccepted .value); +} + +void MTreatmentUltrafiltrationState::toVariantList(QVariantList &vData) const { + vData += _data.mAccepted .value; +} + +bool MTreatmentUltrafiltrationState::fromByteArray(const QByteArray &vByteArray, int *vIndex) { + int index = 0; // message data start position + if (GetValue(vByteArray, index, _data.mAccepted )) + return true ; + else { if(vIndex) *vIndex = index; return false; } +} + +TreatmentUltrafiltrationStateData MTreatmentUltrafiltrationState::data() const { + Data data; + data.mAccepted = _data.mAccepted .value; + return data; +} Index: sources/model/mtreatmentultrafiltrationstate.h =================================================================== diff -u --- sources/model/mtreatmentultrafiltrationstate.h (revision 0) +++ sources/model/mtreatmentultrafiltrationstate.h (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,55 @@ +/*! + * + * 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 mtreatmentultrafiltrationstate.h + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#pragma once + +// Qt +#include + +// Project +#include "types.h" + +// forward declarations +class tst_models; + +namespace Model { + +class MTreatmentUltrafiltrationState { + + // friends + friend class ::tst_models; + +public: + QString stringPrefix = "Ultrafiltration State"; + struct Data { + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + }; + +private: + struct { + Types::U08 mAccepted ; // this is a responce to AcknowGeneral which has a data of 1 byte for the accpted/rejected. + } _data; + +public: + MTreatmentUltrafiltrationState() { } + + QString toString ( ) const ; + void toVariantList ( QVariantList &vData ) const ; + bool fromByteArray (const QByteArray &vByteArray , int *vIndex = nullptr); + + Data data() const; +}; + +} + +typedef Model::MTreatmentUltrafiltrationState::Data TreatmentUltrafiltrationStateData; Index: sources/view/vtreatmentadjustmentduration.cpp =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/view/vtreatmentadjustmentduration.cpp (.../vtreatmentadjustmentduration.cpp) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/view/vtreatmentadjustmentduration.cpp (.../vtreatmentadjustmentduration.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -18,6 +18,14 @@ VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentDuration, AdjustDurationResponseData) +void VTreatmentAdjustmentDuration::initConnections() { + + ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustDurationResponseData); + + connect(this , SIGNAL(didAdjustment(quint32)), + &_GuiController, SLOT( doAdjustment(quint32))); +} + void VTreatmentAdjustmentDuration::onActionReceive(const AdjustDurationResponseData &vData) { adjustment_Accepted ( vData.mAccepted ); @@ -27,5 +35,5 @@ // *** 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. *** - adjustmentDuration ( true ); + adjustment ( true ); } Index: sources/view/vtreatmentadjustmentduration.h =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/view/vtreatmentadjustmentduration.h (.../vtreatmentadjustmentduration.h) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/view/vtreatmentadjustmentduration.h (.../vtreatmentadjustmentduration.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -31,14 +31,22 @@ // 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 - TRIGGER( bool , adjustmentDuration , 0) + TRIGGER( bool , adjustment , 0) // coco end // Treatment Duration data PROPERTY( quint32 , duration , 0) PROPERTY( float , ultrafiltration , 0) VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentDuration, AdjustDurationResponseData) + +public slots: + // ----- Adjust Duration + void doAdjustment(quint32 vDuratoin) { + emit didAdjustment( vDuratoin); + } +signals: + void didAdjustment(quint32 vDuration); }; } Index: sources/view/vtreatmentadjustmentflows.cpp =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/view/vtreatmentadjustmentflows.cpp (.../vtreatmentadjustmentflows.cpp) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/view/vtreatmentadjustmentflows.cpp (.../vtreatmentadjustmentflows.cpp) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -17,6 +17,13 @@ #include "guicontroller.h" VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentFlows, AdjustBloodDialysateResponseData) +void VTreatmentAdjustmentFlows::initConnections() { + ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustBloodDialysateResponseData); + //ACTION_TRANSMT_BRIDGE_CONNECTION + // ----- Adjust Blood/Dialysate Flows + connect(this , SIGNAL(didAdjustment(quint32, quint32)), + &_GuiController, SLOT( doAdjustment(quint32, quint32))); +} void VTreatmentAdjustmentFlows::onActionReceive(const AdjustBloodDialysateResponseData &vData) { @@ -27,6 +34,6 @@ // *** 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. *** - adjustmentFlow ( true ); + adjustment ( true ); } Index: sources/view/vtreatmentadjustmentflows.h =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/view/vtreatmentadjustmentflows.h (.../vtreatmentadjustmentflows.h) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/view/vtreatmentadjustmentflows.h (.../vtreatmentadjustmentflows.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -31,14 +31,23 @@ // 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 - TRIGGER( bool , adjustmentFlow , 0) + TRIGGER( bool , adjustment , 0) // coco end // Treatment Blood/Dialysate Flow data PROPERTY( quint32 , bloodFlow_FlowSetPoint , 0) PROPERTY( quint32 , dialysateFlow_FlowSetPoint , 0) VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentFlows, AdjustBloodDialysateResponseData) + +public slots: + // ----- Adjust Blood/Dialysate Flows + void doAdjustment(quint32 vBloodFlow, quint32 vDialysateFlow) { + emit didAdjustment( vBloodFlow, vDialysateFlow); + } +signals: + void didAdjustment(quint32 vBloodFlow, quint32 vDialysateFlow); + }; } Index: sources/view/vtreatmentadjustmentultrafiltration.cpp =================================================================== diff -u --- sources/view/vtreatmentadjustmentultrafiltration.cpp (revision 0) +++ sources/view/vtreatmentadjustmentultrafiltration.cpp (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,43 @@ +/*! + * + * 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 vtreatmentadjustmentultrafiltration.cpp + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#include "vtreatmentadjustmentultrafiltration.h" + +// Project +#include "guicontroller.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltration, AdjustUltrafiltrationResponseData) + +void VTreatmentAdjustmentUltrafiltration::initConnections() { + + ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, AdjustUltrafiltrationResponseData); + + connect(this , SIGNAL(didAdjustment(quint32)), + &_GuiController, SLOT( doAdjustment(quint32))); +} + +void VTreatmentAdjustmentUltrafiltration::onActionReceive(const AdjustUltrafiltrationResponseData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); + + volume ( vData.mVolume ); + duration ( vData.mDuration ); + durationDiff ( vData.mDurationDiff ); + rate ( vData.mRate ); + rateDiff ( vData.mRateDiff ); + + // *** 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 ( true ); +} Index: sources/view/vtreatmentadjustmentultrafiltration.h =================================================================== diff -u --- sources/view/vtreatmentadjustmentultrafiltration.h (revision 0) +++ sources/view/vtreatmentadjustmentultrafiltration.h (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,55 @@ +/*! + * + * 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 vtreatmentadjustmentultrafiltration.h + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#pragma once + +#include + +// Project +#include "vtreatmentadjustmentsresponse.h" + +namespace View { + +class VTreatmentAdjustmentUltrafiltration : public VTreatmentAdjustmentsResponse +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + // 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 + TRIGGER( bool , adjustment , 0) + // coco end + + // Treatment Ultrafiltration data + PROPERTY( float , volume , 0) + PROPERTY( quint32 , duration , 0) + PROPERTY( quint32 , durationDiff , 0) + PROPERTY( float , rate , 0) + PROPERTY( float , rateDiff , 0) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltration, AdjustUltrafiltrationResponseData) + +// ----------- Adjust Ultrafiltration +public slots: + void doAdjustment(quint32 vVolume) { + emit didAdjustment( vVolume); + } +signals: + void didAdjustment(quint32 vVolume); +}; + +} Index: sources/view/vtreatmentultrafiltrationstate.cpp =================================================================== diff -u --- sources/view/vtreatmentultrafiltrationstate.cpp (revision 0) +++ sources/view/vtreatmentultrafiltrationstate.cpp (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,51 @@ +/*! + * + * 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 vtreatmentultrafiltrationstate.cpp + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#include "vtreatmentultrafiltrationstate.h" + +// Project +#include "guicontroller.h" + +VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentUltrafiltrationState, TreatmentUltrafiltrationStateData) + +void VTreatmentUltrafiltrationState::initConnections() { + + ACTION_RECEIVE_BRIDGE_CONNECTION(Gui::_GuiController, TreatmentUltrafiltrationStateData); + + connect(this , SIGNAL(didUltrafiltrationStateRequest(quint32)), + &_GuiController, SLOT( doUltrafiltrationStateRequest(quint32))); +} + +void VTreatmentUltrafiltrationState::onActionReceive(const TreatmentUltrafiltrationStateData &vData) +{ + adjustment_Accepted ( vData.mAccepted ); + if (adjustment_Accepted()) { + isPaused ( _requestedState == GuiActionData::Pause); + } + + // *** 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 ( true ); +} + +void View::VTreatmentUltrafiltrationState::doPause() +{ + _requestedState = GuiActionData::Pause; + emit didUltrafiltrationStateRequest(static_cast(_requestedState)); +} + +void View::VTreatmentUltrafiltrationState::doResume() +{ + _requestedState = GuiActionData::Resume; + emit didUltrafiltrationStateRequest(static_cast(_requestedState)); +} Index: sources/view/vtreatmentultrafiltrationstate.h =================================================================== diff -u --- sources/view/vtreatmentultrafiltrationstate.h (revision 0) +++ sources/view/vtreatmentultrafiltrationstate.h (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -0,0 +1,52 @@ +/*! + * + * 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 vtreatmentultrafiltrationstate.h + * \date 5/20/2020 + * \author Behrouz NematiPour + * + */ +#pragma once + +#include + +// Project +#include "vtreatmentadjustmentsresponse.h" + +namespace View { + +class VTreatmentUltrafiltrationState : public VTreatmentAdjustmentsResponse +{ + Q_OBJECT + + // friends + friend class ::tst_views; + + GuiActionData _requestedState = GuiActionData::NoData; + + // 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 + TRIGGER( bool , adjustment , 0) + // coco end + + PROPERTY( bool , isPaused , false) + + VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentUltrafiltrationState, TreatmentUltrafiltrationStateData) + + +// ---------- Puase Ultrafiltration +public slots: + void doPause (); + void doResume(); +signals: + void didUltrafiltrationStateRequest(quint32 vState); +}; + +} Index: sources/view/vview.h =================================================================== diff -u -r016578b44e879b89bd42dda7763ed50e67d7e64c -ra159e12630645a9a35fb0a5585cc7b639cfe6aa6 --- sources/view/vview.h (.../vview.h) (revision 016578b44e879b89bd42dda7763ed50e67d7e64c) +++ sources/view/vview.h (.../vview.h) (revision a159e12630645a9a35fb0a5585cc7b639cfe6aa6) @@ -70,22 +70,6 @@ VIEW_DEF_CLASS(vCLASS) \ VIEW_DEF_CONNECTION(vCLASS, vDATATYPE) //--------------------------------------------------------------------------------// -//--------- Please add the view type to the lists below to register them ---------// -//--------------------------------------------------------------------------------// -//--------------------------------------------------------------------------------// -#define REGISTER_VIEW_TYPES \ - using namespace View; \ - REGISTER_TYPE( VTreatmentBloodFlow ) \ - REGISTER_TYPE( VTreatmentDialysateFlow ) \ - REGISTER_TYPE( VTreatmentUltrafiltration ) \ - REGISTER_TYPE( VTreatmentPressureOcclusion ) \ - REGISTER_TYPE( VTreatmentTime ) \ - REGISTER_TYPE( VTreatmentAdjustmentDuration ) \ - REGISTER_TYPE( VTreatmentAdjustmentFlows ) \ - REGISTER_TYPE( VTreatmentRanges ) \ - REGISTER_TYPE( VAlarmStatus ) \ - REGISTER_TYPE( VPowerOff ) -//--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// // The Adjustment child definition in cpp @@ -97,7 +81,27 @@ using namespace View; \ vCLASS::vCLASS(QObject *parent) : VTreatmentAdjustmentsResponse(parent) { \ initConnections(); \ - } \ - VIEW_DEF_CONNECTION(vCLASS, vDATATYPE) + } + //--------------------------------------------------------------------------------// +//--------------------------------------------------------------------------------// +//--------- Please add the view type to the lists below to register them ---------// +//--------------------------------------------------------------------------------// +//--------------------------------------------------------------------------------// +#define REGISTER_VIEW_TYPES \ + using namespace View; \ + REGISTER_TYPE( VTreatmentBloodFlow ) \ + REGISTER_TYPE( VTreatmentDialysateFlow ) \ + REGISTER_TYPE( VTreatmentUltrafiltration ) \ + REGISTER_TYPE( VTreatmentUltrafiltrationState ) \ + REGISTER_TYPE( VTreatmentPressureOcclusion ) \ + REGISTER_TYPE( VTreatmentTime ) \ + REGISTER_TYPE( VTreatmentRanges ) \ + REGISTER_TYPE( VAlarmStatus ) \ + REGISTER_TYPE( VPowerOff ) \ + REGISTER_TYPE( VTreatmentAdjustmentDuration ) \ + REGISTER_TYPE( VTreatmentAdjustmentFlows ) \ + REGISTER_TYPE( VTreatmentAdjustmentUltrafiltration ) +//--------------------------------------------------------------------------------// +