Commit graph

272 commits

Author SHA1 Message Date
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
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
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
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
2d9c9c6a1c Silence warnings in linux.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:43 -08:00
Dirk Hohndel
0a585aad71 Silence warnings in qtserialbluetooth.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:41 -08:00
Dirk Hohndel
ae5c7a55be Clean up UEMIS downloader
Mostly signedness issues, but also removing useless code that didn't have
any effect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:36 -08:00
Dirk Hohndel
349c27a96e Clean up signedness confusion in time.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:28 -08:00
Dirk Hohndel
c63f14eefc Remove unused function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:25 -08:00
Dirk Hohndel
6920480463 Clean up signedness confusion in statistics.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:22 -08:00
Dirk Hohndel
7d1c2a142f Clean up signedness confusion in gaspressures.h
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:18 -08:00
Dirk Hohndel
7f2ad93396 Clean up signedness confusion in profile.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:15 -08:00
Dirk Hohndel
59299f0ab3 Clean up signedness confusion in planner.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:13 -08:00
Dirk Hohndel
b0283c2a99 Clean up signedness confusion in parse-xml.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:10 -08:00
Dirk Hohndel
1dab8800e5 Clean up signedness confusion in libdivecomputer.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:07 -08:00
Dirk Hohndel
ba34b168be Silence warning in file.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:04 -08:00
Dirk Hohndel
d2f7732d22 Clean up signedness confusion in divelist.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:47:02 -08:00
Dirk Hohndel
f2c40907c5 Clean up signedness confusion in dive.c
This started out as cleaning up warnings - but it actually turned into a
matter of semantics and correctness. Which lead to changes in .h files
which will have a ton of ripple effects.

A lot more of this to come.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:46:58 -08:00
Dirk Hohndel
ee6f60515c Silence warnings in cochran.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:46:29 -08:00
Tomaz Canabrava
a61ce696a4 Silence warnings in worldmap-save.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:57 -08:00
Tomaz Canabrava
5cebf43849 Silence warnings in save-xml.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:54 -08:00
Tomaz Canabrava
df55799a98 Silence warnings in save-html.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:51 -08:00
Tomaz Canabrava
91b096a310 Silence warnings in save-git.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:48 -08:00
Tomaz Canabrava
f469a55a46 Silence warnings in parse-xml.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:44 -08:00
Tomaz Canabrava
3d7a9a2095 Silence warnings in membuffer.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:41 -08:00
Tomaz Canabrava
77909ead62 Silence warnings in load-git.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:38 -08:00
Tomaz Canabrava
d3bbb85b86 Silence warnings in libdivecomputer.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:35 -08:00
Tomaz Canabrava
4fba319791 Silence warnings in git-access.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:30 -08:00
Tomaz Canabrava
2da2eb79bc Silence warnings in gaspressures.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:28 -08:00
Tomaz Canabrava
1048845650 Silence warnings in equipment.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:24 -08:00
Tomaz Canabrava
8109439261 Silence warnings in datatrack.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:20 -08:00
Tomaz Canabrava
ea1350e960 Silence warnings in cochram.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 11:44:17 -08:00
Tomaz Canabrava
7a03024517 Silence warnings in gaspressures.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:58:22 -08:00
Dirk Hohndel
c6c3967dd9 Fix include file ordering problem
Otherwise dc_serial_qt_open() is not declared.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 17:18:10 -08:00
Tomaz Canabrava
9d4429c212 Silence warnings in SettingsObjectWrapper.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:45:16 -08:00
Tomaz Canabrava
e64f13104d Silence warnings in save-git.c
Also, another unused function removed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:44:50 -08:00
Tomaz Canabrava
a86a2e52c6 Silence warnings in planner.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:44:12 -08:00
Tomaz Canabrava
91ee285d93 Silence warnings in deco.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:43:57 -08:00
Tomaz Canabrava
f81dd80a48 Silence warnings in cochran.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:43:43 -08:00
Tomaz Canabrava
19b4477cd9 Silence warnings in libdivecomputer.c
There was also a function not being used that could be safely removed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:42:56 -08:00
Tomaz Canabrava
2258939566 Silence warnings in parse-xml.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:42:30 -08:00
Tomaz Canabrava
b77c1d0d95 Silence warnings in load-git.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:42:26 -08:00
Tomaz Canabrava
3b782da960 Silence warnings in liquivision.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:34:17 -08:00
Tomaz Canabrava
62bdc9e3ec Silence warnings in git-access.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:32:41 -08:00
Tomaz Canabrava
9d3be5a165 Silence warnings in gaspressures.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:32:18 -08:00
Tomaz Canabrava
04e39704e2 Fix annoyances on file.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:24:10 -08:00
Tomaz Canabrava
d7d8660bbb Clean up more unused variables
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:21:44 -08:00
Tomaz Canabrava
5bf0e48700 Remove unused variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:17:16 -08:00