Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -r7ad92639d1b70bd07c0bb9ea7ae467b87d847219 -rd82802819678ccdb5d2cf480cf06071c4b4b4197 --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 7ad92639d1b70bd07c0bb9ea7ae467b87d847219) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision d82802819678ccdb5d2cf480cf06071c4b4b4197) @@ -44,9 +44,8 @@ qsTr("Disinfection" ), ] - property int stackStepIndex : 0 + property int stackStepIndex : 0 readonly property bool isDisconnect : _root.stackStepIndex === PostTreatmentStack.StackStep.Disconnect - readonly property bool isReview : _root.stackStepIndex === PostTreatmentStack.StackStep.Review onVisibleChanged: { if (visible) { @@ -58,6 +57,11 @@ } } + function setPage(vPage, vCondition) { + _root.stackStepIndex = vPage.stepIndex + page( vPage , vCondition) + } + function confirmClicked() { switch ( _root.stackStepIndex ) { case PostTreatmentStack.Disconnect: @@ -67,7 +71,7 @@ vPostTreatmentAdjustmentDisposablesRemovalConfirm.doConfirm() break case PostTreatmentStack.Review: - page( _postTreatmentDisinfection ) + setPage( _postTreatmentDisinfection ) break case PostTreatmentStack.Disinfection: // Skip button - go back to standby -- Finish Treatment @@ -83,7 +87,7 @@ _postTreatmentDisconnectStack.backClicked() break case PostTreatmentStack.Disinfection: - page(_postTreatmentReview) + setPage( _postTreatmentReview) break case PostTreatmentStack.Remove: case PostTreatmentStack.Review: @@ -150,56 +154,13 @@ onBackClicked : _root.backClicked() onConfirmClicked: _root.confirmClicked() - - Row { id: _qrRow - spacing : Variables.defaultMargin - visible : _root.isReview - - anchors { - left : _titleBar.left - leftMargin : Variables.defaultMargin * 2 - top : _titleBar.top - topMargin : Variables.defaultMargin * 2 - } - - QRCode { id: _qrCode - anchors.verticalCenter : parent.verticalCenter - anchors.verticalCenterOffset: -5 - qrcode : vPostTreatmentAdjustmentTreatmentLog.txCode - clear : ! _root.visible - } - - Text { id: _txCodeText - anchors.bottom : _qrCode.bottom - text : vPostTreatmentAdjustmentTreatmentLog.txCode ? qsTr("Tx Code: ") + vPostTreatmentAdjustmentTreatmentLog.txCode : " " - color : "#DBE9FA" - font.pixelSize : Fonts.fontPixelButton - } - } } - PostTreatmentDisconnectStack { id: _postTreatmentDisconnectStack - objectName : "_postTreatmentDisconnectStack" - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnect; initStack() } - } + PostTreatmentBase { id: _patientDisconnectionConfirm; stepIndex: PostTreatmentStack.Disconnect; instructionBased: true } + PostTreatmentBase { id: _postTreatmentRemove; stepIndex: PostTreatmentStack.Remove; instructionBased: true } + PostTreatmentReview { id: _postTreatmentReview; stepIndex: PostTreatmentStack.Review } + PostTreatmentBase { id: _postTreatmentDisinfection; stepIndex: PostTreatmentStack.Disinfection } - PostTreatmentBase { id: _postTreatmentRemove - objectName : "_postTreatmentRemove" - instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Remove; updateModel() } - } - - PostTreatmentReview { id: _postTreatmentReview - objectName : " _postTreatmentReview" - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review; - vPostTreatmentAdjustmentTreatmentLog.doRequest() } - } - - PostTreatmentDisinfection { id: _postTreatmentDisinfection - objectName :" _postTreatmentDisinfection" - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disinfection } - } - // connections Connections { target: vPostTreatmentStates function onDrainReservoirsChanged ( vValue ) { console.debug("drainReservoirs ", vValue )} @@ -209,7 +170,7 @@ } Connections { target: vTDOpMode - function onPostTreatmentChanged ( vValue ) { page( _postTreatmentDisconnectStack , vValue )} + function onPostTreatmentChanged ( vValue ) { setPage( _patientDisconnectionConfirm , vValue )} } // Disconnect stack @@ -222,7 +183,8 @@ function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentDisposablesRemovalConfirm.adjustment_Accepted ) { _postTreatmentRemove.reasonText = "" - page( _postTreatmentReview ) + vPostTreatmentAdjustmentTreatmentLog.doRequest() + setPage( _postTreatmentReview ) } else { _postTreatmentRemove.reasonText = vPostTreatmentAdjustmentDisposablesRemovalConfirm.text() }