From 6f7467de7a073178c0593673b9e0b697cb265d0a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 31 May 2013 16:21:39 +1000 Subject: Show the gas with the pressure diagram This is a feature that had been requested a few times in the past and when debugging my "show only used gases" commit I realized that this would have been extremely useful to have... Signed-off-by: Dirk Hohndel --- qt-ui/profilegraphics.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'qt-ui/profilegraphics.cpp') diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 82477b201..375d8b6d3 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -577,6 +577,8 @@ void ProfileGraphicsView::plot_cylinder_pressure_text() cyl = entry->cylinderindex; if (!seen_cyl[cyl]) { plot_pressure_value(mbar, entry->sec, LEFT, BOTTOM); + plot_gas_value(mbar, entry->sec, LEFT, TOP, + entry->o2, entry->he); seen_cyl[cyl] = TRUE; } } @@ -601,6 +603,20 @@ void ProfileGraphicsView::plot_pressure_value(int mbar, int sec, double xalign, plot_text(&tro, QPointF(sec, mbar), QString("%1 %2").arg(pressure).arg(unit)); } +void ProfileGraphicsView::plot_gas_value(int mbar, int sec, double xalign, double yalign, int o2, int he) +{ + QString gas; + if (is_air(o2, he)) + gas = tr("air"); + else if (he == 0) + gas = QString(tr("EAN%1")).arg((o2 + 5) / 10); + else + gas = QString("%1/%2").arg((o2 + 5) / 10).arg((he + 5) / 10); + static text_render_options_t tro = {PRESSURE_TEXT_SIZE, PRESSURE_TEXT, xalign, yalign}; + plot_text(&tro, QPointF(sec, mbar), gas); + +} + void ProfileGraphicsView::plot_depth_text() { int maxtime, maxdepth; -- cgit v1.2.3-70-g09d2