summaryrefslogtreecommitdiffstats
path: root/core/planner.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2016-11-27 11:31:30 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-12-04 05:32:08 +0900
commitf03acb9e9a2d6fae22be6288be13ce63fd4f50ea (patch)
tree5b4be4d5168073288a08ba418f391522e33985ce /core/planner.c
parent4d0d37b6903a65ade442fece35238d1670522df2 (diff)
downloadsubsurface-f03acb9e9a2d6fae22be6288be13ce63fd4f50ea.tar.gz
Fix effective GFs in notes
This patch fixes two bugs: 1) It first computes the effective gradient factors and then composes the notes with the diveplan rather than the other way around. 2) It does not try to fit a line through a single point. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/planner.c')
-rw-r--r--core/planner.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/planner.c b/core/planner.c
index 488fcb9c4..ccb71c3ea 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -1362,15 +1362,15 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
} while (!is_final_plan);
plan_add_segment(diveplan, clock - previous_point_time, 0, current_cylinder, po2, false);
- create_dive_from_plan(diveplan, is_planner);
- add_plan_to_notes(diveplan, &displayed_dive, show_disclaimer, error);
- fixup_dc_duration(&displayed_dive.dc);
-
if(prefs.deco_mode == VPMB) {
diveplan->eff_gfhigh = rint(100.0 * regressionb());
diveplan->eff_gflow = rint(100*(regressiona() * first_stop_depth + regressionb()));
}
+ create_dive_from_plan(diveplan, is_planner);
+ add_plan_to_notes(diveplan, &displayed_dive, show_disclaimer, error);
+ fixup_dc_duration(&displayed_dive.dc);
+
free(stoplevels);
free(gaschanges);
free(bottom_cache);