Commit graph

8948 commits

Author SHA1 Message Date
Claudiu Olteanu
a83f59ff09 Clear the BTH discovered devices list on each search
Clear the Bluetooth discovered devices list on each search.
In this way we will show only the devices that are in range
and active during the last scannning. Also if we clear the
list before each call we don't need to check anymore if the
discovered device is already in the list.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:11 -07:00
Claudiu Olteanu
14ca6a4e77 Check the last error when the BTH device scanning is finished
If there is no error reported when the device scanning is finished
then report to the dialog status that the scanning finished
successfully. Otherwise report the last error.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:07 -07:00
Claudiu Olteanu
9f043f4a93 Cleanup Bluetooth local device and the discovery agent on exit
Do some extra cleanup when the BtDeviceSelectionDialog is
destroyed.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:45:04 -07:00
Tomaz Canabrava
118e978b5a Display dives from the same location on the list
Some dive sites are separated in more than one real dive site
(for instance, a 'blue hole' dive site that has different
entry points on the gps), so instead of checking only the
dive_site id, also check it's name.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:23:25 -07:00
Dirk Hohndel
a081ffe48e Always save taxonomy data, even if disabled in the prefs
Otherwise, if one of the systems used with cloud storage doesn't have the
preference for geo encoding enabled, the taxonomy data will be lost.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 11:05:07 -07:00
Robert C. Helling
0bb65a17cb Use boyle_compensation in profile
otherwise VPM-B planned profiles seem to violate the ceiling. This needs
the first_stop_pressure to be available also in the profile, so I made
it global in planner.c

Important lesson: If you want to use deco_allowed_depth on a tissue_tolerance
that comes from a VPM-B planned dive, you have to call boyles_law() before
add_segment()!

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 07:28:00 -07:00
Robert C. Helling
2a50731139 Leftovers from introduction of in_planner() helper function
I have no idea how these could have been left behind

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 07:25:01 -07:00
Miika Turkia
6c0bcec3e7 Avoid duplicate divesites on Liquivision import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19 10:14:56 -07:00
Miika Turkia
9bd683ef35 More precise comments
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19 10:14:43 -07:00
Sander Kleijwegt
dbf2868dee Restore selection after renumbering dives.
After renumbering any number of selected dives, the selected
dives would still be selected, but this was not visible from
the divelist view. Clicking on subsequent dives would deselect
them while the GUI shows them as selected, any further action
like delete would not be done on the visible selection, but
on the invisible dive->selected state, leading to apparently
very weird behaviour.

Fixes #917

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19 10:11:38 -07:00
Sander Kleijwegt
b84e6dfc8a Fix startup crash with missing HOME or LOGNAME environment variables
Check whether setenv returns NULL and if so default to '~' for HOME
and 'default' for LOGNAME.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-19 10:11:31 -07:00
Rick Walsh
953470d945 VPM-B: Update critical_volume_lambda
The default value for critical_volume_lambda is 6500 fsw.min (= 199.58 bar.min)
for VPM-B, rather than 7500 fsw.min (= 230.284 bar.min) for VPM.  This is
consistent with V-Planner, MultiDeco, GUE DecoPlanner, HLPlanner and the
comments in the Fortran code explanation.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18 09:18:18 -07:00
Robert C. Helling
72806e42bc Replace global in_planner variable by helper function
as promised earlier

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18 06:42:01 -07:00
Robert C. Helling
4e89a6020e Get rid of is_ok_vpmb
Since a8ce8, that made deco_allowed_depth work for VPM-B as well, this
function became obsolete but was reintroduced by one of Jan's latest patches.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18 06:40:50 -07:00
Robert C. Helling
159c9eb2c1 Compare ceiling to next stop rather than try to ascent for VPM-B
For VPM-B, to stay within the reference implementation, to decide if we
need to stop we check if the current ceiling is above the next stop depth
rather than trying to ascent and check if we violate a ceiling. This
leads to more conservative profiles.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18 06:40:45 -07:00
Dirk Hohndel
f2b883865c Revert "Pref. to ascent to next stop only when stop is below ceiling"
This reverts commit a6ed36fb73.
2015-08-18 06:40:35 -07:00
Jan Darowski
39794d3478 VPM-B: Fix calculating Boyles compensation on gas change stops.
Previously we were calculating the compensation only on the deco
stops, gas change stops appearing before the first deco stop were
ommited.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18 06:34:54 -07:00
Robert C. Helling
075221b4ef Explicit names for initialization of deco constants
This patch is purely cosmetic except for the fact it changes the
critical radii to the V-planner with Boyle compensation values.

