Commit graph

19620 commits

Author SHA1 Message Date
rmorris
a1a834568a Correct paths, to allow libmtp to build
Signed-off-by: rmorris <rmorris@rkmorris.us>
2023-02-09 05:17:23 -08:00
Michael Keller
40fc037aa4 Fix handling of gas type for CCR dives.
Fix bug introduced in #3576: On CCR dives cylinders listed as open
circuit bailout by the dive computer need to be set to `OC_GAS`.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-09 10:51:39 +01:00
Michał Sawicz (Saviq)
8fe5564059 ci: bring Snap USNs back
Ref. https://bugs.launchpad.net/snapstore-server/+bug/2004008

While that gets resolved, ignore the extra packages when checking for
security notices.

Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-02-08 07:48:34 -08:00
Berthold Stoeger
7b44689c8e parser: fix char-not-found checks in import-csv.c
These were two weird and clearly wrong constructs of the
type "if (iter && iter + 1)", where iter is a pointer. This
is always true at best and undefined at worst. Another
instance was removed in 096de0efd0.

The original code probably wanted to check whether the
found character was the last character in the string.
But that likewise seems to make no particular sense in
this context. Therefore, just remove the second part of
the boolean expression.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-07 23:43:04 +01:00
Michael Keller
1e3d378ad9 Cylindermodel: Improve editing of tank use
Use the drop down for editing the tank use in the gas list in both the
equipment tab and the dive planner.
The tank use column is now available in the equipment tab for all dives
and not just CCR dives, as 'not used' is a valid entry in both cases.
However, if the current dive is an OC dive, only 'OC-gas' and 'not used' are
shown.
There still seems to be a problem that in some cases, when opening the
planner after selecting an existing CCR dive the drop down in the
planner does not list CCR gas uses - for some reason `displayed_dive`
does not seem to be updated correctly on opening of the planner. But I have not been able to
reproduce this consistently, and changing 'Dive mode' fixes this.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-07 14:20:29 +01:00
Kim Delmar
1ed995aa7a html export: update CHANGELOG.md
Signed-off-by: Kim Delmar <62100831+KimDelmar@users.noreply.github.com>
2023-02-05 14:32:09 +01:00
Kim Delmar
3c771e2ee2 html export: fix diveguide display
Signed-off-by: Kim Delmar <62100831+KimDelmar@users.noreply.github.com>
2023-02-05 14:32:09 +01:00
Michael Keller
de4cad22b6 Desktop: Clarified the Dive Computer Firmware Update Message.
Clarified the message that is shown when a newer dive computer firmware
version is available, informing the user that
using an older firmware version may result in problems when using
Subsurface, as discussed in #3568.
This is currently only supported for Heinrichs-Weikamp dive computers.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-03 13:37:52 +01:00
Michael Keller
a92ee1e05d Refactoring: Use core functions to find gasmixes in TankItem.
Small refactoring to use `get_gasmix_at_time` from `core` in `TankItem`
to find the first gasmix used during a dive.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-03 08:24:56 +01:00
Michael Keller
72c40a18c2 Desktop: Fix brightness configuration for OSTC4
The Heinrichs Weikamp OSTC4 introduced an additional
'Cave' brightness level that is dimmer than all existing ones.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-03 08:22:13 +01:00
Michael Keller
321c8d92dc Improvement: Show gases as diluent by default for CCR dives.
Instead of adding all gases read from a dive computer as part of a dive
log as 'OC-gas', add gases as 'diluent' if the dive has a dive mode of
'CCR'. This creates consistency with the ppO2 for CCR dives being
tracked as sensor readings or a fixed setpoint, and not as the ppO2 of
the current gas ad depth.
A follow up question from this is whether gas use in the cylinders list
on the Equipment tab should be user editable. This seems to be
inconsistent at the moment, with gas constituent percentages downloaded
from the dive computer being editable, but gas use not.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-01 21:26:48 +01:00
Michael Keller
ada32f999e Cleanup: Remove 'data' field from 'DeviceDetails'.
`device_data_t data` in DeviceDetails has never been populated since it was first
added, and consequently is not used. This is confusing, especially as certain
fields inside `device_data_t` have been added directly to `DeviceDetails` in the meantime (e.g. `firmwareVersion`).

Separated from #3568 as per
https://github.com/subsurface/subsurface/pull/3568#pullrequestreview-1274995287.

Signed-off-by: Michael Keller <github@ike.ch>
2023-01-31 10:54:39 +01:00
Michael Keller
7ecc4c7034 Cleanup: Fix typos in comments.
Fixed some typos in comments.
Separated from #3568 as per
https://github.com/subsurface/subsurface/pull/3568#pullrequestreview-1274995287.

Signed-off-by: Michael Keller <github@ike.ch>
2023-01-31 00:03:06 +01:00
Dirk Hohndel
0ccb762a09 build-system: disable the daily Snap build for now
Apparently these currently end up in a rebuild loop.

