Index: sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -rd0ae5a039ca37630c0911e1f9041b93b980e0431 --- sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/gui/qml/pages/treatment/sections/TreatmentSaline.qml (.../TreatmentSaline.qml) (revision d0ae5a039ca37630c0911e1f9041b93b980e0431) @@ -7,7 +7,7 @@ * * \file TreatmentSaline.qml * \author (last) Behrouz NematiPour - * \date (last) 13-Aug-2020 + * \date (last) 16-Oct-2020 * \author (original) Behrouz NematiPour * \date (original) 10-Aug-2020 * @@ -27,19 +27,27 @@ * \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 - readonly property string textAfterStarted : qsTr("STOP BOLUS" ) - readonly property string textAfterStopped : qsTr("START BOLUS") - readonly property string textAfterDisabled : qsTr("START BOLUS") // it stays at START but should be disabled. - readonly property string mesgAfterDisabled : qsTr("Maximum cumulative saline bolus volume delivered") - readonly property string mesgRejectReason : vTreatmentAdjustmentSaline.adjustment_ReasonText + 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 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.isStarted ? textAfterStarted : textAfterStopped + hasArrow : false + isTouchable : ! ( _root.isDisabled || _root.isWaitPump ) + buttonText : ( _root.isDisabled || _root.isWaitPump ) ? _private.textStart : + _root.isStarted ? _private.textStop : + _private.textStart title : qsTr("SALINE BOLUS") unit : Variables.unitTextSaline @@ -55,6 +63,10 @@ notification { visible : true - text : isDisabled ? mesgAfterDisabled : mesgRejectReason + text : isIdle ? "" : + isDisabled ? _private.mesgDisabled : + isWaitPump ? _private.mesgWaitForPump : + isStarted ? _private.mesgRejectReason : + "" } }