summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-09 11:09:34 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-09 11:09:34 -0700
commit41bce9e5f4c80803132563681d492e74853aa609 (patch)
tree632343ceab08ac5d1012058460f3770d1b13ee86 /profile.c
parent9437a6512a3b353197146c077c1816f0565e0981 (diff)
downloadsubsurface-41bce9e5f4c80803132563681d492e74853aa609.tar.gz
Show tank type and O2 mix for air usage
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index abd7afe12..270a04177 100644
--- a/profile.c
+++ b/profile.c
@@ -391,7 +391,7 @@ static void plot_info(struct dive *dive, struct graphics_context *gc)
{
text_render_options_t tro = {10, 0.2, 1.0, 0.2, LEFT, TOP};
const double liters_per_cuft = 28.317;
- const char *unit;
+ const char *unit, *desc;
double airuse;
airuse = calculate_airuse(dive);
@@ -414,6 +414,15 @@ static void plot_info(struct dive *dive, struct graphics_context *gc)
double sac = airuse / pressure * 60 / dive->duration.seconds;
plot_text(gc, &tro, 0.8, 0.85, "SAC: %4.2f %s/min", sac, unit);
}
+ desc = dive->cylinder[0].type.description;
+ if (desc || dive->cylinder[0].gasmix.o2.permille) {
+ int o2 = dive->cylinder[0].gasmix.o2.permille / 10;
+ if (!desc)
+ desc = "";
+ if (!o2)
+ o2 = 21;
+ plot_text(gc, &tro, 0.8, 0.9, "%s (%d%%)", desc, o2);
+ }
}
static void plot_cylinder_pressure_text(struct dive *dive, struct graphics_context *gc)