Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -rf772cc152a61bf775aa7c4ce968024670f204f17 -r2fcd1a1722285e5e741b89176ad21989eb0f56f5 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision f772cc152a61bf775aa7c4ce968024670f204f17) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 2fcd1a1722285e5e741b89176ad21989eb0f56f5) @@ -7,7 +7,7 @@ * * \file PreTreatmentCreate.qml * \author (last) Behrouz NematiPour - * \date (last) 12-Jan-2021 + * \date (last) 01-Mar-2021 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * @@ -21,29 +21,28 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/pages/pretreatment" /*! * \brief Pre-Treatment create screen * \details which contains the components to let user set values of the treatment parameters. */ PreTreatmentBase { id: _root - objectName: "_PreTreatmentCreate"; // SquishQt testability + objectName: "_PreTreatmentCreate" // SquishQt testability - signal continueClicked() + header.confirmEnabled: vTreatmentCreate.continueEnabled function setInteractive(isInteractive) { _flickable.interactive = isInteractive } - header.stepName : Variables.preTreatmentStepLabelCreate - Flickable { id: _flickable objectName: "TreatmentCreateFlickable" anchors { - top : parent.top - topMargin : header.height - bottom : parent.bottom - bottomMargin : 75 + top : _root.title.bottom + topMargin : 15 + bottom : _root.bottom + bottomMargin : Variables.notificationHeight + 15 horizontalCenter: parent.horizontalCenter } width: parent.width @@ -65,20 +64,13 @@ Column { id: _column spacing: Variables.treatmentSpacing - anchors.horizontalCenter: parent.horizontalCenter; - anchors.fill: parent; + anchors.horizontalCenter: parent.horizontalCenter + anchors.fill: parent - Text { id: _titleText - anchors.horizontalCenter: parent.horizontalCenter; - text: qsTr("Create a Custom Treatment") - color: Colors.textMain - font.pixelSize: Fonts.fontPixelTitle - } - Text { id: _titleTextPrescription - anchors.horizontalCenter: parent.horizontalCenter; - text: qsTr("PRESCRIPTION"); - color: Colors.textMain; + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("PRESCRIPTION") + color: Colors.textMain font.pixelSize: Fonts.fontPixelButton font.bold: true } @@ -113,10 +105,10 @@ units: qsTr("mL/min") onPressed: { setInteractive(false) - vTreatmentCreate.dialysateFlowRate = value; + vTreatmentCreate.dialysateFlowRate = value } onReleased: { - vTreatmentCreate.dialysateFlowRate = value; + vTreatmentCreate.dialysateFlowRate = value setInteractive(true) } } @@ -132,10 +124,10 @@ units: qsTr("min") onPressed: { setInteractive(false) - vTreatmentCreate.duration = value; + vTreatmentCreate.duration = value } onReleased: { - vTreatmentCreate.duration = value; + vTreatmentCreate.duration = value setInteractive(true) } } @@ -219,9 +211,9 @@ } Text { id: _titleTextOperation - anchors.horizontalCenter: parent.horizontalCenter; - text: qsTr("OPERATING PARAMETERS"); - color: Colors.textMain; + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("OPERATING PARAMETERS") + color: Colors.textMain font.pixelSize: Fonts.fontPixelButton font.bold: true } @@ -241,9 +233,9 @@ name: qsTr("Bicarbonate Concentrate") numRows: 1 numCols: 2 - buttonNames: vTreatmentCreate.bicarbonateConcentrateOptions; + buttonNames: vTreatmentCreate.bicarbonateConcentrateOptions onButtonClicked: { - vTreatmentCreate.bicarbonateConcentrate = selectedIndex; + vTreatmentCreate.bicarbonateConcentrate = selectedIndex } } @@ -252,9 +244,9 @@ name: qsTr("Dialyzer Type") numRows: 3 numCols: 2 - buttonNames: vTreatmentCreate.dialyzerTypeOptions; + buttonNames: vTreatmentCreate.dialyzerTypeOptions onButtonClicked: { - vTreatmentCreate.dialyzerType = selectedIndex; + vTreatmentCreate.dialyzerType = selectedIndex } } @@ -336,8 +328,10 @@ onPressed : { setInteractive(false) } onDragged : { setInteractive(false) } onReleased: { setInteractive(true ) } - onMinValueChanged: if (minAdjusted) vTreatmentCreate.arterialPressureLimitLow = minValue - onMaxValueChanged: if (maxAdjusted) vTreatmentCreate.arterialPressureLimitHigh = maxValue + onMinValueChanged: { if ( minAdjusted ) vTreatmentCreate.arterialPressureLimitLow = minValue } + onMaxValueChanged: { if ( maxAdjusted ) vTreatmentCreate.arterialPressureLimitHigh = maxValue } + onClicked : { if ( minAdjusted ) vTreatmentCreate.arterialPressureLimitLow = minValue + if ( maxAdjusted ) vTreatmentCreate.arterialPressureLimitHigh = maxValue } } } @@ -400,8 +394,10 @@ onPressed : { setInteractive(false) } onDragged : { setInteractive(false) } onReleased: { setInteractive(true ) } - onMinValueChanged: if (minAdjusted) vTreatmentCreate.venousPressureLimitLow = minValue - onMaxValueChanged: if (maxAdjusted) vTreatmentCreate.venousPressureLimitHigh = maxValue + onMinValueChanged: { if ( minAdjusted ) vTreatmentCreate.venousPressureLimitLow = minValue } + onMaxValueChanged: { if ( maxAdjusted ) vTreatmentCreate.venousPressureLimitHigh = maxValue } + onClicked : { if ( minAdjusted ) vTreatmentCreate.venousPressureLimitLow = minValue + if ( maxAdjusted ) vTreatmentCreate.venousPressureLimitHigh = maxValue } } } @@ -444,68 +440,37 @@ setInteractive(true) } } - - TouchRect { id : _continueRect - objectName: "_continueButton" - anchors.horizontalCenter: parent.horizontalCenter - text.text: qsTr("CONTINUE") - backgroundColor: Colors.createTreatmentNotReady - borderColor: Colors.createTreatmentNotReady - textColor: Colors.createTreatmentTextNotReady - button.onClicked: { - vTreatmentCreate.saveTreatmentProfile = false; - if (vTreatmentCreate.continueEnabled) { - _root.continueClicked() - } - } - - function toggleEnabled(enabled) { - if (enabled) { - backgroundColor = Colors.createTreatmentActive - borderColor = Colors.createTreatmentActive - textColor = Colors.createTreatmentTextReady - } else { - backgroundColor = Colors.createTreatmentNotReady - borderColor = Colors.createTreatmentNotReady - textColor = Colors.createTreatmentTextNotReady - } - } + Item { + width : 50 + height : 50 } } } Connections { target: vTreatmentCreate - onContinueEnabledChanged: { - if (vTreatmentCreate.continueEnabled) { - _continueRect.toggleEnabled(true) - } else { - _continueRect.toggleEnabled(false) - } - } - onResetCreateTreatment: { - _bloodFlowRate.isActive = false; - _dialysateFlowRate.isActive = false; - _duration.isActive = false; - _heparinDispensingRate.isActive = false; + _bloodFlowRate.isActive = false + _dialysateFlowRate.isActive = false + _duration.isActive = false + _heparinDispensingRate.isActive = false - _heparinBolusVolume.isActive = false; - _heparinStopTime.isActive = false; + _heparinBolusVolume.isActive = false + _heparinStopTime.isActive = false - _salineBolus.isActive = false; - _acidConcentrate.setActive(false); - _bicarbonateConcentrate.setActive(false); - _dialyzerType.setActive(false); + _salineBolus.isActive = false + _acidConcentrate.setActive(false) + _bicarbonateConcentrate.setActive(false) + _dialyzerType.setActive(false) - _dialysateTemperature.isActive = false; - _bloodPressureMeasurementInterval.isActive = false; - _rinsebackFlowRate.isActive = false; + _dialysateTemperature.isActive = false + _bloodPressureMeasurementInterval.isActive = false + _rinsebackFlowRate.isActive = false // TODO : Will be addressed in sub-task DEN-6686. - // _arterialPressureLimits.isLowActive = false; - // _arterialPressureLimits.isHighActive = false; - // _venousPressureLimits.isLowActive = false; - // _venousPressureLimits.isHighActive = false; + // _arterialPressureLimits.isLowActive = false + // _arterialPressureLimits.isHighActive = false + // _venousPressureLimits.isLowActive = false + // _venousPressureLimits.isHighActive = false } @@ -519,14 +484,14 @@ _heparinStopTime .setValid (true) _salineBolus .setValid (true) - _acidConcentrate .setValid (true) - _bicarbonateConcentrate .setValid (true) - _dialyzerType .setValid (true) + //_acidConcentrate .setValid (true) + // _bicarbonateConcentrate .setValid (true) + // _dialyzerType .setValid (true) + // + // _dialysateTemperature .setValid (true) + // _bloodPressureMeasurementInterval .setValid (true) + // _rinsebackFlowRate .setValid (true) - _dialysateTemperature .setValid (true) - _bloodPressureMeasurementInterval .setValid (true) - _rinsebackFlowRate .setValid (true) - // TODO : Will be addressed in sub-task DEN-6686. // _arterialPressureLimits .setLowValid (true) // _arterialPressureLimits .setHighValid(true) @@ -606,61 +571,61 @@ } onScrollToParameter: { - let prefix = "data."; - let contentYMargin = 80; - let newContentY = 0; + let prefix = "data." + let contentYMargin = 80 + let newContentY = 0 if (parameter === prefix+"bloodFlowRate") { - newContentY = _bloodFlowRate.mapToItem(_bloodFlowRate.parent, 0, 0).y; + newContentY = _bloodFlowRate.mapToItem(_bloodFlowRate.parent, 0, 0).y } else if (parameter === prefix+"dialysateFlowRate") { - newContentY = _dialysateFlowRate.mapToItem(_dialysateFlowRate.parent, 0, 0).y; + newContentY = _dialysateFlowRate.mapToItem(_dialysateFlowRate.parent, 0, 0).y } else if (parameter === prefix+"duration") { - newContentY = _duration.mapToItem(_duration.parent, 0, 0).y; + newContentY = _duration.mapToItem(_duration.parent, 0, 0).y } else if (parameter === prefix+"heparinDispensingRate") { - newContentY = _heparinDispensingRate.mapToItem(_heparinDispensingRate.parent, 0, 0).y; + newContentY = _heparinDispensingRate.mapToItem(_heparinDispensingRate.parent, 0, 0).y } else if (parameter === prefix+"heparinBolusVolume") { - newContentY = _heparinBolusVolume.mapToItem(_heparinBolusVolume.parent, 0, 0).y; + newContentY = _heparinBolusVolume.mapToItem(_heparinBolusVolume.parent, 0, 0).y } else if (parameter === prefix+"heparinStopTime") { - newContentY = _heparinStopTime.mapToItem(_heparinStopTime.parent, 0, 0).y; + newContentY = _heparinStopTime.mapToItem(_heparinStopTime.parent, 0, 0).y } else if (parameter === prefix+"salineBolus") { - newContentY = _salineBolus.mapToItem(_salineBolus.parent, 0, 0).y; + newContentY = _salineBolus.mapToItem(_salineBolus.parent, 0, 0).y } else if (parameter === prefix+"acidConcentrate") { - newContentY = _acidConcentrate.mapToItem(_acidConcentrate.parent, 0, 0).y; + newContentY = _acidConcentrate.mapToItem(_acidConcentrate.parent, 0, 0).y } else if (parameter === prefix+"bicarbonateConcentrate") { - newContentY = _bicarbonateConcentrate.mapToItem(_bicarbonateConcentrate.parent, 0, 0).y; + newContentY = _bicarbonateConcentrate.mapToItem(_bicarbonateConcentrate.parent, 0, 0).y } else if (parameter === prefix+"dialyzerType") { - newContentY = _dialyzerType.mapToItem(_dialyzerType.parent, 0, 0).y; + newContentY = _dialyzerType.mapToItem(_dialyzerType.parent, 0, 0).y } else if (parameter === prefix+"dialysateTemp") { - newContentY = _dialysateTemperature.mapToItem(_dialysateTemperature.parent, 0, 0).y; + newContentY = _dialysateTemperature.mapToItem(_dialysateTemperature.parent, 0, 0).y } else if (parameter === prefix+"arterialPressureLimitLow" || parameter === prefix+"arterialPressureLimitHigh") { - newContentY = _arterialPressureLimits.mapToItem(_arterialPressureLimits.parent, 0, 0).y; + newContentY = _arterialPressureLimits.mapToItem(_arterialPressureLimits.parent, 0, 0).y } else if (parameter === prefix+"venousPressureLimitLow" || parameter === prefix+"venousPressureLimitHigh") { - newContentY = _venousPressureLimits.mapToItem(_venousPressureLimits.parent, 0, 0).y; + newContentY = _venousPressureLimits.mapToItem(_venousPressureLimits.parent, 0, 0).y } else if (parameter === prefix+"bloodPressureMeasureInterval") { - newContentY = _bloodPressureMeasurementInterval.mapToItem(_bloodPressureMeasurementInterval.parent, 0, 0).y; + newContentY = _bloodPressureMeasurementInterval.mapToItem(_bloodPressureMeasurementInterval.parent, 0, 0).y } else if (parameter === prefix+"rinsebackFlowRate") { - newContentY = _rinsebackFlowRate.mapToItem(_rinsebackFlowRate.parent, 0, 0).y; + newContentY = _rinsebackFlowRate.mapToItem(_rinsebackFlowRate.parent, 0, 0).y } else { - return; + return } - _flickable.contentY = newContentY - contentYMargin; + _flickable.contentY = newContentY - contentYMargin } } }