summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-21 14:59:19 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-21 11:35:09 -0800
commit8065374793908894b47cfd1c2bb0b9913d404bb4 (patch)
treedf2fe4bfec7a05ce3e255cdcf06a38b6f7aded4c /qt-ui/profile/profilewidget2.cpp
parentb1df7aeb4e06cfc512d19b2f7e7f5b455dea0c22 (diff)
downloadsubsurface-8065374793908894b47cfd1c2bb0b9913d404bb4.tar.gz
Add the DiveCalculatedCeiling item.
This item plots the DiveCalculatedCeiling over the profile. I still need to add the Calc All Tissues version. 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.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index b76b4d351..46856ba76 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -38,7 +38,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
gasPressureItem(NULL),
cartesianPlane(new DiveCartesianPlane()),
meanDepth(new DiveLineItem()),
- diveComputerText(new DiveTextItem())
+ diveComputerText(new DiveTextItem()),
+ diveCeiling(NULL)
{
setScene(new QGraphicsScene());
scene()->setSceneRect(0, 0, 100, 100);
@@ -358,6 +359,18 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
gasPressureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
scene()->addItem(gasPressureItem);
+ if(diveCeiling){
+ scene()->removeItem(diveCeiling);
+ delete diveCeiling;
+ }
+ diveCeiling = new DiveCalculatedCeiling();
+ diveCeiling->setHorizontalAxis(timeAxis);
+ diveCeiling->setVerticalAxis(profileYAxis);
+ diveCeiling->setModel(dataModel);
+ diveCeiling->setVerticalDataColumn(DivePlotDataModel::CEILING);
+ diveCeiling->setHorizontalDataColumn(DivePlotDataModel::TIME);
+ scene()->addItem(diveCeiling);
+
diveComputerText->setText(currentdc->model);
diveComputerText->animateMoveTo(1 , sceneRect().height());