Index: sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml =================================================================== diff -u -rb84d1c20f9bad35e1406bbc84cd70bfa8bef810f -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision b84d1c20f9bad35e1406bbc84cd70bfa8bef810f) +++ sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-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 TreatmentSaline.qml - * \author (last) Behrouz NematiPour - * \date (last) 13-Aug-2020 - * \author (original) Behrouz NematiPour - * \date (original) 10-Aug-2020 + * \file TreatmentSaline.qml + * \author (last) Vy + * \date (last) 18-May-2023 + * \author (original) Behrouz NematiPour + * \date (original) 10-Aug-2020 * */ @@ -27,36 +27,50 @@ * \brief Treatment Screen Saline Management section */ TreatmentFluid { id: _root - // comes from the response accepted - readonly property bool isStarted : vTreatmentAdjustmentSaline.isStarted - // comes from the broadcast Treatment States salineState field - readonly property bool isDisabled : vTreatmentAdjustmentSaline.isDisabled + readonly property bool isStarted : vHDTreatmentStates.sbRunning + readonly property bool isIdle : vHDTreatmentStates.sbIdle + // other that max saline bolus delivered, + // if saline started but still is waiting for pump the button is disabled so user won't tap multiple times. + readonly property bool isDisabled : vHDTreatmentStates.sbMaxReached + readonly property bool isWaitPump : vHDTreatmentStates.sbWaitPump QtObject { id: _private readonly property string textStart : qsTr("START BOLUS") readonly property string textStop : qsTr("STOP BOLUS" ) readonly property string textVolumeTarget : "(" + valueTarget + unit + ")" - readonly property string mesgAfterDisabled : qsTr("Maximum cumulative saline bolus volume delivered") + readonly property string mesgDisabled : qsTr("Maximum cumulative saline bolus volume delivered") + readonly property string mesgWaitForPump : "" // qsTr("Saline Bolus is starting") // Not sure if we shouls show any message at this point readonly property string mesgRejectReason : vTreatmentAdjustmentSaline.adjustment_ReasonText } - isTouchable : ! _root.isDisabled - buttonText : _root.isDisabled ? _private.textStart : _root.isStarted ? _private.textStop : _private.textStart + " " + _private.textVolumeTarget + hasArrow : false + isTouchable : false + buttonEnabled : ! ( _root.isDisabled || _root.isWaitPump ) + buttonText : ( _root.isDisabled || _root.isWaitPump ) ? _private.textStart : + _root.isStarted ? _private.textStop : + _private.textStart + + fluidProgressBarColor: _root.isStarted ? Colors.sliderHighlightColor : Colors.highlightProgressBar + title : qsTr("SALINE BOLUS") unit : Variables.unitTextSaline - valueTarget : vTreatmentSaline.target || vTreatmentAdjustmentSaline.target - valueCumulative: vTreatmentSaline.cumulative .toFixed(0) - valueDelivered : vTreatmentSaline.delivered .toFixed(0) + valueDecimal : Variables.salinePrecision + valueTarget : vTreatmentSaline.target || vTreatmentAdjustmentSaline.target + valueCumulative : vTreatmentSaline.cumulative + valueDelivered : vTreatmentSaline.delivered VTreatmentSaline { id: vTreatmentSaline } onClicked: { - vTreatmentAdjustmentSaline.doAdjustment() + if ( isIdle ) vTreatmentAdjustmentSaline.doStart() // IDLE + if ( isStarted ) vTreatmentAdjustmentSaline.doStop () // IN_PROGRESS } notification { visible : true - text : isDisabled ? _private.mesgAfterDisabled : _private.mesgRejectReason + text : isDisabled ? _private.mesgDisabled : + isWaitPump ? _private.mesgWaitForPump : + _private.mesgRejectReason } }