diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-17 14:28:59 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-17 14:04:47 -0800 |
commit | e3ec5ef2906c4dfee2af6e772c69110e31d4102a (patch) | |
tree | 800625ef42c683e8ba91288f1ab3286cb1ec8da2 /qt-ui/profile | |
parent | e23841dd7f199b97a2e24cb7618c07416e269af7 (diff) | |
download | subsurface-e3ec5ef2906c4dfee2af6e772c69110e31d4102a.tar.gz |
Added the Cylinder Pressure Axis
The cylinder pressure axis is the 'Y' axis for the Cylinder plot.
I positioned it in around 20% to 60% of the screen state.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 13 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index be309b921..7bb6db4cd 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -33,6 +33,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : depthController(new DiveRectItem()), timeController(new DiveRectItem()), diveProfileItem(NULL), + cylinderPressureAxis(new DiveCartesianAxis()), temperatureItem(NULL), cartesianPlane(new DiveCartesianPlane()) { @@ -69,6 +70,12 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : temperatureAxis->setTickSize(2); temperatureAxis->setTickInterval(300); + cylinderPressureAxis->setOrientation(DiveCartesianAxis::TopToBottom); + cylinderPressureAxis->setLine(0,20,0,60); + cylinderPressureAxis->setX(3); + cylinderPressureAxis->setTickSize(2); + cylinderPressureAxis->setTickInterval(30000); + timeAxis->setLine(0,0,96,0); timeAxis->setX(3); timeAxis->setTickSize(1); @@ -82,7 +89,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : // insert in the same way it's declared on the Enum. This is needed so we don't use an map. QList<QGraphicsItem*> stateItems; stateItems << background << profileYAxis << gasYAxis << - timeAxis << depthController << timeController << temperatureAxis; + timeAxis << depthController << timeController << temperatureAxis << cylinderPressureAxis; Q_FOREACH(QGraphicsItem *item, stateItems) { scene()->addItem(item); } @@ -282,6 +289,10 @@ void ProfileWidget2::plotDives(QList<dive*> dives) //temperatureAxis->updateTicks(); timeAxis->setMaximum(maxtime); timeAxis->updateTicks(); + cylinderPressureAxis->setMinimum(pInfo.minpressure); + cylinderPressureAxis->setMaximum(pInfo.maxpressure); + cylinderPressureAxis->updateTicks(); + dataModel->setDive(current_dive, pInfo); if (diveProfileItem) { diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index e3289f911..b5d9f0a31 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -75,6 +75,7 @@ private: DiveProfileItem *diveProfileItem; DiveCartesianPlane *cartesianPlane; DiveTemperatureItem *temperatureItem; + DiveCartesianAxis *cylinderPressureAxis; QList<DiveEventItem*> eventItems; }; |