Index: sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml =================================================================== diff -u -rf160ef9c259a75e8d6120ad962cda648e8f7a9b3 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml (.../TreatmentFluid.qml) (revision f160ef9c259a75e8d6120ad962cda648e8f7a9b3) +++ sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml (.../TreatmentFluid.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,14 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * 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 TreatmentFluid.qml - * \date 2020/01/27 - * \author Behrouz NematiPour + * \author (last) Vy + * \date (last) 18-May-2023 + * \author (original) Behrouz NematiPour + * \date (original) 27-Jan-2020 * */ @@ -25,101 +26,117 @@ * \brief Treatment Screen Fluid Management section */ TouchArea { id: _root + property string buttonText : "" + property alias buttonEnabled : _startFluidButton.enabled + property alias fluidProgressBarColor : _fluidProgressBar.color + + property bool cumulativeVisible : true + property bool targetVisible : true + property bool progressBarVisible : true + + property int rowTextSpacing : 10 + property int volumeTextWidth : 60 + + property string unit : Variables.unitTextFluid + property int valueDecimal : 0 + property alias valueTarget : _fluidTarget .value + property alias valueCumulative : _cumulativeValue .value + property alias valueDelivered : _fluidProgressBar .value + x : 0 y : 0 width : 200 height : 200 isTouchable: false title: qsTr("FLUID MANAGEMENT") - property int rowTextSpacing : 10 - property int volumeTextWidth: 60 - - property bool cumulativeVisible: true - - // may need to be removed later when created separate Saline/Heparin object - property string buttonText: "" - - TouchRect { id: _startButton + TouchRect { id: _startFluidButton y : 45 width : 340 height : 55 text.text: buttonText + textColor: enabled ? Colors.textButton : Colors.textDisableButton text.font { weight: Font.DemiBold pixelSize : 20 letterSpacing : 3 } - animated: true - duration: 100 + onClicked: _root.clicked() } + Text { id: _fluidText + anchors { + top: _startFluidButton.bottom + topMargin: 15 + + } + width: parent.width + text: qsTr("Volume Delivered") + font.pixelSize: Fonts.fontPixelFluidText + color: Colors.fluidText + Text { id: _fluidTarget + visible: targetVisible + property real value: 0 + width: volumeTextWidth + anchors { + right: parent.right + baseline: parent.baseline + } + text: qsTr("(%1 %2)").arg(value).arg(_root.unit) + font.pixelSize: Fonts.fontPixelFluidVolume + color: Colors.fluidUnit + } + Text { id: _fluidUnit + anchors { + right: parent.right + rightMargin: volumeTextWidth + rowTextSpacing + baseline: parent.baseline + } + text: _root.unit + font.pixelSize: Fonts.fontPixelFluidUnit + color: Colors.fluidUnit + } + Text { id: _fluidValue + anchors { + right: _fluidUnit.left + rightMargin: rowTextSpacing + baseline: parent.baseline + } + horizontalAlignment: Text.AlignRight + text: _root.valueDelivered.toFixed(_root.valueDecimal) + width: 60 + font.pixelSize: Fonts.fontPixelFluidValue + color: Colors.fluidText + } + } + ProgressBar { id: _fluidProgressBar + visible: progressBarVisible anchors { - top: _startButton.bottom - topMargin: 50 + left : parent.left + top : _fluidText.bottom + topMargin : 10 } width : parent.width height : Variables.progressbarFluidHeight minText.visible : false maxText.visible : false marker.visible : false + maximum : _fluidTarget.value value : 0 - - Text { id: _fluidText - anchors { - left : parent.left - bottom : parent.bottom - bottomMargin: 15 - } - width: parent.width - text: qsTr("Volume Delivered") - font.pixelSize: Fonts.fontPixelFluidText - color: Colors.fluidText - Text { id: _fluidVolume - width: volumeTextWidth - anchors { - right: parent.right - baseline: parent.baseline - } - text: qsTr("(100 mL)") - font.pixelSize: Fonts.fontPixelFluidVolume - color: Colors.fluidUnit - } - Text { id: _fluidUnit - anchors { - right: parent.right - rightMargin: volumeTextWidth + rowTextSpacing - baseline: parent.baseline - } - text: qsTr("mL") - font.pixelSize: Fonts.fontPixelFluidUnit - color: Colors.fluidUnit - } - Text { id: _fluidValue - anchors { - right: _fluidUnit.left - rightMargin: rowTextSpacing - baseline: parent.baseline - } - horizontalAlignment: Text.AlignRight - text: _fluidProgressBar.value - width: 60 - font.pixelSize: Fonts.fontPixelFluidValue - color: Colors.fluidText - } - } + decimal : _root.valueDecimal } + Text { id: _cumulativeText visible: cumulativeVisible anchors { left : parent.left top : _fluidProgressBar.bottom - topMargin : 15 + topMargin : 10 } width: parent.width - text: qsTr("Cumulative Delivery") + text: qsTr("Cumulative Delivered") font.pixelSize: Fonts.fontPixelFluidText color: Colors.fluidText Text { id: _cumulativeUnit @@ -128,20 +145,19 @@ rightMargin: volumeTextWidth + rowTextSpacing baseline: parent.baseline } - text: qsTr("mL") + text: _root.unit font.pixelSize: Fonts.fontPixelFluidUnit color: Colors.fluidUnit } Text { id: _cumulativeValue - property int valueLast : 0 // needs to be bound to a model to keep cumulative value - property int value : 0 // needs to be bound to a model to keep cumulative value + property real value : 0 anchors { right: _cumulativeUnit.left rightMargin: rowTextSpacing baseline: parent.baseline } horizontalAlignment: Text.AlignRight - text: value + text: value.toFixed(_root.valueDecimal) width: 60 font.pixelSize: Fonts.fontPixelFluidValue color: Colors.fluidText