Commit graph

373 commits

Author SHA1 Message Date
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
Miika Turkia
38ac965989 UDCF import: store units in a variable
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
3cf9989d65 Import: move some "functions" to commonTemplates
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
1e45637575 UDCF import: support for imperial depths
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
405e5050a1 Move XSLT depth conversion to commonTemplates
Moving depth conversion template from MacDive specific XSLT to
commonTemplates.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-15 17:54:05 +02:00
Miika Turkia
859098a37e SDE import: include DC serial number
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-08 21:30:00 +01:00
Miika Turkia
f798859178 Import DC model from SDE file
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-02-08 21:30:00 +01:00
Miika Turkia
65c4891a71 Add support for air and water temps for CSV import
Add support of importing air and water temperatures from DC header
information.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08 06:06:12 +02:00
Miika Turkia
5046fa34a4 Add support for max and mean depths for CSV import
Add support of importing max and mean depths from DC header information.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08 06:06:12 +02:00
Miika Turkia
2e340d3a61 Include cylinder pressures on export when they exist
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-10 11:29:52 +02:00
Miika Turkia
2b484316e4 Check that cylinder start and end pressures exist
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-10 11:29:52 +02:00
Miika Turkia
38cc8bdc40 Support dctype/divemode on UDDF import
This will grab the divemode information from the first waypoint within
the dive that includes this info and uses it for dctype.

Note that our dive type is not as fine grained as the one in UDDF. The
latter allows one to switch divemode during the dive when we do not.
However, one could argue that i.e. a rebreather dive should be a
rebreather dive even if one switches to bailout gas at some point...

Fixes #922

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-12-10 11:29:52 +02:00
Miika Turkia
5f88b62cb1 Support for trimix on jdivelog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-10-26 13:13:24 -04:00
Miika Turkia
ae34f62489 Support gas changes on Shearwater XML import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-24 17:49:10 +03:00
Miika Turkia
baa60e1077 Support for 2 cylinders on Shearwater XML import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-13 14:04:31 -07:00
Miika Turkia
8f61dfe812 Fix CSV export for imperial start and end pressure
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-15 14:44:07 +09:00
Miika Turkia
24614a989f Reflect import of subsurfaceCSV with having units in headers 2017-07-15 14:44:07 +09:00
Miika Turkia
0135597265 CSV export: show units on header
Let's show the units in CSV header so the actual fields have only the
values. This should be easier to parse with some other programs.

Fixes #472

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-15 14:44:07 +09:00
Miika Turkia
9b7d321c87 CSV export: show units on header
Let's show the units in CSV header so the actual fields have only the
values. This should be easier to parse with some other programs.

Fixes #472

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-15 14:44:07 +09:00
Jan Mulder
bbde0a1741 Two simple export UDDF fixes
This fixes issues #418 and $419.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-27 14:15:35 +09:00
Miika Turkia
afb45a216c Import NDL from Shearwater Desktop
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-30 13:25:08 -07:00
Miika Turkia
fcc69103be Fix Shearwater import pressure data
Apparently recording cylinder pressure in PSI is not the only oddity
with Shearwater Desktop. It also records half the value, so doubling the
reading here.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-30 13:25:08 -07:00
Miika Turkia
f6f74a0a3e Import pressure data for tank0 on Shearwater Desktop import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-30 13:25:08 -07:00
Miika Turkia
a489b3fa42 Rounding imperial export for profile
Precision for the rounding is more than makes sense, but this satisfied
the test case.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-12 14:05:33 -07:00
Miika Turkia
ccf916344b Include some extradata info on Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-07 21:36:50 -07:00
Dirk Hohndel
d7cf3408e5 Merge branch 'seabear-refactor'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-07 07:52:55 -07:00
Miika Turkia
6e1c00078d Add dive mode support for Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-07 15:34:27 +03:00
Miika Turkia
cef56c6290 Import dive number from Seabear CSV file
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-07 14:19:58 +03:00
Miika Turkia
0617308b39 More robust UDDF export test mode
When doing the xslt transformation for UDDF export, the C source does
actually give a parameter units with value 0. Thus we need to treat
that case as normal mode.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-06 08:06:42 -07:00