Commit graph

20389 commits

Author SHA1 Message Date
Berthold Stoeger
022b927755 planner: make argument to plan_add_segment() depth_t
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
6b57b3b745 core: make round_to parameter of gas_mod() and gas_mnd() a depth_t
Simplifies practically all the callers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
bd2f7e72f1 core: turn M_OR_FT macro into a function
No point in this being a macro. Make it return a depth_t - it
was unclear that this returns a depth in mm.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
0e77dd9a68 core: implement interpolate() function for unit types
Calls the global interpolate() function for integer types.

For now, the template is enabled if the arguments are not
integer types. Might want to refine that in the future.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
1ccfb823f0 core: make interpolate() a template
Make the type the interpolate() function works on a template type,
so that this can be used for arbitrary unit types without warnings.
Internally, it does its math using floating point arithmetics anyway,
so no risk of overflow. (Exception: when just taking the middle point,
but I would hope that no part of the code lives on the edge such that
addition of two values gives an overflow.)

Moreover, add an "math.h" include so that the header becomes
independent of others.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
6fbc3917bb core: make unit user-defined literals constexpr
Currently, we can't use our unit literals, such as "3_m" in
constexpr context, for example to define them as variables
as such:

static constexpr deco_stops_multiplier = 3_m;

Declaring the respective operator""() functions as constexpr
enables this use case.

The _ft and _atm literals are left as non-constexpr, because
they use round(), which is not constexpr on our Android
compiler. Revise this later.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
da17f6a08c core: pass depth_t to depth_to_* functions
This is a drop in the ocean. Make the usage of the unit-types a
bit more consistent throughout the code base.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
661ce3f9c7 Whitespace fix: no Java-style functions
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
bc35aadc20 trivial: replace macro cube() by inline function/template
Avoids funky side effects. The old version would have failed
horribly for innocent invocations such as "cube(a+b)" or
"cube(++a)".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-14 12:34:44 +01:00
Berthold Stoeger
d26f1a07cf trivial: remove unused macro
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-14 12:34:44 +01:00
Berthold Stoeger
6f367c70b7 Create UUID when adding a dive site to core
3f8b4604be introduced a bug: it replaced alloc_dive_site() by the
divesite constructor. However, the latter does not generate a
UUID (for that it would have to access the dive site table).

Thus newly added dive sites had no UUID and could not be saved
properly.

Use the register_site() instead of the put() function when
adding the dive site to the core, so that the UUID is created
if needed.

This needs an audit.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-08 17:56:53 -08:00
Subsurface CI
e0d1a54aef macOS: build against Qt 5.15.16
With this we should be able to switch to a newer mac build VM.

