summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2014-07-18 20:25:00 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-18 17:55:10 -0700
commit93f63466d61f9cfb0bb79c44f11e10e31fc46a3b (patch)
tree0b3ddce36e6fd3137aec296f583dae0ac72024d3 /planner.c
parent88a0dc1bb2bc24609a8556f6a4d4214b797bde04 (diff)
downloadsubsurface-93f63466d61f9cfb0bb79c44f11e10e31fc46a3b.tar.gz
Use our types in interpolate_transition
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/planner.c b/planner.c
index 8c442042e..dc80729ec 100644
--- a/planner.c
+++ b/planner.c
@@ -118,14 +118,14 @@ int get_gasidx(struct dive *dive, struct gasmix *mix)
return -1;
}
-double interpolate_transition(struct dive *dive, int t0, int t1, int d0, int d1, const struct gasmix *gasmix, int po2)
+double interpolate_transition(struct dive *dive, duration_t t0, duration_t t1, depth_t d0, depth_t d1, const struct gasmix *gasmix, o2pressure_t po2)
{
int j;
double tissue_tolerance = 0.0;
- for (j = t0; j < t1; j++) {
- int depth = interpolate(d0, d1, j - t0, t1 - t0);
- tissue_tolerance = add_segment(depth_to_mbar(depth, dive) / 1000.0, gasmix, 1, po2, dive);
+ for (j = t0.seconds; j < t1.seconds; j++) {
+ int depth = interpolate(d0.mm, d1.mm, j - t0.seconds, t1.seconds - t0.seconds);
+ tissue_tolerance = add_segment(depth_to_mbar(depth, dive) / 1000.0, gasmix, 1, po2.mbar, dive);
}
return tissue_tolerance;
}
@@ -160,7 +160,7 @@ double tissue_at_end(struct dive *dive, char **cached_datap)
get_gas_at_time(dive, dc, t0, &gas);
if (i > 0)
lastdepth = psample->depth;
- tissue_tolerance = interpolate_transition(dive, t0.seconds, t1.seconds, lastdepth.mm, sample->depth.mm, &gas, sample->po2.mbar);
+ tissue_tolerance = interpolate_transition(dive, t0, t1, lastdepth, sample->depth, &gas, sample->po2);
psample = sample;
t0 = t1;
}