Commit graph

401 commits

Author SHA1 Message Date
Miika Turkia
baee988d75 As last resort, use the site name as location
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2021-02-17 07:04:25 -08:00
Miika Turkia
2936aa6aa0 Use country for divelogs.de export
This will use only the country name for the location field in
divelogs.de export. The old version concatenated all the fields
together. This is inline with Rainer's new import functionality.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2021-02-17 07:04:25 -08:00
Miika Turkia
dbf7fa89a2 Shearwater cloud import: adjust to milliseconds
Seems that Shearwater cloud gives the sample time in milliseconds
nowadays. Taking a wild guess, that this logic should suffice for us to
be able to import old and newer XML logs. (Assuming that if the
timestamp for the first sample is more than 100, timestamps are in
milliseconds, otherwise in seconds.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15 08:47:51 -07:00
Miika Turkia
2d108cb8ad Fix indentation
The diff goes crazy if indentation is not fixed by itself.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31 08:59:47 -07:00
Miika Turkia
3dc5ac219d Print empty cylinder, if needed
When the dive that is used to generate the header, we need to print
empty cylinders for the dives that had less cylinders than the one used
for header printing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31 08:59:47 -07:00
Miika Turkia
108b30e8b5 Print at most as many cylinders as the header has
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31 08:59:47 -07:00
Miika Turkia
8f7c9bc7d1 Limit cylinders to one dive only
With XSLT we have to be specific if we want to apply cylinder iteration
operation to one dive only. Thus using the last dive as reference when
printing cylinder header.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31 08:59:47 -07:00
Miika Turkia
790c89549a Fix precision bug on SubsurfaceCSV import
We need decimal point as size is stored with one decimal on imperial
export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
3a1502de71 Remove debug output
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
a1c59260bc Add dive mode support for SubsurfaceCSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
a41a8c1065 Fix field indexes after dive mode and sac change
We need to update field numbers when parsing CSV, as recently sac and
dive mode were added.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
c924591f46 CSV import: add SAC if we end up supporting it
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
e8f97cbc3f XML start tag does not have new line before header
When Subsurface adds start tag to CSV file, there is no new line after
it. Thus changing XSLT to parse this way.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
0acf8721d3 Trip support for CSV export of dive details
Debugging the tests with new test dive, I noticed that CSV export does
not work, if the exported XML includes trips.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
368719379e Add multicylinder support for Subsurface CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
dc829e3487 Take SAC into account on SubsurfaceCSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
889f36a57c Multi cylinder support for CSV export
Fixes #2830

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
19cdab52b3 CSV export: Split printing of header
This will split the printing of header for CSV export. Cylinder
information is printed by itself allowing me to later print it in a loop
as many times as there are cylinders.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26 11:33:10 -07:00
Miika Turkia
0525f31510 CSV export: include SAC when exporting dive details
Simply adds SAC field to CSV export of dive details.

Fixes #2829

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-18 09:32:58 -07:00
Miika Turkia
3e2a410f93 format for readability
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-18 09:32:58 -07:00
Miika Turkia
05177cfc14 CSV export: include dive mode field
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-04 10:43:40 +02:00
Miika Turkia
e1c3f29b88 CSV export: Add dive mode
Include dive mode to exported dive detail CSV

Closes #1588

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-04 10:43:40 +02:00
Miika Turkia
96ee6898e8 Fix special case for temperature in CSV export
The old code took air and water temperatures primarily from
dive/divetemperature or secondarily if the previous one didn't have
either one of them from divecomputer/temperature. The new code attempts
to take first air temperature from dive/divetemperature or
diveomputer/temperature and then on a separate run the water
temperature from these both. Thus we should be fine if one temperature
is in dive/divetemperature and the other in divecomputer/temperature.

Fixes #2169

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-07-13 08:48:26 -07:00
Miika Turkia
a4ecfb7522 CSV Import: add heartrate support
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-05-11 11:23:41 -07:00
Miika Turkia
6f916473a5 SDE import: add custom fields to tags
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-05-10 10:40:35 +02:00
Miika Turkia
ea203373f8 Suunto import: add description to weight import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-05-10 10:40:35 +02:00
Miika Turkia
fade17d16b Suunto import: fix weight import
Suunto apparently has a typo in their SDE format. Let's import also
WEIGTH :D

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-05-10 10:40:35 +02:00
Miika Turkia
043d07213a Initial support for Mares import
This import is based on one sample I received. It was exported from some
Mares software. Imported data is somewhat limited, but we do get the
depth and temperature profiles. (I would love to receive some more
sample logs to validate the import and to enhance the data we are
grabbing.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-04-02 07:47:11 -07:00
Miika Turkia
f040912395 CSV import: import of last field
The last field ends with new line instead of field separator.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
3f5b5f7b3e CSV import: do not add quote to single word
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
d3239aed0f CSV import: support for quoted "
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
b3694faefc CSV import: support for quoted " within field
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
9540793552 CSV import: simplify code
These two cases were identical, so simplifying the code.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
f96d155759 CSV export: include unquoted quotable fields
Turns out that the initial quoting implementation discarded the fields
without quoting. This one ensures we should be getting also that data
exported.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
c44ece0ea1 CSV export: quote quotes
If a text field contains quotation mark ("), encode this with double
quote ("").

Fixes #1679

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-07 17:41:14 +03:00
Miika Turkia
a65a8267a5 divelogs.de import: improve export for temperature
Add support for exporting dive temperatures if they are user entered
instead coming from a DC.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-08-04 07:21:20 -07:00
Miika Turkia
7103f36c7c UDDF import: add support for decimal comma for depth
Depth values might apparently contain decimal comma instead of decimal
point with some locale settings. Thus add support for both of them.

Fixes #1485

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-07-10 10:21:13 -07:00
Miika Turkia
f638b7ef80 CSV import: support \n as new line on notes field
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-06-25 20:12:06 +08:00
Miika Turkia
ddd35bc941 Shearwater import: add support for DC reported ceiling
This adds stopdepth, stoptime and in_deco attributes on Shearwater XML
import. The output from the XSLT is very verbose (these values are
printed for each sample), but as Subsurface cleans things up, there is
no need to do any more magic on XSLT side.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-27 23:18:01 +03:00
Miika Turkia
cf4e3e17aa Shearwater import: include NDL only if not zero
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-27 23:18:01 +03:00
Miika Turkia
4e2a7b4e2f Shearwater import: new format for DC info
Include the DC info into settings and refer to that in each dive.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-27 23:18:01 +03:00
Miika Turkia
12e4b6d62c CSV import: include visibility and rating in import
Add support for visibility and rating to CSV import dialog.

Fixes #1212

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-05-01 22:42:10 +03:00
Stefan Fuchs
2f1d6867df CSV export: Remove erroneous printed dive site notes from export
Remove erroneous printed dive site notes from dive profile export.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-19 11:59:58 -07:00
Stefan Fuchs
46f1fea1b6 CSV export: Correct numeric format for depth
Add two missing format-number functions for mean depth in dive list
export and depth in dive profile export.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-19 11:59:58 -07:00
Stefan Fuchs
fc01045680 CSV export: Modify format of dive list and dive profile export
In dive list CSV export:
- Move unit "min" from duration field to header
- Move unit "%" from O2 and He fields to header

In dive profile CSV export:
- Add "min" to sample time header
- Add column for sample heart rate

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-19 11:59:58 -07:00
Miika Turkia
b0eca5cb32 Convert cylinder volume to metric
This is a rough conversion from cuft to liters. Should be close enough
when we don't have working pressure to do the real calculation. (As far
as I know, this is the case with UDCF.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
006e00ebc4 Case insensitive string comparison for units
Not really surprising, but a sample log that I received used different
case for unit than I had expected.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
f8360eeddd Convert imperial pressures to metric
This will convert cylinder start and end pressures from imperial to
metric, when necessary.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
0f3057d7d0 Add imperial unit support for temperature
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
5b422332ac UDCF import: use unit variable
Simplify depth conversion from by using the unit variable and allowing
dephtConvert template to do the work.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00