Independ of the settings, the threshold to reset the GPS data was
hard coded to 5 minutes. Now, honour the entered (and updated during
a session) time to refresh the GPS data in the location service.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This tries to sanely handle the case of a dive computer reporting
multiple cylinder pressures concurrently.
NOTE! There are various "interesting" situations that this whole issue
brings up:
- some dive computers may report more cylinder pressures than we have
slots for.
Currently we will drop such pressures on the floor if they come for
the same sample, but if they end up being spread across multiple
samples we will end up re-using the slots with different sensor
indexes.
That kind of slot re-use may or may not end up confusing other
subsurface logic - for example, make things believe there was a
cylidner change event.
- some dive computers might send only one sample at a time, but switch
*which* sample they send on a gas switch event. If they also report
the correct sensor number, we'll now start reporting that pressure in
the second slot.
This should all be fine, and is the RightThing(tm) to do, but is
different from what we used to do when we only ever used a single
slot.
- When people actually use multiple sensors, our old save format will
start to need fixing. Right now our save format comes from the CCR
model where the second sensor was always the Oxygen sensor.
We save that pressure fine (except we save it as "o2pressure" - just
an odd historical naming artifact), but we do *not* save the actual
sensor index, because in our traditional format that was always
implicit in the data ("it's the oxygen cylinder").
so while this code hopefully makes our libdivecomputer download do the
right thing, there *will* be further fallout from having multiple
cylinder pressure sensors. We're not done yet.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
good (1) = 5
medium (2) = 3
bad (3) = 1
There seems also to be 0 used in the log, even though it is not
mentioned in the valid selections. This is not giving any stars for this
option...
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Note that I have not been able to do a positive test for this due to
lack of CCR sample data. But at least OC dives are now categorized
correctly.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Not the lsit is much more compact and shows a lot more dives even on
smaller screens. And it's similar in style to the dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace the theme checkboxes on the settings page
so that we get a unified UI.
These switches are linked and as such can only be activated
deactivation occurs when the user selects another theme.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Move the location services switch to the GPS menu, indicate both with icon and text if the service is active or not.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Strangely, a click/tap anywhere else worked as expected, but if you hit
exactly on the checkbox, the status change wasn't propagated.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears that we used to get additional tts=0:00min tags on Seabear
parsing. I would assume these to be incorrect as there other values
right before these that look more sensible. Also the resent change to
streamline the feature of not storing repeating values causes the test
to fail. Anyway, just grabbing the new result to compare with as it
seems sensible.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
In stead of using the fixed 4 column code introduced in f2fcad89b0db9b164d8fd3f89218ad27ca362bd3 use percentages of page width to allow for a more flexible layout since no block really has 4 columns.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Automatically save changes made on the settings page on completion of text fields or theme checkboxes.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Put all GPS settings in one block and revert to a 2 column layout while maintaing the 4 column widh.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Addresses: #492
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Had a bit of rebase issue with this one.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
New icons for the dive management sub-menu
ttps://material.io/icons/
The icons are under Apache License Version 2.0
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Add a couple of icons from the material repository.
https://material.io/icons/
The icons are under Apache License Version 2.0
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Add a checkbox to the preferences page to facilitate selective visibility of the developer menu. With the coresponding function in qmlmanager.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Now that the cylinder pressures are more generalized, we should show
them even for non-CCR dives if we have them. The most notable example
would be having separate pressure transmitters for both cylinders in a
sidemount setup. The code no longer really depends on any CCR logic.
NOTE! This is still preparatory work, in that this is one part of
supporting multiple simulataneous cylinder pressures, but we are still
lacking in other departments (eg properly filling those fields in when a
dive computer exports multiple pressure sensors etc).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"cur_dc" may be NULL when the XML source isn't a subsurface XML file,
and xml parsing is supposed to use "get_dc()" to pick a dive computer
when the nesting of the XML may not be proper.
Now, XML sources that don't have the proper dive computer nesting
markers generally also do not end up having the extra-data string
information, but one example of this is the simple XML that the
libdivecomputer 'dctool' program generates.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Our "get_has_used()" helper only filled in gas usage for cylinders that
had a gas change event associated with them. That works really badly
for things like CCR, but also simply for cases where the dive computer
wasn't necessarily explicitly notified about usage, like sidemount
diving etc.
Just remove the logic. If some use ends up particularly wanting to
ignore some cylinder, they can always do it in the caller instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Because of how we traditionally did things, the "o2pressure" parsing
depends on implicitly setting the sensor index to the last cylinder that
was marked as being used for oxygen.
We also always defaulted the primary sensor (which is used for the
diluent tank for CCR) to cylinder 0, but that doesn't work when the
oxygen tank is cylinder 0.
This gets that right at file loading time, and unifies the xml and git
sample parsing to make them match. The new defaults are:
- unless anything else is explicitly specified, the primary sensor is
associated with the first tank, and the secondary sensor is
associated with the second tank
- if we're a CCR dive, and have an explicit oxygen tank, we associate
the secondary sensor with that oxygen cylinder. The primary sensor
will be switched over to the second cylinder if the oxygen cylinder
is the first one.
This may sound backwards, but matches our traditional behavior where
the O2 pressure was the secondary pressure.
This is definitely not pretty, but it gets our historical files working
right, and is at least reasonably sensible.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we load sample data from a git save-file, we always default to
using the state from the previous sample (except for the special case of
cylinder pressure where an empty value does not mean "same", but
"interpolate", see core/load-git.c: new_sample()).
But the corollary to that is that it's always redundant to save sample
data that hasn't changed since the previous sample.
For some reason, the rbt, bearing and heartrate sample data didn't
follow that rule, and instead saved with lots of extra reduncancy.
(The alternative would be to clear those samples at load time, and make
them act like the pressure data, but it would appear that all these
three values may as well just have the normal "if no change, don't save
them" semantics).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a very timid start at making us actually use multiple sensors
without the magical special case for just CCR oxygen tracking.
It mainly does:
- turn the "sample->sensor" index into an array of two indexes, to
match the pressures themselves.
- get rid of dive->{oxygen_cylinder_index,diluent_cylinder_index},
since a CCR dive should now simply set the sample->sensor[] indices
correctly instead.
- in a couple of places, start actually looping over the sensors rather
than special-case the O2 case (although often the small "loops" are
just unrolled, since it's just two cases.
but in many cases we still end up only covering the zero sensor case,
because the CCR O2 sensor code coverage was fairly limited.
It's entirely possible (even likely) that this migth break some existing
case: it tries to be a fairly direct ("stupid") translation of the old
code, but unlike the preparatory patch this does actually does change
some semantics.
For example, right now the git loader code assumes that if the git save
data contains a o2pressure entry, it just hardcodes the O2 sensor index
to 1.
In fact, one issue is going to simply be that our file formats do not
have that multiple sensor format, but instead had very clearly encoded
things as being the CCR O2 pressure sensor.
But this is hopefully close to usable, and I will need feedback (and
maybe test cases) from people who have existing CCR dives with pressure
data.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>