Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r20639e283efe066d113c8b81630d89e4f8e82902 -r83b9d737cd495b34a7b42f5409962a9442f3b8f4 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 20639e283efe066d113c8b81630d89e4f8e82902) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 83b9d737cd495b34a7b42f5409962a9442f3b8f4) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2024 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 PreTreatmentCreate.qml * \author (last) Behrouz NematiPour - * \date (last) 11-Apr-2023 + * \date (last) 08-Feb-2024 * \author (original) Behrouz NematiPour * \date (original) 12-Jan-2021 * @@ -43,12 +43,7 @@ _bicarbonateConcentrate .active && _dialyzerType .active && _dialysateTemperature .active && _dialysateTemperature . valid && - _arterialPressureLimits .minAdjusted && _arterialPressureLimits .lowerBoundValid && - _arterialPressureLimits .maxAdjusted && _arterialPressureLimits .upperBoundValid && - _venousPressureLimits .minAdjusted && _venousPressureLimits .lowerBoundValid && - _venousPressureLimits .maxAdjusted && _venousPressureLimits .upperBoundValid && - _bloodPressureInterval .active && _bloodPressureInterval . valid && - _rinsebackFlowRate .active && _rinsebackFlowRate . valid + _bloodPressureInterval .active && _bloodPressureInterval . valid Connections{ target:vTreatmentCreate // Update flicker location to show the invalid parameter @@ -67,12 +62,7 @@ if ( vTreatmentCreate. dialyzerTypeRejectReason ) { scrollTo( _dialyzerType ); return } if ( vTreatmentCreate. dialysateTempRejectReason ) { scrollTo( _dialysateTemperature ); return } - if ( vTreatmentCreate. arterialPressureLimitLowRejectReason ) { scrollTo( _venousColumn ); return } - if ( vTreatmentCreate. arterialPressureLimitHighRejectReason ) { scrollTo( _venousColumn ); return } - if ( vTreatmentCreate. venousPressureLimitLowRejectReason ) { scrollTo( _arterialColumn ); return } - if ( vTreatmentCreate. venousPressureLimitHighRejectReason ) { scrollTo( _venousColumn ); return } if ( vTreatmentCreate.bloodPressureMeasureIntervalRejectReason ) { scrollTo( _bloodPressureInterval ); return } - if ( vTreatmentCreate. rinsebackFlowRateRejectReason ) { scrollTo( _rinsebackFlowRate ); return } } } @@ -84,7 +74,60 @@ _flickable.contentY = vItem.mapToItem(_flickable.contentItem, 0, 0).y } + function clear() { + _flickable.contentY = 0 + _bloodFlowRate .clear() + _dialysateFlowRate .clear() + _duration .clear() + _heparinDispensingRate .clear() + _heparinBolusVolume .clear() + _heparinStopTime .clear() + _salineBolus .clear() + _heparinType .clear() + _acidConcentrate .clear() + _bicarbonateConcentrate .clear() + _dialyzerType .clear() + _dialysateTemperature .clear() + _bloodPressureInterval .clear() + } + property bool prepopulated: false + function prepopulate() { + // not complete yet and not part of the current DNBUG + // the issue is the On/Off switches whcih has not been stored in the view to restore/prepopulate it, + // which is needed for three sliders to be set properly. + _bloodFlowRate .reset(vTreatmentCreate.bloodFlowRate ) + _dialysateFlowRate .reset(vTreatmentCreate.dialysateFlowRate ) + _duration .reset(vTreatmentCreate.treatmentDuration ) + _heparinDispensingRate .reset(vTreatmentCreate.heparinDispensingRate ) + _heparinBolusVolume .reset(vTreatmentCreate.heparinBolusVolume ) + _heparinStopTime .reset(vTreatmentCreate.heparinStopTime ) + _salineBolus .reset(vTreatmentCreate.salineBolusVolume ) + _heparinType .reset(vTreatmentCreate.heparinType ) + _acidConcentrate .reset(vTreatmentCreate.acidConcentrate ) + _bicarbonateConcentrate .reset(vTreatmentCreate.bicarbonateConcentrate ) + _dialyzerType .reset(vTreatmentCreate.heparinType ) + _dialysateTemperature .reset(vTreatmentCreate.dialysateTemp ) + _bloodPressureInterval .reset(vTreatmentCreate.bloodPressureMeasureInterval ) + } + + ConfirmButton { id : _prepopulateButton + objectName : "_prepopulateButton" + text.text : prepopulated ? qsTr("RESET") : qsTr("PREPOPULATE") + anchors.top : title.top + anchors.topMargin : 0 + visible : false // true // not readu yet and has been hidded. + onClicked : { + if ( prepopulated ) { + clear() + } + else { + prepopulate() + } + prepopulated = ! prepopulated + } + } + ScrollBar { flickable : _flickable anchors.fill: _flickable @@ -127,7 +170,7 @@ minimum : vTreatmentRanges.bloodFlowRateMin maximum : vTreatmentRanges.bloodFlowRateMax step : vTreatmentRanges.bloodFlowRateRes - value : vTreatmentRanges.bloodFlowRateDef + defaultValue: vTreatmentRanges.bloodFlowRateDef valid : !vTreatmentCreate.bloodFlowRateRejectReason onValueChanged : { // Reset the valid state to allow repositioning to the next invalid parameter @@ -146,7 +189,7 @@ minimum : vTreatmentRanges.dialysateFlowRateMin maximum : vTreatmentRanges.dialysateFlowRateMax step : vTreatmentRanges.dialysateFlowRateRes - value : vTreatmentRanges.dialysateFlowRateDef + defaultValue: vTreatmentRanges.dialysateFlowRateDef valid : !vTreatmentCreate.dialysateFlowRateRejectReason onValueChanged : { // Reset the valid state to allow repositioning to the next invalid parameter @@ -165,7 +208,7 @@ minimum : vTreatmentRanges.treatmentDurationMin maximum : vTreatmentRanges.treatmentDurationMax step : vTreatmentRanges.treatmentDurationRes - value : vTreatmentRanges.treatmentDurationDef + defaultValue: vTreatmentRanges.treatmentDurationDef valid : !vTreatmentCreate.treatmentDurationRejectReason onValueChanged: { // Reset the valid state to allow repositioning to the next invalid parameter @@ -211,7 +254,7 @@ minimum : vTreatmentRanges.heparinDispensingRateMin maximum : vTreatmentRanges.heparinDispensingRateMax step : vTreatmentRanges.heparinDispensingRateRes - value : vTreatmentRanges.heparinDispensingRateDef + defaultValue: vTreatmentRanges.heparinDispensingRateDef valid : !vTreatmentCreate.heparinDispensingRateRejectReason adjustable : _heparinDispensingRateSwitch.checked inActiveZero : true @@ -226,19 +269,18 @@ // ToDo: create a component for Switch, // ToDo: Consider putting the new CheckBox component into the SliderCreateTreatment component and set via boolean property // This is a full implementation of a Switch + toggleSwich: _heparinDispensingRateSwitch Switch { id: _heparinDispensingRateSwitch property bool active: false - onActiveChanged : { - _heparinDispensingRate.active = active - } onCheckedChanged: { if ( ! active ) { active = true checked = ! checked } - vTreatmentCreate.heparinDispensingRate = 0 - _heparinDispensingRate.reset ( 0 ) - _heparinDispensingRate.active = ! checked + vTreatmentCreate.heparinDispensingRate = 0 + vTreatmentCreate.heparinDispensingRateOff = ! checked + _heparinDispensingRate.reset ( 0 ) + _heparinDispensingRate.active = ! checked } x : width * -1.5 @@ -291,7 +333,7 @@ minimum : vTreatmentRanges.heparinBolusVolumeMin maximum : vTreatmentRanges.heparinBolusVolumeMax step : vTreatmentRanges.heparinBolusVolumeRes - value : vTreatmentRanges.heparinBolusVolumeDef + defaultValue: vTreatmentRanges.heparinBolusVolumeDef valid : !vTreatmentCreate.heparinBolusVolumeRejectReason adjustable : _heparinBolusVolumeSwitch.checked inActiveZero : true @@ -307,16 +349,18 @@ // ToDo: create a component for this, // ToDo: Consider putting the new CheckBox component into the SliderCreateTreatment component and set via boolean property // This is a full implementation of a CheckBox + toggleSwich: _heparinBolusVolumeSwitch Switch { id: _heparinBolusVolumeSwitch property bool active: false onCheckedChanged: { if ( ! active ) { active = true checked = ! checked } - vTreatmentCreate.heparinBolusVolume = 0 - _heparinBolusVolume.reset ( 0 ) - _heparinBolusVolume.active = ! checked + vTreatmentCreate.heparinBolusVolume = 0 + vTreatmentCreate.heparinBolusVolumeOff = ! checked + _heparinBolusVolume.reset ( 0 ) + _heparinBolusVolume.active = ! checked } x : width * -1.5 @@ -367,7 +411,7 @@ minimum : vTreatmentRanges.heparinStopTimeMin maximum : vTreatmentRanges.heparinStopTimeMax step : vTreatmentRanges.heparinStopTimeRes - value : vTreatmentRanges.heparinStopTimeDef + defaultValue: vTreatmentRanges.heparinStopTimeDef valid : !vTreatmentCreate.heparinStopTimeRejectReason enabled : false // this switch depends on the heparin dispencing adjustable : false // this switch depends on the heparin dispencing @@ -389,7 +433,7 @@ minimum : vTreatmentRanges.salineBolusVolumeMin maximum : vTreatmentRanges.salineBolusVolumeMax step : vTreatmentRanges.salineBolusVolumeRes - value : vTreatmentRanges.salineBolusVolumeDef + defaultValue: vTreatmentRanges.salineBolusVolumeDef valid : !vTreatmentCreate.salineBolusVolumeRejectReason onValueChanged: { // Reset the valid state to allow repositioning to the next invalid parameter @@ -417,10 +461,9 @@ onClicked :{vTreatmentCreate.heparinType = curIndex ; vTreatmentCreate.heparinTypeSet = true; } enabled : _heparinDispensingRateSwitch.checked || _heparinBolusVolumeSwitch.checked onEnabledChanged: { - if (!enabled) { - // set disabled value - vTreatmentCreate.heparinType = -1 + if ( ! enabled ) { vTreatmentCreate.heparinTypeSet = false + clear() } } @@ -469,8 +512,9 @@ minimum : vTreatmentRanges.dialysateTempMin maximum : vTreatmentRanges.dialysateTempMax step : vTreatmentRanges.dialysateTempRes - value : vTreatmentRanges.dialysateTempDef + defaultValue: vTreatmentRanges.dialysateTempDef valid : !vTreatmentCreate.dialysateTempRejectReason + onValueChanged: { // Reset the valid state to allow repositioning to the next invalid parameter if(!valid) { @@ -480,6 +524,8 @@ } } +/* [DEN-15359] Arterial and Venous Pressure has been removed, it has been kept here since it supposed to become a component and don't watnt to loose the coce. + // TODO : This has to be a Component Column { id: _arterialColumn spacing: 45 @@ -731,6 +777,8 @@ } } +*/ + SliderCreateTreatment { id: _bloodPressureInterval objectName : "_bloodPressureMeasurementInterval" label : qsTr("Blood Pressure Measurement Interval") @@ -740,7 +788,7 @@ minimum : vTreatmentRanges.bloodPressureMeasureIntervalMin maximum : vTreatmentRanges.bloodPressureMeasureIntervalMax step : vTreatmentRanges.bloodPressureMeasureIntervalRes - value : vTreatmentRanges.bloodPressureMeasureIntervalDef + defaultValue: vTreatmentRanges.bloodPressureMeasureIntervalDef valid : !vTreatmentCreate.bloodPressureMeasureIntervalRejectReason adjustable : _bloodPressureIntervalSwitch.checked inActiveZero: true @@ -756,6 +804,7 @@ // ToDo: create a component for this, // ToDo: Consider putting the new CheckBox component into the SliderCreateTreatment component and set via boolean property // This is a full implementation of a CheckBox + toggleSwich: _bloodPressureIntervalSwitch Switch { id: _bloodPressureIntervalSwitch property bool active: false onCheckedChanged: { @@ -809,24 +858,6 @@ } } - SliderCreateTreatment { id: _rinsebackFlowRate - objectName : "_rinsebackFlowRate" - label : qsTr("Rinseback Flow Rate") - flickable : _flickable - unit : Variables.unitTextFlowRate - minimum : vTreatmentRanges.rinsebackFlowRateMin - maximum : vTreatmentRanges.rinsebackFlowRateMax - step : vTreatmentRanges.rinsebackFlowRateRes - value : vTreatmentRanges.rinsebackFlowRateDef - valid : !vTreatmentCreate.rinsebackFlowRateRejectReason - onValueChanged: { - // Reset the valid state to allow repositioning to the next invalid parameter - if(!valid) { - vTreatmentCreate.rinsebackFlowRateRejectReason = Variables.noRejectReason - } - vTreatmentCreate.rinsebackFlowRate = value - } - } Item { width : 50 height : 50