Commit graph

17 commits

Author SHA1 Message Date
Linus Torvalds
28e3413ff6 Add 'location_t' data structure
Instead of having people treat latitude and longitude as separate
things, just add a 'location_t' data structure that contains both.

Almost all cases want to always act on them together.

This is really just prep-work for adding a few more locations that we
track: I want to add a entry/exit location to each dive (independent of
the dive site) because of how the Garmin Descent gives us the
information (and hopefully, some day, other dive computers too).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-21 19:55:09 +03:00
jan Iversen
262e994bbc core: removed clang warnings from units.h
lbs_to_grams and to_feet returns int but uses
a function that returns long, causing clang to
warn about conversion loss due to implicit conversion.

Adding a cast, shows that it is correct.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 21:27:37 +03:00
Oliver Schwaneberg
0ca52f868e Choose water presets from a qcombobox in planner, custom value possible
Add a combo box for water types with defaults for fresh water, sea water
and the EN 13319. All values taken from units.h, where EN 13319 was added
beforehand.
Custom values can be entered through a spinbox.
Also changed "Salinity" in TapDiveInformation.ui to "Water type".

Translation required!

Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-03-02 08:38:22 -08:00
Stefan Fuchs
862e121532 Correct comments for struct temperature_t value range
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-02-24 11:45:17 -08:00
Stefan Fuchs
95a23cf470 Use temperature_t for temperatures in struct stats_t
Use struct temperature_t for temperatures in struct stats_t and
use get_temperature_string() when printing these temperatures for
statistics and HTML export.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-02-24 11:45:17 -08:00
Stefan Fuchs
bd88306722 Change prefs.show_units_table to bool
Bool is the correct choice for this option.
int was used before because it was not clear to me how and if I can use
bool in this C file.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-24 07:56:10 -08:00
Berthold Stoeger
9ec7aa7fd7 Fix typo: LENGHT -> LENGTH 2017-11-17 15:29:42 +01:00
Stefan Fuchs
1f8506ce64 Display values in info box only if value is interesting
Type duration_t changed from uint to int.

Default value of '-1' introduced for some of the values in struct sample:
NDL used -1 as default.
Bearing uses -1 as default (no bearing set).

Display pXX, EAD, END, density, MOD only if values are larger than 0.

In profile don't display data from two first and two last plot_data
entries in info box.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-13 20:50:10 -08:00
Stefan Fuchs
78cda85444 Display units in dive list table based on prefs option
Add a preferences option which enables or disables display of units in the
main dive liste table.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-09 11:49:29 +03:00
Robert C. Helling
0cf8ef6e2d Adopt O2 and He densities to 20degC
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-26 15:52:04 -07:00
Robert C. Helling
bb6ceba4ac Compute and display gas density
This appears to be critical for work of breathing so it might be
worthwhile to compute. So far only in infobox.

For background, see

https://www.youtube.com/watch?v=QBajM3xmOtc

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-26 15:52:04 -07:00
Dirk Hohndel
876b479d69 Wire up duration units preference UI
Now we track the preference, but we don't act on it, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06 13:49:36 -07:00
Dirk Hohndel
b368ecd5aa Add SPDX header to remaining core files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Dirk Hohndel
08284275e7 Merge branch 'master' of https://github.com/dje29/subsurface 2017-03-11 08:41:41 -08:00
Martin Měřinský
dcf2542215 Use abbreviations with dots. 2017-03-11 08:09:07 -08: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
Dirk Hohndel
7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00
Renamed from subsurface-core/units.h (Browse further)