I couldn't make this to work as a single pass build, so we again do a dual pass
and manually assemble the dylib. This is then copied to a sane spot which
required another attempt to copy it in the CMakeLists.txt - which I added
comments to in order to make sense of the weirdness.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is an initial build of the C++ classes that seems to work, but the QML
integration is still missing. Still, progress is being made.
Unfortunately with Qt6 we can't forward declare the MapLocationModel class (one
of the operators needs to be able to determine the size of the class), so we
need to include the header file.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Making this simply depend on Qt5 or Qt6 was short-sighted as work on QtLocation
upstream continues. Instead break this out as its own option.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Both for Windows and macOS the installers actually didn't work correctly.
It turns out that the nifty trick (which is the officially documented way of
doing this) for setting up Qt5 OR Qt6 doesn't actually set up all of the
variables correctly - at least not on Windows and macOS.
Instead of trying to figure out why that part is failing, I decided to simply
immediately re-run the find_package for Qt5 if we don't find Qt6.
In the Windows case there was an additional problem: A very subtle typo where a
Qt5 turned into a Qt (which alone would have broken things).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way they are available in both mobile and desktop version.
Without this, the icons weren't shown on iOS and Android.
Fixes#3214
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I thought that explicitly requesting Qt5 should be enough, but we have a report
from a user who tried to build against Qt6 and cmake happily let them proceed.
So let's fail this explicitly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit lacking sophistication (you need to remember to make clean
before rebuilding when changing this option, etc), but it works well
enough for my purpuses.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Android and iOS use qmake, so add the code to the .pro file.
This also removes all remnants of QCharts includes and uses and all the
references to QCharts in our various build systems.
That was a brief but extremely useful detour.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It turns out that the wrong base class was used for the chart.
QQuickWidget can only be used on desktop, not in a mobile UI.
Therefore, turn this into a QQuickItem and move the container
QQuickWidget into desktop-only code.
Currently, this code is insane: The chart is rendered onto a
QGraphicsScene (as it was before), which is then rendered into
a QImage, which is transformed into a QSGTexture, which is then
projected onto the device. This is performed on every mouse
move event, since these events in general change the position
of the info-box.
The plan is to slowly convert elements such as the info-box into
QQuickItems. Browsing the QtQuick documentation, this will
not be much fun.
Also note that the rendering currently tears, flickers and has
antialiasing artifacts, most likely owing to integer (QImage)
to floating point (QGraphicsScene, QQuickItem) conversion
problems. The data flow is
QGraphicsScene (float) -> QImage (int) -> QQuickItem (float).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The StatsView shows the chart described by the StatsState structure.
It is based on a QML ChartView. This should make it possible to
easily port to mobile. It does not include any of the UI around
the chart, viz. the variable and chart selection, etc.
The code checking for the statistical significance of the regression
line was written by Willem.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
The StatisticVariable class hierarchy encapsulates the concept
of a dive-variable, which can be plotted in charts either as
dependend or independend variable.
There are three types of these variables:
1) discrete: For example dive buddies or suit type.
2) continuous: Has a notion of linear metric - can be
used as histogram or scatter plot axis.
3) numeric: Like continuous, but allows for operations
such as calculating the mean or the sum over numerous
dives.
All variables support binning. The bins are defined per
variable.
Continuous variables can be converted into an arbitrary
double value, which is used to be plotted on a continuous
axis.
Moreover, numeric variables support a number of operations,
which depend on the variable.
Since binning is based on different types, the code is rather
template-heavy. Of course, this could be solved with
unions/variants and runtime-polymorphism, but using templates
was just much quicker. Notably, this uses the CRTP
(curiously recurring template pattern) where a subclass
passes itself as argument to the baseclass. This is a weird
kind of "reverse inheritance".
The StatsTranslations class is a dummy class which will
be used to collect all translations of the statistics
module.
This includes changes by Dirk to fix compilation of the
downloader.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On macOS the cmake build system doesn't copy the QML resources into the app
bundle and so we do that manually. I forgot to add that for QtCharts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Even though the mobile build doesn't have a UI for the statistics, yet, it
already builds the base files.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These should already be part of the kirigami plugin, but without explicitly
adding them here they appear to not get found at runtime.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of relying on this being available as a system resource, treat it
the same way as we treat Kirigami and the Breeze icons.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Our half-assed manual build of Kirigami was becoming completely unmaintainable.
So let's try to use the build method that the Kirigami team recommends. Which
unfortunately requires us to have access to the KDE extra cmake modules (ECM).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt 5.11 is what current Raspian comes with. Unless we
really need it, let's try not to have to manually download
Qt on an already slow RaspberryPi.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Provide supported dive computer list on the command line
and actually call the cli download. Still not functional.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
We'll need this in order to be able to actually open dive files and
download things from a dive computer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this doesn't do a thing, but it gives us a nice target that
has far fewer dependencies and should contain enough parts to download
stuff from a divecomputer and then sync that with cloud storage.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is barely scratching the surface (no put intended), and of course the
container needs to be updated, first, to have a 64bit version of MXE installed,
but this seems to help make libmtp build correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This brings in the needed libdivecomputer updates and builds Subsurface against
libmtp in order to support downloading dive data via MTP (since the Mk2/Mk2i
no longer provide a FAT filesystem via USB).
In order for this to work you need to have libmtp installed on your system.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We used to need this when building our own libgit2 on older
distibutions. This shouldn't be needed anymore at all.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Technically with this the app might be ready for AppStore inclusion. I don't see myself
spending the energy on that, TBH.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Qt based implementation apparently got broken at some point and now fails
to connect to rfcomm dive computers like the Shearwater Petrel.
This uses the libdivecomputer rfcomm backend. Tested to work with bluez on
Linux as well as with the native Windows implementation.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Number 3 overall committer with currently 9% of total commits and 27% of all
commits in the last three years.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We no longer use libusb to access USB devices on Android, therefore
there's no point including libusb in our build. Also, we have never even
attempted to run the tests on Android, so let's not even pretend to
support building them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
WARNING: multi directory commit, needed to secure it builds.
move the core/exportfuncs.* to backend-shared.
update backend-shared/CMakeLists.txt to generate backend-shared lib
update CMakeLists.txt to include backend-shared lib in link process.
update ios project to reflect new directory
Signed-off-by: Jan Iversen <jan@casacondor.com>
WARNING: multi directory commit, needed to secure it builds.
leaving the shared backend sources in core, imposes a severe limitation,
that they cannot make use of e.g. qt-models, because that is created
after core (first library to be created).
The shared backend uses functionality from core and qt-models, so it
must be created when those are available and before desktop-widgets
or mobile-widgets are created.
Make a new root directory "backend-shared" with empty CMakeLists.txt
Signed-off-by: Jan Iversen <jan@casacondor.com>
In order to make the central CMakeLists cleaner and more consistent
add a CMakeLists.txt to mobile-widgets, like in other root directories.
Signed-off-by: Jan Iversen <jan@casacondor.com>