diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-02-19 17:18:26 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-19 17:19:57 -0800 |
commit | fd1a62568b549ea1d698d1578da8d7653063ba04 (patch) | |
tree | 9080ec10a0ce7073c944dbf3b8ce87764741ed0d /qt-ui | |
parent | 08490785b2bc9a40a3a65e2ae1b416f0089d629b (diff) | |
download | subsurface-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')
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.cpp | 1 | ||||
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.h | 2 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 29 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 2 |
4 files changed, 29 insertions, 5 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index f799135fe..f7a0e231b 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -40,6 +40,7 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const case PN2: return item.pn2; case PHE: return item.phe; case PO2: return item.po2; + case HEARTBEAT: return item.heartbeat; } } diff --git a/qt-ui/profile/diveplotdatamodel.h b/qt-ui/profile/diveplotdatamodel.h index 19d2f4360..0a64a6a89 100644 --- a/qt-ui/profile/diveplotdatamodel.h +++ b/qt-ui/profile/diveplotdatamodel.h @@ -14,7 +14,7 @@ Q_OBJECT public: enum {DEPTH, TIME, PRESSURE, TEMPERATURE, USERENTERED, COLOR, CYLINDERINDEX, SENSOR_PRESSURE, INTERPOLATED_PRESSURE, SAC, CEILING, TISSUE_1,TISSUE_2,TISSUE_3,TISSUE_4,TISSUE_5,TISSUE_6,TISSUE_7,TISSUE_8,TISSUE_9,TISSUE_10, - TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16, PN2,PHE,PO2,COLUMNS}; + TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16, PN2,PHE,PO2, HEARTBEAT, COLUMNS}; explicit DivePlotDataModel(QObject* parent = 0); virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 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 +} diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 44f92f707..6b244d251 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -97,6 +97,8 @@ private: PartialPressureGasItem *pn2GasItem; PartialPressureGasItem *pheGasItem; PartialPressureGasItem *po2GasItem; + DiveCartesianAxis *heartBeatAxis; + DiveTemperatureItem *heartBeatItem; }; #endif // PROFILEWIDGET2_H |