mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Default calculation of distance/bearing for airports. Follow up of the discussion in slack/during T125
Summary: Default calculation of distance/bearing for airports. Reviewers: msutcliffe, rwinklmeier Reviewed By: msutcliffe, rwinklmeier Subscribers: jenkins Maniphest Tasks: T125 Differential Revision: https://dev.swift-project.org/D48
This commit is contained in:
committed by
Mathew Sutcliffe
parent
73556492fd
commit
2b3b173b76
@@ -255,11 +255,14 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
// default implementation
|
// default implementation
|
||||||
if (!sApp || !sApp->hasWebDataServices()) { return CAirportList(); }
|
if (!sApp || !sApp->hasWebDataServices()) { return CAirportList(); }
|
||||||
|
if (sApp->isShuttingDown()) { return CAirportList(); }
|
||||||
|
|
||||||
const CAirportList airports = sApp->getWebDataServices()->getAirports();
|
CAirportList airports = sApp->getWebDataServices()->getAirports();
|
||||||
if (airports.isEmpty()) { return airports; }
|
if (airports.isEmpty()) { return airports; }
|
||||||
const CCoordinateGeodetic ownPosition = this->getOwnAircraftPosition();
|
const CCoordinateGeodetic ownPosition = this->getOwnAircraftPosition();
|
||||||
return airports.findClosest(maxAirportsInRange(), ownPosition);
|
airports = airports.findClosest(maxAirportsInRange(), ownPosition);
|
||||||
|
if (m_autoCalcAirportDistance) { airports.calculcateAndUpdateRelativeDistanceAndBearing(ownPosition); }
|
||||||
|
return airports;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorCommon::setWeatherActivated(bool activated)
|
void CSimulatorCommon::setWeatherActivated(bool activated)
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ namespace BlackCore
|
|||||||
bool showDebugLogMessage() const;
|
bool showDebugLogMessage() const;
|
||||||
|
|
||||||
bool m_pausedSimFreezesInterpolation = false; //!< paused simulator will also pause interpolation (so AI aircraft will hold)
|
bool m_pausedSimFreezesInterpolation = false; //!< paused simulator will also pause interpolation (so AI aircraft will hold)
|
||||||
|
bool m_autoCalcAirportDistance = true; //!< automatically calculate airport distance and bearing
|
||||||
BlackMisc::Simulation::CAircraftModel m_defaultModel; //!< default model
|
BlackMisc::Simulation::CAircraftModel m_defaultModel; //!< default model
|
||||||
int m_statsUpdateAircraftCountMs = 0; //!< statistics update count
|
int m_statsUpdateAircraftCountMs = 0; //!< statistics update count
|
||||||
qint64 m_statsUpdateAircraftTimeTotalMs = 0; //!< statistics update time
|
qint64 m_statsUpdateAircraftTimeTotalMs = 0; //!< statistics update time
|
||||||
|
|||||||
Reference in New Issue
Block a user