aboutsummaryrefslogtreecommitdiffstats
path: root/divesite.h
AgeCommit message (Collapse)Author
2015-02-13Add helper function to detect empty dive sitesGravatar Dirk Hohndel
No point in keeping those. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Add another helper funtionGravatar Dirk Hohndel
We need to be able to get rid of dive sites as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Improve dive site creation from v2 git storageGravatar Dirk Hohndel
Fix broken helper function, move helper functions into the .c file (there really wasn't a good reason for these to be inline), fix the logic that decides if we want to create a new dive site or use an existing one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Improve parsing of older XML files in order to auto create dive sitesGravatar Dirk Hohndel
While the existing code worked with a couple of hand crafted examples it turns out it did a poor job with most of my files. Oops. Depending on whether we find name or coordinates first, we need to identify existing sites in either case and do the right thing. The challeng here are multiple dives at the same site with slightly different GPS coordinates. If the name is read first, these all get merged into one (and we warn about the different GPS data). But if GPS gets read first, we create separate dive sites with the same name. We need a sane UI to consolidate these - but we can't completely automate this... it's possible that these ARE the same site and the GPS data is just imprecise (for example, multiple dives at the same time with GPS locations from the Subsurface companion app). The user should be able to either pick one of the GPS locations, or keep multiple (for example, different buoyes for the same site and you want to keep the different markers). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Fix dive site creation from v2 git storageGravatar Dirk Hohndel
Clearly didn't test that part well enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Improve helper functionsGravatar Dirk Hohndel
Sometimes we want to create a dive site just based on a name, sometimes we have both a name and GPS coordinates. Let's make a helper for either case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Another helper: for_each_dive_site()Gravatar Dirk Hohndel
This doesn't make the code necessarily more compact, but easier to read and is consistent with our other patterns. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Some dive site helper functionsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Add dive site data structureGravatar Dirk Hohndel
This leaves location and gps coordinates in the struct dive to allow a step by step migration. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>