Index: denali.pro.user =================================================================== diff -u -rc70a3e2ca2b9a679b042bf543dc331cffbd937ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- denali.pro.user (.../denali.pro.user) (revision c70a3e2ca2b9a679b042bf543dc331cffbd937ac) +++ denali.pro.user (.../denali.pro.user) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -1,6 +1,6 @@ - + EnvironmentId @@ -100,11 +100,11 @@ qmake QtProjectManager.QMakeBuildStep - false + true false false - false + true true @@ -156,11 +156,11 @@ qmake QtProjectManager.QMakeBuildStep - false + true false false - false + true true @@ -1176,16 +1176,16 @@ denali Qt4ProjectManager.Qt4RunConfiguration:/home/denali/Projects/application/denali.pro - + -q 3768 false true true false - false - true + true + false - /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Debug + /home/denali/Projects/tmp/build/denali-Desktop_Qt_5_12_5_GCC_64bit-Release 1 @@ -1207,11 +1207,11 @@ qmake QtProjectManager.QMakeBuildStep - false + true false false - false + true true @@ -1263,11 +1263,11 @@ qmake QtProjectManager.QMakeBuildStep - false + true false false - false + true true @@ -1485,8 +1485,8 @@ false true false - false - true + true + false false Index: en_US.udic =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- en_US.udic (.../en_US.udic) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ en_US.udic (.../en_US.udic) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -2,3 +2,8 @@ denali Diality ultrafiltration +UI +FW +invocable +bool +Initializer Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -106,12 +106,13 @@ bool _init = false; QList _needsAcknow { - GuiActionType::ID_AdjustBloodDialysateReq , - GuiActionType::ID_AdjustDurationReq , - GuiActionType::ID_AdjustUltrafiltrationStateReq , - GuiActionType::ID_AdjustUltrafiltrationEditReq , - GuiActionType::ID_AdjustUltrafiltrationConfirmReq , - GuiActionType::ID_AlarmSilenceReq , + GuiActionType::ID_AdjustBloodDialysateReq , + GuiActionType::ID_AdjustDurationReq , + GuiActionType::ID_AdjustUltrafiltrationStateReq , + GuiActionType::ID_AdjustUltrafiltrationEditReq , + GuiActionType::ID_AdjustUltrafiltrationConfirmReq , + GuiActionType::ID_AdjustSalineReq , + GuiActionType::ID_AlarmSilenceReq , }; public slots: Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -91,6 +91,7 @@ // ---- {Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq , 1 * 4 }, // 1 parameter each 4bytes + {Gui::GuiActionType::ID_AdjustUltrafiltrationStateRsp , 3 * 4 }, // 3 parameter each 4bytes // ---- {Gui::GuiActionType::ID_AdjustUltrafiltrationEditReq , 1 * 4 }, // 1 parameter each 4bytes Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -348,14 +348,12 @@ case Gui::GuiActionType::ID_AlarmCleared : ok = alarmCleared (vMessage, vData); break; // TODO : implement notify<>() // Adjustment Response Messages - case Gui::GuiActionType::ID_AdjustDurationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationRsp ); break; - case Gui::GuiActionType::ID_AdjustBloodDialysateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodDialysateRsp); break; - case Gui::GuiActionType::ID_AdjustSalineRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSalineRsp ); break; + case Gui::GuiActionType::ID_AdjustDurationRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustDurationRsp ); break; + case Gui::GuiActionType::ID_AdjustBloodDialysateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustBloodDialysateRsp ); break; + case Gui::GuiActionType::ID_AdjustSalineRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustSalineRsp ); break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationStateRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustUltrafiltrationStateRsp ); break; - // ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq); break; - // this message has been inherited from MAbstract and should use notify but since the response message is not standard can't use notify yet. - // when received gets payload len error and can't be interpreted. (Needs FW modification) - case Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq : ok = adjustUltrafiltrationState (vMessage, vData); break; // TODO : implement notify<>() + // these need to be standard and use notify as well case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = adjustUltrafiltrationEdit (vMessage, vData); break; // TODO : implement notify<>() case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); break; // TODO : implement notify<>() @@ -463,7 +461,7 @@ Model::MAlarmStatus mData; ok = mData.fromByteArray(vMessage.data); - LOG_EVENT("HD," + mData.toString()); + LOG_EVENT("HD," + mData.toString()); // TODO: Not Standard mData.toVariantList(vData); emit didActionReceive(mData.data()); @@ -488,7 +486,7 @@ Model::MAlarmTriggered mData; ok = mData.fromByteArray(vMessage.data); - LOG_EVENT("HD," + mData.toString()); + LOG_EVENT("HD," + mData.toString()); // TODO: Not Standard mData.toVariantList(vData); emit didActionReceive(mData.data()); @@ -524,7 +522,7 @@ // ---------- ---------- ---------- ---------- ---------- Adjustments ---------- ---------- ---------- ---------- ---------- // /*! - * \brief MessageInterpreter::ultrafiltrationState + * \brief MessageInterpreter::adjustUltrafiltrationState * \details This method interprets Treatment Ultrafiltration State Adjustment Response message data * in vMessage of type Message. * \param vMessage - The vMessage of type Message which contains all the data, @@ -535,9 +533,7 @@ bool MessageInterpreter::adjustUltrafiltrationState(const Message &vMessage, QVariantList &vData) { bool ok = false; - // TODO : In HD the Ultrafiltration State change shall have the rejection reason like other responses. - if ( ! isType (vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationStateReq) ) return ok; - if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::ID_AcknowGeneric ) ) return ok; // This is an exception It has to be changed. + if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_AdjustUltrafiltrationStateRsp) ) return ok; Model::MAdjustUltrafiltrationStateResponse mData; ok = mData.fromByteArray(vMessage.data); @@ -565,7 +561,7 @@ Model::MAdjustUltrafiltrationEditResponse mData; ok = mData.fromByteArray(vMessage.data); - LOG_EVENT("HD," + mData.toString()); + LOG_EVENT("HD," + mData.toString()); // TODO: Not Standard mData.toVariantList(vData); emit didActionReceive(mData.data()); @@ -589,7 +585,7 @@ Model::MAdjustUltrafiltrationConfirmResponse mData; ok = mData.fromByteArray(vMessage.data); - LOG_EVENT("HD," + mData.toString()); + LOG_EVENT("HD," + mData.toString()); // TODO: Not Standard mData.toVariantList(vData); emit didActionReceive(mData.data()); @@ -606,8 +602,7 @@ */ bool MessageInterpreter::createTreatmentRespData(const Message &vMessage, QVariantList &vData) { bool ok = false; - if ( ! isType (vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; - if ( ! isPayloadLenValid(vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; + if ( ! isValidMessage(vMessage, Gui::GuiActionType::ID_CreateTreatmentRsp) ) return ok; Model::MTreatmentParametersResponse mData; ok = mData.fromByteArray(vMessage.data); Index: sources/gui/GuiGlobals.h =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -111,7 +111,7 @@ ID_AdjustBloodDialysateRsp = 0x1800, // 24 ID_AdjustUltrafiltrationStateReq = 0x1000, // 16 - // idAcknowGeneric : the response is the AcknowGeneric with the same msgID + ID_AdjustUltrafiltrationStateRsp = 0x4100, // 65 ID_AdjustUltrafiltrationEditReq = 0x1100, // 17 ID_AdjustUltrafiltrationEditRsp = 0x1300, // 19 @@ -155,6 +155,7 @@ Q_ENUM(HD_Op_Modes) Q_ENUM(UF_Adjustments) Q_ENUM(Treatment_States) + Q_ENUM(UF_Commands) Q_ENUM(UF_States) Q_ENUM(Saline_Bolus_States) @@ -176,6 +177,7 @@ typedef GuiActions::UF_Adjustments GuiUFAdjustment; typedef GuiActions::Treatment_States GuiTreatmentStates; + typedef GuiActions::UF_Commands GuiUFCommands; typedef GuiActions::UF_States GuiUFStates; typedef GuiActions::Saline_Bolus_States GuiSalineStates; Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -76,7 +76,5 @@ } } - NotificationBar { id: _notification - text: "" //_root.notificationText - } + NotificationBar { id: _notification } } Index: sources/gui/qml/components/NotificationBar.qml =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -23,12 +23,13 @@ Rectangle { id: _root objectName: "NotificationBar" // SquishQt - property alias text : _text.text - property alias textColor : _text.color - property int level : 0 - property bool isSilenced : false - property int muteTimeoutSec : 0 - property color backgroundColor : Colors.textNotificationNoneBg + property alias text : _text.text + property alias textColor : _text.color + property int level : 0 + property bool isSilenced : false + property int muteTimeoutSec : 0 + property color backgroundColor : Colors.textNotificationNoneBg + property alias iconVisible : _icon.visible visible : _text.text height : Variables.notificationHeight @@ -64,8 +65,7 @@ } } - Image { - id: _icon + Image { id: _icon source: "qrc:/images/iAlarm" anchors.right: _text.left anchors.rightMargin: Variables.notificationBarIconMargin; Index: sources/gui/qml/components/NotificationBarSmall.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/components/NotificationBarSmall.qml (.../NotificationBarSmall.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/components/NotificationBarSmall.qml (.../NotificationBarSmall.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -35,7 +35,6 @@ property int level : 0 - visible : _text.text height : Variables.notificationHeight Index: sources/gui/qml/components/TouchArea.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/components/TouchArea.qml (.../TouchArea.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/components/TouchArea.qml (.../TouchArea.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -31,6 +31,7 @@ property string title : "" property int titleLetterSpacing : 3 property bool isTouchable : true + property bool hasArrow : true property alias notification : _notification @@ -53,7 +54,7 @@ } Image { id: _arrowImage - visible: isTouchable + visible: isTouchable && hasArrow anchors { top: parent.top right: parent.right Index: sources/gui/qml/main.qml =================================================================== diff -u -r4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/main.qml (.../main.qml) (revision 4fab8841b1040c8eaa406713ff9bdc8c65b7b6ac) +++ sources/gui/qml/main.qml (.../main.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -34,9 +34,6 @@ import VTreatmentAdjustmentDuration 0.1; import VTreatmentAdjustmentFlows 0.1; -import VTreatmentAdjustmentUltrafiltrationState 0.1; -import VTreatmentAdjustmentUltrafiltrationEdit 0.1; -import VTreatmentAdjustmentUltrafiltrationConfirm 0.1; import VCreateTreatment 0.1; import VDGDrainPump 0.1; @@ -123,9 +120,6 @@ VTreatmentAdjustmentDuration { id: vTreatmentAdjustmentDuration } VTreatmentAdjustmentFlows { id: vTreatmentAdjustmentFlows } - VTreatmentAdjustmentUltrafiltrationState { id: vTreatmentAdjustmentUltrafiltrationState } - VTreatmentAdjustmentUltrafiltrationEdit { id: vTreatmentAdjustmentUltrafiltrationEdit } - VTreatmentAdjustmentUltrafiltrationConfirm { id: vTreatmentAdjustmentUltrafiltrationConfirm } VCreateTreatment { id: vCreateTreatment } // ----- Follow the below Z order ----- Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -rc70a3e2ca2b9a679b042bf543dc331cffbd937ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision c70a3e2ca2b9a679b042bf543dc331cffbd937ac) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -17,15 +17,19 @@ import QtQuick 2.12 // Project -import Gui.Actions 0.1 -import VTreatmentRanges 0.1 -import VTreatmentAdjustmentSaline 0.1 -import VHDTreatmentStates 0.1 +import Gui.Actions 0.1 +import VTreatmentRanges 0.1 +import VTreatmentAdjustmentSaline 0.1 +import VHDTreatmentStates 0.1 +import VTreatmentAdjustmentUltrafiltrationState 0.1 +import VTreatmentAdjustmentUltrafiltrationEdit 0.1 +import VTreatmentAdjustmentUltrafiltrationConfirm 0.1 // Qml imports import "qrc:/globals" import "qrc:/components" import "qrc:/pages/treatment/adjustments" + /*! * \brief TreatmentStack is the screen * which contains the main stack for all the Trearment screens @@ -38,16 +42,17 @@ stackView.initialItem : _treatmentHome // Views - VTreatmentRanges { id: vTreatmentRanges } - VTreatmentAdjustmentSaline { id: vTreatmentAdjustmentSaline } - VHDTreatmentStates { id: vHDTreatmentStates } + VTreatmentRanges { id: vTreatmentRanges } + VTreatmentAdjustmentSaline { id: vTreatmentAdjustmentSaline } + VHDTreatmentStates { id: vHDTreatmentStates } + VTreatmentAdjustmentUltrafiltrationState { id: vTreatmentAdjustmentUltrafiltrationState } + VTreatmentAdjustmentUltrafiltrationEdit { id: vTreatmentAdjustmentUltrafiltrationEdit } + VTreatmentAdjustmentUltrafiltrationConfirm { id: vTreatmentAdjustmentUltrafiltrationConfirm } // ultrafiltration state information bar properties - readonly property bool isUFPaused : vTreatmentAdjustmentUltrafiltrationState.isPaused || - vHDTreatmentStates.ufPaused + readonly property bool isUFPaused : vHDTreatmentStates.ufPaused readonly property bool isUFOff : vHDTreatmentStates.ufOff - readonly property bool isUFRunning : ! vTreatmentAdjustmentUltrafiltrationState.isPaused && - vHDTreatmentStates.ufRunning + readonly property bool isUFRunning : vHDTreatmentStates.ufRunning readonly property bool isUFCompleted : vHDTreatmentStates.ufCompleted readonly property string ufInfoImageSource : isUFPaused ? "qrc:/images/iPauseGray" : isUFOff ? "qrc:/images/iOffGray" : @@ -57,7 +62,7 @@ isUFCompleted ? qsTr("Ultrafiltration is completed" ) : "" readonly property string ufInfoTextColor : isUFPaused ? "gray" : isUFOff ? "gray" : - isUFCompleted ? "white" : "" + isUFCompleted ? "lightgray" : "" // Components MainMenu { id: _treatmentMenu @@ -193,17 +198,18 @@ Connections { target: vTreatmentAdjustmentUltrafiltrationState onAdjustmentTriggered : { if ( vTreatmentAdjustmentUltrafiltrationState.adjustment_Accepted ) { - if ( vTreatmentAdjustmentUltrafiltrationState.isPaused ) { + if (vHDTreatmentStates.ufPaused) { // handle screen regarding current accepted _treatmentAdjustmentUltrafiltrationStart .close() _treatmentAdjustmentUltrafiltrationPaused.open () } else { _treatmentAdjustmentUltrafiltrationPaused.close() } - } else { - if ( vTreatmentAdjustmentUltrafiltrationState.isPaused ) { - _treatmentAdjustmentUltrafiltrationPaused.notification.text = vTreatmentAdjustmentUltrafiltrationState.text() + } + else { + if (vHDTreatmentStates.ufRunning) { // handle error messages regarding current accepted + _treatmentAdjustmentUltrafiltrationStart.notificationText = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText } else { - _treatmentAdjustmentUltrafiltrationStart .notification.text = vTreatmentAdjustmentUltrafiltrationState.text() + _treatmentAdjustmentUltrafiltrationPaused.notificationText = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText } } } @@ -231,9 +237,7 @@ Connections { target: vTreatmentAdjustmentUltrafiltrationConfirm onAdjustmentTriggered : { if (vTreatmentAdjustmentUltrafiltrationConfirm.adjustment_Accepted) { - // HD resumes the ultrafiltration and no need to recall the doPause just update the state - vTreatmentAdjustmentUltrafiltrationState.isPaused = false - vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentUltrafiltrationConfirm.volume + vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentUltrafiltrationConfirm.volume _treatmentAdjustmentUltrafiltrationConfirm.close() } else { _treatmentAdjustmentUltrafiltrationConfirm.notification.text = vTreatmentAdjustmentUltrafiltrationConfirm.text() Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -41,9 +41,10 @@ signal backClicked() onVisibleChanged: { - notification.text = "" + notificationText = "" } + notification.iconVisible: false header: Rectangle { id : _headerRect Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml (.../TreatmentAdjustmentUltrafiltrationConfirm.qml) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml (.../TreatmentAdjustmentUltrafiltrationConfirm.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -47,10 +47,11 @@ closeVisible : false confirmVisible : false backVisible : true + information { - visible : true - imageSource : ufInfoImageSource - text : ufInfoText + visible : true && information.text && ! notification.visible + imageSource : ufInfoImageSource + text : ufInfoText } titleText : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml (.../TreatmentAdjustmentUltrafiltrationEdit.qml) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml (.../TreatmentAdjustmentUltrafiltrationEdit.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -47,12 +47,14 @@ closeVisible : false confirmVisible : false backVisible : true + information { - visible : true - imageSource : ufInfoImageSource - text : ufInfoText + visible : true && information.text && ! notification.visible + imageSource : ufInfoImageSource + text : ufInfoText } + titleText : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume ProgressBarEx { id: _rangeProgressBar Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationPaused.qml =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationPaused.qml (.../TreatmentAdjustmentUltrafiltrationPaused.qml) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationPaused.qml (.../TreatmentAdjustmentUltrafiltrationPaused.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -39,8 +39,9 @@ signal resumeClicked() confirmVisible : false + information { - visible : true + visible : true && information.text && ! notification.visible imageSource : ufInfoImageSource text : ufInfoText } Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml (.../TreatmentAdjustmentUltrafiltrationStart.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml (.../TreatmentAdjustmentUltrafiltrationStart.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -40,6 +40,12 @@ confirmVisible: false + information { + visible : true && information.text && ! notification.visible + imageSource : ufInfoImageSource + text : ufInfoText + } + titleText : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume ProgressBarEx { id: _progressbarex Index: sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -27,21 +27,26 @@ * \brief Treatment Screen Saline Management section */ TreatmentFluid { id: _root - // comes from the response accepted - readonly property bool isStarted : vTreatmentAdjustmentSaline.isStarted - // comes from the broadcast Treatment States salineState field - readonly property bool isDisabled : vTreatmentAdjustmentSaline.isDisabled + readonly property bool isStarted : vHDTreatmentStates.sbRunning + // other that max saline bolus delivered, + // if saline started but still is waiting for pump the button is disabled so user won't tap multiple times. + readonly property bool isDisabled : vHDTreatmentStates.sbMaxReached + readonly property bool isWaitPump : vHDTreatmentStates.sbWaitPump QtObject { id: _private readonly property string textStart : qsTr("START BOLUS") readonly property string textStop : qsTr("STOP BOLUS" ) readonly property string textVolumeTarget : "(" + valueTarget + unit + ")" - readonly property string mesgAfterDisabled : qsTr("Maximum cumulative saline bolus volume delivered") + readonly property string mesgDisabled : qsTr("Maximum cumulative saline bolus volume delivered") + readonly property string mesgWaitForPump : "" // qsTr("Saline Bolus is starting") // Not sure if we shouls show any message at this point readonly property string mesgRejectReason : vTreatmentAdjustmentSaline.adjustment_ReasonText } - isTouchable : ! _root.isDisabled - buttonText : _root.isDisabled ? _private.textStart : _root.isStarted ? _private.textStop : _private.textStart + hasArrow : false + isTouchable : ! ( _root.isDisabled || _root.isWaitPump ) + buttonText : _root.isDisabled ? (_private.textStart || _root.isWaitPump ): + _root.isStarted ? _private.textStop : + _private.textStart title : qsTr("SALINE BOLUS") unit : Variables.unitTextSaline @@ -57,6 +62,7 @@ notification { visible : true - text : isDisabled ? _private.mesgAfterDisabled : _private.mesgRejectReason + text : isDisabled ? _private.mesgDisabled : + isWaitPump ? _private.mesgWaitForPump : _private.mesgRejectReason } } Index: sources/gui/qml/pages/treatment/sections/TreatmentTime.qml =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/sections/TreatmentTime.qml (.../TreatmentTime.qml) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/gui/qml/pages/treatment/sections/TreatmentTime.qml (.../TreatmentTime.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -32,7 +32,7 @@ property int progressValue : vTreatmentTime.time_Elapsed property int timeTextValue : vTreatmentTime.time_Remaining - property bool isPaused : vHDTreatmentStates.txPaused + property bool isRunning : vHDTreatmentStates.txDialysis_Running signal clicked() @@ -52,7 +52,7 @@ TimeText { id: _timeText anchors.centerIn : parent seconds : _root.timeTextValue - secondsVisible: ! _root.isPaused + secondsVisible: _root.isRunning } Rectangle { id: _timeTitleRect @@ -71,7 +71,7 @@ anchors.left: parent.left Image { id: _arrowImage - visible: ! _root.isPaused + visible: _root.isRunning anchors.left : parent.right anchors.bottom: parent.baseline anchors.leftMargin: 10 @@ -83,7 +83,7 @@ } NotificationBarSmall { id: _notification - visible : _root.isPaused + visible : ! _root.isRunning height : 25 imageAutoSize: false imageAnimated: true @@ -103,7 +103,7 @@ MouseArea { id: _mouseArea anchors.fill: parent onClicked: { - if (! _root.isPaused) { + if (_root.isRunning) { _root.clicked() } } Index: sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml =================================================================== diff -u -raabacb1dbdd30968ec8bc8ffc6c97263b09db71b -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml (.../TreatmentUltrafiltration.qml) (revision aabacb1dbdd30968ec8bc8ffc6c97263b09db71b) +++ sources/gui/qml/pages/treatment/sections/TreatmentUltrafiltration.qml (.../TreatmentUltrafiltration.qml) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -38,13 +38,13 @@ width : 200 height : 200 - isTouchable : ! vTreatmentAdjustmentSaline.isStarted + isTouchable : ! ( vHDTreatmentStates.sbRunning || vHDTreatmentStates.sbWaitPump ) title : qsTr("ULTRAFILTRATION VOLUME") + " " + Variables.unitTextUltrafiltrationVolume notification { visible : true imageSource : ufInfoImageSource text : ufInfoText - textColor : ufInfoTextColor + textColor : ufInfoTextColor } ProgressBarEx { id: _progressbarex Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -21,6 +21,8 @@ //project #include "GuiGlobals.h" +using namespace Gui; + namespace Model { @@ -150,12 +152,8 @@ */ class MAdjustUltrafiltrationStateReq : public MModel { public: - enum State{ - ePaused = 0, - eRunning = 1, - }; - State requestedState = ePaused; // the requested state. Initially it's running => paused. + GuiUFCommands requestedState = GuiUFCommands::UF_CMD_PAUSE; // the requested state. Initially it's running => paused. // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { @@ -249,6 +247,11 @@ */ class MAdjustSalineReq : public MModel { public: + /*! + * \brief The State enum + * \details The saline bolus requested state. + * There is no FW shared enum for this so has been defined here as documented in "Messages List". + */ enum State { eStop = 0, eStart = 1, Index: sources/model/hd/adjustment/MTreatmentAdjustSalineResponse.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/model/hd/adjustment/MTreatmentAdjustSalineResponse.cpp (.../MTreatmentAdjustSalineResponse.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/model/hd/adjustment/MTreatmentAdjustSalineResponse.cpp (.../MTreatmentAdjustSalineResponse.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -16,12 +16,12 @@ using namespace Model; - QVariantList MAdjustSalineResponse::parameters() const { return { _data.mAccepted.value, _data.mReason .value, - _data.mTarget .value + _data.mTarget .value, + _data.mState .value }; } @@ -30,10 +30,12 @@ if (GetValue(vByteArray, index, _data.mAccepted )) if (GetValue(vByteArray, index, _data.mReason )) if (GetValue(vByteArray, index, _data.mTarget )) + if (GetValue(vByteArray, index, _data.mState )) 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; } } /*! @@ -46,5 +48,6 @@ data.mAccepted = _data.mAccepted.value; data.mReason = _data.mReason .value; data.mTarget = _data.mTarget .value; + data.mState = _data.mState .value; return data; } Index: sources/model/hd/adjustment/MTreatmentAdjustSalineResponse.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/model/hd/adjustment/MTreatmentAdjustSalineResponse.h (.../MTreatmentAdjustSalineResponse.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/model/hd/adjustment/MTreatmentAdjustSalineResponse.h (.../MTreatmentAdjustSalineResponse.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -63,6 +63,7 @@ Types::U32 mAccepted; Types::U32 mReason ; Types::U32 mTarget ; + Types::U32 mState ; } _data; public: @@ -75,6 +76,7 @@ bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ quint32 mTarget = 0; /*!< Target Volume value of type quint32 extracted out */ + quint32 mState = 0; /*!< Saline State value of type quint32 extracted out */ }; MAdjustSalineResponse () { } Index: sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.cpp (.../MTreatmentAdjustUltrafiltrationStateResponse.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.cpp (.../MTreatmentAdjustUltrafiltrationStateResponse.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -19,15 +19,21 @@ QVariantList MAdjustUltrafiltrationStateResponse::parameters() const { return { - _data.mAccepted.value + _data.mAccepted.value, + _data.mReason .value, + _data.mState .value }; } bool MAdjustUltrafiltrationStateResponse::fromByteArray(const QByteArray &vByteArray, int *vIndex) { int index = 0; // message data start position - if (GetValue(vByteArray, index, _data.mAccepted)) + if (GetValue(vByteArray, index, _data.mAccepted )) + if (GetValue(vByteArray, index, _data.mReason )) + if (GetValue(vByteArray, index, _data.mState )) return true ; else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } } /*! @@ -37,6 +43,8 @@ */ AdjustUltrafiltrationStateResponseData MAdjustUltrafiltrationStateResponse::data() const { Data data; - data.mAccepted = _data.mAccepted.value; + data.mAccepted = _data.mAccepted.value; + data.mReason = _data.mReason .value; + data.mState = _data.mState .value; return data; } Index: sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.h =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.h (.../MTreatmentAdjustUltrafiltrationStateResponse.h) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/hd/adjustment/MTreatmentAdjustUltrafiltrationStateResponse.h (.../MTreatmentAdjustUltrafiltrationStateResponse.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -30,15 +30,18 @@ * \brief The MAdjustUltrafiltrationStateResponse class * \details The ultrafiltration adjustment state response model * - * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | - * |:----:|:------:|:-----:|:----:|:---:|:---:|:----:|:-----------: | - * |0x1000| 0x100 | 9 | Rsp | N | HD | UI | Generic response ACK/NAK | + * | MSG | CAN ID | M.Box | Type | Ack | Src | Dest | Description | + * |:---:|:------:|:-----:|:----:|:---:|:---:|:----:|:------------------------:| + * | 65 | 0x020 | 6 | Rsp | Y | HD | UI | UF Pause/Resume Response | * * | Payload || * | || - * | #1:(U08) | \ref Data::mAccepted | + * | #1:(U32) | \ref Data::mAccepted | + * | #2:(U32) | \ref Data::mReason | + * | #3:(U32) | \ref Data::mState | * * \sa Data + * \sa MAdjustUltrafiltrationStateReq : Ultrafiltration state change Request * *

