diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-10-24 16:40:21 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-04 07:13:04 -0800 |
commit | 06ddfc01222879ee0463affe796dba05de33b368 (patch) | |
tree | f098f39a8ffb7321e3db08989960b9dd511a1b53 /deco.c | |
parent | f31d34adfd9676d7ccb6544d4a2b50336295e917 (diff) | |
download | subsurface-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 'deco.c')
-rw-r--r-- | deco.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -18,6 +18,7 @@ #include <math.h> #include <string.h> #include "dive.h" +#include <assert.h> //! Option structure for Buehlmann decompression. struct buehlmann_config { @@ -184,12 +185,12 @@ double he_factor(int period_in_seconds, int ci) } /* add period_in_seconds at the given pressure and gas to the deco calculation */ -double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, const struct dive *dive) +double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, const struct dive *dive, int sac) { int ci; struct gas_pressures pressures; - fill_pressures(&pressures, pressure - WV_PRESSURE, gasmix, (double) ccpo2 / 1000.0); + fill_pressures(&pressures, pressure - WV_PRESSURE, gasmix, (double) ccpo2 / 1000.0, ccpo2 ? CCR : OC, sac); if (buehlmann_config.gf_low_at_maxdepth && pressure > gf_low_pressure_this_dive) gf_low_pressure_this_dive = pressure; |