Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -r1286d74bd015276aab604808be2766136091c125 -r70d6ebddd11a5df068f059fd563a0c1d0b50a2a3 --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 1286d74bd015276aab604808be2766136091c125) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 70d6ebddd11a5df068f059fd563a0c1d0b50a2a3) @@ -31,31 +31,22 @@ stackView.initialItem : null enum StackStep { - Disconnection , + Disconnect , + Remove , Review , Disinfection } property var stepNames: [ - qsTr("Disconnection"), + qsTr("Disconnect" ), + qsTr("Remove" ), qsTr("Review" ), qsTr("Disinfection" ), ] property int stackStepIndex : 0 + readonly property bool isDisconnect : _root.stackStepIndex === PostTreatmentStack.StackStep.Disconnect - signal patientDisconnectionConfirm () - signal treatmentReviewConfirm () - signal disposablesRemovalConfirm () - signal disposablesRemovalBack () - - // TODO fix in post treatment - onPatientDisconnectionConfirm : { vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( ) } -// /* No wait for Rsp, so navigates => */ page( _treatmentReviewConfirm ) -// /* After navigation ask for Tx data */ vPostTreatmentAdjustmentTreatmentLog .doRequest( )} - onTreatmentReviewConfirm : { vPostTreatmentAdjustmentPatientDisconnectionConfirm .doConfirm( )} -// onDisposablesRemovalConfirm : vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( ) - onDisposablesRemovalBack : page( _treatmentReviewConfirm ) onVisibleChanged: { if (visible) { _mainMenu.hidden = true @@ -66,16 +57,24 @@ } } + function setPage(vPage, vCondition) { + _root.stackStepIndex = vPage.stepIndex + page( vPage , vCondition) + } + function confirmClicked() { switch ( _root.stackStepIndex ) { - case PostTreatmentStack.Disconnection: - _root.patientDisconnectionConfirm() + case PostTreatmentStack.Disconnect: + _postTreatmentDisconnectStack.continueClicked() break + case PostTreatmentStack.Remove: + vPostTreatmentAdjustmentDisposablesRemovalConfirm.doConfirm() + break case PostTreatmentStack.Review: - _root.treatmentReviewConfirm() + setPage( _postTreatmentDisinfection ) break case PostTreatmentStack.Disinfection: - _root.disposablesRemovalConfirm() + // Skip button - go back to standby -- Finish Treatment break default: break @@ -84,30 +83,46 @@ function backClicked() { switch ( _root.stackStepIndex ) { - case PostTreatmentStack.Disconnection: + case PostTreatmentStack.Disconnect: + _postTreatmentDisconnectStack.backClicked() break - case PostTreatmentStack.Review: - break case PostTreatmentStack.Disinfection: - _root.disposablesRemovalBack () + setPage( _postTreatmentReview) break + case PostTreatmentStack.Remove: + case PostTreatmentStack.Review: default: break } } function confirmButtonText() { switch ( _root.stackStepIndex ) { - case PostTreatmentStack.Disconnection: - return qsTr("Auto Eject") + case PostTreatmentStack.Disconnect: case PostTreatmentStack.Review: - return qsTr("NEXT") + return qsTr("Continue") + case PostTreatmentStack.Remove: + return qsTr("Auto Eject") case PostTreatmentStack.Disinfection: + return qsTr("Skip") default: - return qsTr("CONFIRM") + return qsTr("Next") } } + function backEnabled() { + switch ( _root.stackStepIndex ) { + case PostTreatmentStack.Disconnect: + return _postTreatmentDisconnectStack.backEnabled() + case PostTreatmentStack.Remove: + case PostTreatmentStack.Review: // fallthrough + return false + case PostTreatmentStack.Disinfection: + default: + return true + } + } + StepNavigationTitleBar { id: _titleBar stepIndex : _root.stackStepIndex anchors { @@ -119,57 +134,32 @@ } confirmText.text: confirmButtonText() confirmVisible : true - backVisible : stackStepIndex === PostTreatmentStack.Disinfection + backVisible : _root.backEnabled() width : _root.width stepNames : _root.stepNames - onBackClicked : _root.backClicked() - onConfirmClicked: _root.confirmClicked() - } - ExportButton { id: _exportButton - isSmall : true - anchors.top : parent.top - anchors.left : parent.left - visible : stackStepIndex === PostTreatmentStack.Review - enabled : vPostTreatmentAdjustmentTreatmentLog.isIdle && _GuiView.usbIsReady && !_GuiView.exportRunning - onClicked : vPostTreatmentAdjustmentTreatmentLog.doExport() - } + subStepIndex : isDisconnect ? _postTreatmentDisconnectStack.subStepIndex + 1 : 0 - USBButton { id: _usbButton - anchors.top : _exportButton.top - anchors.left : _exportButton.right - anchors.leftMargin: Variables.minVGap - enabled : _GuiView.usbIsReady && !_GuiView.exportRunning - visible : stackStepIndex === PostTreatmentStack.Review - } + currentStep : { + let arr =Array(stepNames.length).fill(false) + arr[PostTreatmentStack.Disconnect] = isDisconnect + return arr + } - PostTreatmentBase { id: _patientDisconnectionConfirm - objectName :"_patientDisconnectionConfirm" - instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnection } - } - - PostTreatmentReview { id: _treatmentReviewConfirm - objectName :"_treatmentReviewConfirm" - instructionBased : false - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review } - - onItemClicked : { - _detailTest.title.text = itemsText[vIndex] - push(_detailTest) + subSteps : { + let arr =Array(stepNames.length).fill(0) + arr[ PostTreatmentStack.Disconnect] = PostTreatmentDisconnectStack.Step.Count + return arr } - } - PostTreatmentBase { id: _detailTest - objectName :"_detailTest" - onBackClicked : pop() + onBackClicked : _root.backClicked() + onConfirmClicked: _root.confirmClicked() } - PostTreatmentBase { id: _disposablesRemovalConfirm - objectName :"_disposablesRemovalConfirm" - instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disinfection } - } + PostTreatmentDisconnectStack { id: _postTreatmentDisconnectStack; stepIndex: PostTreatmentStack.Disconnect } + PostTreatmentBase { id: _postTreatmentRemove; stepIndex: PostTreatmentStack.Remove; instructionBased: true } + PostTreatmentReview { id: _postTreatmentReview; stepIndex: PostTreatmentStack.Review } + PostTreatmentBase { id: _postTreatmentDisinfection; stepIndex: PostTreatmentStack.Disinfection } // connections Connections { target: vPostTreatmentStates @@ -180,38 +170,34 @@ } Connections { target: vTDOpMode - function onPostTreatmentChanged ( vValue ) { page( _patientDisconnectionConfirm , vValue )} + function onPostTreatmentChanged ( vValue ) { setPage( _postTreatmentDisconnectStack , vValue )} } - Connections { target: vPostTreatmentAdjustmentPatientDisconnectionConfirm - function onAdjustmentTriggered ( vValue ) { - if ( vPostTreatmentAdjustmentPatientDisconnectionConfirm.adjustment_Accepted ) { - _treatmentReviewConfirm.reasonText = "" - page( _disposablesRemovalConfirm ) - - } else { - _treatmentReviewConfirm.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() - } - } + // Disconnect stack + Connections { target: _postTreatmentDisconnectStack + function onGoToNextStep () { setPage ( _postTreatmentRemove )} } + // Auto - Eject Connections { target: vPostTreatmentAdjustmentDisposablesRemovalConfirm function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentDisposablesRemovalConfirm.adjustment_Accepted ) { - _patientDisconnectionConfirm.reasonText = "" - page( _treatmentReviewConfirm ) + _postTreatmentRemove.reasonText = "" + vPostTreatmentAdjustmentTreatmentLog.doRequest() + setPage( _postTreatmentReview ) } else { - _patientDisconnectionConfirm.reasonText = vPostTreatmentAdjustmentDisposablesRemovalConfirm.text() + _postTreatmentRemove.reasonText = vPostTreatmentAdjustmentDisposablesRemovalConfirm.text() } } } + // Treatment Review Connections { target: vPostTreatmentAdjustmentTreatmentLog function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentTreatmentLog.adjustment_Accepted ) { - _treatmentReviewConfirm.reasonText = "" + _postTreatmentReview.reasonText = "" } else { - _treatmentReviewConfirm.reasonText = vPostTreatmentAdjustmentTreatmentLog.text() + _postTreatmentReview.reasonText = vPostTreatmentAdjustmentTreatmentLog.text() } } }