Index: denali.pro.user =================================================================== diff -u -rc0c63c4b149dafea2b02e4cd31f223e392ff7818 -r526137b088b43e51868cb241ce70b3cf52febae8 --- denali.pro.user (.../denali.pro.user) (revision c0c63c4b149dafea2b02e4cd31f223e392ff7818) +++ denali.pro.user (.../denali.pro.user) (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -1,6 +1,6 @@ - + EnvironmentId Index: denali.qrc =================================================================== diff -u -rfa1b7c7d5ca98b991168bacc0bab1e9614ed39b6 -r526137b088b43e51868cb241ce70b3cf52febae8 --- denali.qrc (.../denali.qrc) (revision fa1b7c7d5ca98b991168bacc0bab1e9614ed39b6) +++ denali.qrc (.../denali.qrc) (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -106,6 +106,7 @@ sources/gui/qml/compounds/PressureRangeSlider.qml sources/gui/qml/compounds/PreTreatmentTitleBar.qml + sources/gui/qml/compounds/InstructionView.qml qtquickcontrols2.conf Index: resources/NotAttachedTestImages/1.png =================================================================== diff -u Binary files differ Index: resources/NotAttachedTestImages/2.png =================================================================== diff -u Binary files differ Index: resources/NotAttachedTestImages/3.png =================================================================== diff -u Binary files differ Index: sources/gui/qml/components/StepBullet.qml =================================================================== diff -u -rfa1b7c7d5ca98b991168bacc0bab1e9614ed39b6 -r526137b088b43e51868cb241ce70b3cf52febae8 --- sources/gui/qml/components/StepBullet.qml (.../StepBullet.qml) (revision fa1b7c7d5ca98b991168bacc0bab1e9614ed39b6) +++ sources/gui/qml/components/StepBullet.qml (.../StepBullet.qml) (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -36,16 +36,17 @@ property color colorComplete : Colors.borderButton property color colorCurrent : currentComplete ? colorComplete : Colors.transparent property color colorInComplete : Colors.borderDisableButton - property int fontSizeCurrent : 18 - property int fontSizeNormal : 14 + property int fontSizeCurrent : Fonts.fontPixelStepCurrent + property int fontSizeNormal : Fonts.fontPixelStepNormal + QtObject { id: _private readonly property real diameter : 15 readonly property string stateNameVertical : "vertical" // must not have translation readonly property string stateNameHorizontal : "horizontal" // must not have translation } - height : _circle.height + (_text.visible ? _text.height : 0) + height : _circle.height + (_text.visible ? _textHightRef.height : 0) width : _private.diameter state : _root.vertical ? _private.stateNameVertical : _private.stateNameHorizontal @@ -63,6 +64,17 @@ border.width: 2 } + // this text is created only for the maximum(current) font info(height) + Text { id: _textHightRef + visible: false + text : _text.text + font { + pixelSize: _root.fontSizeCurrent + bold : _root.current + italic : _root.current + } + } + Text { id: _text visible: ! _root.hideLabels anchors.top : _circle.bottom @@ -75,7 +87,6 @@ pixelSize: _root.current ? _root.fontSizeCurrent : _root.fontSizeNormal bold : _root.current italic : _root.current - } } Index: sources/gui/qml/components/StepIndicator.qml =================================================================== diff -u -r6112c3191d418571246b5b6da11502b2e723ef2e -r526137b088b43e51868cb241ce70b3cf52febae8 --- sources/gui/qml/components/StepIndicator.qml (.../StepIndicator.qml) (revision 6112c3191d418571246b5b6da11502b2e723ef2e) +++ sources/gui/qml/components/StepIndicator.qml (.../StepIndicator.qml) (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -70,7 +70,6 @@ columns : _root.vertical ? 1 : 0 rowSpacing : _root.spacing columnSpacing : _root.spacing - anchors.centerIn: parent StepBullet { id: _headStepBullet currentComplete : _root.currentComplete Index: sources/gui/qml/compounds/InstructionView.qml =================================================================== diff -u --- sources/gui/qml/compounds/InstructionView.qml (revision 0) +++ sources/gui/qml/compounds/InstructionView.qml (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -0,0 +1,157 @@ +/*! + * + * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file InstructionView.qml + * \author (last) Behrouz NematiPour + * \date (last) 14-Mar-2021 + * \author (original) Behrouz NematiPour + * \date (original) 14-Mar-2021 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Controls 2.12 // swipeview + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief TitleBarCreateTreatment - Contains a back button as well + * as the current progress in each of the pre-treatment steps. + */ +Rectangle { id: _root + property var stepNames : [] + property var stepImages : [] + + readonly property int frameGap : 47 + readonly property int chevronWidth : 25 + readonly property int chevronHeight : 35 + readonly property int chevronMargin : ( _root.frameGap - _root.chevronWidth ) / 2 + readonly property int outerRadius : 10 + readonly property int outerHMargin : 30 + readonly property int outerVMargin : 15 + readonly property int innerRadius : 5 + + signal leftClicked () + signal rightClicked() + + color : Colors.transparent + border.color : Colors.borderButton + radius : _root.outerRadius + + anchors { + left : parent.left + right : parent.right + leftMargin : _root.outerHMargin + rightMargin : _root.outerHMargin + topMargin : _root.outerVMargin + bottomMargin : _root.outerVMargin + } + + Text { id: _message + color : Colors.textMain + text : _root.stepNames[_swipeview.currentIndex] + anchors.top : _root.top + anchors.bottom : _innerFrame.top + anchors.horizontalCenter: _root.horizontalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pixelSize: Fonts.fontPixelDialogText + } + + Rectangle { id: _innerFrame + color : Colors.transparent + border.color : Colors.line + anchors { + fill : _root + margins : _root.frameGap + } + radius : _root.innerRadius + Item { id: _containerSwipeView + clip : true // it has to be clipped although not performace friendly, otherwise the other pages will be partially shown. + anchors.fill : parent + SwipeView { id: _swipeview + anchors.fill: parent + Repeater { + model: _root.stepNames + Loader { id: _content + active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem + sourceComponent: Item { + Image { id: _image + width : _containerSwipeView.width + height : _containerSwipeView.height + horizontalAlignment: Image.AlignHCenter + verticalAlignment: Image.AlignVCenter + fillMode: Image.PreserveAspectFit + source: _root.stepImages[index] + } + } + } + } + } + } + } + + StepIndicator { id: _indicator + currentComplete : true + hideLabels : true + stepNames : _root.stepNames + currentStepIndex: _swipeview.currentIndex + anchors.top : _innerFrame.bottom + anchors.bottom : _root.bottom + anchors.horizontalCenter: _root.horizontalCenter + } + + Image { id: _leftImage + visible : _swipeview.currentIndex != 0 + width : _root.chevronWidth + height : _root.chevronHeight + source : "qrc:/images/iArrowLeft" + anchors.left : _root.left + anchors.right : _innerFrame.left + anchors.verticalCenter: _root.verticalCenter + anchors.margins : _root.chevronMargin + } + Image { id: _rightImage + visible : _swipeview.currentIndex != _swipeview.count - 1 + width : _root.chevronWidth + height : _root.chevronHeight + source : "qrc:/images/iArrowRight" + anchors.right : _root.right + anchors.left : _innerFrame.right + anchors.verticalCenter: _root.verticalCenter + anchors.margins : _root.chevronMargin + } + + MouseArea { id: _mouseAreaLeft + width : _root.frameGap + anchors.left : _root.left + anchors.top : _root.top + anchors.bottom : _root.bottom + onClicked : { + console.debug("leftClicked") + if (_swipeview.currentIndex > 0) + _swipeview.currentIndex-- + _root.leftClicked + } + } + MouseArea {id: _mouseAreaRight + width : _root.frameGap + anchors.right : _root.right + anchors.top : _root.top + anchors.bottom : _root.bottom + onClicked : { + console.debug("rightClicked") + if (_swipeview.currentIndex < _swipeview.count-1) + _swipeview.currentIndex++ + _root.rightClicked + } + } +} Index: sources/gui/qml/globals/Fonts.qml =================================================================== diff -u -rdd2d4b50f32f74eccbc9592be5ef9da0bc0fbd25 -r526137b088b43e51868cb241ce70b3cf52febae8 --- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision dd2d4b50f32f74eccbc9592be5ef9da0bc0fbd25) +++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -39,6 +39,9 @@ readonly property int fontPixelRangeMarker : 16 readonly property int fontPixelRangeRectText : 14 + readonly property int fontPixelStepCurrent : 20 + readonly property int fontPixelStepNormal : 14 + readonly property int fontPixelPresseuresText : 22 readonly property int fontPixelPresseuresLabel : 34 Index: sources/gui/qml/pages/pretreatment/sample/PreTreatmentWaterSample.qml =================================================================== diff -u -r6112c3191d418571246b5b6da11502b2e723ef2e -r526137b088b43e51868cb241ce70b3cf52febae8 --- sources/gui/qml/pages/pretreatment/sample/PreTreatmentWaterSample.qml (.../PreTreatmentWaterSample.qml) (revision 6112c3191d418571246b5b6da11502b2e723ef2e) +++ sources/gui/qml/pages/pretreatment/sample/PreTreatmentWaterSample.qml (.../PreTreatmentWaterSample.qml) (revision 526137b088b43e51868cb241ce70b3cf52febae8) @@ -15,11 +15,12 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // swipeview + // Project // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" import "qrc:/pages/pretreatment" /*! @@ -31,134 +32,21 @@ signal samplePressed () signal sampleReleased() - Rectangle { id: _component + InstructionView { + stepNames: [ + ". Unlock pump track . Lock pump track", + "Insert cartridge using alignment pins", + "HD machine door open / HD machine door closed", + ] + stepImages: [ + "file:/home/denali/Projects/application/resources/NotAttachedTestImages/1.png", + "file:/home/denali/Projects/application/resources/NotAttachedTestImages/2.png", + "file:/home/denali/Projects/application/resources/NotAttachedTestImages/3.png", + ] anchors.top: title.bottom anchors.bottom: _buttonRow.top // anchors.bottom: parent.bottom // anchors.bottomMargin: Variables.notificationHeight + 15 - - // ---- - - readonly property int frameGap : 47 - readonly property int chevronWidth : 25 - readonly property int chevronHeight : 35 - readonly property int outerRadius : 10 - readonly property int outerHMargin : 30 - readonly property int outerVMargin : 15 - readonly property int innerRadius : 5 - readonly property int imageMargin : ( _component.frameGap - _component.chevronWidth ) / 2 - - property var stepNames: ["A", "B", "C"] - - signal leftClicked () - signal rightClicked() - - color : Colors.transparent - border.color : Colors.borderButton - radius : _component.outerRadius - anchors { - left : parent.left - right : parent.right - leftMargin : _component.outerHMargin - rightMargin : _component.outerHMargin - topMargin : _component.outerVMargin - bottomMargin : _component.outerVMargin - } - Text { id: _message - color: Colors.textMain - text: _component.stepNames[_swipeview.currentIndex] - anchors.top: _component.top - anchors.bottom: _innerFrame.top - anchors.horizontalCenter: _component.horizontalCenter - font.pixelSize: Fonts.fontPixelSection - } - - Rectangle { id: _innerFrame - clip: true - color : Colors.transparent - border.color : Colors.line - anchors.fill : _component - anchors.margins : _component.frameGap - radius : _component.innerRadius - onWidthChanged : console.debug(" ----- ", width, height) - onHeightChanged : console.debug(" ----- ", width, height) - Rectangle { id: _containerSwipeView - anchors.fill: parent - anchors.margins: 2 - SwipeView { id: _swipeview - clip: true - currentIndex: 0 - anchors.fill: parent - Repeater { - model: _component.stepNames - Loader { - anchors.margins: 2 - active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem - sourceComponent: Item { - Image { - anchors.fill: parent - source: "qrc:/images/iLogoDiality" - } - } - } - } - } - } - } - - StepIndicator { id: _indicator - currentComplete : true - hideLabels : true - stepNames : _component.stepNames - currentStepIndex: _swipeview.currentIndex - anchors.top : _innerFrame.bottom - anchors.bottom : _component.bottom - anchors.horizontalCenter: _component.horizontalCenter - } - - Image { id: _leftImage - width : _component.chevronWidth - height : _component.chevronHeight - source : "qrc:/images/iArrowLeft" - anchors.left : _component.left - anchors.right : _innerFrame.left - anchors.verticalCenter: _component.verticalCenter - anchors.margins : _component.imageMargin - } - Image { id: _rightImage - width : _component.chevronWidth - height : _component.chevronHeight - source : "qrc:/images/iArrowRight" - anchors.right : _component.right - anchors.left : _innerFrame.right - anchors.verticalCenter: _component.verticalCenter - anchors.margins : _component.imageMargin - } - - MouseArea { id: _mouseAreaLeft - width : _component.frameGap - anchors.left : _component.left - anchors.top : _component.top - anchors.bottom : _component.bottom - onClicked : { - console.debug("leftClicked") - if (_swipeview.currentIndex > 0) - _swipeview.currentIndex-- - _component.leftClicked - } - } - MouseArea {id: _mouseAreaRight - width : _component.frameGap - anchors.right : _component.right - anchors.top : _component.top - anchors.bottom : _component.bottom - onClicked : { - console.debug("rightClicked") - if (_swipeview.currentIndex < _swipeview.count-1) - _swipeview.currentIndex++ - _component.rightClicked - } - } } Row { id: _buttonRow