aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-06-12Android BT: fix compile bugGravatar Jan Mulder
One Andorid JNI include was missing. And removed the unused ones from QMLManager. [Dirk Hohndel: I had added the missing include elsewhere, so this commit now only has the removal of the unused includes] Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12QML UI: call correct function for BT addressGravatar Jan Mulder
After the recent refactoring of QMLManager to btdiscovery, the manager.getBtAddress() got superseeded by downloadThread.data().getDetectedDeviceAddress(). Corrected this here. Futher some debug output is modified, so that it report the proper function names. This corrects the download from an automatically detected OSTC 3. Manul selection of the same device from the fake vendor "Paired BT Devices" does not work, however. Still work to be done in that area. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12QML UI: do not crash on selecting dive computersGravatar Jan Mulder
For reasons unknown to me, the DCDeviceData instance was freed way too early, and used afterwards, obviously resulting in a SIGSEGV. This commit creates the DCDeviceData as a direct child of the QMLManager instance, ensuring it does not get freed prematurely. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12Download dialog showed time incorrectlyGravatar Miika Turkia
The used time format was h:mh: i.e. 1:16h: This patch gets rid of the colon after the hour indicator. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-06-11qthelper.cpp: leave lbs rounding to QString().arg() with 'f'Gravatar Lubomir I. Ivanov
The following call in weight_string(): str = QString("%1").arg(lbs, 0, 'f', lbs >= 40.0 ? 0 : 1); will make values in lbs larger or equal to 40 to have no fractional part and be rounded to nearest, while values less than 40 will have one decimal place. fixes #412 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11TabDiveInformation.cpp: use lrint() for sac.mliter in updateData()Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11simplewidgets.cpp: silence warning about parenthesesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11datatrak.c: don't use POSIX %m format for sscanf() in dtrak_prepare_data()Gravatar Lubomir I. Ivanov
The format option "%m" doesn't work for MINGW/Windows and is reported as an unknown conversation type and this sscanf() call would not work. The alternative is to malloc() enough space manually - e.g. strlen(input) + 1. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11Android build fixGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11Fix a few warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11smtk2ssrf-mxe-build.sh: add a flag for git repoGravatar Salvador Cuñat
Previous script would fail on git folders that pull from more than one repo. That's not a general case, but pretty usual for developers pulling/pushing to github. BTW in this cases, a lind git pull doesn't ensure we are pulling from the right repo. When run without flag, default to pull --rebase. At the same time introduce a tiny func to return a message and bail out after some command failures.
2017-06-11QML UI: move BT handling into core codeGravatar Dirk Hohndel
This shouldn't be part of the UI (qmlmanager), but part of our overall handling of dive computers and BT devices. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11QML UI: adjust to modified logging APIGravatar Dirk Hohndel
appendTextToLog prepends the elapsed time which can be useful, so let's not remove that but instead have it log to qDebug() instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11Make message handler write to console as wellGravatar Dirk Hohndel
This way we can see the debug output even if the app is hung or crashes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11Add a messageHandler to take care of qDebug & friends on QMLGravatar Tomaz Canabrava
all qDebug / qCDebug and friends now will be properly logged into developer -> log, on QML. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11QML UI: add paired BT devices as vendorGravatar Dirk Hohndel
This way the user can explicitly chose which dive computer they want to download from. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11QML UI: correctly set up the divecomputer for downloadGravatar Dirk Hohndel
If we find a paired BT divecomputer, this will populate vendor and product correctly for that device. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11smtk-import portability: avoid using %m[] in sscanfGravatar Salvador Cuñat
As Lubomir pointed out in his patch for datatrak.c, the format option %m for sscanf doesn't work in mingw/windows. Fortunately it's unnecessary as dates are dropped and we just get times. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-06-11smtk-import: portability: rework non portable funcsGravatar Salvador Cuñat
For different reasons some used functions aren't portable or simply are not included in mingw. This includes index, rindex, strptime, and timegm. A workaround for this is needed, if we want to build for windows using mingw based mxe environment. This patch does: - drops index and rindex in favor of strchr and strrchr - substitute strptime with a sscanf parsing - emulate timegm with a private func smtk_timegm() - remove definitions needed by strptime Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-06-11smtk-import: portability: rename DATEGravatar Salvador Cuñat
DATE happens to be defined in wtypes.h. Redefining it may be a bad idea, so move it to _DATE Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-06-11smtk-import: portability: include windows.hGravatar Salvador Cuñat
Include windows.h if we are cross building to windows Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-06-11Let command line version not open an X windowGravatar Robert C. Helling
So we can run it on a headless system Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-06-11smtk-import: Add mxe cross-building scriptGravatar Salvador Cuñat
Add to packaging/windows an script to build an installer for the importer tool.
2017-06-11smtk-import: add cmake modules and .nsi skeletonGravatar Salvador Cuñat
Needed to crossbuild to windows. The cmake modules are just clones from those under subsurface/cmake/Modules, tweaked to build smtk-import for windows.
2017-06-11smtk-import: Add build script for smtk2ssrfGravatar Salvador Cuñat
Add a bash script to build the linux version of smtk2ssrf tool. It works mostly like build.sh, but have some flags avaliable.
2017-06-11smtk-import: change CMakeLists.txtGravatar Salvador Cuñat
As SmartTrak importer is building separately from Subsurface, a full CMakeLists.txt file is necessary for the smtk-import directory. It includes cross building to windows capability.
2017-06-11CMakeLists.txt: Remove SmartTrak import optionsGravatar Salvador Cuñat
Remove SmartTrak import options from Subsurface's CMakeLists,txt, as a first step to keep the importer apart from the main application.
2017-06-04QML UI: show selection box on the Download from DC listGravatar Tomaz Canabrava
QML and C++ model don't interact too much, a new Rule should be created and used on the QML Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-02Silence compiler warningsGravatar Jan Mulder
Silence some compiler warnings about implicit double to int conversions. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-02Android BT: generalize pairing dataGravatar Jan Mulder
This adds a list of paired BT devices to the QMLManager class. In addition, a very simple implementation is made of getting the paired BT devices on Linux, so that we can test further processing of selecting the proper devices, in a mobile-on-desktop situation. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01Android BT: do not force BT onGravatar Jan Mulder
It is very impolite to force BT on at start of the mobile app. We cannot know if the user is going to import dives over BT. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01Android BT: pull the pairing data from a deviceGravatar Jan Mulder
As Qt is not able to pull the pairing data from a device, a lengthy discovery process is needed to see what devices are paired. On https://forum.qt.io/topic/46075/solved-bluetooth-list-paired-devices user s.frings74 does, however, present a solution to this using JNI. Currently, this code is taken "as is". Currently, only for Android (so not mobile-on-desktop, or even desktop). And only generating logging data in the logcat. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01Enable BT for iOS buildGravatar Robert C. Helling
and add some new source files to .pro file Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-01Use #if defined() instead of #ifGravatar Jan Mulder
qtcreator (4.3.0) got confused whether BT_SUPPORT was defined. Using work as expected. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-05-31Android BT download: hardcode UUIDGravatar Dirk Hohndel
While it seemed logical to use the advertized service UUID that doesn't appear to be working - instead using this hard coded UUID seems to do the trick. I now did a successful download from my Shearwater Petrel. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Cochran import: Removed long tail of 0 depth from profileGravatar John Van Ostrand
The Cochran logs the first 10 to 20 minutes (configurable) of surface interval in case the diver re-submerges. Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Cochran import: better support for older modelsGravatar John Van Ostrand
Older models allowed for configuration sample frequency; This patch adds detection of sample frequency (profile_period) for cochran log file imports. Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Android BT: use NoSecurity for connectionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31QML UI: try to also detect OSTC BT dive computersGravatar Dirk Hohndel
The naming scheme of OSTC dive computers doesn't match their product names, but they all behave the same from a download perspective, so we assume that any BT device that has a name starting with OSTC is an OSTC 3. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Android build script: use interactive SDK installGravatar Dirk Hohndel
And then manually fix the license as that doesn't appear to work correctly in the tool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Android build script: update for Qt 5.9Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Android: connect to BT via uuid instead of portGravatar Dirk Hohndel
We remember the offered service uuids as we detect the device and then try the first one - likely this needs to be fixed / tuned to pick the right one if multiple uuids are offered. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31QML UI: use the BT address of the first dive computer foundGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31QML UI: add getBtAddress functionGravatar Dirk Hohndel
This allows us to get the BT address of the first dive computer that we found. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31Don't override device name when using BTGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-30Import NDL from Shearwater DesktopGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-30Fix Shearwater import pressure dataGravatar Miika Turkia
Apparently recording cylinder pressure in PSI is not the only oddity with Shearwater Desktop. It also records half the value, so doubling the reading here. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-30Import pressure data for tank0 on Shearwater Desktop importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-29FTDI support: add minimal debugging outputGravatar Dirk Hohndel
Copied the libdivecomputer macros for convenience. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29Subsurface-mobile on Android: add USB intent filterGravatar Dirk Hohndel
With this a few FTDI based dive computers should be visible from the app. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>