Signed-off-by: Subsurface CI <ci@subsurface-divelog.org>
2024-12-06 16:37:39 -08:00
Michael Keller
4410302de8 CICD: Add Build for Debian / bookworm (stable).
Our current build for debian trixie (testing) has started failing
because mdbtools-dev seems to be no longer available in trixie.
Not sure what the future plans for mdbtools are - the project itself
seems to be a bit stagnant, so we might need to consider removing this
from builds where the target OS has stopped supporting this tooling (or
change to download and install this library ourselves as part of our
build process.
For now I am adding a build for debian / bookworm to cover debian, and
disabling the debian / trixie build.

Signed-off-by: Michael Keller <github@ike.ch>
2024-12-06 14:07:16 +13:00
Michael Keller
f7e624fe0f Profile: Stop Hiding All Compass Headings.
It seems to be over the top to hide all compass heading information just
because _some_ dive computers log them for every sample.
A better approach will be to either suppress these in the parser for the
affected dive computer, or let the user suppress them in the
profile if they wish to do so.
Since there is no information in the comments about the manufacturer /
model of the affected dive computer, this is implementing a 'scream
test'.

Signed-off-by: Michael Keller <github@ike.ch>
2024-12-04 01:48:54 +13:00
Berthold Stoeger
4d4c250589 Avoid UTF8->UTF16->UTF8 roundtrip when logging on mobile
Make writeToAppLogFile() take an std::string parameter to avoid
an unnecessary UTF8->UTF16->UTF8 (std::string->QString->char *)
roundtrip.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-01 16:33:33 +01:00
Jef Driesen
7d1e0ef0d1 Redirect logs to the application log file again
In commit 4de109bbf1, qDebug() was
replaced with report_info(). As a side effect, the subsurface log
messages are no longer redirected to the application log file. Only the
internal Qt logging ends up in the log file.

For bug reporting by end-users, this application log file is important
because it's the easiest way to collect all the necessary information to
investigate the problem.

Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
2024-11-30 16:22:30 +01:00
Michael Keller
be6b017534 Update the Windows MXE Build Image to 3.4.0.
Signed-off-by: Michael Keller <github@ike.ch>
2024-11-27 08:29:40 +13:00
rmultan
46c439c443 Bluetooth: Add Mares Sirius to known devices
The app already supports Mares Sirius,
but user has to allow scanning for
unknown devices in app settings.
This adds Mares Sirius to known devices.

Signed-off-by: rmultan <multan.rafal.k@gmail.com>
2024-11-26 22:29:13 +13:00
Michael Keller
015ac0e459 CICD: Build Release Versions on Push.
Change the builds on push (i.e. pull request merges) to build release
versions. This seems to be the correct way to build these, as they are
now distributed as the official builds on
https://subsurface-divelog.org/.
For users wanting to help with debugging, build artifacts on pull
requests are available, and these are debug builds.
Also adding the option to manually trigger builds, so if needed debug
builds can be run on `master`.

Signed-off-by: Michael Keller <github@ike.ch>
2024-11-26 19:37:45 +13:00
Michael Keller
91d8bfef55 Import: Add Parsing for Divesoft Freedom+ Format Files.
Switch the Divesoft log file importer to use the parser in
libdivecomputer. This adds support for the newer Divesoft Freedom+ log
file format.
Also refactor the OSTCTools log file importer to share common
functionality.

Signed-off-by: Michael Keller <github@ike.ch>
2024-11-19 08:47:00 +13:00
Michael Keller
7f42acfdfb Import: Add Parsing for Divesoft Freedom+ Format Files.
Switch the Divesoft log file importer to use the parser in
libdivecomputer. This adds support for the newer Divesoft Freedom+ log
file format.
Also refactor the OSTCTools log file importer to share common
functionality.

Signed-off-by: Michael Keller <github@ike.ch>
2024-11-19 08:47:00 +13:00
Robert C. Helling
7dc92e170f Round MOD to lower depths
When computing the suggested switch depth for a gas,
we should take the next stop depth above the MOD, i.e.
round down. Otherwise we can produce MOD violation warnings.

We need, however, a bit of fudge as otherwise we do not
suggest to switch to o2 at 6m.

TestPlan uses the MOD to determine the depth to switch to
Tx21/35. This happens to be 65.378m. Therefore, switching
at 66m violates the MOD, the switch should be at 63m.
This then affects the gas usage.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2024-11-19 08:46:13 +13:00
Michael Keller
a898173ce7 CICD: Update the MXE Version Used to Build the Windows Version.
This fixes the missing 'Print' functionality in Windows.

Signed-off-by: Michael Keller <github@ike.ch>
2024-11-19 08:44:55 +13:00
Berthold Stoeger
4f7d567571 planner: use value semantics for computeVariations()
When computing the variations in a background thread, the
code has to work on a copy of the dive plan and the deco
state. Instead of passing a copy via a unique_ptr<>, simply
use value semantics when calling computeVariations().

This does an unnecessary copy of the deco state, when
computeVariations is not run in the background, but so what.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-11-17 08:40:24 +13:00
Berthold Stoeger
9f55f167b2 planner: fix calculations of variations
In 8704a8b the code in cloneDiveplan() was replaced by a simple
assignment statement.

Alas, the original code was more complex: it copied only up
to a certain point (it stopped at automatically generated
steps).

The new behavior made the calculations of variations fail,
because a call to plan() adds deco stops.

Therefore, copy the plan _before_ calling plan().

Fixes #4368

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-11-17 08:40:24 +13:00
Dirk Hohndel
beb352d47c Ubuntu: update supported versions
Drop 23.10 / Mantic
Add  24.10 / Oracular

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-11-11 14:22:28 +13:00
Dirk Hohndel
e7900c514c export-html: prevent invalid json
A dive without events could lead to json with extra closing brackets that
prevents browsers from rendering the dive log.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-11-05 19:17:12 +01:00
dependabot[bot]
8e9010a000 build(deps): bump com.github.mik3y:usb-serial-for-android
Bumps [com.github.mik3y:usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) from v3.8.0 to 3.8.1.
- [Release notes](https://github.com/mik3y/usb-serial-for-android/releases)
- [Changelog](https://github.com/mik3y/usb-serial-for-android/blob/master/CHANGELOG.txt)
- [Commits](https://github.com/mik3y/usb-serial-for-android/compare/v3.8.0...v3.8.1)

---
updated-dependencies:
- dependency-name: com.github.mik3y:usb-serial-for-android
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 15:59:52 +13:00
Michael Keller
0e7d3a6466 Desktop: Fix Saving of the Divesite Country.
Fix a bug in the edit divesite country command preventing the
country of the divesite from ever being saved.

Fixes #4357.

Signed-off-by: Michael Keller <github@ike.ch>
2024-11-03 00:31:09 +13:00
crofrog
534bf68639 Update INSTALL.md
corrected missing ``` to allow the file to render the markup correctly

Signed-off-by: crofrog <cshafer@gmail.com>
2024-11-01 06:55:12 +13:00
Victor Arvidsson
077f078151 Updated user-maunal with new instructions for subtitles.
Signed-off-by: Victor Arvidsson <victarv@gmail.com>
2024-10-27 01:37:04 +13:00
Victor Arvidsson
e58824e636 Fixed small bug in replace_all.
Start_pos should of course be 0...

Signed-off-by: Victor Arvidsson <victarv@gmail.com>
2024-10-27 01:37:04 +13:00
Victor Arvidsson
6886c9ccf8 Make the "Save dive data as subtitles" feature more configurable.
Previously, the subtitle generation was hardcoded, making it unsuitable
if you didn't want all of the displayed values. This has been replaced
by a format string that is configurable in the settings, using predefined
tags that are replaced with the values. The default value for this has
been set to (mostly) match the currently generated subtitle string. This
also provides a good starting point for users that want to modify the string.

Signed-off-by: Victor Arvidsson <victarv@gmail.com>
2024-10-27 01:37:04 +13:00
Michael Keller
1a9b09682a Windows: Switch to Build on ubuntu 24.04
Switch the Windows build to run on ubuntu 24.04, and also update to use the latest version of MXE.

Signed-off-by: Michael Keller <github@ike.ch>
2024-10-24 15:54:34 +13:00
Michael Keller
8212b28641 Make MXE Build on ubuntu 24.04.
As per a31368b037.

Signed-off-by: Michael Keller <github@ike.ch>
2024-10-23 12:45:45 +13:00
Michael Keller
f60f01838c Update MXE docker Image Version Number.
Signed-off-by: Michael Keller <github@ike.ch>
2024-10-23 12:45:45 +13:00
dependabot[bot]
f7d32c850d build(deps): bump ubuntu in /scripts/docker/mxe-build-container
Bumps ubuntu from 22.04 to 24.04.

---
updated-dependencies:
- dependency-name: ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-23 12:45:45 +13:00
Michael Keller
2244f3f528 Export: Cleanup jqplot Module References.
Clean up references to the jqplot modules that were overlooked in #4350.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-10-22 10:23:29 +13:00
Michael Keller
364c776ff1 Export: Update jquery to a Secure Version.
Update jquery to a version that fixes known security vulnerabilities.
Triggered by https://github.com/subsurface/subsurface/security/dependabot/7

Signed-off-by: Michael Keller <github@ike.ch>
2024-10-21 09:25:19 +13:00
Dirk Hohndel
3bd7be809a mobile: fix dive detail scrolling
When using the current version of Subsurface-mobile, you cannot scroll
the dive details (i.e. you cannot see the bottom of the dive
information, depending on the size of your screen), nor can you scroll
the notes editor.

I'm not sure how I didn't stumble across this earlier, but a git bisect
appears to pinpoint commit a39f0e2891 ("Mobile: Fix QML Warnings.")
which is quite old.

Partially reverting this seems sufficient to get scrolling for the dive
details and dive notes edit working again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-10-03 15:40:59 +13:00
Michael Keller
b392052c37 CICD: Fix Windows Build.
Fix missing define introduced in #4343.

Signed-off-by: Michael Keller <github@ike.ch>
2024-10-03 09:04:42 +13:00
Michael Keller
c72a26afe1 Remove misleading comment about smtk2ssrf build.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-30 22:22:39 +13:00
Salvador Cuñat
f81cf77886 Make libraw support build optional
Build in by default if libraw is found, but make it optional for builds
were it's not needed, like smtk2ssrf or subsurface-downloader.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2024-09-30 22:22:39 +13:00
dependabot[bot]
821f3fc551 build(deps): bump com.github.mik3y:usb-serial-for-android
Bumps [com.github.mik3y:usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) from v3.4.3 to v3.8.0.
- [Release notes](https://github.com/mik3y/usb-serial-for-android/releases)
- [Changelog](https://github.com/mik3y/usb-serial-for-android/blob/master/CHANGELOG.txt)
- [Commits](https://github.com/mik3y/usb-serial-for-android/compare/v3.4.3...v3.8.0)

---
updated-dependencies:
- dependency-name: com.github.mik3y:usb-serial-for-android
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-29 09:23:36 +13:00
dependabot[bot]
b1493c3540 build(deps): bump com.android.support:support-v4 in /android-mobile
Bumps com.android.support:support-v4 from 25.3.1 to 28.0.0.

---
updated-dependencies:
- dependency-name: com.android.support:support-v4
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-29 08:36:07 +13:00
Michael Keller
8a64d1f4b9 Cleanup: Fix Warnings in MacOS build.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-28 23:50:55 +12:00
Michael Keller
784eddc166 Android: Update the docker Image Version Used to Build.
Update to the latest version (5.15.3).

Signed-off-by: Michael Keller <github@ike.ch>
2024-09-28 23:25:02 +12:00
dependabot[bot]
5613014124 build(deps): bump DamianReeves/write-file-action from 1.2 to 1.3
Bumps [DamianReeves/write-file-action](https://github.com/damianreeves/write-file-action) from 1.2 to 1.3.
- [Release notes](https://github.com/damianreeves/write-file-action/releases)
- [Commits](https://github.com/damianreeves/write-file-action/compare/v1.2...v1.3)

---
updated-dependencies:
- dependency-name: DamianReeves/write-file-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:50:34 +12:00
dependabot[bot]
b5e5e4c212 build(deps): bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:49:23 +12:00
dependabot[bot]
968599c7d9 build(deps): bump insightsengineering/pip-action from 2.0.0 to 2.0.1
Bumps [insightsengineering/pip-action](https://github.com/insightsengineering/pip-action) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/insightsengineering/pip-action/releases)
- [Commits](https://github.com/insightsengineering/pip-action/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: insightsengineering/pip-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:48:46 +12:00