Index: sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -r474e5b3680d8acbf0ac79062124352d0b3d43b65 --- sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml (.../TreatmentFluid.qml) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ sources/gui/qml/pages/treatment/sections/TreatmentFluid.qml (.../TreatmentFluid.qml) (revision 474e5b3680d8acbf0ac79062124352d0b3d43b65) @@ -1,16 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 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 * \author (last) Behrouz NemaiPour * \date (last) 08-Jun-2020 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 - * + * */ // Qt @@ -26,38 +26,47 @@ * \brief Treatment Screen Fluid Management section */ TouchArea { id: _root + property string buttonText : "" + property bool cumulativeVisible : true + + property int rowTextSpacing : 10 + property int volumeTextWidth : 60 + + property string unit : "" + 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 + enabled : _root.isTouchable 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: { + if (enabled) + _root.clicked() + } } ProgressBar { id: _fluidProgressBar anchors { - top: _startButton.bottom + top: _startFluidButton.bottom topMargin: 50 } width : parent.width @@ -78,13 +87,14 @@ text: qsTr("Volume Delivered") font.pixelSize: Fonts.fontPixelFluidText color: Colors.fluidText - Text { id: _fluidVolume + Text { id: _fluidTarget + property real value: 0 width: volumeTextWidth anchors { right: parent.right baseline: parent.baseline } - text: qsTr("(100 mL)") + text: qsTr("(%1 %2)").arg(value).arg(_root.unit) font.pixelSize: Fonts.fontPixelFluidVolume color: Colors.fluidUnit } @@ -94,7 +104,7 @@ rightMargin: volumeTextWidth + rowTextSpacing baseline: parent.baseline } - text: qsTr("mL") + text: _root.unit font.pixelSize: Fonts.fontPixelFluidUnit color: Colors.fluidUnit } @@ -129,13 +139,12 @@ 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