aboutsummaryrefslogtreecommitdiffstats
path: root/core/import-shearwater.c
AgeCommit message (Collapse)Author
2019-04-12Parser: parse into custom dive site tableGravatar Berthold Stoeger
To extend the undo system to dive sites, the importers and downloaders must not parse directly into the global dive site table. Instead, pass a dive_site_table argument to parse into. For now, always pass the global dive_site_table so that this commit should not cause any functional change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-09Parser: add trip_table parameter to parsing functionsGravatar Berthold Stoeger
To allow parsing into arbitrary trip_tables, add the corresponding parameter to the parsing functions and the parser state. Currently, all callers pass the global trip_table so there should be no change in functionality. These arguments will be replaced in subsequent commits. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-03Use state structure for sample rate infoGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-01Use correct value for PO2Gravatar Miika Turkia
averagePPO2 appears to be correct value instead of currentPPO2SetPoint. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-12-31Grab correct setpoint on Shearwater cloud importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-12-30Use different time field as it seems to be more correctGravatar Miika Turkia
The starTimestamp is 4 hours apart on 2 different DCs within the sample log. DiveDate on the dive_logs table seems to be correct, but must be converted from human readable format. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-12-29Sample rate varies between divesGravatar Miika Turkia
Seems that Shearwater cloud stores sample rate into the database and it is not constant within the log. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-12-29Initial support for Shearwater CloudGravatar Miika Turkia
This works to some extent to part of a sample log I received. However, still quite a bit more work is needed. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-12-29Shearwater import: dive id might be large than intGravatar Miika Turkia
I encountered this while implementing Shearwater Cloud import, but it makes sense to increase the size for dive id for Shearwater Desktop as well. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-23Parser: make parser (mostly) reentrantGravatar Berthold Stoeger
Introduce a parser_state structure, which describes (most) of the global parser state. Create such a structure in the entry routines to the parser and pass it down to the individual functions. The parser state is initialized and freed with the init_parser_state() and free_parser_state() functions. The main benefits are: 1) Isolation of parser state. 2) Keeping the global name space tidy. 3) Prevent memory leaks which could happen in truncated files by freeing all the parser state after parse. A somewhat controversial point might be that the individual parsing functions are split in those that need parser-state and those that don't. This means that there are now two versions of the MATCH macro, viz. one for the former and one for the latter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-27Remove unnecessary {}Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-27Shearwater import: avoid running atoi multiple timesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-27Shearwater import: support for DC reported ceilingGravatar Miika Turkia
This adds support for DC reported ceiling when importing the Shearwater Desktop database. Both AI and non-AI versions are tested, but not all possible paths. For non-AI the DC reported ceiling was from firstStopDepth and for the AI version it was from the decoCeiling field. I do not currently know when each of these fields are used, but at least this works on my test data. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-24core: replace (void) with UNUSED(x) and include ssrf.hGravatar jan Iversen
Unused parameters in C are "silenced" by adding UNUSED(x) Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-14Core: introduce new subsurface-string headerGravatar Dirk Hohndel
First small step to shrinking dive.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-29Move Shearwater DB import into its own fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>