Pull requests can be triggered by anyone - we should not publish code
that comes in through pull requests to either GitHub releases or
Launchpad, Copr, etc.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's embarrassing that we kept doing this for so long. Debian and Ubuntu
have had new enough versions of libgit2 for a very long time.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If there are no gas mixes returned by libdivecomputer, we need to default to air. The previous commit would have defaulted to pure oxygen.
Signed-off-by: Micha WERLE <micha@michaelwerle.com>
During code review, an argument was made to use the bottom gas mix as
the mix to fill additional tanks with instead of the last mix reported
by the dive computer.
This change implements `get_deeper_gasmix` which compares two gas mixes
and returns the one with the lower MOD. This comparison does not perform
actual MOD calculations but only performs a relative oxygen and helium
content comparison.
Instead of saving the last gas mix and assigning it to additional tanks,
a `bottom_gas` mix is saved and assigned instead.
Signed-off-by: Micha WERLE <micha@michaelwerle.com>
Reverted "optimisation" based on code feedback.
Firstly, it's implementation-defined whether or not a stack frame is created for sub-scopes, secondly any optimisation is questionable regardless, and thirdly it was felt that it makes the code harder to understand.
Signed-off-by: Micha WERLE <micha@michaelwerle.com>
Instead of defaulting to air when we run out of gas mixes to assign to
cylinders, use the last gas mix provided by the dive computer.
If no gas mixes are provided at all, then default to air.
This prevents Subsurface from "inventing" gas mixes which are not
reported by the dive computer. It also works very nicely with a sidemount
configuration where the dive computer typically reports two cylinders but
only a single gas mix.
Signed-off-by: Micha WERLE <micha@michaelwerle.com>
It's unclear if this will be enough to use gcc 10 by default when building
Subsurface using this container.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The divecomputer_device_open() function tries all supported transports
one by one, and exits as soon as one is opened successfully. When the
end of the function is reached, the DC_STATUS_UNSUPPORTED error code is
returned.
The annoying side effect is that the actual error code returned by the
transport is ignored and changed into DC_STATUS_UNSUPPORTED. This is
very confusing while troubleshooting download problems.
Fixed by initializing the error code to DC_STATUS_UNSUPPORTED, in case
no transport is available for trying, and returning the last reported
error to caller.
Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
Add the Aqualung i330R and Apeks DSX model numbers to the Pelagic
pattern table. These two models also use a new BLE service UUID.
Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
The UUID of the Divesoft BLE service needs to be added to the list of
known services. It's a 16-bit UUID that gets detected as a standard
service and is ignored otherwise.
Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
This adds a test for the bug just fixed, where we have a trimix gas and
nitrox/air with less o2 than the trimix.
Signed-off-by: Anton Lundin <glance@ac2.se>
When we've already seen a trimix gas, of we after that see a nitrox gas
with less o2, it shouldn't update the mino2 state.
Signed-off-by: Anton Lundin <glance@ac2.se>
When the import from a dive computer gives you 100% as the first gas,
the get_dive_gas never finds which gas had the lowest o2 percent.
This fixes the logic to find the lowest o2 percent in any dive cylinder
list.
Signed-off-by: Anton Lundin <glance@ac2.se>
It looks kinda strange that all CCR dives have a dive gas ..100%, so
rather than showing it as the dive gas used, just ignore cylinders
with usage flagged as oxygen.
Signed-off-by: Anton Lundin <glance@ac2.se>
Fix deprecation warnings for actions using a deprecated version of node.
Also switch to a fixed version of the environment in order to avoid
future deprecation warnings.
Signed-off-by: Michael Keller <github@ike.ch>
If enabling the notification fails, receiving data packets is not
possible. Instead of silently ignoring this fatal problem and trying to
continue, report the error back to the caller.
Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
This does two independent things:
It sets the planner state early enough so the appropriate
default profile for the planner is created (without
safety stop).
Upon cancelling the planner, it resets the profile widget
to profile more (rather than planner) as otherwise upon
the next change into the planner the planner model is
not properly initialized.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
To be used on Subsurface merch, this introduces versions
of the Subsurface icon with the program's name and web
address.
Signed-off-by: Robert C. Helling <helling@atdotde.de>