Commit graph

20434 commits

Author SHA1 Message Date
Michael Keller
71ebee8ab6 Change 'sensor7' to 'dc_supplied_ppo2' for the dive computer supplied value.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-21 07:11:55 +13:00
Michael Keller
c685f3d6a1 Import: Fix the Handling of ppO2 Sensor IDs.
Instead of assigning sensor ids in the order that values are reported,
actually use the sensor ids reported by libdivecomputer. This will fix
the problem that for some dive computers (e.g. Shearwater) the dive
computer calculated ppO2 is currently reported first, thus pushing out
all actual sensor values.
A new fixed id (7) outside of the range of currently supported sensor
IDs is used for these dive computer calculated values.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-21 07:11:55 +13:00
Michael Keller
9ec1190a30 Desktop: Close Warning when Closing Dive.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-20 10:39:31 +13:00
Michael Keller
297bac2988 Desktop: Clarify 'Renumber' Action.
Clarify that the 'Renumber' menu item action renumbers all dives and not the selected ones.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-20 09:55:13 +13:00
Michael Keller
3d46f6daf0 Planner: Fix UI Misalignment Bug.
Fix some misaligned items in the planner settings panel.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-20 09:42:58 +13:00
Dirk Hohndel
5671a634a8 fix std:clamp usage
We appear to consistently assume that clamp can be called with 0, size as
interval, but that actually results in a possible out of bounds access at the
upper end.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2025-01-12 07:34:30 +13:00
Michael Keller
bbff369bf2 Mobile: Remove unused components from build.
Remove import / export components that are not supported in the mobile
version from the mobild build.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-12 07:33:58 +13:00
Michael Keller
972b7a0643 Fix indentation.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-04 00:12:14 +13:00
Morten Borup Petersen
6a702d9d0a fix default mem_csv value
Signed-off-by: Morten Borup Petersen <morten_bp@live.dk>
2025-01-04 00:12:14 +13:00
Morten Borup Petersen
d59eb9bdfa Slight refactor of DAN parse code
Mostly NFC; this commit is mainly to get familiar with the codebase and to meet
the people who will review these changes.

I hope to make some changes to the DAN parsing code to eventually extract more
metainfo from my aqualung divecomputer's `.zxu` formatted logs. To do so, and
for me to be able to work on this efficiently, I've refactored the DAN parsing
code using a bit more modern C++-style, as well as being more true-to-spec wrt.
the (...ancient) DAN file format documentation that i could dig up... hopefully
that's an alright tradeoff for the project.

This more true-to-spec parsing also fixed a bug with the number being parsed
from the incorrect index in the ZDH vector (or, atleast i consider it a bug -
the "Export sequence" number was being used as the dive number, instead of the
"Internal Dive Sequence" number. The latter, described in the spec as: `The
sequence number assigned to the dive by the recording computer`).

