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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>