mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
refactor: Remove airport view
This commit is contained in:
@@ -634,8 +634,6 @@ namespace swift::core
|
||||
{
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this,
|
||||
&ISimulator::onSwiftDbAllDataRead, Qt::QueuedConnection);
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAirportsRead, this,
|
||||
&ISimulator::onSwiftDbAirportsRead, Qt::QueuedConnection);
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbModelMatchingEntitiesRead, this,
|
||||
&ISimulator::onSwiftDbModelMatchingEntitiesRead, Qt::QueuedConnection);
|
||||
}
|
||||
@@ -751,26 +749,6 @@ namespace swift::core
|
||||
return r;
|
||||
}
|
||||
|
||||
CAirportList ISimulator::getWebServiceAirports() const
|
||||
{
|
||||
if (this->isShuttingDown()) { return {}; }
|
||||
if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; }
|
||||
return sApp->getWebDataServices()->getAirports();
|
||||
}
|
||||
|
||||
CAirport ISimulator::getWebServiceAirport(const CAirportIcaoCode &icao) const
|
||||
{
|
||||
if (this->isShuttingDown()) { return {}; }
|
||||
if (!sApp || sApp->isShuttingDown() || !sApp->hasWebDataServices()) { return {}; }
|
||||
return sApp->getWebDataServices()->getAirports().findFirstByIcao(icao);
|
||||
}
|
||||
|
||||
int ISimulator::maxAirportsInRange() const
|
||||
{
|
||||
// might change in future or become a setting or such
|
||||
return 20;
|
||||
}
|
||||
|
||||
void ISimulator::onSwiftDbAllDataRead()
|
||||
{
|
||||
// void, can be overridden in specialized drivers
|
||||
@@ -781,11 +759,6 @@ namespace swift::core
|
||||
// void, can be overridden in specialized drivers
|
||||
}
|
||||
|
||||
void ISimulator::onSwiftDbAirportsRead()
|
||||
{
|
||||
// void, can be overridden in specialized drivers
|
||||
}
|
||||
|
||||
void ISimulator::initSimulatorInternals()
|
||||
{
|
||||
const CSpecializedSimulatorSettings s = this->getSimulatorSettings();
|
||||
@@ -887,23 +860,6 @@ namespace swift::core
|
||||
return m_loopbackSituations.value(callsign);
|
||||
}
|
||||
|
||||
CAirportList ISimulator::getAirportsInRange(bool recalculateDistance) const
|
||||
{
|
||||
// default implementation
|
||||
if (this->isShuttingDown()) { return {}; }
|
||||
if (!sApp || !sApp->hasWebDataServices()) { return {}; }
|
||||
|
||||
const CAirportList airports = sApp->getWebDataServices()->getAirports();
|
||||
if (airports.isEmpty()) { return airports; }
|
||||
const CCoordinateGeodetic ownPosition = this->getOwnAircraftPosition();
|
||||
CAirportList airportsInRange = airports.findClosest(maxAirportsInRange(), ownPosition);
|
||||
if (recalculateDistance)
|
||||
{
|
||||
airportsInRange.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftPosition());
|
||||
}
|
||||
return airportsInRange;
|
||||
}
|
||||
|
||||
CAircraftModel ISimulator::reverseLookupModel(const CAircraftModel &model)
|
||||
{
|
||||
bool modified = false;
|
||||
|
||||
Reference in New Issue
Block a user