Commit graph

408 commits

Author SHA1 Message Date
Miika Turkia
de76cb3ebb Fix UDCF import time unit in timedepthmode
The timedepthmode specifies the time in seconds when using si units,
otherwise minutes. This patch implements this support.

Fixes #981

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-26 23:11:18 -08:00
Miika Turkia
6381425476 Fix UDDF import indentation
Only indentation is changed on this commit.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:24:09 -08:00
Miika Turkia
af323a9fb1 Only include samples with data on UDDF import
According to the specification each proper sample should have depth, so
we can just ignore the empty waypoints.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:24:05 -08:00
Miika Turkia
4833d6bd72 Grab all gas mixes only when no tank data is given
Grabbing all gas mixes was added for Xdeep default cylinders, and it is
not required for other data sources that have tankdata info in the UDDF
file.

See #958

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 21:04:47 -08:00
Miika Turkia
bf2df951e6 Divelogs.de export: split location on slash
As we join LOCATION with SITE on divelogs.de import using slash (/) as a
separator, we might as well split on last slash on export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-24 20:17:21 +09:00
Miika Turkia
058575bbbc CSV import: use the delta value instead of 1 sec
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01 07:54:51 -04:00
Miika Turkia
f5b17f2d29 Divelogs.de import: set default working pressure
Let's use the same assumption for working pressure (where not defined)
as the origin uses.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-24 07:11:18 -07:00
Miika Turkia
f38f8ce4c9 Add importing of working pressure from divelogs.de
We were missing the import of cylinders' working pressure when syncing
with divelogs.de. This piece of information is required for proper unit
conversions when user uses imperial units for displaying the
dive information. (Both Subsurface and divelogs.de use metric
internally, or at least the export from divelogs.de is in metric.)

See #907

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-12 12:36:26 -07:00
Miika Turkia
5430eec99d New location management for divelogs.de export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07 07:24:11 -07:00
Miika Turkia
c8e542e5d3 UDDF export: adapt to new dive site management
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07 07:23:46 -07:00
Miika Turkia
e8df3da9e3 CSV export: support for new location management
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-06 07:40:40 -07:00
Miika Turkia
21d8d26da1 CSV import: imperial support for cylinder pressure
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:32:27 -07:00
Miika Turkia
232001a1f5 CSV import: implement unit conversion for temperature
If input is in F, we need to convert it to C on import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:32:23 -07:00
Miika Turkia
d7a5bae4c8 CSV import: fix imperial conversion for weight
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31 10:32:17 -07:00
Miika Turkia
02488ba9df CSV import: add XSLT support for DC hw info
Include the DC's hardware name if it was given as parameter on CSV
import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:34:04 -07:00
Miika Turkia
615f45e58b CSV import: create o2 and diluent cylinders for CCR
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:33:57 -07:00
Miika Turkia
2fc54b6855 Add setpoint support on CSV import (XSLT parsing)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-21 07:34:13 -07:00
Anton Lundin
feb15a5498 Set the number of o2 sensors on a CSV import
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:43:28 -07:00
Anton Lundin
d3d5f88384 Correctly tag a CSV imported CCR dive as CCR
This looks if we're importing any o2 values form the csv file, then its
probably a CCR dive.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:43:19 -07:00
Anton Lundin
4867363ec5 Move model tagging to xslt
Instead of replacing all the empty model tags after a csv to xml
transform with some text, just produce that text in the csv to xml
transform instead.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:43:04 -07:00
Anton Lundin
f04b3bc166 Add support for importing O2 sensors from CSV file
This adds support for importing individual O2 sensors from a CSV file,
e.g. an APD log viewer file.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:42:05 -07:00
Miika Turkia
95c2c06be4 Clean up MacDive location conversion
We got additional slashes in front of the site if country and/or
location was missing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-21 08:47:29 -07:00
Miika Turkia
69b4a404b9 Ignore the gas_change alarm on MacDive import
As the gas changes can be parsed more reliably from the gases list, we
just ignore the gas_change events as redundant information.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-07 11:17:17 -07:00
Miika Turkia
30a60f34b6 Parse MacDive gas usage from gases list
Gas change events can be parsed properly from the gases list with clear
information on what the gas mixture was.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-07 11:17:10 -07:00
Miika Turkia
381f702017 Use function from commonTemplates on MacDive import
Get rid of duplicate function.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-07 11:17:03 -07:00
Miika Turkia
55a7715be0 Import tags from MacDive
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-07 11:16:57 -07:00
Miika Turkia
973713e9db Parse the MacDive gaschange values
Fixes #869

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-07 11:16:47 -07:00
Miika Turkia
9cd79776f2 Fix event name for MacDive gas changes
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-07 11:16:40 -07:00
Miika Turkia
178fb5152f Add new fields as extra data on MacDive import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-04 10:55:47 -07:00
Miika Turkia
01faebc99b Add entryType as tag on MacDive import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-04 10:55:41 -07:00
Miika Turkia
fdd714435e Have computer data inside divecomputer tag
This includes all the data computer related data within the divecomputer
tag. All the extra noise is just indentation (apart from moving the
divecomputer end tag).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-04 10:55:29 -07:00
Miika Turkia
4f5db4a11f Re-order the MacDive import
Next commit will do indentation so this one will keep it clear of what
actually occurs.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-04 10:55:24 -07:00
Miika Turkia
6cd71882f2 Support for new data format for MacDive
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-04 10:55:20 -07:00
Miika Turkia
1559eb590d Use dynamic sample interval on divelogs.de export
Rounding always up should give us sensible sample interval as EON Steel
adds extra samples.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-02 11:25:57 -07:00
Miika Turkia
4f83bb9236 Have the dive duration in variable for further use
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-02 11:25:35 -07:00
Miika Turkia
c21883c419 Select only "meaningful" samples for divelogs.de export
The logic to select samples from EON Steel for divelogs.de export is the
following:
- Ignore sample at time zero, as that is surface, and the second "odd"
  sample contains information we are interested in
