[PATCH] Scale partial pressure graphs according to enabled gases

subsurface at henrik.synth.no subsurface at henrik.synth.no
Sun Jan 13 03:32:19 PST 2013


From: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>

The max Y value of the partial pressure graph grid tends to be way too
high when only pO2 or pHe is enabled.

Signed-off-by: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
---
 profile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/profile.c b/profile.c
index ccca599..9595c94 100644
--- a/profile.c
+++ b/profile.c
@@ -1845,11 +1845,11 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
 			entry->phe = fhe / 1000.0 * amb_pressure;
 			entry->pn2 = (1000 - fo2 - fhe) / 1000.0 * amb_pressure;
 		}
-		if (entry->po2 > pi->maxpp)
+		if (entry->po2 > pi->maxpp && prefs.pp_graphs.po2)
 			pi->maxpp = entry->po2;
-		if (entry->phe > pi->maxpp)
+		if (entry->phe > pi->maxpp && prefs.pp_graphs.phe)
 			pi->maxpp = entry->phe;
-		if (entry->pn2 > pi->maxpp)
+		if (entry->pn2 > pi->maxpp && prefs.pp_graphs.pn2)
 			pi->maxpp = entry->pn2;
 
 		/* and now let's try to do some deco calculations */
-- 
1.8.0.1



More information about the subsurface mailing list