aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.cpp
AgeCommit message (Collapse)Author
2017-03-28minimal pO2 threshold: color the p02 graph also for minumumGravatar Jan Mulder
Color the p02 graph also in red for going under the minumum p02 value as set in the Preferences. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-28minimal pO2 threshold: split max threshold into min and maxGravatar Jan Mulder
Nothing really special here. Just a split of the only p02 max threshold into a min threshold and max threshold, and the adaptation of the UI. Change of translatable strings included. ref: https://github.com/Subsurface-divelog/subsurface/issues/259 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26MOBILE: Display pO2 and Setpoint for CCR divesGravatar Joakim Bygdell
For CCR dives we want to display the setpoint and pO2 information, due to the limited screensize we have to remove the temperature graph or the view will be to cluttered. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-03-24Fix double to int truncation in C++ codeGravatar Jeremie Guichard
Wfloat-conversion enabled for C++ part of the code Fix warnings raised by the flag using lrint Original issue reported on the mailing list: The ascent/descent rates are sometimes not what is expected. E.g. setting the ascent rate to 10m/min results in an actual ascent rate of 9m/min. This is due to truncating the ascent rate preference, then effectively rounding up the time to reach each stop to 2s intervals. The result being that setting the ascent rate to 10m/min results in 20s to ascend 3m (9m/min), when it should be exactly 18s. Reported-by: John Smith <noseygit@hotmail.com> Reported-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-11Merge branch 'master' of https://github.com/dje29/subsurfaceGravatar Dirk Hohndel
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-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-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-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-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-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-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-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-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-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-09Silence warnings in profilewidget2.cppGravatar Dirk Hohndel
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-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-01-25More Profile Itens on the new SettingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Start to use the QSettings ObjectWrapperGravatar Tomaz Canabrava
start of the QSettinsg Object Wrapper usage on the code this first patch removes two macros that generated around 200 lines in runtime for something like a quarter of it Basically, whenever we changed anything we called the PreferencesDialog::settingsChanged and connected everythign to that signal, now each setting has it's own changed signal and we can call it directly. The best thing about this approach is that we don't trigger repaints for things that are not directly profile related. ( actually we still do, but the plan is to remove them in due time) this commit breaks correct atualization of the profile (because everything was connected to PreferencesDialog::settingsChanged) and now I need to hunt a bit for the correct connections Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05Small changes to the profileGravatar Joakim Bygdell
Due to the small screen of mobile devices, the positions of the temperature graph and the time axis needs to be shifted upwards a bit to prevent them from overlapping with the dive computer name. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-27QML UI: don't show "1 of n" for multiple dive computersGravatar Dirk Hohndel
This is actually not a change in the QML - it just conditionally compiles out the code when building Subsurface-mobile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-06profilewidget2.cpp: hide the heartbeat graph on an empty stateGravatar Lubomir I. Ivanov
Opening Subsurface for the first time with heartbeat graph visible and then immediately doing File->New shows the logo/background in the profile space while hiding everything except the heartbeat graph. This patch makes sure that the graph is hidden with everything else on an empty profile state. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01QML-UI: turn of some profile featuresGravatar Dirk Hohndel
We don't have a tooltip on the QML UI as it's rendered into a pixmal. We also don't need the timer as we don't need the TTS calculations. And we don't need the acrobatics to figure out if we're in the planner as we don't support the visual planner (or any planner, at this point) with the mobile UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Drag and Drop ImagesGravatar Robert C. Helling
Now that we have the possibility to add images without meaningful time stamps to a dive, we should let the user provide that time offset manually. This patch allowed pictures to be dragged from the image list to the profile. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15Planner: support profile in planner printGravatar Lubomir I. Ivanov
The "Print" button in the planner dumps the QTextEdit to a QPrinter via ::print(). This patch renders the Profile to a Pixmap which is inserted as Base64 stream in an <img> tag and fed on top of the QTextEdit HTML contents. This route preserves the planner notes as text in PDF prints. The quick alternative is to render the QTextDocument to a QPixmap as well, but that will not preserve the text and pagination becomes manual. Possibly the QTextDocument can be rendered as a QPicture but pagination is still an issue, while so far there is exactly one user requesting this feature! Related small change in ProfileWidget2: Explicitly hide the tooltip when printMode is true. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11profilewidget2: Only add actions in desktop versionGravatar Sebastian Kügler
This fixes a bunch of warnings in the mobile version where these slots are not defined (see the corresponding header's conditionals). Signed-off-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07profilewidget2.cpp: remove unused variablesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-06Untangle DiveCalculatedCeiling from MainWindowGravatar Lubomir I. Ivanov
DiveCalculatedCeiling is the last class the references MainWindow in the profile-widget stack. In modelDataChanged() it looks for the information() widget and sets a slot for the dateTimeChanged() signal that information() emits. To solve the issue we make DiveCalculatedCeiling recieve a ProfileWidget2 reference and make ProfileWidget2 emit the dateTimeChangedItems() signal. ProfileWidget2 itself listens for the dateTimeChanged() signal that information() emits and emits dateTimeChangedItems() to notify any possible children/item listeners in the ProfileWidget2::dateTimeChanged() slot. The connection between ProfileWidget2 and information() is set in MainWindow. This makes DiveCalculatedCeiling unaware of MainWindow and which class originally emits the dateTimeChanged() signal to ProfileWidget2. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> -- Think delegation. Tomaz, please take a look at this one, to double check if i messed up. also i have zero idea how the mobile app is setting these connections, if it does so even. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06Untagle DiveCartesianAxis from MainWindowGravatar Lubomir I. Ivanov
DiveCartesianAxis and derivatives can recieve ProfileWidget2 as an instance in their constructor. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05Profile: don't compile the desktop specific parts on mobileGravatar Dirk Hohndel
When building subsurface-mobile we won't be using all these UI elements, so let's not build them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05Untangle Profile from MainTabGravatar Dirk Hohndel
This one was easy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05Untangle Profile from MainWindow: edit current profileGravatar Dirk Hohndel
And action can't not just trigger a slot, it can also send a signal. With this there is no reference to the MainWindow left in the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05Untangle Profile from MainWindow: update main tab via signalGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05Untangle Profile from MainWindow: remove silly indirectionGravatar Dirk Hohndel
Ummm. What? That one was awesome. This seems easier :-) MainWindow::instance()->graphics() is a way to retrieve a pointer to the profile widget... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05Untangle Profile from MainWindow: make profile the parent of dialogsGravatar Dirk Hohndel
I don't quite know why these were parented to the MainWindow - I bet there's a very clever reason that I'm missing... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>