Commit graph

10516 commits

Author SHA1 Message Date
Dirk Hohndel
bff3588c25 Undo two more unsigned changes that are no longer needed
With this master should compile without signed / unsigned warning,
hopefully without any more breakage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 10:11:39 -07:00
Dirk Hohndel
0cd0762807 Another attempt to clean up signed / unsigned in profile.c
This time we err on the side of signed variables most of the time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 10:04:30 -07:00
Dirk Hohndel
22c94a3e65 Don't try to force depth to be unsigned
Trying to clean up the signed vs. unsigned issues it becomes clear that
forcing depth to be unsigned causes way too many problems in the code.

So this commit goes the opposite direction; since we clearly aren't
limited INT_MAX vs UINT_MAX, simply make more of the depth related
variables signed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 09:53:44 -07:00
Robert C. Helling
e93c99c8bc When changing units from psi to bar first change value, then max
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 09:34:49 -07:00
Dirk Hohndel
0ae5f6faae Revert "Clean up signedness confusion in planner.c"
This reverts commit 59299f0ab3.

Doing this oversimplified "fix" actually breaks the planner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 08:17:17 -07:00
Dirk Hohndel
abb3b03511 Don't start Add or Plan while accessing cloud storage
This avoids a race condition where we get confused about our internal
state.

Fixes #1031

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 17:41:15 -07:00
Robert C. Helling
48007ebc30 Make the reserve gas units aware
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.

Fixes #1027

[Dirk Hohndel: small modifications, more reasonable step for psi,
               more reasonable maxima]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 16:16:38 -07:00
Dirk Hohndel
e8f8051efe QML UI: use consistent, darker text color for dive list
We received suggestions from users to darken the text color in the dive
list a bit and this does seem to be a lot more readable. Especially since
people are likely to use this outdoors the higher contrast seems
reasonable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 11:36:11 -07:00
Anton Lundin
77e1c2afa9 configure OSTC/OSTC3: Bugfix depth parameter unit
The unit for the depth parameters ain't meters, its 0.1 meters. This
caused the values stored to be out of range.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:46:40 -07:00
Miika Turkia
ee0bdd9043 CSV export
Need to discard dive site notes on csv export..

miika

From ab23245e2acee32410fa680d0eaab098af69b5c2 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Mon, 21 Mar 2016 17:50:28 +0800
Subject: [PATCH] CSV export: discard dive site notes

The new format of divesite management breaks the CSV export as the notes
of divesites are matched.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:45:04 -07:00
Rick Walsh
cbd332fbcc Profile widget: Display gradient factors used in plan
Currently, the gradient factors displayed at the top of the profile are the
gradient factors set in preferences.  This is correct for saved dives, but
when planning dives, the gradient factors displayed at the top of the profile
should be the gradient factors used in the plan.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 11:31:13 -07:00
Dirk Hohndel
47ba8b38d4 Preferences: fix missing slot problem when creating new account
This is still a left over from the damage done when creating the
preferences objectification.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 07:52:33 -07:00
Rick Walsh
0e5c8f101c Planner: add segment symbol to output table
Add a symbol to each line of output table indicating whether a segment is an
ascent, descent, constant depth (user entered) or deco stop

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-03-19 10:45:37 +01:00
Jeroen Massar
cfd3d8868b Verify that the Xcode Command Line Tools are installed
Otherwise /usr/include does not exist on a clean-ish install

Signed-off-by: Jeroen Massar <jeroen@massar.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 09:00:50 -07:00
Jeroen Massar
0ddfd3a992 Detect Homebrew Qt5
And preserve that path in CMAKE_PREFIX_PATH and pass it along to cmake

Signed-off-by: Jeroen Massar <jeroen@massar.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 09:00:31 -07:00
Jeroen Massar
4a8619349a Debug reminder: how to get more verbose details out of cmake
Signed-off-by: Jeroen Massar <jeroen@massar.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 08:59:37 -07:00
Dirk Hohndel
ed9e5fe0f3 Don't use CRLF in documentation files
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 07:46:47 -07:00
Robert C. Helling
e32ae20ca3 Fix loading images from URLs
This was broken when introducing loading images from the server. Now it first tries the
server and if that fails tries the actual URL.

