Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r76f632ce5a9039ae662d9a52286079b772f8ae7f -r3345651cca9723989785801ee25001dc3e4f28a1 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 76f632ce5a9039ae662d9a52286079b772f8ae7f) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 3345651cca9723989785801ee25001dc3e4f28a1) @@ -222,8 +222,10 @@ } } - PostTreatmentRinseback { id: _postTreatmentRinseback } - PostTreatmentRecirculate { id: _postTreatmentRecirculate } + PostTreatmentRinseback { id: _postTreatmentRinseback } + PostTreatmentRinsebackComplete { id: _postTreatmentRinsebackComplete } + PostTreatmentRecirculate { id: _postTreatmentRecirculate } + PostTreatmentComplete { id: _postTreatmentComplete } // ---------- Manages Responses ---------- Connections { target: vTreatmentAdjustmentDuration @@ -330,17 +332,34 @@ onShowTreatmentStart : { push(_treatmentStart) } } + // 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 onTxStartChanged: { - console.debug(" ----- onTxStartChanged") if ( vHDTreatmentStates.txStart ) { back( _treatmentStart ) } } + onTxDialysisEndChanged: { + if ( vHDTreatmentStates.txDialysisEnd ) { + // if Tx completed + // -> Rinseback + // -> End / Disconnect + // if Tx Stopped + // -> + back( _postTreatmentComplete ) + } + } + onTxRinsebackChanged: { if ( vHDTreatmentStates.txRinseback ) { - push( _postTreatmentRinseback ) + // it may be navigated from complete or stop alarm dialog, + // which in the later case it can't be replaced with main treatment + // since user is able to go back to main treament if it's not timed out. + back( _postTreatmentRinseback ) _treatmentMenu.hidden = true } } @@ -350,7 +369,7 @@ // application state by design is navigating always from Rinseback to recirculate // so always it is rinseback on top which has to be replaced by recirculate // also we never go back to rinseback from recirculate and will go back to blood priming - replace( _postTreatmentRecirculate ) + back( _postTreatmentRecirculate ) _treatmentMenu.hidden = true } }