Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -re8df7fe7fe6274c416f176369250b9581e07d2a5 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision e8df7fe7fe6274c416f176369250b9581e07d2a5) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 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 TreatmentStack.qml - * \author (last) Behrouz NematiPour - * \date (last) 28-Sep-2022 + * \author (last) Vy + * \date (last) 14-Jun-2023 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * @@ -34,7 +34,7 @@ onVisibleChanged : { // this should never happen by design, but in tests it can easily happen and will block the screen touch. _treatmentAdjustmentFlow .close() - _vitalEntry .close() + _vitalEntry .close( true ) // vQuit == true _treatmentAdjustmentPressuresLimits .close() _treatmentAdjustmentDuration .close() _treatmentUltrafiltrationItem .close() @@ -51,12 +51,17 @@ readonly property bool isSBInProgress : ( vHDTreatmentStates.sbRunning || vHDTreatmentStates.sbWaitPump ) + readonly property bool isDialogOpened : _treatmentAdjustmentFlow .visible + || _treatmentAdjustmentPressuresLimits .visible + || _treatmentAdjustmentDuration .visible + || _treatmentUltrafiltrationItem .visible // Components MainMenu { id: _treatmentMenu y : Variables.mainMenuHeight * -1 position : MainMenu.Position.Top hidden : true titles : [ qsTr("Treatment") , qsTr("Trending") , qsTr("Settings") ] + visibleItems : [ true , false , false ] spacing : 20 leftPdding : 20 rightPdding : 50 @@ -74,138 +79,55 @@ TreatmentBloodPrime { id: _treatmentBloodPrime } TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } - TreatmentHome { id: _treatmentHome - onSectionFlowClicked : { + TreatmentHome { id: _treatmentHome } + + Connections { target: _treatmentHome + function onSectionFlowClicked ( vValue ) { _treatmentAdjustmentFlow.open() } - onSectionVitalsClicked : { + function onSectionVitalsClicked ( vValue ) { _vitalEntry.open() } - onSectionPressuresClicked: { + function onSectionPressuresClicked ( vValue ) { _treatmentAdjustmentPressuresLimits.open() } - onSectionTimeClicked : { - _treatmentAdjustmentDuration.durationValue = vTreatmentTime.time_Total / 60 // minutes => hours + function onSectionTimeClicked ( vValue ) { + //DEBUG: console.log("time total minutes: " + vTreatmentTime.time_Total / 60 ) + _treatmentAdjustmentDuration.setDurationValue(vTreatmentTime.time_Total / 60) // minutes => hours _treatmentAdjustmentDuration.open() } - onSectionUltrafiltrationClicked: { + function onSectionUltrafiltrationClicked ( vValue ) { _treatmentUltrafiltrationItem.open() } } - ScreenItem { id: _treatmentTrending -/* ----- TEST: Under the test code, for the plotting of the items ----- - Timer { id: _timer - property real x1: 0 - property real x2: 0 - interval: 500 - running: _treatmentTrending.visible - repeat: true - onTriggered: { - x1 = x1 + 1 - x2 = x2 + 0.1 + ScreenItem { id: _treatmentTrending } - var r = Math.random() - _lineSerries1.append(x1, r * 10 ) - _lineSerries2.append(x2, r ) - } - } - Column { - anchors.fill: parent - anchors.topMargin: Variables.mainMenuHeight - Slider { id : _zoomSlider - width : parent.width - minimum : 0 - maximum : 2 - step : 0.1 - value : 0 - onValueChanged: _chartView.zoom(value) - } - TouchRect { - width : 50 - height : 50 - onClicked: _chartView.zoomReset() - } + //// Treatment Adjustment Dialogs + TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow } + TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } - ChartView { id: _chartView - title: "Line" - width: parent.width - height: parent.height - _zoomSlider.height - antialiasing: true - backgroundColor: Colors.transparent - - legend.labelColor: Colors.white - - ValueAxis { id: xAxis1 - color: Colors.white - min: 0 - max: _timer.x1 - } - ValueAxis { id: yAxis1 - color: Colors.white - min: 0 - max: 10 - } - SplineSeries { id: _lineSerries1 - name: "LineSeries" - axisX: xAxis1 - axisY: yAxis1 - } - ValueAxis { id: xAxis2 - color: Colors.white - min: 0 - max: _timer.x2 - } - ValueAxis { id: yAxis2 - color: Colors.white - labelsColor: Colors.red - min: 0 - max: 10 - } - SplineSeries { id: _lineSerries2 - name: "LineSeries" - axisX: xAxis2 - axisY: yAxis2 - } - } + Connections { target: _treatmentAdjustmentFlow + function onConfirmClicked ( vValue ) { vTreatmentAdjustmentFlows.doAdjustment( + _treatmentAdjustmentFlow.bloodFlowRateValue , + _treatmentAdjustmentFlow.dialysateFlowRateValue ) } -*/ } - - //// Treatment Adjustment Dialogs - TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow - onConfirmClicked : vTreatmentAdjustmentFlows.doAdjustment(bloodFlowRateValue, dialysateFlowRateValue) + Connections { target: _treatmentAdjustmentPressuresLimits + function onConfirmClicked ( vValue ) { vTreatmentAdjustmentPressuresLimits.doAdjustment( + _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow , + _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow , + _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc ) + } } - TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits - onConfirmClicked : vTreatmentAdjustmentPressuresLimits.doAdjustment( - arterialPressureLowerBound , - arterialPressureUpperBound , - venousPressureLowerBound , - venousPressureUpperBound - ) - - arterialPressureMinimum : vTreatmentRanges.arterialPressureMonitorMin - arterialPressureMaximum : vTreatmentRanges.arterialPressureMonitorMax - venousPressureMinimum : vTreatmentRanges.venousPressureMonitorMin - venousPressureMaximum : vTreatmentRanges.venousPressureMonitorMax - - arterialPressureLowerBound : vTreatmentAdjustmentPressuresLimits.arterialLimitLow - arterialPressureUpperBound : vTreatmentAdjustmentPressuresLimits.arterialLimitHigh - venousPressureLowerBound : vTreatmentAdjustmentPressuresLimits.venousLimitLow - venousPressureUpperBound : vTreatmentAdjustmentPressuresLimits.venousLimitHigh - - arterialPressureStep : vTreatmentRanges.arterialPressureLimitLowRes - arterialPressureValue : vTreatmentPressureOcclusion.arterialPressure - - venousPressureStep : vTreatmentRanges.venousPressureLimitLowRes - venousPressureValue : vTreatmentPressureOcclusion.venousPressure + TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } + Connections { target: _treatmentAdjustmentDuration + function onConfirmClicked ( vValue ) { vTreatmentAdjustmentDuration.doAdjustment( + _treatmentAdjustmentDuration.durationValue ) + } } - TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration - onConfirmClicked : vTreatmentAdjustmentDuration.doAdjustment(durationValue) - } - EntryDialog { id: _vitalEntry function update(vSystolic, vDiastolic ,vHeartRate) { _bphrEntry.systolic = vSystolic ? vSystolic : "" @@ -228,50 +150,47 @@ vTreatmentVitals.doSkip() // only for logging } - onOpened : { - vTreatmentVitals.doTimerStop() // Can't be moved to C++, and has to be handled here because it can manually being opened by the user - _bphrEntry.setFocus() - } + onOpened : vTreatmentVitals.doTimerStop() // Can't be moved to C++, and has to be handled here because it can manually being opened by the user onClosed : { - vTreatmentVitals.doTimerStart() + if ( ! vQuit ) + vTreatmentVitals.doTimerStart() } BPHREntry { id : _bphrEntry contentRectHeight : _vitalEntry.contentRect.height } Connections { target: vTreatmentVitals - onDidTrigger : { + function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { if ( vTreatmentVitals.enableDialog ) { - _vitalEntry.update(vSystolic, vDiastolic, vHeartRate ) - _vitalEntry.open() + _vitalEntry.update ( vSystolic, vDiastolic, vHeartRate ) + _vitalEntry.open () } } } } // ---------- Manages Responses ---------- Connections { target: vTreatmentAdjustmentDuration - onAdjustmentTriggered : { + function onAdjustmentTriggered ( vValue ) { if ( vTreatmentAdjustmentDuration.adjustment_Accepted ) { vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentDuration.ultrafiltration _treatmentAdjustmentDuration.accept() } else { - _treatmentAdjustmentDuration.durationValue = vTreatmentAdjustmentDuration.duration; + _treatmentAdjustmentDuration.setDurationValue(vTreatmentAdjustmentDuration.duration); _treatmentAdjustmentDuration.notification.text = vTreatmentAdjustmentDuration.text(); } } } Connections { target: vTreatmentAdjustmentPressuresLimits - onAdjustmentTriggered : { + function onAdjustmentTriggered ( vValue ) { // values have to be update even when rejected HD is reverting back the values. // if accepted will be updated for later [may need refresh later] - _treatmentAdjustmentPressuresLimits.arterialPressureLowerBound = vTreatmentAdjustmentPressuresLimits.arterialLimitLow - _treatmentAdjustmentPressuresLimits.arterialPressureUpperBound = vTreatmentAdjustmentPressuresLimits.arterialLimitHigh - _treatmentAdjustmentPressuresLimits.venousPressureLowerBound = vTreatmentAdjustmentPressuresLimits.venousLimitLow - _treatmentAdjustmentPressuresLimits.venousPressureUpperBound = vTreatmentAdjustmentPressuresLimits.venousLimitHigh + _treatmentAdjustmentPressuresLimits.arterialPressureLimitWindow = vTreatmentAdjustmentPressuresLimits.arterialPressureLimitWindow + _treatmentAdjustmentPressuresLimits.venousPressureLimitWindow = vTreatmentAdjustmentPressuresLimits.venousPressureLimitWindow + _treatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc = vTreatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc if (vTreatmentAdjustmentPressuresLimits.adjustment_Accepted) { _treatmentAdjustmentPressuresLimits.close() @@ -285,11 +204,11 @@ Connections { target: vHDOperationMode // The initail screen should be the Blood Prime, since that one is the earlier state in the list. // also since it is being used in two stacks In-Treatment and also in End-Treatmet is has been defined in the MainStack. - onInTreatmentChanged : { page( _treatmentBloodPrime , vinTreatment )} + function onInTreatmentChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} } Connections { target: _treatmentBloodPrime - onVisibleChanged: { + function onVisibleChanged ( vValue ) { if (_treatmentBloodPrime.visible) { _treatmentMenu.hidden = true } @@ -298,11 +217,11 @@ Connections { target: vHDTreatmentStates // in-Treatmet - onTxBloodPrimeChanged : { page( _treatmentBloodPrime , vtxBloodPrime )} - onTxDialysisChanged : { page( _treatmentHome , vtxDialysis )} + function onTxBloodPrimeChanged ( vValue ) { page( _treatmentBloodPrime , vValue )} + function onTxDialysisChanged ( vValue ) { page( _treatmentHome , vValue )} } Connections { target: _mainHome - onStartTreatment : { page( _treatmentHome )} + function onStartTreatment ( vValue ) { page( _treatmentHome )} } }