Should have removed the getFieldByIndex template from these files when
it was moved to commonTemplates. Otherwise these imports wont work.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
Implementation of getFieldByIndex on this file does not support
quotation so lets use a template that is developed further.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The profile export now uses Sample time, etc. on profile export as that
is the naming we use on import as well.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need a special case to import tags on our own CSV export as there is
no field separator at the end of the line.
See #814
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Discarding header lines was faulty as the test whether dive number was
numeric did not work properly.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use tab as separator when exporting dive details to CSV file. This also
replaces tabs and line feeds from notes with spaces.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I am a bit baffled as to how this used to work before and does not work
anymore. Anyway, it should be sufficient that we take the quoted text
without verifying that the next character is the field separator. (Of
course it would be better to make sure field separator follows, as then
quotation marks could be used in the free-form texts.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch only implements the feature, indentation fix is to follow.
This ensures that the actual change can be more easily reviewed.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need to have empty field printed for every value on the CSV export.
Hopefully this is enough.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the cylinder size seems to be in the form of ALxx, LPxx, or HPxx use
that as cylinder description.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will read duration from CSV in minutes if the dive would be less
than 10 minutes when treating the duration as seconds.
In practice, this means that free-divers cannot import dive duration
properly from CSV, but this should be sensible for scuba divers.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds support for importing multi-line notes field on CSV import.
Naturally the notes filed must be quoted with " in this case.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch uses pre-defined working pressures on cylinders to roughly
calculate the size in liters. Imperial selection is ignored here as we
can use the prefix to detect if the value seems like imperial unit (and
the type of cylinder varies based on location, not divers preference in
unit).
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If specific value is not available, we need to have an empty value
instead.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Try to grab pressure information from first DC if it is not manually
entered.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need to limit the DCs from which we grab the depths. Otherwise, we
end up with too many depth values.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If temperature is recorded by a DC it must be taken from under the
divecomputer tag. However, this will prefer the manually written value
if such exists.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is intended to export all the details that someone might copy from a
paper logbook. We need a matching import template to make this simple.
This hasn't been well tested, I'm sure it will break when elements and
attributes are missing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds support for importing cylinder information from manually kept
dive logs. However, this cannot be used before GUI counterpart is added.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds support for importing temperatures from manually kept dive logs.
However, this cannot be used before GUI counterpart is added.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The existence of location information was tested incorrectly resulting
in erroneously adding these fields if they were not present.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Having the mix name like EANX34 as cylinder description was apparently
confusing, so switching to 'unknown' instead.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds support for importing cylinder information from at least Xdeep
and Diving Log v 5.0.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
UDDF only supports a specific set of alarms. Some events also don't map
to alarms but map to other types of elements in UDDF.
This patch adds a map of the accepted types. Where a map doesn't exist
the type will not be mapped to an alarm, the option then remains to
map it to another kind of element, in the same way that happened with
headings and gas switches.
This removes the need for the specific exclusion of heading and
gas switch, as they are now simply not included in the map.
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Using node() along with the node-set seems to grab the weights properly
for me.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>