Suggested-by: Michał Sawicz <michal@sawicz.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-27 09:25:55 -08:00
Michał Sawicz (Saviq)
a21cddc69a snap: use version: git
Snapcraft can determine the version from git on its own.

Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-01-19 10:37:48 -08:00
Michał Sawicz (Saviq)
e335c7a20d snap: fix GitHub Action warnings
`set-output` is getting deprecated, so need to move to newer ways.

Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-01-19 10:37:48 -08:00
Michał Sawicz (Saviq)
76c4b76027 snap: refresh for ubuntu-latest being 22.04
Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-01-19 10:37:48 -08:00
Martin Splitt
1b5de2d33b Update CHANGELOG.md
Signed-off-by: Martin Splitt <martinsplitt@google.com>
Signed-off-by: Martin Splitt <splitti@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Martin Splitt
30c5dfce00 HTML export: make element ids more consistent
Signed-off-by: Martin Splitt <martinsplitt@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Martin Splitt
02f4eb6904 HTML export: rename divemaster references to diveguide
This fixes the search in the web export.

Signed-off-by: Martin Splitt <splitti@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Berthold Stoeger
d7ca0c7253 planner: avoid out-of-bounds access
When exiting the loop, stopidx is 0, which means that if there
are no stoplevels, stoplevels[stopidx + 1] generates an
out-of-bounds access. Instead, suppose a stop at 3m or 10ft.

Suggested-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-01-19 14:26:00 +01:00
Berthold Stoeger
687f65bf77 planner: avoid out-of-bound access when initializing the planner
For dives with many samples (i.e. logged dives), samples are merged.

I'm not exactly sure how this code works, but it does an
out-of-bound access in some cases. Avoid that by a simple
check.

That said, I wonder if this downsampling is a good idea. A user
reports that they have logged dives marked as manually added dives.
We now load them into edit mode, which means a significant loss
of information.

Perhaps we should consider dives with more than 100 samples as
non-manual dives?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-01-19 14:26:00 +01:00
Berthold Stoeger
063a20a406 desktop: pass dive list to ShiftTimesDialog
Users report that the ShiftTimesDialog does not work on Mac and
Windows. Apparently, get_first_selected_dive returns NULL, which
should not be possible because the dialog is only created when
dives are selected. Very omninous.

Get the selected dives in the caller and pass them down. This
bug at least should not happen anylonger. Perhaps now the
dialog does not show at all, but that will narrow down the
root cause of the problem.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-01-18 15:42:47 -08:00
Andrei Rybak
f45379e97c CONTRIBUTING.md: update link to transifex.com
URL https://www.transifex.com/projects/p/subsurface/ now redirects to
https://explore.transifex.com/.  Update the link to

    https://explore.transifex.com/subsurface/subsurface/

which is the landing page for Subsurface on transifex.com.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
a8eaa3e391 CONTRIBUTING.md: link to CODINGSTYLE.md
File `CodingStyle` was renamed to `CodingStyle.md` in 0ceb7e01d (Convert
CodingStyle file to Markdown notations, 2018-04-14) and then to
`CODINGSTYLE.md` in 4ef1e9cb2 (documentation: coding style.,
2019-12-25).  However, a link to the file in `CONTRIBUTING.md` wasn't
updated.

