X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=1912690ce2b2021fbe25957eff294a086c5c2999;hb=42f627b8b1cf7e929a30c0a07a5fb44a4cec9e1f;hp=abd7afe12a4136d960347e3f8b45e62354c52d77;hpb=86e48bfe10d271f86c896e64350c35d59c94c331;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index abd7afe..1912690 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) @@ -618,7 +627,7 @@ GtkWidget *dive_profile_widget(void) GtkWidget *da; da = gtk_drawing_area_new(); - gtk_widget_set_size_request(da, 450, 350); + gtk_widget_set_size_request(da, 350, 250); g_signal_connect(da, "expose_event", G_CALLBACK(expose_event), NULL); return da;