mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
62c6a19744
commit
4613321e3e
2 changed files with 70 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue