Commit graph

18894 commits

Author SHA1 Message Date
Dirk Hohndel
2a0d14b100 core: remove location service preferences
Including the related tests.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
6f813b9f8e mobile: remove GpsLocation
Only used in context of acquiring GPS locations with the mobile app, which
we no longer do.

Keep the DiveAndLocation structure around as that's needed by the
ApplyGpsFixes command.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
105b60389c mobile: remove GpsLocation reference from qmlmanager
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
5bc99194da mobile: remove locationService interfaces
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
7bf90fd208 mobile: remove hasLocationSourceChanged interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
085c65b0c4 mobile: remove logText property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
f33c90ba6b mobile: remove deleteGpsFix interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
094a3b01c8 mobile: remove applyGpsData interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
0b8c8599c1 mobile: remove copyGpsFixesToClipboard interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
3065eddbe1 mobile: remove clearGpsData interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
ea751928aa mobile: remove getCurrentPosition interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
bea552bf0d mobile: remove GpsListModel
This is only needed to show the list of GPS fixes obtained with
the now removed location service.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
edf4fbd38a mobile: remove GPS list UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
76e0208a11 mobile: remove current location checkbox from dive edit
Since we no longer access the device location, we can't do that any longer,
either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
ebbef8cf17 mobile: remove long disabled planner UI
This was never functional.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
53cbf53058 mobile: remove GPS related item in main mobile UI
Given the nonsense that Google and Apple makes us go through in order to
support this feature, it's time to cut our losses and walk away.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Josh Torres
4e93d38482 Adding changelog entry for rich text support
Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
2021-09-07 08:51:40 -07:00
Josh Torres
dcf1188a3b Support rich text on mobile notes field
When viewing dives on mobile the notes field does not support rich
text. User formatting, output from the planning feature, etc will
render html as plain text.

Adding qml tag to support rich text

Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
2021-09-07 08:51:40 -07:00
Josh Torres
da6eb9d947 Add changelog entry
Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-06 13:00:42 -07:00
Josh Torres
7e6d9935f1 core: fix off-by-one causing incorrect profile display
In commit 4724c88 get_plot_details_new was updated to pass an index
instead of the entry into plot_string. This means we are passing "i" to
plot_string after the final increment of the for loop, instead of
getting the entry[i] within the loop before the final increment. This
means if we are mousing over the far right of the graph, where the time
based break is not hit, we will end up passing an index equal to nr-2
instead of nr-3, which is intended to shave off the final two rows
containing data not useful to the display.

There are a handful of ways to fix this. This commit intends to be
consistent with stylistic choices made elsewhere in the project.

Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-06 13:00:37 -07:00
Berthold Stoeger
64faa23448 undo: renumber cylinders when deleting a cylinder
Removal of a cylinder requires a renumbering of
cylinders in the core data structures (samples, etc.).

The renumbering was performed in the undo-action of
cylinder removal, but not during actual cylinder removal.
What a mess!

Add the missing call.

Attention: this makes the deletion of sensor-readings
on cylinder-deletion non-undoable!

Undo will have to be fixed in upcoming commits.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 13:35:28 -07:00
Berthold Stoeger
9376721873 desktop: warn when deleting a cylinder with sensor readings
This makes the sensors pointless and in the future, they
will be removed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 13:35:28 -07:00
Berthold Stoeger
28fe6a7b38 core: add a function to test for sensors of a given cylinder
We want to prevent the user from accidentally deleting a
cylinder with sensor readings. Therefore, we need such a
function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 13:35:28 -07:00
Berthold Stoeger
5eda1c0e39 parser: XML_PARSE_RECOVER to xmlReadMemory()
Due to changes in the handling of sensor-ids, invalid XMLs were
generated. In particular, these contained duplicate attributes
in the sample tags.

Even though these files shouldn't exist, let's try to parse
them anyway. Some data will be lost, but that's better than
not opening the file.

libxml2 can be told to try to recover from such petty(?) errors
by passing the XML_PARSE_RECOVER flag.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 09:30:34 -07:00
Dirk Hohndel
836111da98 mobile: update version to 3.3.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-02 12:42:39 -07:00
Dirk Hohndel
f19e10209c mobile: fix broken cylinder name tracking in dive edit
Prior to this change, we had two different cylinder lists as models for
drop down boxes - one that prepends the "no default cylinder" entry
(which we need for setting up no default cylinder to be used in the
app), and another one that only includes actual cylinders.

