Replace wet_volume calculation with straight forward pressure formula

Since no one else approximates gas volumes at higher pressures, we
shouldn't do that either when converting imperial tank names (cuft @
working pressure) into wet volumes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
More logical layout for the Dive Info tab

Up until now the tiles seemed to be arranged rather randomly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
O2/He percentages aren't integral

We do gas mixes in permille, not in percent.  Some people really like
using the value they got from the analyzer, which is generally something
like 29.4% or whatever.  So don't truncate percentages to integers.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix the imperial cylinder size calculations in equipment handling

This makes us use the same linear calculations as we did in the Gtk
branch.  We don't take compressibility into account, since tank
manufacturers don't seem to either.  A Luxfer AL80 is 11.1 liters, and
with the standard (non-compressibility) calculations, 80 cuft of air at
3000 psi is 11.094 liter, so that is the right model to use.

Also, stop with the horrible "units in edited numbers" stuff.  It uses
up precious space, and doesn't look any better.  If the user asked for
cuft, give him cuft without making a big deal about it.

Oh, and if the working pressure doesn't exist, sizes are always in
liters.  That's what we did in the Gtk branch, that's what we do here.
Again, no reason to even bother stating units, it's not helping.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't show '0.0%' gas percentages

It's just distracting.  Leave it empty.  No helium should be visually
very different from actual trimix, and for oxygen, zero means something
different anyway (it's air).  In neither case is '0.0%' a good string to
show, just show it as empty.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show sample pressures in the cylinder equipment page

If we don't have any manually set pressure data, show the data from the
samples instead.  It uses an italic font for this case, mainly because I
couldn't figure out how to gray things out.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added the first scope of the visual dive planner.

Added the first files and skeleton code for the visual
dive planner. now I need to fill things. The code is
using the print action borrowed, this will need to move
to a better choice in the future.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make double click work to put new items on the canvas.

Make double click work to put new items on the canvas.
Those items right now are QGraphicsEllipseItems, but
it will change to 'draggable' items.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Plots Lines and handles on the Planner

This is still a bit bugged - the lines are going to the wrong
end - most probaly I messed something on the math. I'll now fix
the sizing issue then I'll try to make it behave in the proper
way.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Better handling of the scene size for the dive Plan

Better handling of the scene size for the dive plan,
The scene can be resized and a transform will be applied,
the handles will not resize however - they are 10x10px
and that's it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fix creation of the poligon-based lines for the dive planner

This fixes the creation of the poligon-based lines
next thing to do is to forbit creation of the next point
before the last one.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a cross that follows the mouse on the dive planner.

Created a cross that follows the mouse on the dive planner,
this will help the user to know where it is placing the stop.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Better defaults for placement of dive stops.

This patch makes it impossible to create a dive stop
outside of the scene - this, messing the complete
planning system.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make the cross red when you cant plot a dive stop

Make the cross red when you cant plot a dive stop,
also make impossible to put a dive stop before the last one.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a class DiveHandle to make drag drop work.

Create d a class DiveHandle to make drag drop works,
it has a from and to Lines, and it will move them
around.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added drag and drop code to the dive plan

Added drag and drop code to the dive plan, it can move the user-
inputted data, but will not touch the computer generated ones.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make the plan handlers to not move across other handlers.

This patch disables the hability to move handlers across
the others, making a 'zigzag' in the time line.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the skeleton for the Ruler Item,

The ruler will deliver the Time and the Depth, later.
it should be vertical or horizontal, and will have
ticks

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added a 2 Ruler Items, Time and Depth.

The ruler items are needed so I can get the correct
coordinates of the planned dive. This is a very
rudimentary ruler and it needs a bit of love, but
it already gives me something to work on.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the code to set the Depth / Time on the user Handlers.

Added the code to set the Depth / Time on the user handlers,
I think this finishes the difficult part. ( well, not really )
the depth and time is being set when handler is added or moved,
but as soon as the deco calculations enters on the code, the
handlers will need to be repositioned - and this code is not ready
yet.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>