aboutsummaryrefslogtreecommitdiffstats
path: root/core/profile.c
AgeCommit message (Collapse)Author
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>