Ref T171, Ref T136, check remote aircraft provider calls for connection

This commit is contained in:
Klaus Basan
2017-10-11 01:40:07 +02:00
parent bc5f431953
commit 32398ce90a
2 changed files with 34 additions and 4 deletions

View File

@@ -59,10 +59,10 @@ namespace BlackCore
m_remoteAircraftProviderConnections.append(
m_remoteAircraftProvider->connectRemoteAircraftProviderSignals(
this, // receiver must match object in bind
std::bind(&CSimulatorCommon::onRemoteProviderAddedAircraftSituation, this, std::placeholders::_1),
std::bind(&CSimulatorCommon::onRemoteProviderAddedAircraftParts, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&CSimulatorCommon::onRemoteProviderRemovedAircraft, this, std::placeholders::_1),
std::bind(&CSimulatorCommon::onRecalculatedRenderedAircraft, this, std::placeholders::_1))
std::bind(&CSimulatorCommon::rapOnRemoteProviderAddedAircraftSituation, this, std::placeholders::_1),
std::bind(&CSimulatorCommon::rapOnRemoteProviderAddedAircraftParts, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&CSimulatorCommon::rapOnRemoteProviderRemovedAircraft, this, std::placeholders::_1),
std::bind(&CSimulatorCommon::rapOnRecalculatedRenderedAircraft, this, std::placeholders::_1))
);
// timer
@@ -560,4 +560,28 @@ namespace BlackCore
if (!sApp->hasWebDataServices()) { return CAirport(); }
return sApp->getWebDataServices()->getAirports().findFirstByIcao(icao);
}
void CSimulatorCommon::rapOnRecalculatedRenderedAircraft(const CAirspaceAircraftSnapshot &snapshot)
{
if (!this->isConnected()) return;
this->onRecalculatedRenderedAircraft(snapshot);
}
void CSimulatorCommon::rapOnRemoteProviderAddedAircraftSituation(const CAircraftSituation &situation)
{
if (!this->isConnected()) return;
this->onRemoteProviderAddedAircraftSituation(situation);
}
void CSimulatorCommon::rapOnRemoteProviderAddedAircraftParts(const CCallsign &callsign, const CAircraftParts &parts)
{
if (!this->isConnected()) return;
this->onRemoteProviderAddedAircraftParts(callsign, parts);
}
void CSimulatorCommon::rapOnRemoteProviderRemovedAircraft(const CCallsign &callsign)
{
if (!this->isConnected()) return;
this->onRemoteProviderRemovedAircraft(callsign);
}
} // namespace

View File

@@ -219,6 +219,12 @@ namespace BlackCore
static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model);
private:
// remote aircraft provider ("rap") bound
void rapOnRecalculatedRenderedAircraft(const BlackMisc::Simulation::CAirspaceAircraftSnapshot &snapshot);
void rapOnRemoteProviderAddedAircraftSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
void rapOnRemoteProviderAddedAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts);
void rapOnRemoteProviderRemovedAircraft(const BlackMisc::Aviation::CCallsign &callsign);
bool m_blinkCycle = false; //!< used for highlighting
qint64 m_highlightEndTimeMsEpoch = 0; //!< end highlighting
int m_timerCounter = 0; //!< allows to calculate n seconds