Logging info

* | || @@ -56,19 +59,20 @@ QVariantList parameters() const override; struct { - Types::U08 mAccepted ; // IMPORTANT : This is a response of AcknowGeneric which has a data of 1 byte for the accepted/rejected state. + Types::U32 mAccepted; + Types::U32 mReason ; + Types::U32 mState ; } _data; public: - // coco begin validated : manually validated. - // this message has been inherited from MAbstract and should use notify but since the response message is not standard can't use notify yet. Type_Enum typeText () const override { return Type_Enum::eEvent ; } - // coco end Unit_Enum unitText () const override { return Unit_Enum::eHD ; } QString infoText () const override { return QString("AdjustUFState"); } struct Data { - bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ + quint32 mState = 0; /*!< UF State value of type quint32 extracted out */ }; MAdjustUltrafiltrationStateResponse() { } Index: sources/model/hd/data/MTreatmentStatesData.h =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/model/hd/data/MTreatmentStatesData.h (.../MTreatmentStatesData.h) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/model/hd/data/MTreatmentStatesData.h (.../MTreatmentStatesData.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -43,6 +43,9 @@ * | #3:(U32) | \ref Data::mSalineState | * * \sa Data + * \sa Saline_Bolus_States + * \sa UF_States + * \sa Treatment_States * *

Logging info

* | || @@ -72,9 +75,9 @@ QString infoText () const override { return QString("TreatmentStates"); } struct Data { - quint32 mSubMode = 0; ///< Sub-Mode - quint32 mUFState = 0; ///< UF State - quint32 mSalineState = 0; ///< Saline State + quint32 mSubMode = 0; ///< Sub-Mode - Saline_Bolus_States + quint32 mUFState = 0; ///< UF State - UF_States + quint32 mSalineState = 0; ///< Saline State - Treatment_States }; MTreatmentStates() { } Index: sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.cpp (.../VTreatmentAdjustmentResponseBase.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.cpp (.../VTreatmentAdjustmentResponseBase.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -48,7 +48,7 @@ * \details The slot to get the Reason Description * \return Reason description as string */ -QString View::VTreatmentAdjustmentResponseBase::text() +QString VTreatmentAdjustmentResponseBase::text() { QString text; if (_adjustment_Reason != GuiRequestReasons::REQUEST_REJECT_REASON_NONE) Index: sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.h (.../VTreatmentAdjustmentResponseBase.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/hd/adjustment/VTreatmentAdjustmentResponseBase.h (.../VTreatmentAdjustmentResponseBase.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -48,12 +48,13 @@ // The adjustment_Reason property as quint32 is not used directly in GUI // it will be used as QString text. // has been manually tested that it works perfectly fine if used. - PROPERTY( quint32 , adjustment_Reason , 0) + // this property changed to trigger since it has been found out during tests that the reason could be same but has to be shown again. + TRIGGER ( quint32 , adjustment_Reason , 0) // coco end PROPERTY( bool , adjustment_Accepted , 0) - Q_PROPERTY(QString adjustment_ReasonText READ text NOTIFY adjustment_ReasonChanged) + Q_PROPERTY(QString adjustment_ReasonText READ text NOTIFY adjustment_ReasonTriggered) VIEW_DEC_CLASS(VTreatmentAdjustmentResponseBase) Index: sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp (.../VTreatmentAdjustmentSaline.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/view/hd/adjustment/VTreatmentAdjustmentSaline.cpp (.../VTreatmentAdjustmentSaline.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -20,7 +20,6 @@ VIEW_DEF_CLASS_ADJUSTMENT(VTreatmentAdjustmentSaline, AdjustSalineResponseData) void VTreatmentAdjustmentSaline::initConnections() { - ACTION_VIEW_CONNECTION(TreatmentStatesData ); ACTION_VIEW_CONNECTION(AdjustSalineResponseData); ADJUST_VIEW_CONNECTION(AdjustSalineRequestData ); } @@ -31,37 +30,20 @@ adjustment_Reason ( vData.mReason ); target ( vData.mTarget ); - if (adjustment_Accepted()) { - // the response doesn't have the state so the requested state which has been accepted is used. - isStarted ( _data.requestedState == AdjustSalineRequestData::eStart ); - } + state ( vData.mState ); // *** 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 ); } /*! - * \brief VTreatmentAdjustmentSaline::onActionReceive - * \details This is the message handler of when the Saline is done - * the state of the Saline in the SalineState of the TreatmentStates message will change at anytime - * and so the state of the UI should change in regards to that field and affect the isStarted - * after the saline start request has been accepted. - * \param vData - data of the Treatment State Message. - */ -void VTreatmentAdjustmentSaline::onActionReceive(const TreatmentStatesData &vData) -{ - isStarted ( vData.mSalineState == GuiSalineStates::SALINE_BOLUS_STATE_IN_PROGRESS ); - isDisabled( vData.mSalineState == GuiSalineStates::SALINE_BOLUS_STATE_MAX_DELIVERED ); -} - -/*! * \brief View::VTreatmentAdjustmentSaline::doAdjustment * \details the invocable slot to adjust(start/stop) the treatment saline bolus state */ void View::VTreatmentAdjustmentSaline::doAdjustment() { - if (isStarted()) { + if ( state() == AdjustSalineRequestData::eStart ) { // last received/response state _data.requestedState = AdjustSalineRequestData::eStop; } else { Index: sources/view/hd/adjustment/VTreatmentAdjustmentSaline.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/adjustment/VTreatmentAdjustmentSaline.h (.../VTreatmentAdjustmentSaline.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/hd/adjustment/VTreatmentAdjustmentSaline.h (.../VTreatmentAdjustmentSaline.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -46,11 +46,9 @@ // coco end PROPERTY( qint32 , target , 0 ) - PROPERTY( bool , isStarted , false ) - PROPERTY( bool , isDisabled , false ) // the Saline is disabled due to maximum cumulative volume reached. + PROPERTY( qint32 , state , 0 ) VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentSaline, AdjustSalineResponseData) - VIEW_DEC_SLOT(TreatmentStatesData) // ---------- Start/Stop Saline Bolus public slots: Index: sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp =================================================================== diff -u -rc70a3e2ca2b9a679b042bf543dc331cffbd937ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp (.../VTreatmentAdjustmentUltrafiltrationState.cpp) (revision c70a3e2ca2b9a679b042bf543dc331cffbd937ac) +++ sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.cpp (.../VTreatmentAdjustmentUltrafiltrationState.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -26,15 +26,14 @@ void VTreatmentAdjustmentUltrafiltrationState::onActionReceive(const AdjustUltrafiltrationStateResponseData &vData) { - if ( vData.mAccepted ) { - // the response doesn't have the state so the requested state which has been accepted is used. - isPaused ( _data.requestedState == AdjustUltrafiltrationStateRequestData::ePaused ); - } - adjustment_Accepted ( vData.mAccepted ); + adjustment_Reason ( vData.mReason ); - // *** 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. *** + state ( vData.mState ); + + // *** 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. *** + // *** use this trigger to make sure you have all the properties with updated values *** adjustment ( true ); } @@ -44,7 +43,7 @@ */ void View::VTreatmentAdjustmentUltrafiltrationState::doPause() { - _data.requestedState = AdjustUltrafiltrationStateRequestData::ePaused; + _data.requestedState = GuiUFCommands::UF_CMD_PAUSE; emit didAdjustment(_data); // notify the controllers to do the adjustment } @@ -54,33 +53,6 @@ */ void View::VTreatmentAdjustmentUltrafiltrationState::doResume() { - _data.requestedState = AdjustUltrafiltrationStateRequestData::eRunning; + _data.requestedState = GuiUFCommands::UF_CMD_RESUME; emit didAdjustment(_data); // notify the controllers to do the adjustment } - -/*! - * \brief View::VTreatmentAdjustmentUltrafiltrationState::text - * \details The slot to get the Reason Description - * \return Reason description as string - * \note The ultrafiltration state (Resume/Pause) change has no returned reason code and it's only bool. - */ -QString View::VTreatmentAdjustmentUltrafiltrationState::text() -{ - if (adjustment_Accepted()) return ""; - - // if there is a reason (passed) it will be used - QString mText = VTreatmentAdjustmentResponseBase::text(); - // coco begin validated : Manually tested. - // Although currently there is no reason passed in the corresponding message. - // But kept this code which seems reasonable to have a reason later. - if (! mText.isEmpty()) return mText; - // coco end - // otherwise a general message will be created/passed. - if (isPaused()) { - mText = tr("Unable to Resume Ultrafiltration or already running"); - } else { - mText = tr("Unable to Pause Ultrafiltration or already paused"); - - } - return mText; -} Index: sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h (.../VTreatmentAdjustmentUltrafiltrationState.h) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationState.h (.../VTreatmentAdjustmentUltrafiltrationState.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -46,15 +46,14 @@ TRIGGER( bool , adjustment , 0) // coco end - PROPERTY( bool , isPaused , false) + PROPERTY( qint32 , state , 0) VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentUltrafiltrationState, AdjustUltrafiltrationStateResponseData) // ---------- Pause Ultrafiltration public slots: void doPause (); void doResume(); - QString text(); signals: void didAdjustment(const AdjustUltrafiltrationStateRequestData &vData); Index: sources/view/hd/data/VHDTreatmentStatesData.cpp =================================================================== diff -u -rc70a3e2ca2b9a679b042bf543dc331cffbd937ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/data/VHDTreatmentStatesData.cpp (.../VHDTreatmentStatesData.cpp) (revision c70a3e2ca2b9a679b042bf543dc331cffbd937ac) +++ sources/view/hd/data/VHDTreatmentStatesData.cpp (.../VHDTreatmentStatesData.cpp) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -17,20 +17,91 @@ // Project #include "GuiController.h" -VIEW_DEF(VHDTreatmentStates, TreatmentStatesData) +VIEW_DEF_CLASS(VHDTreatmentStates) +/*! + * \brief VTreatmentAdjustmentSaline::initConnections + * \details Initializes the message(s) connection + * \note This class not only listens to its dedicated message TreatmentStatesData, + * But also listens to other messages which affect ultrafiltration and saline bolus state. + * These extra messages are AdjustSalineResponseData , AdjustUltrafiltrationStateResponseData. + * Which ever comes first will set its related properties. + * Since the properties wont set twice if they have the same value it doesn't affect performance so much. + * Also FW suppose to send the TreatmentStatesData related message immediately after the two others. + */ +void VHDTreatmentStates::initConnections() { + ACTION_VIEW_CONNECTION(TreatmentStatesData ); + ACTION_VIEW_CONNECTION(AdjustSalineResponseData ); + ACTION_VIEW_CONNECTION(AdjustUltrafiltrationStateResponseData ); +} + +/*! + * \brief VHDTreatmentStates::onActionReceive + * \details sets the properties for the received data of Treatment States + * \param vData - Treatment States data + */ void VHDTreatmentStates::onActionReceive(const TreatmentStatesData &vData) { - subMode ( vData.mSubMode ); - ufState ( vData.mUFState ); - salineState ( vData.mSalineState ); + subMode ( vData.mSubMode ); + ufState ( vData.mUFState ); + salineState ( vData.mSalineState ); - // ultrafiltration - ufPaused ( vData.mUFState == GuiActions::UF_PAUSED_STATE ); - ufRunning ( vData.mUFState == GuiActions::UF_RUNNING_STATE ); - ufOff ( vData.mUFState == GuiActions::UF_OFF_STATE ); - ufCompleted ( vData.mUFState == GuiActions::UF_COMPLETED_STATE ); + // Ultrafiltration states + ufStart ( vData.mUFState == GuiUFStates ::UF_START_STATE ); + ufPaused ( vData.mUFState == GuiUFStates ::UF_PAUSED_STATE ); + ufRunning ( vData.mUFState == GuiUFStates ::UF_RUNNING_STATE ); + ufOff ( vData.mUFState == GuiUFStates ::UF_OFF_STATE ); + ufCompleted ( vData.mUFState == GuiUFStates ::UF_COMPLETED_STATE ); - // treatment duration - txPaused ( vData.mSubMode != GuiActions::TREATMENT_DIALYSIS_STATE ); + // Saline Bolus states + sbOff ( vData.mSalineState == GuiSalineStates ::SALINE_BOLUS_STATE_IDLE ); + sbWaitPump ( vData.mSalineState == GuiSalineStates ::SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP ); + sbRunning ( vData.mSalineState == GuiSalineStates ::SALINE_BOLUS_STATE_IN_PROGRESS ); + sbMaxReached ( vData.mSalineState == GuiSalineStates ::SALINE_BOLUS_STATE_MAX_DELIVERED ); + + // Treatment states + // Treatment states - Basics + txStart ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_START_STATE ); + txStop ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_STOP_STATE ); + txEnd ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_END_STATE ); + // Treatment states - Dialysis + txDialysis_Running ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_DIALYSIS_STATE ); + txDialysis_End ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_DIALYSIS_END_STATE ); + // Treatment states - Rinse back + txRinseback_Running ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_RINSEBACK_STATE ); + txRinseback_Pause ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_RINSEBACK_PAUSE_STATE ); + // Treatment states - Recirculate + txRecirculate_Setup ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_RECIRC_SETUP_STATE ); + txRecirculate_Running ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_RECIRC_STATE ); + txRecirculate_Pause ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_RECIRC_PAUSE_STATE ); + txRecirculate_Stop ( vData.mSubMode == GuiTreatmentStates ::TREATMENT_RECIRC_STOP_STATE ); } + +/*! + * \brief VHDTreatmentStates::onActionReceive + * \details message handler for the message AdjustUltrafiltrationStateResponse data + * \param vData - AdjustUltrafiltrationStateResponse data + */ +void VHDTreatmentStates::onActionReceive(const AdjustSalineResponseData &vData) +{ + // Saline Bolus states + sbOff ( vData.mState == GuiSalineStates ::SALINE_BOLUS_STATE_IDLE ); + sbWaitPump ( vData.mState == GuiSalineStates ::SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP ); + sbRunning ( vData.mState == GuiSalineStates ::SALINE_BOLUS_STATE_IN_PROGRESS ); + sbMaxReached ( vData.mState == GuiSalineStates ::SALINE_BOLUS_STATE_MAX_DELIVERED ); +} + +/*! + * \brief VHDTreatmentStates::onActionReceive + * \details message handler for the message AdjustUltrafiltrationStateResponse data + * \param vData - AdjustUltrafiltrationStateResponse data + */ +void VHDTreatmentStates::onActionReceive(const AdjustUltrafiltrationStateResponseData &vData) +{ + // Ultrafiltration states + ufStart ( vData.mState == GuiUFStates ::UF_START_STATE ); + ufPaused ( vData.mState == GuiUFStates ::UF_PAUSED_STATE ); + ufRunning ( vData.mState == GuiUFStates ::UF_RUNNING_STATE ); + ufOff ( vData.mState == GuiUFStates ::UF_OFF_STATE ); + ufCompleted ( vData.mState == GuiUFStates ::UF_COMPLETED_STATE ); +} Index: sources/view/hd/data/VHDTreatmentStatesData.h =================================================================== diff -u -rc70a3e2ca2b9a679b042bf543dc331cffbd937ac -r2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95 --- sources/view/hd/data/VHDTreatmentStatesData.h (.../VHDTreatmentStatesData.h) (revision c70a3e2ca2b9a679b042bf543dc331cffbd937ac) +++ sources/view/hd/data/VHDTreatmentStatesData.h (.../VHDTreatmentStatesData.h) (revision 2c9421bd6da03c7e0bd0bfa1f49fa95c2bd18a95) @@ -49,20 +49,48 @@ // and if one becomes true the other ones become false at the same time // so on each change we were going to have multiple signal emits. // but since it is not happening more often Property is used. - // otherwise it should be implemented as a single signal with these properties as parameters. - // also start UF_START_STATE has been intentionally ignored + // otherwise it should be implemented as a single signal with these properties as parameters.\n + // also start UF_START_STATE should not be used often // because it's only useful in FW implementation and it immediately changes to another state. - PROPERTY( bool , ufPaused , false) - PROPERTY( bool , ufRunning , false) - PROPERTY( bool , ufOff , true ) // default state - PROPERTY( bool , ufCompleted , false) - // treatment paused state - // normally paused - PROPERTY( bool , txPaused , true ) + // Ultrafiltration states + PROPERTY( bool , ufStart , false) ///< UF_START_STATE Start state of the ultrafiltration state machine + PROPERTY( bool , ufPaused , false) ///< UF_PAUSED_STATE Paused state of the ultrafiltration state machine + PROPERTY( bool , ufRunning , false) ///< UF_RUNNING_STATE Running state of the ultrafiltration state machine + PROPERTY( bool , ufOff , true ) ///< UF_OFF_STATE Completed/off state of the ultrafiltration state machine (default state) + PROPERTY( bool , ufCompleted , false) ///< UF_COMPLETED_STATE Completed state of ultrafiltration state machine - VIEW_DEC(VHDTreatmentStates, TreatmentStatesData) + // Saline Bolus states + PROPERTY( bool , sbOff , true ) ///< SALINE_BOLUS_STATE_IDLE No saline bolus delivery is in progress (default state) + PROPERTY( bool , sbWaitPump , false) ///< SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP Wait for pumps to stop before starting bolus + PROPERTY( bool , sbRunning , false) ///< SALINE_BOLUS_STATE_IN_PROGRESS A saline bolus delivery is in progress + PROPERTY( bool , sbMaxReached , false) ///< SALINE_BOLUS_STATE_MAX_DELIVERED Maximum saline bolus volume reached - no more saline bolus deliveries allowed + // Treatment states + // Treatment states - Basics + PROPERTY( bool , txStart , false) ///< TREATMENT_START_STATE Start treatment, prime blood side with gradual ramp for 1 min. while dialyzer is bypassed. No dialysis or UF taking place + PROPERTY( bool , txStop , false) ///< TREATMENT_STOP_STATE Treatment stopped. All pumps off. Dializer bypassed + PROPERTY( bool , txEnd , false) ///< TREATMENT_END_STATE Treatment has ended. All pumps off. Dialyzer is bypassed. Blood lines are closed. User to disconnect + // Treatment states - Dialysis + PROPERTY( bool , txDialysis_Running , false) ///< TREATMENT_DIALYSIS_STATE Perform dialysis. Deliver Heparin as prescribed. Deliver UF as prescribed. Handle saline boluses as requested + PROPERTY( bool , txDialysis_End , false) ///< TREATMENT_DIALYSIS_END_STATE Dialysis has ended. Blood pump slowed. Dialyzer is bypassed. Dialysate is recirculated. User can rinseback + // Treatment states - Rinse back + PROPERTY( bool , txRinseback_Running , false) ///< TREATMENT_RINSEBACK_STATE Perform rinseback with saline. Dialyzer bypassed. Dialysate recirculating + PROPERTY( bool , txRinseback_Pause , false) ///< TREATMENT_RINSEBACK_PAUSE_STATE Rinseback paused. Blood pump off. Dialyzer bypassed. Dialysate recirculating + // Treatment states - Recirculate + PROPERTY( bool , txRecirculate_Setup , false) ///< TREATMENT_RECIRC_SETUP_STATE Rinseback complete. Blood pump off. Blood lines closed. User to disconnect and shunt blood lines + PROPERTY( bool , txRecirculate_Running , false) ///< TREATMENT_RECIRC_STATE Recirculate saline and dialysate while patient disconnected. Blood lines open and shunted. Dialyzer is bypassed + PROPERTY( bool , txRecirculate_Pause , false) ///< TREATMENT_RECIRC_PAUSE_STATE Recirculate paused. Blood pump off. Blood lines closed and shunted. Dialyzer is bypassed + PROPERTY( bool , txRecirculate_Stop , false) ///< TREATMENT_RECIRC_STOP_STATE Recirculate stopped. Blood pump off. Blood lines open. Waiting for patient to unshunt and connect and resume treatment + + // class definition + VIEW_DEC_CLASS(VHDTreatmentStates) + + // slots for received data messages (onActionReceive) + VIEW_DEC_SLOT (TreatmentStatesData ) // Treatment States broadcast messages (This class original receiver) + VIEW_DEC_SLOT (AdjustSalineResponseData ) // Saline Bolus Adjustment response message + VIEW_DEC_SLOT (AdjustUltrafiltrationStateResponseData ) // Ultrafiltration state adjustment response message + public slots: }; }