]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Merge branch 'add-info-stats-page' of git://github.com/dirkhh/subsurface
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Nov 2011 23:49:33 +0000 (16:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Nov 2011 23:49:33 +0000 (16:49 -0700)
* 'add-info-stats-page' of git://github.com/dirkhh/subsurface:
  Exclude obviously bogus SAC values from statistics calculations

statistics.c

index 351f2d1507062024f37ea6cd4dd737291841b524..8000309c3d0d53da48811ed33056e1dacf79af12 100644 (file)
@@ -76,7 +76,7 @@ static void process_all_dives(struct dive *dive, struct dive **prev_dive)
                        info_stat.max_depth.mm = dp->maxdepth.mm;
                info_stat.avg_depth.mm = (1.0 * old_tt * info_stat.avg_depth.mm +
                                dp->duration.seconds * dp->meandepth.mm) / info_stat.total_time.seconds;
-               if (dp->sac > 0) {
+               if (dp->sac > 2800) { /* less than .1 cuft/min (2800ml/min) is bogus */
                        int old_sac_time = sac_time;
                        sac_time += dp->duration.seconds;
                        info_stat.avg_sac.mliter = (1.0 * old_sac_time * info_stat.avg_sac.mliter +