mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
ToolTipItem: show gf line based on correct gradient factor preferences
Calculate gfline using the gradient factor that is set by the planner preferences when in the planner, and by the general prefs when not in the planner. This is achieved by doing the gradient factor calculation in dive.c, where buehlmann_config is defined. Previously, the gfline was calculated using the general preferences gfhigh and gflow, even when in the planner. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a2d6bcf23f
commit
ebddf95252
3 changed files with 17 additions and 4 deletions
|
|
@ -962,10 +962,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
|
|||
int time_stepsize = 20;
|
||||
|
||||
entry->ambpressure = depth_to_bar(entry->depth, dive);
|
||||
entry->gfline = MAX((double)prefs.gflow, (entry->ambpressure - surface_pressure) / (gf_low_pressure_this_dive - surface_pressure) *
|
||||
(prefs.gflow - prefs.gfhigh) +
|
||||
prefs.gfhigh) *
|
||||
(100.0 - AMB_PERCENTAGE) / 100.0 + AMB_PERCENTAGE;
|
||||
entry->gfline = get_gf(entry->ambpressure, dive) * (100.0 - AMB_PERCENTAGE) + AMB_PERCENTAGE;
|
||||
if (t0 > t1) {
|
||||
fprintf(stderr, "non-monotonous dive stamps %d %d\n", t0, t1);
|
||||
int xchg = t1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue