From 0ca12c36011804eb4b2c3034269bab51ad04a500 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 19 Nov 2013 22:50:02 -0800 Subject: Collect per tank SAC rate This is a bit painful, but we basically walk the samples and pick the valid tank from the events. And then we do a simple discrete integration to figure out the mean depth per tank and duration per tank. And then we assemble all that into per tank statistics. Strangely the value calculated here seems slightly higher than one would expect from the overall SAC rate. This inconsistency should be investigated a bit further, but my guess it it's based on the assumption that the DC provided mean depth is possibly more accurate than what we can calculate from the profile. Fixes #284 Signed-off-by: Dirk Hohndel --- dive.h | 1 + 1 file changed, 1 insertion(+) (limited to 'dive.h') diff --git a/dive.h b/dive.h index 03b783480..28753e2b9 100644 --- a/dive.h +++ b/dive.h @@ -661,6 +661,7 @@ extern void copy_samples(struct dive *s, struct dive *d); extern void fill_default_cylinder(cylinder_t *cyl); extern void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int time, int idx); extern void add_event(struct divecomputer *dc, int time, int type, int flags, int value, const char *name); +extern void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *mean, int *duration); /* UI related protopypes */ -- cgit v1.2.3-70-g09d2