mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 17:30:12 +08:00
Removed "new aircraft" branch from ICAO codes received, as it is not needed
This commit is contained in:
@@ -23,33 +23,12 @@ namespace BlackCore
|
|||||||
* Aircraft info received
|
* Aircraft info received
|
||||||
*/
|
*/
|
||||||
void CContextNetwork::psFsdIcaoCodesReceived(const CCallsign &callsign, const CAircraftIcao &icaoData)
|
void CContextNetwork::psFsdIcaoCodesReceived(const CCallsign &callsign, const CAircraftIcao &icaoData)
|
||||||
{
|
|
||||||
// this->log(Q_FUNC_INFO, callsign.toQString(), icaoData.toQString());
|
|
||||||
CAircraftList aircraftsWithCallsign = this->m_aircraftsInRange.findByCallsign(callsign);
|
|
||||||
if (aircraftsWithCallsign.isEmpty())
|
|
||||||
{
|
|
||||||
// new aircraft
|
|
||||||
CAircraft aircraft;
|
|
||||||
aircraft.setCallsign(callsign);
|
|
||||||
aircraft.setIcaoInfo(icaoData);
|
|
||||||
aircraft.calculcateDistanceToPlane(this->m_ownAircraft.getPosition());
|
|
||||||
this->m_aircraftsInRange.push_back(aircraft);
|
|
||||||
if (this->isConnected())
|
|
||||||
{
|
|
||||||
// emit only if still connected
|
|
||||||
emit this->m_network->sendFrequencyQuery(callsign);
|
|
||||||
emit this->m_network->sendRealNameQuery(callsign);
|
|
||||||
}
|
|
||||||
emit this->changedAircraftsInRange();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// update
|
// update
|
||||||
CIndexVariantMap vm(CAircraft::IndexIcao, icaoData.toQVariant());
|
CIndexVariantMap vm(CAircraft::IndexIcao, icaoData.toQVariant());
|
||||||
this->m_aircraftsInRange.applyIf(BlackMisc::Predicates::MemberEqual<CAircraft>(&CAircraft::getCallsign, callsign), vm);
|
this->m_aircraftsInRange.applyIf(BlackMisc::Predicates::MemberEqual<CAircraft>(&CAircraft::getCallsign, callsign), vm);
|
||||||
emit this->changedAircraftsInRange();
|
emit this->changedAircraftsInRange();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Aircraft update received
|
* Aircraft update received
|
||||||
|
|||||||
Reference in New Issue
Block a user