Commit graph

105 commits

Author SHA1 Message Date
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
Miika Turkia
f771a94a85 Get information only from first line at each time
As some CSV log files seem to contain multiple sample lines for a single
time, we'll just grab the first one of them to avoid duplicates.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 12:19:23 -07:00
Miika Turkia
3ec6871720 Field variables for CSV import
Field variables for the CSV XSLT import have disappeared at some point
during developing GUI for the CSV import. So adding them to the XSLT for
the field selections to have effect.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 12:19:06 -07:00
Miika Turkia
80bced4f56 Rounding error on time change
When we convert time in seconds to mm:ss format, we do not want to round
but get floor instead.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16 11:52:05 -07:00