aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-19 17:18:26 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-19 17:19:57 -0800
commitfd1a62568b549ea1d698d1578da8d7653063ba04 (patch)
tree9080ec10a0ce7073c944dbf3b8ce87764741ed0d /qt-ui/profile/profilewidget2.cpp
parent08490785b2bc9a40a3a65e2ae1b416f0089d629b (diff)
downloadsubsurface-fd1a62568b549ea1d698d1578da8d7653063ba04.tar.gz
New profile: partial addition of heartrate
This was done during an IRC hacking session with Tomaz. It compiles, it shows something but not the right graph. Committed here so Tomaz and I can continue to work on it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index bba1a96a8..b7f5e0030 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -50,6 +50,7 @@ static struct _ItemPos{
_Axis time;
_Axis cylinder;
_Axis temperature;
+ _Axis heartBeat;
} itemPos;
ProfileWidget2::ProfileWidget2(QWidget *parent) :
@@ -73,7 +74,9 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
reportedCeiling(new DiveReportedCeiling()),
pn2GasItem( new PartialPressureGasItem()),
pheGasItem( new PartialPressureGasItem()),
- po2GasItem( new PartialPressureGasItem())
+ po2GasItem( new PartialPressureGasItem()),
+ heartBeatAxis(new DiveCartesianAxis()),
+ heartBeatItem(new DiveTemperatureItem()) // FIXME: making this a DiveTemperatureItem is a hack
{
memset(&plotInfo, 0, sizeof(plotInfo));
@@ -111,6 +114,8 @@ void ProfileWidget2::addItemsToScene()
scene()->addItem(pn2GasItem);
scene()->addItem(pheGasItem);
scene()->addItem(po2GasItem);
+ scene()->addItem(heartBeatAxis);
+ scene()->addItem(heartBeatItem);
Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
scene()->addItem(tissue);
}
@@ -137,6 +142,12 @@ void ProfileWidget2::setupItemOnScene()
gasYAxis->setFontLabelScale(0.7);
gasYAxis->setLineSize(96);
+ heartBeatAxis->setOrientation(DiveCartesianAxis::BottomToTop);
+ heartBeatAxis->setTickSize(2);
+ heartBeatAxis->setTickInterval(10);
+ heartBeatAxis->setFontLabelScale(0.7);
+ heartBeatAxis->setLineSize(96);
+
temperatureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
temperatureAxis->setTickSize(2);
temperatureAxis->setTickInterval(300);
@@ -163,6 +174,7 @@ 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);
setupItem(diveProfileItem, timeAxis, profileYAxis, dataModel, DivePlotDataModel::DEPTH, DivePlotDataModel::TIME, 0);
#define CREATE_PP_GAS( ITEM, VERTICAL_COLUMN, COLOR, COLOR_ALERT, THRESHOULD_SETTINGS, VISIBILITY_SETTINGS ) \
@@ -185,7 +197,8 @@ void ProfileWidget2::setupItemOnScene()
timeAxis->setLinesVisible(true);
profileYAxis->setLinesVisible(true);
gasYAxis->setZValue(timeAxis->zValue()+1);
-
+ heartBeatAxis->setTextVisible(true);
+ heartBeatAxis->setLinesVisible(true);
}
void ProfileWidget2::setupItemSizes()
@@ -248,6 +261,9 @@ void ProfileWidget2::setupItemSizes()
itemPos.temperature.shrinked.setP1(QPointF(0,5));
itemPos.temperature.shrinked.setP2(QPointF(0,15));
+ itemPos.heartBeat.pos.on.setX(3);
+ itemPos.heartBeat.pos.on.setY(60);
+
itemPos.dcLabel.on.setX(3);
itemPos.dcLabel.on.setY(100);
itemPos.dcLabel.off.setX(-10);
@@ -326,6 +342,11 @@ 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
+
timeAxis->setMaximum(maxtime);
int i, incr;
@@ -525,7 +546,7 @@ void ProfileWidget2::setProfileState()
cylinderPressureAxis->setPos(itemPos.cylinder.pos.on);
temperatureAxis->setPos(itemPos.temperature.pos.on);
-
+ heartBeatAxis->setPos(itemPos.heartBeat.pos.on);
meanDepth->setVisible(true);
diveComputerText->setVisible(true);
@@ -620,4 +641,4 @@ void ProfileWidget2::changeGas()
//TODO: find a way to make this do not need a full redraw
dataModel->clear();
plotDives(QList<dive*>() << getDiveById(diveId));
-} \ No newline at end of file
+}