aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2017-09-28Save Subsurface version to libdivecomputer logfileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-28Planner prefs: set all ascent rates to 9m/minGravatar Rick Walsh
9m/min (or 10m/min) is the ascent rate assumed by Buhlmann and navy tables, and the default of most other planning software and dive computers. Setting the default to 9m/min allows the default behaviour to be consistent with "expected" behaviour, but does not prevent the user from changing the preference. There is disagreement between some users whether the final ascent ascent duration should be considered when determining the length of the final stop. This change does not alter that at all, but at 9m/min, the difference is <1min. See #592 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-09-22BLE: big writes to connected DC (OSTC firmware)Gravatar Jan Mulder
Most writes to a connected DC are small, typically some command bytes to get DC in download mode, or to set some parameter. All this just worked over BLE, however, sending a full firmware update (on an OSTC device) failed, as the underlying BLE interface can only handle small 20 byte BLE packets at once. So, send max ble->packet_size chuncks at once. Tested for the following cases (linux desktop with OSTC3 over BLE): 1) normal download of dive data. 2) read and write settings from configure UI 3) update firmware (from 2.15 to 2.15) And to my surprise, no flow control credit administration is required here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-20BLE support: simplify write functionGravatar Dirk Hohndel
It seems clearer to bail when list is empty... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-20DC download: fix 'no new dives' messageGravatar Dirk Hohndel
Stupidly, commit 731d9dc9bdf ("DC download: tell user when no new dives were found") was missing the conditional when to show that messages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-20Remove option to apply GFlow at maxdepthGravatar Robert C. Helling
This option should have never been there. This is not how gradient factors are supposed to work. It would only trick users to use the wrong value.. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-09-20Add a checkbox to turn off plan variationsGravatar Robert C. Helling
... as those come with a performance penalty Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-09-20Correct comment for deco subsurface_conservatism_factorGravatar Stefan Fuchs
This adapts the comment according to the change done in bd89e33e765d73aa2b48419031d6922b8bf5eb37 Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-17BLE on non-Apple OSs: switch back to using BT addressGravatar Dirk Hohndel
While this interface is deprecated, too much in our existing code depends on being able to create the QLowEnergyController with just the address. Additionally, createCentral() is new in Qt 5.7 and therefor this broke builds on Linux distros that are still on 5.6. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17DC download: tell user when no new dives were foundGravatar Dirk Hohndel
Otherwise it almost looks like something went wrong with the download. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17BLE: try to pick the correct descriptor to write toGravatar Dirk Hohndel
The ordering on Mac appears to be random, but after looking through the various successful logs of BLE downloads, it seems we always wrote to the ClientCharacteristicConfiguration descriptor. So try to find that one first, and only grab the first descriptor in the list if we didn't find a ClientCharacteristicConfiguration descriptor. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17BLE: create controller from QBtDeviceInfoGravatar Dirk Hohndel
Creating it from an address is a) deprecated and b) impossible on Mac or iOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17BLE: helper function to get QBtDeviceInfo from UUIDGravatar Dirk Hohndel
Right now this will only work if you scan for your BLE dive computer every time. Ideally we should simply initiate a scan and look for that address if it's not found in the hash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17BLE: if there's no address, use the UUID insteadGravatar Dirk Hohndel
This is not just for IOS, the same applies on a Mac. But I see no issue with enabling that for all OSs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15Use dive ID instead of dive number when importing from Shearwater dbGravatar Seppo Takalo
Dive IDs are unique but same dive number can appear multiple times within the same database. This can happen for example when user changes the "next log number" from his computer. Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-15Convert usage of atof() to strtod_flags()Gravatar Seppo Takalo
The provided strod_flags(str, 0, 0) should work as a drop in replacement for atof() but does not care about locales which may cause atof() to fail. strtod_flags() would allow checking of conversion result, but I did not change the existing logic. This was just regexp search&replace change to get rid of atof(). I use flags 0 to get more relaxed conversion. Fixes #574 Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-15Properly clear sensor pressure data for synthetic plotinfo entriesGravatar Linus Torvalds
We only cleared the first sensor data when we created new synthetic plot info entries, because we only used to have one (well, we had the o2 data, but apparently nobody ever noticed that it didn't get properly interpolated, probably because people who have CCR dives with o2 pressures are few, and the pressure drops are gradual anyway). Clear all the pressure data, so that the interpolation code doesn't think we have some existing real sensor data for the plot info entries in between proper sample entries. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15xml: save the right sensor pressure when we have multiple sensor readingsGravatar Linus Torvalds
The XML saving code got the multi-sensor case completely wrong, because it still had one place where it would always save the first pressure, rather than the pressure from the right sensor. This was hidden by the fact that old data would be saved using the legacy model that only ever used the first sensor slot. Only if you actually had multiple sensor slots used would the bug trigger. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-14Refine cylinder usage testsGravatar Miika Turkia
Consider cylinder used also if the first and last sample pressure differ enough Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-13Make the info window show all the pressures we haveGravatar Linus Torvalds
We used to only show the first pressure we had, from back when we only supported a single sensor. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-13Detect dive mode on Shearwater DB importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-13Don't assume CCR mode when importing from ShearwaterGravatar Seppo Takalo
Logic was assuming CCR mode if field "averagePPO2" was present. Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-13Fix cylinder changes when importing from Shearwater databaseGravatar Seppo Takalo
Re-do the logic to use add_gas_switch_event() instead of creating event manually. Fix the SQL query to find the proper dive id from dive log number. Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-13Fix Shearwater cylinder detection logicGravatar Seppo Takalo
Fix the SQL query to find proper dive id instead of assuming log number to be the same as id. Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-13Ignore missing pressure values when importing from ShearwaterGravatar Seppo Takalo
Shearwater seems to report missing AI sensors as a pressure reading 4092 (raw) which is 564 bar. Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-11Inform user if there was no dive profile in DL7/ZXU fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-11Import dive number from DL7 logGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-11Do not merge dives with zero durationGravatar Miika Turkia
As these are probably manually entered dives with incomplete data, it is better not to merge them. See #561 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-11Do not save non-existent timeGravatar Miika Turkia
Note that git storage still encodes the time into file name. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-11Do not save duration if it is zeroGravatar Miika Turkia
See #561
2017-09-11Do not save heartbeat to XML if it has not changedGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-11Do not save bearing to XML if it has not changedGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-06Add Cochran dive computers to FTDI listGravatar Dirk Hohndel
Based on information from John Van Ostrand <john@vanostrand.com>. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-06Implemented serial_set_break for FTDIGravatar John Van Ostrand
Setting break is required to wake up Cochran DCs (it doesn't make sense to me, but it's needed). Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-06Changed serial_ftdi flush to a reset if DC_DIRECTION_ALLGravatar John Van Ostrand
The USB reset flushes both buffers, but it also solves a problem waking up a Cochran DCs. Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-06Changed backoff strategy for short reads.Gravatar John Van Ostrand
Back off was exponential starting at 10ms, which for high baud rate and no flow-control connections might cause buffer overrun. This was causing problems when reading Cochran DCs, the hearbeat byte was being missed. Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-04Unify credential statesGravatar Jan Mulder
Having two different enums around with more or less the same definition has lead to unclear code. After removing two not needed states on the mobile end, the remaining step to one enum for the credential state becomes almost is simple rename operation. Unfortunately, I do not know a way to embed a plain C enum from pref.h into the QMLManager object. So after this, there are still 2 enums around, but now identical. This commit is not changing any functionality. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-08-29adding comments as advisedGravatar Marc Arndt
2017-08-29fixing indentationGravatar Marc Arndt
2017-08-29Ignore Divesoft Button Press EventsGravatar Marc Arndt
Prevent button press events from showing on the profile graph when we import divesoft DLF files. Reported-by: Marc Arndt Signed-off-by: Marc Arndt <marc@marcarndt.com>
2017-08-29Show variations in Runtime stringGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Compute variations of plansGravatar Robert C. Helling
Print out partial derivatives of stop times with respect to variation of depth and duratin of last manual segment. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Store a table of deco stops in plannerGravatar Robert C. Helling
... in addition to struct diveplan which combines all kinds of information Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Cache all Buehlmann factorsGravatar Robert C. Helling
not just the last one. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Allow for o2 breaks in binary search stop time finderGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Find deco stop time by binary search instead of iterationGravatar Robert C. Helling
This allows to go to much smaller granularity without severe performance penalty. It should also increase performance for long decompression times. Currently this leads to missing cached tissue factors, the caching has to be adopted to this. Also, for the time being this breaks the bottom gas breaks feature. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Make plan take dive and decotimestep as argumentsGravatar Robert C. Helling
...rather than use a global variable and a macro. This should be a no-op in preparation to allow planning several versions of a dive. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-29Change color to red if minimum gas is violated.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-26Another signed/unsigned warningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-26Adjust signature to match data we needGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>