diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-21 19:32:46 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-23 07:51:22 -0700 |
commit | 607d450cd6d659a99fda9b73870d340a2e16af1f (patch) | |
tree | 9ecad03c2d085a8c94bbbda04326915e038c827a /qt-ui/profile/profilewidget2.cpp | |
parent | 65eefe7b599575bf401c0adc9c61e42bc56fc4c9 (diff) | |
download | subsurface-607d450cd6d659a99fda9b73870d340a2e16af1f.tar.gz |
Code cleanup: HeartRate item was doing insane things
This simplifies so much of the code that we were using to control
the visibility of the HeartRate. now things are much saner.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index a6b3564f8..e683b67f6 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -222,8 +222,6 @@ void ProfileWidget2::setupItemOnScene() setupItem(gasPressureItem, timeAxis, cylinderPressureAxis, dataModel, DivePlotDataModel::TEMPERATURE, DivePlotDataModel::TIME, 1); setupItem(temperatureItem, timeAxis, temperatureAxis, dataModel, DivePlotDataModel::TEMPERATURE, DivePlotDataModel::TIME, 1); setupItem(heartBeatItem, timeAxis, heartBeatAxis, dataModel, DivePlotDataModel::HEARTBEAT, DivePlotDataModel::TIME, 1); - heartBeatItem->setVisibilitySettingsKey("hrgraph"); - heartBeatItem->settingsChanged(); setupItem(diveProfileItem, timeAxis, profileYAxis, dataModel, DivePlotDataModel::DEPTH, DivePlotDataModel::TIME, 0); #define CREATE_PP_GAS(ITEM, VERTICAL_COLUMN, COLOR, COLOR_ALERT, THRESHOULD_SETTINGS, VISIBILITY_SETTINGS) \ @@ -452,18 +450,16 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) temperatureAxis->setMinimum(pInfo.mintemp); temperatureAxis->setMaximum(pInfo.maxtemp); - if (heartBeatItem->isVisible()) { - if (pInfo.maxhr) { - heartBeatAxis->setMinimum(pInfo.minhr); - heartBeatAxis->setMaximum(pInfo.maxhr); - heartBeatAxis->updateTicks(HR_AXIS); // this shows the ticks - heartBeatAxis->setVisible(true); - } else { - heartBeatAxis->setVisible(false); - } + + if (pInfo.maxhr) { + heartBeatAxis->setMinimum(pInfo.minhr); + heartBeatAxis->setMaximum(pInfo.maxhr); + heartBeatAxis->updateTicks(HR_AXIS); // this shows the ticks + heartBeatAxis->setVisible(true); } else { heartBeatAxis->setVisible(false); } + timeAxis->setMaximum(maxtime); int i, incr; static int increments[8] = { 10, 20, 30, 60, 5 * 60, 10 * 60, 15 * 60, 30 * 60 }; |