aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.h
AgeCommit message (Collapse)Author
2018-09-29Cleanup: reinstate override modifiersGravatar Berthold Stoeger
This reverts commit 1c4a859c8d0b37b2e938209fe9c4d99e9758327a, where the override modifiers were removed owing to the noisy "inconsistent override modifiers" which is default-on in clang. This warning was disabled in 77577f717f5aad38ea8c4c41c10c181486c4337f, so we can reinstate the overrides. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-01Cleanup: remove all override modifiersGravatar Berthold Stoeger
Commit df156a56c08a56eb380711a507ef739d8150a71f replaced "virtual" by "override" where appropriate. Unfortunately, this had the unintended consequence of producing numerous clang warnings. If clang finds a override-modified function in a class definition, it warns for *all* overriden virtual functions without the override modifier. To solve this, go the easy route and remove all overrides. At least it is consistent. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-31Cleanup: replace virtual by override where appropriateGravatar Berthold Stoeger
The keyword "virtual" signalizes that the function is virtual, i.e. the function of the derived class is called, even if the call is on the parent class. It is not necessary to repeat the "virtual" keyword in derived classes. To highlight derived virtual functions, the keyword "override" should be used instead. It results in a hard compile- error, if no function is overridden, thus avoiding subtle bugs. Replace "virtual" by "override" where appropriate. Moreover, replace Q_DECL_OVERRIDE by override, since we require reasonably recent compilers anyway. Likewise, replace /* reimp */ by "override" for consistency and compiler support. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24Copy divemode to ReplanGravatar Robert C. Helling
this needs copying the divemode from the dive to the plan. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-05-14Add planner infra structure for bailoutGravatar Robert C. Helling
Add a divemode column to the planner model and a corresponding field to struct divepoint and fill it in the corresponding functions. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-01-10Move function to proper placeGravatar Jan Mulder
Instead of writing TODO comment blocks, just do the work, and move the function to the proper class. Further, after review from Berthold, cleanup the function. There is no reason that getGasList() is member of any class. It is just a non-class helper, and as it is only used here, a static helper. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-24Simplify update of gflow and gfhigh values in the codeGravatar Stefan Fuchs
The more complex handling is no longer needed because: - Keyboard tracking for gfhigh/low UI fields was switched off here: 030c094854aeab4aaade523d7126728d9ce98a5b - GFhigh was limited to 40 here: 53fffe0ce3696de33ce4657e20d295e4a43e0fd9 Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-24Correcty typo ghflow -> gflow in diveplannermodel.cppGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Actually compute variations in backgroundGravatar Robert C. Helling
This reenables the computation of plan variations but now in a separate thread. Once finieshed, a signal is sent to update the notes. Signed-off-by: Robert C. Helling <helling@atdotde.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-25Localize global planner stateGravatar Robert C. Helling
For UI responsiveness, we need to be able to run the planner in the background. This needs the planner state to be localized (and we need to pass a pointer around). In order to not let too many lines overrun (and to save typing in the future) I have renamed instances of struct deco_state to ds. Yes this should have gone to a separate commit but I accidentally commit --amend'ed it. Computing of planner variations is temporarily disabled. Unlock the planner when returning early So we don't deadlock in add dive and recreational mode (which use the planner without actually planning). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Run variations calculation in backgroundGravatar Robert C. Helling
but there are still side effects and thus it crashes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-16Correctly name member function gasChange of DivePlannerPointsModelGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-16Update diveplannerpoints cylinderidx when deleting a cylinderGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-04Planner settings ascend and descende rate: Wire up UI elements correctlyGravatar Stefan Fuchs
Wire up the UI elements (QSpinBoxes) for ascend rates (4x) and descend rate (1x) correctly so that the profile and calculation is updated immediately after the value is changed (e.g. increased/decresed by 1) by clicking the QSpinBox arrows. Until now one had to click into the profile or change another planner preference first before the change became effective. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-20Add a checkbox to turn off plan variationsGravatar Robert C. Helling
... as those come with a performance penalty Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Show variations in Runtime stringGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Compute variations of plansGravatar Robert C. Helling
Print out partial derivatives of stop times with respect to variation of depth and duratin of last manual segment. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-04-29Add SPDX header to Qt modelsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Minimum gas calculation - Calculations and UI parametersGravatar Stefan Fuchs
Add minimum gas calculation to planner output. Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime. Connect UI signals and slots for recalculation of diveplan. Disable minimum gas calculation if there was already a warning before. If minimum gas result is larger then cylinder start pressure give warning message instead of result. Add line break before pO2 warnings but only if warnings exist. Signed-off-by: Joachim Ritter <jritter@bitsenke.de> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
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>
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-07-23Remove another unused variableGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-23Remove unnecessary DivePlannerPointsModel functions and variablesGravatar Rick Walsh
Commit b1ed04a means that DivePlannerPointsModel::rememberTanks() and related functions and variables are no longer required Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09Planner: automate calculation of best mix for max depthGravatar Rick Walsh
Add option to calculate the best mix portion of O2 and He for the dive's max depth if the user enters * in the MOD and MND cylinder fields. Gas portions are automatically recalculated if the max depth of the dive changes. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> 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>
2015-08-15VPM-B: Add conservatism levels to the ui. Fix planner settings disabling.Gravatar Jan Darowski
Conservatism level can now be changed from gui, is saved in settings. Also way of disabling the planner settings in the ui was improved to support more deco models and be called at the widget creation. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add deco choice to the ui.Gravatar Jan Darowski
Removed recreational mode from ui and pref and replaced it with new deco_mode enum. Added radio button ui selection. Set default deco_mode to Buehlmann algorithm. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-06-26Add only switch at required stop optionGravatar Rick Walsh
Add the option to only switch at required stop to the planner UI. This is not actually used yet. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-19Add planner minimum gas switch duration optionGravatar Rick Walsh
Add the option for a minimum gas switch duration to the planner UI. This is not actually used yet. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Set up signalling to display notes in planner again.Gravatar Robert C. Helling
This got broken in a recent transition to more abstract models. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29Move DivePlannerModel and CylinderModel to qt-modelsGravatar Tomaz Canabrava
Still trying to make it easier for the Mobile Port: This patch is a bit bigger than I hopped, but it was the smallest that I could get. A lot of TODO items where added where I broke the code because the current implementation would break the QML implementtion on the designer. I'll most probably fix those myself when I finish the transition to the models to the new folder. I only moved both models at once because there's an interdependency between them (seems inevitable, tough, but I'll take a better look at it later). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>