Commit graph

287 commits

Author SHA1 Message Date
Miika Turkia
2d69f8c9d0 CSV import: convert imperial mean depth to metric
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:24:12 -08:00
Miika Turkia
6d6caf8620 Fix imiperial conversion on CSV import
Somehow the divider lost one zero during copypaste to this XSLT file.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:23:56 -08:00
Miika Turkia
821e35d2bb Fix time fraction calculation for CSV import
Previous formula didn't handle values of less than 10 correctly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:23:51 -08:00
Miika Turkia
ac800e14dd CSV import: Support sec,fraction format
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:23:17 -08:00
Miika Turkia
caeb72ceb0 Manual CSV import had wrong tag name for DC
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:23:09 -08:00
Miika Turkia
b88d403fb6 CSV import might have time in sec.fraction format
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:22:46 -08:00
Miika Turkia
c78bbf6883 CSV import: support for decimal comma on temperature
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:22:42 -08:00
Miika Turkia
50ea5ec296 CSV import: support for decimal comma on depth
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:22:37 -08:00
Miika Turkia
5402d489c6 CSV import: support time with decimal comma
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15 03:22:28 -08:00
Miika Turkia
caf14865b4 DL7 import: ignore non-numeric pressure
If pressure field is empty, we do not want to have field separator as
pressure value. This would flood the console with parsing error
messages.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-05 12:54:02 -07:00
Miika Turkia
3a454d77ba Fix month on Shearwater import
Fixes #1096

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-03 07:59:04 -07:00
Miika Turkia
71273945c6 Support hⓂ️s format for duration on CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:29:24 -07:00
Miika Turkia
0e31171087 Fix cylinder pressure for UDDF export
Fixes #1086

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28 04:55:39 -07:00
Miika Turkia
6392bf83ab Use manual temperatures in CSV details import
When importing dive details from a CSV file, it is better to treat the
values as manually imported instead of imported from a dive computer.
The original way discarded the temperature values from the details
import if a dive profile was imported and merged to the dive details.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:02:22 -07:00
Miika Turkia
2936b63a04 Typo in CSV import
Variables are started with $ sign...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-16 11:02:09 -07:00
Miika Turkia
304af311f0 CSV import: import dive number if defined
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:10 -07:00
Miika Turkia
7ec83ef02a CSV import: import time field if available
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:07 -07:00
Miika Turkia
a83c674139 CSV import: support for user specified date format
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:03 -07:00
Miika Turkia
a480d28afd CSV import: use date field on profile import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:24:52 -07:00
Miika Turkia
98f93be0c4 CSV import: convert cylinder size from imperial
This will convert cylinder size when importing from imperial units. I am
using default working pressure of 3000 PSI that is not precisely
correct, but should be close enough for the most common aluminium
cylinders.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:24:47 -07:00
Miika Turkia
0b8ac416bf CSV import: support min.sec format
Assume a format containing a dot to be min.sec as defined in DL7
specification.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:52 -07:00
Miika Turkia
7a4fa510e9 Add pipe as supported field separator on CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:07:27 -07:00
Miika Turkia
9607ff6c93 Import picture URLs from divelogs.de
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 21:03:27 -07:00
Miika Turkia
7e47874adb SDM import: fix logic for sample import
Seems that testing if BOOKMARK is empty is a bad idea. We end up not
getting any samples, but the ones containing a bookmark. So we need to
switch the logic to testing if BOOKMARK contains something and do those
tasks first and otherwise grab a regular sample.

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

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02 06:28:51 -05:00
Miika Turkia
ee0bdd9043 CSV export
Need to discard dive site notes on csv export..

miika

From ab23245e2acee32410fa680d0eaab098af69b5c2 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Mon, 21 Mar 2016 17:50:28 +0800
Subject: [PATCH] CSV export: discard dive site notes

The new format of divesite management breaks the CSV export as the notes
of divesites are matched.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:45:04 -07:00
Miika Turkia
6bcfb033ee UDDF export: fix dive site support
We need to match the divesites to suppress extra output that breaks the
XML. This is because the divesites are actually gathered by calling a
template.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:31:30 -07:00
Miika Turkia
2b8e8849e6 Use full precision on weight system on XSLT transforms
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-25 00:38:03 +01:00
Miika Turkia
df6eff917c Support PSI on CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24 21:26:03 -08:00
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