Commit graph

9443 commits

Author SHA1 Message Date
Miika Turkia
4d8d7c2a0f NULL terminate the parameters array
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:30:16 -07:00
Miika Turkia
93e529f371 Parse txt formatted log files
This parses .txt log files produced by Dataplus and Oceanlog software.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:30:16 -07:00
Miika Turkia
06843f1155 Use encoded file name on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:30:16 -07:00
Miika Turkia
a5611c1d28 Allow parsing of .txt files on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:30:16 -07:00
Dirk Hohndel
6a6f824caa Fix typo
Otherwise this code makes no sense (and has no effect).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-03 09:56:13 -07:00
Miika Turkia
5916a4e37b Parse date and time from on APD import
This will parse the date and time information on CSV import if the file
name matches the one used by APD log viewer (date and time are available
in the file name). Hard coding the year to 20?? is a bit unfortunate,
but as there is only 2 digits in the year, we have to invent something.
And it would be quite optimistic to assume this will bite us back any
time soon :D

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-03 09:50:50 -07:00
Miika Turkia
bd20b8c9a2 CSV import: import dive number if defined
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 12:01:55 -07:00
Miika Turkia
51b7de7812 CSV import: import time field if available
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 12:01:55 -07:00
Miika Turkia
f1a24f08fb CSV import: support for user specified date format
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 12:01:55 -07:00
Miika Turkia
f3abedd588 Print xsltproc command line on verbose mode
Printed command line can be used to manually test the import function,
allowing faster testing of XSLT changes, and showing debug prints that
are discarded by Subsurface.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 12:01:54 -07:00
Miika Turkia
4393f59250 CSV import: use date field on profile import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 12:01:54 -07:00
Miika Turkia
46fa803259 CSV import: convert cylinder size from imperial
This will convert cylinder size when importing from imperial units. I am
using default working pressure of 3000 PSI that is not precisely
correct, but should be close enough for the most common aluminium
cylinders.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 12:01:54 -07:00
Dirk Hohndel
403a7b959c Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-26 09:38:53 -07:00
Miika Turkia
97a26166e7 Add Ubuntu Xenial to be built (16.04)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-26 09:26:52 -07:00
Miika Turkia
21ad9ac62c Abort git authentication attempt
If we have incorrect cloud credentials, we need to return an error on
git authentication call back in order to avoid endless authentication
loop. This might well happen e.g. when changing the password on desktop
and then on laptop Subsurface still thinks the credentials are validated
and ends up in the authentication loop.

The authentication call back on libgit is intended to be used to ask for
user credentials, and as we handle credentials elsewhere, we just need
to fail the authentication attempts. (The threshold for bail out could
have been 1 attempt...)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:34:24 -07:00
Miika Turkia
4ef2ef1540 Fix time parsing for Divesoft Freedom
Divesoft uses 17 bits for time so parse accordingly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:32:50 -07:00
Miika Turkia
573489bebc DL7: parse temperature and cylinder pressure
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:32:35 -07:00
Miika Turkia
14aafaa67d Parse date and time in DL7 import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:32:22 -07:00
Miika Turkia
6df8752d7d Grab the payload of DL7 file
This allows us to parse the DL7 profile data (skipping the header and
footer)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:32:10 -07:00
Miika Turkia
9d26f40279 CSV import: support min.sec format
Assume a format containing a dot to be min.sec as defined in DL7
specification.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:31:58 -07:00
Miika Turkia
6cc6c04521 Special handling for DL7
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:31:44 -07:00
Miika Turkia
f7ec0b3dd0 Detect DL7 depth units
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:31:36 -07:00
Miika Turkia
d6f6a8c7f8 Basic GUI part for DL7 import
This sets the basic properties properly but is still missing the parsing
of meta-data, especially used units.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:31:27 -07:00
Miika Turkia
9fe0cbaae4 Fix file extension regesp
The original negative lookahead failed in case the file name contains
more than 1 dot as it looks for dot that is not followed by the given
extensions. And such a match exists in the file name. The new version
should look properly if the file ends with any of the given extensions.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:31:15 -07:00
Miika Turkia
979dee2de7 Add CSV parsing trigger for zxu and zxl files
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:03:28 -07:00
Miika Turkia
696541e7b0 Add DAN DL7 file extensions for import UI
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:03:16 -07:00
Miika Turkia
c52bbc660c Detect pipe as field separator in CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:02:50 -07:00
Miika Turkia
3ce15d236b Add pipe as supported field separator on CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 12:02:15 -07:00
Dirk Hohndel
40af185902 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 15:46:24 -07:00
Dirk Hohndel
e56e522ac5 Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 21:00:47 -07:00
Miika Turkia
410ea40229 Import picture URLs from divelogs.de
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 20:59:25 -07:00
Miika Turkia
a1fb31a2d8 Fix UDDF import indentation
Only indentation is changed on this commit.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 20:59:08 -07:00
Dirk Hohndel
a26c1c6df1 Updates for version 4.5.6
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 20:14:40 -07:00
Rick Walsh
ed8e665242 VPM-B profile: declare CVA iteration variables within each loop
The variables that control each CVA iteration should be declared at the start
of each loop so that the values are carried over from one iteration to the
next.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-04-18 20:10:10 -07:00
Robert C. Helling
15d07a879e Fix time of first ceiling calculation
In our verision of VPM-B for real dives, we take as the deco time the
difference between the time of the deepest ceiling and the time when the
ceiling clears.

