X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=statistics.c;h=bf37bf85e01c489ae374e00a7b12f52cadae224a;hb=edbba678b3cdc8f06a84a965b04f13ef1f4ecaab;hp=56b04f283de79a9f38b29dd27d2171544a1f4e54;hpb=ba6c57083177178c2c5bfda832bc2afe03cb249f;p=ext%2Fsubsurface.git diff --git a/statistics.c b/statistics.c index 56b04f2..bf37bf8 100644 --- a/statistics.c +++ b/statistics.c @@ -76,14 +76,14 @@ 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 + dp->duration.seconds * dp->sac) / sac_time ; if (dp->sac > info_stat.max_sac.mliter) info_stat.max_sac.mliter = dp->sac; - if (info_stat.min_sac.mliter == 0 || dp->sac < info_stat.max_sac.mliter) + if (info_stat.min_sac.mliter == 0 || dp->sac < info_stat.min_sac.mliter) info_stat.min_sac.mliter = dp->sac; } } @@ -140,8 +140,11 @@ void show_dive_stats(struct dive *dive) set_label(info_stat_w.max_depth, "%.*f %s", decimals, value, unit); value = get_depth_units(dive->meandepth.mm, &decimals, &unit); set_label(info_stat_w.avg_depth, "%.*f %s", decimals, value, unit); - value = get_temp_units(dive->watertemp.mkelvin, &unit); - set_label(info_stat_w.water_temp, "%.1f %s", value, unit); + if (dive->watertemp.mkelvin > 200) { + value = get_temp_units(dive->watertemp.mkelvin, &unit); + set_label(info_stat_w.water_temp, "%.1f %s", value, unit); + } else + set_label(info_stat_w.water_temp, ""); value = get_volume_units(dive->sac, &decimals, &unit); if (value > 0) { set_label(info_stat_w.sac, "%.*f %s/min", decimals, value, unit); @@ -175,8 +178,7 @@ void show_dive_stats(struct dive *dive) gas_used += cyl->type.size.mliter / 1000.0 * (cyl->start.mbar - cyl->end.mbar); } - if (offset) - set_label(info_stat_w.o2he, buf); + set_label(info_stat_w.o2he, buf); if (gas_used) { value = get_volume_units(gas_used, &decimals, &unit); set_label(info_stat_w.gas_used, "%.*f %s", decimals, value, unit);