Care about drop_stone_mode in createSimpleDive

The checkbox is remembered as long as the program is still running, so
if you planned one dive with drop_stone_mode and saved/aborted and then
tried to plan another one we had a first "down" waypoint from
createSimpleDive and drop_stone_mode was also enabled.

This makes sure we don't add the first waypoint in createSimpleDive when
drop_stone_mode is enabled and lets that add a implicit first waypoint.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2014-06-27 08:04:47 +02:00 committed by Dirk Hohndel
parent 707b9f0666
commit b6fac74f6e

View file

@ -70,7 +70,11 @@ void DivePlannerPointsModel::createSimpleDive()
// let's use the gas from the first cylinder // let's use the gas from the first cylinder
gas = stagingDive->cylinder[0].gasmix; gas = stagingDive->cylinder[0].gasmix;
plannerModel->addStop(M_OR_FT(15, 45), 1 * 60, &gas, 0, true); // If we're in drop_stone_mode, don't add a first point.
// It will be added implicit.
if (!drop_stone_mode)
plannerModel->addStop(M_OR_FT(15, 45), 1 * 60, &gas, 0, true);
plannerModel->addStop(M_OR_FT(15, 45), 40 * 60, &gas, 0, true); plannerModel->addStop(M_OR_FT(15, 45), 40 * 60, &gas, 0, true);
if (!isPlanner()) { if (!isPlanner()) {
plannerModel->addStop(M_OR_FT(5, 15), 42 * 60, &gas, 0, true); plannerModel->addStop(M_OR_FT(5, 15), 42 * 60, &gas, 0, true);