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>
For some reason the progress bar on macOS doesn't show the
progress text. This creates a label below the progress bar
and shows the text there instead.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Especially on BT/BLE devices, where there is a longer negotiation
phase at the beginning of the download, this seems more user friendly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
Following on beb0d5703a, the context menu seems to work fine
with a much older QtQuick import - version 2.0.
The 2.7 import is technically a development leftover
and a minimal version should have been considered earlier.
On older Qt setups (e.g. 5.5.x) this might throw a:
'module "QtQuick" version 2.6 is not installed'
Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Go back to the old startegy of retrieving the correct end of the dive
plot by looking at the plot data instead of looking at dc->duration.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Meanwhile (after removing marble) it seems to be a good choice to use
latest MXE version with currently Qt 5.9.1.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
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>
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>
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>
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>
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>
When Linus modified the gas handling code six weeks ago he pointed out
that that had broken the tankbar; with this patch we now simply walk the
gas changes of the displayed dive directly and create the tankbar
rectangles from that information.
See #562
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>