more Statistics fun, now even for mobile - with some caveats

Dirk Hohndel dirk at hohndel.org
Sun Jan 10 15:25:00 PST 2021


I just merged yet another set of changes, their main purpose is to get us closer to being able to show the statistics in the mobile app.

There are a few caveats (and because of a couple of them, I'm not QUITE ready to make new iOS and Android test builds available just yet):

This changes the way the statistics get rendered. In order for them to be usable in the QML UI, we need to do something that is pretty atrocious. To quote from the commit message:

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.

So in certain situations this can lead to 100% CPU consumption - Berthold has seen this situation, I have not in my testing.
This definitely causes a lot of wasted CPU cycles in the desktop version and means there's the chance for visual artifacts (and if you see those, please report with screenshot), but in my testing it seemed to behave basically the same as the old version.
And excitingly, this gives us statistics on mobile (here a screenshot from mobile-on-desktop, but with the screen resolution of my phone simulated)





There are quite a few issues that still need to be addressed (including selection of charts), but it's already surprisingly usable.

This got merged now in order to make sure we don't have diverging code basis and to increase the testing of the code that will eventually be in the next release (instead of testing the older code that would never work for mobile).

There is a LOT of good stuff happening right now, I think.

Also in the pipeline is the addition of calculated deco ceilings on mobile - something quite a few people have been asking about.

/D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20210110/cf5e1c37/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2021-01-10 at 3.21.45 PM.png
Type: image/png
Size: 208698 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20210110/cf5e1c37/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2021-01-10 at 3.22.40 PM.png
Type: image/png
Size: 217754 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20210110/cf5e1c37/attachment-0003.png>


More information about the subsurface mailing list