Commit graph

178 commits

Author SHA1 Message Date
Miika Turkia
1e04aec7fd Preconfigured import of Subsurface CSV log file
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:43:43 -08:00
Miika Turkia
e471335af6 Include tags on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:43:37 -08:00
Miika Turkia
e750eb1686 Export total weight on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:43:30 -08:00
Miika Turkia
0b040b769d Store more cylinder information on manual CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:43:24 -08:00
Miika Turkia
4cf0f77d8a Save info only from first cylinder on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26 08:41:08 -08:00
Miika Turkia
7c23a08921 Support quoting strings with "" on manual CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:26:19 -08:00
Miika Turkia
a950365b6f Include some empty fields if they are not available
If specific value is not available, we need to have an empty value
instead.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:25:52 -08:00
Miika Turkia
663f6eef0b Include empty location and gps if non is given
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:25:35 -08:00
Miika Turkia
f9b7b9bba0 Take pressure info from first DC on CSV export
Try to grab pressure information from first DC if it is not manually
entered.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:25:16 -08:00
Miika Turkia
f1b3ecbfa9 Take depths from first DC on CSV export
We need to limit the DCs from which we grab the depths. Otherwise, we
end up with too many depth values.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:23:50 -08:00
Miika Turkia
898a62f888 Grab divecomputer/temperature on CSV export
If temperature is recorded by a DC it must be taken from under the
divecomputer tag. However, this will prefer the manually written value
if such exists.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-22 14:23:38 -08:00
Dirk Hohndel
74f5842f0c Add second CSV export with dive details
This is intended to export all the details that someone might copy from a
paper logbook. We need a matching import template to make this simple.

This hasn't been well tested, I'm sure it will break when elements and
attributes are missing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-21 21:51:54 -08:00
Miika Turkia
cdb3c87b5d Add cylinder support to manual2xml XSLT
This adds support for importing cylinder information from manually kept
dive logs. However, this cannot be used before GUI counterpart is added.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20 11:30:18 -08:00
Miika Turkia
3343634fc9 Add temperature support to manual2xml XSLT
This adds support for importing temperatures from manually kept dive logs.
However, this cannot be used before GUI counterpart is added.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20 11:30:06 -08:00
Miika Turkia
64c735f2ae Fix a bug that added 0, 0 as location on manual CSV import
The existence of location information was tested incorrectly resulting
in erroneously adding these fields if they were not present.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20 11:29:56 -08:00
Miika Turkia
683d6e1339 Describe cylinder as unknown instead of mix name
Having the mix name like EANX34 as cylinder description was apparently
confusing, so switching to 'unknown' instead.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-19 08:56:46 -08:00
Miika Turkia
299a85f668 Support cylinder information from Xdeep and Diving Log
This adds support for importing cylinder information from at least Xdeep
and Diving Log v 5.0.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 07:51:43 -08:00
Miika Turkia
ff338f62c2 Move the samples inside divecomputer tag on UDDF import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16 21:54:46 -08:00
Martin Long
51fdf86a2b Fix event/alarm types in UDDF export.
UDDF only supports a specific set of alarms. Some events also don't map
to alarms but map to other types of elements in UDDF.

This patch adds a map of the accepted types. Where a map doesn't exist
the type will not be mapped to an alarm, the option then remains to
map it to another kind of element, in the same way that happened with
headings and gas switches.

This removes the need for the specific exclusion of heading and
gas switch, as they are now simply not included in the map.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-14 23:22:05 -08:00
Miika Turkia
fef56399b9 Count the weights properly on UDDF export
Using node() along with the node-set seems to grab the weights properly
for me.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-14 10:06:34 -08:00
Miika Turkia
2307acd37f Include weight system on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:18:23 -08:00
Miika Turkia
a06ce34123 Include dive buddies on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:18:16 -08:00
Miika Turkia
1c7efda5e1 Include dive location on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:18:11 -08:00
Miika Turkia
0a533d9dc2 Include notes on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:18:07 -08:00
Miika Turkia
e5c291aca4 Fix name for temperature sample on UDDF import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:58 -08:00
Miika Turkia
41e9ec12e2 UDDF import: check following event time
Seems that our UDDF export is adding time after the event name. Thus we
need to add reading the following time as well.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:53 -08:00
Miika Turkia
88cf25075f Include temperatures properly on uddf import
Adjust to UDDF 3.2 specification and use proper tag name for air
temperature.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:49 -08:00
Miika Turkia
a2bcbae4f3 Include rating and visibility on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:42 -08:00
Miika Turkia
b694e960b7 Grab manually added air temperature on UDDF export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:38 -08:00
Miika Turkia
cb576e49d3 Include dive duration on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:28 -08:00
Miika Turkia
872ee7efab Include dive number on uddf import
Adjust to UDDF 3.2 specification

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 13:17:17 -08:00
Miika Turkia
cb0762a3ff Fix switchmix references on UDDF export
The switchmix values must be concatenated properly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 08:51:59 -08:00
Miika Turkia
453aeab470 Fix mix reference on UDDF export
The mix value must be concatenated properly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 08:51:53 -08:00
Miika Turkia
0a99c26590 Export leadquantity only when we have weights
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 08:51:47 -08:00
Miika Turkia
aa76bbaa97 Export only used cylinders to divelogs.de
This attempts to export only used cylinders to divelogs.de. The
detection is based only on o2 percentage as per our test dives. However,
the new cylinder id would be better, but that does not exist on old
dives.

Fixes #757

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 08:50:53 -08:00
Martin Long
5a3b010586 Fix bug in tankpressurebegin in UDDF export
There was a bug when the first sample doesn't contain pressure info.
This fixes that by selecting the first with pressure info.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:27:18 -08:00
Martin Long
6c891c02e5 Lots of minor UDDF export tweaks.
The XDS schema for UDDF is very sensitive to ordering of elements
so I've rearranged many of them to match. Elements in:
 - informationbeforedive
 - waypoint

Adjusted namespace of export to correct UDDF namespace.

Updated remaining references to mixes it include prefix 'mix'

Moved equipment from informationbeforedive to informationafterdive *

Change trip ids to generated IDs and updated tripmembership to use
the trip id instead of the name *

* These constitutes a difference in XSD and the documentation. I will
raise these issues with the author.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:27:13 -08:00
Martin Long
268ac6774c Various minor fixes to UDDF export
Removed underscore from buddy name elements
Added 'mix' prefix to gas ids. Ids must not start with a number.
Added mandatory profile data with empty tags.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:27:05 -08:00
Martin Long
cbb613bcde Fix divecomputer part of UDDF export
XPath was incorrect for parsing divecomputers into the equipment
section, meaning they dont get inserted.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:26:56 -08:00
Martin Long
c043d02f26 Use generated Ids for site lookup in UDDF export.
As with buddies, sites could contain characters which are not valid
in Ids. Also, it is very possible to have duplicate site names.

This uses an XSL generated id to prevent any issues.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:26:51 -08:00
Martin Long
b1da9b207f Use generated ids for buddies in UDDF export.
This is instead of using their names, which may contain illegal
characters.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:26:44 -08:00
Martin Long
8e923a5e35 Update UDDF export <generator> header to include madatory tags.
Add name at <generator> level, and add additional <homepage> in
contact tag.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 18:26:40 -08:00
Martin Long
71949b20d4 Add 'trip' support to UDDF export
Currently repetition groups are used to group dives into trips. This
is not really correct. Repetition groups should really represent a
group of dives where tissue loading needs to be preserved between
dives (typically the same day).

UDDF has support for trips, using the <divetrip> tags. This is a
bidirectional link between the dives and the trips.

This patch adds support for these trips. However, it leaves in the
repetition groups. Repetition groups may need further consideration.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 15:51:05 -07:00
Martin Long
434f19cf56 Aggregate multiple weights into UDDF export.
Sum together all of the weights recored on a dive to use in the
<leadquantity> tag in UDDF export.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 14:49:39 -07:00
Martin Long
18aa6f5ed8 Support buddies with only a first name, no surname.
The previous patch would not fill the first name field if there was
no second name. This rectifies that.

Signed-Off-By: Martin Long <martin@longhome.co.uk>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 14:49:32 -07:00
Miika Turkia
54d8cee3d8 Allow more flexible GPS coordinates for CSV import
This theoretically allows one to use format like
1°36'11.711"N 124°46'00.368"E for GPS coordinates. However, in practice
this is not allowed without properly parsing this format in C/C++ side.

This patch changes the export format to UTF8 and improves the location
import by allowing either gps or location attributes to be imported.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 10:51:57 -07:00
Martin Long
7ea27a2d88 Fixed airtemperature in UDDF export.
The XSLT didn't expect the temperature tag to be within the
<divecomputer> element in the source, so the selection wasn't finding
it.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:15:07 -07:00
Martin Long
f460ef581a Added <leadquantity> to UDDF export, showing weight used.
Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:53 -07:00
Martin Long
721760e532 Split last_name and first_name for buddies in UDDF export
Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:49 -07:00
Martin Long
7367ccfb09 Fix gasdefinitons in UDDF export
Selection of <cylinder> elements wasn't working where dives are
part of a trip. Change the selection so that it will select all
cylinders whether or not the dive is part of a trip.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:44 -07:00