mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f31d34adfd
commit
06ddfc0122
8 changed files with 29 additions and 19 deletions
|
@ -127,7 +127,7 @@ double interpolate_transition(struct dive *dive, duration_t t0, duration_t t1, d
|
|||
|
||||
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);
|
||||
tissue_tolerance = add_segment(depth_to_mbar(depth, dive) / 1000.0, gasmix, 1, po2.mbar, dive, prefs.bottomsac);
|
||||
}
|
||||
return tissue_tolerance;
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ int plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool s
|
|||
|
||||
tissue_tolerance = add_segment(depth_to_mbar(depth, &displayed_dive) / 1000.0,
|
||||
&displayed_dive.cylinder[current_cylinder].gasmix,
|
||||
TIMESTEP, po2, &displayed_dive);
|
||||
TIMESTEP, po2, &displayed_dive, prefs.decosac);
|
||||
clock += TIMESTEP;
|
||||
depth -= deltad;
|
||||
} while (depth > stoplevels[stopidx]);
|
||||
|
@ -869,7 +869,7 @@ int plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool s
|
|||
deltad = trial_depth;
|
||||
tissue_tolerance = add_segment(depth_to_mbar(trial_depth, &displayed_dive) / 1000.0,
|
||||
&displayed_dive.cylinder[current_cylinder].gasmix,
|
||||
TIMESTEP, po2, &displayed_dive);
|
||||
TIMESTEP, po2, &displayed_dive, prefs.decosac);
|
||||
if (deco_allowed_depth(tissue_tolerance, diveplan->surface_pressure / 1000.0, &displayed_dive, 1) > trial_depth - deltad) {
|
||||
/* We should have stopped */
|
||||
clear_to_ascend = false;
|
||||
|
@ -892,7 +892,7 @@ int plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool s
|
|||
}
|
||||
tissue_tolerance = add_segment(depth_to_mbar(depth, &displayed_dive) / 1000.0,
|
||||
&displayed_dive.cylinder[current_cylinder].gasmix,
|
||||
DECOTIMESTEP, po2, &displayed_dive);
|
||||
DECOTIMESTEP, po2, &displayed_dive, prefs.decosac);
|
||||
cache_deco_state(tissue_tolerance, &trial_cache);
|
||||
clock += DECOTIMESTEP;
|
||||
/* Finish infinite deco */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue