diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-10-19 07:07:07 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-19 07:07:07 -0700 |
commit | 5f44fdd9cf6fba073837cbc1d89c6ed3ea28dd76 (patch) | |
tree | ccf7ecf769b5b3240fa313233eff78c0f52c7881 /divelist.c | |
parent | 839bcaaf70b763590509031208b6786288910bc3 (diff) | |
download | subsurface-5f44fdd9cf6fba073837cbc1d89c6ed3ea28dd76.tar.gz |
Make planner work again for CCR dives
The latest CCR patches had rendered the planner not usable for CCR dives.
This patch corrects this (and reenables the CCR set point column for
segments). The problem was that a new member setpoint of struct divepoint
had been introduced, but there was already po2 which had the same meaning.
This patch merges the two and renames them setpoint to prevent future
confusion.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/divelist.c b/divelist.c index cccd3a0a6..1f05b6fa6 100644 --- a/divelist.c +++ b/divelist.c @@ -171,8 +171,8 @@ static int calculate_otu(struct dive *dive) struct sample *sample = dc->sample + i; struct sample *psample = sample - 1; t = sample->time.seconds - psample->time.seconds; - if (sample->po2.mbar) { - po2 = sample->po2.mbar; + if (sample->setpoint.mbar) { + po2 = sample->setpoint.mbar; } else { int o2 = active_o2(dive, dc, sample->time); po2 = o2 * depth_to_atm(sample->depth.mm, dive); @@ -235,8 +235,8 @@ static int calculate_cns(struct dive *dive) struct sample *sample = dc->sample + i; struct sample *psample = sample - 1; t = sample->time.seconds - psample->time.seconds; - if (sample->po2.mbar) { - po2 = sample->po2.mbar; + if (sample->setpoint.mbar) { + po2 = sample->setpoint.mbar; } else { int o2 = active_o2(dive, dc, sample->time); po2 = o2 * depth_to_atm(sample->depth.mm, dive); @@ -322,7 +322,7 @@ static void add_dive_to_deco(struct dive *dive) for (j = t0; j < t1; j++) { int depth = interpolate(psample->depth.mm, sample->depth.mm, j - t0, t1 - t0); (void)add_segment(depth_to_mbar(depth, dive) / 1000.0, - &dive->cylinder[sample->sensor].gasmix, 1, sample->po2.mbar, dive); + &dive->cylinder[sample->sensor].gasmix, 1, sample->setpoint.mbar, dive); } } } |