aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget
AgeCommit message (Collapse)Author
2018-01-24Planner: print icd information at 0.1 resolutionGravatar Willem Ferguson
The gas fractions (in %) are now printed at a resolution of 0.1% and not at 0.01% as previously. The string in the info box that provides icd data is reformatted so that the info-box is as narrow as possible. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
2018-01-24profile: fix weird disappearance of cylinder pressure lineGravatar Jan Mulder
The reason for this issue, and fix for this is very similar to commit b4d37e8ee. Just set both recalculate flags on a mouse release event, so that the cylinder pressure line is recalculated. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-21Profile info box ICD: Change format of ICD stringGravatar Stefan Fuchs
Change the format from (example!) ICD: ΔHe=-34% ΔN₂=3%<3% to ICD: ΔHe=-34% ΔN₂=+3%<+2.8% Change strings given to translation to less complex ones. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-21Only give ICD warning if pN2 increasesGravatar Robert C. Helling
as otherwise there are warning on the descent. The ICD line in the info box is generated for all gas switches with decreasing He content. Also change the presentation in the info box to align it with the notes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-01-21Show ICD in gaschange iconsGravatar Robert C. Helling
Add an exclamation mark in the gas change icons if the change violates our isobaric counter diffusion criterium. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-01-21Show ICD events data in infoboxGravatar Robert C. Helling
If a gas switch violates our ICD criteria, show this in the info box. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-01-12profile: fix garbled profiles after visiting the plannerGravatar Jan Mulder
See mentioned GitHub issue for the full issue, and images. The reason for this weird behavior is the existence of 2 flags in the profile code: shouldCalculateMaxTime and shouldCalculateMaxDepth. When exactly following the use case and test data as attached to the GitHub issue (a very short dive, shorter than most of the dives in the logbook), the shouldCalculateMaxTime flag never got back to its true status, causing the the time scale not to adapt to other dives when just clicking (or selecting) them from the dive list. The problem is fixed here by also setting the shouldCalculateMaxTime flag on manipulating wayppoints in the dive plan. Fixes: #1039 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-11Introduce helper function empty_string()Gravatar Berthold Stoeger
There are ca. 50 constructs of the kind same_string(s, "") to test for empty or null strings. Replace them by the new helper function empty_string(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Pictures tied to profile are not supported on mobileGravatar Jan Mulder
Move divepicturemodel.cpp to the desktop only category and deal with the (limited) fallout. We, currently, do not support dive pictures tied to the profile on mobile, so there is no use including this code. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Un-tie plannner model from profile on mobileGravatar Jan Mulder
Do not pull in the DivePlannerPointsModel::instance as this is not used in the called function. We (currently) do not support deco computations on mobile, so trying to pull in any deco state from the planner is futile anyway. With this uncoupling, 6 more model files are not needed in mobile any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Typo: Threshould -> ThresholdGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Typo: indice -> indexGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Replace CREATE_PP_GAS macro by member function in profilewidget2.cppGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Remove two arguments from ProfileWidget2::setupItem()Gravatar Berthold Stoeger
1) hAxis was always set to timeAxis 2) model was always set to dataModel Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Replace ADD_ACTION macro by member function in profilewidget2.cppGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Replace HIDE_ALL macro by template function in profilewidget2.cppGravatar Berthold Stoeger
This is easier to read and debug. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Remove unnecessary deletes in destructor of ProfileWidget2Gravatar Berthold Stoeger
All the deleted items were added to the scene, which takes "ownership" (a remarkably fuzzy concept in Qt) of these objects. In principle, deleting these items is a bug - even though it is handled gracefully. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Unused code: remove ProfileWidget2::isAddOrPlanner()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: DiveCartesianAxis::percentAt()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10Unused code: remove DiveCartesianAxis::tickInterval() and tickSize()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29cleanup: Uninitialized scalar fieldGravatar Jan Mulder
CID 208332 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29cleanup: Uninitialized pointer fieldGravatar Jan Mulder
CID 45172 And one non initalized member hAxis could be removed as it is not used. Surprisingly, Coverity did not see this. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-18Implement different zoom levels for dive photos tabGravatar Berthold Stoeger
This implements different zoom levels for the dive photos tab as suggested by Stefan Fuchs <sfuchs@gmx.de> in #898. The zoom level can be changed using a slider or CTRL+mousewheel. Zoom levels range from a third of the standard thumbnail size to thrice the standard thumbnail size. Thumbnails are cached in maximum resolution and scaled down on the fly. Because the profile widget took its pictures from the photo list model, an extra picture copy with a fixed size had to be introduced. The UI is still a bit crude. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-15divepicturemodel: Reset start and end row for displayed_dive correctlyGravatar Stefan Fuchs
Correct way of using indices for rowDDstart and rowDDend. Reset rowDDstart and rowDDend at beginning of updating dive pictures. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13Fine tune the position of pictures in the profileGravatar Stefan Fuchs
Start a new column a little bit earlier otherwise it will get difficult to fit a high number of pictures. Don't put more than ~16 pictures in one column. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-13Dive pictures show pictures of all selected divesGravatar Stefan Fuchs
In the dive picture tab show pictures of all selected dive. But at the same moment take care that in the profile only pictures from displayed_dive are displayed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Prevent redundant replanningGravatar Robert C. Helling
Planning dives is heavy on CPU, so better be sure we only do it when needed. In particular, when moving around dive points, we only want a new plan once per move and not three times (triggered at various points in the chain of events). This should significantly improve planner snappiness. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-01Control growth of time axisGravatar Robert C. Helling
While dragging waypoints around, don't grow the time axis according to dive duration (including deco stops) as this can explode too easly resulting in an effectively unresponsive planner. Rather grow it only (slowly) when a dive handler is moved to the right 10% of the profile. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-01Dive picture handling: Re enable multi select, improve mouse eventsGravatar Stefan Fuchs
Some improvements for the dive picture tab and dive pictures in profile: - Bugfix mouse event in profile: Only Left-click will open picture - Bugfix mouse events in picture tab: - Re-enable context menu (Windows bug mainly) - Re-enable multi select in a nice way - Only double-left-click will open picture Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-30Use better aliases for icons.Gravatar Martin Měřinský
Icon aliases were complete mess. Some icons had alias some didn't. Named with underscores vs. hyphens vs. camelCase. Lower vs. upper case. "ICON" prefix vs. suffix vs. nothing. With vs. without filename suffix. Some didn't make sence. Eg. mapwidget-marker-gray (I can see, it's grey, but what does it represent?) Some were duplicated, eg warning vs. warning-icon. Some were name after widget, which is wrong. Do not reinvent wheel. Use widely used naming scheme close to Freedesktop Icon Naming Specification. This will enable usage of common icons from current set in the future. Thus Subsurface will fit nicely to GUI. This changes icon aliases to one, easy grep-able style. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Revert "Use consistent aliases for all icons."Gravatar Dirk Hohndel
This reverts commit 92e9c6606f6ef3ad16d2e31f9f9a8f5fa14f2c1a.
2017-11-29Use consistent aliases for all icons.Gravatar Martin Měřinský
Icon aliases were inconsistent mess. Underscores vs. hyphens vs. camelCase. With vs. without filename suffix. Lower vs. upper case. "icon" suffix vs. prefix vs. nothing. Some were duplicated, eg warning vs. warning-icon. Some icons didn't have alias at all. This changes all icon aliases to one, easy grep-able style which complies to Freedesktop Icon Naming Specification (Guidelines). Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-25Fix toggling of partial pressure graphsGravatar Berthold Stoeger
When toggling the display of the partial pressure graph, the graph was either not shown correctly or unnecessary ticks were left in the graph. Calling the settingsChanged() method of the profileYAxis object solves the problem by initializing the ticks according to the selected graphs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25In strings change tank to cylinderGravatar Stefan Fuchs
Change the word "tank" to "cylinder" or "cyl." in two occurences. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25Hand planner variables to profileGravatar Robert C. Helling
Pass the planner state struct to the profile computation so it can use deco_time and first ceiling to display VPM-B ceiling. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-23Fix obscure display bug in profile widget, where heat map wasn't shownGravatar Berthold Stoeger
Fixes an obscure bug, which happened under very specific circumstances. Precodition: fresh program start and neither of the partial pressure graphs, nor the heat maps are shown. User clicks on heat map icon. Bug: The heat map is not shown at the bottom of the graph. The fix consists in replacing two percentageAxis->setLine() calls by precentageAxis->animateChangeLine() calls. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-18Prevent signed/unsigned comparison warningGravatar Berthold Stoeger
Change an unsigned integer to a signed integer in profilewidget2.cpp, because commit 1f8506c changed the definition of duration_t from unsigned to signed. Since this value represents the number of seconds since a dive started, there is no possible chance of overflow problems. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-13mobile: icon size in profileGravatar Jan Mulder
Size the event item icons in the profile a little bigger. Obviously, how big is big enhough is upto personal taste, but on Github a screendump is added to show the new size. Fixes: #310 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-26desktop UI: no longer attempt to manually show error notificationsGravatar Dirk Hohndel
report_error() now does this automatically. So all these odd places in which we tried to make sure that we show errors are no longer needed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-20Silence random warningsGravatar Dirk Hohndel
None of these seem to point to actual issues, so let's quiet them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-20Translate dc text in profile also if string has suffix for > 1 DCGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-19When selecting icons for events don't misinterpret a gaschangeGravatar Stefan Fuchs
Don't misinterpret a gaschange as "useless internal of the dive computer" when it has a higher flag value. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-19Use displayed_dc instead of current_dcGravatar Robert C. Helling
current_dc is a macro that determines the dive computer based on the current dive number. When the planner is started from an emtpy dive list, the dive number ends up being -1 and that doesn't produce a valid dive computer. Use the divecomputer of the displayed_dive instead. This is done via a macro that can also be used in two other places. Without this patch, the planner crashed when called on an empty dive list. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-18Add a icon for gaschange to Oxy with all green tank shoulder colorGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-18Find current gasmix for heatmapGravatar Robert C. Helling
To compute the heatmap value, we need the current gasmix but the current cylinderindex is no longer available. Fixes #562 Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-08Hide outdated gas name strings in profile in plannerGravatar Stefan Fuchs
When deleting dive planner points in the planner we currently sometimes miss to hide the outdated gas name strings printed close to the profile legs. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-15End tankbar at the correct end of the dive plotGravatar Stefan Fuchs
Go back to the old startegy of retrieving the correct end of the dive plot by looking at the plot data instead of looking at dc->duration. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-14Update the tankbar code to work with the new gas handlingGravatar Dirk Hohndel
When Linus modified the gas handling code six weeks ago he pointed out that that had broken the tankbar; with this patch we now simply walk the gas changes of the displayed dive directly and create the tankbar rectangles from that information. See #562 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-26Move unused code into the disabled blockGravatar Dirk Hohndel
These varaiables are only used in the code that we currently aren't compiling. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-07Fix the overprinting of gas name and pressure value on the profileGravatar Linus Torvalds
When I massaged the code to do multiple gas pressures in commit e1b880f4 ("Profile support for multiple concurrent pressure sensors") some of the Y offsetting code got cut out as being too specific to the old o2pressure code. But I removed a bit too much, leaving the label (gas name) and number (gas pressure) overlapping. This should fix it. If we really care about multiple gas pressure labels overlapping each other, we'll have to revisit this code, but the old two-gas case didn't do a very good job either (both that old code - and this new version - can look very good in particular cases, but there are cases where it won't work so well). So we may need to revisit this eventually, but this gets it looking fine for the normal cases. Reported-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>