The problem occured if a dive is created before the first time we edit
an existing dive: in this case we are applying indices across the two
models, but the indices are of course off by one; this results in
actually picking the wrong cylinder. So each time we try to edit a dive,
we end up with the previous cylinder in the list.

This commit simplifies the code by having only one place where we create
list of cylinder names (which is then used as the model for the combo
box). It also uses more logical names for the two 'flavors' of this list
to make it clear which one is supposed to be used (the regular list when
editing or adding dives, the one with the "no default cylinder" entry
prependet for the Settings page).

Reported-by: Brian Fransen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-02 12:41:00 -07:00
Dirk Hohndel
33dc5478d8 update README and ReleaseNotes for 5.0.3
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 20:26:26 -07:00
Dirk Hohndel
834f9b813a Update list of supported dive computers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 20:26:26 -07:00
Dirk Hohndel
ece0ac7918 Pull latest translations from transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 19:58:21 -07:00
Dirk Hohndel
0988855285 another libdivecomputer update
- add string serial numbers for Suunto Vyper and Mares IconHD type dive computers
- add support for Cressi Neon

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 19:45:44 -07:00
Dirk Hohndel
af734c81f1 update libdivecomputer
Add support for new gas change data from EON Steel with FW 2.5

Fixes #3254

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-19 12:57:31 -07:00
Robert C. Helling
2126ac7c25 Adopt tests to updated CNS and OTU calculations
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2021-08-19 10:58:08 -07:00
Robert C. Helling
c634a07e38 Planner: Correctly compute CNS and OTU for bailout segments
For dives with mixed divemode, one needs to check sample.setpoint
to figure out if the segment is an OC segment and the po2 needs
to be computed from the gasmix and ambient pressure.

This fixes #3310

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2021-08-19 10:58:08 -07:00
Dirk Hohndel
edce243147 mobile: update version to 3.3.0
New minor numbers are always arbitrary...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
503d8bd1fc mobile: don't quit on back button in Statistics mode
Fixes #3192

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
2c04a1f297 mobile: tweak line spacing
When strings in dive details wrap, the line spacing is too tight
in some circumstances. While not perfect, this change improves
the situation somewhat.

See #3263

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
9b669d91e0 mobile: add ability to edit tags
We already showed the tags, but we didn't allow the user to edit them.

This tries hard not to create inconsistent or illogical tags by trimming
white space and being careful with how the tags are added.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
454207cd80 mobile: make cloud timeouts more consistent
In the mobile version we should always allow a little more wait time for
the cloud server - there just seem to be more issues with response times
on mobile devices, especially when in places with poor data reception
(which isn't uncommon for dive sites).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 19:09:59 -07:00
Dirk Hohndel
3faff0b7f0 update Changelog and user manual
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 13:22:02 -07:00
Dirk Hohndel
b1d53481ad profile: use undo infrastructure for editing nicknames
This does the right thing even when removing a nickname by setting it to
an empty string. The oddly named DiveListNotifier handles the need to
redraw the profile when the name changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 13:22:02 -07:00
Dirk Hohndel
e7a5ec46f5 undo/device: adjust device management infrastructure
We no longer need the remove infrastructure, and the edit nickname function
becomes much more intuitive to use by passing in the dive computer for
which we want to create a nickname instead of the internal index into
the array of devices.

This also removes / simplifies the device list update signals in the
DiveListNotifier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 13:22:02 -07:00
Dirk Hohndel
fbe17e620e core: add get_or_add helper for dc table
This makes it much easier to manipulate dc nickname entries. In order
for that to work we can't simply remove entries with empty nickname (but
that isn't needed, anyway, as the code that saves XML or git already
handles that case correctly).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 13:22:02 -07:00
Linus Torvalds
47b0a9ce65 Don't share dive computer data allocations
... it just causes problems later when we free them, since we don't do
any reference counting.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-18 13:22:02 -07:00
Dirk Hohndel
2c12648156 WIP profile: add UI to edit dc nickname
This is just a quick first implementation - it will need to use the undo
code in the future, but for now this is a reasonable first step.

It's also missing the code to redraw the profile with the updated DC
name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 13:22:02 -07:00
Linus Torvalds
d141bbf38f Update the serial number and deviceid in sync when loading
When we save the divecomputer data, we never actually save the serial
value as a field.  We used to rely on saving the very dodgy 'deviceid',
and then look up the serial number from there.  And that never really
worked reliably, but we didn't really notice, because we never really
_used_ the serial number anywhere.

