diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-03 23:56:10 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-04 11:13:14 -0800 |
commit | 6dc247ff784d5fae6ba5721ff4c9683c1749999a (patch) | |
tree | 35b82513bbe864ee720d9ad94e0a54ba5eda38cc /profile.c | |
parent | 75b970f7accc2498289ea646b16d6f412efd1912 (diff) | |
download | subsurface-6dc247ff784d5fae6ba5721ff4c9683c1749999a.tar.gz |
Fix deco calculations to correctly use GF values and add CC support
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 <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |