aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2017-04-22Reduce default verbosityGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-20Identify user provided notes in plain text in replanGravatar Robert C. Helling
This is another attept at the problem if identifying a potentially user supplied text in the dive notes upon replannig a dive. It gets rid of the user visable position markers (*!* and ***) and cirumvents problems with mark-up by first converting the old notes to plan text (assuming that user only enters plain text in the notes field as we do in other places as well). Then the automatically added part is identified by locating the disclaimer in the text (if the user edited/delted the disclaimer or changed langue in between it is her problem to manually delete the old plan). Everything from the disclaimer on is deleted and replaced by the new plan. If the disclaimer is not found, the new plan is appended to the old notes. This way we make sure no information gets automatically deleted. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-04-20Show % after Büllmanns GFsGravatar Jan Mulder
2 strings in the planner output showed based on "Bühlmann ZHL-16B with GFLow = " gradient factors without % after the factor. While this is fine for an abbreviated form like GF 40/80, this looks strange for a verbose sentence like the 2 corrected ones. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-20Support for new DM5 blob formatGravatar Miika Turkia
Currently we do not know what the extra data in the sampleBlob is, but the block size must be adjusted nevertheless. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-18Attempt latin1 parsing on importGravatar Miika Turkia
We parse input XML using UTF-8 encoding by default. If this fails, try latin1 instead. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-16Handle notes from plannerGravatar Stefan Fuchs
New strategy to identify old planner output in notes when replanning a dive: Text anchors ("*!*" and "***") added for planner output For backwards compatibility: If there is no anchor but an old table delete everything. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-13Cleanup some unnecessary include statementsGravatar Jef Driesen
Some of these header files are no longer necessary, and will be removed from libdivecomputer in the near future. Signed-off-by: Jef Driesen <jef@libdivecomputer.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-13Fix building against upstream libdivecomputerGravatar Jef Driesen
The custom_serial.h header doesn't exist in upstream libdivecomputer. Signed-off-by: Jef Driesen <jef@libdivecomputer.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-11Ignore empty cylinders on Cobalt importGravatar Miika Turkia
It appears that Cobalt might include additional gas mixes, and only way to determine what is used appears to be to ensure that start and end pressures are greater than 0. One would assume there to be something else available in the database, but I was not able to spot it. Fixes #297 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-06Move version and date around notes to save spaceGravatar Robert C. Helling
This prints this information in the header near "Subsurface" where I guess at least the version information belongs. Plus it saves a line. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-04-06Add creation date and Subsurface version to planner outputGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
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>