Index: sources/gui/qml/components/GridSelection.qml =================================================================== diff -u -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 -r9b99693be1aaf7306272f37e614b52c7085bcf44 --- sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) +++ sources/gui/qml/components/GridSelection.qml (.../GridSelection.qml) (revision 9b99693be1aaf7306272f37e614b52c7085bcf44) @@ -49,11 +49,16 @@ signal clicked(int vIndex) - function reset() { + function clear() { _root.curIndex = -1 _root.active = false } + function reset(vIndex) { + _root.curIndex = vIndex + _root.active = true + } + Text { id : _title text : "" color : _root.valid ? Colors.textMain : Colors.createTreatmentInvalidParam Index: sources/gui/qml/components/SliderCreateTreatment.qml =================================================================== diff -u -r1a9eb2756f33ec0387dd360e5c051ed9a04b9c1c -r9b99693be1aaf7306272f37e614b52c7085bcf44 --- sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 1a9eb2756f33ec0387dd360e5c051ed9a04b9c1c) +++ sources/gui/qml/components/SliderCreateTreatment.qml (.../SliderCreateTreatment.qml) (revision 9b99693be1aaf7306272f37e614b52c7085bcf44) @@ -27,6 +27,8 @@ Rectangle { id: _root property Flickable flickable: null + property var toggleSwich : null // it is the treatment slider custom Switch bu it will be defined outside of this component and the var type would suffice. + property bool adjustable : true property alias label : _label.text property alias decimal : _slider.decimal @@ -54,6 +56,15 @@ anchors.horizontalCenter: parent.horizontalCenter + function clear() { + reset(defaultValue) + active = false + if ( toggleSwich ) { + toggleSwich.checked = false + toggleSwich.active = false + } + } + function reset(vValue) { _slider.reset(vValue) } Index: sources/gui/qml/pages/MainStack.qml =================================================================== diff -u -r689177edf29dee6f10bebfed42f6bbadeb7ce8a8 -r9b99693be1aaf7306272f37e614b52c7085bcf44 --- sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 689177edf29dee6f10bebfed42f6bbadeb7ce8a8) +++ sources/gui/qml/pages/MainStack.qml (.../MainStack.qml) (revision 9b99693be1aaf7306272f37e614b52c7085bcf44) @@ -156,7 +156,8 @@ function onStandbyWaitTreatmentChanged ( vValue ) { /* It depends on the subModes of the standBy. Handled by onHome. */ } function onStandbyWaitDisinfectChanged ( vValue ) { page( _disinfectStack , vValue )} - function onValidateParametersChanged ( vValue ) { page( _preTreatmentCreateStack , vValue )} + function onValidateParametersChanged ( vValue ) { _preTreatmentCreateStack . clear () + page( _preTreatmentCreateStack , vValue )} function onPreTreatmentChanged ( vValue ) { page( _preTreatmentStack , vValue )} function onInTreatmentChanged ( vValue ) { page( _treatmentStack , vValue )} function onPostTreatmentChanged ( vValue ) { page( _postTreatmentStack , vValue )} Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 -r9b99693be1aaf7306272f37e614b52c7085bcf44 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 9b99693be1aaf7306272f37e614b52c7085bcf44) @@ -74,7 +74,59 @@ _flickable.contentY = vItem.mapToItem(_flickable.contentItem, 0, 0).y } + function clear() { + _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 +268,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 +348,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: { @@ -408,7 +462,7 @@ onEnabledChanged: { if ( ! enabled ) { vTreatmentCreate.heparinTypeSet = false - reset() + clear() } } @@ -749,6 +803,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: { Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml =================================================================== diff -u -r656c8ece0af7d784f545535ee1ccf9bb0e43cd63 -r9b99693be1aaf7306272f37e614b52c7085bcf44 --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml (.../PreTreatmentCreateStack.qml) (revision 656c8ece0af7d784f545535ee1ccf9bb0e43cd63) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateStack.qml (.../PreTreatmentCreateStack.qml) (revision 9b99693be1aaf7306272f37e614b52c7085bcf44) @@ -50,7 +50,15 @@ _pretreatmentPatientID.setFocus() } + function clear() { + _pretreatmentPatientID.clear() + _pretreatmentCreate.clear() + } + PreTreatmentBase { id: _pretreatmentPatientID + function clear() { + vTreatmentCreate.patientID = "" + } function setFocus() { _pretreatmentPatientIDEntry.textInput.forceActiveFocus()