Index: sources/gui/qml/pages/endtreatment/EndTreatmentRecirculateStack.qml =================================================================== diff -u -rf68b226e67eb500758ee94fe015df48931240013 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/pages/endtreatment/EndTreatmentRecirculateStack.qml (.../EndTreatmentRecirculateStack.qml) (revision f68b226e67eb500758ee94fe015df48931240013) +++ sources/gui/qml/pages/endtreatment/EndTreatmentRecirculateStack.qml (.../EndTreatmentRecirculateStack.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2021-2022 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 EndTreatmentRecirculateStack.qml - * \author (last) Behrouz NematiPour - * \date (last) 07-Oct-2021 + * \author (last) Vy + * \date (last) 17-May-2023 * \author (original) Behrouz NematiPour * \date (original) 11-Apr-2021 * @@ -25,88 +25,115 @@ * \brief the end treatment recirculate stack screen */ StackItem { id: _root - objectName: "_EndTreatmentRecirculateStack" + objectName: "_recirculateRecirculateStack" stackView.initialItem : null property int stackStepIndex : 0 signal reconnectClicked () - signal recirculateConfirmClicked() + signal confirmDisconnectClicked () + signal confirmReconnectClicked () signal recirculateBackClicked () signal treatmentEndClicked () - onReconnectClicked : vTreatmentAdjustmentRecirculate.doReconnect () //84.0 - onRecirculateConfirmClicked : vTreatmentAdjustmentRecirculate.doConfirm () //84.1 - onRecirculateBackClicked : vTreatmentAdjustmentRecirculate.doResume () //84.2 - onTreatmentEndClicked : vTreatmentAdjustmentRecirculate.doTreatmentEnd () //84.3 + onReconnectClicked : vTreatmentAdjustmentRecirculate.doReconnect () //84.0 + onConfirmReconnectClicked : vTreatmentAdjustmentRecirculate.doConfirmReconnect () //84.1 + onRecirculateBackClicked : vTreatmentAdjustmentRecirculate.doResume () //84.2 + onTreatmentEndClicked : vTreatmentAdjustmentRecirculate.doTreatmentEnd () //84.3 + onConfirmDisconnectClicked : vTreatmentAdjustmentRecirculate.doConfirmDisconnect () //84.4 - // Recirculate - EndTreatmentBase { id : _endTreatmentRecirculate - title.text : qsTr("Recirculate") - instructionBased : true - hasTimeout : vTreatmentRecirculate .timeoutTotal - timeoutValue : vTreatmentRecirculate .timeoutCountDown * 60 + readonly property bool timeoutTotal : vTreatmentRecirculate .timeoutTotal + readonly property int timeoutCountdown : vTreatmentRecirculate .timeoutCountDown * 60 + readonly property bool treatmentTimeLeft : true // vTreatmentTime .time_IsLeft // regarding the conversation with Sean (04/23/2023). - footer { - width : parent.width - height : Variables.touchRectHeight - } + component ButtonBackToRecirculate : TouchRect { + text.text : qsTr("BACK TO RECIRCULATE") + onClicked : recirculateBackClicked() + } - FooterStatic { - childrenWidth : 300 - anchors.fill : parent.footer - children : [ - Item { }, - TouchRect { - text.text : qsTr("RECONNECT") - isDefault : true - onClicked : reconnectClicked() - }, - TouchRect { - visible : vTreatmentTime .time_IsLeft - text.text : qsTr("END TREATMENT") - onClicked : treatmentEndClicked() - } - ] - } + component ButtonEndTreatment : TouchRect { + visible : treatmentTimeLeft + text.text : qsTr("END TREATMENT") + onClicked : treatmentEndClicked() } - EndTreatmentBase { id : _endTreatmentReconnect - title.text : qsTr("Reconnect") - instructionBased : true - header.confirmVisible : vTreatmentTime .time_IsLeft - hasTimeout : vTreatmentRecirculate .timeoutTotal - timeoutValue : vTreatmentRecirculate .timeoutCountDown * 60 - onConfirmClicked : recirculateConfirmClicked() + component ButtonReconnect : TouchRect { + text.text : qsTr("RESUME TREATMENT") + isDefault : true + onClicked : reconnectClicked() + } + component RecirculateBase : EndTreatmentBase { + property alias footerButtons : _footer.children + property bool confirmVisible : false + + header.confirmVisible : confirmVisible + instructionBased : true + hasTimeout : timeoutTotal + timeoutValue : timeoutCountdown + footer { - width : parent.width - height : Variables.touchRectHeight + width : parent.width + height : Variables.touchRectHeight } - FooterStatic { - childrenWidth : 300 - anchors.fill : parent.footer - children : [ - Item { }, - TouchRect { - visible : vTreatmentTime .time_IsLeft - text.text : qsTr("BACK TO RECIRCULATE") - onClicked : recirculateBackClicked() - }, - TouchRect { - visible : vTreatmentTime .time_IsLeft - text.text : qsTr("END TREATMENT") - onClicked : treatmentEndClicked() - } - ] + FooterStatic { id: _footer + childrenWidth : 300 + anchors.fill : parent.footer } } + // Disconnect + RecirculateBase { id: _recirculateDisconnect + title.text : qsTr("Recirculate Disconnect") + confirmVisible : true + onConfirmClicked : confirmDisconnectClicked() + footerButtons : [ + ButtonEndTreatment {}, + Item {}, // button placeholder to align the buttons + Item {} // button placeholder to align the buttons + ] + } + + // Recirculate + RecirculateBase { id: _recirculateRecirculate + title.text : qsTr("Recirculate") + footerButtons : [ + ButtonEndTreatment {}, + ButtonReconnect {}, + Item {} // button placeholder to align the buttons + ] + } + + // Stopped + RecirculateBase { id: _recirculateStopped + title.text : qsTr("Recirculate Stopped") + footerButtons : [ + ButtonEndTreatment {}, + ButtonBackToRecirculate {}, + Item {} // button placeholder to align the buttons + + ] + } + + // Reconnect + RecirculateBase { id: _recirculateReconnect + title.text : qsTr("Recirculate Reconnect") + confirmVisible : true + onConfirmClicked : confirmReconnectClicked() + footerButtons : [ + ButtonEndTreatment {}, + ButtonBackToRecirculate {}, + Item {} // button placeholder to align the buttons + ] + } + Connections { target: vHDTreatmentStates - function onRcStartedChanged ( vValue ) { page( _endTreatmentRecirculate , vValue )} - function onRcStoppedChanged ( vValue ) { page( _endTreatmentReconnect , vValue )} + function onRcDisconnectChanged ( vValue ) { page( _recirculateDisconnect , vValue )} + function onRcStartedChanged ( vValue ) { page( _recirculateRecirculate , vValue )} + function onRcStoppedChanged ( vValue ) { page( _recirculateStopped , vValue )} + function onRcReconnectChanged ( vValue ) { page( _recirculateReconnect , vValue )} } Connections { target: vTreatmentAdjustmentRecirculate @@ -115,8 +142,10 @@ // since the rejection reason will be cleared by each trasition // so it's fine to set all at the same time // and let them cleared for their own message when each get visible. - _endTreatmentRecirculate .reasonText = vTreatmentAdjustmentRecirculate.text(); - _endTreatmentReconnect .reasonText = vTreatmentAdjustmentRecirculate.text(); + _recirculateDisconnect .reasonText = vTreatmentAdjustmentRecirculate.text(); + _recirculateRecirculate .reasonText = vTreatmentAdjustmentRecirculate.text(); + _recirculateStopped .reasonText = vTreatmentAdjustmentRecirculate.text(); + _recirculateReconnect .reasonText = vTreatmentAdjustmentRecirculate.text(); } } }