Commit graph

127 commits

Author SHA1 Message Date
Miika Turkia
921041163b Seabear import: fix detection of empty lines
The old code trusted in Windows new lines with length of 3. The new code
strips out spaces and line ending chars resulting in empty line being
of length 0.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28 09:32:53 -07:00
Miika Turkia
6953824bd6 CSV import: add support for DC hw info
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:34:43 -07:00
Miika Turkia
3ef5dbaacb Add hw info to Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:34:18 -07:00
Miika Turkia
aa9c2b7384 Add sample pressure to be auto-filled on Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:57:47 -07:00
Miika Turkia
f4799e67b8 Always use "csv" parsing for Seabear
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:22:12 -07:00
Miika Turkia
0a69c35501 Strip unit from Seabear sample interval value
XSLT parsing treats this as numeric value, thus we need to strip out the
" s" part.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:22:05 -07:00
Miika Turkia
c9a98a4f7b Add a known type for second DC on APD import
This patch adds importing of sensor values from the second DC on APD log
import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:50 -07:00
Miika Turkia
ac4871c699 Import sensor values for autodetected APD files
If APD Log Viewer format is automatically detected, we should set the
sensor values to be imported properly. These need to be added to the
firstline and since we convert the number 2 from column headers to
subscript, this step must be skipped for the APD import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:43 -07:00
Miika Turkia
bf45eddceb CSV import test wrong values
We need to test for the sensor values on CSV import, not the po2.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:34 -07:00
Miika Turkia
6ab87a7420 Clean hard coded values on divelog CSV import
Hard coding the values of known imports is quite awkward if we add
these. Thus switching to use enum and names instead.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:16 -07:00
Miika Turkia
b28517b9b0 Add setpoint support for CSV import
The import of setpoint values is tested with Seabear data.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-21 07:34:24 -07:00
Anton Lundin
f04b3bc166 Add support for importing O2 sensors from CSV file
This adds support for importing individual O2 sensors from a CSV file,
e.g. an APD log viewer file.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:42:05 -07:00
Dirk Hohndel
ccc9d80015 Remove all the no longer necessary code that aborts read of first V2 file
This was a poorly implemented hack when we executed the reverse geo lookup
in the main thread and opening a V2 file could take a very long time. We
need to do the "Welcome" message quite differently.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 14:41:56 -07:00
Miika Turkia
c80d1879b7 Add suit field for CSV import
Fixes #853

[Dirk Hohndel: fixed test compile]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 06:50:50 -07:00
Dirk Hohndel
6f7e3d04cb Handle XSLT based imports correctly
XSLT conversions create V2 XML files, but we shouldn't abort when we parse
those without having the user informed about the potential slowness - all
XSLT based imports are slow, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22 13:20:27 -07:00
Miika Turkia
86ac7fdf47 Import support for new Seabear format
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>
2015-03-23 05:44:06 -07:00
Miika Turkia
838b450066 CSV import: average depth name fix
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>
2015-03-15 15:43:47 -07:00
Miika Turkia
76ce2b095b Trim CSV lines on import
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>
2015-03-10 14:27:43 -07:00
Dirk Hohndel
2866a604b4 Revert "Update Qt4 patch"
This reverts commit 762315e7ee.

Oops, this was supposed to update the patch, not update and apply it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22 08:30:34 -08:00
Dirk Hohndel
762315e7ee Update Qt4 patch
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-19 21:52:41 -08:00
Tomaz Canabrava
6b038c2a9a Remove the ProfileWidget from mainwindow.ui
It is now in mainwindo.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Miika Turkia
0e26487208 Select the known import for APD automatically
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>
2015-02-07 08:56:27 -08:00
Miika Turkia
2dc1a42b29 Fix crash if one selects incorrectly Seabear CSV
Fixes #814

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 07:06:12 -08:00
Miika Turkia
b01f14efab Fix maximum depth on CSV import
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>
2015-01-31 10:14:48 -08:00
Dirk Hohndel
07e94c67e0 Make sure the index is valid
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>
2015-01-29 15:26:24 -08:00
Lubomir I. Ivanov
dee91a96aa divelogimportdialog.cpp: remove extra line at EOF
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 07:21:27 -08:00
Lubomir I. Ivanov
96575b2366 divelogimportdialog.cpp: more capitalization of acronyms
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 07:21:17 -08:00
Tim Wootton
d329420d55 Typos, punctuation and capitalisation.
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 07:25:37 -08:00
Lubomir I. Ivanov
656d23fa93 Typos: capitalize TTS, CNS, NDL in diveloginportdialog.cpp
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:36:08 -08:00
Lubomir I. Ivanov
0ca87f3a02 Typos: use subscript for pO2 in divelogimportdialog.cpp
[Dirk Hohndel: also fixed the "detph" typo]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:32:26 -08:00
Miika Turkia
14f96fc4de Match ₂ to 2 and cylinder to cyl. on CSV import
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>
2015-01-24 14:51:14 -08:00
Miika Turkia
fb367b22b0 Switch Subsurface CSV import to use tab separator
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>
2015-01-24 14:50:51 -08:00
Miika Turkia
b8d02b4b27 Block the signals properly
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>
2015-01-24 14:50:36 -08:00
Miika Turkia
6fb0465654 Limit the row count properly when displaying CSV file
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>
2015-01-24 14:50:02 -08:00
Miika Turkia
6bb1fee9a6 Enable importing of dive profile from CSV files
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>
2015-01-24 14:49:28 -08:00
Miika Turkia
afae2af13f Fix the support of APD Log Viewer CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:49:04 -08:00
Miika Turkia
b29a1bfb7b CSV import, fix known import handling with tab separator
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>
2015-01-24 14:48:45 -08:00
Miika Turkia
b772beda71 Known import fix for XP5
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 07:09:29 +12:00
Miika Turkia
d501445bea Fix segm fault on known CSV imports
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>
2015-01-24 07:09:22 +12:00
Miika Turkia
5ac5619a77 Set the known import selection for Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23 06:31:47 +12:00
Miika Turkia
2e77e710a0 Use proper sample headings for Seabear CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23 06:31:38 +12:00
Miika Turkia
a4c3e9cdc0 Use correct case for string matching on CSV import
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>
2015-01-22 21:49:15 +12:00
Miika Turkia
f8b9d61b92 Fix string that is used as XML tag name
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>
2015-01-22 21:49:03 +12:00
Miika Turkia
ffdb78a3dc Fix order of CSV field separators
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>
2015-01-22 21:48:57 +12:00
Miika Turkia
c1f716614f Special handling of Seaber CSV files
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>
2015-01-22 21:48:44 +12:00
Dirk Hohndel
02d8dd5d13 Clean up the header files
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>
2015-01-17 23:00:43 +13:00
Dirk Hohndel
d7762f8fbe No need for a new variable
We already have provider in a local variable. The lookup and "model"
variable is redundant.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 13:44:51 -08:00
Dirk Hohndel
5f4770a5bd CSV import: make predefined imports work again
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>
2015-01-07 17:02:42 -08:00
Dirk Hohndel
db988aa62b CSV import: first steps to enable the preset types again
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>
2015-01-07 16:59:42 -08:00
Dirk Hohndel
a51110b0d0 CSV input UI: if we detect columns, set type to "manual" for now
We still need to re-implement the other presets.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-07 15:11:54 -08:00