aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2017-11-10Fix warningGravatar Jan Mulder
Commit 97712559192ca82d introduces a compiler warning due to mismatched pointer types. Fixed here. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-09Print version when run in verbose modeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-09Add details about key libraries when showing versionGravatar Dirk Hohndel
Also fixed a spelling error and apparently some whitespace issue. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-09CNS can be higher than 255%Gravatar Jan Mulder
I'm sure this bug has heen here forever, but the CNS clock is not very relevant for most divers, and even some technical divers do not care about this value. However, doing long decompression dives, the value can easily grow over 100%, and a lot further. For example, the OSTC computers use 2 bytes to store the CNS value in the profile data, and I have multiple dives in my logbook going way over 255%. This all said. Just store the CNS value in an unsigned 16 bit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-09Planner don't add minimum gas switch time more than onceGravatar Stefan Fuchs
Avoid adding the minimum gas switch time more than once even if we skip some available deco gas. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-08VPMB: calculate time of final ascent properlyGravatar Rick Walsh
Commit d15779a calculates final stop based on stoplevels[2], but if final stop is 6m/20ft, we should use stoplevels[3]. This fixes it. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPMB: time_clear_ceiling is only valid after time_deep_ceilingGravatar Rick Walsh
Some messed up logic was producing negative deco_time values for some no-deco dives. The CVA wouldn't converge and unrealistic VPMB ceilings were displayed in the profile. This fixes it. See #762 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPMB profile: remember deco_time when restoring deco_stateGravatar Rick Walsh
Otherwise the CVA won't iterate properly. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPMB: final_tts may be calculated before final sampleGravatar Rick Walsh
We calculate tts every 30s, not every sample. Consider that when determining the time that the ceiling would have cleared if it's after the surfacing time. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPMB profile: use deco_time rather bottom_time from plannerGravatar Rick Walsh
This makes the calculations in profile.c a little simpler, especially now we adopt consistent final ascent rate to determine deco_time since d15779a27 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPMB in profile: deepest ceiling occurs just after bottom timeGravatar Rick Walsh
This lets us calculate deco_time for real dives closer to the planner value. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPMB: calculate deco_time assuming final ascent always takes the same timeGravatar Rick Walsh
If we consider the actual time to ascend from the final stop when calculating deco_time, then slowing the final ascent can lead to the final stop being extended, which is completely nonsensical. For consistency with the original VPMB implementation, we can't ignore the final ascent time completely, but if we assume it is always the same (take default ascent rate of 9m/min) then slower the final ascent won't lead to a longer final stop. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08VPM-B: move bottom_time into deco_stateGravatar Rick Walsh
Removing ext variable from profile.c should facilitate future performance gains Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-11-08Do not save dive sites that are not usedGravatar Jan Mulder
As it is not possible to delete dive sites from the logbook, we need to make sure that we never save sites that are not tied to any dive. With this change, unused site that are currently in the logbook will also be removed, so it will also clear up (wrong) historical data. Supposed to fix #786 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-07Save font_size in correct groupGravatar Jan Mulder
A change of the font_size in preferences ended up in the wrong preferences group (the GeneralSettings group), appearing to the user as a non-saved preference. Fix is simple. Just set the the correct group before saving a change in font_size. Fixes: #780 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-06Add "Aladin" to the list of recognized BT names.Gravatar Berthold Stoeger
Recognize Aladin as the Bluetooth name of the Scubapro Aladin Sport Matrix. Note that the Scubapro Aladin H Matrix most likely also identifies itself using this BT name. But it probably uses the same BT protocol (i.e. the G2 protocol) and therefore this should not pose a problem. Ultimately a common name should be found. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-06Fix typo which prevented correct translation of word "Density"Gravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04Disable o2 break option if last stop is not at 6m/20ftGravatar Stefan Fuchs
Disable the possibility to plan o2 breaks of option "last stop at 6m/20ft" is not set. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04O2 breaks code enhancements and cleanupGravatar Stefan Fuchs
Remove unused variables o2time and breaktime or convert into boolean. Never consider minimum gas switch time when switching to o2. Reflect this behavior also in the UI. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04Replace QMap::operator[] with QMap::value()Gravatar Berthold Stoeger
QMap::operator[] creates a new default constructed entry in the map if no entry with the given key exists. While not problematic (since typically nullptrs are inserted) this is usually not what you want for read access. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-03win32: optimize the console and logging logicGravatar Lubomir I. Ivanov
Currently one has to explicitly use --win32console and/or --win32log to enable a dedicated console (a console window that opens next to the Subsurface window) or to enable file logging on Win32. This patch makes the following changes: - removes the --win32* command line arguments - removes the dedicated console window support - if the app starts from a shortcut and not from a console, always redirect stderr and stdout to _err & _out log files - if the app starts from a console redirect stderr and stdout to that console Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-02Fix resource leaks in qt-ble.cppGravatar Berthold Stoeger
1) Destroy QLowEnergyService objects in destructor of BLEObject. 2) Let BLE object take ownership of the controller so that the latter can be destroyed in the destructor of the former. This introduces a certain ownership subtlety, which could be solved by allocating the controller object in the BLE object. But let's first do the less intrusive thing. 3) Destroy the BLE object for two error conditions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-31When O2 breaking, add segment with current mix not with nextGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-31Don't do the minimal gaschanging stops during O2 breaktingGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-31Correct time bookkeeping when doing O2 breaksGravatar Robert C. Helling
These got mangled with previous changes to stop length determination. Fixes #662 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-30VPM-B ceiling: calculate deco_time similar to planned VPM-B divesGravatar Rick Walsh
When planning a VPM-B dive, the "deco time" ends at surfacing, which is after ascending after a full-minute deco stop is complete, after ceiling clears. We should take this into account when calculating the ceiling outside of the planner. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30VPM-B ceiling outside of planner: over-estimate deco_time on first iterationGravatar Rick Walsh
This means the iterations converge from an over-estimate, consistent with planning VPM-B dives Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30whitespace (planner.c)Gravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30VPMB profile: use bottom_time to calculate deco_time in plannerGravatar Rick Walsh
This corrects the issue where the displayed ceiling in the profile was "broken" by the planner, especially for shorter and shallower dives. Also fixes issue outside of planner where the deepest VPM-B ceiling was shown too early, messing up the deco_time calculation. VPM-B plans respond to change in O2% in gas as expected (in my testing) Fixes: #630 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30Planner remove unnecessary gas consumption info from notesGravatar Stefan Fuchs
If we consumed 0l/0bar in total from a cylinder there is no need to also state that we consumed 0l/0bar during ascend. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-30Add a useful error message if we fail to connect to cloud serverGravatar Dirk Hohndel
Because now we are trying to open a URL as if it was a local file. Again, the goal is to accelerated debugging if things go wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-30Improve parsing of git error messageGravatar Dirk Hohndel
This is rather fragile code, and the capitalization of the error message in libgit2 changed at some point. But commit 794739b4c0 ("strstr is a case sensitive compare") didn't really fix the problem - as it broke that same check for older libgit2 versions. Instead use our new helper function to make it work with libgit2 old and new. Also, add some more error output so the next time we run into this it's more obvious what broke and where. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-30Add new helfer for strcasestrGravatar Dirk Hohndel
That's not a standard functions, so let's just build it. This is not the most efficient way to write it, but it will do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-29Mark missing translationsGravatar Dirk Hohndel
Reported-by: Pedro Neves <nevesdiver@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-29Remove three obsolete preferences options for geocodingGravatar Stefan Fuchs
These options are not used any longer/were never used and can be removed to not confuse the users. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-28Planner: Do not translate VARIATIONSGravatar Salvador Cuñat
This string is substituted with the runtime increments derived of slight variations in depth or bottom time in: diveplannermodel.cpp:1058: displayed_dive.notes = strdup(notes.replace("VARIATIONS", QString(buf)).toUtf8().data()); Translating it avoids substitution and we just get the translated string. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-10-26Clear error string when starting dive computer dowload.Gravatar Berthold Stoeger
Fixes minor interface inconsistency: After a failed download, the error message was also shown on subsequent successful downloads. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-26git save: create a better commit message for initial commitGravatar Dirk Hohndel
When we create an empty repo we should simply state that in the commit message. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26git save: don't save the git_id if just creating empty repoGravatar Dirk Hohndel
Otherwise the following call to do_git_save will potentially have incorrect information about the cache validity of the dives in the divelist. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26git save: remove redundant 'subsurface' from commit messageGravatar Dirk Hohndel
The user agent string already contains the (correctly capitalized) program name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26git storage: print the actual errorGravatar Dirk Hohndel
It seems silly to not show what git told us went wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26cloudstorage: handle invalid PIN correctlyGravatar Dirk Hohndel
If the server tells us that the PIN is invalid, we need to continue to ask for a PIN. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26Remove bogus member that hides global variableGravatar Dirk Hohndel
Inexplicably, commit 8b7427c56d ("Move CloudStorage out of the widgets") didn't just move the code but added a local member 'verbose' that hides our global variable... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26Desktop UI: notify user if they need to enter a cloud PINGravatar Dirk Hohndel
This will need to be merged / cleaned up once the git storage fixes have been merged. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26Don't show error if cloud credentials aren't set upGravatar Dirk Hohndel
This became rather obvious with the change to immediately show errors. The commit also fixes a small memory leak. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26Set error callback helperGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26Move error reporting into its own source fileGravatar Dirk Hohndel
This doesn't really seem to belong in save_git.c. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-20Silence random warningsGravatar Dirk Hohndel
None of these seem to point to actual issues, so let's quiet them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-20Do not overwrite start and end pressures on cylinderGravatar Miika Turkia
The pressure information of cylinder should be kept intact when copy-pasting other cylinder related information from other dive. According to Dirk, the gas mix is wanted to be changed as technical divers might have always the same multiple cylinders and wish to copy the gasmix information over. Fixes #689 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-10-20Don't show localization warning unless verboseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>