Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r7e503c5459ec77a2816d6c7789da9b206cedbe8a -ra82ee4f326b26c4369f1306f867edc1bca6dabbe --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 7e503c5459ec77a2816d6c7789da9b206cedbe8a) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision a82ee4f326b26c4369f1306f867edc1bca6dabbe) @@ -30,8 +30,27 @@ PreTreatmentBase { id: _root objectName: "_PreTreatmentCreate" // SquishQt testability - header.confirmEnabled: vTreatmentCreate.continueEnabled + header.confirmEnabled: + _bloodFlowRate .active && + _dialysateFlowRate .active && + _duration .active && + _heparinDispensingRate .active && + _heparinBolusVolume .active && + _heparinStopTime .active && + _salineBolus .active && + _heparinType .active && + _acidConcentrate .active && + _bicarbonateConcentrate .active && + _dialyzerType .active && + _dialysateTemperature .active && + _arterialPressureLimits .minAdjusted && + _arterialPressureLimits .maxAdjusted && + _venousPressureLimits .minAdjusted && + _venousPressureLimits .maxAdjusted && + _bloodPressureInterval .active && + _rinsebackFlowRate .active + function setInteractive(vInteractive) { _flickable.interactive = vInteractive } @@ -109,9 +128,53 @@ onReleased : vTreatmentCreate.duration = value } +// ToDo: create a component for this, +// This is a full implementation of a CheckBox +// Switch { id: _heparinDelivery +// text: qsTr("Heparin Delivery") +// width : Variables.createTreatmentSliderWidth + 25 + +// anchors.horizontalCenter: parent.horizontalCenter + +// indicator: Rectangle { +// implicitWidth : Variables.sliderCircleDiameter * 1.7 +// implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) +// radius : implicitHeight +// x : _heparinDelivery.leftPadding +// y : parent.height / 2 - height / 2 +// color : _heparinDelivery.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive +// border.color : _heparinDelivery.checked ? Colors.borderButton : Colors.createTreatmentInactive +// Rectangle { id: _handler +// property real diameter : Variables.sliderCircleDiameter + +// x: _heparinDelivery.checked ? parent.width - width : 0 +// anchors.verticalCenter: parent.verticalCenter +// width : diameter +// height : diameter +// radius : diameter +// color : _heparinDelivery.checked ? Colors.highlightProgressBar : Colors.createTreatmentInactive +// border { +// width: 4 +// color: Colors.textMain +// } +// } +// } + +// contentItem: Text { +// enabled: _heparinDelivery.checked +// text: _heparinDelivery.text +// font: _heparinDelivery.font +// opacity: enabled ? 1.0 : 0.3 +// color : Colors.textButton +// verticalAlignment: Text.AlignVCenter +// leftPadding: _heparinDelivery.indicator.width + _heparinDelivery.spacing +// } +// } + SliderCreateTreatment { id: _heparinDispensingRate objectName : "_heparinDispensingRate" label : qsTr("Heparin Dispensing Rate") + zeroLabel : qsTr("OFF") flickable : _flickable unit : Variables.unitTextDispensingRate value : vTreatmentCreate.heparinDispensingRate @@ -121,11 +184,65 @@ step : vTreatmentCreate.heparinDispensingRateRes onPressed : vTreatmentCreate.heparinDispensingRate = value onReleased : vTreatmentCreate.heparinDispensingRate = value + adjustable : _heparinDispensingRateSwitch.checked + inActiveZero: true + + Switch { id: _heparinDispensingRateSwitch + property bool active: false + onCheckedChanged: { + if ( ! active ) { + active = true + checked = ! checked + } + vTreatmentCreate.heparinDispensingRate = 0 + _heparinDispensingRate.value = 0 + _heparinDispensingRate.active = ! checked + } + + x : width * -2 + y : parent.height - 13 // (height / 2) + width : indicator.width + indicator: Rectangle { + implicitWidth : Variables.sliderCircleDiameter * 1.7 + implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) + radius : implicitHeight + x : _heparinDispensingRateSwitch.leftPadding + y : parent.height / 2 - height / 2 + color : _heparinDispensingRateSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive + border.color : _heparinDispensingRateSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive + Rectangle { + property real diameter : Variables.sliderCircleDiameter + + x: _heparinDispensingRateSwitch.checked ? parent.width - width : 0 + anchors.verticalCenter: parent.verticalCenter + width : diameter + height : diameter + radius : diameter + color : _heparinDispensingRateSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive + border { + width: Variables.progressbarHandlerBorderWidth + color: Colors.textMain + } + } + } + + contentItem: Text { + width : _heparinDispensingRateSwitch.width + text : _heparinDispensingRateSwitch.checked ? qsTr("ON") : qsTr("OFF") + font : _heparinDispensingRateSwitch.font + color : _heparinDispensingRateSwitch.active ? Colors.textMain : Colors.textDisableButton + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + anchors.bottom: _heparinDispensingRateSwitch.top + anchors.bottomMargin: 12 + } + } } SliderCreateTreatment { id: _heparinBolusVolume objectName : "_heparinBolusVolume" label : qsTr("Heparin Bolus Volume") + zeroLabel : qsTr("OFF") flickable : _flickable unit : Variables.unitTextFluid value : vTreatmentCreate.heparinBolusVolume @@ -135,6 +252,60 @@ step : vTreatmentCreate.heparinBolusVolumeRes onPressed : vTreatmentCreate.heparinBolusVolume = value onReleased : vTreatmentCreate.heparinBolusVolume = value + adjustable : _heparinBolusVolumeSwitch.checked + inActiveZero: true + + Switch { id: _heparinBolusVolumeSwitch + property bool active: false + onCheckedChanged: { + if ( ! active ) { + active = true + checked = ! checked + } + vTreatmentCreate.heparinBolusVolume = 0 + _heparinBolusVolume.value = 0 + _heparinBolusVolume.active = ! checked + + } + + x : width * -2 + y : parent.height - 13 // (height / 2) + width : indicator.width + indicator: Rectangle { + implicitWidth : Variables.sliderCircleDiameter * 1.7 + implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) + radius : implicitHeight + x : _heparinBolusVolumeSwitch.leftPadding + y : parent.height / 2 - height / 2 + color : _heparinBolusVolumeSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive + border.color : _heparinBolusVolumeSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive + Rectangle { + property real diameter : Variables.sliderCircleDiameter + + x: _heparinBolusVolumeSwitch.checked ? parent.width - width : 0 + anchors.verticalCenter: parent.verticalCenter + width : diameter + height : diameter + radius : diameter + color : _heparinBolusVolumeSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive + border { + width: Variables.progressbarHandlerBorderWidth + color: Colors.textMain + } + } + } + + contentItem: Text { + width : _heparinBolusVolumeSwitch.width + text : _heparinBolusVolumeSwitch.checked ? qsTr("ON") : qsTr("OFF") + font : _heparinBolusVolumeSwitch.font + color : _heparinBolusVolumeSwitch.active ? Colors.textMain : Colors.textDisableButton + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + anchors.bottom: _heparinBolusVolumeSwitch.top + anchors.bottomMargin: 12 + } + } } SliderCreateTreatment { id: _heparinStopTime @@ -389,6 +560,7 @@ SliderCreateTreatment { id: _bloodPressureInterval objectName : "_bloodPressureMeasurementInterval" label : qsTr("Blood Pressure Measurement Interval") + zeroLabel : qsTr("OFF") flickable : _flickable unit : Variables.unitTextDuration value : vTreatmentCreate.bloodPressureMeasureInterval @@ -482,10 +654,10 @@ onBicarbonateConcentrate_ValidationFailed : _bicarbonateConcentrate .valid = false onDialyzerType_ValidationFailed : _dialyzerType .valid = false onDialysateTemp_ValidationFailed : _dialysateTemperature .valid = false - onArterialPressureLimitLow_ValidationFailed : _arterialPressureLimits .setLowValid ( false ) - onArterialPressureLimitHigh_ValidationFailed : _arterialPressureLimits .setHighValid ( false ) - onVenousPressureLimitLow_ValidationFailed : _venousPressureLimits .setLowValid ( false ) - onVenousPressureLimitHigh_ValidationFailed : _venousPressureLimits .setHighValid ( false ) +// onArterialPressureLimitLow_ValidationFailed : _arterialPressureLimits .setLowValid ( false ) +// onArterialPressureLimitHigh_ValidationFailed : _arterialPressureLimits .setHighValid ( false ) +// onVenousPressureLimitLow_ValidationFailed : _venousPressureLimits .setLowValid ( false ) +// onVenousPressureLimitHigh_ValidationFailed : _venousPressureLimits .setHighValid ( false ) onBloodPressureMeasureInterval_ValidationFailed : _bloodPressureInterval .valid = false onRinsebackFlowRate_ValidationFailed : _rinsebackFlowRate .valid = false onScrollToParameter: {