These values would have been set anyway by Jan's commit
"VPM-B: Set radius constants to values reccomended by V-Planner" which
will conflict with this anyway. This way, the last chunk of Jan's patch
can just be discarded.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:58:09 -07:00
Robert C. Helling
a6ed36fb73 Pref. to ascent to next stop only when stop is below ceiling
Usually, we try to ascent to the next stop and check if we break the
ceiling while doing that. This patch adds a preference value to rather
check if the ceiling is above the next stop before attempting to ascent.

The difference if off-gasing during the ascent is taken into account.

Logically, it does not sound like it could be relevant to ignore that
off-gasing but it leads to more conservative schedules and it seems
the original Fortran VPM-B implementation does just this. So one could
argue it is part of that model (if it makes sense or not), so we should
at least give users the possibility to turn this on.

Maybe we should even make this the default for VPM-B.

This patch just addes the code to have the value in the preferences and
the planner to act accordingly. There is no UI for it, yet. To test, you
have to set it in the code. There could be a later patch with a UI if people
like to have it.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:58:09 -07:00
Robert C. Helling
930e83dfc4 Factor out root of cubic to be used also for update_gradient
We can use the analytic solution of a cubic in two different places.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:47:20 -07:00
Dirk Hohndel
d93984448c Merge branch 'boyle-ready' of https://github.com/Slagvi/subsurface
Fixed merge conflicts in
	deco.c
	dive.h
	planner.c

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:45:51 -07:00
Miika Turkia
2e8286623d Fix MKVI erroneous sample time
There was a bug in MKVI download tool that resulted in erroneous sample
times. This fix takes care of that and should work similarly as the
vendor's own.

Fixes #916

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:41:19 -07:00
Robert C. Helling
56c90efba8 Explicit cast to stop compiler warning
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 21:09:22 -07:00
Dirk Hohndel
aa48dfea27 Cmake: automatically create version for Mac bundle
The version info that is used for the Mac bundle is created at cmake run
time, not at make run time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 08:45:15 -07:00
Dirk Hohndel
a41475c339 INSTALL file: update Mac build instructions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 17:42:55 -07:00
Dirk Hohndel
128493ae8a Build script: fix install_name for libssrfmarblewidget on Mac
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 17:39:25 -07:00
Dirk Hohndel
530c3a388b Build script: make sure cmake finds Qt on Mac
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 16:56:56 -07:00
Dirk Hohndel
fc5bb31a51 INSTALL file: build the latest master / testing branches
The INSTALL file in the sources should show the instructions to build the
latest master - and then be updated to build the latest release as we get
closer to making a release.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 14:51:43 -07:00
Dirk Hohndel
476cfec6dc INSTALL file: update the Homebrew install URL
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 14:47:00 -07:00
Dirk Hohndel
0a67f7cc95 Build script: make sure we find any library that we installed
Somehow libssh2 wasn't found on Mac builds - this makes sure we always add
the $INSTALL_ROOT/lib as library path.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 12:35:25 -07:00
Dirk Hohndel
79f3f18ef6 Cmake: only link against libusb-1.0 if it was found
This should work much better as libusb is really only required if you want
support for all the dive computers (e.g., Atomics Aquatics Cobalt family).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 12:33:28 -07:00
Robert C. Helling
a8ce8c3ef1 Some unification between Buehlmann and VPM-B
This patch makes deco_allowed_depth() work both for Buehlmann as well as
VPM-B (as long as the VPM-B internal variable total_gradient[] is valid).
As a bonus, in VPM-B mode, in the planner, the ceilings are VPM-B ceilings
and not Buehlmann GF.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 09:10:29 -07:00
Jan Darowski
ffe2884f72 VPM-B: Set radius constants to values reccomended by V-Planner.
V-Planner reccomends smaller values for the VPM with the Boyles
compensation. Also missing units comments were added.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 15:55:46 +02:00
Jan Darowski
6856e87689 VPM-B: Add conservatism levels to the ui. Fix planner settings disabling.
Conservatism level can now be changed from gui, is saved in settings.
Also way of disabling the planner settings in the ui was improved
to support more deco models and be called at the widget creation.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 15:16:51 +02:00
Jan Darowski
cad866013b VPM-B: Add conservatism levels to deco.c
Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 14:36:07 +02:00
Jan Darowski
499ec9af2f VPM-B: Add surface decompression time.
Now, we calculate the volume of free gas not only based on the deco
time but also time on the surface, needed for the full desaturation.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 14:32:36 +02:00
Dirk Hohndel
2455a5dec7 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-08-15 05:22:07 -07:00
Jan Darowski
c0fde4f50f VPM-B: Add Boyles compensation to the planner.
Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 14:21:18 +02:00
Jan Darowski
a828d528f9 VPM-B: Add simple Boyle's law compensation.
This is a very basic implementation that uses bin search for solving the cubic.
It's not called anywhere at this stage, needs to be changed to analytic solution.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
2015-08-15 14:09:51 +02:00
Gehad elrobey
f3c5699714 Printing: remove silly white line at end of each page
QPrinter::pageRect() doesn't always return the correct value of the
printable area, which results in white horizontal lines of un-rendered
area at the bottom of each page, Use QPrinter::pageLayout() instead
which fixes the issue.

