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 /dive.h | |
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 'dive.h')
-rw-r--r-- | dive.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -47,7 +47,7 @@ extern "C" { #include <stdbool.h> #endif -enum dive_comp_type {OC, CCR}; // Flags (Open-circuit and Closed-circuit-rebreather) for setting dive computer type +enum dive_comp_type {OC, CCR, PSCR}; // Flags (Open-circuit and Closed-circuit-rebreather) for setting dive computer type enum cylinderuse {oxygen, diluent, bailout}; // The different uses for cylinders in CCR dives struct gasmix { @@ -140,7 +140,7 @@ struct gas_pressures { double o2, n2, he; }; -extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2); +extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, enum dive_comp_type dctype, int sac); extern void sanitize_gasmix(struct gasmix *mix); extern int gasmix_distance(const struct gasmix *a, const struct gasmix *b); @@ -731,7 +731,7 @@ extern void subsurface_command_line_exit(int *, char ***); #define FRACTION(n, x) ((unsigned)(n) / (x)), ((unsigned)(n) % (x)) -extern double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive); +extern double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive, int sac); extern void clear_deco(double surface_pressure); extern void dump_tissues(void); extern unsigned int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct dive *dive, bool smooth); |