Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rd5e9940fa96373f6cc118dfa9761d95f361689a5 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision d5e9940fa96373f6cc118dfa9761d95f361689a5) @@ -21,125 +21,220 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" /*! * \brief TreatmentAdjustmentFlow.qml is the screen * To adjust the treatment blood/dialysate flow */ TreatmentAdjustmentBase { id: _root - contentItem.objectName: "TreatmentAdjustmentFlow" //SquishQt testability + objectName: "_TreatmentAdjustmentFlow" // SquishQt testability - property alias bloodFlowRateValue : _bloodFlowSlider.value - property alias bloodFlowRateMinimum : _bloodFlowSlider.minimum - property alias bloodFlowRateMaximum : _bloodFlowSlider.maximum - property alias bloodFlowRateStep : _bloodFlowSlider.step + QtObject { id: _private + objectName: "_private" + readonly property int containerWidth: (_root.width - (Variables.defaultMargin * 5))/2 + readonly property int titleFontPixelSize: Fonts.fontPixelContainerTitleSmall + readonly property int unitFontPixelSize: Fonts.fontPixelContainerUnitSmall + } - property alias dialysateFlowRateValue : _dialysateFlowSlider.value - property alias dialysateFlowRateMinimum : _dialysateFlowSlider.minimum - property alias dialysateFlowRateMaximum : _dialysateFlowSlider.maximum - property alias dialysateFlowRateStep : _dialysateFlowSlider.step + titleText: qsTr("Treatment Parameters") - property int textWidth : 200 + contentItem: Item { id: _contentItem + objectName: "_contentItem" - titleText: qsTr("FLOWS") + Item { id: _contentArea + objectName: "_contentArea" + anchors { + top: parent.top + bottom: _confirmButton.top + left: parent.left + leftMargin: Variables.defaultMargin * 2 + right: parent.right + rightMargin: anchors.leftMargin + } - // 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 + Row { id: _controlRow + objectName: "_controlRow" + anchors.centerIn: parent + spacing: Variables.defaultMargin - // reset the flow values to the current flow values - function currentFlows() { - _bloodFlowSlider.reset ( vTreatmentBloodFlow. bloodFlow_PresFlow ) - _dialysateFlowSlider.reset ( vTreatmentDialysateFlow.dialysateFlow_PresFlow ) - } + Column { id: _controlLeftColumn + objectName: "_controlLeftColumn" + spacing: Variables.defaultMargin - // reset the flow values to the values of the adjustment response - function resetFlows() { - _bloodFlowSlider.reset ( vTreatmentAdjustmentFlows. bloodFlow_FlowSetPoint ) - _dialysateFlowSlider.reset ( vTreatmentAdjustmentFlows.dialysateFlow_FlowSetPoint ) - } + LabelUnitValueAdjuster { id: _bloodFlowRate + objectName : "_bloodFlowRate" + width : _private.containerWidth + text : qsTr("Blood Flow Rate") + titleFontPixelSize : _private.titleFontPixelSize + unitText : Variables.unitTextFlowRate + unitFontPixelSize : _private.unitFontPixelSize + minimum : vTreatmentRanges.arterialPressureLimitWindowMin + maximum : vTreatmentRanges.arterialPressureLimitWindowMax + step : vTreatmentRanges.arterialPressureLimitWindowRes + value : { value = vTreatmentRanges.arterialPressureLimitWindowDef } // set without binding + } - onAboutToShow: { - // TODO : When Testing data on Setting screen is removed - // This needs to be moved into the Treatment______.qml - currentFlows() - } + LabelUnitValueAdjuster { id: _dialysateFlowRate + objectName : "_dialysateFlowRate" + width : _private.containerWidth + text : qsTr("Dialysate Flow Rate") + titleFontPixelSize : _private.titleFontPixelSize + unitText : Variables.unitTextFlowRate + unitFontPixelSize : _private.unitFontPixelSize + minimum : vTreatmentRanges.venousPressureLimitWindowMin + maximum : vTreatmentRanges.venousPressureLimitWindowMax + step : vTreatmentRanges.venousPressureLimitWindowRes + value : { value = vTreatmentRanges.venousPressureLimitWindowDef } // set without binding + } - Connections { target: vTreatmentAdjustmentFlows - function onAdjustmentTriggered ( vValue ) { - if ( vTreatmentAdjustmentFlows.adjustment_Accepted ) { - accept() - } else { - resetFlows() - console.debug(vTreatmentAdjustmentFlows.text()) - notification.text = vTreatmentAdjustmentFlows.text() + LabelUnitValueAdjuster { id: _dialysateTemperature + objectName : "_dialysateTemperature" + width : _private.containerWidth + text : qsTr("Dialysate Temperature") + titleFontPixelSize : _private.titleFontPixelSize + unitText : Variables.unitTextTemperature + unitFontPixelSize : _private.unitFontPixelSize + minimum : vTreatmentRanges.venousPressureLimitAsymtrcMin + maximum : vTreatmentRanges.venousPressureLimitAsymtrcMax + step : vTreatmentRanges.venousPressureLimitAsymtrcRes + value : { value = vTreatmentRanges.venousPressureLimitAsymtrcDef } // set without binding + } + } + + Column { id: _controlRightColumn + objectName: "_controlRightColumn" + spacing: Variables.defaultMargin + + LabelUnitContainer { id: _acidConcentrate + objectName : "_acidConcentrate" + width : _private.containerWidth + height : Variables.adjustmentLabelUnitContainerHeight + text : qsTr("Acid Concentrate") + titleFontPixelSize : _private.titleFontPixelSize + unitFontPixelSize : _private.unitFontPixelSize + showEdit : true + // onEditClicked : _acidConcentrateAdjustment.open() + // valid : ! vTreatmentCreate.acidConcentrateRejectReason + + contentItem: BaseComboBox { id: _acidConcentrateComboBox + objectName : "_acidConcentrateComboBox" + anchors { + topMargin : Variables.defaultMargin / 2 + bottomMargin: anchors.topMargin + leftMargin : Variables.defaultMargin * 2 + rightMargin : anchors.leftMargin + } + isActive : vTreatmentCreate.acidConcentrateSet + currentIndex : vTreatmentCreate.acidConcentrate + model : vTreatmentRanges.acidConcentrateOptions + onClear : { + vTreatmentRanges.doClearAcidConcentrate(vTreatmentCreate.acidConcentrateSet) + vTreatmentCreate.acidConcentrateSet = false + } + + onActivated : { + if ( ! _acidConcentrate.valid ) { vTreatmentCreate.acidConcentrateRejectReason = Variables.noRejectReason } + vTreatmentCreate.acidConcentrate = _acidConcentrateComboBox.currentIndex + vTreatmentCreate.acidConcentrateSet = true + } + } + } + + LabelUnitContainer { id: _bicarbonateConcentrate + objectName : "_bicarbonateConcentrate" + width : _private.containerWidth + height : Variables.adjustmentLabelUnitContainerHeight + text : qsTr("Bicarbonate Concentrate") + titleFontPixelSize : _private.titleFontPixelSize + unitFontPixelSize : _private.unitFontPixelSize + + contentItem: BaseComboBox { id: _bicarbonateConcentrateComboBox + objectName : "_bicarbonateConcentrateComboBox" + anchors { + topMargin : Variables.defaultMargin / 2 + bottomMargin: anchors.topMargin + leftMargin : Variables.defaultMargin * 2 + rightMargin : anchors.leftMargin + } + isActive : vTreatmentCreate.bicarbonateConcentrateSet + currentIndex : vTreatmentCreate.bicarbonateConcentrate + model : vTreatmentRanges.bicarbonateConcentrateOptions + onClear : vTreatmentCreate.bicarbonateConcentrateSet = false + onActivated : { + if ( ! _bicarbonateConcentrate.valid ) { vTreatmentCreate.bicarbonateConcentrateRejectReason = Variables.noRejectReason } + vTreatmentCreate.bicarbonateConcentrate = _bicarbonateConcentrateComboBox.currentIndex + vTreatmentCreate.bicarbonateConcentrateSet = true + } + } + } + + LabelUnitContainer { id: _theoreticalConductivity + objectName : "_theoreticalConductivity" + width : _private.containerWidth + height : Variables.adjustmentLabelUnitContainerHeight + text : qsTr("Theoretical Conductivity") + titleFontPixelSize : _private.titleFontPixelSize + unitText : Variables.unitTextDialCond + unitFontPixelSize : _private.unitFontPixelSize + + contentItem: Text { id: _theoreticalConductivityText + objectName : "_theoreticalConductivityText" + anchors.centerIn : parent + width : contentWidth + height : contentHeight + color : Colors.offWhite + font.pixelSize : Fonts.fontPixelValueControl + text : "--" + } + } + + LabelUnitContainer { id: _independentConductivity + objectName : "_independentConductivity" + width : _private.containerWidth + height : Variables.adjustmentLabelUnitContainerHeight + text : qsTr("Independent Conductivity Reading") + titleFontPixelSize : _private.titleFontPixelSize + unitText : Variables.unitTextDialCond + unitFontPixelSize : _private.unitFontPixelSize + + contentItem: Text { id: _independentConductivityText + objectName : "_independentConductivityText" + anchors.centerIn : parent + width : contentWidth + height : contentHeight + color : Colors.offWhite + font.pixelSize : Fonts.fontPixelValueControl + text : "--" + } + } + } } } - } - Column { id : _flowsColumn - spacing: 100 - anchors.centerIn: parent - Row { id : _bloodFlowRow - spacing: 50 - anchors.horizontalCenter: parent.horizontalCenter - TextRect { id: _bloodFlowTextRect - anchors.top: parent.top - anchors.topMargin: 25 - width: textWidth - title: qsTr("Blood Flow Rate") - label: _bloodFlowSlider.value - extra: Variables.unitTextFlowRate - labelFont.weight: Font.ExtraLight + TouchRect { id: _confirmButton + objectName : "_confirmButton" + anchors { + bottom : parent.bottom + horizontalCenter: parent.horizontalCenter } - Slider { id : _bloodFlowSlider - anchors.verticalCenter: parent.verticalCenter - width : 600 - minimum : Variables.bloodFlowMin - maximum : Variables.bloodFlowMax - decimal : Variables.bloodFlowPrecision - unit : Variables.unitTextFlowRate - step : Variables.bloodFlowResolution - ticks : true + width : Variables.defaultButtonWidth + height : Variables.defaultButtonHeight + text { + text : qsTr("Confirm") + font.weight : Font.Medium } - SliderArrows{ id:_bloodFlowSliderArrows - anchors.verticalCenter : _bloodFlowSlider.verticalCenter - onIncrementValue : _bloodFlowSlider.incrementValue(true) - onDecrementValue : _bloodFlowSlider.decrementValue(true) + isDefault : true + + onClicked : { + _root.onConfirmClicked() } } - Line { - anchors.horizontalCenter: parent.horizontalCenter - length : _root.width - 100 - color : Colors.separatorLine - } - Row { id : _dialysateInletFlowRow - spacing: 50 - anchors.horizontalCenter: parent.horizontalCenter - TextRect { id: _dialysateInletFlowTextRect - anchors.top: parent.top - anchors.topMargin: 25 - width: textWidth - title: qsTr("Dialysate Flow Rate") - label: _dialysateFlowSlider.value - extra: Variables.unitTextFlowRate - labelFont.weight: Font.ExtraLight - } - Slider { id : _dialysateFlowSlider - anchors.verticalCenter: parent.verticalCenter - width : 600 - minimum : vTreatmentRanges.treatmentRanges_Dialysate_Flow_Min - maximum : vTreatmentRanges.treatmentRanges_Dialysate_Flow_Max - unit : Variables.unitTextFlowRate - step : Variables.dialysateFlowResolution - ticks : true - } - SliderArrows{ id:_dialysateFlowSliderArrows - anchors.verticalCenter : _dialysateFlowSlider.verticalCenter - onIncrementValue : _dialysateFlowSlider.incrementValue(true) - onDecrementValue : _dialysateFlowSlider.decrementValue(true) - } - } } + + footer: Item { id: _footerItem + objectName : "_footerItem" + width : parent.width + height : Variables.notificationHeight + } }