In commit e58f54cac1 ("Fix ATM-vs-bar confusion") Linus broke the CNS
calculations; The partial pressure is fraction of gas times ambient
pressure, not divided by.
[Dirk Hohndel: identical patch sent by Robert and Anton; I combined the
commit messages and added the ACK from the perpetrator]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If you switch to edit mode by making a change to cylinders or weights,
then the data in the editedDive was changed and afterwards the current
dive was once again copied into the editedDive - even though we already
did that earlier when setting up the display.
Fixes#539
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With commit 708f19830e ("Planner: New plannerSettingsWidget") we
suddenly started out showing the planner widget. Not useful. So let's
switch us back to the default screen :-)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Robert's commit 708f19830e ("Planner: New plannerSettingsWidget")
moved several of the widgets from the maintab area to the new planner
settings widget.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In planner mode, this replaces the globe with the dive plan and introduces
a new plannerSettingsWidget in the diveListPane. All new fields are still
disfunctional. This is WIP.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Note that we are missing code to write out the new attributes, so saving
this test dive back to a file loses them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch lays the foundation for differentiating
between open-circuit(OC)dives and rebreather dives
(CCR). The following were done:
1) In dive.h add an enum type dive_computer_type
2) In dive.h add two more fields to the dc structure:
a) dctype (an enum field indicating dc type)
b) no_o2sensor (indicating number of o2 sensors for this dc)
3) In parse-xml.c add a function trimspace that strips any
whitespace from a string. This is used by two functions:
utf8_string as well as by get_dc_type, described below.
The pointer to buffer is not changed in order to ensure
consistency when the buffer is freed.
4) In parse-xml.c add a function get_dc_type. This parses the
dc_type string from xml and assigns an enum value which will
later be returned to the function that parses
the dc variables.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The QDialog for html creates a folder, we need to choose a folder, not a
file. getSaveFileName was wrong. ;p
Fixes#533
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Not having a format string that explicitly references the arguments is
considered a potential security issue in code.
This gets rid of a compiler warning that turned into an error on Fedora 21.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This can't be the only dive computer, of course. Goes nicely with the
ability to reprder them.
Fixes#551
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is needed if something has changed that requires a redraw, but the
plotDives() function can't tell (for example when a dive computer has been
deleted and there's now a different DC in the same spot, with the same
number - see next commit).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For some reason the docclean rule wasn't included in the Makefile when
cross building for Windows on Linux. Doing some searching into the issue I
found a much easier way to handle the make clean stage and sidestepped the
actual problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For some reasons Marble appears to sometimes not detect double clicks and
call the correct callback. With this commit we manually intercept the
double clocks and route them to the right function.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fist is really obvious. I quite regularly decompress using pure O2.
It's as good a last decompression gas as you get.
The second is a bit harder. There are very few that dive with 80%+ helium
in their mixes but they exist, and there are real weirdos that dive
heliox, so they are actual diveable gases too.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This finally gets me something that I like. The way the different boxes
get resized seems pleasant and intuitive. And it appears to do the right
thing on all platforms (I learned that having different levels of layout
nested creates no vertical offset on Linux/KDE, but a very ugly offset on
Mac, for example).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This raises the maximum number of gas mixes listed to 20 and also changes
the layout / design of the stats tab to make it much more attractive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The planner has its own view of the gradient factors. So replacing those
with the ones set up for viewing dives in the preferences is wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While planning we might change the gradient factors. Make sure they are
back to what's in the preferences when we're done planning.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already did a list of gases and volume consumed for the selected dive
on the Dive Info tab, but did not provide that same data on the Stats tab
for all the selected dives.
I arbitrary limited this to eight gases (as the list can get quite long
when you select a lot of dives). The gases are sorted by volume consumed.
Fixes#535
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Being shown between the deepest and shallowest dive's max depth it
confuses a lot of people - the average depth is frequently less than the
shallowest of the dives, so at first glance it looks like the "average" is
less than the "minimum". So having three numbers grouped like this that
use different algorithms is just distracting.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"warning: 'bottom_time' may be used uninitialized in this
function"
we set it to zero for now.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
warning: 'ProfileWidget2::someVariableName' will be
initialized after [-Wreorder]
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"warning: suggest parentheses around assignment used
as truth value [-Wparentheses]"
I think 4.8.2 is confused about this one, but we suppress
it regardless by separating into two assignments.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
encodeUtf8() and decodeUtf8() are only used for Q_OS_WIN in init_ui(),
but also that branch is wrapped in a "#if QT_VERSION < 0x050000"
we do the same for the actual function declarations.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We should either use mplicit struct initializers (empty braces { }
or double braced zero {{ 0 }}) or memset the struct.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This worked before without the "file:///" prefix, but something else that
I did broke that. Oh well, now it works again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Strangely, *prinf() on Linux appears to do the right thing in either
order (my guess is based on the type of the two values?), but on Windows
things go badly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Previously the code could get confused by edits (including trivial things
like deleting the coordinates). It seems much more reliable to simply
compare the coordinates of the edited dive with the ones in the current
dive before the edits.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also change the on file XML to be even easier to read by making it a
duration as well (which gets us '32:34 min' instead of un-typed seconds).
This is backwards compatible, it will happily read what was written with
the previous commit).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And fix the bug that in the info overlay SAC was always given in metric
values. And try to reduce the number of places in which we calculate the
unit conversions...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 125ddd955c ("Display liters with script el") Robert only fixed
the C routine we use to show units. Strangely, we had a separately
implemented C++ function as well. Instead of implementing this in two
spots I now simply have the C++ function use the C function to do the
actual work and then wrap this into an easier to use (from UI code)
QString output.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Triple time step in deco ascents to improve responsiveness of interactive
deco calculation.
[Dirk Hohndel: split commit into two]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use script ell instead of 'l' for liters to avoid confusion with digit 1.
Let's hope that this glyph is available in the common fonts, otherwise
we'll have to revert it.
[Dirk Hohndel: split commit into two]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>