Reset missing position data if missing - #4670
Conversation
Coverage Report for CI Build 32851747166Warning No base build found for commit Coverage: 59.096%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
📦 Build Artifacts Ready
|
| const bool hasHacc = localPosition.hasAttribute( QGeoPositionInfo::HorizontalAccuracy ); | ||
| if ( hasHacc && !qgsDoubleNear( localPosition.attribute( QGeoPositionInfo::HorizontalAccuracy ), mLastPosition.hacc ) ) | ||
| const double newHorizontalAccuracy = localPosition.hasAttribute( QGeoPositionInfo::HorizontalAccuracy ) ? | ||
| localPosition.attribute( QGeoPositionInfo::HorizontalAccuracy ) : std::numeric_limits<double>::quiet_NaN();; |
There was a problem hiding this comment.
The double semicolon might be a typo. Same on line 217
| if ( hasSpeedInfo && !qgsDoubleNear( localPosition.attribute( QGeoPositionInfo::GroundSpeed ), mLastPosition.speed ) ) | ||
| const double newSpeed = localPosition.hasAttribute( QGeoPositionInfo::GroundSpeed ) ? | ||
| localPosition.attribute( QGeoPositionInfo::GroundSpeed ) * 3.6 : std::numeric_limits<double>::quiet_NaN(); // convert from m/s to km/h | ||
| if ( !qgsDoubleNear( newSpeed, mLastPosition.speed ) ) |
There was a problem hiding this comment.
If both of these will be NaN, thats always false no? I think qgsDoubleNear won't ever return true if it is comparing NaN values. So it goes through even when it shouldn't and forces positionDataHasChanged to true. The attributes stay missing though and this stays like that on every consecutive update right? Is that intended? Same applies to other if statements bellow
This fixes issue where stale/untrue position data is shown to users if the data is missing from newer position update. We will clear the data now.