Commit graph

9029 commits

Author SHA1 Message Date
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
Dirk Hohndel
9f5a944107 Cloud storage: first test case for a very simple merge
- We add a dive while offline.
- On a different computer (here simulated by a different local cache) we
  add a different file.
- Now we go back to the previous local cache (the one where we added a
  different dive in the first step) and take that online (i.e., connect to
  cloud storage). Now both of the new dives should have been added to our
  data file.

This is a rather trivial test with no conflict and a straight forward
merge. We need to add a lot more test cases to make sure this works as
expected and doesn't leave the user with a corrupt state.

Ideally whatever happens, the user should never see an error...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:15 -07:00
Dirk Hohndel
449ba2876f Cloud storage: test offline operation
All this really does is make sure that the fast forward works if the local
cache has received updates that haven't made it to the server, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:10 -07:00
Dirk Hohndel
39863089ed Cloud storage: adjust debugging messages
We shouldn't always tell the user about the perceived validity of the
cloud certificate - we force it anyway.

But it's nice to be easily able to see if we tried to update the remote,
so add another debug output when run with -v

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:44:02 -07:00
Dirk Hohndel
092abe9b39 Cloud storage: add test for simple save / load from our test account
This will fail if the proxy settings of the user running the test are
incorrect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:57 -07:00
Dirk Hohndel
420afeef57 Save XML: sort the dive sites by uuid
This makes it much easier to compare XML files written by Subsurface.
The order of the dive_site_table depended on the order in which they were
encountered. This makes it easier to eye-ball changes in XML files. And
allows the GitStorage test to pass.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:52 -07:00
Dirk Hohndel
e03b553e80 Make created dive site uuid deterministic
Having random uuids seemed like a good idea, but there are several
situations where they really cause problems. One is merging dive file
imports from V2 logfiles. Another is testing such imports.

Instead of making the uuid random we now hash the name and add the
timestamp of the first dive associated with this dive site to the hash
(first in this context is "first encountered" with no guarantee that it is
the chronologically first). This way V2 imports create deterministic uuids
but uuid conflicts are still extremely unlikely, even if the user has
multiple dive sites with the same name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:48 -07:00
Dirk Hohndel
6eed3155e6 Add simple test for git storage
This just makes sure that writing data to git storage and reading it back
gives you the same result. Without the fixed generation of initial dive
site UUIDs this fails.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:41 -07:00
Dirk Hohndel
eb205c1b09 Cloud storage: be more verbose if asked to be verbose
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:36 -07:00
Dirk Hohndel
f177b2ec53 Cloud storage: try to brute force your way around merge issues
This seems to do the right thing in several cases that I tested, but I'm
worried if it might end up causing us data loss in other cases. This needs
a TON of testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:32 -07:00
Dirk Hohndel
70c38de3a1 Cloud storage: be very strict about renames
Because of the structure of some of our files git too easily assumed that
they were renames and that confused the merge algorithm.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:27 -07:00
Dirk Hohndel
a45c5f1acf When building against libgit2 v0.23 or newer we can assume API23
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:22 -07:00
Dirk Hohndel
471af6c2fd Cloud storage: clean up after the merge
Make sure the branch is pointing at the merge commit, etc.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:16 -07:00
Dirk Hohndel
f5eb0e2bbb Cloud storage: move git merge into its own function
Just to keep things more readable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:11 -07:00
Dirk Hohndel
4c31c01139 Cloud storage: better error message for dirty state
Tell us WHAT is wrong with the state.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:01 -07:00
Dirk Hohndel
2f540b56a8 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-08-23 07:38:11 -07:00
Robert C. Helling
fbce8a0378 Add a test for the VPM-B mode of the planner
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:30:33 -07:00
Robert C. Helling
41349c29dd Prepare global state of VPM-B when starting to plan
Otherwise, the results of the calculations tend to be rather
random and irreproducible...

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:30:23 -07:00
Robert C. Helling
cb375623f9 dump_tissues() should be available regardless of macro settings
this does not increas binary size increadably but is usefull
when trying to figure out what the planner is doing.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:29:46 -07:00
Robert C. Helling
120d09181d Comment meaning of preference variables
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:28:52 -07:00
Robert C. Helling
7bfc8bc1fe Show tissue ceilings in tenth of m/ft
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:28:06 -07:00
Robert C. Helling
8909dbbfd3 Simplified Boyle's law correction and new cubic root
This uses a bit of algebra to simplify the formula for Boyle's law
correction and introduces another algebraic cubic root solver that
can also deal with negative discriminants thanks to a trigonometric
formula from Wikipedia.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:22:12 -07:00
Rick Walsh
634e698664 VPM-B: Calculate first_stop_pressure before starting ascent
The Boyle's law compensation depends on first_stop_pressure.  To produce
profiles similar to other VPM-B implementations, we should calculate it as the
ceiling before starting the ascent.

