summaryrefslogtreecommitdiffstats
path: root/core/deco.c
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2018-04-03 19:30:27 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-05-14 23:47:00 +0300
commit27a0542220ae3766f0a98058c28e86d6c6d43a62 (patch)
treecf5a13544588d53667c2a4272a9053406b32d6a6 /core/deco.c
parentcf377beb2ea13833fa4a867b9c99153ecd9fff22 (diff)
downloadsubsurface-27a0542220ae3766f0a98058c28e86d6c6d43a62.tar.gz
Implement bailout outside of the dive planner
This is the second step for implementing bailout. The indirect calls to fill_pressures through add_segment() (in deco.c) are addressed. Bailout is now fully implemented in the dive log but not in the dive planner. 1) The parameters to add_segment() are changed to take a divemode as the second last parameter, and not a *dive. 2) Call to add_segment() in profile.c and in divelist.c are adapted. In divelist.c some calls to add_segment were left using dc-> divemode instead of possible bailout. This appears tp be the most appropriate route. 3) The functions get_divemode_from_time() and get_next_divemodechange() in dive.c have had some small changes. 4) The calls to get_segment(0 in planner.c were changed to reflect the new parameter list, but not updated to reflect bailout. This is the next step. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Diffstat (limited to 'core/deco.c')
-rw-r--r--core/deco.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/deco.c b/core/deco.c
index 5135860b8..b8780557c 100644
--- a/core/deco.c
+++ b/core/deco.c
@@ -478,14 +478,14 @@ void calc_crushing_pressure(struct deco_state *ds, double pressure)
}
/* add period_in_seconds at the given pressure and gas to the deco calculation */
-void add_segment(struct deco_state *ds, double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, const struct dive *dive, int sac)
+void add_segment(struct deco_state *ds, double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, enum dive_comp_type divemode, int sac)
{
(void) sac;
int ci;
struct gas_pressures pressures;
bool icd = false;
fill_pressures(&pressures, pressure - ((in_planner() && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE),
- gasmix, (double) ccpo2 / 1000.0, dive->dc.divemode);
+ gasmix, (double) ccpo2 / 1000.0, divemode);
for (ci = 0; ci < 16; ci++) {
double pn2_oversat = pressures.n2 - ds->tissue_n2_sat[ci];