summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-07-25Mobile: honour location service time thresholdGravatar Jan Mulder
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>
2017-07-25Try to sanely download multiple concurrent cylinder pressuresGravatar Linus Torvalds
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>
2017-07-25Error message on mobile cloud credentialsGravatar Miika Turkia
Display proper error message when cloud credentials are incorrect. See #481 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-24CCR is now detected from the log dataGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-24Map Divinglog's visibility to our starsGravatar Miika Turkia
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>
2017-07-24Detect CCR/PSCR from Divinglog importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-24Fix TestParse to handle CCR import properlyGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-24Fix CCR detection on Divinglog importGravatar Miika Turkia
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>
2017-07-24Add visibility support to Divinglog importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-23QML UI: Download from DC: tell user if BT is disabledGravatar Dirk Hohndel
This makes much more sense than displaying "No dives" Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23QML UI: Download from DC: move label next to buttonsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23QML UI: remove obsolete commentGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23QML UI: better list of downloaded divesGravatar Dirk Hohndel
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>
2017-07-23QML UI: replace theme checkboxes with switchesGravatar Joakim Bygdell
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>
2017-07-23QML UI: move location services to GPS menuGravatar Joakim Bygdell
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>
2017-07-23QML UI: fix copy paste errorGravatar Joakim Bygdell
The credential status has nothing to do with GPS functionality. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23QML UI: fix typoGravatar Joakim Bygdell
Simple typo on the overlay drawer. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-22QML UI: remember the last dive computerGravatar Dirk Hohndel
We already have the infrastructure to do so, all we needed to do was hook it all up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22QML UI: Download from DC: respond to click on checkboxGravatar Dirk Hohndel
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>
2017-07-22QML UI: Download from DC: remove unused propertyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22QML UI: save credentials as they are bein enteredGravatar Dirk Hohndel
We removed the action button for saving on the Settings page, so credentials never got saved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22QML UI: don't disclose the current passwordGravatar Dirk Hohndel
This isn't perfect, but at least it doesn't disclose a password that isn't currently being edited. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22QML UI: fix typoGravatar Dirk Hohndel
And remove line that's commented out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22QML UI: allow downloading from libdc simulatorGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23Fix comparison data for TestParseGravatar Miika Turkia
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>
2017-07-22Add README explaining icon licensesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23QML UI: simplify settings page codeGravatar Joakim Bygdell
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>
2017-07-23QML UI: make the theme settings not overflow page widthGravatar Joakim Bygdell
As per title. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23QML UI: remove the save button from settings pageGravatar Joakim Bygdell
As per title. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23QML UI: enable auto-save on settings pageGravatar Joakim Bygdell
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>
2017-07-23QML UI: merge all GPS settings in one blockGravatar Joakim Bygdell
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>
2017-07-23QML UI: Replace checkboxes on settingspage with switchesGravatar Joakim Bygdell
Replace the checkboxes for location services and developer with switches. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23QML UI: fix typoGravatar Joakim Bygdell
Simple typo fix. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23Mobile settings: stylize switchesGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-23Mobile Settings formattingGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-23Mobile: consolidate settings to one page and menu entryGravatar Joakim Bygdell
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>
2017-07-23QML UI: move location service to preferences pageGravatar Joakim Bygdell
Move the locations service switch to the GPS section of the preferences page. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23QML UI: add icons to the GPS menuGravatar Joakim Bygdell
As per title. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23QML UI: add icons to the dive management sub-menuGravatar Joakim Bygdell
The title says it all. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23Add more iconsGravatar Joakim Bygdell
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>
2017-07-23QML UI: add icons to global drawerGravatar Joakim Bygdell
Add an icon to each item in the global drawer Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23Add material iconsGravatar Joakim Bygdell
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>
2017-07-23QML UI: add checkbox to show/hide developer menuGravatar Joakim Bygdell
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>
2017-07-23QML UI: reorder the items of the global drawerGravatar Joakim Bygdell
Change the order of the items in the global drawer and change the name of some of them. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-22Show multiple gas pressures in the profile even if the dive isn't CCRGravatar Linus Torvalds
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>
2017-07-22parse-xml: use the right dc for filling in extra dataGravatar Linus Torvalds
"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>
2017-07-22Gas usage statistics: don't require gas switch eventsGravatar Linus Torvalds
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>
2017-07-21Fix up o2 pressure sensor handling at load timeGravatar Linus Torvalds
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>
2017-07-21git save format: don't save redundant sample informationGravatar Linus Torvalds
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>
2017-07-21Start cleaning up sensor indexing for multiple sensorsGravatar Linus Torvalds
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>