Index: sources/gui/qml/pages/treatment/sections/TreatmentPressures.qml =================================================================== diff -u -r86274f18e9356126c41d848bc78bfba318638aee -r6c3a4b048006ebd90c85cfa943d2b9615dc808f3 --- sources/gui/qml/pages/treatment/sections/TreatmentPressures.qml (.../TreatmentPressures.qml) (revision 86274f18e9356126c41d848bc78bfba318638aee) +++ sources/gui/qml/pages/treatment/sections/TreatmentPressures.qml (.../TreatmentPressures.qml) (revision 6c3a4b048006ebd90c85cfa943d2b9615dc808f3) @@ -21,86 +21,85 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages/treatment" /*! * \brief Treatment Screen Pressure section */ -TouchArea { id: _root - +TreatmentSection { id: _root property int arterialMinimum : vTreatmentRanges.arterialPressureMonitorMin property int arterialMaximum : vTreatmentRanges.arterialPressureMonitorMax property int venousMinimum : vTreatmentRanges.venousPressureMonitorMin property int venousMaximum : vTreatmentRanges.venousPressureMonitorMax + property int tmpMinimum : vTreatmentRanges.transmembranePressureMonitorMin + property int tmpMaximum : vTreatmentRanges.transmembranePressureMonitorMax property int arterialLowerBound : vTreatmentPressureOcclusion.arterialMin property int arterialUpperBound : vTreatmentPressureOcclusion.arterialMax property int venousLowerBound : vTreatmentPressureOcclusion.venousMin property int venousUpperBound : vTreatmentPressureOcclusion.venousMax + property int tmpLowerBound : vTreatmentPressureOcclusion.tmpMin + property int tmpUpperBound : vTreatmentPressureOcclusion.tmpMax property int arterialPressure : vTreatmentPressureOcclusion.arterialPressure property int venousPressure : vTreatmentPressureOcclusion.venousPressure + property int tmpPressure : vTreatmentPressureOcclusion.tmpPressure - property bool valueOutRangeNotify : true - clip: false - x : 0 - y : 0 - width : 200 - height : 200 - isTouchable: true - title: qsTr("PRESSURE") + " " + qsTr("(mmHg)") + header.title : qsTr("Pressures") + " (" + qsTr("mmHg") + ")" + header.showExpanding : true - RangeBar { id: _arterialRangeBar - x: 0 - y: 80 - width : 175 - height : 15 - rangebar.color: Colors.pressuresArterialBar - markerOutRangeNotify: _root.valueOutRangeNotify + contentArea.anchors.topMargin : Variables.defaultMargin - minimum : _root.arterialMinimum - lowerBound : _root.arterialLowerBound - upperBound : _root.arterialUpperBound - maximum : _root.arterialMaximum - value : _root.arterialPressure - color : valueOutRangeNotify ? Colors.backgroundRangeRect : rangebar.color + onExpandingClicked : vTreatmentAdjustmentPressuresWidening.doAdjustment() - Text { id: _arterialText - anchors { - left: parent.left - top: parent.bottom - topMargin: 35 - } - text: qsTr("Arterial") - font.pixelSize: Fonts.fontPixelPresseuresText - color: Colors.pressuresText + function checkMinimum (minimum, lowerBound) { return lowerBound < minimum ? lowerBound : minimum } + function checkMaximum (maximum, upperBound) { return upperBound > maximum ? upperBound : maximum } + + contentItem: Column { id: _column + property int cellHeight : Variables.contentHeight / 3 + property int cellWidth : contentItem.width * 0.9 + + spacing : Variables.defaultMargin * 4 + topPadding : Variables.defaultMargin + leftPadding : Variables.defaultMargin / 2 + rightPadding : Variables.defaultMargin + + TreatmentPressureComponent { id: _arterialRangeBar + title : qsTr("Arterial:") + height : _column.cellHeight + width : _column.cellWidth + barColor : Colors.pressuresArterialBar + + minimum : checkMinimum(_root.arterialMinimum, lowerBound) + lowerBound : _root.arterialLowerBound + upperBound : _root.arterialUpperBound + maximum : checkMaximum(_root.arterialMaximum, upperBound) + pressure : _root.arterialPressure } - onClicked: _root.clicked() - } - RangeBar { id: _venousRangeBar - x: 210 - y: 80 - width : 175 - height : 15 - rangebar.color: Colors.pressuresVenousBar - markerOutRangeNotify: _root.valueOutRangeNotify + TreatmentPressureComponent { id: _venousRangeBar + title : qsTr("Venous:") + height : _column.cellHeight + width : _column.cellWidth + barColor : Colors.pressuresVenousBar - minimum : _root.venousMinimum - lowerBound : _root.venousLowerBound - upperBound : _root.venousUpperBound - maximum : _root.venousMaximum - value : _root.venousPressure - color : valueOutRangeNotify ? Colors.backgroundRangeRect : rangebar.color + minimum : checkMinimum(_root.venousMinimum, lowerBound) + lowerBound : _root.venousLowerBound + upperBound : _root.venousUpperBound + maximum : checkMaximum(_root.venousMaximum, upperBound) + pressure : _root.venousPressure + } - Text { id: _venousText - anchors { - left: parent.left - top: parent.bottom - topMargin: 35 - } - text: qsTr("Venous") - font.pixelSize: Fonts.fontPixelPresseuresText - color: Colors.pressuresText + TreatmentPressureComponent { id: _tmpRangeBar + title : qsTr("TMP:") + height : _column.cellHeight + width : _column.cellWidth + barColor : Colors.pressuresTmpBar + + minimum : checkMinimum(_root.tmpMinimum, lowerBound) + lowerBound : _root.tmpLowerBound + upperBound : _root.tmpUpperBound + maximum : checkMaximum(_root.tmpMaximum, upperBound) + pressure : _root.tmpPressure } - onClicked: _root.clicked() } }