Index: sources/gui/qml/pages/treatment/TreatmentCreate.qml =================================================================== diff -u -r6e4cc1f67e9290035b4e3a5be2eac04a85ae0c9a -r0401b9a1fb6f89f0ec83571f2f868956c7500a0f --- sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 6e4cc1f67e9290035b4e3a5be2eac04a85ae0c9a) +++ sources/gui/qml/pages/treatment/TreatmentCreate.qml (.../TreatmentCreate.qml) (revision 0401b9a1fb6f89f0ec83571f2f868956c7500a0f) @@ -1,14 +1,13 @@ /*! * - * Copyright (c) 2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * 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 TreatmentCreate.qml + * \file TreatmentCreate.qml * \author (last) Peter Lucia - * \date (last) 17-07-2020 + * \date (last) 06-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * @@ -43,19 +42,34 @@ } - Flickable { - id: _flickable + Flickable { id: _flickable + objectName: "TreatmentCreateFlickable" anchors.top: _topMenuBar.bottom anchors.left: parent.left anchors.bottom: parent.bottom width: parent.width contentWidth: parent.width contentHeight: _column.implicitHeight clip: true + flickDeceleration: Variables.createTreatmentFlickableDeceleration - Column { - id: _column - spacing: Variables.cTreatmentSpacing + function setInteractive(isInteractive) { + _flickable.interactive = isInteractive + } + + ScrollBar.vertical: ScrollBar { id: _scrollBar + anchors.right: _flickable.right + anchors.rightMargin: 3 + contentItem: Rectangle { + color: Colors.backgroundRangeRect + implicitWidth: 6 + radius: width / 2 + width: 3 + } + } + + Column { id: _column + spacing: Variables.treatmentSpacing anchors.horizontalCenter: parent.horizontalCenter; anchors.fill: parent; @@ -75,124 +89,154 @@ } - SliderCreateTreatment { - id: _bloodFlowRate + SliderCreateTreatment { id: _bloodFlowRate objectName: "_bloodFlowRate" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Blood Flow Rate" - units: qsTr(" mL/min") min: vTreatmentCreate.bloodFlowRateMin max: vTreatmentCreate.bloodFlowRateMax step: vTreatmentCreate.bloodFlowRateRes - onSliderChanged: { - vTreatmentCreate.bloodFlowRate = value; + text: qsTr("Blood Flow Rate") + units: qsTr("mL/min") + onPressed: { + _flickable.setInteractive(false) + vTreatmentCreate.bloodFlowRate = value } + onReleased: { + vTreatmentCreate.bloodFlowRate = value + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _dialysateFlowRate + SliderCreateTreatment { id: _dialysateFlowRate objectName: "_dialysateFlowRate" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Dialysate Flow Rate" - units: qsTr(" mL/min") min: vTreatmentCreate.dialysateFlowRateMin max: vTreatmentCreate.dialysateFlowRateMax step: vTreatmentCreate.dialysateFlowRateRes - onSliderChanged: { + text: qsTr("Dialysate Flow Rate") + units: qsTr("mL/min") + onPressed: { + _flickable.setInteractive(false) vTreatmentCreate.dialysateFlowRate = value; } + onReleased: { + vTreatmentCreate.dialysateFlowRate = value; + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _duration + SliderCreateTreatment { id: _duration objectName: "_duration" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Duration" - units: qsTr(" min") min: vTreatmentCreate.durationMin max: vTreatmentCreate.durationMax step: vTreatmentCreate.durationRes - onSliderChanged: { + text: qsTr("Duration") + units: qsTr("min") + onPressed: { + _flickable.setInteractive(false) vTreatmentCreate.duration = value; } + onReleased: { + vTreatmentCreate.duration = value; + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _heparinDispensingRate + SliderCreateTreatment { id: _heparinDispensingRate objectName: "_heparinDispensingRate" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Heparin Dispensing Rate" - units: qsTr(" mL/hr") min: vTreatmentCreate.heparinDispensingRateMin max: vTreatmentCreate.heparinDispensingRateMax step: vTreatmentCreate.heparinDispensingRateRes - - onSliderChanged: { - vTreatmentCreate.heparinDispensingRate = value; + text: qsTr("Heparin Dispensing Rate") + units: qsTr("mL/hr") + onPressed: { + _flickable.setInteractive(false) + vTreatmentCreate.heparinDispensingRate = value } + onReleased: { + vTreatmentCreate.heparinDispensingRate = value + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _heparinBolusVolume + SliderCreateTreatment { id: _heparinBolusVolume objectName: "_heparinBolusVolume" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Heparin Bolus Volume" - units: qsTr(" mL") min: vTreatmentCreate.heparinBolusVolumeMin max: vTreatmentCreate.heparinBolusVolumeMax step: vTreatmentCreate.heparinBolusVolumeRes - onSliderChanged: { - vTreatmentCreate.heparinBolusVolume = value; + + text: qsTr("Heparin Bolus Volume") + units: qsTr("mL") + onPressed: { + _flickable.setInteractive(false) + vTreatmentCreate.heparinBolusVolume = value } + onReleased: { + vTreatmentCreate.heparinBolusVolume = value + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _heparinStopTime + SliderCreateTreatment { id: _heparinStopTime objectName: "_heparinStopTime" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Heparin Stop Time" - units: qsTr(" min") min: vTreatmentCreate.heparinStopTimeMin max: vTreatmentCreate.heparinStopTimeMax step: vTreatmentCreate.heparinStopTimeRes - onSliderChanged: { - vTreatmentCreate.heparinStopTime = value; + text: qsTr("Heparin Stop Time") + units: qsTr("min") + onPressed: { + _flickable.setInteractive(false) + vTreatmentCreate.heparinStopTime = value } + onReleased: { + vTreatmentCreate.heparinStopTime = value + _flickable.setInteractive(true) + } } SliderCreateTreatment { id: _salineBolus - objectName: "_salineBolusRect" + objectName: "_salineBolus" + sliderObjectName: objectName + "Slider" + selectedValueObjectName: objectName + "Value" text: "Saline Bolus" - units: qsTr(" mL") + units: qsTr("mL") min: vTreatmentCreate.salineBolusVolumeMin max: vTreatmentCreate.salineBolusVolumeMax step: vTreatmentCreate.salineBolusVolumeRes - onSliderChanged: { - vTreatmentCreate.salineBolusVolume = value; + onPressed: { + _flickable.setInteractive(false) + vTreatmentCreate.salineBolusVolume = value } + onReleased: { + vTreatmentCreate.salineBolusVolume = value + _flickable.setInteractive(true) + } } GridSelection { id: _acidConcentrate objectName: "_acidConcentrateRect" - name: "Acid Concentrate" - buttonNames: vTreatmentCreate.acidConcentrateOptions; + name: qsTr("Acid Concentrate") + buttonNames: vTreatmentCreate.acidConcentrateOptions onButtonClicked: { - vTreatmentCreate.acidConcentrate = selectedIndex; + vTreatmentCreate.acidConcentrate = selectedIndex } } - GridSelection { - id: _bicarbonateConcentrate + GridSelection { id: _bicarbonateConcentrate objectName: "_bicarbonateConcentrateRect" - name: "Bicarbonate Concentrate" + name: qsTr("Bicarbonate Concentrate") numRows: 1 numCols: 2 buttonNames: vTreatmentCreate.bicarbonateConcentrateOptions; @@ -201,10 +245,9 @@ } } - GridSelection { - id: _dialyzerType + GridSelection { id: _dialyzerType objectName: "_dialyzerTypeRect" - name: "Dialyzer Type" + name: qsTr("Dialyzer Type") numRows: 3 numCols: 2 buttonNames: vTreatmentCreate.dialyzerTypeOptions; @@ -213,41 +256,43 @@ } } - SliderCreateTreatment { - id: _dialysateTemperature + SliderCreateTreatment { id: _dialysateTemperature objectName: "_dialysateTemperature" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Dialysate Temperature" - units: qsTr(" C") min: vTreatmentCreate.dialysateTempMin max: vTreatmentCreate.dialysateTempMax step: vTreatmentCreate.dialysateTempRes - onSliderChanged: { - vTreatmentCreate.dialysateTemp = value; + text: qsTr("Dialysate Temperature") + units: qsTr("C") + onPressed: { + _flickable.setInteractive(false) + vTreatmentCreate.dialysateTemp = value } + onReleased: { + vTreatmentCreate.dialysateTemp = value + _flickable.setInteractive(true) + } } - Text { - id: _arterialPressureLimitsTitle - text: "Arterial Pressure Limits" + Text { id: _arterialPressureLimitsTitle + text: qsTr("Arterial Pressure Limits") anchors.left: _arterialPressureLimits.left font.pixelSize: Fonts.fontPixelFluidText color: Colors.textMain; } - SliderDoubleCreateTreatment { - id: _arterialPressureLimits + SliderDoubleCreateTreatment { id: _arterialPressureLimits objectName: "_arterialPressureLimits" lowSliderObjectName: objectName + "LowSlider" lowSelectedValueObjectName: objectName + "LowValue" highSliderObjectName: objectName + "HighSlider" highSelectedValueObjectName: objectName + "HighValue" - lowTitle: "Low" - lowUnits: " mmHg" - highTitle: "High" - highUnits: " mmHg" + lowTitle: qsTr("Low") + lowUnits: qsTr("mmHg") + highTitle: qsTr("High") + highUnits: qsTr("mmHg") lowMin: vTreatmentCreate.arterialPressureLimitLowMin lowMax: vTreatmentCreate.arterialPressureLimitLowMax highMin: vTreatmentCreate.arterialPressureLimitHighMin @@ -256,35 +301,43 @@ highValue: vTreatmentCreate.arterialPressureLimitHighMin lowStep: vTreatmentCreate.arterialPressureLimitLowRes highStep: vTreatmentCreate.arterialPressureLimitHighRes - onLowSliderChanged: { + onLowSliderPressed: { + _flickable.setInteractive(false) vTreatmentCreate.arterialPressureLimitLow = lowValue } - onHighSliderChanged: { + onLowSliderReleased: { + vTreatmentCreate.arterialPressureLimitLow = lowValue + _flickable.setInteractive(true) + } + onHighSliderPressed: { + _flickable.setInteractive(false) vTreatmentCreate.arterialPressureLimitHigh = highValue } + onHighSliderReleased: { + vTreatmentCreate.arterialPressureLimitHigh = highValue + _flickable.setInteractive(true) + } } - Text { - id: _venousPressureLimitsTitle - text: "Venous Pressure Limits" + Text { id: _venousPressureLimitsTitle + text: qsTr("Venous Pressure Limits") anchors.left: _venousPressureLimits.left font.pixelSize: Fonts.fontPixelFluidText color: Colors.textMain; } - SliderDoubleCreateTreatment { - id: _venousPressureLimits + SliderDoubleCreateTreatment { id: _venousPressureLimits objectName: "_venousPressureLimits" lowSliderObjectName: objectName + "LowSlider" lowSelectedValueObjectName: objectName + "LowValue" highSliderObjectName: objectName + "HighSlider" highSelectedValueObjectName: objectName + "HighValue" - lowTitle: "Low" - lowUnits: " mmHg" - highTitle: "High" - highUnits: " mmHg" + lowTitle: qsTr("Low") + lowUnits: Variables.unitTextBloodPressure + highTitle: qsTr("High") + highUnits: Variables.unitTextBloodPressure lowMin: vTreatmentCreate.venousPressureLimitLowMin lowMax: vTreatmentCreate.venousPressureLimitLowMax highMin: vTreatmentCreate.venousPressureLimitHighMin @@ -293,44 +346,62 @@ highValue: vTreatmentCreate.venousPressureLimitHighMin lowStep: vTreatmentCreate.venousPressureLimitLowRes highStep: vTreatmentCreate.venousPressureLimitHighRes - onLowSliderChanged: { + onLowSliderPressed: { + _flickable.setInteractive(false) vTreatmentCreate.venousPressureLimitLow = lowValue } - onHighSliderChanged: { + onLowSliderReleased: { + vTreatmentCreate.venousPressureLimitLow = lowValue + _flickable.setInteractive(true) + } + onHighSliderPressed: { + _flickable.setInteractive(false) vTreatmentCreate.venousPressureLimitHigh = highValue } + onHighSliderReleased: { + vTreatmentCreate.venousPressureLimitHigh = highValue + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _bloodPressureMeasurementInterval + SliderCreateTreatment { id: _bloodPressureMeasurementInterval objectName: "_bloodPressureMeasurementInterval" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Blood Pressure Measurement Interval" - units: qsTr(" min") + text: qsTr("Blood Pressure Measurement Interval") + units: Variables.unitTextBPMeasurementInterval min: vTreatmentCreate.bloodPressureMeasureIntervalMin max: vTreatmentCreate.bloodPressureMeasureIntervalMax step: vTreatmentCreate.bloodPressureMeasureIntervalRes stepSnap: true - onSliderChanged: { + onPressed: { + _flickable.setInteractive(false) vTreatmentCreate.bloodPressureMeasureInterval = value } + onReleased: { + vTreatmentCreate.bloodPressureMeasureInterval = value + _flickable.setInteractive(true) + } } - SliderCreateTreatment { - id: _rinsebackFlowRate + SliderCreateTreatment { id: _rinsebackFlowRate objectName: "_rinsebackFlowRate" sliderObjectName: objectName + "Slider" selectedValueObjectName: objectName + "Value" - text: "Rinseback Flow Rate" - units: qsTr(" mL/min") + text: qsTr("Rinseback Flow Rate") + units: Variables.unitTextFlowRate min: vTreatmentCreate.rinsebackFlowRateMin max: vTreatmentCreate.rinsebackFlowRateMax step: vTreatmentCreate.rinsebackFlowRateRes stepSnap: true - onSliderChanged: { + onPressed: { + _flickable.setInteractive(false) vTreatmentCreate.rinsebackFlowRate = value } + onReleased: { + vTreatmentCreate.rinsebackFlowRate = value + _flickable.setInteractive(true) + } } TouchRect { id : _continueRect @@ -339,7 +410,7 @@ text.text: qsTr("CONTINUE") backgroundColor: Colors.createTreatmentNotReady borderColor: Colors.createTreatmentNotReady - textColor: Colors.createTrTextNotReady + textColor: Colors.createTreatmentTextNotReady button.onClicked: { vTreatmentCreate.saveTreatmentProfile = false; if (vTreatmentCreate.continueEnabled) { @@ -351,11 +422,11 @@ if (enabled) { backgroundColor = Colors.createTreatmentActive borderColor = Colors.createTreatmentActive - textColor = Colors.createTrTextReady + textColor = Colors.createTreatmentTextReady } else { backgroundColor = Colors.createTreatmentNotReady borderColor = Colors.createTreatmentNotReady - textColor = Colors.createTrTextNotReady + textColor = Colors.createTreatmentTextNotReady } } } @@ -369,37 +440,6 @@ } } - states: [ - State { - when: _flickable.movingVertically - PropertyChanges { - target: _verticalScrollBar - opacity: 0.8 - } - } - ] - - ScrollBar { - anchors.top: _flickable.top - anchors.bottom: _flickable.bottom - id: _verticalScrollBar - size: _flickable.height / _column.implicitHeight - active: true - anchors.right: _flickable.right - anchors.rightMargin: 5 - opacity: 0 - orientation: Qt.Vertical - position: _flickable.visibleArea.yPosition - - contentItem: Rectangle { - color: Colors.backgroundRangeRect - implicitWidth: 6 - radius: width / 2 - width: 3 - } - - } - onVisibleChanged: { if (visible) { _mainMenu.hidden = true @@ -417,7 +457,6 @@ } onResetCreateTreatment: { - console.log("resetting create treatment"); _bloodFlowRate.isActive = false; _dialysateFlowRate.isActive = false; _duration.isActive = false; @@ -441,93 +480,97 @@ } + onFwValidationSuccess: { + _bloodFlowRate .setValid (true) + _dialysateFlowRate .setValid (true) + _duration .setValid (true) + _heparinDispensingRate .setValid (true) + + _heparinBolusVolume .setValid (true) + _heparinStopTime .setValid (true) + + _salineBolus .setValid (true) + _acidConcentrate .setValid (true) + _bicarbonateConcentrate .setValid (true) + _dialyzerType .setValid (true) + + _dialysateTemperature .setValid (true) + _arterialPressureLimits .setLowValid (true) + _arterialPressureLimits .setHighValid(true) + _venousPressureLimits .setLowValid (true) + _venousPressureLimits .setHighValid(true) + _bloodPressureMeasurementInterval .setValid (true) + _rinsebackFlowRate .setValid (true) + } + onFwValidationFailed: { - console.debug("Fw validation failed: " + reason) } onBloodFlowRate_ValidationFailed: { - console.debug("Blood flow validation failed: " + reason) _bloodFlowRate.setValid(false) } onDialysateFlowRate_ValidationFailed: { - console.debug("Dialysate flow rate validation failed: " + reason) _dialysateFlowRate.setValid(false) } - onDuration_ValidationFailed: { - console.debug("Duration validation failed: " + reason) _duration.setValid(false) } onHeparinDispensingRate_ValidationFailed: { - console.debug("Heparin dispensing rate validation failed: " + reason) _heparinDispensingRate.setValid(false) } onHeparinBolusVolume_ValidationFailed: { - console.debug("Heparin bolus volume validation failed: " + reason) _heparinBolusVolume.setValid(false) } onHeparinStopTime_ValidationFailed: { - console.debug("Heparin stop time validation failed: " + reason) _heparinStopTime.setValid(false) } onSalineBolusVolume_ValidationFailed: { - console.debug("Saline bolus volume validation failed: " + reason) _salineBolus.setValid(false) } onAcidConcentrate_ValidationFailed: { - console.debug("Acid concentrate validation failed: " + reason) _acidConcentrate.setValid(false) } onBicarbonateConcentrate_ValidationFailed: { - console.debug("Bicarbonate concentrate validation failed: " + reason) _bicarbonateConcentrate.setValid(false) } onDialyzerType_ValidationFailed: { - console.debug("Dialyzer type validation failed: " + reason) _dialyzerType.setValid(false) } onDialysateTemp_ValidationFailed: { - console.debug("Dialysate temp validation failed: " + reason) _dialysateTemperature.setValid(false) } onArterialPressureLimitLow_ValidationFailed: { - console.debug("Arterial pressure limit low validation failed: " + reason) _arterialPressureLimits.setLowValid(false) } onArterialPressureLimitHigh_ValidationFailed: { - console.debug("Arterial pressure limit high validation failed: " + reason) _arterialPressureLimits.setHighValid(false) } onVenousPressureLimitLow_ValidationFailed: { - console.debug("Venous pressure limit low validation failed: " + reason) _venousPressureLimits.setLowValid(false) } onVenousPressureLimitHigh_ValidationFailed: { - console.debug("Venous pressure limit high validation failed: " + reason) _venousPressureLimits.setHighValid(false) } onBloodPressureMeasureInterval_ValidationFailed: { - console.debug("Blood pressure measure interval validation failed: " + reason) _bloodPressureMeasurementInterval.setValid(false) } onRinsebackFlowRate_ValidationFailed: { - console.debug("Rinseback flow rate validation failed: " + reason) _rinsebackFlowRate.setValid(false) }