When the display of ceilings was set to multiples of 3m this was confused, as
the maximum finder had issues: First of all, it updated the time when the ceiling
was the same (which was almost always the case for stepped ceilings) but changing
>= to > was not enough, since then the first time a deepest stepped ceiling was
reached was used.

This patch uses the actual ceiling (not rounded to the next integer multiple of 3m)
for this calculation to get rid of this problem.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-04-18 20:09:58 -07:00
Linus Torvalds
b3b43e0140 Fix dive computer copying
When copying a dive, we need to copy all the dive computers, but the first
one is special since it is embedded inside the "struct dive".

We had special case code for that case, but it only copied the samples and
events.

Use the proper "copy_dc()" for the primary dive computer copying too,
which gets all the details right.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11 12:23:49 -07:00
Linus Torvalds
7e15c2a7ad Fix seabear import sample overrun bug
The Seabear import fixed up the NDL and TTS in the samples from minutes
(in the import) to seconds (our internal format for all time).  But it
did it with a loop that overran the end of the samples array by one:

	for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) {

Fix it to use the proper "<" instead of "<=".

Reported-by: Stuart Vernon <stuartv@force2.net>
Tested-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11 12:23:39 -07:00
Dirk Hohndel
37e08d5e25 Give git progress dialog a chance to actually display something
The UI only runs when the main thread pauses, but the main thread is busy
doing the git update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-09 08:33:37 -07:00
Dirk Hohndel
d0754138a4 Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-09 08:33:37 -07:00
Dirk Hohndel
669e2bf9fe Cloud storage: make first connect a post
But don't wait for it to succeed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-09 08:33:36 -07:00
Dirk Hohndel
fe8c2ba6ce Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02 06:32:18 -05:00
Miika Turkia
e9caf75db0 SDM import: fix logic for sample import
Seems that testing if BOOKMARK is empty is a bad idea. We end up not
getting any samples, but the ones containing a bookmark. So we need to
switch the logic to testing if BOOKMARK contains something and do those
tasks first and otherwise grab a regular sample.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02 06:31:31 -05:00
Miika Turkia
916ed01830 SDM import: calculate duration if needed
Seems that DiveManager does not always return the dive duration in
DIVETIMESEC field. In this case we can try to calculate the duration
from sample count and interval.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02 06:31:22 -05:00
Dirk Hohndel
3ba21027b9 Get ready for 4,5,5 release
Update README and ReleaseNotes

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-28 16:40:15 -05:00
Robert C. Helling
90bd1b0af7 When changing units from psi to bar first change value, then max
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 13:55:09 -07:00
Werner Macho
fd10342b24 typo fix
small typo fix for GUI

Signed-off-by: Werner Macho <werner.macho@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 13:38:05 -07:00
Dirk Hohndel
c332bf2cfa Don't start Add or Plan while accessing cloud storage
This avoids a race condition where we get confused about our internal
state.

Fixes #1031

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 17:20:17 -07:00
Robert C. Helling
e167506bdb Make the reserve gas units aware
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.

Fixes #1027

[Dirk Hohndel: small modifications, more reasonable step for psi,
               more reasonable maxima]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 16:32:39 -07:00
Miika Turkia
0d080f3249 CSV export
Need to discard dive site notes on csv export..

miika

From ab23245e2acee32410fa680d0eaab098af69b5c2 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Mon, 21 Mar 2016 17:50:28 +0800
Subject: [PATCH] CSV export: discard dive site notes

The new format of divesite management breaks the CSV export as the notes
of divesites are matched.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:43:46 -07:00
Rick Walsh
550f07da8b Profile widget: Display gradient factors used in plan
Currently, the gradient factors displayed at the top of the profile are the
gradient factors set in preferences.  This is correct for saved dives, but
when planning dives, the gradient factors displayed at the top of the profile
should be the gradient factors used in the plan.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 11:35:28 -07:00