summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-11-06 23:52:56 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-07 13:19:18 -0800
commitcff413f14d89b8239e676240aef4d73f8ea07559 (patch)
tree8de9663d73cf2423d3bc3f18e8cd9eaa70f6c48b /profile.c
parent24c491053cd9ca2fcd1c380a23c928dce69e38d6 (diff)
downloadsubsurface-cff413f14d89b8239e676240aef4d73f8ea07559.tar.gz
The po2 argument of addS_segment is the setpoint, not the pO2 at that time
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/profile.c b/profile.c
index c74c7c0c6..5bfe7b972 100644
--- a/profile.c
+++ b/profile.c
@@ -735,7 +735,7 @@ static void calculate_ndl_tts(double tissue_tolerance, struct plot_data *entry,
while (entry->ndl_calc < max_ndl && deco_allowed_depth(tissue_tolerance, surface_pressure, dive, 1) <= 0) {
entry->ndl_calc += time_stepsize;
tissue_tolerance = add_segment(depth_to_mbar(entry->depth, dive) / 1000.0,
- &dive->cylinder[cylinderindex].gasmix, time_stepsize, entry->pressures.o2 * 1000, dive, prefs.bottomsac);
+ &dive->cylinder[cylinderindex].gasmix, time_stepsize, entry->o2setpoint * 1000, dive, prefs.bottomsac);
}
/* we don't need to calculate anything else */
return;
@@ -747,7 +747,7 @@ static void calculate_ndl_tts(double tissue_tolerance, struct plot_data *entry,
/* Add segments for movement to stopdepth */
for (; ascent_depth > next_stop; ascent_depth -= ascent_mm_per_step, entry->tts_calc += ascent_s_per_step) {
tissue_tolerance = add_segment(depth_to_mbar(ascent_depth, dive) / 1000.0,
- &dive->cylinder[cylinderindex].gasmix, ascent_s_per_step, entry->pressures.o2 * 1000, dive, prefs.decosac);
+ &dive->cylinder[cylinderindex].gasmix, ascent_s_per_step, entry->o2setpoint * 1000, dive, prefs.decosac);
next_stop = ROUND_UP(deco_allowed_depth(tissue_tolerance, surface_pressure, dive, 1), deco_stepsize);
}
ascent_depth = next_stop;
@@ -765,13 +765,13 @@ static void calculate_ndl_tts(double tissue_tolerance, struct plot_data *entry,
entry->tts_calc += time_stepsize;
tissue_tolerance = add_segment(depth_to_mbar(ascent_depth, dive) / 1000.0,
- &dive->cylinder[cylinderindex].gasmix, time_stepsize, entry->pressures.o2 * 1000, dive, prefs.decosac);
+ &dive->cylinder[cylinderindex].gasmix, time_stepsize, entry->o2setpoint * 1000, dive, prefs.decosac);
if (deco_allowed_depth(tissue_tolerance, surface_pressure, dive, 1) <= next_stop) {
/* move to the next stop and add the travel between stops */
for (; ascent_depth > next_stop; ascent_depth -= ascent_mm_per_deco_step, entry->tts_calc += ascent_s_per_deco_step)
add_segment(depth_to_mbar(ascent_depth, dive) / 1000.0,
- &dive->cylinder[cylinderindex].gasmix, ascent_s_per_deco_step, entry->pressures.o2 * 1000, dive, prefs.decosac);
+ &dive->cylinder[cylinderindex].gasmix, ascent_s_per_deco_step, entry->o2setpoint * 1000, dive, prefs.decosac);
ascent_depth = next_stop;
next_stop -= deco_stepsize;
}
@@ -799,7 +799,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
for (j = t0 + time_stepsize; j <= t1; j += time_stepsize) {
int depth = interpolate(entry[-1].depth, entry[0].depth, j - t0, t1 - t0);
double min_pressure = add_segment(depth_to_mbar(depth, dive) / 1000.0,
- &dive->cylinder[entry->cylinderindex].gasmix, time_stepsize, entry->pressures.o2 * 1000, dive, entry->sac);
+ &dive->cylinder[entry->cylinderindex].gasmix, time_stepsize, entry->o2setpoint * 1000, dive, entry->sac);
tissue_tolerance = min_pressure;
if (j - t0 < time_stepsize)
time_stepsize = j - t0;