Add a meandepth to the dive structure

This is currently only used in one place (in statistics.c), but it
certainly is consistent with the other recent changes to avoid using only
the first divecomputer when trying to make statements about a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-02-09 06:50:53 -08:00
parent 0755cc522b
commit c7efcb23a9
3 changed files with 18 additions and 2 deletions

View file

@ -146,7 +146,7 @@ static void process_dive(struct dive *dp, stats_t *stats)
if (!duration)
return;
stats->avg_depth.mm = (1.0 * old_tt * stats->avg_depth.mm +
duration * dp->dc.meandepth.mm) / stats->total_time.seconds;
duration * dp->meandepth.mm) / stats->total_time.seconds;
if (dp->sac > 2800) { /* less than .1 cuft/min (2800ml/min) is bogus */
sac_time = stats->total_sac_time + duration;
stats->avg_sac.mliter = (1.0 * stats->total_sac_time * stats->avg_sac.mliter +