Commit graph

8973 commits

Author SHA1 Message Date
Dirk Hohndel
e0587cb6df Fix subtle bug in dive site import from V2 file
Assume your V2 file contains two locations with different name but
identical GPS location. "Blue Corner" and "Blue Corner, Palau". And you
have many dives there.

When reading a V2 file the GPS is read first and a dive site is looked up
based on that. Let's assume the lookup by gps finds "Blue Corner, Palau".

Now every time we get the "Blue Corner" site in the V2 file we look  up
the GPS, get "Blue Corner, Palau" as dive site, then read the name "Blue
Corner" and say "oops, different site" and create a new one. Resulting in
several dive sites named "Blue Corner" with identical GPS but different
UUID (as we add the dive time into the SHA for the deterministic UUID).

With this commit, if we have a dive site that matches the GPS but has a
different name, we check if we happen to have an exact match for the dive
site information from the XML file (and use it, if we have it) before
creating a new dive site.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-30 10:14:50 -07:00
Rick Walsh
d15a1db428 TestPlan: Do not re-declare bool result
Fixing this error makes TestPlan pass again.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-30 09:14:58 -07:00
Sander Kleijwegt
d22a135343 Fix edit & show of divesites for new and existing dives.
The UI detects when it should refresh the loction after the
user finished editting a divesite. Creating and editting
divesites is now working even when the current dive is not
saved yet.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:10:32 -07:00
Rick Walsh
954c30c4cf VPM-B Tests: Compare against known Subsurface runtime
We should compare the calculated runtime against the runtime previously
calculated by Subsurface, expecting them to match exactly, in order to detect if
a change has been made.  We still compare against a benchmark, allowing some
difference.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:56 -07:00
Rick Walsh
4a9433864e VPM-B: Don't break the ceiling due to ongassing on ascent
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:53 -07:00
Rick Walsh
e2178c0e55 VPM-B: Remove obsolete first_ceiling_pressure calculation
We now do the first_ceiling_pressure calculation at the start of the CVA loop.
We don't need to do it before.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:49 -07:00
Rick Walsh
27ba48a09e Planner: Change where we clear deco and reset gradients
We should run clear_deco as early as we can.  We should calculate the nuclear
regeneration and start gradient after calculating tissue tolerance.  We don't
need to redo nuclear regeration and start gradient after that.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:46 -07:00
Rick Walsh
2d45e587ba VPM-B: Calculate crushing pressure on descent
By calculating crushing pressure after the manually entered phase, we were doing
it wrong for multi-level dives.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:43 -07:00
Rick Walsh
7d09f418f8 Use Schreiner water vapour pressure for VPM-B
Inspired gas loading equations depend on the partial pressure of inert gas in
the alveolar.
P_alv = (P_amb - P_H2O + (1 - Rq) / Rq * P_CO2) * f
where:
P_alv	alveolar partial pressure of inert gas
P_amb	ambient pressure
P_H2O	water vapour partial pressure = ~0.0627 bar
P_CO2	carbon dioxide partial pressure = ~0.0534 bar
Rq	respiratory quotient (O2 consumption / CO2 production)
f	fraction of inert gas

In our calculations, we simplify this to use an effective water vapour pressure
WV = P_H20 - (1 - Rq) / Rq * P_CO2

Buhlmann ignored the contribution of CO2 (i.e. Rq = 1.0), whereas Schreiner
adopted Rq = 0.8.
WV_Buhlmann = PP_H2O = 0.0627 bar
WV_Schreiner = 0.0627 - (1 - 0.8) / Rq * 0.0534 = 0.0493 bar

Buhlmann calculations use the Buhlmann value, VPM-B calculations use the
Schreiner value.

