aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-23 14:32:25 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-23 14:32:25 -0800
commit41abab72533a31affe7746568e3d6fc3d8f94981 (patch)
treed18a023b00753aaee60c6c8d30eca3591c58c41a /qt-ui/profile/profilewidget2.cpp
parent9712999e666bd0040625a6eb924432c265f748bc (diff)
downloadsubsurface-41abab72533a31affe7746568e3d6fc3d8f94981.tar.gz
Calculate minimum and maximum heartrate
And setup the axis accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 9152f1c76..a8f1e0e33 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -345,10 +345,14 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
temperatureAxis->setMinimum(pInfo.mintemp);
temperatureAxis->setMaximum(pInfo.maxtemp);
- heartBeatAxis->setMinimum(20); // FIXME: find minimum
- heartBeatAxis->setMaximum(200); // FIXME: find maximum
- heartBeatAxis->updateTicks(); // this shows the ticks
-
+ if (pInfo.maxhr) {
+ heartBeatAxis->setMinimum(pInfo.minhr);
+ heartBeatAxis->setMaximum(pInfo.maxhr);
+ heartBeatAxis->updateTicks(); // this shows the ticks
+ heartBeatAxis->setVisible(true);
+ } else {
+ heartBeatAxis->setVisible(false);
+ }
timeAxis->setMaximum(maxtime);
int i, incr;