Still, the image does not show up immediately, since the DivePictureModel is
unavailable to the image downloader to be told to update the images.

This needs to be fixed but in the mean time, the image is shown when the dive
is reselected (possibly on the next run) since it is then loaded from the cache.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 07:46:28 -07:00
Robert C. Helling
8a59d78faa When handing off a picture to a worker thread, copy it first
as otherwise we crash when the picture is freed before the
worker thread (to load from the net or to compute hashes)
is finished

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 07:46:28 -07:00
Robert C. Helling
3c7e14a18f Don't build libdivecomputer examples
... as those don't compile.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 07:46:28 -07:00
Robert C. Helling
49bcbf39d5 Replace ~ by $HOME in build.sh
Somehow the file test with ~ interpolation does not work

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16 07:46:28 -07:00
Dirk Hohndel
b02b76aea0 Bump Subsurface-mobile version
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 18:24:29 -07:00
Dirk Hohndel
dca6eaa089 Use more informative error message in application log
While on the desktop we show the error to the user, in Subsurface-mobile
it's only appended to the log; so in order to improve debuggability it
makes sense to show the full error there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 18:22:54 -07:00
Salvador Cuñat
27524248cc mobile-manual - Update authors, dates and so
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 12:46:43 -07:00
Salvador Cuñat
b7848cc9c9 Spanish translation for mobile-manual.txt
[Dirk Hohndel: also added an html version]

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 12:46:17 -07:00
Linus Torvalds
fb5ce88b81 gas model: update to new coefficients, and simplify expressions
This updates the gas model to use the new virial coefficients from the R
script, and simplifies the expression a tiny bit by avoiding the
division by 1000 for the gas fractions, and replacing it with a multiply
by 0.001 at the end.

The virial coefficients for Oxygen and Nitrogen changed in the last
digits due to the use of a different tool for the least-square fitting.
That also accounts for the change in format (the coefficients are not
using scientific notation).

The coefficients for Helium changed noticeably more, since they are now
based on the new least-squares fit from the raw data.

But the actual end result does not change appreciably, the main
advantage is that now the numbers are easily reproducible.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 12:43:35 -07:00
Linus Torvalds
6b5e22a68e gas model: add proper He compressibility data and do a least-squares fit
Lubomir pointed to exactly where he got his data from, so I added that
raw Helium data to the R script, and let the least-squares fit just take
care of the interpolation between 273K and 323K.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 12:43:30 -07:00
Dirk Hohndel
4f935595d9 QML UI: make return to dive list work when entering credentials
If the user tapped on the "Cloud credentials" menu and wants to go back to the
dive list (by selecting that option from the menu), allow them to do so if they
previously had valid credentials.

This allows them to go back to the dive list even on a device without a back
button like an iOS device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 11:41:09 -07:00
Dirk Hohndel
8dcb6fa25c QML UI: show user manual in browser window
This is so obvious... and I know others asked for this before. Should
definitely have been in the first version...

Fixes #1026

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 11:13:04 -07:00
Dirk Hohndel
087cda05e6 QML UI: font color isn't supported on app log page
So let's remove all that markup.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:58:57 -07:00
Dirk Hohndel
3efa20820a QML UI: show cloud access notification when refreshing from menu
If the user requests a refresh we always try to access the cloud and need to
show the notification accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:56:29 -07:00
Linus Torvalds
fcf1898b0c gas-model: add R compressibility script
It annoyed me that we hand-waved a bit about how the virial factors were
actually computed in the gas-model.c file, so here's an actual R script
that computes them and plots the results.

You can run it with (for example):

    R --vanilla < compressibility.r

and it will generate a Rplots.pdf of the plots, and the coefficients
will be shown on stdout.

The result actually differs in insignificant ways from the values that
Lubomir computed, which is likely just due to tools.  I used R, Lubomir
seems to have used

    http://polynomialregression.drque.net/online.php

but the actual curve is pretty much the same.

