Index: leahi.qrc
===================================================================
diff -u -r303c3a2193ca2c7d6839acdb508dd420774b049f -rc843f1d6a805119ecadfa2c24f309f77e7637830
--- leahi.qrc (.../leahi.qrc) (revision 303c3a2193ca2c7d6839acdb508dd420774b049f)
+++ leahi.qrc (.../leahi.qrc) (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -163,6 +163,7 @@
sources/gui/qml/components/HeaderBar.qml
sources/gui/qml/components/HeaderBarPopup.qml
sources/gui/qml/components/AlarmButtonRow.qml
+ sources/gui/qml/components/VitalsButton.qml
sources/gui/qml/compounds/PressureRangeSlider.qml
Index: sources/gui/qml/components/HeaderBar.qml
===================================================================
diff -u -r51cb7f2c575286515aa7b715e032514772c1ce1f -rc843f1d6a805119ecadfa2c24f309f77e7637830
--- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 51cb7f2c575286515aa7b715e032514772c1ce1f)
+++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -17,7 +17,7 @@
GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) }
}
- function vitalsRecorded() { _pulseAnimation.start() }
+ function vitalsRecorded() { _vitalsButton.pulseAnimation.start() }
MouseArea { id: _mouseArea
anchors.fill : parent
@@ -112,30 +112,10 @@
rightMargin : _headerButtonRow.spacing
}
- IconButton { id : _vitalsButton
- iconSize : Variables.headerIconDiameter
- iconImageSource : "qrc:/images/iVitals"
+ VitalsButton { id : _vitalsButton
extraSpace : _headerButtonRow.spacing
onPressed : _treatmentAdjustmentVitals.open()
-
- SequentialAnimation { id: _pulseAnimation
- loops : 2
- running : false
- alwaysRunToEnd : true
- onStarted : _vitalsButton.iconImageSource = "qrc:/images/iVitalsRed"
- onStopped : _vitalsButton.iconImageSource = "qrc:/images/iVitals"
- onFinished : { _vitalsButton.iconImageSource = "qrc:/images/iVitals"; _vitalsButton.opacity = 1; }
- ParallelAnimation { id: _pulseOut
- NumberAnimation { target: _vitalsButton; property: "opacity"; from: 0.3; to: 1; duration: 350; } // pulse up
- NumberAnimation { target: _vitalsButton; property: "scale"; to: 1.14; duration: 350; easing.type: Easing.OutCubic } // beat grow
- }
-
- ParallelAnimation { id: _pulseDown
- NumberAnimation { target: _vitalsButton; property: "opacity"; from: 1; to: 0.3; duration: 350; } // pulse down
- NumberAnimation { target: _vitalsButton; property: "scale"; to: 1.0; duration: 350; easing.type: Easing.InCubic } // beat shrink
- }
- }
}
IconButton { id : _prescriptionButton
Index: sources/gui/qml/components/IconButton.qml
===================================================================
diff -u -r3ef1a4ff361ba1774ad1a6f6170dbb174cadbdd5 -rc843f1d6a805119ecadfa2c24f309f77e7637830
--- sources/gui/qml/components/IconButton.qml (.../IconButton.qml) (revision 3ef1a4ff361ba1774ad1a6f6170dbb174cadbdd5)
+++ sources/gui/qml/components/IconButton.qml (.../IconButton.qml) (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -23,6 +23,7 @@
property int iconSize : Variables.iconButtonSize
property string iconImageSource : ""
property int extraSpace : Variables.defaultMargin
+ readonly property alias icon : _iconImage
width : iconSize + extraSpace
height : iconSize + extraSpace
Index: sources/gui/qml/components/VitalsButton.qml
===================================================================
diff -u
--- sources/gui/qml/components/VitalsButton.qml (revision 0)
+++ sources/gui/qml/components/VitalsButton.qml (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -0,0 +1,48 @@
+import QtQuick 2.12
+
+import "qrc:/components"
+import "qrc:/globals"
+
+IconButton { id : _root
+ readonly property int intervalSec : vTreatmentVitals.interval * 60
+ property alias pulseAnimation : _pulseAnimation
+
+ iconSize : Variables.headerIconDiameter
+ iconImageSource : "qrc:/images/iVitals"
+
+ Item { id: _fillHeart
+ anchors {
+ fill : _root.icon
+ topMargin : _root.iconSize - (_root.iconSize / _root.intervalSec * vTreatmentVitals.totalCount)
+ bottom : _root.icon.bottom
+ top : _root.icon.top
+ }
+
+ clip: true
+ Image { id: _fillHeartImage
+ anchors.bottom : parent.bottom
+ height : _root.iconSize
+ width : height
+ source : "qrc:/images/iVitalsRed"
+ fillMode : Image.PreserveAspectFit
+ }
+ }
+
+ SequentialAnimation { id: _pulseAnimation
+ loops : 2
+ running : false
+ alwaysRunToEnd : true
+ onStarted : _root.iconImageSource = "qrc:/images/iVitalsRed"
+ onStopped : _root.iconImageSource = "qrc:/images/iVitals"
+ onFinished : { _root.iconImageSource = "qrc:/images/iVitals"; _root.opacity = 1; }
+ ParallelAnimation { id: _pulseOut
+ NumberAnimation { target: _root; property: "opacity"; from: 0.3; to: 1; duration: 350; } // pulse up
+ NumberAnimation { target: _root; property: "scale"; to: 1.14; duration: 350; easing.type: Easing.OutCubic } // beat grow
+ }
+
+ ParallelAnimation { id: _pulseDown
+ NumberAnimation { target: _root; property: "opacity"; from: 1; to: 0.3; duration: 350; } // pulse down
+ NumberAnimation { target: _root; property: "scale"; to: 1.0; duration: 350; easing.type: Easing.InCubic } // beat shrink
+ }
+ }
+}
Index: sources/gui/qml/pages/treatment/TreatmentHome.qml
===================================================================
diff -u -rc1d0546e2d1a51ff919b2172ce647003359f0853 -rc843f1d6a805119ecadfa2c24f309f77e7637830
--- sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision c1d0546e2d1a51ff919b2172ce647003359f0853)
+++ sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -95,7 +95,7 @@
verticalAlignment : Text.AlignVCenter
height : 15
width : 100
- text : vTreatmentVitals.interval ? ( vTreatmentVitals.countdown ) : ""
+ text : vTreatmentVitals.interval ? vTreatmentVitals.countdown : ""
font.pixelSize: 16
}
}
Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp
===================================================================
diff -u -rfad1a894d3a4fb4558d91481d026c0ebcf205366 -rc843f1d6a805119ecadfa2c24f309f77e7637830
--- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision fad1a894d3a4fb4558d91481d026c0ebcf205366)
+++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.cpp (.../VCommonAdjustmentVitals.cpp) (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -160,6 +160,7 @@
if ( ! _interval ) return; // if interval is 0/OFF return
_counter_sec++;
+ emit totalCountChanged(++_totalCount);
min_left(_counter_min );
sec_left(60 - _counter_sec);
@@ -216,6 +217,7 @@
_counter_min = 0;
}
_counter_sec = 0;
+ totalCount(0);
}
/*!
Index: sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h
===================================================================
diff -u -ra9cc981e51277c1c258446920ac7e7612da49159 -rc843f1d6a805119ecadfa2c24f309f77e7637830
--- sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision a9cc981e51277c1c258446920ac7e7612da49159)
+++ sources/view/hd/adjustment/common/VCommonAdjustmentVitals.h (.../VCommonAdjustmentVitals.h) (revision c843f1d6a805119ecadfa2c24f309f77e7637830)
@@ -57,6 +57,7 @@
PROPERTY( quint64 , epoch , 0)
PROPERTY( QString , lastRead , "")
PROPERTY( QString , countdown , "")
+ PROPERTY( int , totalCount , 0)
// vitals
PROPERTY( quint16 , systolic , 0)