Also contains some unrelated formatting changes; i tried to keep these minimal
(i presume these files haven't been touched in a while by `clang-format`).

Signed-off-by: Morten Borup Petersen <morten_bp@live.dk>
2025-01-04 00:12:14 +13:00
Michael Keller
e2b0851ddc Update the lists of supported dive computers.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-03 12:58:10 +13:00
Michael Keller
a405d8aa41 Import: Update the Dive Computer Importers to the Latest Version of
libdivecomputer.

Details in https://github.com/subsurface/libdc/pull/71.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-03 12:58:10 +13:00
Salvador Cuñat
2af18dfa36 [asd-logtrak] Add import to CHANGELOG.md and user-manual.txt
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2025-01-02 14:26:56 +13:00
Michael Keller
754992cf62 CICD: Fix the Version Number Generation
Fix the script used to generate version numbers for CICD builds. If
there is a race condition and we are not the first to create the branch
named after the lates changeset id, go and do a `git pull` before
attempting to read the branch that was created by another process.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-02 14:24:39 +13:00
Michael Keller
d5519847af Fix bug in workflow file.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 18:40:29 +13:00
Michael Keller
12cc3d0206 Fix bug in workflow file.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 18:34:15 +13:00
Michael Keller
cc552927f0 Fix bug in workflow file.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 18:14:13 +13:00
Michael Keller
4528c56eaf Fix typo in workflow file.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 18:03:43 +13:00
Michael Keller
2957f1e2cc Android: Fix the Build.
Fix the Android build after a missing file was introduced in
5889c1a3f8.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 17:51:07 +13:00
Michael Keller
468068f06d Update libdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 16:58:19 +13:00
Michael Keller
5889c1a3f8 Import: Move the Import of .FIT Files to 'Import log files'
Move the import of .FIT files into the 'Import log files' menu item,
where most people will be looking for it. This also naturally opens a
file selection dialog, which is more intuitive than having to select
this in the dive computer import dialog.
Also fix a bug affecting file imports if the log files contain
coordinates - the dive log needs to be set in the import data structure.
And refactor the file dialog file filters to make it more natural to add
more entries.

Requires https://github.com/subsurface/libdc/pull/72 to work.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 16:50:21 +13:00
Michael Keller
feb70907e5 Update libdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 14:38:53 +13:00
Salvador Cuñat
c50e953df7 [asd - logtrak] Fix android build with new imports
As pointed out by Mike, this is needed for android build (although
not used in android app).

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2025-01-01 14:31:54 +13:00
Salvador Cuñat
d1b25c044a [asd-gogtrak] fix free/delete mismatch
This was using delete for a buffer allocated with calloc().
BTW this definition is more simple than previous.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2025-01-01 14:31:54 +13:00
Salvador Cuñat
69d1ac8314 [asd-logtrak] Make datatrak.cpp dt_libdc_buffer() no static
So it can be used in other import modules

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2025-01-01 14:31:54 +13:00
Salvador Cuñat
9e6ed55cf5 Add suport to import Scubapro's LogTrak files
Import can be done from .script files generated by LogTrak software or
from .asd files generated by SmartTrak and LogTrak export option.

This code was writen in C, and has just been "ported" to some extent to
C++, so it can work with recent rework of Subsurface to C++.

I'm not a C++ guy, so this is mostly C with some make-up.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2025-01-01 14:31:54 +13:00
Michael Keller
9baf36da45 CICD: Add Check for Changes in the Supported Dive Computer Lists.
Add a check that will fail whenever there is a change in the list of
supported dive computers in libdivecomputer that is not reflected in the
`SupportedDivecomputers.*` lists.
Also add a script for a simplified update of these lists.
From a discussion with @dirkhh in https://github.com/subsurface/libdc/pull/71#issuecomment-2565384338.

Signed-off-by: Michael Keller <github@ike.ch>
2025-01-01 14:31:44 +13:00
Michael Keller
939154705b Reshuffle the CCR Preference to Keep the Context Correct.
Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:22:47 +13:00
Michael Keller
b51ece8de0 Fixup gaschange events.
Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:22:47 +13:00
Michael Keller
0a27f124fd Fix the Diveplan Creation.
Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:22:47 +13:00
Michael Keller
07898f277c Profile: Improve Display of Bailout / Loop Events.
For dives in CCR mode, show 'bailout' and 'on loop' events whenever a
gas switch from a diluent gas to a bailout gas and vice versa happens.

Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:22:47 +13:00
Michael Keller
de12d3a6ea Disable Debugging in Planner.
Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:03:21 +13:00
Michael Keller
2673b7fa10 Bugfix: Fix planner debug code.
Fix the debug code in `core/planner.cpp`.

Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:03:21 +13:00
Michael Keller
29fcd5ca15 Update libdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:02:48 +13:00
Michael Keller
269ed630be CICD: Make Version Generation Fail a Bit More Verbosely.
Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 22:51:41 +13:00
Michael Keller
39e47845d7 Profile: Clarify the Gradient Factor Display.
Clarify that the gradient factor displayed in green in the profile is
the gradient factor that is set in Subsurface, and not the one used by
the dive computer.

Fixes #4396.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-12-23 21:47:13 +01:00
Berthold Stoeger
55b72d40e3 planner: round deco-stop levels to integral feet
In the decostop table, we had deco stops at fractional feet
(e.g. 333.33 ft). This was somewhat awkward, because the
user defined literals do not yet(?) support non-integers
and therefore, these entries were given in mm instead.

Just round to the nearest integral feet values.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
992e258524 core: pass depth_t to get_depth_units()
Commit is longer than expected, because a few of the callers
were converted to use depth_t instead of int.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
1d14b03935 core: let pressure_to_altitude return a depth_t
Also un-inline it. There seems no reason for exporting the
implementation details in the header file.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
4237cb9999 profile: turn plotdata::mod, ead, eadd, end into depth_t
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
58d096adfc profile: turn plotdata::ceiling into depth_t
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
9cf753fa56 core: refactor per_cylinder_mean_depth()
This function had a horrendous interface: The caller would have to
allocate two arrays of the correct size to be filled with data.
The callee couldn't even check the size, because the data was passed
as raw pointers.

Instead, use std::vector<>, construct everything in the called
function and do size-sanity check in the calling function.

Use depth_t and duration_t instead of plain integers to represent
mean depth and time.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
dbc06d78b6 profile: small cleanup concerning depth_t
Operate directly on depth_t instead of working with the base
type.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
94a54d8e35 profile: make plotdata::depth depth_t
A small drop in the bucket: more conversion to our unit types.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
Berthold Stoeger
851e8bc5ee core: implement scalar multiplication/division for unit types
Allow multiplication/division of unit types with scalars,
such as
	depth * 4
or
	depth / 4
Multiplication the other way round (4 * depth) is not currently
supported, because that needs some template trickery.

Might do this later or wait for our switch to C++20, where we
could use concepts to make that trickery more palatable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-12-17 13:58:27 +13:00
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