aboutsummaryrefslogtreecommitdiffstats
path: root/core/profile.c
AgeCommit message (Collapse)Author
2017-06-22Preserve VPM-B state in profile displayGravatar Robert C. Helling
This fixes a but reported by Willem in the display of VPMB ceilings for logged dives. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-27Fix some warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-26Gas denisity display improvementGravatar Robert C. Helling
This combines the display with EADD since this is the same value with a different unit. And show it for air dives as well. Suggested by Jan Mulder & Anton Lundin Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-26Compute and display gas densityGravatar Robert C. Helling
This appears to be critical for work of breathing so it might be worthwhile to compute. So far only in infobox. For background, see https://www.youtube.com/watch?v=QBajM3xmOtc Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-26Adopt planner state caching to new structGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-26Assemble global state of planner in a structGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-04-29Add SPDX header to remaining core filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-13Safetystop > Safety stopGravatar Martin Měřinský
2017-03-11Merge branch 'master' of https://github.com/dje29/subsurfaceGravatar Dirk Hohndel
2017-03-11unkn > unknownGravatar Martin Měřinský
2017-03-11SAC: %.*f%s/min versus SAC:%.*f %sGravatar Martin Měřinský
2017-03-09Fix potential double/float to int rounding errorsGravatar Jeremie Guichard
Not using lrint(f) when converting double/float to int creates rounding errors. This error was detected by TestParse::testParseDM4 failure on Windows. It was creating rounding inconsistencies on Linux too, see change in TestDiveDM4.xml. Enable -Wfloat-conversion for gcc version greater than 4.9.0 Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
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-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-10-27ToolTipItem: show gf line based on correct gradient factor preferencesGravatar Rick Walsh
Calculate gfline using the gradient factor that is set by the planner preferences when in the planner, and by the general prefs when not in the planner. This is achieved by doing the gradient factor calculation in dive.c, where buehlmann_config is defined. Previously, the gfline was calculated using the general preferences gfhigh and gflow, even when in the planner. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-18Show SAC rate when using the rulerGravatar Dirk Hohndel
This way it's really easy to see the SAC rate during a segment of a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-01Make sure all dive computer events are represented in the plot_info dataGravatar Linus Torvalds
We could create a plot_info data that didn't contain all the time slots for the events fromt he dive computer, which would terminally confuse the plotting of the event profile widgets because it couldn't match up the event with the dive plot data model. So for example, in DiveEventItem::recalculatePos(), when the code tries to figure out the spot in the data model, it could fail, and then try to hide the event (because without the data model information it doesn't know where it should go). But that hiding would then not match the logic in DiveEventItem::shouldBeHidden(), and the event would end up being shown in the upper left-hand corner of the profile after all. The reason the plot_info data wouldn't contain the time slots is that the slots are allocated primarily for the sample data, and then the events would be added in between sample data in populate_plot_entries(). But since we'd only add the event pointer *between* samples, that would mean that events after the last samples would not get plot-info points allocated to them. That issue was exacerbated by how we also truncate uninteresting samples at the end when some dive computers end up giving a long stream (possibly several minutes) of "at the surface" events before they finally turn off logging. This makes sure that we take the event timestamps into account for the "maxtime" calculation, and also that we finish populating the plot_info data with any final event timestamps. Now all the events will have a matching plot_info entry. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20Don't calculate the 9 minute averageGravatar Dirk Hohndel
We don't do the "smoothed" profile anymore (and haven't for years), so no need to calculate the data. 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-11VPM-B profile: declare CVA iteration variables within each loopGravatar Rick Walsh
The variables that control each CVA iteration should be declared at the start of each loop so that the values are carried over from one iteration to the next. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-04-11Fix time of first ceiling calculationGravatar Robert C. Helling
In our verision of VPM-B for real dives, we take as the deco time the difference between the time of the deepest ceiling and the time when the ceiling clears. When the display of ceilings was set to multiples of 3m this was confused, as the maximum finder had issues: First of all, it updated the time when the ceiling was the same (which was almost always the case for stepped ceilings) but changing >= to > was not enough, since then the first time a deepest stepped ceiling was reached was used. This patch uses the actual ceiling (not rounded to the next integer multiple of 3m) for this calculation to get rid of this problem. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-04-04Make gas change events always have a cylinder indexGravatar Linus Torvalds
In commit df4e26c8757a ("Start sanitizing gaschange event information") back about a year and a half ago, I started sanitizing the gas switch event data, allowing gas switches to be associated with a particular cylinder index rather than just the gas mix that is switched to. But that initial step only _allowed_ a gas switch event to be associated with a particular cylinder, the primary model was still to just specify the mix. This finally takes the next step, and *always* associates a gas switch event with a particular cylinder. Instead of then looking up the cylinder by trying to match gas mixes at runtime, subsurface now looks it up when loading the dive initially as part of the dive fixup code. The switch event still has an a separate gas mix associated with it, but this patch also starts preparing for entirely relying on the gas mix in the cylinder itself, by starting to pass in not just the event but also the dive pointer to the routines that look up gas mix details. 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>