From 6dc247ff784d5fae6ba5721ff4c9683c1749999a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 3 Jan 2013 23:56:10 -0800 Subject: Fix deco calculations to correctly use GF values and add CC support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old implementation was broken in several ways. For one thing the GF values are percentages, so they should normally be 0 < GF < 1 (well, some crazy people like to go above that). With this most of the Bühlmann config constants were wrong. Furthermore, after we adjust the pressure tolerance based on the gradient factors, we need to convert this back into a depth (instead of passing back the unmodified depth - oops). Finally, this commit adds closed circuit support to the deco calculations. Major progress and much more useful at this stage. Signed-off-by: Dirk Hohndel --- profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profile.c') diff --git a/profile.c b/profile.c index 32a91d2e6..6de888607 100644 --- a/profile.c +++ b/profile.c @@ -1758,7 +1758,7 @@ static struct plot_info *create_plot_info(struct dive *dive, struct divecomputer for (j = t0; j < t1; j++) { int depth = 0.5 + (entry - 1)->depth + (j - t0) * (entry->depth - (entry - 1)->depth) / (t1 - t0); double min_pressure = add_segment(depth_to_mbar(depth, dive) / 1000.0, - &dive->cylinder[cylinderindex].gasmix, 1); + &dive->cylinder[cylinderindex].gasmix, 1, entry->po2); if (min_pressure > ceiling_pressure) ceiling_pressure = min_pressure; } -- cgit v1.2.3-70-g09d2