mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
Ref T270, fixed provider so signals are correctly emitted
This commit is contained in:
@@ -232,6 +232,8 @@ namespace BlackMisc
|
|||||||
BLACK_VERIFY_X(situationList.isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "wrong sort order");
|
BLACK_VERIFY_X(situationList.isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "wrong sort order");
|
||||||
BLACK_VERIFY_X(situationList.size() <= IRemoteAircraftProvider::MaxSituationsPerCallsign, Q_FUNC_INFO, "Wrong size");
|
BLACK_VERIFY_X(situationList.size() <= IRemoteAircraftProvider::MaxSituationsPerCallsign, Q_FUNC_INFO, "Wrong size");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit this->addedAircraftSituation(situation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRemoteAircraftProvider::storeAircraftParts(const CCallsign &callsign, const CAircraftParts &parts, bool removeOutdated)
|
void CRemoteAircraftProvider::storeAircraftParts(const CCallsign &callsign, const CAircraftParts &parts, bool removeOutdated)
|
||||||
@@ -266,6 +268,22 @@ namespace BlackMisc
|
|||||||
const int c = situationList.adjustGroundFlag(parts);
|
const int c = situationList.adjustGroundFlag(parts);
|
||||||
if (c > 0) { m_situationsLastModified[callsign] = ts; }
|
if (c > 0) { m_situationsLastModified[callsign] = ts; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update aircraft
|
||||||
|
{
|
||||||
|
QWriteLocker l(&m_lockAircraft);
|
||||||
|
const int c = m_aircraftInRange.setAircraftPartsSynchronized(callsign, parts);
|
||||||
|
Q_UNUSED(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
// update parts
|
||||||
|
{
|
||||||
|
// aircraft supporting parts
|
||||||
|
QWriteLocker l(&m_lockParts);
|
||||||
|
m_aircraftWithParts.insert(callsign); // mark as callsign which supports parts
|
||||||
|
}
|
||||||
|
|
||||||
|
emit this->addedAircraftParts(callsign, parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRemoteAircraftProvider::storeAircraftParts(const CCallsign &callsign, const QJsonObject &jsonObject, int currentOffset)
|
void CRemoteAircraftProvider::storeAircraftParts(const CCallsign &callsign, const QJsonObject &jsonObject, int currentOffset)
|
||||||
@@ -307,21 +325,6 @@ namespace BlackMisc
|
|||||||
// store part history (parts always absolute)
|
// store part history (parts always absolute)
|
||||||
this->storeAircraftParts(callsign, parts, false);
|
this->storeAircraftParts(callsign, parts, false);
|
||||||
|
|
||||||
// update aircraft
|
|
||||||
{
|
|
||||||
QWriteLocker l(&m_lockAircraft);
|
|
||||||
const int c = m_aircraftInRange.setAircraftPartsSynchronized(callsign, parts);
|
|
||||||
Q_UNUSED(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
// update parts
|
|
||||||
{
|
|
||||||
// aircraft supporting parts
|
|
||||||
QWriteLocker l(&m_lockParts);
|
|
||||||
m_aircraftWithParts.insert(callsign); // mark as callsign which supports parts
|
|
||||||
}
|
|
||||||
emit this->addedAircraftParts(callsign, parts);
|
|
||||||
|
|
||||||
// history
|
// history
|
||||||
if (this->isAircraftPartsHistoryEnabled())
|
if (this->isAircraftPartsHistoryEnabled())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user