- Grab the second sample, first sample with pressure and temperature
  readings
- Grab the third sample - "grand parent" is 0, thus our first interval
  sample
- Grab the samples when the predecessor (or grand parent) is at least 10
  seconds away

This logic seems to produce reasonable results when exporting EON Steel
logs to divelogs.de. Naturally there might be corner cases, that are not
taken into account, but this basic logic seems reasonable in normal
cases. (Unfortunately analysis is done based on a single dive.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30 16:55:39 -07:00
Miika Turkia
3f25f84127 Use variable to track special handling of DCs
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30 16:55:01 -07:00
Miika Turkia
5ab0cac1ca Set EON Steel sample interval to 10s on
This sets the Suunto EON Steel sample interval to 10 seconds when
exporting to divelogs.de.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30 16:54:27 -07:00
Miika Turkia
c80d1879b7 Add suit field for CSV import
Fixes #853

[Dirk Hohndel: fixed test compile]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 06:50:50 -07:00
Miika Turkia
86ac7fdf47 Import support for new Seabear format
This add support for Seabear's new import format that is used by H3 and
T1. In the future also the Hudc  should switch to the new format. The
main difference to the old one is that time stamps are no longer
recorded in the samples, but intervali is specified in the header.

The header contains other useful information as well that we should
build support for. E.g. surface pressure, gas mixes, GF, and mode might
be useful additions later on.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-23 05:44:06 -07:00
Dirk Hohndel
f1f02941c7 Merge branch 'v4.4-branch' back into master
The manuals all will need a careful read.
The changes to use lsb-release and the PCLinuxOS specific files got lost
because I didn't want to try to rewite this in the middle of a merge.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>

Conflicts:
	Documentation/50-pot/subsurface-manual.pot
	Documentation/fr/po/subsurface-manual.fr.po
	Documentation/user-manual.txt
	Documentation/user-manual_es.txt
	Documentation/user-manual_fr.html.git
	Documentation/user-manual_fr.txt
	Documentation/user-manual_ru.html.git
	Documentation/user-manual_ru.txt
	file.c
	qthelper.cpp
	subsurface.pro
	subsurfacesysinfo.cpp
	xslt/DiveLog.xslt
2015-02-19 19:44:37 -08:00
Miika Turkia
554b652d25 DiveLog import: Only include weight when available
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-18 11:11:03 -08:00
Miika Turkia
541ec4fcac Add some extra data for DiveLog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-18 11:10:54 -08:00
Miika Turkia
b87eb78192 Add serial number to DiveLog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-18 11:10:38 -08:00
Miika Turkia
f7365015ff Include Boat in DiveLog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-18 11:10:32 -08:00
Miika Turkia
265128451f Add visibility and weather to dive notes
This adds a bit more information to dive notes on DiveLog import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 14:07:25 -08:00
Miika Turkia
169fb32484 Add time to DiveLog import
I originally thought about converting the time as well, but my fingers
were too slow and memory too short to actually do that :D

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 14:07:22 -08:00
Miika Turkia
3aaa995fc9 XSLT to import MacDive logs
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 14:06:55 -08:00
Miika Turkia
371feac82f Add visibility and weather to dive notes
This adds a bit more information to dive notes on DiveLog import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 12:29:00 -08:00
Miika Turkia
4f26240b55 Add time to DiveLog import
I originally thought about converting the time as well, but my fingers
were too slow and memory too short to actually do that :D

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 12:28:56 -08:00
Miika Turkia
3f070eadd1 XSLT to import MacDive logs
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 12:28:17 -08:00
Martin Long
dca78fe6fc UDDF Export: Moved equipmentused to informationbeforedive section as per updated spec
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:15:28 -08:00
Martin Long
9b6c546244 UDDF Export: Moved tankdata before samples, as expected in xsd definition.
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:15:19 -08:00
Miika Turkia
737b5bdd5c Count the UDDF samples in different namespaces
Since UDDF import uses different namespaces, we need to count the
temperature samples in all of them to get temperature readings from
waypoints.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 07:09:59 -08:00
Miika Turkia
7a6b91a67e Should use the common GetFieldByIndex on import
Should have removed the getFieldByIndex template from these files when
it was moved to commonTemplates. Otherwise these imports wont work.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:14:31 -08:00
Miika Turkia
1b48b19d0b Export cylinder information to divelogs.de also if pressure dropped
This will export the cylinder information to divelogs.de also if there
is a pressure drop of at least 5 bars. (Previously only a gas switch to
the gas triggered the export of that particular cylinder.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-29 09:38:47 -08:00
Miika Turkia
81c0f39fa7 Use the get field template from common templates
Implementation of getFieldByIndex on this file does not support
quotation so lets use a template that is developed further.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 09:25:36 -08:00
Miika Turkia
793758c483 Move getFieldByIndex template to common templates
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 09:25:29 -08:00
Miika Turkia
99d95c3436 Update header to use sample wording on CSV export
The profile export now uses Sample time, etc. on profile export as that
is the naming we use on import as well.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 09:25:21 -08:00
Miika Turkia
7c43ca9035 Support for AM/PM time format on manual CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 12:02:13 -08:00
Miika Turkia
d57ffa8e58 Import quoted strings from the end of line properly
We need a special case to import tags on our own CSV export as there is
no field separator at the end of the line.

See #814

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:24:12 -08:00
Miika Turkia
3b8643af4f Fix detection of numeric field
Discarding header lines was faulty as the test whether dive number was
numeric did not work properly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:51:24 -08:00
Miika Turkia
8e75243a5b Improve detection of continuation lines in CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:51:00 -08:00
Miika Turkia
6c82578540 Switching to tab delimited CSV export
Use tab as separator when exporting dive details to CSV file. This also
replaces tabs and line feeds from notes with spaces.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:50:16 -08:00
Miika Turkia
54aa6dd91f Fix quoted CSV import
I am a bit baffled as to how this used to work before and does not work
anymore. Anyway, it should be sufficient that we take the quoted text
without verifying that the next character is the field separator. (Of
course it would be better to make sure field separator follows, as then
quotation marks could be used in the free-form texts.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23 17:43:08 +12:00
Miika Turkia
c5075b93a2 Have Sensus samples inside divecomputer tag
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23 17:42:20 +12:00
Miika Turkia
f8f5e73dae Improve testing whether we have temp and depth info
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-22 21:49:08 +12:00
Dirk Hohndel
e544796199 Add missing divemaster field to the manual import
No idea why I didn't notice earlier that this was missing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-06 20:19:45 -08:00
Miika Turkia
4dff1e7b93 Indentation fix for Subsurface CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:13:40 -08:00
Miika Turkia
182ea3ea6c Support for multi-line notes on SubsurfaceCSV import
This patch only implements the feature, indentation fix is to follow.
This ensures that the actual change can be more easily reviewed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:13:35 -08:00
Miika Turkia
c00a5614f3 Add required empty fields on CSV export
We need to have empty field printed for every value on the CSV export.
Hopefully this is enough.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:06:05 -08:00
Miika Turkia
16c46ba2f8 Export only profile from first divecomputer
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:13:11 -08:00
Miika Turkia
77a7595cbd Imperial support for CSV profile export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:13:04 -08:00
Miika Turkia
205c893fc3 Include cylinder description for imperial import
If the cylinder size seems to be in the form of ALxx, LPxx, or HPxx use
that as cylinder description.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:12:53 -08:00
Miika Turkia
48019a73d5 Imperial support for CSV details export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 12:12:26 -08:00
Miika Turkia
d70a6f23ed Change the XSLT to use the duration format instead of "logic"
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 08:35:36 -08:00
Miika Turkia
0f7c4ecd90 Treat duration as minutes if dive would be short
This will read duration from CSV in minutes if the dive would be less
than 10 minutes when treating the duration as seconds.

In practice, this means that free-divers cannot import dive duration
properly from CSV, but this should be sensible for scuba divers.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 08:19:19 -08:00
Miika Turkia
83ccf24e1e Support importing quoted multi-line notes field
This adds support for importing multi-line notes field on CSV import.
Naturally the notes filed must be quoted with " in this case.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-31 08:19:12 -08:00
Miika Turkia
c5d3d923a0 Guess imperial cylinder sizes on CSV import
This patch uses pre-defined working pressures on cylinders to roughly
calculate the size in liters. Imperial selection is ignored here as we
can use the prefix to detect if the value seems like imperial unit (and
the type of cylinder varies based on location, not divers preference in
unit).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 11:47:55 -08:00
Miika Turkia
3416278da4 Allow unit selection on known CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30 07:35:23 -08:00
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
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
Miika Turkia
dbb3f2dea2 Tune the unit test on DivingLog import
At least in some cases the maximum sample depth can be more than
recorded maximum depth on DivingLog XML export. Thus the maximum depth
is doubled for unit detection.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23 08:20:56 -07:00
Miika Turkia
cd4dc503fc Set proper gas type on UDDF import
Use type 25 on UDDF import when the gas mix contains some helium.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:22:33 -07:00
Miika Turkia
796df27273 Index used cylinder properly on divelogs.de export
The wrong O2 percentage was due to not referring to the correct cylinder
but grabbing any o2 value in any cylinder. While fixing this, I noticed
that also end pressure was missing the cylinder selection, so fixing
that as well.

Fixes #626

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:21:01 -07:00
Miika Turkia
5a34261fec Try to detect first cylinder on divelogs.de export
Most dive computers start always with the first cylinder (and if not,
they give a gas switch in the first few seconds). Trying to follow this
principle on divelogs.de export.

The bug 626 sounds like a bit different case so a sample XML log would
be needed to ensure that use case gets fixed.

See #626

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 20:46:19 -07:00
Miika Turkia
e65c4ac55e Add support for decimal comma on UDDF import
Gas changes generated by Xdeep can contain mix information with decimal
comma instead of decimal point. Thus we need to convert the comma to
point before performing mathematical operations on it.

Fixes #612

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11 12:08:03 -07:00
Miika Turkia
964401c374 Add image support to UDDF export
This patch adds image support to UDDF export. As far as I can tell from
the UDDF specification, the images can only be added to notes field, so
that is what we do here. (buddy and owner can also have image tags, but
that is irrelevant for Subsurface currently.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11 12:07:43 -07:00
Anton Lundin
89d74888b3 Add support for importing pressure from CSV files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 12:40:25 -07:00
Anton Lundin
6cd0928487 Add support for importing TTS from CSV files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09 13:22:00 -07:00
Anton Lundin
d5991800ee Add support for importing NDL from CSV files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09 13:22:00 -07:00
Miika Turkia
de89aefdcd Marginal optimization of UDDF import
This speeds up Aquadivelog imports marginally by doing lookup to used
equipments only instead of all equipment ever used.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 09:00:26 -07:00
Miika Turkia
088017f67c Optimize UDDF export
Writing the samples/waypoints to UDDF export in a totally new way.
Previously the preparations for approximating waypoints was done for
every sample, now only for the events.

A few days ago it took 36 seconds for my test set of 8 dives to export
to UDDF.  This optimization round took it down from 0m4.745s to
0m0.253s.

Fixes #508

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-02 22:25:59 -07:00
Miika Turkia
1739b4879a Improve header wording for CSV export
Duration is better term than time for the length of the dive. Also
remove the repetitive word dive from some of the header fields.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 09:16:21 -07:00
Miika Turkia
4aa7b01059 Properly identify siblings on UDDF export
UDDF export used all samples in the export when detecting previous
sample. This resulted in a very slow processing as we had to go through
massive amount of data for each event that's time was to be
approximated. The detection of previous sample was also erroneous
resulting in incorrect depth samples for the events in some occasions.
This patch should address these issues. And along with patch that
included pressure data on import this will fix the bug #499.

Well, the performance after the patch is still not stellar, but still
quite a difference with such a small change. The sample set of 8 dives
(with one event each) takes now less than 5 seconds instead of the
original 36 seconds (measured by doing the conversion with xsltproc).

Fixes #499

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:02:50 -07:00
Miika Turkia
4d48eb8262 Include pressure data on UDDF import
Importing pressure samples on UDDF import was missing. This patch adds
that bit of information to our import.

See #499

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-27 09:27:19 -07:00
Miika Turkia
2b559225d6 Quote header line properly on CSV export
Let's make the export consistent by quoting the header line the same way
the sample rows are quoted.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-26 17:17:02 -07:00
Miika Turkia
07fabc03fd No negative depth on divelogs.de export
Crafting depth samples produced a negative depth for the last sample.
This patch checks that negative last sample is ignored. (This occurred
when last manual sample is not full minutes.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-10 09:11:00 -07:00
Miika Turkia
27fa775c7c Create synthetic depth samples for manual dives
This patch creates artificial depth samples for manually entered dives
every 60 seconds. This is used for export to divelogs.de.

Fixes #486

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-10 09:10:59 -07:00
Jan Mulder
141433c3df Reefnet Sensus dataloggers report in mbar (CSV import)
Sensus dataloggers report depth in (absolute) millibar. This simple
fix corrects the CSV import. The depth is now computed correctly.

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-03 10:26:38 -07:00
Miika Turkia
b7940dec5c XSLT to export dive log in CSV
This implements divelog export into CSV format. This currently supports
only metric units and lacks user interface.

See #434

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-02 12:04:15 -08:00
Miika Turkia
dd24eaa377 Fix missing air temp on divelogs.de export
Fixes #439

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17 10:48:16 -08:00
Miika Turkia
cb5ab4bc8e Add unit support for CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15 06:33:33 -08:00
Miika Turkia
0ac8ab3070 Add support for Shearwater Desktop XML logs
Fixes #342

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08 07:12:18 -08:00
Miika Turkia
7048457b30 XSLT for importing manually kept CSV dives
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-25 06:52:04 -08:00
Miika Turkia
803623042c Fix importing CSV files with empty values
Empty values included the rest of the line in the value, instead of
leaving it empty. This patch leaves empty values empty.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-23 21:10:42 -08:00
Miika Turkia
209a793acf XSLT for parsing Sensus Ultra CSV export
Sensus divides temperature in one or two fields (depending on locale),
so it cannot be parsed with our generic CSV import XSLT. And e.g. depth
is in millimeters.

This supports only importing of single dive at a time. Multiple dives
would be in same file with first column being dive number.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-17 05:57:37 +07:00
Miika Turkia
dd3261f232 Grab also the last column in CSV when requested
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16 09:37:28 +07:00
Miika Turkia
bdecafc86a Use timeField variable on CSV import
We want to skip duplicate lines on CSV import. For this we need to use
time field, that is not necessarily the first field of the input. This
patch uses the configured time field instead of first one.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16 09:36:53 +07:00
Rodrigo Severo
2da8146b46 Include support for semicolon separated CSV files
Oceanic's Geo's companion software, OceanLog, when exporting as txt produces log files with the dives samples as semicolon separated CSV files.

Signed-off-by: Rodrigo Severo <rodrigo@fabricadeideias.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-14 21:08:31 +07:00
Miika Turkia
a18ada18e4 Remove unnecessary cylinder generation on UDDF
Nowadays cylinder tags are generated based on actual usage. This
includes all the required information on cylinders. Therefore generating
incomplete cylinder tags from all listed cylinders is not needed
anymore.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28 07:43:50 -08:00
Miika Turkia
9731f85fc6 Cylinder support improved on UDDF import
This patch adds support for cylinders for UDDF version 3.2.1.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28 07:43:34 -08:00
Miika Turkia
16d7f5e86e Support for multiple cylinders on UDDF export
Adding support for multiple cylinders on UDDF export. This also adds a
cylinder reference to the tankdata to enable mix lookups.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28 07:43:21 -08:00
Miika Turkia
683227d2aa Generate UDDF waypoints for in-between events
This patch generates a waypoint for events occurring between profile
samples. It approximates the depth of the crafted waypoint linearly
between the recorded sample depths.

Fixes #385

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28 07:43:18 -08:00
Miika Turkia
a88f413f70 Add depth conversions to XSLT
Convert depth to and from mm.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28 07:40:22 -08:00
Miika Turkia
abcc4d55bd Including alarms and bookmarks on UDDF import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-28 07:40:17 -08:00
Miika Turkia
57f85a773a UDDF export: save events occurring between samples
UDDF export saved events only if they occurred at exactly same time as a
profile sample. This patch will include events between samples as well.
This assumes that profile samples are recorded in even intervals.

Fixes #385

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-25 12:47:02 -08:00
Miika Turkia
dbd14f8662 Include O2 percentage in DivingLog import
Seems there is a different way to state O2 percentage in DivingLog.
This patch includes that format along with the previously seen one.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 08:52:38 -08:00
Miika Turkia
b07af31ea5 Try to detect whether DivingLog's samples are m/f
Seems that we can detect the unit of samples from DivingLog import when
comparing the maximum dive depth to the maximum recorded sample depth.
If sample is bigger, it is recorded in imperial. Of course this relies
on the assumption that the max depth of dive is recorded in metric unit,
but that seems to be the case, at least in the sample received.

It really does not make any sense to have both units in use for one dive
without any info on the unit used. But since that is the case, let's try
to cope with it.

Fixes #316

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 08:20:06 -08:00
Miika Turkia
03a01efdcb We need to use include statement on XSLT nowadays
After change to include XSLT files in resources, the import quit
working (even though the files and templates were found properly). This
patch uses include statement instead as it seems to work in our case.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:16:30 -08:00
Dirk Hohndel
b5d3476b0b Allow comma separated CSV files
The separator selector in the CSV import dialog was unused. This passes
the value into the xslt and adds ',' as possible value.

I'm sure this could be done much better (pass the actual character instead
of the index), but I couldn't get that to work and this does seem to do
the trick.

Also added a test dive to test this feature.

Fixes #321

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 15:27:09 -08:00
Anton Lundin
7e36b4a253 Tidy up csv to xml xslt
Use if around the attribute, instead if a choose inside. Its less
horrible on the eyes.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-25 14:47:09 -08:00
Anton Lundin
5e04aaa756 Add the missed csv-field stopdepth
I managed to mess up and grab parts of my unfinished otu field code and
squash it into the wrong patch. Here is the code for stopdepth, and now
the code sets the in_deco flag to.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-25 14:46:53 -08:00
Anton Lundin
26656310ab Add optional support for stopdepth import from csv
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 15:54:28 -08:00
Anton Lundin
5eccd73a30 Add optional support for cns import from csv files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 15:54:21 -08:00
Anton Lundin
8dde12fa35 Add optional support for po2 import from csv files
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 15:54:16 -08:00
Anton Lundin
cf06f78892 Make temperature optional in csv import
This adds a checkbox to be able to import csv files without temperature.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 15:53:54 -08:00
Miika Turkia
cd0475fe96 Improve UDDF export to include more dive data
Basic information like buddy, location and visibility is included in
UDDF export. Also attempt to grab temperature information from both
temperature and divetemperature tags.

This partially fixes bug #224. However, at least divemaster and tags are
not exported (as the UDDF spec either does not have these or has hidden
the information of these fields somewhere between so many seemingly
unnecessary other fields).

See #224

Signed-off-by: Miika Turkia <miika.turkia@nixu.fi>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 04:25:01 -08:00
Miika Turkia
5b0162d9d4 Improve UDDF import
Some improvements on importing different versions of UDDF logs. Also
include rating, gps coordinates and gas mixture in the import.

Signed-off-by: Miika Turkia <miika.turkia@nixu.fi>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21 04:24:20 -08:00
Miika Turkia
89770249d0 Add current date to CSV import
Since CSV import does not include date/time stamp, we need to generate
one for ourselves. This patch uses current time of the import as dive
time.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-20 15:27:07 +02:00