Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gps] Correctly set initial value of hoz/vert accuracy and direction …
…as not available

(cherry picked from commit d182cf2)
  • Loading branch information
nyalldawson authored and nirvn committed Dec 6, 2019
1 parent c396c0b commit d7dd190
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions python/core/auto_generated/gps/qgsgpsconnection.sip.in
Expand Up @@ -40,7 +40,9 @@ struct QgsGpsInformation
double pdop;
double hdop;
double vdop;
//! Horizontal accuracy in meters
double hacc;
//! Vertical accuracy in meters
double vacc;
QDateTime utcDateTime;
QChar fixMode;
Expand Down
19 changes: 16 additions & 3 deletions src/core/gps/qgsgpsconnection.h
Expand Up @@ -55,13 +55,26 @@ struct CORE_EXPORT QgsGpsInformation
double longitude = 0;
double elevation = 0;
double speed = 0; //in km/h
double direction = 0;
#ifndef SIP_RUN
double direction = std::numeric_limits< double >::quiet_NaN();
#else
double direction;
#endif
QList<QgsSatelliteInfo> satellitesInView;
double pdop = 0;
double hdop = 0;
double vdop = 0;
double hacc = -1; //horizontal accuracy in meters
double vacc = -1; //vertical accuracy in meters
#ifndef SIP_RUN
//! Horizontal accuracy in meters
double hacc = std::numeric_limits< double >::quiet_NaN();
//! Vertical accuracy in meters
double vacc = std::numeric_limits< double >::quiet_NaN();
#else
//! Horizontal accuracy in meters
double hacc;
//! Vertical accuracy in meters
double vacc;
#endif
QDateTime utcDateTime;
QChar fixMode;
int fixType = 0; // valid values: 1,2,3
Expand Down

0 comments on commit d7dd190

Please sign in to comment.