Show fixes compass only when it's declared in settings.ini

This commit is contained in:
vng 2012-10-17 02:13:56 +03:00 committed by Alex Zolotarev
parent 3fbefffaff
commit 9d5777dee6
2 changed files with 10 additions and 5 deletions

View file

@ -103,11 +103,14 @@ void Framework::OnLocationUpdate(location::GpsInfo const & info)
// pretend like GPS position
rInfo.m_horizontalAccuracy = 5.0;
// pass compass value (for devices without compass)
location::CompassInfo compass;
compass.m_magneticHeading = compass.m_trueHeading = 0.0;
compass.m_timestamp = rInfo.m_timestamp;
OnCompassUpdate(compass);
if (m_fixedPos.HasNorth())
{
// pass compass value (for devices without compass)
location::CompassInfo compass;
compass.m_magneticHeading = compass.m_trueHeading = 0.0;
compass.m_timestamp = rInfo.m_timestamp;
OnCompassUpdate(compass);
}
#else
location::GpsInfo const & rInfo = info;

View file

@ -61,7 +61,9 @@ class Framework
void GetLat(double & l) const { if (m_fixedLatLon) l = m_latlon.first; }
void GetLon(double & l) const { if (m_fixedLatLon) l = m_latlon.second; }
void GetNorth(double & n) const { if (m_fixedDir) n = m_dirFromNorth; }
bool HasNorth() const { return m_fixedDir; }
} m_fixedPos;
#endif