diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-05-25 22:29:25 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-26 15:44:36 -0700 |
commit | 57ee5a5477c92ff4dd7b8975b1866c988556d14e (patch) | |
tree | c97be555946401540f5819078e75a6e981557b1f /core/profile.c | |
parent | b1ccd2fc43a309631ead61465e50d63f76844571 (diff) | |
download | subsurface-57ee5a5477c92ff4dd7b8975b1866c988556d14e.tar.gz |
Assemble global state of planner in a struct
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/profile.c')
-rw-r--r-- | core/profile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/profile.c b/core/profile.c index fc2b478e1..efe97d4f3 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1018,11 +1018,11 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru } } for (j = 0; j < 16; j++) { - double m_value = buehlmann_inertgas_a[j] + entry->ambpressure / buehlmann_inertgas_b[j]; - entry->ceilings[j] = deco_allowed_depth(tolerated_by_tissue[j], surface_pressure, dive, 1); - entry->percentages[j] = tissue_inertgas_saturation[j] < entry->ambpressure ? - lrint(tissue_inertgas_saturation[j] / entry->ambpressure * AMB_PERCENTAGE) : - lrint(AMB_PERCENTAGE + (tissue_inertgas_saturation[j] - entry->ambpressure) / (m_value - entry->ambpressure) * (100.0 - AMB_PERCENTAGE)); + double m_value = deco_state->buehlmann_inertgas_a[j] + entry->ambpressure / deco_state->buehlmann_inertgas_b[j]; + entry->ceilings[j] = deco_allowed_depth(deco_state->tolerated_by_tissue[j], surface_pressure, dive, 1); + entry->percentages[j] = deco_state->tissue_inertgas_saturation[j] < entry->ambpressure ? + lrint(deco_state->tissue_inertgas_saturation[j] / entry->ambpressure * AMB_PERCENTAGE) : + lrint(AMB_PERCENTAGE + (deco_state->tissue_inertgas_saturation[j] - entry->ambpressure) / (m_value - entry->ambpressure) * (100.0 - AMB_PERCENTAGE)); } /* should we do more calculations? |