diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-01 20:59:41 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-01 21:00:09 -0700 |
commit | d740ad1317084ebc3ea9abfa66a1d18fed41d675 (patch) | |
tree | 6d9d16ef4a15d562d952c52482415800388387f5 /qt-ui/profile/diveprofileitem.cpp | |
parent | 28093ae957548d5fc1e4d373ca0a345cc1be5069 (diff) | |
download | subsurface-d740ad1317084ebc3ea9abfa66a1d18fed41d675.tar.gz |
Convert plot_gas_value to gasmix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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<Qt::Alig texts.push_back(text); } -void DiveGasPressureItem::plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> flags, int o2, int he) +void DiveGasPressureItem::plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> 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); |