Commit graph

14 commits

Author SHA1 Message Date
Miika Turkia
7e47874adb SDM import: fix logic for sample import
Seems that testing if BOOKMARK is empty is a bad idea. We end up not
getting any samples, but the ones containing a bookmark. So we need to
switch the logic to testing if BOOKMARK contains something and do those
tasks first and otherwise grab a regular sample.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02 06:29:25 -05:00
Miika Turkia
19400b8da1 SDM import: calculate duration if needed
Seems that DiveManager does not always return the dive duration in
DIVETIMESEC field. In this case we can try to calculate the duration
from sample count and interval.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02 06:28:51 -05:00
Miika Turkia
05b76410d6 Use bottom temperature on Suunto SDM imports
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 15:07:47 -07:00
Miika Turkia
bfc20ae70f Fix water temperature on Suunto SDM import
Seems that Suunto stores temperature value of 0 when there is no
temperature reading (I guess). Thus this patch ignores temperature
samples that are zero. Otherwise, Subsurface looks into the samples and
grabs the lowest number as water temperature.

See #720

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-28 13:53:16 -07:00
Benjamin
fb5ae28865 Correct spelling of "weight" throughout the code.
"Weight" was misspelled "weigth" in several places in the code
and comments.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 09:40:56 -07:00
Miika Turkia
4297d931a3 Identify converted files as imported
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-08 10:17:33 -08:00
Miika Turkia
9f6b8ca89a Translate comma to colon on XML import
Translate decimal commas on XML import to decimal points. (As detected
from available sample files using Linus' debug printing.)

Also check for empty values on MacDive temperature import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-07 11:58:57 -08:00
Miika Turkia
a9cc7f9b10 Fix import when locale set to decimal comma
This should take care of locale caused problems when the input uses decimal
point but locale uses decimal comma. Also the sample I have of Suunto DM3
format weight is represented with comma instead of dot so converting that as
well.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-07 10:27:20 -08:00
Miika Turkia
52f438bcd0 Treat headings properly when importing Suunto logs
This patch will convert a heading bookmark to Subsurface format.
Suunto's bookmark uses "Heading: <degrees>°" format and was previously
set as the full event name. Now the resulting event will look like:

<event name="heading" value="333" time="0:58 min"/>

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01 21:51:42 -08:00
Linus Torvalds
b2e4ca552f Suunto SDE conversion: add boat name to notes if it exists
This is, I think, the last piece of relevant information that I can find
in Szymon's SDE file.

Which is not to mean that we get all the conversions right, or that we
handle the more complex cases (still no multi-cylinder import, for
example). But it should be much better than it used to be.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-12 12:28:40 -07:00
Linus Torvalds
36e4abf8c0 Suunto SDE updates, take 178: add weight and visibility info
This converts the weight information into subsurface weights, and also
adds visibility info (if it exists) into the notes for the dive.

More fall-out from me looking at the nasty suunto xml files, now that I
have a few that actually have some info that isn't just from the
computer download.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-12 12:21:32 -07:00
Linus Torvalds
8a58dae3ae Fix more Suunto SDM xml conversion problems
Looking at the XML of the two dives Szymon Kosecki sent out to the
subsurface list, I notice that our cylinder size conversion was wrong.
It looks like CYLINDERUNITS is what determines whether the cylinder size
is in metric (0) or imperial (1) units.

Of course, if you gave a cylinder size in cuft and didn't give a working
pressure, subsurface will just ignore the size as the random crap it is.
We *could* default to a working pressure of 3000 psi, of course.

This also picks up the CYLINDERDESCRIPTION value, although neither of
Szymon's dives actually had any description.

I need more SDE xml files to figure out how multi-cylinder dives look
etc, but I think this gets most *simple* SDE files converted almost
correctly now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-12 12:01:38 -07:00
Linus Torvalds
12f2c2ed5c Fix dive notes import from Suundo SDM
The xslt translation didn't add the <notes> tag for the notes, so while
it did select the notes from the SDM file, that never made it into the
subsurface notes.

Also added weather info to the notes, mainly as an example.

There are probably other things we could do, but this fixes at least the
trivial test-case from Szymon Kosecki.

Reported-by: Szymon Kosecki <skosecki@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-11 14:21:19 -07:00
Miika Turkia
61f3114fce XSLT to import SDM dive log
This is tested with Linus' sample data, all basic functionality seems to
be working properly. Gas changes are implemented but not tested as there
was no samples of those. Multiple cylinders are missing because there
was no samples available.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-21 11:33:52 -08:00