Correctly convert an existing dive into a plan

I missed this one spot when converting back to the different semantics for
divedatapoints.

With this change add dive appears to work correctly (fingers crossed).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-13 22:39:05 +09:00
parent bb041069a3
commit 98322a976c

View file

@ -444,10 +444,12 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
for(int i = 0; i < d->dc.samples-1; i++){
backupSamples.push_back( d->dc.sample[i]);
}
int lasttime = 0;
Q_FOREACH(const sample &s, backupSamples){
int o2 = 0, he = 0;
get_gas_from_events(&backupDive->dc, s.time.seconds, &o2, &he);
get_gas_from_events(&backupDive->dc, lasttime, &o2, &he);
plannerModel->addStop(s.depth.mm, s.time.seconds, o2, he, 0);
lasttime = s.time.seconds;
}
}