From 4ff73cf5370a3233a4caf29ded6e738e3d02b3a0 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 17 Jan 2014 15:34:15 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'qt-ui/profile/profilewidget2.cpp') 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 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(); } -- cgit v1.2.3-70-g09d2