Make plan take dive and decotimestep as arguments

...rather than use a global variable and a macro.

This should be a no-op in preparation to allow planning
several versions of a dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2017-08-23 22:43:33 +02:00 committed by Dirk Hohndel
parent 58d7948871
commit 82aac4efff
4 changed files with 73 additions and 71 deletions

View file

@ -842,7 +842,7 @@ void DivePlannerPointsModel::createTemporaryPlan()
dump_plan(&diveplan);
#endif
if (recalcQ() && !diveplan_empty(&diveplan)) {
plan(&diveplan, &cache, isPlanner(), false);
plan(&diveplan, &displayed_dive, DECOTIMESTEP, &cache, isPlanner(), false);
emit calculatedPlanNotes();
}
// throw away the cache
@ -878,7 +878,7 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
setRecalc(oldRecalc);
//TODO: C-based function here?
plan(&diveplan, &cache, isPlanner(), true);
plan(&diveplan, &displayed_dive, DECOTIMESTEP, &cache, isPlanner(), true);
free(cache);
if (!current_dive || displayed_dive.id != current_dive->id) {
// we were planning a new dive, not re-planning an existing on