Index: sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml =================================================================== diff -u -rec7f919fdb70ff29a8de627937e4ad7008e59c1c -rc4dffe90d1a236a107599027b0b4248d25314af6 --- sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) +++ sources/gui/qml/pages/pretreatment/connection/PreTreatmentConnectionStack.qml (.../PreTreatmentConnectionStack.qml) (revision c4dffe90d1a236a107599027b0b4248d25314af6) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2021-2022 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-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 PreTreatmentConnectionStack.qml * \author (last) Behrouz NematiPour - * \date (last) 19-Jan-2022 + * \date (last) 23-Sep-2024 * \author (original) Behrouz NematiPour * \date (original) 18-Mar-2021 * @@ -23,6 +23,7 @@ import "qrc:/compounds" import "qrc:/pages/pretreatment" import "qrc:/pages/pretreatment/connection" +import "qrc:/pages/settings" // for SettingsBluetoothCuff /*! * \brief the pre-treatment consumbles stack screen @@ -34,10 +35,10 @@ property int stackStepIndex : 7 - PreTreatmentUltrafiltration { id: _preTreatmentUltrafiltration - header.stepIndex : 5 - header.confirmVisible : true - title.text : qsTr("Ultrafiltration Setup") + function clear() { + _preTreatmentVitals .clear() + _preTreatmentUltrafiltration.clear() + } PreTreatmentBase { id: _preTreatmentVitals // BP/HR Entry @@ -47,17 +48,31 @@ _bphrEntry.heartRate = vHeartRate ? vHeartRate : "" } - header.stepIndex : 6 - header.confirmText.text : _bphrEntry.isValid ? qsTr("CONFIRM") : qsTr("SKIP") - header.backVisible : true + function clear() { + _bphrEntry.clear() + } + + header.stepIndex : 5 + header.confirmText.text : qsTr("CONFIRM") + header.backVisible : false header.confirmVisible : true + header.confirmEnabled : _bphrEntry.isValid title.text : qsTr("BP/HR") BPHREntry { id: _bphrEntry topMarginContent : 250 contentRectHeight : _root.height } + TouchRect { id: _enterBluetoothScreen + visible : vBluetooth.pairedAddr == "" // empty pairedAddr indicate not paired + text.text : qsTr("CONNECTION") + onClicked : page(_settingsBluetoothPage) + width : _bphrEntry.width/2 + anchors.top : _bphrEntry.bottom + anchors.topMargin : Variables.notificationHeight + Variables.minVGap + anchors.horizontalCenter: _bphrEntry.horizontalCenter + } Label { - text : qsTr("Press START on Blood Pressure Measurement Cuff to display reading or enter vitals manually") + text : (vBluetooth.pairedAddr == "") ? qsTr("Press CONNECTION to pair a Bluetooth Pressure Measurement Cuff.") : qsTr("Press START on Blood Pressure Measurement Cuff to display reading or enter vitals manually") width : parent.width anchors { bottom: parent.bottom @@ -80,12 +95,25 @@ } Connections { target: vTreatmentVitals - onDidTrigger: { + function onDidTrigger ( vSystolic, vDiastolic, vHeartRate ) { _preTreatmentVitals.update( vSystolic, vDiastolic, vHeartRate ) } } } + SettingsBluetoothCuff { id: _settingsBluetoothPage + property var itemsText : [qsTr("Bluetooth Cuff")] + itemIndex : 0 // set to zero for itemsText access of array + onBackClicked : page(_settingsBluetoothPage) + } + + PreTreatmentUltrafiltration { id: _preTreatmentUltrafiltration + header.stepIndex : 6 + header.confirmVisible : true + header.backVisible : true + title.text : qsTr("Ultrafiltration Setup") + } + PreTreatmentBase { id: _preTreatmentPatientConnection header.stepIndex : 7 header.backVisible : true @@ -105,17 +133,18 @@ } Connections { target: vPreTreatmentStates - onPatientConnectionChanged : { page( _preTreatmentUltrafiltration , vpatientConnection )} + function onPatientConnectionChanged ( vValue ) { page( _preTreatmentVitals , vValue )} } Connections { target: vPreTreatmentAdjustmentUltrafiltrationInit - onAdjustmentTriggered : { + function onAdjustmentTriggered ( vValue ) { // the maximum ultrafiltration volume has to be set/revert regardless - vTreatmentUltrafiltration.maximum = vPreTreatmentAdjustmentUltrafiltrationInit.volume - _preTreatmentUltrafiltration.ufVolume = vPreTreatmentAdjustmentUltrafiltrationInit.volume + vTreatmentUltrafiltration.maximum = vPreTreatmentAdjustmentUltrafiltrationInit.volume + _preTreatmentUltrafiltration.reset ( vPreTreatmentAdjustmentUltrafiltrationInit.volume ) + // but only if it has been accepted it will navigate if ( vPreTreatmentAdjustmentUltrafiltrationInit.adjustment_Accepted ) { - page( _preTreatmentVitals ) + page( _preTreatmentPatientConnection ) } else { _preTreatmentUltrafiltration.reasonText = vPreTreatmentAdjustmentUltrafiltrationInit.text() @@ -124,27 +153,26 @@ } Connections { target: _preTreatmentUltrafiltration - onConfirmClicked : { vPreTreatmentAdjustmentUltrafiltrationInit.doAdjustment(_preTreatmentUltrafiltration.ufVolume)} + function onBackClicked ( vValue ) { page( _preTreatmentVitals )} + function onConfirmClicked ( vValue ) { vPreTreatmentAdjustmentUltrafiltrationInit.doAdjustment(_preTreatmentUltrafiltration.ufVolume)} } Connections { target: _preTreatmentVitals - onBackClicked : { page( _preTreatmentUltrafiltration )} - onConfirmClicked : { page( _preTreatmentPatientConnection ) - } + function onConfirmClicked ( vValue ) { page( _preTreatmentUltrafiltration )} } Connections { target: _preTreatmentPatientConnection - onBackClicked : { page( _preTreatmentVitals )} - onConfirmClicked : { vPreTreatmentAdjustmentPatientConnectionConfirm.doConfirm()} + function onBackClicked ( vValue ) { page( _preTreatmentUltrafiltration )} + function onConfirmClicked ( vValue ) { vPreTreatmentAdjustmentPatientConnectionConfirm.doConfirm()} } Connections { target: _preTreatmentStartTreatment - onBackClicked : { page( _preTreatmentPatientConnection )} - onConfirmClicked : { vPreTreatmentAdjustmentStartTreatment.doStart() } + function onBackClicked ( vValue ) { page( _preTreatmentPatientConnection )} + function onConfirmClicked ( vValue ) { vPreTreatmentAdjustmentStartTreatment.doStart()} } Connections { target: vPreTreatmentAdjustmentPatientConnectionConfirm - onAdjustmentTriggered : { + function onAdjustmentTriggered ( vValue ) { if ( vPreTreatmentAdjustmentPatientConnectionConfirm.adjustment_Accepted ) { page( _preTreatmentStartTreatment ) _preTreatmentPatientConnection.reasonText = "" @@ -155,7 +183,7 @@ } Connections { target: vPreTreatmentAdjustmentStartTreatment - onAdjustmentTriggered : { + function onAdjustmentTriggered ( vValue ) { if ( vPreTreatmentAdjustmentStartTreatment.adjustment_Accepted ) { _preTreatmentStartTreatment.reasonText = "" } else { @@ -169,6 +197,7 @@ _mainMenu.hidden = true } else { + clear() stackView.initialItem = null } }