On Wed, Sep 13, 2017 at 1:00 PM, Linus Torvalds
<[email protected]> wrote:
>
> Hmm. The infobox pressure thing I will look into.
This should fix it.
Linus
From a2741d5cd59ce1cd16c97d46f6e548f763f5c4ef Mon Sep 17 00:00:00 2001
From: Linus Torvalds <[email protected]>
Date: Wed, 13 Sep 2017 13:18:31 -0700
Subject: [PATCH] Make the info window show all the pressures we have
We used to only show the first pressure we had, from back when we only
supported a single sensor.
Reported-by: Stefan Fuchs <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
---
core/profile.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/core/profile.c b/core/profile.c
index c63ea829..af9ebff2 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -1309,14 +1309,19 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
int pressurevalue, mod, ead, end, eadd;
const char *depth_unit, *pressure_unit, *temp_unit, *vertical_speed_unit;
double depthvalue, tempvalue, speedvalue, sacvalue;
- int decimals;
+ int decimals, cyl;
const char *unit;
depthvalue = get_depth_units(entry->depth, NULL, &depth_unit);
put_format(b, translate("gettextFromC", "@: %d:%02d\nD: %.1f%s\n"), FRACTION(entry->sec, 60), depthvalue, depth_unit);
- if (GET_PRESSURE(entry, 0)) {
- pressurevalue = get_pressure_units(GET_PRESSURE(entry, 0), &pressure_unit);
- put_format(b, translate("gettextFromC", "P: %d%s\n"), pressurevalue, pressure_unit);
+ for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
+ struct gasmix *mix;
+ int mbar = GET_PRESSURE(entry, cyl);
+ if (!mbar)
+ continue;
+ mix = &displayed_dive.cylinder[cyl].gasmix;
+ pressurevalue = get_pressure_units(mbar, &pressure_unit);
+ put_format(b, translate("gettextFromC", "P: %d%s (%s)\n"), pressurevalue, pressure_unit, gasname(mix));
}
if (entry->temperature) {
tempvalue = get_temp_units(entry->temperature, &temp_unit);
--
2.14.1.538.gc8f31819a
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface