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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Cmake has a bug that causes the moc process not being handed the necessary
defines for the architecture we are building for.
Also we were missing a library to make the BT implementation on Windows
work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After a replot, check if there is an error message to display.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is nothing to compensate but we would hit a 0/0 numerical
instability there.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Each state can have the same widgets but with different
properties - currently I'm using "enabled" : true and false
for the DiveSiteEdit, it looks like a big amount of code
for such a small thing but it was the cleaner way that
I tougth of doing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added USB usage permissions in manifest.
Also added various FTDI based USB devices in xml/device_filter.xml. When any
device matching the VID and PID provided in the device_filter.xml is attached,
subsurface application is opened automatically. Also, the USB permissions are
granted to the application. This simplifies the USB file generation approach.
Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This connects the serial_ftdi implementation to subsurface, and builds
libftdi1 for the android builds.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This cleans up serial_ftdi.c from being a libdivecomputer source and
making it into a subsurface custom_serial.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>