Commit 159c9eb2c1, Compare ceiling to next stop
rather than try to ascent for VPM-B, changed (VPM-B) to consider the current
ceiling rather than an incremental ascent between one stop level and the next.
However, the initial ascent generally steps through several stop levels, so
first_stop_pressure was still not calculated as the ceiling prior to commencing
the calculated ascent.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:21:17 -07:00
Joakim Bygdell
898ea6acb5 Recmode: Disable gas switch options
Gas switch is not part of recreational mode, so disable the switch options.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:20:48 -07:00
Joakim Bygdell
d969cacfe2 Indent "Conservatism level"
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23 07:20:39 -07:00
Dirk Hohndel
b8575221b1 Cloud storage: use merge options to avoid conflicts
In many cases Subsurface will do something "reasonable" if we have
conflicting edits and then try to merge. GIT_MERGE_FILE_FAVOR_UNION means
that both edits will be added to the final file and then Subsurface should
quietly take one or the other - this will need quite a bit of testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22 17:52:31 -07:00
Dirk Hohndel
fe0864be60 Cloud storage: merge local and remote changes if there is no conflict
We still punt if there are any conflicts (which are likely to occur if we
have touched dive sites in both changes). But in my testing at least for
fairly simple, non-conflicting changes this works and creates a correctly
merged tree.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22 17:52:31 -07:00
Gehad elrobey
cc86479475 Printing: replace usage of std::ceil()
std::ceil() in printer.cpp throws errors when compiled with mingw, so
replace all std::ceil calls with qCeil().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:39:08 +03:00
Gehad elrobey
f45fdc8660 Printing: disable template editing for statistics templates
Editing statistics templates is not supported now, as there is no
custom template for statistics printing, so disable the template
edit area.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:37:48 +03:00
Gehad elrobey
b6d3735204 Printing: enable UI elements that now can be used
The new statistics code, enable the editing of colors, font, and other
template options.

This patch enables the UI elements for these features.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:36:58 +03:00
Gehad elrobey
69f2921ffa Printing: use the same code for both statistics and divelist print
- use the same generic code for both types of templates
- check for the printing type before generating the template
- remove unused printStatistics() method

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:36:19 +03:00
Gehad elrobey
4553155cf3 Printing: add a statistics template
Add a statistics template to the templates directory.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:36:10 +03:00
Gehad elrobey
b0e84e7e2b Printing: generate a Grantlee statistics template
As there are two types of templates, Grantlee need to support both.

This commit adds the support to generating a statistics HTML code from
a statistics template.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:35:51 +03:00
Gehad elrobey
70e8862efc Printing: export a statistics data structure to the Grantlee backend
Add a YearInfo class which represents a year statistics. Export the
class to the Grantlee backend, also export all it's members to the
printing backend.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:34:48 +03:00
Gehad elrobey
6a692495c0 Printing: add statistics templates to the dialog
Show the existing templates based on the print type selected
by the user.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:34:34 +03:00
Gehad elrobey
77c81b299b Printing: read statistics templates from the "statistics" path
Now there are two types of templates, dive list and statistics.
We need to support reading both types of templates.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:34:06 +03:00
Gehad elrobey
c516421bc2 Printing: check the print type in the preview section
Preview output should be identical to the actual printing code, so
call the flow rendering method for all flow templates.

Also don't create new pages while rendering a one page preview, just
exit after the first page is full.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:33:36 +03:00
Gehad elrobey
13febc1eee Printing: fix uninialized border width
In flow rendering the border width is not initialized which causes
huge borders that blocks the page while previewing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:33:26 +03:00
Gehad elrobey
20c22596f0 Printing: update the user-manual
Add printing description to the user-manual, also add appendix F
which describes how to write a custom template for Subsurface.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:33:07 +03:00
Gehad elrobey
afc697e797 Printing: refactor printing code
This section of the code is called only while rendering a flow layout
template, so move it to the flow layout function.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:32:53 +03:00
Gehad elrobey
4a988aa868 Printing: update user-manual images
Add updated user-manual images, with the new dialog UI.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:32:44 +03:00
Gehad elrobey
90852e114c Printing: fix typo in template name
Template names was capitalized, so change the file name to
"Custom.html" instead of "custom.html"

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:32:28 +03:00
Gehad elrobey
b19d07c61c Printing: fix the six dives per page layout
Add container with height 100% which contains the six dives, so dives
don't overflow the page.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:32:17 +03:00
Gehad elrobey
67bfa9f968 Printing: use older Qt methods when calculating the ceil
Better portability for < Qt5.3.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:30:32 +03:00
Dirk Hohndel
ccd2cb2502 Continue to separate logic code from UI code
We don't want to call into the MainWindow from C code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22 07:05:13 -07:00