Fix the generation of <switchmix> elements in the UDDF export.
Also change the ids of gasmixes to include the helium fraction, and
fractions of a percent, in order to make UDDF export suitable for
technical diving.
Signed-off-by: Michael Keller <github@ike.ch>
Fix the cylinder pressures in the CSV summary export. Only show
pressures derived from `pressure` attributes in samples for the first
cylinder. Add support for showing pressures derived from `pressure0` ...
`pressureX` attributes.
Also cleaned up unit conversions, and changed tabs to spaces.
From discussion in
https://github.com/subsurface/subsurface/pull/3906#issuecomment-1575980882.
Signed-off-by: Michael Keller <github@ike.ch>
Rework of the XSLT used to generate the Summary CSV export:
- fixed a bug causing invalid CSV to be generated for double quotes
(`""`);
- changed quoting and escaping to be compliant with RFC 4180;
- changed output to contain information for all cylinders for all dives
(instead of limiting the number of cylinders to howevermany are used
for the last dive);
- added an index to the cylinder data headings;
- changed unit designators to use `[]` instead of `()`;
- some minor improvements to the XSLT.
Signed-off-by: Michael Keller <github@ike.ch>
Change the output formato for the Export / 'CSV summary dive details'
from TSV to CSV, to make it consistent with the menu item name, and with
the other 'CSV' export function.
This was changed to TSV by @mturkia in
6c82578540,
but I could not find any discussion as to why.
Also removed replacement of the field separator in any fields, as,
according to the CSV RFC (https://datatracker.ietf.org/doc/html/rfc4180)
this is not required as long as the fields containing separators are
enclosed in quotes, and any quotes within the fields are doubled up.
Tested with a fairly large log file, and importing into Google Sheets is
working fine for the output produced.
Also made capitalisation of the Export menu items consistent.
Signed-off-by: Michael Keller <github@ike.ch>
When user has selected to show unused cylinders in equipment tab,
respect this setting when exporting to divelogs.de.
Fixes#3277
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>