Commit graph

461 commits

Author SHA1 Message Date
Berthold Stoeger
cf70a25be4 statistics: remove old unused statistics code
This never came to be - no point in carrying it around.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-19 15:03:30 -08:00
Dirk Hohndel
4bac5dbb66 build-system: allow adaptive building without WebKit
This should avoid build failures on platforms where we don't know if
QtWebKit will be available or not.

The options for printing and user manual are awkward to work with. This
all needs to be cleaned up at some point. Right.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-07-07 10:19:22 -07:00
Dirk Hohndel
efdc525a22 cmake: try harder to find the cmake modules we install
While I clearly recall that in the past the couple of cmake modules
that were installed when building the dependencies were found, in my
latest tests on macOS 12 with the latest cmake this seems to fail.

This seems like a cheap quick way to ensure that things behave as
expected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
5a5188bc47 build-system: don't build against Qt6 by default
As some Linux distros start to ship both Qt5 and Qt6, it actually makes more
sense to build only against Qt6 when the user explicitly asks for it. Having it
preferred over Qt5 seems completely wrong in hind sight.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-23 12:35:54 -07:00
Dirk Hohndel
ac70282193 macOS: build googlemaps plugin as fat binary
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>
2022-04-18 07:24:39 +02:00
Dirk Hohndel
53e153e6d7 build-system: make CMakeLists.txt more consistent
We used two different ways to add to the end of a list. Let's stick with
the more idiomatic one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
256f58e723 build-system: remove obsolete warning
Apparently Qt 6.3.0 already fixes this problem, so... never mind.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
ea961edec8 Qt6: first steps towards map support
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>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
2241a28499 build-system: make map support its own thing
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>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
890f21bd58 whitespace cleanup
Random, I know. But it bugged me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
a363ad0910 build-system: fix failing installer builds
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>
2022-03-23 19:43:40 -07:00
Dirk Hohndel
69cb33fd2e build-system: move profile specific icons into separate QRC
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>
2022-03-13 15:05:55 -07:00
Dirk Hohndel
240b2dc4df macOS: warn about harmless but annoying errors on M1 Macs
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
ddeafcfad5 Qt6: more QtLocation dependent parts in the CMakeLists.txt
These didn't really cause errors, but they were simply wrong to have there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
eb1849d7ba Qt6: more CMakeLists.txt cleanup
We used yet another version dependent variable. This one is even weirder as it is
an undocumented one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
ce254bee57 build-system: update cmake to allow Qt5 and Qt6
Qt6 builds of course still fail, but now they are at least possible.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
5dd3d1897f build-system: small cleanups for the CMakeLists.txt
Simply removing outdated things that will be in the way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
383f326136 build-system: fail with Qt6
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>
2021-07-28 07:44:58 -07:00
Dirk Hohndel
0521f79fae build-system: make ASAN builds easier
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>
2021-03-31 08:03:04 -07:00
Dirk Hohndel
ecf3ac12eb mobile/statistics: make icons available in mobile app
They were bundled via the desktop qrc, but they need a shared qrc that
can be used in both apps.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19 12:35:29 -08:00
Dirk Hohndel
b40354c7f2 build-system: compile stats code on mobile OSs
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>
2021-01-10 15:16:52 -08:00
Berthold Stoeger
e7907c494f statistics: convert chart to QQuickItem
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>
2021-01-10 15:16:52 -08:00
Berthold Stoeger
995100a540 statistics: implement StatsView
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>
2021-01-02 11:04:03 -08:00
Berthold Stoeger
93ba2219ee statistics: add statistic variables
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>
2021-01-01 21:10:10 +01:00
Dirk Hohndel
48c3e017d6 build-system: fix macOS QtCharts QML resources
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>
2021-01-01 09:57:46 -08:00
Dirk Hohndel
cdd3adc61b build-system: add QQuickWidgets to mobile build
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>
2020-12-29 08:38:36 -08:00
Berthold Stoeger
3e9ef9558e build-system: compile with QtCharts module
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-29 08:38:36 -08:00
Dirk Hohndel
3c89964d79 mobile/kirigami: add the shaders as resource
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>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
24bb4d7677 mobile/kirigami: install our own copy of ECM
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>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
a883fce612 mobile: re-add breeze icons
This time from the cloned repo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
0e7fd632c1 mobile: silly whitespace cleanup
Simply because it bugged me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
0851224b6c mobile/kirigami: first steps to switching to Kirigami 5.76
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>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
eac59a79d8 build-system/downloader: cli-downloader isn't part of the core
It's part of the main excutable / helper and needs to be linked before
all of our support libraries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Robert C. Helling
d73c70181f downloader: require only Qt 5.11
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>
2020-12-03 13:26:55 -08:00
Robert C. Helling
b39e77071e downloader: small improvements
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>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
5a8db97819 build-system: add models and shared backends to the downloader
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>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
057c151fe8 build-system: start adding a headless build
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>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
e9073a7570 build-system: first steps towards a 64bit Windows build
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>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
4b24730ee6 add initial support for the Garmin Descent Mk2i
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>
2020-10-30 12:24:36 -07:00
Berthold Stoeger
1211520ca9 build-system: switch to using C++17 as default C++ dialect
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-24 15:21:55 -07:00
Dirk Hohndel
4801dcecf3 cleanup: remove outdated explicit libssh2 link
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>
2020-10-23 20:48:15 -07:00
Dirk Hohndel
485ac4b58f build-system/macOS: remove Qt SQL plugins and suppress some errors
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>
2020-10-16 14:19:59 -07:00
Robert C. Helling
48adaf5297 Set the NO_PRINTING variable properly
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-10-11 08:40:38 -07:00
Dirk Hohndel
7f896ee8d5 build-system: remove building Grantlee cmake
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-08 12:19:39 -07:00
Linus Torvalds
e1befbea0a core/bluetooth: switch to use libdivecomputer rfcomm support
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>
2020-09-19 19:26:26 -07:00
Dirk Hohndel
3825fbbf72 build-system/macOS: add one more library that macdeployqt misses
This appears to be new with Qt 5.14.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13 13:55:46 -07:00
Dirk Hohndel
9815024199 add Berthold to the list of explicitly mentioned developers
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>
2020-05-09 17:21:43 -07:00
Dirk Hohndel
0fe02af0e8 build-system/android: remove libusb at QTest
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>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
b0d2e5c737 build-system/Android: don't bundle the user manual
That wouldn't work, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
053356c49b build-system: remove pointless distinction between desktop and mobile
It's the same sources, the same library.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10 09:25:57 -07:00