Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml =================================================================== diff -u -r16a8f25568b4636ebc31e76c86a8031940cc4ad7 -r601289deb20f7059b3af5bb19e16f53974262ceb --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml (.../TreatmentAdjustmentPressuresLimits.qml) (revision 16a8f25568b4636ebc31e76c86a8031940cc4ad7) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentPressuresLimits.qml (.../TreatmentAdjustmentPressuresLimits.qml) (revision 601289deb20f7059b3af5bb19e16f53974262ceb) @@ -28,159 +28,121 @@ * To adjust the treatment inline blood pressure ranges of Arterial and venous */ TreatmentAdjustmentBase { id: _root - contentItem.objectName: "TreatmentAdjustmentPressures" //SquishQt testability + objectName: "_TreatmentAdjustmentPressuresLimits" // SquishQt testability - property alias arterialPressureLimitWindow : _arterialWindow .value - property alias venousPressureLimitWindow : _venousWindow .value - property alias venousPressureLimitAsymtrc : _venousAsymmetric .value + readonly property alias arterialPressureLimitWindow : _arterialWindow.value + readonly property alias venousPressureLimitWindow : _venousWindow.value + readonly property alias venousPressureLimitAsymtrc : _venousAsymmetricWindow.value + readonly property alias tmpLimitWindow : _tmpWindow.value - titleText: qsTr("PRESSURES") + titleText: qsTr("Pressure Window Limit Settings") - // Note : The slider values are not bound and will be set by user freely - // and will be used to be sent for adjustment - // if accepted will not changed and - // if rejected then will be reset to the values passed by adjustment response - - // reset the flow values to the current flow values - function currentFlows() { - // if the vTreatmentAdjustmentPressuresLimits.* is not set yet, use the default value - // TODO need to change to use the value used in treatment if these limits are being set in create treatment - _arterialWindow.reset( vTreatmentAdjustmentPressuresLimits.arterialPressureLimitWindow || _arterialWindow.defaultValue) - _venousWindow.reset( vTreatmentAdjustmentPressuresLimits.venousPressureLimitWindow || _venousWindow.defaultValue) - _venousAsymmetric.reset( vTreatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc || _venousAsymmetric.defaultValue) - } - - // reset the flow values to the values of the adjustment response - function resetFlows() { - _arterialWindow.reset( vTreatmentAdjustmentPressuresLimits.arterialPressureLimitWindow ) - _venousWindow.reset( vTreatmentAdjustmentPressuresLimits.venousPressureLimitWindow ) - _venousAsymmetric.reset( vTreatmentAdjustmentPressuresLimits.venousPressureLimitAsymtrc ) - } - onAboutToShow: { - // TODO : When Testing data on Setting screen is removed - // This needs to be moved into the Treatment______.qml - currentFlows() + _arterialWindow.value = vTreatmentPressureOcclusion.arterialPressure + _venousWindow.value = vTreatmentPressureOcclusion.venousPressure + _venousAsymmetricWindow.value = 0 // vTreatmentPressureOcclusion.venousLongPressure + _tmpWindow.value = vTreatmentPressureOcclusion.tmpPressure } - Connections { target: vTreatmentAdjustmentPressuresLimits - function onAdjustmentTriggered ( vValue ) { - if ( vTreatmentAdjustmentPressuresLimits.adjustment_Accepted ) { - accept() - } else { - resetFlows() - console.debug(vTreatmentAdjustmentPressuresLimits.text()) - notification.text = vTreatmentAdjustmentPressuresLimits.text() - } + Item { id: _contentItem + objectName: "_contentItem" + anchors { + top: parent.top + bottom: notification.top + left: parent.left + right: parent.right } - } - component SliderPressure : Item { - property alias title : _title.text - property alias minimum : _slider.minimum - property alias maximum : _slider.maximum - property alias step : _slider.step - property alias value : _slider.value - property alias defaultValue : _slider.defaultValue - property alias sliderWidth : _slider.width - property int hPadding : 30 + Item { id: _contentArea + objectName: "_contentArea" + anchors { + top: parent.top + bottom: _confirmButton.top + left: parent.left + right: parent.right + } - function reset(vValue) { - _slider.reset(vValue) - } + Column { id: _controlColumn + objectName: "_controlColumn" + anchors.centerIn: parent + spacing: Variables.defaultMargin - height : 150 - width : parent.width - hPadding * 2 + LabelUnitValueAdjuster { id: _arterialWindow + objectName : "_arterialWindow" + text : qsTr("Arterial Window") + titleFontPixelSize : Fonts.fontPixelContainerTitleSmall + unitText : Variables.unitTextPressure + unitFontPixelSize : Fonts.fontPixelContainerUnitSmall + isActive : true + minimum : vTreatmentPressureOcclusion.arterialMin + maximum : vTreatmentPressureOcclusion.arterialMax + step : vTreatmentRanges.arterialPressureLimitWindowRes - Text { id: _title - height : 50 - anchors.top : parent.top - anchors.left : parent.left - horizontalAlignment : Text.AlignLeft - font.pixelSize : Fonts.fontPixelPresseuresLabel - color : Colors.textMain - } + onDidChange : function(vValue) { value = vValue } + } - Text { id: _value - width : 120 - anchors.baseline : _title.baseline - anchors.right : parent.right - font.pixelSize : Fonts.fontPixelFluidUnit - color : Colors.textMain - text : _slider.value.toFixed(0) + " " + Variables.unitTextBloodPressure - horizontalAlignment : Text.AlignRight - } + LabelUnitValueAdjuster { id: _venousWindow + objectName : "_venousWindow" + text : qsTr("Venous Window") + titleFontPixelSize : _arterialWindow.titleFontPixelSize + unitText : Variables.unitTextPressure + unitFontPixelSize : _arterialWindow.unitFontPixelSize + isActive : true + minimum : vTreatmentPressureOcclusion.venousMin + maximum : vTreatmentPressureOcclusion.venousMax + step : vTreatmentRanges.venousPressureLimitWindowRes - Slider { id : _slider - anchors.top : _title.bottom - anchors.topMargin : 15 - anchors.horizontalCenter: parent.horizontalCenter - width : 700 - height : Variables.sliderDefaultBodyHeight - diameter : Variables.progressbarHandler - touchMargin : Variables.sliderDefaultBodyHeight - ticks : true - onValueChanged : reset( value ) - } + onDidChange : function(vValue) { value = vValue } + } - SliderArrows{ id : _sliderArrows - anchors.left : _slider.right - anchors.leftMargin : 30 - anchors.verticalCenter : _slider.verticalCenter - onIncrementValue : _slider.incrementValue(true) - onDecrementValue : _slider.decrementValue(true) - } - } + LabelUnitValueAdjuster { id: _venousAsymmetricWindow + objectName : "_venousAsymmetricWindow" + text : qsTr("Venous Asymmetric Window") + titleFontPixelSize : _arterialWindow.titleFontPixelSize + unitText : Variables.unitTextPressure + unitFontPixelSize : _arterialWindow.unitFontPixelSize + isActive : true + minimum : vTreatmentRanges.venousPressureLimitAsymtrcMin + maximum : vTreatmentRanges.venousPressureLimitAsymtrcMax + step : vTreatmentRanges.venousPressureLimitAsymtrcRes - SliderPressure { id: _arterialWindow - objectName : "_arterialWindow" - anchors { - top : parent.top - topMargin : 125 - horizontalCenter: parent.horizontalCenter - } - title : qsTr("Arterial Window") - minimum : vTreatmentRanges.arterialPressureLimitWindowMin - maximum : vTreatmentRanges.arterialPressureLimitWindowMax - step : vTreatmentRanges.arterialPressureLimitWindowRes - value : vTreatmentRanges.arterialPressureLimitWindowDef - defaultValue : vTreatmentRanges.arterialPressureLimitWindowDef - } + onDidChange : function(vValue) { value = vValue } + } - Line { id: _divider - anchors.horizontalCenter: parent.horizontalCenter - length : _root.width - 100 - color : Colors.separatorLine - anchors.top: _arterialWindow.bottom - anchors.topMargin: 15 - } + LabelUnitValueAdjuster { id: _tmpWindow + objectName : "_tmpWindow" + text : qsTr("TMP Window") + titleFontPixelSize : _arterialWindow.titleFontPixelSize + unitText : Variables.unitTextPressure + unitFontPixelSize : _arterialWindow.unitFontPixelSize + isActive : true + minimum : vTreatmentPressureOcclusion.tmpMin + maximum : vTreatmentPressureOcclusion.tmpMax + step : vTreatmentRanges.transmembranePressureLimitWindowRes - SliderPressure { id: _venousWindow - objectName : "_venousWindow" - anchors { - top : _divider.bottom - topMargin : 30 - horizontalCenter: parent.horizontalCenter + onDidChange : function(vValue) { value = vValue } + } + } } - title : qsTr("Venous Window") - minimum : vTreatmentRanges.venousPressureLimitWindowMin - maximum : vTreatmentRanges.venousPressureLimitWindowMax - step : vTreatmentRanges.venousPressureLimitWindowRes - value : vTreatmentRanges.venousPressureLimitWindowDef - defaultValue : vTreatmentRanges.venousPressureLimitWindowDef - } - SliderPressure { id: _venousAsymmetric - objectName : "_venousAsymmetric" - anchors { - top : _venousWindow.bottom - horizontalCenter: parent.horizontalCenter + TouchRect { id: _confirmButton + objectName : "_confirmButton" + anchors { + bottom : parent.bottom + bottomMargin : Variables.defaultMargin + horizontalCenter: parent.horizontalCenter + } + width : Variables.defaultButtonWidth + height : Variables.defaultButtonHeight + text { + text : qsTr("Confirm") + font.weight : Font.Medium + } + isDefault : true + + onClicked : { + _root.confirmClicked() + } } - title : qsTr("Venous Asymmetric") - minimum : vTreatmentRanges.venousPressureLimitAsymtrcMin - maximum : vTreatmentRanges.venousPressureLimitAsymtrcMax - step : vTreatmentRanges.venousPressureLimitAsymtrcRes - value : vTreatmentRanges.venousPressureLimitAsymtrcDef - defaultValue : vTreatmentRanges.venousPressureLimitAsymtrcDef } }