Add a combo box for water types with defaults for fresh water, sea water
and the EN 13319. All values taken from units.h, where EN 13319 was added
beforehand.
Custom values can be entered through a spinbox.
Also changed "Salinity" in TapDiveInformation.ui to "Water type".
Translation required!
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
This fixes a bug reported by Willem that removing waypoints
using the right click context menu makes the cylinder
pressure lines partly disappear.
The reason was that clicking a dive handler disables the
pressure interpolation (and other things, controlled by
shouldCalculateMaxdepth). This is turned on again upon
the mouse release event. This event is not triggered when
selecting in item from the context menu (like remove
waypoint or gas selection) so we need to send it manually.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
The more complex handling is no longer needed because:
- Keyboard tracking for gfhigh/low UI fields was switched off here:
030c094854
- GFhigh was limited to 40 here:
53fffe0ce3
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Calculating variations when in recreational mode doesn't make sense, and can
prevent variations from being calculated when switching back to Buhlmann or
VPM-B modes.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Don't accidentally enable o2breaks option when entering planner in
RECREATIONAL mode.
Disable also label for min_switch_duration according to dive mode.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Disable option "safety stop" for all deco modes other than
"recreational".
Disable also labels "reserve gas", "GF ..." and "VPM conservatism"
correctly.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
The connection wasn't working anyway since the signal comes without
value while the slot wanted a value and thus only created a runtime
warning.
Turning of keyboard tracking means that when typing the number 123 the
value change signal is not fired three times (with values 1, 12, and 123)
but is only fired upon pressing enter or the spin box losing focus.
We should add a similar setting to the depth, duration and runtime
columns of the DivePlannerPointsModel but i have no clue how to do that.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
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>
Data such as cilinders and used gasses are populated fromn the currently
selected dive when starting the planner. It is more logical to use
the dive mode (OC, CCR, pSCR) of the currently selected dive
as well. This commits changes this.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
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>
This is needed in the altitude pressure conversion as there
negative altitudes are possible (for diving in the netherlands
or the Dead Sea).
Signed-off-by: Robert C. Helling <helling@atdotde.de>
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>
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>
Bottom pO2 gas option in planner should be always enabled because
also recreational dives can use nitrox and produce "high pO2" warnings.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
The cylinder table was constructed very ealy from the contructor of the
planner, so early that the tr() functions are not registered. This fix
instantiates the cylinderModel from the maintab (as it is done
with, for example, the weightsModel) and lets the planner user
this instantiated (and proper translating) cylinderModel.
Fixes: #206
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The limits set in diveplanner.ui is intended for the unit set there,
meters. If we move between units we need to update the limits to.
This fixes#201
Signed-off-by: Anton Lundin <glance@acc.umu.se>
This is to avoid confusion with planner.display_deco_mode.
When accessing the "current deco mode" use the decoMode()
helper function.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
We need to initialize the UI elements accordingly.
Fixes#1094
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Call the emitDataChanged slot when ascent and descent rate spinboxes lose
focus. Without this connection, rates are not updated immediately after
editing the value with keyboard numbers and hitting tab or enter.
It is necessary to keep the valueChanged(int) connections, because
editingFinished() is not triggered by changing the value with the arrows.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
Instead of settings things manually in the code. (btw,
if we use lambdas the code can be quite smaller)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move Preferences sync / initialization out of the planner
widget prerferences to the ObjectWrapper.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fix is reasonably straightforward when the divedatapoint structure stores
the cylinder rather than gasmix.
Fixes#970
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
The previous patch (Planner: add best mix EAD preference) used the term EAD
(equivalent air depth) in variable names and strings, when it should have been
END (equivalent narcotic depth).
They're not the same thing and shouldn't be confused.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add best mix EAD preference and UI, along with a tooltip describing what it
does
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.
Fixes#1027
[Dirk Hohndel: small modifications, more reasonable step for psi,
more reasonable maxima]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The reason for that is, even if profile widget is made with qpainter
and for that reason it should be a desktop widget, it's being used
on the mobile version because of a lack of QML plotting library that
is fast and reliable.
We discovered that it was faster just to encapsulate our Profile in
a QML class and call it directly.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we have now destkop and mobile versions, 'qt-ui' was a very
poor name choice for a folder that contains only destkop-enabled
widgets.
Also, move the graphicsview-common.h/cpp to subsurface-core because
it doesn't depend on qgraphicsview, it merely implements all the
colors that we use throughout Subsurface, and we will use colors on both
desktop and mobile versions
Same thing applies for metrics.h/cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>