Commit graph

11903 commits

Author SHA1 Message Date
Robert C. Helling
295b1b78d8 Make depth conversion work for negative depths
This is needed in the altitude pressure conversion as there
negative altitudes are possible (for diving in the netherlands
or the Dead Sea).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-11 08:03:25 -08:00
Stefan Fuchs
af96ec5d04 Minimum gas calculation: Ducumentation in user manual (EN)
Small paragraph in EN user manual added.
Planner screen shots changed and renamed.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 08:01:35 -08:00
Stefan Fuchs
8a4d3876d6 Disable minimum gas calculation for recreational mode
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 08:01:35 -08:00
Stefan Fuchs
7f8c3592ce Minimum gas calculation - Calculations and UI parameters
Add minimum gas calculation to planner output.
Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime.
Connect UI signals and slots for recalculation of diveplan.

Disable minimum gas calculation if there was already a warning before.
If minimum gas result is larger then cylinder start pressure give warning message instead of result.

Add line break before pO2 warnings but only if warnings exist.

Signed-off-by: Joachim Ritter <jritter@bitsenke.de>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 08:01:35 -08:00
Stefan Fuchs
b8e044dee3 Don't erroneously mark the cylinder pressure red and set font italic
In the cylinder table today the cylinder start and end pressure fields
are marked red and the end pressure font is set to italic if cyl->end is 0.
But sometimes with planned dives there is no cyl->end but only cyl->sample_end.
This is taken into account now.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 07:27:18 -08:00
Stefan Fuchs
ab887e4438 Fix cyclinder table issue "workingpressure" in planner
Fixes the issue that the cylinder table in the planner is messed up after
changing the table header.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11 07:27:18 -08:00
Jeremie Guichard
2b06a0b223 Fix potential double/float to int rounding errors
Not using lrint(f) when converting double/float to int
creates rounding errors.
This error was detected by TestParse::testParseDM4 failure
on Windows. It was creating rounding inconsistencies
on Linux too, see change in TestDiveDM4.xml.

Enable -Wfloat-conversion for gcc version greater than 4.9.0

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-09 23:07:30 +07:00
Jeremie Guichard
406e4287eb Change calls to rint into lrint avoiding conversion warnings
Using gcc option "-Wfloat-conversion" is useful to catch
potential conversion errors (where lrint should be used).
rint returns double and still raises the same warning,
this is why this change updates all rint calls to lrint.
In few places, where input type is a float, corresponding
lrinf is used.

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-08 14:04:17 +07:00
Martin Měřinský
9c2619ea3b For About UI window layout, use SetFixedSize.
Window is resized according to its content.
There is no need for user to resize this window.
2017-03-07 21:45:05 -08:00
Martin Měřinský
d6bfcd5245 In weights table 'weight' is redundant and no used for other types. 2017-03-07 16:22:27 -08:00
Martin Měřinský
186a80fffe Enable translate 'All' in yearly statistics. 2017-03-07 16:22:03 -08:00
Stefan Fuchs
e34e2693ea Enable bottom pO2 option also for recreational dives in planner
Bottom pO2 gas option in planner should be always enabled because
also recreational dives can use nitrox and produce "high pO2" warnings.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-07 16:21:28 -08:00
Lubomir I. Ivanov
e8c918622f Printing: support the "Border width" setting for templates
Going to "Template -> Edit" now has a field to enter the
border width (in pixels as only that makes sense in CSS as a flexible
unit, TMK).

This field modifies the template_options.borderwidth Grantlee
property which is part of the bundled templates already
and allows the users to modify the borders of tables.

The C++ implementation was missing, while the HTML (template)
implementation was already in place. Overlooked during GSoC.

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-06 20:08:39 -08:00
Martin Měřinský
831fe3d7f9 fix: User survey UI.
Enable window resize (Lay Out in a Grid).
Center first label and it's text.
2017-03-06 06:40:00 -08:00
Shachar Snapiri
228e2b5a77 Update to the Hebrew translation
Fixed new and old translations, typos and phrasing

