Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -r4a2b83dcb56555861d2c741a8e8894e5b07e24bf -r7c12b8ce1964a37e856ebcae205f8b4ed19f3c6a --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 4a2b83dcb56555861d2c741a8e8894e5b07e24bf) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 7c12b8ce1964a37e856ebcae205f8b4ed19f3c6a) @@ -31,31 +31,37 @@ 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 + property int stackStepIndex : 0 + readonly property bool isDisconnect : _root.stackStepIndex === PostTreatmentStack.StackStep.Disconnect + readonly property bool isReview : _root.stackStepIndex === PostTreatmentStack.StackStep.Review - signal patientDisconnectionConfirm () - signal treatmentReviewConfirm () - signal disposablesRemovalConfirm () - signal disposablesRemovalBack () +// signal patientDisconnectionConfirm () +// signal treatmentReviewConfirm () +// signal disposablesRemovalConfirm () +// signal disposablesRemovalBack () + // TODO fix in post treatment - onPatientDisconnectionConfirm : { vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( ) } -// /* No wait for Rsp, so navigates => */ page( _treatmentReviewConfirm ) +// onPatientDisconnectionConfirm : { vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( ) } +// /* No wait for Rsp, so navigates => */ page( _postTreatmentReview ) // /* After navigation ask for Tx data */ vPostTreatmentAdjustmentTreatmentLog .doRequest( )} - onTreatmentReviewConfirm : { vPostTreatmentAdjustmentPatientDisconnectionConfirm .doConfirm( )} +// onTreatmentReviewConfirm : { vPostTreatmentAdjustmentPatientDisconnectionConfirm .doConfirm( )} // onDisposablesRemovalConfirm : vPostTreatmentAdjustmentDisposablesRemovalConfirm .doConfirm( ) - onDisposablesRemovalBack : page( _treatmentReviewConfirm ) +// onDisposablesRemovalBack : page( _postTreatmentReview ) + onVisibleChanged: { if (visible) { _mainMenu.hidden = true @@ -69,14 +75,17 @@ 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() + vPostTreatmentAdjustmentPatientDisconnectionConfirm.doConfirm() break case PostTreatmentStack.Disinfection: - _root.disposablesRemovalConfirm() + // Skip button - go back to standby -- Finish Treatment break default: break @@ -85,30 +94,47 @@ function backClicked() { switch ( _root.stackStepIndex ) { - case PostTreatmentStack.Disconnection: + case PostTreatmentStack.Disconnect: + _postTreatmentDisconnectStack.backClicked() break - case PostTreatmentStack.Review: - break case PostTreatmentStack.Disinfection: - _root.disposablesRemovalBack () + page( _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 { @@ -120,54 +146,77 @@ } confirmText.text: confirmButtonText() confirmVisible : true - backVisible : stackStepIndex === PostTreatmentStack.Disinfection + backVisible : _root.backEnabled() width : _root.width stepNames : _root.stepNames + + subStepIndex : isDisconnect ? _postTreatmentDisconnectStack.subStepIndex + 1 : 0 + + subSteps : { + let arr =Array(stepNames.length).fill(0) + arr[ PostTreatmentStack.Disconnect] = PostTreatmentDisconnectStack.Step.Count + return arr + } + 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() + Row { id: _qrRow + spacing : Variables.defaultMargin + visible : _root.isReview + + anchors { + left : _titleBar.left + top : _titleBar.top + topMargin : Variables.defaultMargin + } + + 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 + } + } + } - USBButton { id: _usbButton - anchors.top : _exportButton.top - anchors.left : _exportButton.right - anchors.leftMargin: Variables.minVGap - enabled : _GuiView.usbIsReady && !_GuiView.exportRunning - visible : stackStepIndex === PostTreatmentStack.Review + PostTreatmentDisconnectStack { id: _postTreatmentDisconnectStack + objectName : "_postTreatmentDisconnectStack" + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnect; initStack() } } - PostTreatmentBase { id: _patientDisconnectionConfirm - objectName :"_patientDisconnectionConfirm" + PostTreatmentBase { id: _postTreatmentRemove + objectName : "_postTreatmentRemove" instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnection } + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Remove; updateModel() } } - PostTreatmentReview { id: _treatmentReviewConfirm - objectName :"_treatmentReviewConfirm" - instructionBased : false - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review } + PostTreatmentReview { id: _postTreatmentReview + objectName : " _postTreatmentReview" + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review; + vPostTreatmentAdjustmentTreatmentLog.doRequest() } - onItemClicked : { - _detailTest.title.text = itemsText[vIndex] - push(_detailTest) - } +// onItemClicked : { +// _detailTest.title.text = itemsText[vIndex] +// push(_detailTest) +// } } - PostTreatmentBase { id: _detailTest - objectName :"_detailTest" - onBackClicked : pop() - } +// PostTreatmentBase { id: _detailTest +// objectName :"_detailTest" +// onBackClicked : pop() +// } - PostTreatmentBase { id: _disposablesRemovalConfirm - objectName :"_disposablesRemovalConfirm" + PostTreatmentBase { id: _postTreatmentDisinfection + objectName :" _postTreatmentDisinfection" instructionBased : true onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disinfection } } @@ -181,39 +230,50 @@ } Connections { target: vTDOpMode - function onPostTreatmentChanged ( vValue ) { page( _patientDisconnectionConfirm , vValue )} + function onPostTreatmentChanged ( vValue ) { page( _postTreatmentDisconnectStack , vValue )} } - Connections { target: vPostTreatmentAdjustmentPatientDisconnectionConfirm - function onAdjustmentTriggered ( vValue ) { - if ( vPostTreatmentAdjustmentPatientDisconnectionConfirm.adjustment_Accepted ) { - _treatmentReviewConfirm.reasonText = "" - page( _disposablesRemovalConfirm ) - } else { - _treatmentReviewConfirm.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() - } - } + // Disconnect + Connections { target: _postTreatmentDisconnectStack + function onGoToNextStep () { page ( _postTreatmentRemove )} } + // Auto - Eject Connections { target: vPostTreatmentAdjustmentDisposablesRemovalConfirm function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentDisposablesRemovalConfirm.adjustment_Accepted ) { - _patientDisconnectionConfirm.reasonText = "" - page( _treatmentReviewConfirm ) + _postTreatmentRemove.reasonText = "" + page( _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() } } } + + // keep? + Connections { target: vPostTreatmentAdjustmentPatientDisconnectionConfirm + function onAdjustmentTriggered ( vValue ) { + if ( vPostTreatmentAdjustmentPatientDisconnectionConfirm.adjustment_Accepted ) { + _postTreatmentReview.reasonText = "" + page( _postTreatmentDisinfection ) + + } else { + _postTreatmentReview.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() + } + } + } + + }