summaryrefslogtreecommitdiffstats
path: root/subsurface-core/gpslocation.cpp
AgeCommit message (Collapse)Author
2016-01-22Avoid precision loss on GPS fixesGravatar Dirk Hohndel
It appears that the Qt documentation might be incorrect. It claims that the precision value is digits after the decimal point, but we have seen examples where the values posted to the server appear to have a total of 6 digits, including the digits ahead of the decimal point. Upping this to 9 shouldn't hurt if Qt gets fixed, but should work around the issue reported by a tester. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11Remove excessive debugging outputGravatar Dirk Hohndel
Now that GPS tracking seems fairly stable, let's quiet down the chatter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-11GPS data: create divesite when missing for applied GPS dataGravatar Dirk Hohndel
Otherwise things will of course crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10Compile fix for older compilersGravatar Dirk Hohndel
Not every compiler supports non-trivial initializers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10QML UI: refresh divelist after GPS data was successfully appliedGravatar Dirk Hohndel
And create a helper to do so to make the code simpler. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10GPS data: if deleting on server fails, remember to try againGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10GPS data: don't try to track what's uploadedGravatar Dirk Hohndel
This has been the cause of issues in several cases. We should simply always try to push all data to the server - it deals with redundant uploads quite nicely. (previous commits already stopped responding to this flag, this simply removes all mention of it) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10GPS data: delete fixes on the serverGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10GPS data: more fixesGravatar Dirk Hohndel
- load the data from settings as we start - improve upload to server - keep settings and in memory model in sync Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10Reimplement the internal repesentation of GPS fixesGravatar Dirk Hohndel
Instead of using the Settings as our data structure and constantly accessing them, we now have a QMap for the GPS fixes and only access the Settings to keep them in sync with the QMap. This should significantly speed things up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08QML UI: partial, slow and incomplete implementation of delete GPS fixGravatar Dirk Hohndel
This only deletes the fix on the mobile device, not on the server. And it is really really slow. Re-reading the data from the settings just isn't a smart way to do this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08Untangle Library LinkageGravatar Tomaz Canabrava
with the adittion of gpslistmodel/location, the libraries qt-models had a direct dependency on subsurface-core, and subsurface-core had a direct dependency on qt-models, this is bad. Moving a bit of code around I'v managed to clean this out, and also to clear a bit of uneeded code (GpsTracker and gpsTracker where basically the same thing.) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Compile fixGravatar Dirk Hohndel
This makes the desktop version compile again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Compile fixGravatar Dirk Hohndel
While the conversion of uint64_t to QVariant works fine with some Qt / compiler combinations, it fails on others. Use Qt's type instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Correctly adjust time stamp of GPS fixesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Populate the model with the GPS fixesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Download gps locations in the mobile appGravatar Dirk Hohndel
This is not the same as the existing download to apply the gps fixes to the dive list. This allows us to download and store the GPS fixes in the settings. I may end up changing things around to have a shared implementation for downloading the GPS fixes, but for now this seemed easier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Create GpsListModel in order to be able to display GPS fixesGravatar Dirk Hohndel
This will allow us to visualize the GPS fixes that are currently stored in the QML UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01Location service: get the current positionGravatar Dirk Hohndel
If we have a fix that is fewer than 5 minutes old, take it, otherwise trigger an update. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01Location service: support the concept of waiting for a positionGravatar Dirk Hohndel
There may be reasons where we want to get the position even if the criteria aren't met. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01Location service: restructure the way GpsSource is managedGravatar Dirk Hohndel
It makes much more sense to have this as a private member of the class instead of a static in one of the functions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-19Don't complain about missing GPS source unless mobileGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02Add instance method for GpsLocationGravatar Dirk Hohndel
This way we can call members from different parts of the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30Subsurface-mobile: don't create the GPS source until it is neededGravatar Dirk Hohndel
This should accelerate the startup of the UI a little more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18applyLocations should be a void functionGravatar Dirk Hohndel
Another issue pointed out by Lubomir. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18gpslocation.cpp: fix signed vs unsinged int comparison warningGravatar Lubomir I. Ivanov
QDateTime::toTime_t() is misleading as it does not return a C time_t type, but a 'unsigned int' or rather the Qt 'uint' typedef. To prevent the warning we cast it to 'time_t' and to comply with the 'lastTime' variable. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: when applying GPS locations mark divelist changedGravatar Dirk Hohndel
Lubomir pointed out that this variable was unused. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: check presence of location sourceGravatar Dirk Hohndel
In theory this should only report a location service if this is a satellite based service, but sadly geoclue appears to claim that there is a satellite based service in my Linux VM - so I'm doubtful that this does what the documentation says it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: move into subsurface-coreGravatar Dirk Hohndel
While this is primarily something targeted at a mobile device, with many of the 2 in 1 devices it is possible that the user might be running the desktop version of Subsurface on a mobile device. As a first step to make it possible to collect GPS fixes on such a device we need to make the infrastructure to do so available in the desktop application as well. This still needs to be hooked up in the desktop UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>