mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 04:13:24 +00:00
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>
This commit is contained in:
parent
3ab3e4e892
commit
8cbe2af4e9
1 changed files with 12 additions and 2 deletions
14
statistics.c
14
statistics.c
|
@ -31,6 +31,7 @@ typedef struct {
|
||||||
*viz,
|
*viz,
|
||||||
*water_temp,
|
*water_temp,
|
||||||
*air_temp,
|
*air_temp,
|
||||||
|
*air_press,
|
||||||
*sac,
|
*sac,
|
||||||
*otu,
|
*otu,
|
||||||
*o2he,
|
*o2he,
|
||||||
|
@ -575,13 +576,20 @@ static void show_single_dive_stats(struct dive *dive)
|
||||||
if (dive->dc.watertemp.mkelvin) {
|
if (dive->dc.watertemp.mkelvin) {
|
||||||
value = get_temp_units(dive->dc.watertemp.mkelvin, &unit);
|
value = get_temp_units(dive->dc.watertemp.mkelvin, &unit);
|
||||||
set_label(single_w.water_temp, "%.1f %s", value, unit);
|
set_label(single_w.water_temp, "%.1f %s", value, unit);
|
||||||
} else
|
} else {
|
||||||
set_label(single_w.water_temp, "");
|
set_label(single_w.water_temp, "");
|
||||||
|
}
|
||||||
if (dive->dc.airtemp.mkelvin) {
|
if (dive->dc.airtemp.mkelvin) {
|
||||||
value = get_temp_units(dive->dc.airtemp.mkelvin, &unit);
|
value = get_temp_units(dive->dc.airtemp.mkelvin, &unit);
|
||||||
set_label(single_w.air_temp, "%.1f %s", value, unit);
|
set_label(single_w.air_temp, "%.1f %s", value, unit);
|
||||||
} else
|
} else {
|
||||||
set_label(single_w.air_temp, "");
|
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);
|
value = get_volume_units(dive->sac, &decimals, &unit);
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
set_label(single_w.sac, _("%.*f %s/min"), decimals, value, unit);
|
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.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_temp = new_info_label_in_frame(hbox, _("Air Temp"));
|
||||||
|
single_w.air_press = new_info_label_in_frame(hbox, _("Air Press"));
|
||||||
|
|
||||||
/* fourth row */
|
/* fourth row */
|
||||||
hbox = gtk_hbox_new(FALSE, 3);
|
hbox = gtk_hbox_new(FALSE, 3);
|
||||||
|
@ -868,6 +877,7 @@ void clear_stats_widgets(void)
|
||||||
set_label(single_w.viz, "");
|
set_label(single_w.viz, "");
|
||||||
set_label(single_w.water_temp, "");
|
set_label(single_w.water_temp, "");
|
||||||
set_label(single_w.air_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.sac, "");
|
set_label(single_w.sac, "");
|
||||||
set_label(single_w.otu, "");
|
set_label(single_w.otu, "");
|
||||||
|
|
Loading…
Add table
Reference in a new issue