Index: sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml =================================================================== diff -u -r1286d74bd015276aab604808be2766136091c125 -r18e4634800357ac1d8bc1da1cad04836ba85d33c --- sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 1286d74bd015276aab604808be2766136091c125) +++ sources/gui/qml/pages/posttreatment/PostTreatmentStack.qml (.../PostTreatmentStack.qml) (revision 18e4634800357ac1d8bc1da1cad04836ba85d33c) @@ -31,31 +31,23 @@ 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 () - - // 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 @@ -68,14 +60,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() + page( _postTreatmentDisinfection ) break case PostTreatmentStack.Disinfection: - _root.disposablesRemovalConfirm() + // Skip button - go back to standby -- Finish Treatment break default: break @@ -84,30 +79,46 @@ 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 { @@ -119,55 +130,67 @@ } 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 - USBButton { id: _usbButton - anchors.top : _exportButton.top - anchors.left : _exportButton.right - anchors.leftMargin: Variables.minVGap - enabled : _GuiView.usbIsReady && !_GuiView.exportRunning - visible : stackStepIndex === PostTreatmentStack.Review - } + anchors { + left : _titleBar.left + leftMargin : Variables.defaultMargin * 2 + top : _titleBar.top + topMargin : Variables.defaultMargin * 2 + } - PostTreatmentBase { id: _patientDisconnectionConfirm - objectName :"_patientDisconnectionConfirm" - instructionBased : true - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnection } - } + QRCode { id: _qrCode + anchors.verticalCenter : parent.verticalCenter + anchors.verticalCenterOffset: -5 + qrcode : vPostTreatmentAdjustmentTreatmentLog.txCode + clear : ! _root.visible + } - PostTreatmentReview { id: _treatmentReviewConfirm - objectName :"_treatmentReviewConfirm" - instructionBased : false - onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Review } - - onItemClicked : { - _detailTest.title.text = itemsText[vIndex] - push(_detailTest) + Text { id: _txCodeText + anchors.bottom : _qrCode.bottom + text : vPostTreatmentAdjustmentTreatmentLog.txCode ? qsTr("Tx Code: ") + vPostTreatmentAdjustmentTreatmentLog.txCode : " " + color : "#DBE9FA" + font.pixelSize : Fonts.fontPixelButton + } } } - PostTreatmentBase { id: _detailTest - objectName :"_detailTest" - onBackClicked : pop() + PostTreatmentDisconnectStack { id: _postTreatmentDisconnectStack + objectName : "_postTreatmentDisconnectStack" + onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disconnect; initStack() } } - PostTreatmentBase { id: _disposablesRemovalConfirm - objectName :"_disposablesRemovalConfirm" + 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() } + } + + PostTreatmentBase { id: _postTreatmentDisinfection + objectName :" _postTreatmentDisinfection" onVisibleChanged : if (visible) { stackStepIndex = PostTreatmentStack.Disinfection } } @@ -180,38 +203,46 @@ } Connections { target: vTDOpMode - function onPostTreatmentChanged ( vValue ) { page( _patientDisconnectionConfirm , vValue )} + function onPostTreatmentChanged ( vValue ) { page( _postTreatmentDisconnectStack , vValue )} } + // Disconnect stack + Connections { target: _postTreatmentDisconnectStack + function onGoToNextStep () { page ( _postTreatmentRemove )} + } + + // Confirm Patient Disconnection Connections { target: vPostTreatmentAdjustmentPatientDisconnectionConfirm function onAdjustmentTriggered ( vValue ) { if ( vPostTreatmentAdjustmentPatientDisconnectionConfirm.adjustment_Accepted ) { - _treatmentReviewConfirm.reasonText = "" - page( _disposablesRemovalConfirm ) + _postTreatmentReview.reasonText = "" + _postTreatmentDisconnectStack.goToDrain() } else { - _treatmentReviewConfirm.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() + _postTreatmentReview.reasonText = vPostTreatmentAdjustmentPatientDisconnectionConfirm.text() } } } + // 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() } } }