Fix the dead link to the coding style guidelines in `CONTRIBUTING.md`.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
5de9c2b30b CONTRIBUTING.md: capitalize "Git"
Git's own documentation consistency capitalizes the word "Git" in prose.
Follow its example and capitalize the word "Git" in prose of file
`CONTRIBUTING.md`.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
4996d90d53 CONTRIBUTING.md: emphasize image caption
Markdown doesn't have a syntax for image captions.  While we could use
table syntax (an extension in GitHub's flavor of Markdown) to align the
caption more clearly with the image, it wouldn't be very readable in
plain text and Markdown renderers that don't have such an extension.

Reduce confusion of readers by makimg the caption of the gitk screenshot
formatted differently than the surrounding paragraphs.  Use emphasis
syntax for that.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
43cdcd0c4b CONTRIBUTING.md: link to "imperative mood" inline
Replace raw URL to English Wikipedia article about imperative mood with
an inline link.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
1cc6981b62 CONTRIBUTING.md: use paragraph breaks consistently
Replace hard-line break (rendered in HTML as a `<br />` tag) between two
paragraphs in `CONTRIBUTING.md` with an paragraph break (blank line) for
consistency with the rest of the document.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
8f7abb2581 CONTRIBUTING.md: add a blank line before a list
List of code areas in `CONTRIBUTING.md` immediately follows the previous
line.  While GitHub's Markdown parser doesn't mind, some Markdown
parsers don't consider it a list.  Add a blank line between the list and
the preceding paragraph to ensure that the list is rendered correctly in
more Markdown renderers.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
bec625eb01 CONTRIBUTING.md: format filenames in monospace
Wrap filenames in paragraphs in `CONTRIBUTING.md` in backticks to render
them in monospace font.  Fix an accidental double space before the
reference to `CHANGELOG.md`, while we're here.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
b607140a2a CONTRIBUTING.md: format command example in monospace
Replace double quotes around `git commit --amend` command example in
`CONTRIBUTING.md` with single backticks to format it in monospace font.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
be1c5b574b CONTRIBUTING.md: use block syntax for prose examples
Use Markdown block syntax for the example of a commit message instead of
hard-line breaks with double spaces at the end.  Such formatting
separates it from the other parts of the text in `CONTRIBUTING.md` and
makes the wrapping at 74 characters easier to understand with monospace
font.  Do the same to the examples of `CHANGELOG.md` entries.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
4899a04505 CONTRIBUTING.md: use block syntax for commands
Replace combination of Markdown inline code syntax (single backticks)
and its hard-line break syntax (double space at end of the line) in file
`CONTRIBUTING.md` with block syntax (four-spaces-wide indentation) and
paragraph breaks (empty lines) for examples of commands to run to make
them look nicer and easier to read in plain text.  Add a missing colon
before the `format-patch` example, while we're here.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
062533d0ac CONTRIBUTING.md: use dashes instead of hyphens
Make `CONTRIBUTING.md` look a tiny bit nicer when rendered by replacing
double hyphens with en-dashes.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Dirk Hohndel
763ce015ff update libdc
garmin: relax string parsing sanity checks

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-02 17:01:53 -08:00
Dirk Hohndel
31277daa71 Update libdc
Add parsing of the CCR setpoint information for Garmin Descent computers

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-12-05 21:09:14 -05:00
Dirk Hohndel
7e43943541 GitHub actions: adjust to Ubuntu 22.04 builds
The qt5-default package was dropped (and isn't needed anymore).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-26 11:42:25 -08:00
Doug Junkins
d537e16cb1 macOS: support newer SDKs
Update to match Xcode command-line-tools SDKs from 10.X to 16.X

Signed-off-by: Doug Junkins <douglas.junkins@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-26 11:40:51 -08:00
Dirk Hohndel
520be78fa8 cleanup: use better connect syntax
This should be used everywhere by now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-25 15:20:47 -08:00
Berthold Stoeger
f27ff65970 statistics: don't use DrawTriangleFan and DrawLineLoop modes
For some reason (use of OpenGL?) with Qt6 these modes fail for me.

Needless to say, I consider this API change a very unfriendly
behavior.

Replace these modes by DrawTriangleStrip and DrawLineStrip.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-19 15:07:07 -08:00
Berthold Stoeger
c62b837b12 statistics: don't import QtQuick in StatsView QML file
This include prevented the statistics from loading for me on Qt6.
And it appears to be unnecessary.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-19 15:07:07 -08:00
Berthold Stoeger
5bd5ff2c2d statistics: fix zero-range on value axis
The code that calculates the bounds of the value axis was broken
when all items had the same value. In that case, increase the shown
range explicitly. It doesn't really matter how much the range
is increased, because all items will be at the center of the graph.

Also, don't overwrite the "decimal" value of the class. That was
just weird.

Fixes #3544.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-19 15:06:22 -08:00
Berthold Stoeger
cf70a25be4 statistics: remove old unused statistics code
This never came to be - no point in carrying it around.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-19 15:03:30 -08:00
Berthold Stoeger
5525344594 git: don't access global dive site table
When loading a git repository, dive sites where loaded into the
global dive site table, not the local table. Apparently, nobody
ever tried to import a git repository into an existing divelog
(as opposed to opening it in the application). Because that would
have probably given funky results.

Remove this access of a global variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-15 14:15:11 -08:00
Berthold Stoeger
2112bd8e08 build-system: make -build-with-qt6 work
-build-with-qt6 did not work for me, because the flag is
ignored when selecting the qmake executable. It would find
the system-wide qmake executable, which is Qt5 and then
decide to build with Qt5.

When the flag is set, try to search for a Qt6 version of
qmake first. On Ubuntu based distros this seems to be
qmake6

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-15 14:08:37 -08:00
Robert C. Helling
741099bdbb Show correct gas density in CCR mode
When collecting the data for the infobox, we have
already computed the current partial pressures of the
breathing gas taking into accoutn the divemode. Use
those rather than fractions (which for CCR mode are
those of diluent) to compute the gas density.

Reported-by: Pietro Tranquillini <p.tranquillini@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2022-11-08 10:43:47 -08:00
Dirk Hohndel
46365b3199 Merge remote-tracking branch 'origin/bstoeger-range'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-08 08:13:27 -08:00
Dirk Hohndel
01a25edf82 Update to latest libdc
- uwatec smart: allow bigger BLE packets
- Garmin: attempt to parse big endian FIT files from the Garmin website

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-08 08:11:07 -08:00
Berthold Stoeger
4bbe5646a5 cleanup: remove unused declarations in planner.h
Most of these declared non existing functions or pointers.
One [get_gas_idx()] was only used in one source file and
doesn't have to be globally accessible

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-01 12:12:19 +01:00