mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Don't creat zero minute legs for gas switchen when replanning
Gas switches appear as special samples with zero or one second duration. Those can be confusing when they appear as zero duration in the dive plan when replanning, so better suppress theose. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
4cc4f5dd7b
commit
79bba04fd4
1 changed files with 5 additions and 1 deletions
|
@ -72,6 +72,7 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
|
|||
recalc = false;
|
||||
CylindersModel::instance()->updateDive();
|
||||
duration_t lasttime = {};
|
||||
duration_t lastrecordedtime = {};
|
||||
duration_t newtime = {};
|
||||
free_dps(&diveplan);
|
||||
diveplan.when = d->when;
|
||||
|
@ -103,7 +104,10 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
|
|||
}
|
||||
if (samplecount) {
|
||||
int cylinderid = get_cylinderid_at_time(d, dc, lasttime);
|
||||
if (newtime.seconds - lastrecordedtime.seconds > 10) {
|
||||
addStop(depthsum / samplecount, newtime.seconds, cylinderid, 0, true);
|
||||
lastrecordedtime = newtime;
|
||||
}
|
||||
lasttime = newtime;
|
||||
depthsum = 0;
|
||||
samplecount = 0;
|
||||
|
|
Loading…
Reference in a new issue