profile: display arbitrary dive

So far the profile operated on the global displayed_dive. Instead,
take the dive to be displayed as a parameter to the plotDive()
functions.

This is necessary if we want to have multiple concurrent
profile objects. Think for example for printing or for mobile
where multiple dive objects are active at the same time.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-28 14:24:38 +01:00 committed by Dirk Hohndel
parent 36f0ba9abe
commit 2789bb05b1
9 changed files with 121 additions and 131 deletions

View file

@ -541,7 +541,7 @@ void PlannerWidgets::planDive()
{
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
MainWindow::instance()->graphics->setPlanState();
MainWindow::instance()->graphics->setPlanState(&displayed_dive, 0);
dc_number = 0;
// create a simple starting dive, using the first gas from the just copied cylinders
@ -569,7 +569,7 @@ void PlannerWidgets::replanDive()
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
DivePlannerPointsModel::instance()->loadFromDive(&displayed_dive);
MainWindow::instance()->graphics->setPlanState();
MainWindow::instance()->graphics->setPlanState(&displayed_dive, 0);
plannerWidget.setReplanButton(true);
plannerWidget.setupStartTime(timestampToDateTime(displayed_dive.when));