Index: sources/gui/qml/pages/treatment/TreatmentHDF.qml =================================================================== diff -u -rc70815ad2b3beadf61832f2e4d12eb90d476e020 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/gui/qml/pages/treatment/TreatmentHDF.qml (.../TreatmentHDF.qml) (revision c70815ad2b3beadf61832f2e4d12eb90d476e020) +++ sources/gui/qml/pages/treatment/TreatmentHDF.qml (.../TreatmentHDF.qml) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -25,14 +25,31 @@ import "qrc:/pages/treatment/sections" ScreenItem { id: _root + enum Status { + Active = 0, + Paused = 1, + Complete = 2 + } + readonly property int margin : Variables.defaultMargin * 5 - readonly property color statusColor : Colors.statusActive - showCreateRxHeaderButton : true + readonly property int hdfState : vTreatmentHDF.hdfState + function statusColor ( vHeaderBar = false ) { + return _root.hdfState === TreatmentHDF.Active ? Colors.statusActive : + _root.hdfState === TreatmentHDF.Paused ? Colors.statusPaused : + _root.hdfState === TreatmentHDF.Complete ? vHeaderBar ? Colors.statusComplete : + Colors.statusTextComplete : Colors.transparent + } + property alias notification : _notification + onHdfStateChanged : setStatusColor() + showCreateRxHeaderButton: true + signal sectionPressuresClicked() signal treatmentHDFEditClicked() - Component.onCompleted : vHeaderbarModel.setHeaderbarHDFStatusColor(_root.statusColor.toString()) + function setStatusColor() { + vHeaderbarModel.setHeaderbarHDFStatusColor(_root.statusColor(true).toString()) + } Connections { target: vTDOpMode function onInTreatmentChanged ( vValue ) { if ( vValue ) { _chart.updateXAxis() } } @@ -89,11 +106,13 @@ objectName : "_treatmentHdfComponent" width : _column.width height : _column.cellHeight - statusColor : _root.statusColor + statusColor : _root.statusColor() - onSubstitutionFlowClicked : print ("Substitution Flow Clicked") + onPauseResumeClicked : vTreatmentHDF.hdfState === TreatmentHDFComponent.Paused ? vTreatmentAdjustmentHDFState.doResume() : + vTreatmentAdjustmentHDFState.doPause() - onEditClicked : _root.treatmentHDFEditClicked() + onEditClicked : _root.treatmentHDFEditClicked() } } + NotificationBarSmall { id: _notification } } Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r59a1b4dceeb629ed08a434775d819ce108fe894b -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 59a1b4dceeb629ed08a434775d819ce108fe894b) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -43,6 +43,7 @@ _treatmentAdjustmentUltrafiltration .close() if (visible) { + _treatmentHDF.setStatusColor() _headerBar.activeStack = stackView } else { @@ -69,7 +70,7 @@ case HeaderBar.Heparin: page( _treatmentHeparin ) break - case HeaderBar.HDF: // TODO + case HeaderBar.HDF: page( _treatmentHDF ) break default: @@ -217,6 +218,44 @@ } + Connections { target: vTreatmentAdjustmentHDF + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentHDF.adjustment_Accepted) { + if ( _treatmentAdjustmentHDF.isValid ) { + vTreatmentCreate.hdfTreatmentMode = _treatmentAdjustmentHDF.txMode + vTreatmentCreate.substitutionFluidVolume = _treatmentAdjustmentHDF.prescFluidVolume + _treatmentAdjustmentHDF.close() + } + } + else { + _treatmentAdjustmentHDF.notification.text = vTreatmentAdjustmentHDF.text() + } + } + } + + Connections { target: vTreatmentAdjustmentHDFState + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentHDFState.adjustment_Accepted) { + _treatmentHDF.notification.text = "" + } + else { + _treatmentHDF.notification.text = vTreatmentAdjustmentHDFState.text() + } + } + } + + Connections { target: vTreatmentAdjustmentAutoSub + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentAutoSub.adjustment_Accepted) { + _treatmentHDF.notification.text = "" + } + else { + print(vTreatmentAdjustmentAutoSub.text()) + _treatmentHDF.notification.text = vTreatmentAdjustmentAutoSub.text() + } + } + } + Connections { target: vTreatmentAdjustmentVitalsAlarmLimits function onAdjustmentTriggered ( vValue ) { if (vTreatmentAdjustmentVitalsAlarmLimits.adjustment_Accepted) { Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentHDF.qml =================================================================== diff -u -r600b6707b102919d981f3b1d18611834e23eae60 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentHDF.qml (.../TreatmentAdjustmentHDF.qml) (revision 600b6707b102919d981f3b1d18611834e23eae60) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentHDF.qml (.../TreatmentAdjustmentHDF.qml) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -15,10 +15,13 @@ height : Variables.smallDialogHeight width : Variables.smallDialogWidth + readonly property bool isValid : _prescribedFluidVolume.valid && _treatmentMode.valid + readonly property int txMode : _treatmentModeControl.value + readonly property real prescFluidVolume: _prescribedFluidVolume.value + function confirm() { - vTreatmentCreate.hdfTreatmentMode = _treatmentModeControl.currentIndex - vTreatmentCreate.substitutionFluidVolume = _prescribedFluidVolume.value - _root.close() + vTreatmentAdjustmentHDF.doAdjustment( _treatmentModeControl.value , + _prescribedFluidVolume.value ) } onOpened: { @@ -40,11 +43,18 @@ text : qsTr("Treatment Mode") width : Variables.adjustmentLabelUnitContainerWidth height : Variables.adjustmentLabelUnitContainerHeight + valid : ! vTreatmentAdjustmentHDF.treatmentModeRejectionReason + onEditClicked : _root.treatmentHDFEditClicked() contentItem : ValueAdjusterCustom { id: _treatmentModeControl value : vTreatmentCreate.hdfTreatmentMode model : vTreatmentRanges.hdfTreatmentModeOptions + + onDidChange : function(vValue) { + if ( ! _treatmentMode.valid ) { vTreatmentAdjustmentHDF.treatmentModeRejectionReason = Variables.noRejectReason } + value = vValue + } } } @@ -53,6 +63,8 @@ text : qsTr("Prescribed Sub. Fluid Volume") width : Variables.adjustmentLabelUnitContainerWidth height : Variables.adjustmentLabelUnitContainerHeight + valid : ! vTreatmentAdjustmentHDF.prescSubVolumeRejectionReason + unitText : Variables.unitVolume decimal : Variables.substitutionPrecision valueTextColor : Colors.offWhite @@ -64,6 +76,7 @@ defaultValue : vTreatmentRanges.substitutionVolumeDef onDidChange : function(vValue) { + if ( ! _prescribedFluidVolume.valid ) { vTreatmentAdjustmentHDF.prescSubVolumeRejectionReason = Variables.noRejectReason } value = vValue } } @@ -78,6 +91,7 @@ width : Variables.defaultButtonWidth height : Variables.defaultButtonHeight + enabled : _root.isValid anchors { top : undefined Index: sources/gui/qml/pages/treatment/sections/TreatmentHDFComponent.qml =================================================================== diff -u -r600b6707b102919d981f3b1d18611834e23eae60 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/gui/qml/pages/treatment/sections/TreatmentHDFComponent.qml (.../TreatmentHDFComponent.qml) (revision 600b6707b102919d981f3b1d18611834e23eae60) +++ sources/gui/qml/pages/treatment/sections/TreatmentHDFComponent.qml (.../TreatmentHDFComponent.qml) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -24,7 +24,11 @@ color : Colors.panelBackgroundColor header.color : Colors.heparinSectionHeader enableDropShadow: false - header.title : qsTr("Hemodiafiltration") + " (" + qsTr("HDF") + ")" + header { + title : qsTr("Hemodiafiltration") + " (" + qsTr("HDF") + ")" + showPauseResume : true + isPaused : vTreatmentHDF.hdfState === TreatmentHDF.Paused + } contentArea.anchors { topMargin : Variables.defaultMargin @@ -43,28 +47,26 @@ readonly property int topTextFontSize : 25 readonly property int bottomTextFontSize : 60 - readonly property real estimatedSubstitutionVal : 23.0 // TODO update later - readonly property int substitutionRate : 125 // TODO update later + readonly property real estimatedSubstitutionVal : vTreatmentHDF.requestedVolume + readonly property real substitutionRate : vTreatmentHDF.currentRate readonly property real minimum : vTreatmentRanges.substitutionVolumeMin readonly property real maximum : vTreatmentRanges.substitutionVolumeMax readonly property real resolution : vTreatmentRanges.substitutionVolumeRes - readonly property real substitutionValue: 10.0 // TODO update later + readonly property real substitutionValue: vTreatmentHDF.totalVolume - readonly property string statusText : qsTr("Active") - /*isDispensing ? qsTr("Active") : - isPaused ? qsTr("Pause") : - isCompleted ? qsTr("Complete") : qsTr("Active")*/ + readonly property string statusText : vTreatmentHDF.hdfState === TreatmentHDF.Active ? qsTr("Active") : + vTreatmentHDF.hdfState === TreatmentHDF.Paused ? qsTr("Pause") : + vTreatmentHDF.hdfState === TreatmentHDF.Complete ? qsTr("Complete") : Variables.emptyEntry - readonly property string buttonText : qsTr("Pause Substitution Flow") + property color statusColor : Colors.transparent readonly property int cellHeight: contentItem.height readonly property int cellWidth : contentItem.width / 2 - _row.spacing - signal substitutionFlowClicked() contentItem: Row { id: _row spacing: Variables.defaultMargin * 2 @@ -83,7 +85,7 @@ topText : qsTr("Estimated Final Substitution Volume") topTextFont.pixelSize : topTextFontSize topTextFont.weight : Font.Medium - bottomText : (_root.estimatedSubstitutionVal).toFixed(Variables.substitutionPrecision) //vTreatmentUltrafiltration.setVolume.toFixed(Variables.substitutionPrecision) + bottomText : (_root.estimatedSubstitutionVal).toFixed(Variables.substitutionPrecision) bottomTextFont.pixelSize: bottomTextFontSize bottomTextFont.weight : Font.Normal leftAlign : true @@ -102,7 +104,8 @@ topText : qsTr("Substitution Rate") topTextFont.pixelSize : topTextFontSize topTextFont.weight : Font.Medium - bottomText : _root.substitutionRate //vTreatmentUltrafiltration.setVolume.toFixed(Variables.substitutionPrecision) + bottomText : _root.substitutionRate.toFixed(Variables.substitutionPrecision) + bottomTextColor : vTreatmentHDF.hdfState === TreatmentHDF.Paused ? Colors.statusTextPaused : Colors.textTextRectLabel bottomTextFont.pixelSize: bottomTextFontSize bottomTextFont.weight : Font.Normal leftAlign : true @@ -118,11 +121,11 @@ width : parent.width * 0.6 height : 20 decimal : Variables.substitutionPrecision - minimum : _root.minimum - maximum : vTreatmentCreate.substitutionFluidVolume - value : _root.substitutionValue + minimum : 0 + maximum : _root.estimatedSubstitutionVal.toFixed(Variables.substitutionPrecision) + value : _root.substitutionValue.toFixed(Variables.substitutionPrecision) unitText : Variables.unitVolume - color : Colors.progressBarUltrafiltration + color : vTreatmentHDF.hdfState === TreatmentHDF.Paused ? Colors.pauseColor : Colors.progressBarUltrafiltration bgColor : Colors.heparinSectionHeader radius : height showMarker : false @@ -145,7 +148,7 @@ right : parent.right } text : _root.substitutionValue.toFixed(Variables.substitutionPrecision) + " " + Variables.unitVolume - color : Colors.white + color : vTreatmentHDF.hdfState === TreatmentHDF.Paused ? Colors.statusTextPaused : Colors.offWhite font.pixelSize : 40 font.weight : Font.DemiBold } @@ -180,25 +183,6 @@ font.weight : Font.DemiBold } } - - TouchRect { id : _substitutionFlowButton - width : text.implicitWidth + Variables.defaultMargin * 2 - height : 60 - text { - text : _root.buttonText - font.pixelSize : Fonts.fontPixelConfirm - font.weight : Font.Medium - } - - isDefault: true - - anchors { - bottom : parent.bottom - horizontalCenter: parent.horizontalCenter - } - - onClicked: substitutionFlowClicked() - } } Column { id: _rightColumn @@ -235,12 +219,10 @@ right : _autoSubText.left rightMargin : Variables.defaultMargin } - checked : true // TODO + checked : vTreatmentHDF.autoSubState height : Variables.contentHeight - onClicked: { - print (("Auto Sub Switch set to %1").arg(_autoSubSwitch.checked ? "On" : "Off")) - } + onClicked: vTreatmentAdjustmentAutoSub.doAdjustment( ! _autoSubSwitch.checked ) } } Index: sources/model/td/adjustment/treatment/MTreatmentAdjustAutoSubResponse.h =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/model/td/adjustment/treatment/MTreatmentAdjustAutoSubResponse.h (.../MTreatmentAdjustAutoSubResponse.h) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/model/td/adjustment/treatment/MTreatmentAdjustAutoSubResponse.h (.../MTreatmentAdjustAutoSubResponse.h) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -53,7 +53,7 @@ QString infoText () const override { return QString("AdjustAutoSub") ; } struct Data { - bool mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ + quint32 mAccepted = 0; /*!< Accepted value of type quint32 extracted out */ quint32 mReason = 0; /*!< Reason value of type quint32 extracted out */ }; Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDF.cpp =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDF.cpp (.../VTreatmentAdjustmentHDF.cpp) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDF.cpp (.../VTreatmentAdjustmentHDF.cpp) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -8,7 +8,7 @@ void VTreatmentAdjustmentHDF::initConnections() { ACTION_VIEW_CONNECTION(AdjustHDFResponseData); - ADJUST_VIEW_CONNECTION(AdjustVitalsAlarmLimitsRequestData ); + ADJUST_VIEW_CONNECTION(AdjustHDFRequestData ); } void VTreatmentAdjustmentHDF::onActionReceive(const AdjustHDFResponseData &vData) @@ -33,7 +33,8 @@ void VTreatmentAdjustmentHDF::doAdjustment( const quint32 vTreatmentMode , const float vSubFluidVolume ) { - _data.treatmentMode = vTreatmentMode ; - _data.subFluidVolume = vSubFluidVolume; - emit didAdjustment(_data); + AdjustHDFRequestData mData; + mData.treatmentMode = vTreatmentMode ; + mData.subFluidVolume = vSubFluidVolume; + emit didAdjustment(mData); } Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDF.h =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDF.h (.../VTreatmentAdjustmentHDF.h) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDF.h (.../VTreatmentAdjustmentHDF.h) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -23,8 +23,6 @@ // friends friend class ::tst_views; - AdjustHDFRequestData _data; - // The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI TRIGGER( bool , adjustment , 0) Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDFState.cpp =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDFState.cpp (.../VTreatmentAdjustmentHDFState.cpp) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDFState.cpp (.../VTreatmentAdjustmentHDFState.cpp) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -23,13 +23,23 @@ /*! * \brief View::VTreatmentAdjustmentHDFState::doAdjustment - * \details request state of auto sub + * \details request state of hdf state */ -void View::VTreatmentAdjustmentHDFState::doAdjustment (int state) +void View::VTreatmentAdjustmentHDFState::doPause () { AdjustHDFStateRequestData mData; - mData.state = state; + mData.state = 0; // update later with FW common enum emit didAdjustment(mData); // notify the controllers to do the adjustment } +/*! + * \brief View::VTreatmentAdjustmentHDFState::doAdjustment + * \details request state of hdf state + */ +void View::VTreatmentAdjustmentHDFState::doResume () +{ + AdjustHDFStateRequestData mData; + mData.state = 1; // update later with FW common enum + emit didAdjustment(mData); // notify the controllers to do the adjustment +} Index: sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDFState.h =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDFState.h (.../VTreatmentAdjustmentHDFState.h) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/view/td/adjustment/treatment/VTreatmentAdjustmentHDFState.h (.../VTreatmentAdjustmentHDFState.h) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -31,7 +31,8 @@ VIEW_DEC_CLASS_ADJUSTMENT(VTreatmentAdjustmentHDFState, AdjustHDFStateResponseData) public slots: - void doAdjustment (int state); + void doPause (); + void doResume (); signals: void didAdjustment(const AdjustHDFStateRequestData &vData); Index: sources/view/td/data/treatment/VTreatmentHDFData.cpp =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/view/td/data/treatment/VTreatmentHDFData.cpp (.../VTreatmentHDFData.cpp) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/view/td/data/treatment/VTreatmentHDFData.cpp (.../VTreatmentHDFData.cpp) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -14,7 +14,7 @@ targetTMP ( vData.mTargetTMP ); currentRate ( vData.mCurrentRate ); currentTMP ( vData.mCurrentTMP ); - mRequestedVolume ( vData.mRequestedVolume ); + requestedVolume ( vData.mRequestedVolume ); totalVolume ( vData.mTotalVolume ); isHDFRequested ( vData.mIsHDFRequested ); } Index: sources/view/td/data/treatment/VTreatmentHDFData.h =================================================================== diff -u -r8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0 -r04892d957c8f85eba1dc0550c2c9b01eef86efe9 --- sources/view/td/data/treatment/VTreatmentHDFData.h (.../VTreatmentHDFData.h) (revision 8fa5a167170e6b1c77551e8583e5ec3dcb8f45b0) +++ sources/view/td/data/treatment/VTreatmentHDFData.h (.../VTreatmentHDFData.h) (revision 04892d957c8f85eba1dc0550c2c9b01eef86efe9) @@ -29,7 +29,7 @@ PROPERTY( float , targetTMP , 0) PROPERTY( float , currentRate , 0) PROPERTY( float , currentTMP , 0) - PROPERTY( float , mRequestedVolume, 0) + PROPERTY( float , requestedVolume , 0) PROPERTY( float , totalVolume , 0) PROPERTY( quint32 , isHDFRequested , 0)