aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-07-28map: add new marker resource imageGravatar Lubomir I. Ivanov
This new marker image is free for use in Subsurface. Custom made in CorelDraw and Photoshop. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28map: add placeholder MapWidget.qml in mobile-widgets/qmlGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28Revert "QML UI: color the status bar correctly"Gravatar Jan Mulder
This reverts commit d22f67925ef4893832c26deb44fef50589c6fff8.
2017-07-27Profile support for multiple concurrent pressure sensorsGravatar Linus Torvalds
This finally handles multiple cylinder pressures, both overlapping and consecutive, and it seems to work on the nasty cases I've thrown at it. Want to just track five different cylinders all at once, without any pesky gas switch events? Sure, you can do that. It will show five different gas pressures for your five cylinders, and they will go down as you breathe down the cylinders. I obviously don't have any real data for that case, but I do have a test file with five actual cylinders that all have samples over the whole course of the dive. The end result looks messy as hell, but what did you expect? HOWEVER. The only way to do this sanely was - actually make the "struct plot_info" have all the cylinder pressures (so no "sensor index and pressure" - every cylinder has a pressure for every plot info entry) This obviously makes the plot_info much bigger. We used to have MAX_CYLINDERS be a fairly generous 8, which seems sane. The planning code made that 8 be 20. That seems questionable. But whatever. The good news is that the plot-info should hopefully get freed, and only be allocated one dive at a time, so the fact that it is big and nasty shouldn't be a scaling issue, though. - the "populate_pressure_information()" function had to be rewritten quite a bit. The good news is that it's actually simpler now, although I would not go so far as to really call it simple. It's still complicated and suble, but now it explicitly just does one cylinder at a time. It *used* to have this insanely complicated "keep track of the pressure ranges for every cylinder at once". I just couldn't stand that model and keep my sanity, so it now just tracks one cylinder at a time, and doesn't have an array of live data, instead the caller will just call it for each cylinder. - get rid of some of our hackier stuff, like the code that populates the plot_info data code with the currently selected cylinder number, and clears out any other pressures. That obviously does *not* work when you may not have a single primary cylinder any more. Now, the above sounds like all good things. Yeah, it mostly is. BUT. There's a few big downsides from the above: - there's no sane way to do this as a series of small changes. The change to make the plot_info take an array of cylinder pressures rather than the sensor+pressure model really isn't amenable to "fix up one use at a time". When you switch over to the new data structure model, you have to switch over to the new way of populating the pressure ranges. The two just go hand in hand. - Some of our code *depended* on the "sensor+pressure" model. I fixed all the ones I could sanely fix. There was one particular case that I just couldn't sanely fix, and I didn't care enough about it to do something insane. So the only _known_ breakage is the "TankItem" profile widget. That's the bar at the bottom of the profile that shows which cylinder is in use right now. You'd think that would be trivial to fix up, and yes it would be - I could just use the regular model of firstcyl = explicit_first_cylinder(dive, dc) .. then iterate over the gas change events to see the others .. but the problem with the "TankItem" widget is that it does its own model, and it has thrown away the dive and the dive computer information. It just doesn't even know. It only knows what cylinders there are, and the plot_info. And it just used to look at the sensor number in the plot_info, and be done with that. That number no longer exists. - I have tested it, and I think the code is better, but hey, it's a fairly large patch to some of the more complex code in our code base. That "interpolate missing pressure fields" code really isn't pretty. It may be prettier, but.. Anyway, without further ado, here's the patch. No sign-off yet, because I do think people should look and comment. But I think the patch is fine, and I'll fix anythign that anybody can find, *except* for that TankItem thing that I will refuse to touch. That class is ugly. It needs to have access to the actual dive. Note how it actually does remove more lines than it adds, and that's despite added comments etc. The code really is simpler, but there may be cases in there that need more work. Known missing pieces that don't currently take advantage of concurrent cylinder pressure data: - the momentary SAC rate coloring for dives will need more work - dive merging (but we expect to generally normally not merge dive computers, which is the main source of sensor data) - actually taking advantage of different sensor data from different dive computers But most of all: Testing. Lots and lots of testing to find all the corner cases. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-26QML UI: remove obsolete debugging codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-26QML UI: remove "show password" switch and only show pw on first entryGravatar Jan Mulder
Like the subject says. We do not want the password to be made visible, so a switch to show it, is useless and is therefore removed. Futher, the entry mode is set to PasswordEchoOnEdit, which causes the passwd to be visible (for easy entry), but can't be made visible again after save/end edit. Fixes: #512 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26QML UI: remove some dead codeGravatar Jan Mulder
Removed some unused alias defines. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26QML UI: color the status bar correctlyGravatar Jan Mulder
In commit e9503cfa3d1740 re-coloring of the status bar was forgotten. Added here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26QML UI: add missing id line in our buttonGravatar Joakim Bygdell
The missing id line in our own button generates an error in log and makes the buttons to fat. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: use a lighter text color for the selected diveGravatar Joakim Bygdell
Use the ligther text color on the secondary row of text when a dive is selcted in the divelist Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: use primaryColor instead of darkerPrimaryColorGravatar Joakim Bygdell
In most places we wrongly used the darker primary color instead of the primary color. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-25Add support for loading and saving multiple pressure samplesGravatar Linus Torvalds
This does both the XML and the git save format, because the changes really are the same, even if the actual format differs in some details. See how the two "save_samples()" routines both do the same basic setup, for example. This is fairly straightforward, with the possible exception of the odd sensor = sample->sensor[0]; default in the git pressure loading code. That line just means that if we do *not* have an explicit cylinder index for the pressure reading, we will always end up filling in the new pressure as the first pressure (because the cylinder index will match the first sensor slot). So that makes the "add_sample_pressure()" case always do the same thing it used to do for the legacy case: fill in the first slot. The actual sensor index may later change, since the legacy format has a "sensor=X" key value pair that sets the sensor, but it will also use the first sensor slot, making it all do exactly what it used to do. And on the other hand, if we're loading new-style data with cylinder pressure and sensor index together, we just end up using the new semantics for add_sample_pressure(), which tries to keep the same slot for the same sensor, but does the right thing if we already have other pressure values. The XML code has no such issues at all, since it can't share the cases anyway, and we need to have different node names for the different sensor values and cannot just have multiple "pressure" entries. Have I mentioned how much I despise XML lately? Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-25Make sample pressure helper functions available to everybodyGravatar Linus Torvalds
We had a "add_sample_pressure()" helper functions that was local to just the libdivecomputer downloading code, but it really is applicable to pretty much any code that adds cylinder pressure data to a sample. Also add another helper: "legacy_format_o2pressures()" which checks the sample data to see if we can use the legacy format, and returns the o2 pressure sensor to use for that legacy format. Because both the XML and the git save format will need a way to save the compatible old-style information, when possible, but save an extended format for when we have data from multiple concurrent sensors. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-26QML UI: replcae the "map it" buttonGravatar Joakim Bygdell
Replace the "map it" button implementation with our own button. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: replace button on DC download pageGravatar Joakim Bygdell
Replace the generic buttons on the DC download page with our own. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: add our own styled buttonGravatar Joakim Bygdell
Add out own styled button as resource. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: replace all checkboxes with our ownGravatar Joakim Bygdell
As per title, helps simplify theme modifications. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: add our own styled checkboxGravatar Joakim Bygdell
Add out own styled checkbox as resource. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: replace all switches with our ownGravatar Joakim Bygdell
As per title, helps simplify theme modifications. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: add our own styled switchGravatar Joakim Bygdell
This adds a switch styled for us, size is about the same as the material default. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: display gps fix icon in the global drawerGravatar Joakim Bygdell
Kirigami prevents us from altering the color of the gps icon in the action menu. So let's display an gps fix icon in the lower left corner of the drawer when the location services is running, colored to match the themes primary accent color. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: add colored version of the gps location iconGravatar Joakim Bygdell
This adds colred versions of the Material ic_gps_fixed icon, in our primary blue and pink colors. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
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>