aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2017-03-30Shift fake tank pressures up by 30barGravatar Dirk Hohndel
This is a rather arbitrary value, intended to create actually valid pressure values for Uwatec Memomouse users - since we treat 0bar as invalid pressure value, this simply creates an arbitrary '30bar + delta' to '30bar' consumption graph (since all the Memomouse devices give us is the pressure delta that was used during the dive). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-29Accept 0 as valid endpressure for Uwatec devicesGravatar Dirk Hohndel
Instead of delivering the actual start and end pressure, memomouse gives you a start pressure that matches the delta between actual start and end pressure, and an end pressure of zero. Who the heck knows why it does that, but the information is better than nothing, so we should accept it. Fixes #286 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-28Always show notes when replanningGravatar Robert C. Helling
... as per popular request. Plus adding const keyword to constant strings. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28Fix missing slash in markupGravatar Robert C. Helling
Reported-by: Stefan Fuchs Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28Handle notes in replanGravatar Robert C. Helling
Upon replanning a dive, we want to delete the old dive plan in the notes and replace it with the actual. This fixes a problem when we failed to detect the old plan due to the deco model name appearing in the disclaimer that was used as a marker for the notes. This patch also adds translation markers for the deco model name strings.. Fixes #285 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28minimal pO2 threshold: split max threshold into min and maxGravatar Jan Mulder
Nothing really special here. Just a split of the only p02 max threshold into a min threshold and max threshold, and the adaptation of the UI. Change of translatable strings included. ref: https://github.com/Subsurface-divelog/subsurface/issues/259 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-28Fix a crash when git init failsGravatar Miika Turkia
This can occur e.g. if directory permissions prevent one from writing to the local cloud storage directory. (Such a crash was discussed on mailing list.) The error message on GUI is misleading, claiming that cloud connection failed... Signed-off-by: Miika Turkia <miika.turkia@gmail.com> --- We probably should check the return value of other git operations as well, but going for bare minimum for now.
2017-03-24Fix double to int truncation in C++ codeGravatar Jeremie Guichard
Wfloat-conversion enabled for C++ part of the code Fix warnings raised by the flag using lrint Original issue reported on the mailing list: The ascent/descent rates are sometimes not what is expected. E.g. setting the ascent rate to 10m/min results in an actual ascent rate of 9m/min. This is due to truncating the ascent rate preference, then effectively rounding up the time to reach each stop to 2s intervals. The result being that setting the ascent rate to 10m/min results in 20s to ascend 3m (9m/min), when it should be exactly 18s. Reported-by: John Smith <noseygit@hotmail.com> Reported-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-24Subsurface-mobile: do send decimal GPS to GoogleGravatar Jan Mulder
Sending nicely readable formatted coordinates to Google Maps does not result in a correctly positioned map. Google likes unreadable decimal format. Little hacky solution. Added a gps_decimal attribute, populate that with the standard function for format a coordinate to string, but reset the preferences value temporarly so that it always converts it to decimal style. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-20Add 10l 200bar and 232bar cylinderGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-19Tests for minimum gasGravatar Stefan Fuchs
Add automatic tests in TestPlan for minimum gas: - Copy minimum gas result (pressure) to diveplan. - Add cylinder size and working pressure for bottom gas to every dive in TestPlan Hint: Unrealistic cylinder sizes (100l, 200l) have to be used for the very long and deep dives in TestPlan - Add minimum gas check for every dive - Add two additional test dives in TestPlan which produce sane minimum gas results with 24l tank Hint: Deco check for these new dives is commented out at the moment Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-19Prevent overflow in minimum gas calculationGravatar Stefan Fuchs
For the "crazy" long and deep dives in "TestPlan" an overflow happened here. Rearranged the calculation to have more margin. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-13Use GFLow, GFHigh (not GFlow, GF Low, GF low).Gravatar Martin Měřinský
2017-03-13Safetystop > Safety stopGravatar Martin Měřinský
2017-03-12qtserialbluetooth.cpp: mark qt_serial_get_transmitted() as unusedGravatar Lubomir I. Ivanov
The function is unused, to silence the warning add the "unused" GCC attribute to the function declaration. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-12planner.c: fix a couple of float -> int cast warningsGravatar Lubomir I. Ivanov
Use lrint() to fix both: 1) core\planner.c:902:23: warning: conversion to 'int' from 'doub le' may alter its value [-Wfloat-conversion] 2) core\planner.c:907:21: warning: conversion to 'int32_t' from ' double' may alter its value [-Wfloat-conversion] Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-12Only enable -Wmissing-field-initializers for ClangGravatar Lubomir I. Ivanov
The following pragma is Clang specific: It produces a warning: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] Only enable it for Clang by checking the __clang__ macro. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Undo one lrint changeGravatar Dirk Hohndel
As here we actually do want the rounded floatingpoint value. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Remove unused static functionsGravatar Dirk Hohndel
These became obsolete with commit e2bbd0ceecff ("Rewrite cylinder merging code from scratch"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Remove unused variableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Merge branch 'master' of https://github.com/dje29/subsurfaceGravatar Dirk Hohndel
2017-03-11Fix build after mergesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Dive No. > Dive #Gravatar Martin Měřinský
2017-03-11divespot > dive spotGravatar Martin Měřinský
2017-03-11divelog > dive logGravatar Martin Měřinský
2017-03-11divemode > dive modeGravatar Martin Měřinský
2017-03-11We use 'setpoint' in UI. Use it also for documentation and comments. No ↵Gravatar Martin Měřinský
semantic change.
2017-03-11Use abbreviations with dots.Gravatar Martin Měřinský
2017-03-11unkn > unknownGravatar Martin Měřinský
2017-03-11SAC: %.*f%s/min versus SAC:%.*f %sGravatar Martin Měřinský
2017-03-11Change type of divedatepoint.depth to depth_tGravatar Robert C. Helling
... for consistency, while we are at it. There are still some internal depth variables which are ints somebody might take a go at those. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-11Make depth conversion work for negative depthsGravatar Robert C. Helling
This is needed in the altitude pressure conversion as there negative altitudes are possible (for diving in the netherlands or the Dead Sea). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-11Disable minimum gas calculation for recreational modeGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-11Minimum gas calculation - Calculations and UI parametersGravatar Stefan Fuchs
Add minimum gas calculation to planner output. Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime. Connect UI signals and slots for recalculation of diveplan. Disable minimum gas calculation if there was already a warning before. If minimum gas result is larger then cylinder start pressure give warning message instead of result. Add line break before pO2 warnings but only if warnings exist. Signed-off-by: Joachim Ritter <jritter@bitsenke.de> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-09Fix potential double/float to int rounding errorsGravatar Jeremie Guichard
Not using lrint(f) when converting double/float to int creates rounding errors. This error was detected by TestParse::testParseDM4 failure on Windows. It was creating rounding inconsistencies on Linux too, see change in TestDiveDM4.xml. Enable -Wfloat-conversion for gcc version greater than 4.9.0 Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-08Change calls to rint into lrint avoiding conversion warningsGravatar Jeremie Guichard
Using gcc option "-Wfloat-conversion" is useful to catch potential conversion errors (where lrint should be used). rint returns double and still raises the same warning, this is why this change updates all rint calls to lrint. In few places, where input type is a float, corresponding lrinf is used. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-07In weights table 'weight' is redundant and no used for other types.Gravatar Martin Měřinský
2017-03-07Enable translate 'All' in yearly statistics.Gravatar Martin Měřinský
2017-03-04Add helper to parse duration textGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-04heartrate, heartbeat > heart rateGravatar Martin Měřinský
2017-03-04Consistent 'salt water' versus 'fresh water'.Gravatar Martin Měřinský
2017-02-24Add subsurface_stat for MacGravatar Dirk Hohndel
Which is also used on iOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-24Fix "Load/Save to cloudstorage" for non-ASCII user namesGravatar Jeremie Guichard
On Windows that would fail because stat() doesn't deal well with our utf8 strings. Added new subsurface_stat() portability function to replace stat(). Added Windows implementation of subsurface_stat() using wstat(), with conversion to ut16 of the inputed path. Other platform implementations (linux, android) make use of the normal stat(). Added non ASCII test case in TestGitStorage::testGitStorageLocal() Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-02-21Dive merge: don't pick an empty dive siteGravatar Dirk Hohndel
When merging, we should treat an empty dive site (which will be deleted on save) the same as not having a dive site. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-21Many filenames are const stringsGravatar Robert C. Helling
So we can use string constants for those Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-02-21Translate names of additional dive events and nicer format info box textGravatar Stefan Fuchs
Enable translation for a few additional internal dive events. Ensure that all event names in datatrak.c are collected for translation. Ensure that for gaschange in profile info box the "cyl." string is also translated. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-02-21Unknow > UnknownGravatar Martin Měřinský
2017-02-19Fix dive site string mergingGravatar Linus Torvalds
If the second dive site doesn't have a particular string, but the first one does, we did the wrong thing and created a result string like (first dive site string) or ((null)) which is not useful. We should just use the first dive site string as-is. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-19Fix typo in saturation/desatureation ratesGravatar Robert C. Helling
This patch eliminates the difference between the saturation and desaturation rates. This was probably once meant as a conservative measure but the desaturation rate was increased rather than the saturation rate (which is probably a typo, as reported by Stefan). Since there is no good basis for this anyway, this patch sets both factors to 1.0 (and if accepted the whole factor business should be removed). This makes our deco times slightly longer. But in the past, we had introduced a 1.2% fudge factor in the critical radius calculation to add conservatism and match the benchmark better. Removing this fudge factor brings us close to the benchmarks. Expected test values updated. Reported-by: Stefan <sjti@gmx.net> Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-02-19Update exif.cpp from upstreamGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>