Concept explained here:
http://www.divetable.de/workshop/V1_e.htm

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:37 -07:00
Rick Walsh
becc1e6dc4 VPM-B: Use correct gamma values
In other implementations of VPM-B, surface_tension_gamma and
skin_compression_gammaC are taken as 0.0179 N/msw and 0.257 N/msw respectively.
We do pressure calculations in bar, not msw, so our gamma values need to reflect
that.  Previously we had used 0.179 and 2.57, which are close but not quite
correct (10 msw == 1.01325 bar).

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:35 -07:00
Rick Walsh
1e7dd49234 Update expected runtime of VPM-B test to match benchmark
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:32 -07:00
Rick Walsh
961c218c06 VPM-B Tests: Output first ceiling
This is useful for determining why we calculate a difference profile

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29 20:06:28 -07:00
Sander Kleijwegt
9770369889 Always show the dive site edit button
Update the tooltip and enable only when there is a divesite selected

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 16:16:05 -07:00
Sander Kleijwegt
67abcd0c2c Fix mouse clicks on divesite completer.
Use clicked instead of activated signal on the completerList to
handle the selection of a divesite.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 16:15:25 -07:00
Sander Kleijwegt
10d0604297 Fix crash when creating a dive site without any dives in logbook.
A divesite uuid is created using the timestamp of the currently
selected dive. When there is no current_dive, use the current
time to create a uuid.

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 16:13:50 -07:00
Dirk Hohndel
d5aacd092d Fix printing on Mac
While I cannot explain for the life of me why this worked on Linux and
Windows and not on Mac, what I have now seems to work on all three
platforms.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-28 09:15:56 -07:00
Dirk Hohndel
4360cee196 Cmake: install grantlee plugins on Mac
And add a small message that two potential ERRORS that are thrown in the
deploy step are actually harmless.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 13:53:32 -07:00
Dirk Hohndel
84c8213e14 Fix build script
A git pull seems to cause things to go wrong. Just fetching the repository
and checking out the version that we want seems to work better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 13:28:25 -07:00
Dirk Hohndel
035e08e633 QtBT: avoid crash at exit if no BT device found
If localDevice isn't valid we never initialize the discory agent, so
let's not dereference it in the destructor unless it is valid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 09:23:38 -07:00
Miika Turkia
837daa08ea Remove unused function and define
These were left unused by cleaning up the import function parameters.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 08:59:56 -07:00
Miika Turkia
14999341e0 Update tests to use cleaner CSV parsing "API"
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 08:59:50 -07:00
Miika Turkia
8e08fdcc85 Clean up CSV import parameters
Continuing the crusade against excessive number of parameters for some
functions. This should be the last of the import functions to be cleaned
up.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 08:59:44 -07:00
Robert C. Helling
c5f92c7501 Rename variable to better reflect what it does
The pressure for the Boyle compensation is of the first ceiling,
i.e. the ceiling seen from the bottom rather than the first
stop.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 07:03:53 -07:00
Robert C. Helling
fe00abc774 Compute first stop pressure for each round of CVA
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 07:03:41 -07:00
Dirk Hohndel
80e7213582 Update INSTALL and build.sh
They now reference the Subsurface-branch branches of Marble and
libdivecomputer and v0.23.1 of libgit2.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-26 11:44:56 -07:00
Sander Kleijwegt
57e15bf789 Explicitly show the menubar after mainwindow initialisation.
At least on Ubuntu with xfce instead of Unity this appears to be necessary
to get a menu bar for the application.

