diff options
-rw-r--r-- | profile-widget/diveprofileitem.cpp | 8 | ||||
-rw-r--r-- | qt-models/diveplotdatamodel.cpp | 4 | ||||
-rw-r--r-- | qt-models/diveplotdatamodel.h | 1 |
3 files changed, 6 insertions, 7 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 02a0745e7..1cd8fae4f 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -11,6 +11,7 @@ #endif #include "qt-models/diveplannermodel.h" #include "core/helpers.h" +#include "core/dive.h" #include "core/subsurface-qt/SettingsObjectWrapper.h" #include "libdivecomputer/parser.h" #include "profile-widget/profilewidget2.h" @@ -424,8 +425,11 @@ void DivePercentageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem for (int i = 1, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) { if (i < poly.count()) { double value = dataModel->index(i, vDataColumn).data().toDouble(); - int cyl = dataModel->index(i, DivePlotDataModel::CYLINDERINDEX).data().toInt(); - int inert = 1000 - get_o2(&displayed_dive.cylinder[cyl].gasmix); + struct gasmix *gasmix = NULL; + struct event *ev = NULL; + int sec = dataModel->index(i, DivePlotDataModel::TIME).data().toInt(); + gasmix = get_gasmix(&displayed_dive, current_dc, sec, &ev, gasmix); + int inert = 1000 - get_o2(gasmix); mypen.setBrush(QBrush(ColorScale(value, inert))); painter->setPen(mypen); painter->drawLine(poly[i - 1], poly[i]); diff --git a/qt-models/diveplotdatamodel.cpp b/qt-models/diveplotdatamodel.cpp index 3e0ae57f1..8cabd833e 100644 --- a/qt-models/diveplotdatamodel.cpp +++ b/qt-models/diveplotdatamodel.cpp @@ -39,8 +39,6 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const return item.velocity; case USERENTERED: return false; - case CYLINDERINDEX: - return 0; case SENSOR_PRESSURE: return item.pressure[0][0]; case INTERPOLATED_PRESSURE: @@ -123,8 +121,6 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, return tr("Color"); case USERENTERED: return tr("User entered"); - case CYLINDERINDEX: - return tr("Cylinder index"); case SENSOR_PRESSURE: return tr("Pressure S"); case INTERPOLATED_PRESSURE: diff --git a/qt-models/diveplotdatamodel.h b/qt-models/diveplotdatamodel.h index 829ee0ebd..b28dce685 100644 --- a/qt-models/diveplotdatamodel.h +++ b/qt-models/diveplotdatamodel.h @@ -20,7 +20,6 @@ public: TEMPERATURE, USERENTERED, COLOR, - CYLINDERINDEX, SENSOR_PRESSURE, INTERPOLATED_PRESSURE, SAC, |