Planner: Don't include the ascent in the default dive

Allow to both create the full default dive or ownly the descent and bottom
part (so the planner can deal with the ascent).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-05-25 15:28:55 -07:00
parent eec0b327a3
commit 660235c9b7
3 changed files with 7 additions and 5 deletions

View file

@ -59,13 +59,15 @@ void DivePlannerPointsModel::removeSelectedPoints(const QVector<int> &rows)
endRemoveRows(); endRemoveRows();
} }
void DivePlannerPointsModel::createSimpleDive() void DivePlannerPointsModel::createSimpleDive(bool planner)
{ {
// plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0); // plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0);
plannerModel->addStop(M_OR_FT(15, 45), 1 * 60, O2_IN_AIR, 0, 0, true); plannerModel->addStop(M_OR_FT(15, 45), 1 * 60, O2_IN_AIR, 0, 0, true);
plannerModel->addStop(M_OR_FT(15, 45), 40 * 60, O2_IN_AIR, 0, 0, true); plannerModel->addStop(M_OR_FT(15, 45), 40 * 60, O2_IN_AIR, 0, 0, true);
plannerModel->addStop(M_OR_FT(5, 15), 42 * 60, O2_IN_AIR, 0, 0, true); if (!planner) {
plannerModel->addStop(M_OR_FT(5, 15), 45 * 60, O2_IN_AIR, 0, 0, true); plannerModel->addStop(M_OR_FT(5, 15), 42 * 60, O2_IN_AIR, 0, 0, true);
plannerModel->addStop(M_OR_FT(5, 15), 45 * 60, O2_IN_AIR, 0, 0, true);
}
} }
void DivePlannerPointsModel::loadFromDive(dive *d) void DivePlannerPointsModel::loadFromDive(dive *d)

View file

@ -39,7 +39,7 @@ public:
void removeSelectedPoints(const QVector<int> &rows); void removeSelectedPoints(const QVector<int> &rows);
void setPlanMode(Mode mode); void setPlanMode(Mode mode);
bool isPlanner(); bool isPlanner();
void createSimpleDive(); void createSimpleDive(bool planner = false);
void clear(); void clear();
Mode currentMode() const; Mode currentMode() const;
bool setRecalc(bool recalc); bool setRecalc(bool recalc);

View file

@ -411,7 +411,7 @@ void MainWindow::on_actionDivePlanner_triggered()
ui.newProfile->setPlanState(); ui.newProfile->setPlanState();
ui.infoPane->setCurrentIndex(PLANNERWIDGET); ui.infoPane->setCurrentIndex(PLANNERWIDGET);
DivePlannerPointsModel::instance()->clear(); DivePlannerPointsModel::instance()->clear();
DivePlannerPointsModel::instance()->createSimpleDive(); DivePlannerPointsModel::instance()->createSimpleDive(true);
ui.ListWidget->reload(DiveTripModel::CURRENT); ui.ListWidget->reload(DiveTripModel::CURRENT);
} }