NOTE! R is not entirely happy about the non-linear fit of the Helium
curve: the fit is *so* precise that it failes the R relative-offset
convergence criterion.  That is apparently generally a sign of
artificial data.

That is probably because Lubomir generated them from the linear mix of
two polynomial fits, rather than a linear mix of the original data.  But
maybe the original data was artificial?

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:32:21 -07:00
Miika Turkia
6bcfb033ee UDDF export: fix dive site support
We need to match the divesites to suppress extra output that breaks the
XML. This is because the divesites are actually gathered by calling a
template.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13 08:31:30 -07:00
Guillaume GARDET
c8df5625d4 Documentation: add mobile user manual to POT/PO management and update french translation of user-manual and mobile-manual
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-12 06:46:03 -08:00
Dirk Hohndel
343e8e3df6 Another bump to the Subsurface-mobile version number
Hopefully this is the one we can release.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11 13:26:51 -08:00
Dirk Hohndel
f1d73606e5 QML UI: don't allow negative gas consumption
If end pressure is higher than start pressure, simply use the same start
and end pressure.

Fixes #1024

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11 13:17:57 -08:00
Dirk Hohndel
5a83226aa8 QML UI: try to clean up UI before showing notification
This way we shouldn't have a drawer or other changes to the UI prevent the
user from seeing / interacting with the notification.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11 10:10:13 -08:00
Dirk Hohndel
c4fb42f8ad QML UI: sort GPS fixes correctly
That was silly. We have the GpsWhenRole specificly for sorting and then
didn't use it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-11 07:26:42 -08:00
Dirk Hohndel
26c2dea46c Bump Subsurface-mobile version
Even though 1.0.0 was never released publicly, it was offered to beta
testers, so it is good practice to bump the version number for the next
binary that I'll push to them. Even if the build number would of course be
different.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:19:21 -08:00
Dirk Hohndel
8224b87b7a QML UI: don't claim to be accessing the cloud when you are not
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:17:23 -08:00
Tomaz Canabrava
fcb308fdf2 Red error messages in QML
[Dirk Hohndel: slightly changed to make it easier for translation plus
               added one missing string that needed to be marked]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:14:58 -08:00
Dirk Hohndel
ba89d9bbb1 QML UI: correctly validate the gasmix entered
We parsed it correctly, but then compared the permille values against
percent thresholds. What a stupid bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 22:03:00 -08:00
Dirk Hohndel
969ca3d9ea QML UI: if the date entered doesn't match the format, try harder
This implements a bunch of standard date and time formats, hoping that
what the user entered matches one of them.

I guess in the end we need to find decent calendar/clock based widgets to
enter the time and avoid the whole parsing hassle.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 18:36:46 -08:00
Dirk Hohndel
3be6b128fd QML UI: hide some profile scaling debug messages
Simply make things less verbose

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 18:02:36 -08:00
Dirk Hohndel
9d6c755f48 QML UI: keep cloud access notification until done
Instead of having the notification disappear after five seconds, keep it
visible until we are done accessing the cloud. That seems to be more
intuitive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 18:00:44 -08:00
Dirk Hohndel
d1247ba19c Small update to the mobile user manual
Also switch the mobile user manual html over to something created on my
machine and (as usual) named .html.git

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 09:00:31 -08:00
Dirk Hohndel
d9c3fc9946 Revert "Clean up signedness confusion in gaspressures.h"
This reverts commit 7d1c2a142f.

Another one.
2016-03-10 07:40:15 -08:00
Dirk Hohndel
a678cba93a Revert "Clean up signedness confusion in profile.c"
This reverts commit 7f2ad93396.

Idiot maintainer to do cleanup like this right before a release
2016-03-10 07:37:18 -08:00
Dirk Hohndel
557eb744a3 Make sure version is freshly generated before extracting
Oops, so Subsurface-mobile 1.0 (4.5.2.1048)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 06:35:40 -08:00
Dirk Hohndel
6be0800704 Update Subsurface-mobile version to 1.0.0
And make sure the version displayed for Android includes both that version
and the build version, which is our regular canonical 4 part version
number - so this release will be something like "1.0.0 (4.5.2.1047)"

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10 06:29:26 -08:00