From d740ad1317084ebc3ea9abfa66a1d18fed41d675 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 1 Jun 2014 20:59:41 -0700 Subject: Convert plot_gas_value to gasmix Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.h | 1 - qt-ui/profile/diveprofileitem.cpp | 9 +++------ qt-ui/profile/diveprofileitem.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index eb6bf217e..526e1c5fd 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -137,7 +137,6 @@ private: Ui::DivePlanner ui; }; -QString gasToStr(gasmix gas); QString dpGasToStr(const divedatapoint &p); #endif // DIVEPLANNER_H diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 976527f32..84ab4a8b9 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -463,8 +463,7 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo if (!seen_cyl[cyl]) { plot_pressure_value(mbar, entry->sec, Qt::AlignRight | Qt::AlignTop); plot_gas_value(mbar, entry->sec, Qt::AlignRight | Qt::AlignBottom, - get_o2(&dive->cylinder[cyl].gasmix), - get_he(&dive->cylinder[cyl].gasmix)); + dive->cylinder[cyl].gasmix); seen_cyl[cyl] = true; } } @@ -491,11 +490,9 @@ void DiveGasPressureItem::plot_pressure_value(int mbar, int sec, QFlags flags, int o2, int he) +void DiveGasPressureItem::plot_gas_value(int mbar, int sec, QFlags flags, struct gasmix gasmix) { - QString gas = (is_air(o2, he)) ? tr("air") : - (he == 0) ? QString(tr("EAN%1")).arg((o2 + 5) / 10) : - QString("%1/%2").arg((o2 + 5) / 10).arg((he + 5) / 10); + QString gas = gasToStr(gasmix); DiveTextItem *text = new DiveTextItem(this); text->setPos(hAxis->posAtValue(sec), vAxis->posAtValue(mbar)); text->setText(gas); diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index 916404c2e..92d48fe70 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -120,7 +120,7 @@ public: private: void plot_pressure_value(int mbar, int sec, QFlags align); - void plot_gas_value(int mbar, int sec, QFlags align, int o2, int he); + void plot_gas_value(int mbar, int sec, QFlags align, struct gasmix gasmix); QVector polygons; }; -- cgit v1.2.3-70-g09d2