diff options
Diffstat (limited to 'qthelper.cpp')
-rw-r--r-- | qthelper.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qthelper.cpp b/qthelper.cpp index 0354a6031..16354e34b 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -897,3 +897,15 @@ picture_load_exit: free(mem.buffer); return; } + +QString get_gas_string(struct gasmix gas) +{ + uint o2 = (get_o2(&gas) + 5) / 10, he = (get_he(&gas) + 5) / 10; + QString result = gasmix_is_air(&gas) ? QObject::tr("AIR") : he == 0 ? (o2 == 100 ? QObject::tr("OXYGEN") : QString("EAN%1").arg(o2, 2, 10, QChar('0'))) : QString("%1/%2").arg(o2).arg(he); + return result; +} + +QString get_divepoint_gas_string(const divedatapoint &p) +{ + return get_gas_string(p.gasmix); +} |