aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget
AgeCommit message (Collapse)Author
2017-01-06Fix deco_mode confusionGravatar Robert C. Helling
We have two prefernces determining the deco_mode (BUEHLMANN vs VPMB vs RECREATIONAL): One for the planner (deco_mode) and one for displaying dives (display_deco_mode). The former is set in the planner settings while the latter is set in the preferences. This patch clears up a confusion which of the two to use by introducing a helper function that selects the correct variable. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-11-01Deco mode for plannining is not deco mode for showingGravatar Tomaz Canabrava
We had (in the wrong place, imo) a new feature that should differentiate the different deco_modes, you could plan your dive in buelhman and see it in vpm-b, for instance but both of them accessed the same pref. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01More preference handling fixesGravatar Tomaz Canabrava
Remove a few uneeded lines and add more loading code for the preferences. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01Use the new preferences object to set the preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27ToolTipItem: only show gf line in pressure graph when using Buhlmann modelGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20Heatmap: Show more yellowGravatar Rick Walsh
Stretch out the yellow zone of the HSV scale, because the yellow band of the true scale appears narrow. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20Heatmap: Color undersaturated values relative to inert gas pressureGravatar Rick Walsh
Color "undersaturated" values relative to inert gas pressure of gas being breathed, rather than relative to inert gas pressure of air. Also change slightly the point at which bright green (hue = 120 deg) from 10% of M value to 0% of M value (=ambient pressure). Other than the slight shift in lower bound of the green-red scale, this does not affect the colors of the tissues with inert gas pressure greater than ambient pressure, which are relative to the Buhlmann M value. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20Heatmap: Draw lines between data points rather than big dotsGravatar Rick Walsh
By drawing oversize dots for each data point, dots were overlapping such that the change in tissue presssure wasn't displayed at the right time - typically out by 1-2 minutes, depending on dive duration. Drawing a line between discrete points, the data points don't overlap and change in tissue pressure is displayed at the right time. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-03Initialize tooltip tissue pixmap properlyGravatar Robert C. Helling
...otherwise we show garbage before the mouse enters the profile for the first time. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Correctly hook up visibility toggle for tissue heat mapGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Hook up the code to toggle DC reported ceiling visibilityGravatar Dirk Hohndel
This got broken a long time ago it seems and no one ever noticed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Separate VPM-B conservatism preference for planner and profileGravatar Rick Walsh
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for planning dives and prefs.vpmb_conservatism for profile ceiling display of saved dives. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Rename conservatism_level to vpmb_conservatismGravatar Rick Walsh
Make the variable purpose less ambiguous Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Separate method for heatmap color scalingGravatar Robert C. Helling
I separated out the color scaling and slightly simplified the expressions. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Allow heat map to zoomGravatar Rick Walsh
Setting the pen to non-cosmetic means the painted width scales when zoomed Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Adjust heat map colour scaleGravatar Rick Walsh
Make the heat map use a colour scale similar to that by Kevin Watt, as used in Simon Mitchell's presentation, Decompression Controversies https://www.youtube.com/watch?v=UY61E49lyos&t=2090&authuser=0 Undersaturated: cyan -> blue ->purple -> black Supersaturated up to M value: black -> yellow -> red Exceeding M value: red -> white Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Introduce heat mapGravatar Robert C. Helling
This replaces the tissue percentage graph that probably nobody ever understood with a heat map like the one used in the discussion of bubble model deco. The information shown is the same but the saturation is now in the color while the tissue determines the y position. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Event name heuristics to show better event iconsGravatar Dirk Hohndel
This matches the strings for a couple of generic events from libdivecomputer that should obviously info or violation events, and matches quite a few more from the Uemis downloader (as those are much more specific). Everything else is still shown as a yellow warning triangle. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Avoid compile time warningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-24Show different icons based on event severityGravatar Dirk Hohndel
So far this is only supported in the Suunto EON Steel backend, but we should try to add this to others where we have such a distinction (and maybe assign different values to the predefined libdivecomputer events). This also adds three new icons for info, warning, and violation. The warning icon we had already, but I drew a new one from scratch to have it match the violation icon. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Event flags should be checked as bits, not valuesGravatar Linus Torvalds
This becomes obvious with the new severity bits introduced in the Suunto EON Steel parser. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-22Undefine both macrosGravatar Dirk Hohndel
There really is not need to do this, but at least do it symmetrically. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Have divedatapoint store cylinder id instead of gasmixGravatar Rick Walsh
Determining the correct cylinder index from a known gas mix can be complicated, but it is trivial to look up the gasmix from the cylinder_t structure. It makes sense to remember which cylinder is being used. This simplifies handling changing a cylinder's gas mix, either directly by the user, or indirectly in the planner. It also permits tracking of multiple cylinders of the same mix, e.g. independent twins / sidemount. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-23Now that we are building with C++11 we need override keywordGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-01Don't show surface events at the beginning or end of the diveGravatar Linus Torvalds
That's just annoying and pointless. So we arbitrarily say that surface events within the first and last 30s of the dive are suppressed. But we now do show them in the middle, in case the sampling rate is too low, and the profile itself doesn't show that we got to the surface. These heuristics still needs tweaking - if the profile already shows that we're at the surface, then we should probably suppress the event triangle. But in the meantime this at least gets rid of the truly pointless cases. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20Only do 9 minute interval for min/max/avgGravatar Dirk Hohndel
We don't use 3 and 6 minute values anywhere, so why calculate them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20Fix 3-, 6- and 9-minute min/max calculationsGravatar Linus Torvalds
Make them use indices into the plot-info, fix calculation of average depth, and fix and add comments. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14Silence warningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Start using the actual cylinder data for gas switch eventsGravatar Linus Torvalds
Now that gas switch events always have indices into the cylinder table, start using that to look up the gas mix from the cylinders rather than from the gas switch event itself. In other words, the cylinder index is now the primary data for gas switch events. This means that now as you change the cylinder information, the gas switch events will automatically update to reflect those changes. Note that on loading data from the outside (either from a xml file, from a git/cloud account, or from a dive computer), we may or may not initially have an index for the gas change event. The external data may be from an older version of subsurface, or it may be from a libdivecomputer download that just doesn't give index data at all. In that case, we will do: - if there is no index, but there is explicit gas mix information, we will look up the index based on that gas mix, picking the cylinder that has the closest mix. - if there isn't even explicit gas mix data, so we only have the event value from libdivecomputer, we will turn that value into a gasmix, and use that to look up the cylinder index as above. - if no valid cylinder information is available at all, gas switch events will just be dropped. When saving the data, we now always save the cylinder index, and the gas mix associated with that cylinder (that gas mix will be ignored on load, since the index is the primary, but it makes the event much easier to read). It is worth noting we do not modify the libdivecomputer value, even if the gasmix has changed, so that remains as a record of the original download. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Don't write back dive data that hasn't changed in gitGravatar Linus Torvalds
This caches the git ID for the dive on load, and avoids building the dive directory and hashing it on save as long as nothing has invalidated the git ID cache. That should make it much faster to write back data to the git repository, since the dive tree structure and the divecomputer blobs in particular are the bulk of it (due to all the sample data). It's not actually the git operations that are all that expensive, it's literally generating the big blob with all the snprintf() calls for the data. The git save used to be a fairly expensive with large data sets, especially noticeable on mobile with much weaker CPU's. This should speed things up by at least a factor of two. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-28QML UI: take device pixel ratio into account when scaling pixmaps on iOSGravatar Dirk Hohndel
This way warning icons and tank change icons and other event markers are no longer ridiculously tiny on retina screens. Oddly this doesn't appear to be needed on Android, only on iOS. Fixes #1033 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Undo two more unsigned changes that are no longer neededGravatar Dirk Hohndel
With this master should compile without signed / unsigned warning, hopefully without any more breakage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19Profile widget: Display gradient factors used in planGravatar Rick Walsh
Currently, the gradient factors displayed at the top of the profile are the gradient factors set in preferences. This is correct for saved dives, but when planning dives, the gradient factors displayed at the top of the profile should be the gradient factors used in the plan. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in tankitem.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in diveprofileitem.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in profilewidget2.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in divetooltipitem.cppGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in divepixmapitem.cppGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08Silence warnings in TankItemGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08Silence warnings in Profilewidget2Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08Silence warnings in DiveProfileItemGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08Silence warnings in DiveEventItemGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08Silence warnings in DiveCartesianAxisGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06Clean up handling of various include fileGravatar Tomaz Canabrava
This is in the context of the iOS port and shouldn't impact any of the other builds. [Dirk Hohndel: refactored the iOS patches] Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20Add option to allocate the samples in fake_dc()Gravatar Dirk Hohndel
We (ab)use fake_dc() to create a pleasing profile for a manually added dive. Based on it's intended use, fake_dc() simply handed back a dc structure that pointed at staticly allocated samples - that's obviously (now that I think about it) going to blow up in my face if I edit a manually added dive more than once. So now we have an option for fake_dc() to actually allocate the samples - this way the rest of the code can treat these samples as we would treat samples created any other way. We can free them and replace them with a new set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06Profile: don't compile code that isn't needed on mobileGravatar Dirk Hohndel
We were creating a couple dozen objects that we never needed and because of that triggered several dozen callbacks whenever the model data changed. All for UI elements of the profile that are either not used in the mobile app (like the calculated ceiling or the partial pressure / tissue saturation graphs), or are only useful when using the profile interactively (which we also don't do on mobile). I don't know if this will make a significant impact on performance, but it seems like the right thing to do either way. A positive side effect is that the odd blue line on top of the rendered profile is gone as well. Fixes #1007 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05profile-widget: use smaller event icons on Subsurface-mobileGravatar Rick Walsh
Smaller event icons fit the mobile display much nicer Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Do not run the deco calculations in the mobile appGravatar Dirk Hohndel
We don't show the calculated ceilings and calculating them is compute intensive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Fix bug on the visibility of the Ruler GraphGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>