Index: sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml =================================================================== diff -u -r43ae56f762e6f3e1416d39e3d16f9103fc597e41 -r77ba0083b790f7c1c851c60ecaeaa4f2e7eff7a8 --- sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 43ae56f762e6f3e1416d39e3d16f9103fc597e41) +++ sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 77ba0083b790f7c1c851c60ecaeaa4f2e7eff7a8) @@ -22,55 +22,123 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages/treatment" /*! * \brief Treatment Screen Saline Management section */ -TreatmentFluid { id: _root +TreatmentSection { id: _root readonly property bool isStarted : vTDTreatmentStates.sbRunning readonly property bool isIdle : vTDTreatmentStates.sbIdle // other that max saline bolus delivered, // if saline started but still is waiting for pump the button is disabled so user won't tap multiple times. readonly property bool isDisabled : vTDTreatmentStates.sbMaxReached readonly property bool isWaitPump : vTDTreatmentStates.sbWaitPump + readonly property string unit : Variables.unitTextFluid + property int valueDecimal : Variables.salinePrecision + property int valueTarget : vTreatmentSaline.target || vTreatmentAdjustmentSaline.target + property int valueCumulative: vTreatmentSaline.cumulative + property int valueDelivered : vTreatmentSaline.delivered + property string buttonText : ( isDisabled || isWaitPump ) ? _private.textStart : + isStarted ? _private.textStop : + _private.textStart + + header.title : qsTr("Saline" ) + header.showEdit : false + QtObject { id: _private - readonly property string textStart : qsTr("START BOLUS") - readonly property string textStop : qsTr("STOP BOLUS" ) - readonly property string textVolumeTarget : "(" + valueTarget + unit + ")" + readonly property string textStart : qsTr("Start Bolus") + "" + textVolumeTarget + "<\b>" + readonly property string textStop : qsTr("Stop Bolus" ) + "" + textVolumeTarget + "<\b>" + readonly property string textVolumeTarget : " (" + valueTarget + unit + ")" readonly property string mesgDisabled : qsTr("Maximum cumulative saline bolus volume delivered") readonly property string mesgWaitForPump : "" // qsTr("Saline Bolus is starting") // Not sure if we shouls show any message at this point readonly property string mesgRejectReason : vTreatmentAdjustmentSaline.adjustment_ReasonText } - hasArrow : false - isTouchable : false - buttonEnabled : ! ( _root.isDisabled || _root.isWaitPump ) - buttonText : ( _root.isDisabled || _root.isWaitPump ) ? _private.textStart : - _root.isStarted ? _private.textStop : - _private.textStart + VTreatmentSaline { id: vTreatmentSaline } - fluidProgressBarColor: _root.isStarted ? Colors.sliderHighlightColor : Colors.highlightProgressBar + contentItem: Column { id :_content + spacing : Variables.defaultMargin * 3 - title : qsTr("SALINE BOLUS") - unit : Variables.unitTextSaline + Text { id: _descriptionText + text : qsTr("Total Saline Delivered") + height : Variables.contentHeight + font.pixelSize : Fonts.fontPixelFluidText + color : Colors.fluidText + horizontalAlignment: Text.AlignHCenter + } - valueDecimal : Variables.salinePrecision - valueTarget : vTreatmentSaline.target || vTreatmentAdjustmentSaline.target - valueCumulative : vTreatmentSaline.cumulative - valueDelivered : vTreatmentSaline.delivered + Item { id: _progressBarArea + height : 30 + width : parent.width - Variables.defaultMargin - VTreatmentSaline { id: vTreatmentSaline } + ProgressBar { id: _fluidProgressBar + width : _progressBarArea.width + 10 + height : Variables.progressbarFluidHeight * 3 + minText.visible : false + maxText.visible : false + marker.visible : false + color : Colors.progressBarSaline + maximum : valueCumulative + value : valueDelivered + decimal : _root.valueDecimal + radius : 9 + progressRadius : radius + } - onClicked: { - if ( isIdle ) vTreatmentAdjustmentSaline.doStart() // IDLE - if ( isStarted ) vTreatmentAdjustmentSaline.doStop () // IN_PROGRESS - } + Label { id: _valueDelivered + property real value: valueDelivered - notification { - visible : true - text : isDisabled ? _private.mesgDisabled : - isWaitPump ? _private.mesgWaitForPump : - _private.mesgRejectReason + anchors { + verticalCenter : _valueDeliveredUnit.verticalCenter + right : _valueDeliveredUnit.left + rightMargin : 5 + } + font.pixelSize : 18 + font.weight : Font.DemiBold + text : value + width : contentWidth + } + + Label { id: _valueDeliveredUnit + property real value: 0 + anchors { + bottom : _fluidProgressBar.top + bottomMargin: Variables.defaultMargin + right : _fluidProgressBar.right + } + font.pixelSize : 18 + text : _root.unit + width : contentWidth + } + } + + TouchRect { id: _startFluidButton + width : _fluidProgressBar.width + height : Variables.contentHeight + 10 + radius : 9 + text.textFormat : Text.RichText + text.text : buttonText + isDefault : true + + text.font { + weight : Font.DemiBold + pixelSize : 20 + } + onPressed : { + if ( isIdle ) vTreatmentAdjustmentSaline.doStart() // IDLE + if ( isStarted ) vTreatmentAdjustmentSaline.doStop () // IN_PROGRESS + } + } } + + // TODO: +// notification { +// visible : true +// text : isDisabled ? _private.mesgDisabled : +// isWaitPump ? _private.mesgWaitForPump : +// _private.mesgRejectReason +// } +// } }