summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-07-06Implement the custom Bluetooth serial communication and use itGravatar Claudiu Olteanu
Create a custom Bluetooth serial communication using the QTBluetooth API and use it when the Bluetooth download mode is enabled. First try to connect on RFCOMM channel 1 because this is the default RFCOMM channel of SPP service for most devices. If this doesn't work try again on RFCOMM channel number 5 because it could be a Petrel2 device. Add a fake open function for the custom implementation. This is used when the selected device is HW OSTC 2N and the Bluetooth mode is activated, then fake the open call of the serial device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06Add a dialog for remote Bluetooth devices selectionGravatar Claudiu Olteanu
Implement a dialog which can be used for remote Bluetooth devices selection and to control the local Bluetooth device. Functionalities of the widget: - expose information about the local BT device - scan for remote BT devices - pair/unpair with a remote BT device - turn on/off the local BT device - logging - save the selected BT device The selection dialog is created when the bluetoothMode checkbox is enabled. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06Add a checkbox and a button for Bluetooth download modeGravatar Claudiu Olteanu
The checkbox will be used to enable the Bluetooth downloading mode. The button will be used to create a dialog selection where the user will be able to scan and select remote devices. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Adapt the test to the API changeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Cmake: only build print related files if NO_PRINTING isn't setGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Correctly include QtQuick when building for mobileGravatar Grace Karanja
The changed introduced in d880040d breaks mobile builds by not correctly linking with QtQuick. This change fixes that by fixing the incorrect line in CMakeLists.txt so that the correct QtQuick headers will be found. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Correct logicGravatar Robert C. Helling
At least my compiler warns about ! binding stronger than == and thus comparing a bool to an int. I guess this is what was meant. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Round MOD of gas rather than truncateGravatar Robert C. Helling
For the proper calculation, we need to take salinity and surface pressure into account (rather than depth = bar * 10 - 10) Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Merge branch 'custom-print' of github.com:neolit123/subsurfaceGravatar Dirk Hohndel
2015-07-05Printing: implement QPlainTextEdit in TemplateEditGravatar Gehad elrobey
This is the main area to edit the templates inside Subsurface. Whenever the user edits a template the edited template is saved in custom.html and custom.html is considered the selected printing template. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: move template_options to print_options.hGravatar Gehad elrobey
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: refactor the print options classGravatar Gehad elrobey
-Remove unneeded parameter to member variable -Check if template_options struct is valid Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add functions that read/write a templateGravatar Gehad elrobey
Read/write templates from files. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add custom options to the PrintDialogGravatar Gehad elrobey
Add: -custom.html template -custom template to print_options struct -options to the options dialog Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: retrieve number of dives per page from the template fileGravatar Gehad elrobey
Add special data attribute 'data-numberofdives' in the template <body> with the number of dives per page. This is standard HTML5 specification so it won't corrupt the template file. Any template that will be used for printing must contain this attribute to assure correct output. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: edit templates to show template options dynamicallyGravatar Gehad elrobey
Template styles must refere to Grantlee fields to be replaced with user selected settings. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: export template_options struct to Grantlee engineGravatar Gehad elrobey
Add template_options to Grantlee lookup section and export the struct fields. -font: is the font type used, must be selcted from 5 different types. -font-size: is a user selection from 9 - 18 then it is scaled to a range from 1 to 2 of the displaying view port. -color-palette: is the colors used in the template, all used colors must be referenced from here.(not yet implemented) -line-spacing: is the distance between two consecutive lines in the dive notes text. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: pass the template_options struct to TemplateLayoutGravatar Gehad elrobey
The template_options struct needs to be passed to TemplateLayout constructor. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add QSettings for TemplateEdit classGravatar Gehad elrobey
TemplateOptions struct must be saved to QSettings after the window is closed, also it must be recalled when initializing the window. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add template_options struct that contains templateGravatar Gehad elrobey
The template_options struct holds the settings variables in the code. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: call TemplateEdit when edit is triggeredGravatar Gehad elrobey
Edit button should open TemplateEdit dialog. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add TemplateEdit form to source treeGravatar Gehad elrobey
The TemplateEdit class works to customize the tempalate before printing, User can select the font-size, font-type, color-palette, linespacing and editing the template HTML code. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: show warning message for WIP featuresGravatar Gehad elrobey
Show warning message before proceeding to print 'Table' or 'Statistics' print layout. This should be used during the development phase only. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: fix two dives per page borders and text fontGravatar Gehad elrobey
As we use a responsive layout, every UI element must be relative to its parent and its size must be a ratio of the view port to prevent them from displaying outside their containing parents. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: choose printing color mode 'color/greyscale'Gravatar Gehad elrobey
We can have color printouts only if the printer supports color prints, the user selected 'print in colors' from the print dialog and the default printer settings (Operating system wise) is to print in colors, Otherwise the prints will be in greyscale. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: make dive profile scale dependant on the page size and DPIGravatar Gehad elrobey
Use setFontPrintScale() to change the font scale of the dive profile as a ratio of the full resolution, font = (pageWidth * dpi) / fontvalue Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: print all dives if 'print selected' is uncheckedGravatar Gehad elrobey
User can choose either to print all dives or print selected dives only. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add QPrintPreviewDialog to main dialogGravatar Gehad elrobey
Add preview dialog that shows the printer contents before printing. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Add simple test for the dive plannerGravatar Dirk Hohndel
This sets up a standard dive scenario (30 minutes at 260ft/79m, EAN36 and Oxygen as deco gases, last stop at 20ft/6m) and calls the planner to set up a dive plan given certain standard gases. Instead of trying to verify the complete plans it checks that we switch to the deco gases at the right depth and the complete duration of the dive matches our expectation. The test intentionally fails right now for imperial as we have the wrong switch depth for Oxygen. See how useful tests are? On the downside, the test does NOT produce the same plan as Subsurface when I try to create a consistent setup for both - and I have not been able to figure out why. There must be some other parameters that I'm not setting, but I haven't identified them, yet. It's very small differences, for example in the metric case the stops at 21m, 9m, and 6m are each one minute shorter in the test than it what Subsurface calculates. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Planner deco stops are at 10ft increments when measured in feetGravatar Rick Walsh
When using feet as depth unit, deco stop levels should be at 10 ft rather than 3 m increments. For shallow stops, rounding means the difference is not apparent. However, with stops deeper than 30 feet, using 3 m increments leads stops at 39ft, 49ft, ..., 98ft, etc. Apart from making plans look messy, the old behaviour makes it harder to benchmark the planner against published profiles in imperial units. This revised patch uses the help macro M_OR_FT(6, 20) to set the last stop at the correct depth. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Read planner preferences when we use themGravatar Rick Walsh
Read and use the last_stop preference in the plan function. Read the plan notes preferences and set variables (plan_verbatim, plan_display_runtime, plan_display_duration, and plan_display_transitions) in the add_plan_to_notes function. Don't read the preferences and set variables otherwise. Both plan and add_plan_to_notes functions are called on data change. Previous behaviour was: - Set variables on declaration - Reset variables in plan function (even variables that only relate to planner notes output) - Changing a preference triggered set_xxx function which sets variable, then plan function, which sets variable again. Apart from being inefficient, the previous behaviour made it difficult to track down where and when variables were set. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Merge branch 'new-vpm' of https://github.com/Slagvi/subsurfaceGravatar Dirk Hohndel
2015-07-04INSTALL file: a few more changesGravatar Dirk Hohndel
- Qt4 is no longer supported - Make the Kubuntu comments more generic - Mention command to add user to dialout group Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-04INSTALL file: add notes for Ubuntu/Kubuntu 15.04Gravatar Pedro Neves
Update the install instructions when compiling Subsurface from source on Ubuntu/Kubuntu machines. Signed-off-by: Pedro Neves <nevesdiver@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-04VPM-B: add CVA to the deco planner.Gravatar Jan Darowski
Added keeping bottom dive state and every deco's time, so we can run multiple deco simulations with different gradients until they converge to some optimal value. Some improvements on the deco time calculation may be needed. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add next gradient calculation.Gravatar Jan Darowski
It improves (increases) gradients for all the compartments, so more free gas can be created in the divers body. Next gradients will converge, so the volume won't exceed the safe limit, indicated by the crit_volume_lambda parameter. Function takes time of the last deco in seconds. Requires vpmb_start_gradient() to be run before. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: vpm without CVA working.Gravatar Jan Darowski
Add call of initial calculation of critical radius and start gradient, so the VPM could work. Currently without CVA, so the gradient isn't improved. Only one iteration is run. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add vpm-b based deco checking.Gravatar Jan Darowski
Check during the trial_ascent() if existing pressure gradient is smaller than previously calculated max gradient. If not, ascent is impossible from the vpm-b's point of view. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add initial gradient calculation.Gravatar Jan Darowski
Calculate the max difference between tissue saturation and ambient pressure that can be accepted during the ascent. Partial results are kept for later improving in next CVA iterations 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-07-03VPM-B: add nuclei size calculation and nuclear regeneration.Gravatar Jan Darowski
This function calculates the size of nuclei at the end of deco, then simulates their regeneration, to the moment before the deco. This is redundant as nuclear regeneration is a very slow process. Function should be called with time in seconds, just before the ascent. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: use an analytic solution for nucleon inner pressure instead of binary ↵Gravatar Robert C. Helling
root search According to mathematica In[4]:= f[x_] := x^3 - b x^2 - c In[18]:= Solve[f[x] == 0, x] Out[18]= {{x -> 1/3 (b + ( 2^(1/3) b^2)/(2 b^3 + 27 c + 3 Sqrt[3] Sqrt[4 b^3 c + 27 c^2])^( 1/3) + (2 b^3 + 27 c + 3 Sqrt[3] Sqrt[4 b^3 c + 27 c^2])^(1/3)/ 2^(1/3))}, {x -> b/3 - ((1 + I Sqrt[3]) b^2)/( 3 2^(2/3) (2 b^3 + 27 c + 3 Sqrt[3] Sqrt[4 b^3 c + 27 c^2])^( 1/3)) - ((1 - I Sqrt[3]) (2 b^3 + 27 c + 3 Sqrt[3] Sqrt[4 b^3 c + 27 c^2])^(1/3))/(6 2^(1/3))}, {x -> b/3 - ((1 - I Sqrt[3]) b^2)/( 3 2^(2/3) (2 b^3 + 27 c + 3 Sqrt[3] Sqrt[4 b^3 c + 27 c^2])^( 1/3)) - ((1 + I Sqrt[3]) (2 b^3 + 27 c + 3 Sqrt[3] Sqrt[4 b^3 c + 27 c^2])^(1/3))/(6 2^(1/3))}} For the values of b and c encounterd in the algorithm, the first solution is in fact the only real one that we are after. So we can use this solution instead of doing a binary search for the root of the cubic. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add initial values for crushing pressure variables.Gravatar Jan Darowski
Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add crushin pressure calculation.Gravatar Jan Darowski
Add new structures holding vpm-b state. Add function calculating current crushing pressure. Call it from add_segment() on every ambient pressure change. It determines what pressure acts on nuclei during the descent and thus their size at the beggining of the deco. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add calculating nucleons inner pressure.Gravatar Jan Darowski
This function calculates the pressure inside the nucleon during the impermeable phase. In the original code, Newton's method is used, for simplicity, we use binary search for finding cubic equations root. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-03VPM-B: add basic algorithm settings.Gravatar Jan Darowski
Created vpmb_config structure based on buehlmann_config. Set it's default values to ones taken from the existing C implementation. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-07-02Add FAQ item about creating a udev rule for Cobalt under LinuxGravatar Dirk Hohndel
This should work under most Linux flavors. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02More debug message cleanupGravatar Dirk Hohndel
Remove several very noise messages on dive site handling (this seems to work well now, so I think we can remove most of them - a couple were left that indicate actual issues). And also remove all the calls to "translate" when outputting data to stderr. Error messages that indicate issues where the user will basically have to come and ask the developers for help shouldn't be localized. They should be in English to make it easier for us to figure out what's going on. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Notes pane: don't show empty taxonomy tagsGravatar Dirk Hohndel
No point in searching for the right tag if the user picked no taxonomy to be shown. And no point in showing an empty value, either. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-02Rename enum values for taxonomyGravatar Dirk Hohndel
This avoids confusion and namespace collisions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>