summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-17 15:34:15 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-17 14:04:47 -0800
commit4ff73cf5370a3233a4caf29ded6e738e3d02b3a0 (patch)
tree24766d2a532522a7f1a0d94ac7ae471c1b244cc1 /qt-ui/profile/profilewidget2.cpp
parent779c1b6738c4378be79a46b744da2c556380ca32 (diff)
downloadsubsurface-4ff73cf5370a3233a4caf29ded6e738e3d02b3a0.tar.gz
Add the gas pressure plot.
Added the Gas Pressure Graph with the related Model Changes to access the cylinder index, pressure, interpolated pressure and SAC. The plot does not correctly plot its color right now but it's not hard to do. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 3970e6f3a..201c68f41 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -70,7 +70,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
temperatureAxis->setTickSize(2);
temperatureAxis->setTickInterval(300);
- cylinderPressureAxis->setOrientation(DiveCartesianAxis::TopToBottom);
+ cylinderPressureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
cylinderPressureAxis->setLine(0,20,0,60);
cylinderPressureAxis->setX(3);
cylinderPressureAxis->setTickSize(2);
@@ -336,6 +336,18 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
temperatureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
scene()->addItem(temperatureItem);
+ if(gasPressureItem){
+ scene()->removeItem(gasPressureItem);
+ delete gasPressureItem;
+ }
+ gasPressureItem = new DiveGasPressureItem();
+ gasPressureItem->setHorizontalAxis(timeAxis);
+ gasPressureItem->setVerticalAxis(cylinderPressureAxis);
+ gasPressureItem->setModel(dataModel);
+ gasPressureItem->setVerticalDataColumn(DivePlotDataModel::TEMPERATURE);
+ gasPressureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
+ scene()->addItem(gasPressureItem);
+
emit startProfileState();
}