aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-06-27Enable 'View->View Globe'Gravatar Lubomir I. Ivanov
For viewing the Globe section (pane) we need to collapse both the 'list' and the 'main' splitters. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-27Add action to 'File->New'Gravatar Lubomir I. Ivanov
File->New in the GTK version performed the same as File->Close. Creating a new file may also ask the user if the current file has to be saved. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-27Add the 'Import files' functionalityGravatar Lubomir I. Ivanov
Similar to File->Open but for multiple files and without calling on_actionClose_triggered(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-24Enable downloads from the UEMIS ZurichGravatar Dirk Hohndel
This behaves somewhat differently from the Gtk version - still needs more investigation. But at least now it's hooked in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-24Add an 'About' dialog for the Qt UIGravatar Lubomir I. Ivanov
The dialog is similar to the one in the GTK version Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-23Perform deco calculation for planGravatar Dirk Hohndel
This uses a bunch of default values that we eventually need to get from the UI, but it's a first step towards a working dive planner. This exhibits some graphical artifacts when running, but other than that appears to be mostly correct. Things go far worse if I enable the changing of the scale once the deco makes the dive longer than the displayed time window. Things quickly spiral out of control. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-23Start hooking in the deco calculationsGravatar Dirk Hohndel
I expanded the DiveHandler to include the actual time / depth of each node on the graph - this way things will stay consistent if we need to rescale the graph. One thing that this makes obvious is that the whole design for the planner so far assumes metric data. We need to make sure this works well with feet instead of meters as well (and that it uses the information in the units settings). With this change we actually create a dive based on the plan input and add the deco stops (if needed) to it - but we don't do anything with the results of those calculations, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-23Print the rounded values for time and depth in plannerGravatar Dirk Hohndel
This looks much more natural than truncating the values. Now the displayed numbers correspond to the "snap" behavior of the handles. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-23Fix updateTicksGravatar Tomaz Canabrava
This is the correct way to add the ticks (and gets rid of two warnings). Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-23Clean up coding styleGravatar Dirk Hohndel
Just to keep me sane. The code still shows compile time warnings which are the areas where we need to complete things to actually do the deco calculations, etc. But now seemed a good time to merge it into master as hopefully more people can contribute. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-22Merge branch 'divePlannerTry3' of github.com:tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-06-21Added the skeleton implementation of the increaseTime and depthGravatar Tomaz Canabrava
Added the skeleton implementation of the increaseTime and increaseDepth methods - they will increase the time / depth by 10 units ( feets / minutes ) each time they are clicked. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Added a new class to handle the pseudo-buttons on the canvas.Gravatar Tomaz Canabrava
Added a new class, named Button, that has a clicked() signal, and can be connected to the view to emulate buttons. While I know that Qt supports widgets on canvas - I think it's too nineties to have such square controls on something that can have rounded borders. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Make the plot and handle movement stick to an 'Grid'Gravatar Tomaz Canabrava
Make the plot and the handle stick to a grid, the grid is defined by the integers in the rulers, so a time of 10,2 is converted to 10, and will put the point at 10. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Depth doesn't suppose to show broken numbers.Gravatar Tomaz Canabrava
This patch makes the depth to show only integers, as dirk asked. I'v also added a 'm' at the end, I know that this will need to be taken from the settings but i feel lazy today =p Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Makes the first and last line of the plot inside of the boundingrectGravatar Tomaz Canabrava
This patch makes the first line and the last line of the plot inside of the boundingRect defined by the timeLine and depthLine Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Do not plot dive handlers outside of the Plane area.Gravatar Tomaz Canabrava
This patch makes the behavior of inserting new hanflers correct. it can only be inserted now inside of the plane defined by the Depth ruler and Time ruler. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Created the posAtValue method for the rulerGravatar Tomaz Canabrava
Created the posAtValue method for the ruler, you enter a value, and it will return the coordinates in double ( coordinate system of a QGraphicsScene is double based ) this is not the best name for the function, but I couldn't find any better suitable name. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-21Round up times instead of downGravatar Anton Lundin
When seeing that you have 0 min left, it looks kinda wierd, so rather round up instead of down. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-21Use the gasmix straight offGravatar Anton Lundin
In calculate_deco_information we compute the ppo2 so we can graph it, but if we send that ppo2 on to add_segment it will just reverse the computation and introduce errors. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-20Added back the menu entry 'Dive Planner'Gravatar Tomaz Canabrava
Added back the menu entry Dive Planner, and removed the calee code from the Print action. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Added a new class to handle the DivePlanner dialogGravatar Tomaz Canabrava
Added a new class named DivePlanner that is a QDialog, and renamed the old DivePlanner class to DivePlannerGraphics. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Make skeleton of 'create_deco_stop'.Gravatar Tomaz Canabrava
This is a skeleton of 'create_deco_stop' plus a bit of code cleanup. I'v commented the create_deco_stop so that the other developers can help me a bit here - since I don't know too well the internals of subsurface. In the original GTK code - a new dive was created every time a user changed something on the dive, I don't know if this will be needed, I jusst need two things: the correct time of dive calculated by the app, and the points to put the decompression lines. The usability of the widget right now is 'ok', nothing to be proud of, it's ugly as hell too, and the Rules are in the wrong position ( they are 'inside' the area where the lines are being drawn, but htis is easily fixable. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Restore the original color of the Handler as soon as mouseRelease.Gravatar Tomaz Canabrava
Restore the original color of the handler as soon as mouseRelease, also a bit of code cleanup. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Added text to the rules so the user knows what's happening at that point.Gravatar Tomaz Canabrava
Added text to the rules, so the user knows what's happening at that point The text will move left / right ( for time ) and up / down ( for depth ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Added the code to set the Depth / Time on the user Handlers.Gravatar Tomaz Canabrava
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>
2013-06-20Added a 2 Ruler Items, Time and Depth.Gravatar Tomaz Canabrava
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>
2013-06-20Added the skeleton for the Ruler Item,Gravatar Tomaz Canabrava
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>
2013-06-20Make the plan handlers to not move across other handlers.Gravatar Tomaz Canabrava
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>
2013-06-20Added drag and drop code to the dive planGravatar Tomaz Canabrava
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>
2013-06-20Created a class DiveHandle to make drag drop work.Gravatar Tomaz Canabrava
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>
2013-06-20Make the cross red when you cant plot a dive stopGravatar Tomaz Canabrava
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>
2013-06-20Better defaults for placement of dive stops.Gravatar Tomaz Canabrava
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>
2013-06-20Created a cross that follows the mouse on the dive planner.Gravatar Tomaz Canabrava
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>
2013-06-20Fix creation of the poligon-based lines for the dive plannerGravatar Tomaz Canabrava
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>
2013-06-20Better handling of the scene size for the dive PlanGravatar Tomaz Canabrava
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>
2013-06-20Plots Lines and handles on the PlannerGravatar Tomaz Canabrava
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>
2013-06-20Make double click work to put new items on the canvas.Gravatar Tomaz Canabrava
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>
2013-06-20Added the first scope of the visual dive planner.Gravatar Tomaz Canabrava
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>
2013-06-19Show sample pressures in the cylinder equipment pageGravatar Linus Torvalds
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>
2013-06-19Don't show '0.0%' gas percentagesGravatar Linus Torvalds
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>
2013-06-19Fix the imperial cylinder size calculations in equipment handlingGravatar Linus Torvalds
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>
2013-06-19O2/He percentages aren't integralGravatar Linus Torvalds
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>
2013-06-19More logical layout for the Dive Info tabGravatar Dirk Hohndel
Up until now the tiles seemed to be arranged rather randomly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Replace wet_volume calculation with straight forward pressure formulaGravatar Dirk Hohndel
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>
2013-06-19Fix cylinder data O2/He percentage entry braindamageGravatar Dirk Hohndel
I can't even begin to explain what got me to write this in the first place. It makes no sense from any angle I look at it... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Remove unused QMap includeGravatar Henrik Brautaset Aronsen
This sneaked into commit 9364436264638e639c7ef2eb642783fbee6f7ea4. It shouldn't be there. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Better minimum width for yearly statistics windowGravatar Dirk Hohndel
The Qt default was way too small. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Improve readability of yearly statisticsGravatar Dirk Hohndel
Make the entries for years bold, keep the months non-bold. It's still a sea of data, but this is an improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Consistently use slots / signalsGravatar Dirk Hohndel
We started out using Q_SLOTS and Q_SIGNALS but then changed our mind. Let's make this consistent again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>