This add support for Seabear's new import format that is used by H3 and
T1. In the future also the Hudc should switch to the new format. The
main difference to the old one is that time stamps are no longer
recorded in the samples, but intervali is specified in the header.
The header contains other useful information as well that we should
build support for. E.g. surface pressure, gas mixes, GF, and mode might
be useful additions later on.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Field name changes should change all the occurrences... We ended up with
field index of -1 for average depth due to mixing field names.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In practice this will sanitize Windows line terminations (discard the
carriage return);
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the filename has extension of .apd, then set the known import
automatically.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit d329420d55 changed the name of the
header from "Max depth" to "Max. depth", so we need to use that in the
code as well. (The dive profile is not drawn if we do not have max
depth.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are reports that the replace calls can cause the application to
crash. This doesn't seem to make sense, looking at the code - this change
shouldn't make any difference. But it makes it even more clear that there
shouldn't be any possible scenario in which we call replace with an index
that's out of range.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This improves the column name matching so our own columns are properly
supported.
See #814
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As changing the export to use tabs, we need to switch the import to do
that as well. However, we also need to support comma separation as older
exports use that.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems that at least in this occasion, the signal blocking requires
the UI element to be given.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The import dialog now displays only a maximum of 10 lines of the CSV
file to be imported.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This assumes that we have either dive details or dive profile, not
combined log files. Before the change in the import UI, user selected
the import type by the tab on import dialog, now we make an educated
guess based on whether sample time field is available.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we have the separator as tab, we need to use the proper tab
character instead of the string for known imports.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the header line is not set up properly, the known imports assignments
will index out of the array.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As the string was changed in our CSVApps array, we must change it here
as well.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We use the human readable name here as XML tag name so it cannot contain
spaces. Note that currently some of the names can have spaces in them as
they are special cases and not used as XML tag name.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Unfortunately we are referencing these separators with index, so they
need to be on same order as used in XSLT files.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These files contain a bit of extra data before the actual CSV part, so
we need to skip there to show sensible information to users.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We need to reparse the file when the known type changes and want to make
sure that we only try to guess the separator and the columns if the user
hasn't told us otherwise.
For the predefined imports this then looks up the correct columns and
places the correct headings there - and then allows the user to modify
them if needed.
This has been lightly tested, there may be dragons.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the new infrastructure colum numbers are 0 based, so the indices had
to change.
This commit also adds the column names for sample based formats (and ends
up re-indenting parts of that code).
This doesn't make things work, yet, but it's a step in the right
direction.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we automatically matched the columns this might already be correct. So
the standard text is confusing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I used to compare strings, but since there can be more than one empty
column, this was a very sad choice, now I'm comparing indexes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This drawns a nice rounded rect around the avaliable column names, using
antialiasing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Enable the new delegate on the view, and give the items a bit more
spacing, so we can draw things around them.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This new class is the responsible to draw the columns that can be dragged
from the top bar to the bottom one.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is taking a very simplistic approach. It picks the predominant
potential separator. If there is no clear winner, it uses the UI default
and makes the user pick (and either way, this can always be overwritten by
the user).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dialog defaults to tab; if a file is indeed comma separated and one
switches to that, data() could be called on a higher index before the
model is re-populated.
I'm a bit surprised why index.isValid() doesn't catch this, but the manual
check appears to work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>