Commit graph

25 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
Miika Turkia
68545465ba Switch to UTF-8 on .DLD export
Let's use the shiny new UTF-8 encoding on divelogs.de export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 06:25:36 -07:00
Miika Turkia
5533cd749f Fix end pressure on DLD export
While working on UDDF export I noticed that the grabbing of last
sample pressure was not working properly. This will fix it for DLD
export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-26 12:52:39 -07:00
Miika Turkia
98d769a02f Correct ending pressure for .DLD export
We grab the pressure information from samples, if available. Otherwise,
we use information from first cylinder.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-14 12:20:05 -07:00
Miika Turkia
03c21b0a92 Fix free form text fields on .DLD upload
We need to have CDATA around text fields to support e.g. Cyrillic
alphabet.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-14 08:28:55 -07:00
Miika Turkia
7c6ff9f957 Convert Subsurface XML to divelogs.de format
The resulting divelogs.de formatted XML is then to be zipped and
uploaded to divelogs.de website.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-10 09:27:53 -07:00