mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Import and merge GPS data from the webservice
Dive locations marked (and named) via the companion app are downloaded from the webservice, parsed and merged with the existing dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b1db60ba47
commit
c521aec884
4 changed files with 35 additions and 3 deletions
7
dive.c
7
dive.c
|
@ -1209,12 +1209,17 @@ static int max_time(duration_t a, duration_t b)
|
|||
*/
|
||||
static int likely_same_dive(struct dive *a, struct dive *b)
|
||||
{
|
||||
int fuzz, match;
|
||||
int match, fuzz = 20 * 60;
|
||||
|
||||
/* Don't try to merge dives in different trips */
|
||||
if (a->divetrip && b->divetrip && a->divetrip != b->divetrip)
|
||||
return 0;
|
||||
|
||||
/* if one of the dives has no depth and duration this could be
|
||||
* a location marker from the webservice */
|
||||
if ((!a->maxdepth.mm && !a->duration.seconds) ||
|
||||
(!b->maxdepth.mm && !b->duration.seconds))
|
||||
return ((a->when <= b->when + fuzz) && (a->when >= b->when - fuzz));
|
||||
/*
|
||||
* Do some basic sanity testing of the values we
|
||||
* have filled in during 'fixup_dive()'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue