Commit graph

156 commits

Author SHA1 Message Date
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
Martin Long
24ac35e107 Prevent UserID from being 'stuffed' into the start of UDDF export.
Due to there being no xsl template for the userID, it ended up getting
inserted at the start of the output. This adds an empty template to
map the <settings> element, preventing this erronious insertion.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:34 -07:00
Martin Long
aa74cd8802 Update dive site structure in UDDF export to match UDDF 3.2.0 specification.
The dive site structure in the UDDF export was using an old structure
where each site is simply listed as a <dive_site>.

The new structure requires a single <divesite> containing at least one
<divebase> - a base location where you are diving from, and at least one
<site>.

As subsurface only tracks sites, I've created a single divebase to be
referenced by all of the sites.

Note: although profiles in Subsurface can be grouped into trips, these
are groupings of profiles, not sites, and the mapping may not be
simple. e.g. on different trips the sames sites may be visited but a
different base used. Or, different bases may be used on a single trip.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:22 -07:00
Martin Long
b462a8da35 Separate out buddies into individual entities when exporting to UDDF.
Part of a series bringing UDDF export closer to the UDDF standard, as
per www.uddf.org.

Currently when exporting to UDDF buddy entities are created
one-per-unique-combination. This means that a group of buddies on a dive
are exported as a single buddy, with the names comma separated.

This patch identifies all unique buddies, whether used independently or
along with other buddies on a dive. They are then linked independently
on each profile.

It also uses the UDDF standard <link ref=""> instead of
<buddy_ref ref="">

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:13:54 -07:00
Miika Turkia
af418a9c0b Include some extra information on Shearwater import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:46:07 -06:00
Miika Turkia
b03423dd96 Samples should be inside divecomputer on Shearwater import
Data read from a divecomputer is moved inside the divecomputer tag

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:46:03 -06:00
Miika Turkia
4dc99a0b56 Add cylinder support for Shearwater XML import
This tries to grab the used cylinders when in open circuit mode.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:45:58 -06:00
Miika Turkia
d7d5c296dd Record ppO2 only when on CCR mode
Shearwater describes the current mode with tag currentCircuitSetting,
thus we should record the ppO2 only when in CCR mode.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:45:46 -06:00
Miika Turkia
1b74947bf5 Allow user to select date format on manual CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:19:49 -08:00
Miika Turkia
61ad81cf7a Default dive number on manual CSV import
If manual CSV import does not have any dive number, give a default one
so that the dives get import and not silently ignored.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 09:42:19 -08:00
Dirk Hohndel
1723c01603 Replace other references to hohndel.org
The only place where I'm not sure if there are unintended sideeffects of
changing over to the new domain is QCoreApplication::setOrganizationDomain

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:13:39 +00:00
Miika Turkia
116615857c Support timedepth mode on UDCF import
Fixes #756

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 21:12:05 -08:00
Miika Turkia
676713335b Include po2 on Shearwater import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-06 05:22:20 -08: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
8ae5b816bd Export additional tanks to divelogs.de
All recorded cylinders are exported to divelogs.de. This potentially
includes cylinders that have not been used.

The start and end pressure for additional cylinders is taken from the
cylinder information. Main tank gets this information from first and
last pressure reading or from the cylinder information if samples are
not available. This should be ok when there is only one cylinder with
pressure sensor, but does not probably work for people having multiple
sensors.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 15:48:27 -04:00
Miika Turkia
6d65e45787 Support for importing additional tanks
This patch adds support for importing additional cylinders from
divelogs.de. This also adds support for He on the import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 14:59:51 -04: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
Anton Lundin
754ed9f9fc Import decostop information from UDDF files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-20 19:25:36 -05:00
Anton Lundin
e7922f6ca8 Import NDL form UDDF files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-20 19:25:27 -05:00
Miika Turkia
bb39a8730b Hack double tank support for export to divelogs
If the cylinder description starts with D%d we test if the size in
description matches the cylinder size. If the cylinder size is double
compared to size in description, we mark the dive as double tank dive to
divelogs.de.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 06:57:55 -06:00
Miika Turkia
7f2cb179be Remove wrong unit from CNS in UDDF import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05 08:08:55 -07:00
Miika Turkia
28bd1fdcb5 CSV import: add min:sec format support
On CSV import the time can be represented with seconds, min:sec or
hour:min:sec. This patch adds support for the min:sec format that was
missing.

See #662

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-28 09:56:30 -07:00
Miika Turkia
0b5fe99353 Fix for sample interval on Divelogs.de export
Logic when to use default sample interval was mixed.

Fixes #657

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-28 09:56:18 -07:00