Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml =================================================================== diff -u -r95c671ab7037af055db551456a719ff67bf10262 -r44a85c96ab55e424866ec4cca0270aa218355f82 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision 95c671ab7037af055db551456a719ff67bf10262) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentFlow.qml (.../TreatmentAdjustmentFlow.qml) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) @@ -1,15 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n - * - * \file TreatmentAdjustmentFlow.qml - * \date 2020/03/18 - * \author Behrouz NematiPour - * + * \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 TreatmentAdjustmentFlow.qml + * \author (last) Behrouz NemaiPour + * \date (last) 18-Jun-2020 + * \author (original) Behrouz NematiPour + * \date (original) 22-Mar-2020 + * */ // Qt @@ -26,6 +27,7 @@ * To adjust the treatment blood/dialysate flow */ TreatmentAdjustmentBase { id: _root + contentItem.objectName: "TreatmentAdjustmentFlow" //SquishQt testability property alias bloodFlowRateValue : _bloodFlowSlider.value property alias bloodFlowRateMinimum : _bloodFlowSlider.minimum @@ -42,21 +44,36 @@ titleText: qsTr("FLOWS") + // Note : The slider values are not bound and will be set by user freely + // and will be used to be sent for adjustment + // if accepted will not changed and + // if rejected then will be reset to the values passed by adjustment response + + // reset the flow values to the current flow values + function currentFlows() { + _bloodFlowSlider.value = vTreatmentBloodFlow. bloodFlow_FlowSetPoint + _dialysateFlowSlider.value = vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint + } + + // reset the flow values to the values of the adjustment response + function resetFlows() { + _bloodFlowSlider.value = vTreatmentAdjustmentFlows. bloodFlow_FlowSetPoint + _dialysateFlowSlider.value = vTreatmentAdjustmentFlows.dialysateFlow_FlowSetPoint + } + onAboutToShow: { // TODO : When Testing data on Setting screen is removed // This needs to be moved into the Treatment______.qml - bloodFlowRateValue = vTreatmentBloodFlow. bloodFlow_FlowSetPoint - dialysateFlowRateValue = vTreatmentDialysateFlow.dialysateFlow_FlowSetPoint + currentFlows() } - Connections { target: vTreatmentAdjustmentsResponse - onAdjustmentFlowTriggered: { - if ( vTreatmentAdjustmentsResponse.adjustment_Accepted ) { + Connections { target: vTreatmentAdjustmentFlows + onAdjustmentTriggered: { + if ( vTreatmentAdjustmentFlows.adjustment_Accepted ) { accept() } else { - _bloodFlowSlider .value = vTreatmentAdjustmentsResponse. bloodFlow_FlowSetPoint; - _dialysateFlowSlider.value = vTreatmentAdjustmentsResponse.dialysateFlow_FlowSetPoint; - notificationText = vTreatmentAdjustmentsResponse.text(); + resetFlows() + notification.text = vTreatmentAdjustmentFlows.text() } } } @@ -80,8 +97,8 @@ anchors.verticalCenter: parent.verticalCenter width : 600 height : 5 - minimum : 100 - maximum : 500 + minimum : Variables.bloodFlowMin + maximum : Variables.bloodFlowMax unit : _root.unit step : Variables.bloodFlowResolution ticks : true @@ -108,8 +125,8 @@ anchors.verticalCenter: parent.verticalCenter width : 600 height : 5 - minimum : 100 - maximum : 600 + minimum : vTreatmentRanges.treatmentRanges_Dialysate_Flow_Min + maximum : vTreatmentRanges.treatmentRanges_Dialysate_Flow_Max unit : _root.unit step : Variables.dialysateFlowResolution ticks : true