Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r1d3e80dd50bfe08502c8e52de126a2b809370211 -r83b9d737cd495b34a7b42f5409962a9442f3b8f4 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 1d3e80dd50bfe08502c8e52de126a2b809370211) +++ 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) 16-Jun-2023 + * \date (last) 08-Feb-2024 * \author (original) Behrouz NematiPour * \date (original) 12-Jan-2021 * @@ -74,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 @@ -216,6 +269,7 @@ // 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 onCheckedChanged: { @@ -295,6 +349,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: _heparinBolusVolumeSwitch Switch { id: _heparinBolusVolumeSwitch property bool active: false onCheckedChanged: { @@ -406,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() } } @@ -750,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: {