Signed-off-by: Shachar Snapiri <shachar@snapiri.net>
2017-03-05 21:29:09 -08:00
Dirk Hohndel
527c622c94 Don't clear plan when (re-) planning
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-05 12:12:49 -08:00
Dirk Hohndel
798965c10d Initialize cylinder index
Otherwise it's possible for an uninitialized value to be used
in addStop which can cause crashes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 17:14:22 -08:00
Dirk Hohndel
d36f056bde Get initial depth/duration correct when manually adding dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
f1c46927ef Ensure correct length of the created dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
b60b7c108e Enable manual setting of duration
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
e9debdf281 Add helper to parse duration text
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
3afc4528b3 Only honor drop stone mode when planning a dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
03eef5b0c2 Implement manual setting of depth
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
74b542ee60 Initial response to entering duration or depth
This marks the UI as modified and updates the maxdepth of the dive; it
ignores changes to the duration, doesn't modify the profile, so it's
nowhere near ready.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
ba570c9eea For manually added dives, show depth and duration
So far this is purely informational, you can't edit this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
05b53d6204 Add depth and duration fields to maintab
And hide them for now. This doesn't change anything visible, it's just
putting in place the pieces for later use.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:16:49 -08:00
Dirk Hohndel
813ccb24f9 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04 12:14:43 -08:00
Martin Měřinský
b14301a84c heartrate, heartbeat > heart rate 2017-03-04 12:08:17 -08:00
Martin Měřinský
869a7fcfcc dive master > divemaster 2017-03-04 12:08:17 -08:00
Martin Měřinský
5fa64fd1ea SankTime > Sank Time 2017-03-04 12:08:17 -08:00
Martin Měřinský
59d18a00db divecomputer > dive computer 2017-03-04 12:08:17 -08:00
Martin Měřinský
67bba5d1c2 cu ft > cuft 2017-03-04 12:08:17 -08:00
Martin Měřinský
46e956aede ppO2 > pO₂ 2017-03-04 12:08:17 -08:00
Martin Měřinský
fccfb968c1 Consistent 'salt water' versus 'fresh water'. 2017-03-04 12:08:17 -08:00
Jan Mulder
7f4b0079f8 user manual: do not repeat
Just said the same thing (CSV file can be edited with a text editor). Too
verbose imho.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
d380795deb user manual: make the difference between import and open explicit
Two different menu path lead to "open a logfile". The File-Open-Logfile
and Import-Import Logfile. The first opens a new logbook, and the second adds the
data to the current log.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
69277afa0e user manual. Add 2 supported import file types
Divesoft dive logs and Poseidon MK VI eCCR dive logs where not listed
as supported, but they are.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
3c2f2c6988 user manual: downloading here
Lets try to be consistent. A dive computer can be in upload mode, and is uploading, but
seen from the host PC, we are downloading.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
c5bae2ea5a user manual: try to describe the add of location the way it is
The here edited section is confusing. It references double clicking,
which does not work in 4.6 (and not sure it ever worked)

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
c204eefaae user manual: do not repeat
Do not repeat the almost same text in the next sentence.

When entering a dive location name, auto location of
dive site names makes it easy to select an existing dive site name.

When typing the name of a dive site,
a dropdown list appears showing all sites with similar names.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
84d34e8b22 user manual: date/time instead of only date
Date and time of the dive are two seperate fields.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
f5b98557d4 user manual: correct upload vs download
When importing from a divecomputer, we are downloading.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
ebac9ea6ce User manual: clearify the use of shortcuts
The way keybord shortcuts work is confusing. 2 ways are used:
- denoted as ctrl-? for some of them
- denoted as underlined character in menu items, proabably language
dependent, and inconsistent.

Despite all this, try to describe it in the manual as it is.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
8c559409c6 User manual: https where we can
http is so 1984 :-)

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
77a611d562 User manual: manual added gas changes have effect to the right
Manual added gas gas changes have effect to the right of the profile, not as erroneously
stated to the left of the point of gas change.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
57f4ae2fce user manual: correct main menu items
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Jan Mulder
c663bed4a3 User manual: minimal Windows 7 from 4.6 onwards
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-04 12:07:12 -08:00
Stefan Fuchs
7eda24d6b1 Correct "set-point" -> "setpoint" and window title setpoint change
Change 2x "set-point" to "setpoint".
Correct window title for "Add setpoint change" window.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-04 12:04:20 -08:00
Jeremie Guichard
b9a3dfb86b Rework TestParse to make tests independent from each other
In the original version, parsing and comparing output was
done in separate test methods. This was forbidding use of
QTest cleanup to call clear_dive_file_data().
As a side effect a failure in one test would make other tests
failing too (since call to clear_dive_file_data was skipped
by QCOMPARE failure).

Added a FILE_COMPARE macro to avoid code duplication.

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-04 12:03:33 -08:00
Jeremie Guichard
5caa9b23fe Use QTest cleanup method for proper test shutdown
In case of QCOMPARE failure, code following the comparison
is not executed, this results in application state not being
properly resorted and often gives several test failures,
when only one test really fails.
Using QTest cleanup method allows restoring proper state,
before next test is executed.

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-04 12:03:33 -08:00