diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-30 06:44:00 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-30 06:44:00 +1100 |
commit | 8cbe2af4e950d73df5ffe35e0657e9d6ac097564 (patch) | |
tree | e90cdd856d5c9c780d90b237bf885c96a01ab433 /statistics.c | |
parent | 3ab3e4e892d6a904639d9dc97264a52b0aa5ea8d (diff) | |
download | subsurface-8cbe2af4e950d73df5ffe35e0657e9d6ac097564.tar.gz |
Display air pressure in the Info notebook
I can't find it in myself to care enough to display this in other units.
mm/Hg anyone? I didn't think so.
We still can't edit this value, but at least if w are able to read it from
the dive computer we also show it to the user.
See #19
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r-- | statistics.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/statistics.c b/statistics.c index 794678bc2..c421b4051 100644 --- a/statistics.c +++ b/statistics.c @@ -31,6 +31,7 @@ typedef struct { *viz, *water_temp, *air_temp, + *air_press, *sac, *otu, *o2he, @@ -575,13 +576,20 @@ static void show_single_dive_stats(struct dive *dive) if (dive->dc.watertemp.mkelvin) { value = get_temp_units(dive->dc.watertemp.mkelvin, &unit); set_label(single_w.water_temp, "%.1f %s", value, unit); - } else + } else { set_label(single_w.water_temp, ""); + } if (dive->dc.airtemp.mkelvin) { value = get_temp_units(dive->dc.airtemp.mkelvin, &unit); set_label(single_w.air_temp, "%.1f %s", value, unit); - } else + } else { set_label(single_w.air_temp, ""); + } + if (dive->dc.surface_pressure.mbar) { + set_label(single_w.air_press, "%d mbar", dive->dc.surface_pressure.mbar); + } else { + set_label(single_w.air_press, _("unknown")); + } value = get_volume_units(dive->sac, &decimals, &unit); if (value > 0) { set_label(single_w.sac, _("%.*f %s/min"), decimals, value, unit); @@ -845,6 +853,7 @@ GtkWidget *single_stats_widget(void) single_w.water_temp = new_info_label_in_frame(hbox, _("Water Temp")); single_w.air_temp = new_info_label_in_frame(hbox, _("Air Temp")); + single_w.air_press = new_info_label_in_frame(hbox, _("Air Press")); /* fourth row */ hbox = gtk_hbox_new(FALSE, 3); @@ -868,6 +877,7 @@ void clear_stats_widgets(void) set_label(single_w.viz, ""); set_label(single_w.water_temp, ""); set_label(single_w.air_temp, ""); + set_label(single_w.air_press, ""); set_label(single_w.sac, ""); set_label(single_w.sac, ""); set_label(single_w.otu, ""); |