Add ability to replan a dive that we planned before

When doing this, all waypoints of the calculated ascent are now waypoints
in the plan - so the user has to remove the ascent part of the dive in
order to really replan the dive. That's a pain, but we don't keep the data
around that would tell us which waypoints are user input and which ones
were calculated.

Fixes #527

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-19 15:03:53 -05:00
parent 76f3c0f028
commit a85a219df3
4 changed files with 41 additions and 7 deletions

View file

@ -1155,7 +1155,9 @@ void DivePlannerPointsModel::createPlan()
//TODO: C-based function here?
plan(&diveplan, &cache, isPlanner(), true);
record_dive(clone_dive(&displayed_dive));
if (!current_dive || displayed_dive.id != current_dive->id)
// we were planning a new dive, not re-planning an existing on
record_dive(clone_dive(&displayed_dive));
mark_divelist_changed(true);
// Remove and clean the diveplan, so we don't delete