Index: leahi.qrc =================================================================== diff -u -r0a9e9579c7481eb5e0900fe604cac7bba6bb86ca -r5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3 --- leahi.qrc (.../leahi.qrc) (revision 0a9e9579c7481eb5e0900fe604cac7bba6bb86ca) +++ leahi.qrc (.../leahi.qrc) (revision 5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3) @@ -280,12 +280,12 @@ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBolusVolume.qml - sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml + sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationStack.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationEdit.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationConfirm.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentSetPoints.qml - sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltration.qml + sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStack.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStart.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationEdit.qml sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationConfirm.qml Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -rc9764bd0ad823c5c1725d7c7f556290c2c459d4d -r5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision c9764bd0ad823c5c1725d7c7f556290c2c459d4d) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3) @@ -108,10 +108,10 @@ ScreenItem { id: _treatmentHDF } // TODO: make me! //// Treatment Adjustment Dialogs - TreatmentAdjustmentSetPoints { id: _treatmentAdjustmentSetPoints } - TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } - TreatmentAdjustmentBolusVolume { id: _treatmentAdjustmentBolusVolume } - TreatmentAdjustmentUltrafiltration { id: _treatmentAdjustmentUltrafiltration } + TreatmentAdjustmentSetPoints { id: _treatmentAdjustmentSetPoints } + TreatmentAdjustmentPressuresLimits { id: _treatmentAdjustmentPressuresLimits } + TreatmentAdjustmentBolusVolume { id: _treatmentAdjustmentBolusVolume } + TreatmentAdjustmentUltrafiltrationStack { id: _treatmentAdjustmentUltrafiltration } Connections { target: _treatmentAdjustmentSetPoints function onConfirmClicked ( vValue ) { @@ -140,7 +140,7 @@ } } - TreatmentAdjustmentDuration { id: _treatmentAdjustmentDuration } + TreatmentAdjustmentDurationStack { id: _treatmentAdjustmentDuration } TreatmentAdjustmentVitalsInterval { id: _treatmentAdjustmentVitalsInterval } Fisheye: Tag 5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3 refers to a dead (removed) revision in file `sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDuration.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationStack.qml =================================================================== diff -u --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationStack.qml (revision 0) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentDurationStack.qml (revision 5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3) @@ -0,0 +1,126 @@ +/*! + * + * 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 TreatmentAdjustmentDuration.qml + * \author (last) Vy + * \date (last) 11-May-2023 + * \author (original) Behrouz NematiPour + * \date (original) 27-Apr-2020 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Controls 2.12 // StackView + +// Project + +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief TreatmentAdjustmentDuration.qml is the screen + * To adjust the treatment duration + */ +TreatmentAdjustmentBase { id: _root + objectName : "_TreatmentAdjustmentDuration" // SquishQt testability + + closeVisible : true + confirmVisible : false + backVisible : _treatmentDurationStack.stackView.depth > 1 + + onAboutToShow : { + // reset the state of the edit screen when edit dialog is first opened to currently set duration + // cannot reset in StackView.onActivating or edit screen will reset when going back from confirm screen + // and user modified duration will be reset back to currently set duration + _treatmentAdjustmentDurationEdit.reset() + // reset the state of the stack and push the initial screen + _treatmentDurationStack.reset() + } + onClosed : { _treatmentDurationStack.reset() } + onBackClicked : { _treatmentDurationStack.pop() } + + StackItem { id: _treatmentDurationStack + objectName : "_treatmentDurationStack" + anchors { + top : parent.top + bottom : notification.top + left : parent.left + right : parent.right + } + visible : true + stackView { + initialItem : _treatmentAdjustmentDurationEdit + popEnter : null + popExit : null + pushEnter : null + pushExit : null + } + + TreatmentAdjustmentDurationEdit { id: _treatmentAdjustmentDurationEdit + objectName : "_treatmentAdjustmentDurationEdit" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Edit Treatment Duration") + _root.notificationText = "" + } + + onContinueClicked : function(vNewTreatmentDuration) { + // send new duration to TD and wait + // if accepted moves to confirm screen, otherwise show error in notification + vTreatmentAdjustmentDurationEdit.doAdjustment(vNewTreatmentDuration) + } + } + + TreatmentAdjustmentDurationConfirm { id: _treatmentAdjustmentDurationConfirm + objectName : "_treatmentAdjustmentDurationConfirm" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Confirm Treatment Duration") + _root.notificationText = "" + } + + onConfirmClicked : function(vNewTreatmentDuration) { + // send new duration to TD and wait + // if accepted moves to confirm screen, otherwise show error in notification + vTreatmentAdjustmentDurationConfirm.doConfirm(vNewTreatmentDuration) + } + } + + Connections { target: vTreatmentAdjustmentDurationEdit + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentDurationEdit.adjustment_Accepted) { + notification.text = "" + + _treatmentAdjustmentDurationConfirm.newTreatmentDuration = vTreatmentAdjustmentDurationEdit.duration + _treatmentAdjustmentDurationConfirm.ufVolumeGoal = vTreatmentAdjustmentDurationEdit.ufVolumeGoal + _treatmentAdjustmentDurationConfirm.ufRate = vTreatmentAdjustmentDurationEdit.ufRate + + _treatmentDurationStack.page(_treatmentAdjustmentDurationConfirm) + } + else { + notification.text = vTreatmentAdjustmentDurationEdit.adjustment_ReasonText + } + } + } + + Connections { target: vTreatmentAdjustmentDurationConfirm + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentDurationConfirm.adjustment_Accepted) { + notification.text = "" + close() + } + else { + notification.text = vTreatmentAdjustmentDurationConfirm.adjustment_ReasonText + } + } + } + } +} Fisheye: Tag 5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3 refers to a dead (removed) revision in file `sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltration.qml'. Fisheye: No comparison available. Pass `N' to diff? Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStack.qml =================================================================== diff -u --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStack.qml (revision 0) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentUltrafiltrationStack.qml (revision 5c13b67267f6919fd7fcc7b970bd7c0ee7de12d3) @@ -0,0 +1,255 @@ +/*! + * + * 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 TreatmentUltrafiltrationItem.qml + * \author (last) Behrouz NematiPour + * \date (last) 27-Apr-2023 + * \author (original) Behrouz NematiPour + * \date (original) 01-Mar-2021 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Controls 2.12 // StackView + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief the treatment ultrafiltration flow manager screen + */ +TreatmentAdjustmentBase { id: _root + objectName: "_TreatmentAdjustmentUltrafiltration" + + // ultrafiltration state information bar properties + readonly property bool isUFPaused: vTreatmentUltrafiltration.ufPaused + + closeVisible : true + confirmVisible : false + backVisible : _ufStack.stackView.depth > 1 + + onAboutToShow : { _ufStack.reset() } + onClosed : { _ufStack.reset() } + onBackClicked : { _ufStack.pop() } + + information { + visible : true && information.text && ! notification.visible + imageSource : isUFPaused ? "qrc:/images/iPauseOrange" : "" + text : isUFPaused ? qsTr("Ultrafiltration Paused") : "" + color : Colors.ufNotificationBarBg + textColor : Colors.ufVolumeGoalText + textfontSize : Fonts.fontPixelUltrafiltrationAdjustmentNotification + textfontWeight : Font.Medium + } + + StackItem { id: _ufStack + objectName : "_ufStack" + anchors { + top: parent.top + bottom: information.top + left: parent.left + right: parent.right + } + visible : true + stackView { + initialItem : _treatmentAdjustmentUltrafiltrationStart + popEnter : null + popExit : null + pushEnter : null + pushExit : null + } + + TreatmentAdjustmentUltrafiltrationStart { id: _treatmentAdjustmentUltrafiltrationStart + objectName : "_treatmentAdjustmentUltrafiltrationStart" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Ultrafiltration Volume ") + Variables.unitTextUltrafiltrationVolume + _root.notificationText = "" + } + onPauseClicked : { + // send pause to TD and wait. + // if accepted button changes, otherwise show error in notification + vTreatmentAdjustmentUltrafiltrationState.doPause() + } + onEditClicked : { + _treatmentAdjustmentUltrafiltrationEdit.reset() // reset the slider to minimum value position + _ufStack.page(_treatmentAdjustmentUltrafiltrationEdit) + } + onIsolatedUfClicked : { + _treatmentAdjustmentIsolatedUFDurationEdit.reset() + _ufStack.page(_treatmentAdjustmentIsolatedUFDurationEdit) + } + onResumeClicked : { + // send resume to TD and wait. + // if accepted button changes, otherwise show error in notification + vTreatmentAdjustmentUltrafiltrationState.doResume() + } + } + + TreatmentAdjustmentUltrafiltrationEdit { id: _treatmentAdjustmentUltrafiltrationEdit + objectName : "_treatmentAdjustmentUltrafiltrationEdit" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Ultrafiltration Volume ") + Variables.unitTextUltrafiltrationVolume + _root.notificationText = "" + } + onContinueClicked : function(vVolume) { + // send Volume to TD and wait. + // if accepted moves to confirm screen, otherwise show error in notification + vTreatmentAdjustmentUltrafiltrationEdit.doAdjustment(vVolume) + } + } + + TreatmentAdjustmentUltrafiltrationConfirm { id: _treatmentAdjustmentUltrafiltrationConfirm + objectName : "_treatmentAdjustmentUltrafiltrationConfirm" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Confirm Ultrafiltration Volume ") + Variables.unitTextUltrafiltrationVolume + _root.notificationText = "" + } + onConfirmVolumeClicked : { + vTreatmentAdjustmentUltrafiltrationConfirm.doConfirm(vVolume) + } + } + + TreatmentAdjustmentIsolatedUFDurationEdit { id: _treatmentAdjustmentIsolatedUFDurationEdit + objectName : "_treatmentAdjustmentIsolatedUFDurationEdit" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Isolated Ultrafiltration Volume ") + Variables.unitTextUltrafiltrationVolume + _root.notificationText = "" + } + + onContinueClicked : function(vDuration) { + // send Volume to TD and wait. + // if accepted moves to confirm screen, otherwise show error in notification + // vTreatmentAdjustmentIsolatedUFEdit.doAdjustment(vVolume) + vTreatmentAdjustmentIsolatedUFDurationEdit.doAdjustment(vDuration) + } + } + + TreatmentAdjustmentIsolatedUFVolumeEdit { id: _treatmentAdjustmentIsolatedUFVolumeEdit + objectName : "_treatmentAdjustmentIsolatedUFVolumeEdit" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Isolated Ultrafiltration Volume ") + Variables.unitTextUltrafiltrationVolume + _root.notificationText = "" + } + onContinueClicked : function(vDuration, vVolume) { + // send Volume to TD and wait. + // if accepted moves to confirm screen, otherwise show error in notification + vTreatmentAdjustmentIsolatedUFVolumeEdit.doAdjustment(vDuration, vVolume) + } + } + + TreatmentAdjustmentIsolatedUFConfirm { id: _treatmentAdjustmentIsolatedUFConfirm + objectName : "_treatmentAdjustmentIsolatedUFConfirm" + visible : false + + StackView.onActivating : { + _root.titleText = qsTr("Confirm Isolated Ultrafiltration Values") + _root.notificationText = "" + } + onConfirmVolumeClicked : { + vTreatmentAdjustmentIsolatedUFConfirm.doConfirm() + } + } + + Connections { target: vTreatmentAdjustmentUltrafiltrationState + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentUltrafiltrationState.adjustment_Accepted) { + notification.text = "" + } + else { + notification.text = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText + } + } + } + + Connections { target: vTreatmentAdjustmentUltrafiltrationEdit + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentUltrafiltrationEdit.adjustment_Accepted) { + notification.text = "" + + _treatmentAdjustmentUltrafiltrationConfirm.ultrafiltrationVolume = vTreatmentAdjustmentUltrafiltrationEdit.volume + _treatmentAdjustmentUltrafiltrationConfirm.ultrafiltrationRate = vTreatmentAdjustmentUltrafiltrationEdit.rate + + _ufStack.page(_treatmentAdjustmentUltrafiltrationConfirm) + } + else { + notification.text = vTreatmentAdjustmentUltrafiltrationEdit.adjustment_ReasonText + } + } + } + + Connections { target: vTreatmentAdjustmentUltrafiltrationConfirm + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentUltrafiltrationConfirm.adjustment_Accepted) { + notification.text = "" + close() + } + else { + notification.text = vTreatmentAdjustmentUltrafiltrationConfirm.adjustment_ReasonText + } + } + } + + Connections { target: vTreatmentAdjustmentIsolatedUFDurationEdit + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentIsolatedUFDurationEdit.adjustment_Accepted) { + notification.text = "" + + _treatmentAdjustmentIsolatedUFVolumeEdit.duration = _treatmentAdjustmentIsolatedUFDurationEdit.duration + _treatmentAdjustmentIsolatedUFVolumeEdit.volumeMax = vTreatmentAdjustmentIsolatedUFDurationEdit.volumeMax + + _treatmentAdjustmentIsolatedUFVolumeEdit.reset() + _ufStack.page(_treatmentAdjustmentIsolatedUFVolumeEdit) + } + else { + notification.text = vTreatmentAdjustmentIsolatedUFDurationEdit.text() + } + } + } + + Connections { target: vTreatmentAdjustmentIsolatedUFVolumeEdit + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentIsolatedUFVolumeEdit.adjustment_Accepted) { + notification.text = "" + + _treatmentAdjustmentIsolatedUFConfirm.volume = vTreatmentAdjustmentIsolatedUFVolumeEdit.volume + _treatmentAdjustmentIsolatedUFConfirm.duration = vTreatmentAdjustmentIsolatedUFVolumeEdit.duration + _treatmentAdjustmentIsolatedUFConfirm.rate = vTreatmentAdjustmentIsolatedUFVolumeEdit.rate + + _ufStack.page(_treatmentAdjustmentIsolatedUFConfirm) + } + else { + notification.text = vTreatmentAdjustmentIsolatedUFVolumeEdit.text() + } + } + } + + Connections { target: vTreatmentAdjustmentIsolatedUFConfirm + function onAdjustmentTriggered ( vValue ) { + if (vTreatmentAdjustmentIsolatedUFConfirm.adjustment_Accepted) { + notification.text = "" + close() + } + else { + notification.text = vTreatmentAdjustmentIsolatedUFConfirm.text() + } + } + } + } +}