Index: denali.qrc
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- denali.qrc (.../denali.qrc) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ denali.qrc (.../denali.qrc) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -40,6 +40,7 @@
sources/gui/qml/components/ProgressBar.qml
sources/gui/qml/components/ProgressMarker.qml
sources/gui/qml/components/ProgressRect.qml
+ sources/gui/qml/components/RangeRect.qml
qtquickcontrols2.conf
Index: sources/gui/qml/components/ProgressBar.qml
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- sources/gui/qml/components/ProgressBar.qml (.../ProgressBar.qml) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ sources/gui/qml/components/ProgressBar.qml (.../ProgressBar.qml) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -23,118 +23,53 @@
/*!
* \brief Denali project ProgressBar
*/
-Item { id: _root
+RangeRect { id: _root
+ property alias value : _progressRect.value
+ property alias valueEx : _progressRectEx.value
- signal clicked()
+ property alias color : _progressRect.color
+ property alias bgColor : _root.color
- property int minimum : 0
- property int maximum : 100
- property int medimum : 0 // Median
+ property alias markerHeight: _progressMarker.height
- property int value : 0
+ height : Variables.progressbarHeight
- property alias bgColor : _background.color
- property alias color : _highlight.color
- property alias colorMed : _highlightMed.color
+ minimum : 0
+ maximum : 0
- property color minColor : Colors.textProgressMarker
+ minText.visible : true
+ maxText.visible : true
- property int margin : 1
- property real radius : 2
- property alias markerColor : _progressMarker.color
- property alias markerText : _progressMarker.text
- property int markerHeight : Variables.progressMarkerHeight
+ ProgressRect { id: _progressRectEx
+ visible : value
- width : parent.width
- height: Variables.progressbarHeight
-
- Background { id: _background
- color : Colors.backgroundProgressBar
- radius: _root.radius
- }
-
- ProgressRect { id: _highlightMed
minimum : _root.minimum
maximum : _root.maximum
- value : _root.medimum
+ value : _root.valueEx
- margin : _root.margin
- radius : _root.radius
color : Colors.highlightMedProgressBar
+ maxText.visible: visible
+ margin : 0
}
- ProgressRect { id: _highlight
+ ProgressRect { id: _progressRect
minimum : _root.minimum
maximum : _root.maximum
value : _root.value
- margin : _root.margin
- radius : _root.radius
color : Colors.highlightProgressBar
ProgressMarker { id: _progressMarker
- value : _root.value
- height : _root.markerHeight
-
+ value : _root.value
+ height : Variables.progressMarkerHeight
text.font.pixelSize : Fonts.fontPixelProgressBarMarker
text.font.bold : true
-
+ // preferred positioning the marker
text.anchors.right : left
text.anchors.top : top
- text.anchors.rightMargin: 5
+ text.anchors.rightMargin: 5
text.anchors.topMargin : -5
}
}
-
- Text { id: _textMed
- visible : medimum
-
- font.pixelSize : Fonts.fontPixelProgressBarRange
- font.bold : true
-
- color : Colors.textProgressBar
- text : medimum
-
- anchors {
- right : _highlightMed.right
- top : parent.bottom
- topMargin : Variables.progressTextMargin
- }
- }
-
- Text { id: _textMinimum
- font.pixelSize : Fonts.fontPixelProgressBarRange
- font.bold : true
-
- color : Colors.textProgressBar
- text : minimum
-
- anchors {
- left : parent.left
- top : parent.bottom
- topMargin : Variables.progressTextMargin
- }
- }
-
- Text { id: _textMaximum
- font.pixelSize : Fonts.fontPixelProgressBarRange
- font.bold : true
-
- color : Colors.textProgressBar
- text : maximum
-
- anchors {
- right : parent.right
- top : parent.bottom
- topMargin : Variables.progressTextMargin
- }
- }
-
- MouseArea { id: _mouseArea
- anchors.fill: _background
- onClicked: {
- _root.clicked
- }
- }
}
Index: sources/gui/qml/components/ProgressRect.qml
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- sources/gui/qml/components/ProgressRect.qml (.../ProgressRect.qml) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ sources/gui/qml/components/ProgressRect.qml (.../ProgressRect.qml) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -25,18 +25,19 @@
* \details This rectangle fits into the rect area and will calculate its length
* in regards to the min, max, width, current value of the parent
*/
-Rectangle { id: _highlightMed
- property int minimum : 0
- property int maximum : 0
+RangeRect { id: _root
property int value : 0
- property real margin : 0
+ property real margin : Variables.rangeRectMargin
QtObject { id: _private
property int length: ((parent.width * (value - minimum)) / (maximum - minimum) - (margin * 2))
}
width : _private.length
+ // progress Rects require to show the current values as their maxText values
+ maxText.text: value
+
anchors {
left : parent.left
top : parent.top
Index: sources/gui/qml/components/RangeRect.qml
===================================================================
diff -u
--- sources/gui/qml/components/RangeRect.qml (revision 0)
+++ sources/gui/qml/components/RangeRect.qml (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -0,0 +1,79 @@
+/*!
+ *
+ * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
+ * \copyright \n
+ * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n
+ * IN PART OR IN WHOLE, \n
+ * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n
+ *
+ * \file RangeRect.qml
+ * \date 2020/01/24
+ * \author Behrouz NematiPour
+ *
+ */
+
+// Qt
+import QtQuick 2.12
+import QtQuick.Controls 2.12
+
+// Project
+// Qml imports
+import "qrc:/globals"
+
+/*!
+ * \brief Denali project RangeRect
+ */
+Rectangle { id: _root
+ signal clicked()
+
+ property int minimum : 0
+ property int maximum : 0
+
+ property alias minText : _textMinimum
+ property alias maxText : _textMaximum
+
+ width : parent.width
+ height : parent.height
+
+ color : Colors.backgroundRangeRect
+ radius : Variables.rangeRectRadius
+
+ Text { id: _textMinimum
+ visible : false
+
+ font.pixelSize : Fonts.fontPixelRengeRectText
+ font.bold : true
+
+ color : Colors.textProgressBar
+ text : minimum
+
+ anchors {
+ left : parent.left
+ top : parent.bottom
+ topMargin : Variables.rangeRectTextMargin
+ }
+ }
+
+ Text { id: _textMaximum
+ visible : false
+
+ font.pixelSize : Fonts.fontPixelRengeRectText
+ font.bold : true
+
+ color : Colors.textProgressBar
+ text : maximum
+
+ anchors {
+ right : parent.right
+ top : parent.bottom
+ topMargin : Variables.rangeRectTextMargin
+ }
+ }
+
+ MouseArea { id: _mouseArea
+ anchors.fill: parent
+ onClicked: {
+ _root.clicked
+ }
+ }
+}
Index: sources/gui/qml/globals/Colors.qml
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -31,7 +31,7 @@
readonly property color backgroundDottedMenu : "#64809D"
readonly property color backgroundSlider : "#195187"
- readonly property color backgroundProgressBar : "#3e546e"
+ readonly property color backgroundRangeRect : "#3e546e"
readonly property color highlightProgressBar : "#3d8eef"
readonly property color highlightMedProgressBar : "#1b2b3e"
readonly property color textProgressBar : "#88a3c5"
Index: sources/gui/qml/globals/Fonts.qml
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ sources/gui/qml/globals/Fonts.qml (.../Fonts.qml) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -34,5 +34,5 @@
readonly property int fontPixelVitals : 68
readonly property int fontPixelProgressBarMarker: 16
- readonly property int fontPixelProgressBarRange : 14
+ readonly property int fontPixelRengeRectText : 14
}
Index: sources/gui/qml/globals/Variables.qml
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -49,9 +49,12 @@
readonly property int dialogRadius : 10
+ readonly property int rangeRectMargin : 1
+ readonly property int rangeRectRadius : 2
+ readonly property int rangeRectTextMargin : 7
+
readonly property int progressbarHeight : 30
readonly property int progressMarkerHeight : 60
readonly property int progressMarkerWidth : 2
- readonly property int progressTextMargin : 7
}
Index: sources/gui/qml/pages/TreatmentStart.qml
===================================================================
diff -u -ra9c98aee00fd5339b969b353926dccf72b0d496f -r00e025a5d672cae66e592608792c17d98be54d19
--- sources/gui/qml/pages/TreatmentStart.qml (.../TreatmentStart.qml) (revision a9c98aee00fd5339b969b353926dccf72b0d496f)
+++ sources/gui/qml/pages/TreatmentStart.qml (.../TreatmentStart.qml) (revision 00e025a5d672cae66e592608792c17d98be54d19)
@@ -110,22 +110,26 @@
// ---------- COLUMN RIGHT
TouchArea { id: _ultrafiltrationTouchArea
clip: false
- x: rightColumnX
- y: row1Y
- width: _flowsTouchArea.width
- height: 200
- isTouchable: true
- orientation: TouchArea.Orientation.Vertical
- title: qsTr("ULTRAFILTRATION VOLUME") + " " + qsTr("(mL)")
+ x : rightColumnX
+ y : row1Y
+ width : _flowsTouchArea.width
+ height : 200
+ isTouchable : true
+ orientation : TouchArea.Orientation.Vertical
+ title : qsTr("ULTRAFILTRATION VOLUME") + " " + qsTr("(mL)")
+
ProgressBar { id: _progressbar
- property int r: Math.floor(Math.random() * 5000 + 1000)
- y: 75
- width: parent.width
+ y : 75
+ width : parent.width
+ height : Variables.progressbarHeight
+ value : 0
+
// TEST : simulation code
- minimum: 0 // TEST : only test values
- medimum: 3000 // TEST : only test values
- maximum: 4000 // TEST : only test values
+ property int r: Math.floor(Math.random() * 5000 + 1000)
+ minimum : 0 // TEST : only test values
+ maximum : 4000 // TEST : only test values
+ valueEx : 3000 // TEST : only test values
NumberAnimation on value { duration: 50000 /*_progressbar.r*/; from: _progressbar.minimum; to: _progressbar.maximum; loops: Animation.Infinite; }
}
}
@@ -147,15 +151,15 @@
text.text: qsTr("START BOLUS (100 mL)")
text.font {
weight: Font.DemiBold
- pixelSize : 20
- letterSpacing: 3
+ pixelSize : 20
+ letterSpacing : 3
}
animated: true
duration: 100
}
}
- Line { x: rightLinesX; y: row2LineY; length: lineLength }
+ Line { x: rightLinesX; y: row2LineY; length: lineLength; }
TouchArea { id: _solutionInfusionTouchArea
x: rightColumnX