QPrinter::pageLayout() is added in QT 5.3, So use pageRect for previous
versions.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:26 +03:00
Gehad elrobey
5892fb5762 Printing: fill the QPainter background color before rendering
While rendering a dynamically sized view port, it may not fit the full
page size, But the background color should be the same for the whole
page, So fill the page background color with the template background
color before rendering.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:22 +03:00
Gehad elrobey
f7fcc96bff Printing: enhance 2 dives template
- Add more text padding on the left
- Reduce the width of the profile so that the padding on the right of it
is equal to the padding bottom from it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:16 +03:00
Gehad elrobey
2d360e8a6d Printing: add table backgrounds and borders to six dives template
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:12 +03:00
Gehad elrobey
4f9349f548 Printing: use the same background for all the data cells flow layout
Dive notes should have the same background as the remaining data cells.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:05:07 +03:00
Gehad elrobey
c862636cf0 Printing: add 'dontbreak' css class to dives
Prevent breaking the dives in flowlayout, and the rows
in the table template. They should have the 'dontbreak'
css selector.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:58 +03:00
Gehad elrobey
6a9c4cb9d7 Printing: don't break dives into successive pages
While rendering a template with "0" dives per page value, try to fit
as many dives per page but don't break a dive into 2 pages.

Use a dynamically sized view port to fit the rendered area only,
and don't render the full page.

All the Template elements that shouldn't be broken should have
the CSS class "dontbreak".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:45 +03:00
Gehad elrobey
31df69c401 Printing: disable ui elements on statistics print
Disable all the UI elements for "dive list print", disable
all the template settings as well, Template Edit button
will be enabled after statistics print supports color palettes.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:34 +03:00
Gehad elrobey
72b35d8e79 Printing: use border width from Grantlee backend
Find the border-width dynamically from the Grantlee backend.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:26 +03:00
Gehad elrobey
59eddc6259 Printing: export border to templates
As there is a problem with sizing the borders in QWebView, "vw" sizing is not
working as supposed with border-width, As a workaround we export border-width
dynamically, so that border-width is relatively the same for all page sizes.

The border-width is equal to the page width / 1000 which gives a nice range
for borders for A0 - A5 papers, Also prevent drawing zero pixel borders
and use 1 px borders as the minimum border.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:11 +03:00
Gehad elrobey
0ced68f15d Printing: fix scrolling bug by adding extra padding
This bug occurs in "table" and "flowlayout" templates, it takes place when
the size of the full web view to be rendered is not divisible by the size
of the view port (Page size), This issue is fixed by adding extra padding
to the bottom of the body so that the total body height is divisable
by the view port size.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:03:53 +03:00