Fixes #833

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-26 11:01:37 -07:00
Dirk Hohndel
13a190464d Tiny fixes to make the FAQ correct for WordPress
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-26 09:48:25 -07:00
Miika Turkia
95fd048822 FAQ: why IRDA DCs don't work on MAC
Copying Dirk's answer to our user forum to FAQ.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-26 09:39:04 -07:00
Dirk Hohndel
a99839a4f1 Remove a couple of debug messages
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 18:15:24 -07:00
Tomaz Canabrava
b8a09ca520 Keep the dive list disabled if editing a dive
When, in a dive edit mode user entered a dive site
and went to dive site edit mode then finished the ds
edit, the app would lose the disabled property of the
dive list, making it possible to select a new dive
when we where editing another one, complete mess.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 18:00:26 -07:00
Tomaz Canabrava
fc6d819616 Create a new dive site and edit it automatically
If the user clicks on the first or second option of the drop
down list, subsurface will move him to the dive site edit panel
automatically, since it's a new dive site and there's no information
about it yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 18:00:15 -07:00
Tomaz Canabrava
0ba832ef12 Move dive site list to its correct position
When we are in display dive mode, and then edit the
location text edit, going to edit dive mode, the location
text edit will be moved a bit below of it's original position
but the Dive Site List would be already opened, and stuck
on it's original position, covering the dive list.
This patch fixes that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:59:25 -07:00
Tomaz Canabrava
32db7e5fb5 Remove edit dive site from the menubar
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:59:15 -07:00
Tomaz Canabrava
03702edf87 Get taxonomy from edit dive site widget
Moved the get taxonomy button from the maintab to the edit dive site
widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:58:59 -07:00
Tomaz Canabrava
aaa70ff56e Turn the get taxonomy button into a manage dive site button
The get taxonomy button will be inside the manage dive site interface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:58:46 -07:00
Tomaz Canabrava
028f0401f6 Disable profile when in dive site edit mode
I didn't have time to create / finish the photos widget, so
I'm adding back the profile view while in dive site edit mode,
but disabling it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:58:30 -07:00
Rick Walsh
6c43685eda Dive planner tests: pass dives that are close to expected duration
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 17:55:59 -07:00
Dirk Hohndel
c22adebebe Merge branch 'gitMerge' 2015-08-25 13:57:12 -07:00
Dirk Hohndel
ab255e07ea Clear the displayed dive and dive site when clearing dive data
Otherwise some artefacts of the last dive / dive site that where shown can
remain visible even after the dive data was closed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 13:55:51 -07:00
Dirk Hohndel
0db80103ca Add spinner while opening or saving cloud storage
Right now this is quite ugly. And at least in my VM the transparency
doesn't seem to work correctly. But at least we now have some visual
indication that we are doing something while opening or saving cloud
storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 13:07:20 -07:00
Miika Turkia
6721698fcd Change Seabear TestParse to use reduced parameters
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:59:45 -07:00
Miika Turkia
bde2e93f8f Seabear import: remove excessive amount of parameters
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:59:38 -07:00
Miika Turkia
ad75b09581 Change TestParse to use reduced parameters
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:59:29 -07:00
Miika Turkia
5bda148020 Remove excessive amount of parameters
This removes the excessive amount of parameters on manual CSV import. We
just use appropriate string array than can be directly fed to XSLT
parsing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:59:15 -07:00
Rick Walsh
e47f62f869 VPM-B: Add more planner tests
Add more VPM-B planner tests.  The "expected" total run time is taken as the
total run time produced by the Fortran VPM-B program.  For all these tests, the
results are within two minutes, which is a good result, but most are classified
as a "fail".

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:57:26 -07:00
Rick Walsh
e25404c9f2 Test VPM-B Correct expected dive time in comment
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:57:09 -07:00
Rick Walsh
3ea7ee1934 Test another VPM-B dive plan
This adds a test for 100 m for 60 min dive on trimix using VPM-B

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:57:06 -07:00
Miika Turkia
7172225c87 Add EON steel udev rule to FAQ
Adding Linus' instructions for udev rule to our FAQ. Product ID 0031
that is used for firmware updates is not included here, as it is
probably not commonly needed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:55:47 -07:00
Dirk Hohndel
72817ff47f Cloud storage: second merge test, delete dive on one side, modify on other
Delete a dive while offline, modify it from a different system while
online. Then resync.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:30 -07:00
Dirk Hohndel
a2c638f63f Cloud storage: attempt to deal with conflicts about deleted files
This doesn't seem right, but it works. Definitely needs more analysis.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:21 -07:00