aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget
AgeCommit message (Collapse)Author
2017-03-11Merge branch 'master' of https://github.com/dje29/subsurfaceGravatar Dirk Hohndel
2017-03-11We use 'setpoint' in UI. Use it also for documentation and comments. No ↵Gravatar Martin Měřinský
semantic change.
2017-03-11Use abbreviations with dots.Gravatar Martin Měřinský
2017-03-11Change type of divedatepoint.depth to depth_tGravatar Robert C. Helling
... for consistency, while we are at it. There are still some internal depth variables which are ints somebody might take a go at those. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-08Change calls to rint into lrint avoiding conversion warningsGravatar Jeremie Guichard
Using gcc option "-Wfloat-conversion" is useful to catch potential conversion errors (where lrint should be used). rint returns double and still raises the same warning, this is why this change updates all rint calls to lrint. In few places, where input type is a float, corresponding lrinf is used. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-04heartrate, heartbeat > heart rateGravatar Martin Měřinský
2017-03-04divecomputer > dive computerGravatar Martin Měřinský
2017-03-04Correct "set-point" -> "setpoint" and window title setpoint changeGravatar Stefan Fuchs
Change 2x "set-point" to "setpoint". Correct window title for "Add setpoint change" window. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-02-21Add units and nicer formating for items in profile info boxGravatar Stefan Fuchs
"SP change" info format in info box: Added/changed formating and add "bar" unit. "waypoint above ceiling" event in info box: Added formating, depth conversation to ft/m and depth unit. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-02-21Translate names of additional dive events and nicer format info box textGravatar Stefan Fuchs
Enable translation for a few additional internal dive events. Ensure that all event names in datatrak.c are collected for translation. Ensure that for gaschange in profile info box the "cyl." string is also translated. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-02-05Mobile: Do not show tankbar for CCR divesGravatar Joakim Bygdell
If we are showing the setpoint and sensor pO2 we need the space. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-02-05MOBILE: Reposition objects in the profileGravatar Joakim Bygdell
Add the tankbar to the profile and change the relative positions of the depth and temperature curves to minimize overlap. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-02-04Let cylinderid = -1 mean same gas as beforeGravatar Robert C. Helling
It's not too clever to give 0 a special meaning (as here: use same gas as for previous leg) when 0 is a legitimate value. This should solve Willem's gas disappearance problem when reediting a dive in the planner. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-28Fix dive visual editor being too quick to rescale timeGravatar Dirk Hohndel
When moving the last handle of a dive (in the planner, in dive add, or when editing a dive), we rescaled the time axis whenever our idea of the maximum duration that we should show changed. That lead to the odd situation that you couldn't get to certain dive durations with the visual editor (e.g. 64 minutes) because just as you approach that time the scale changes and the dive duration jumps past the desired value. Fixes issue #174 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-21Fix tankbar offset at gas switch eventGravatar Joakim Bygdell
When painting the tankbar the function triggers on change in cylinder index, as a result the new gascolour are changed at the next sample time point. On a divecomputer with a reasonable fast sample rate the 2-3s offset are hardly noticable, especially on a longer dive. For divecomputers with slow sample rate the 10-30s offset are clearly visible. This is fixed by start painting the new gascolour at the time point of the switch event rather than the time point of the next sample. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-01-21Don't let the tankbar overlap the tissue heatmapGravatar Joakim Bygdell
Shift the position of the tankbar to prevent it from overlapping the tissue heatmap Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-01-15Prevent the heatmap form overlapping at the endsv4.6.0Gravatar Robert C. Helling
...by making the pen start at its first position rather than first position minus half width. Sorry for my first attempt to solve this in a totally differen (read: wrong) way. Signed-off-by: Robert C. Helling <helling@atdotde.de>
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>