Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r3702984c4572607055ab3ede4d45792e74595991 -r6581def57942b1c1ef56a2f2feb74559946517b9 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 3702984c4572607055ab3ede4d45792e74595991) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 6581def57942b1c1ef56a2f2feb74559946517b9) @@ -7,7 +7,7 @@ * * \file TreatmentStack.qml * \author (last) Behrouz NematiPour - * \date (last) 09-Feb-2021 + * \date (last) 28-Feb-2021 * \author (original) Behrouz NematiPour * \date (original) 27-Jan-2020 * @@ -20,7 +20,7 @@ import "qrc:/globals" import "qrc:/components" import "qrc:/pages/treatment/adjustments" -import "qrc:/pages/pretreatment/create" +import "qrc:/pages/pretreatment" import "qrc:/pages/posttreatment" /*! @@ -32,51 +32,38 @@ StackItem { id : _root objectName: "TreatmentStack" - stackView.initialItem : _treatmentHome + stackView.initialItem : null // ultrafiltration state information bar properties readonly property bool isUFPaused : vHDTreatmentStates.ufPaused - readonly property bool isUFOff : vHDTreatmentStates.ufOff readonly property bool isUFRunning : vHDTreatmentStates.ufRunning - readonly property bool isUFCompleted : vHDTreatmentStates.ufCompleted - readonly property string ufInfoImageSource : isUFPaused ? "qrc:/images/iPauseGray" : - isUFOff ? "qrc:/images/iOffGray" : - isUFCompleted ? "qrc:/images/iDone" : "" - readonly property string ufInfoText : isUFPaused ? qsTr("Ultrafiltration is paused" ) : - isUFOff ? qsTr("Ultrafiltration is off" ) : - isUFCompleted ? qsTr("Ultrafiltration is completed" ) : "" - readonly property string ufInfoTextColor : isUFPaused ? "gray" : - isUFOff ? "gray" : - isUFCompleted ? "lightgray" : "" + readonly property string ufInfoImageSource : isUFPaused ? "qrc:/images/iPauseGray" : "" + readonly property string ufInfoText : isUFPaused ? qsTr("Ultrafiltration Paused" ) : "" + readonly property string ufInfoTextColor : isUFPaused ? "gray" : "" readonly property bool isSBInProgress : ( vHDTreatmentStates.sbRunning || vHDTreatmentStates.sbWaitPump ) + signal backClicked + // Components - MainMenu { id: _treatmentMenu + MainMenu { id: _treatmentMenu y : Variables.mainMenuHeight * -1 position : MainMenu.Position.Top hidden : true titles : [ qsTr("Back") , qsTr("Treatment") , qsTr("Trending") , qsTr("Settings") ] spacing : 20 leftPdding : 20 - partitionWidth : 100 // Todo Important : max width should be the width for all + partitionWidth : 100 // Todo Important : max width should be the width for all bottons hasRightText : true hasLogo : true } - // Blood Prime - PostTreatmentBloodPrime { id: _postTreatmentBloodPrime } // only one page, no stack for now. - PostTreatmentRinsebackStack { id: _postTreatmentRinsebackStack } - PostTreatmentRecirculateStack { id: _postTreatmentRecirculateStack } - PostTreatmentEndStack { id: _postTreatmentEndStack } - TreatmentHome { id: _treatmentHome - onTreatmentStarted : push( _treatmentStart ) - onTreatmentCreated : vTreatmentCreate.doSelectParameters() - } - - TreatmentStart { id: _treatmentStart - onBackClicked : pop( _treatmentHome ) + TreatmentUltrafiltrationItem{ id: _treatmentUltrafiltrationItem } + TreatmentStart { id: _treatmentStart + onBackClicked : { + _root.backClicked() + } onSectionFlowClicked : { _treatmentAdjustmentFlow.open() } @@ -91,34 +78,10 @@ _treatmentAdjustmentDuration.open() } onSectionUltrafiltrationClicked: { - if ( isUFRunning ) { - _treatmentAdjustmentUltrafiltrationStart .open() - } else { - _treatmentAdjustmentUltrafiltrationPaused.open() - } + _treatmentUltrafiltrationItem.open() } } - PreTreatmentCreate { id: _pretreatmentCreate - onBackClicked : {vTreatmentCreate.doCancelSelectingParameters() } - onContinueClicked : {vTreatmentCreate.doFinishedCreate(); } - } - - PreTreatmentConfirm { id: _pretreatmentConfirm - onBackClicked : {vTreatmentCreate.doCancelConfirmParameters() } - onConfirmClicked : {vTreatmentCreate.doFinishedConfirm(); } - } - - PreTreatmentPrime { id: _pretreatmentPrime - onBackClicked : {vTreatmentCreate.doRequestPop() } - onContinueClicked : {vTreatmentCreate.doFinishedPrime(); } - } - - PreTreatmentUltrafiltration { id: _pretreatmentUltrafiltration - onBackClicked : {vTreatmentCreate.doRequestPop() } - onStartClicked : {vTreatmentAdjustmentUltrafiltrationInit.doAdjustment(_pretreatmentUltrafiltration.ufVolume) } - } - //// Treatment Adjustment Dialogs TreatmentAdjustmentFlow { id: _treatmentAdjustmentFlow onCloseClicked : close() @@ -156,58 +119,6 @@ onConfirmClicked : vTreatmentAdjustmentDuration.doAdjustment(durationValue) } - TreatmentAdjustmentUltrafiltrationStart { id: _treatmentAdjustmentUltrafiltrationStart - onCloseClicked : close() - onPauseClicked : { - // send pause to HD and wait. - // if accepted close() - // not accepted show error in notification - vTreatmentAdjustmentUltrafiltrationState.doPause() - } - } - - TreatmentAdjustmentUltrafiltrationPaused { id: _treatmentAdjustmentUltrafiltrationPaused - onCloseClicked : close() - onEditClicked : { - close() - _treatmentAdjustmentUltrafiltrationEdit.reset() // reset the slider to minimum value position - _treatmentAdjustmentUltrafiltrationEdit.open() - } - onResumeClicked : { - // send resume to HD and wait. - // if accepted close() - // not accepted show error in notification - vTreatmentAdjustmentUltrafiltrationState.doResume() - } - } - - TreatmentAdjustmentUltrafiltrationEdit { id: _treatmentAdjustmentUltrafiltrationEdit - onBackClicked : { - close() - _treatmentAdjustmentUltrafiltrationPaused.open() - } - onNextClicked : { - // send Volume to HD and wait. - // if accepted close() - // not accepted show error in notification - vTreatmentAdjustmentUltrafiltrationEdit.doAdjustment(vVolume) - } - } - - TreatmentAdjustmentUltrafiltrationConfirm { id: _treatmentAdjustmentUltrafiltrationConfirm - onBackClicked : { - close() - _treatmentAdjustmentUltrafiltrationEdit.open () - } - onConfirmRateClicked : { - vTreatmentAdjustmentUltrafiltrationConfirm.doOptionRate(vVolume) - } - onConfirmDurationClicked: { - vTreatmentAdjustmentUltrafiltrationConfirm.doOptionDuration(vVolume) - } - } - - // ---------- Manages Responses ---------- Connections { target: vTreatmentAdjustmentDuration onAdjustmentTriggered : { @@ -221,71 +132,6 @@ } } - Connections { target: vTreatmentAdjustmentUltrafiltrationInit - onAdjustmentTriggered : { - // the maximum ultrafiltration volume has to be set/revert regardless - vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentUltrafiltrationInit.volume - _pretreatmentUltrafiltration.ufVolume = vTreatmentAdjustmentUltrafiltrationInit.volume - // but only if it has been accepted it will navigate - if (vTreatmentAdjustmentUltrafiltrationInit.adjustment_Accepted) { - vTreatmentCreate.doStartTreatment() - } - else { - _pretreatmentUltrafiltration.reasonText = vTreatmentAdjustmentUltrafiltrationInit.text() - } - } - } - - Connections { target: vTreatmentAdjustmentUltrafiltrationState - onAdjustmentTriggered : { - if ( vTreatmentAdjustmentUltrafiltrationState.adjustment_Accepted ) { - if (vHDTreatmentStates.ufPaused) { // handle screen regarding current accepted - _treatmentAdjustmentUltrafiltrationStart .close() - _treatmentAdjustmentUltrafiltrationPaused.open () - } else { - _treatmentAdjustmentUltrafiltrationPaused.close() - } - } - else { - if (vHDTreatmentStates.ufRunning) { // handle error messages regarding current accepted - _treatmentAdjustmentUltrafiltrationStart.notificationText = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText - } else { - _treatmentAdjustmentUltrafiltrationPaused.notificationText = vTreatmentAdjustmentUltrafiltrationState.adjustment_ReasonText - } - } - } - } - - Connections { target: vTreatmentAdjustmentUltrafiltrationEdit - onAdjustmentTriggered : { - if (vTreatmentAdjustmentUltrafiltrationEdit.adjustment_Accepted) { - _treatmentAdjustmentUltrafiltrationConfirm.ultrafiltrationVolume = vTreatmentAdjustmentUltrafiltrationEdit.volume - _treatmentAdjustmentUltrafiltrationConfirm.treatmentDuration = vTreatmentAdjustmentUltrafiltrationEdit.duration - _treatmentAdjustmentUltrafiltrationConfirm.treatmentDurationDiff = vTreatmentAdjustmentUltrafiltrationEdit.durationDiff - _treatmentAdjustmentUltrafiltrationConfirm.ultrafiltrationRate = vTreatmentAdjustmentUltrafiltrationEdit.rate - _treatmentAdjustmentUltrafiltrationConfirm.ultrafiltrationRateDiff = vTreatmentAdjustmentUltrafiltrationEdit.rateDiff - _treatmentAdjustmentUltrafiltrationConfirm.ultrafiltrationRateOld = vTreatmentAdjustmentUltrafiltrationEdit.rateOld - - _treatmentAdjustmentUltrafiltrationEdit .close() - _treatmentAdjustmentUltrafiltrationConfirm.reset() - _treatmentAdjustmentUltrafiltrationConfirm.open () - } else { - _treatmentAdjustmentUltrafiltrationEdit.notification.text = vTreatmentAdjustmentUltrafiltrationEdit.text() - } - } - } - - Connections { target: vTreatmentAdjustmentUltrafiltrationConfirm - onAdjustmentTriggered : { - if (vTreatmentAdjustmentUltrafiltrationConfirm.adjustment_Accepted) { - vTreatmentUltrafiltration.maximum = vTreatmentAdjustmentUltrafiltrationConfirm.volume - _treatmentAdjustmentUltrafiltrationConfirm.close() - } else { - _treatmentAdjustmentUltrafiltrationConfirm.notification.text = vTreatmentAdjustmentUltrafiltrationConfirm.text() - } - } - } - Connections { target: vTreatmentAdjustmentPressuresLimits onAdjustmentTriggered : { // values have to be update even when rejected HD is reverting back the values. @@ -304,34 +150,26 @@ } } - Connections { target: vTreatmentCreate - onShowCreate : { push(_pretreatmentCreate) } - onShowConfirm : { push(_pretreatmentConfirm) } - onShowPrime : { push(_pretreatmentPrime) } - onShowBegin : { push(_pretreatmentUltrafiltration) } - onPop : { pop() } - onShowTreatmentStart : { push(_treatmentStart) } + Connections { target: vHDOperationMode + // The initail screen should be the Blood Prime, since that one is the earlier state in the list. + // also since it is being used in two stacks In-Treatment and also in End-Treatmet is has been defined in the MainStack. + onInTreatmentChanged : { page( _postTreatmentBloodPrime , vinTreatment )} } - // the back is more flixible regarding our current design - // and it's easier(or may not need) to modify later if required. - // and is more optimized and will never leave screen empty - // also with what ever order they have been push with the reverse/correct animation will be poped or pushed. - Connections { target: vHDTreatmentStates - // Blood Prime - onTxBloodPrimeChanged : { if ( vtxBloodPrime ) { page( _postTreatmentBloodPrime )}} - onBpRampChanged : { if ( vbpRamp ) { /* No action defined yet */ }} + Connections { target: _postTreatmentBloodPrime + onVisibleChanged: { + if (_postTreatmentBloodPrime.visible) { + _treatmentMenu.hidden = true + } + } + } + Connections { target: vHDTreatmentStates // in-Treatmet - onTxDialysisChanged : { if ( vtxDialysis ) { page( _treatmentStart )}} + onTxDialysisChanged : { page( _treatmentStart , vtxDialysis )} + } - onTxRinsebackChanged : { if ( vtxRinseback ) { page( _postTreatmentRinsebackStack )}} - onTxRecirculateChanged : { if ( vtxRecirculate ) { page( _postTreatmentRecirculateStack )}} - onTxEndChanged : { if ( vtxEnd ) { page( _postTreatmentEndStack )}} - - // Treatment Stop - onTxStopChanged : { if ( vtxStop ) { page( _treatmentStart )}} - onTsRecirculateChanged : { if ( vtsRecirculate ) { /* No action defined yet */ }} - onTsRecirculateNoChanged: { if ( vtsRecirculateNo ) { /* No action defined yet */ }} + Connections { target: _mainHome + onStartTreatment : { page ( _treatmentStart )} } }