The only place the serial number is actually reliably displayed is in
the "Extra data" tab, which contains the key value pairs, and that's
where the original dive download code got the serial number from.

So just parse that at load time too, the same way we parsed it at dive
download time.

In fact, do the firmware version the same way, and remove the code from
the downloader, since it too can rely on 'add_extra_data()' just picking
up the information directly.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-18 13:22:02 -07:00
Linus Torvalds
35adf2d729 Add (nonfunctional) dive computer rename hooks
This adds the menu item to rename a dive computer (ie create a nickname
for it) when right-clicking on the dive computer name of a dive computer
that has a serial number (indicated by having a non-zero ->deviceid).

It is nonfunctional because it's really just the skeleton code: it needs
the UI to actually ask for a new nickname, and then it needs to actually
do the proper "create_device_node(model,serial,nickname)" to set it (or
remove the nickname if empty).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-18 13:22:02 -07:00
Linus Torvalds
2da7e9e5ad Remove the divecomputermodel code
This is no longer reachable, since the divecomputer tab is gone.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-18 13:22:02 -07:00
Linus Torvalds
ba6f7361da Remove the divecomputer naming tab
The TabDiveComputer model won't work in the new world order, where you
can't even insert a new device entry without a nickname to be edited.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-18 13:22:02 -07:00
Linus Torvalds
6c4e890960 Clean up divecomputer 'device' handling
We have this odd legacy notion of a divecomputer 'device', that was
originally just basically the libdivecomputer 'EVENT_DEVINFO' report
that was associated with each dive.  So it had firmware version,
deviceid, and serial number.

It had also gotten extended to do 'nickname' handling, and it was all
confusing, ugly and bad.  It was particularly bad because it wasn't
actually a 'per device' thing at all: due to the firmware field, a dive
computer that got a firmware update forced a new 'device'.

To make matters worse, the 'deviceid' was also almost random, because
we've calculated it a couple of different ways, and libdivecomputer
itself has changed how the legacy 32-bit 'serial number' is expressed.

Finally, because of all these issues, we didn't even try to make the
thing unique, so it really ended up being a random snapshot of the state
of the dive computer at the time of a dive, and sometimes we'd pick one,
and sometimes another, since they weren't really well-defined.

So get rid of all this confusion.

The new rules:

 - the actual random dive computer state at the time of a dive is kept
   in the dive data. So if you want to know the firmware version, it
   should be in the 'extra data'

 - the only serial number that matters is the string one in the extra
   data, because that's the one that actually matches what the dive
   computer reports, and isn't some random 32-bit integer with ambiguous
   formatting.

 - the 'device id' - the thing we match with (together with the model
   name, eg "Suunto EON Steel") is purely a hash of the real serial
   number.

   The device ID that libdivecomputer reports in EVENT_DEVINFO is
   ignored, as is the device ID we've saved in the XML or git files. If
   we have a serial number, the device ID will be uniquely associated
   with that serial number, and if we don't have one, the device ID will
   be zero (for 'match anything').

   So now 'deviceid' is literally just a shorthand for the serial number
   string, and the two are joined at the hip.

 - the 'device' managament is _only_ used to track devices that have
   serial numbers _and_ nicknames. So no more different device
   structures just because one had a nickname and the other didn't etc.

   Without a serial number, the device is 'anonymous' and fundamentally
   cannot be distinguished from other devices of the same model, so a
   nickname is meaningless. And without a nickname, there is no point in
   creating a device data structure, since all the data is in the dive
   itself and the device structure wouldn't add any value..

These rules mean that we no longer have ambiguous 'device' structures,
and we can never have duplicates that can confuse us.

This does mean that you can't give a nickname to a device that cannot be
uniquely identified with a serial number, but those are happily fairly
rare (and mostly older ones).  Dirk said he'd look at what it takes to
give more dive computers proper serial numbers, and I already did it for
the Garmin Descent family yesterday.

(Honesty in advertizing: right now you can't add a nickname to a dive
computer that doesn't already have one, because such a dive computer
will not have a device structure.  But that's a UI issue, and I'll sort
that out separately)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-08-18 13:22:02 -07:00
Dirk Hohndel
61524f9b2d update libdivecomputer
Garmin: add extra-info for serial number and firmware version

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-16 19:23:32 -07:00