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>
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>
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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
-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>
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>
- 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>
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>
Search the index of an item in a container. Compare by
equality or a lambda. The lack of these have annoyed me for a
long time. Return the index of the first found element or
-1 if no element found.
Currently, only supports random-access operators. Might be
trivially changed for forward iterators.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When switching from "empty mode" (i.e. the subsurface logo is shown,
because no dive is selected), the profile is first shown by switching
to the appropriate tab and then plotted. However, the showing might
lead to a resize event and then to a crash with owing to stale dive
data. Therefore, reverse that.
Note that I never could reproduce that.
Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
When the profile was to small, it would switch into empty state
and clear the plot info.
On resize events, the plot info is not recalculated.
This means that when making the profile extremely small and
then bigger, nothing is shown.
This may also happen on startup. The profile is rendered into
a 0x0 widget and then gets a resize event.
Therefore, remember when the profile is empty and force a
recalculation of the plot info.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The chances that their are still users of the old thumbnail
format (i.e. all thumbnails saved in the hash file) are basically
0. If there are they will just get their thumbnails rebuilt
when opening the individual dives.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>