From e3ec5ef2906c4dfee2af6e772c69110e31d4102a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 17 Jan 2014 14:28:59 -0200 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 13 ++++++++++++- qt-ui/profile/profilewidget2.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) 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 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 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 eventItems; };