diff options
author | Doug Junkins <junkins@foghead.com> | 2019-03-09 18:21:46 -0800 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-03-12 00:53:51 +0100 |
commit | 4613321e3e4c8dac659df2ec537f2978cee56c64 (patch) | |
tree | c06367a010356bfbd88e835361ae2353deb3df4c /core/statistics.h | |
parent | 62c6a19744da9ae02fe82676638f8c622f8c2e9b (diff) | |
download | subsurface-4613321e3e4c8dac659df2ec537f2978cee56c64.tar.gz |
Add backend support for statistics by depth and temperature
Added stats_t structures to summarize dive statistics by depth and
by temperature.
Process each dive to add the dive stats to the proper depth and
temperature bucket. Buckets are defined using constants
STATS_MAX_DEPTH, STATS_DEPTH_BUCKET, STATS_MAX_TEMP, and
STATS_TEMP_BUCKET which are defined in statistics.h
Signed-off-by: Doug Junkins <junkins@foghead.com>
Diffstat (limited to 'core/statistics.h')
-rw-r--r-- | core/statistics.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/statistics.h b/core/statistics.h index 6072f93b2..257303e19 100644 --- a/core/statistics.h +++ b/core/statistics.h @@ -12,6 +12,11 @@ #include "core/units.h" #include "core/dive.h" // For MAX_CYLINDERS +#define STATS_MAX_DEPTH 300 /* Max depth for stats bucket is 300m */ +#define STATS_DEPTH_BUCKET 10 /* Size of buckets for depth range */ +#define STATS_MAX_TEMP 40 /* Max temp for stats bucket is 40C */ +#define STATS_TEMP_BUCKET 5 /* Size of buckets for temp range */ + typedef struct { int period; @@ -44,6 +49,8 @@ struct stats_summary { stats_t *stats_monthly; stats_t *stats_by_trip; stats_t *stats_by_type; + stats_t *stats_by_depth; + stats_t *stats_by_temp; }; #ifdef __cplusplus |