summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-10-24 16:40:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-04 07:13:04 -0800
commit06ddfc01222879ee0463affe796dba05de33b368 (patch)
treef098f39a8ffb7321e3db08989960b9dd511a1b53 /divelist.c
parentf31d34adfd9676d7ccb6544d4a2b50336295e917 (diff)
downloadsubsurface-06ddfc01222879ee0463affe796dba05de33b368.tar.gz
Prepare for PSCR calculations
Calculations for passive semi-closed rebreathers are pretty much like OC except the pO2 is lower bey a certain (SAC dependent) factor. This patch introduces the corresponding calculations in case dctype == PSCR which is so far never set and there is currently no UI for these calculations. As pO2 is SAC dependent it takes a certain attempt at getting it and drops to defaults from the prefs otherwise. As there is no UI at this point and I also don't have any dives, this has not received much testing, yet, but it compiles. At least. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/divelist.c b/divelist.c
index 1f05b6fa6..7efafa88c 100644
--- a/divelist.c
+++ b/divelist.c
@@ -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->setpoint.mbar, dive);
+ &dive->cylinder[sample->sensor].gasmix, 1, sample->setpoint.mbar, dive, dive->sac);
}
}
}
@@ -396,7 +396,7 @@ double init_decompression(struct dive *dive)
if (pdive->when > lasttime) {
surface_time = pdive->when - lasttime;
lasttime = pdive->when + pdive->duration.seconds;
- tissue_tolerance = add_segment(surface_pressure, &air, surface_time, 0, dive);
+ tissue_tolerance = add_segment(surface_pressure, &air, surface_time, 0, dive, prefs.decosac);
#if DECO_CALC_DEBUG & 2
printf("after surface intervall of %d:%02u\n", FRACTION(surface_time, 60));
dump_tissues();
@@ -407,7 +407,7 @@ double init_decompression(struct dive *dive)
if (lasttime && dive->when > lasttime) {
surface_time = dive->when - lasttime;
surface_pressure = get_surface_pressure_in_mbar(dive, true) / 1000.0;
- tissue_tolerance = add_segment(surface_pressure, &air, surface_time, 0, dive);
+ tissue_tolerance = add_segment(surface_pressure, &air, surface_time, 0, dive, prefs.decosac);
#if DECO_CALC_DEBUG & 2
printf("after surface intervall of %d:%02u\n", FRACTION(surface_time, 60));
dump_tissues();