Ref T27, store flight plan remarks in VATSIM reader

This can be used in airspace monitor
This commit is contained in:
Klaus Basan
2017-06-25 19:45:10 +02:00
committed by Mathew Sutcliffe
parent 39bd8aa2bb
commit 042f725e54
4 changed files with 49 additions and 21 deletions

View File

@@ -103,7 +103,7 @@ namespace BlackCore
this->connect(sApp->getWebDataServices()->getBookingReader(), &CVatsimBookingReader::atcBookingsReadUnchanged, this, &CAirspaceMonitor::onReadUnchangedAtcBookings);
}
if (sApp->getWebDataServices()->getVatsimDataFileReader())
if (this->supportsVatsimDataFile())
{
this->connect(sApp->getWebDataServices()->getVatsimDataFileReader(), &CVatsimDataFileReader::dataFileRead, this, &CAirspaceMonitor::onReceivedDataFile);
}
@@ -305,6 +305,14 @@ namespace BlackCore
return plan;
}
QString CAirspaceMonitor::tryToGetFlightPlanRemarks(const CCallsign &callsign) const
{
if (callsign.isEmpty()) { return ""; }
if (m_flightPlanCache.contains(callsign)) { return m_flightPlanCache[callsign].getRemarks(); }
if (this->supportsVatsimDataFile()) { return sApp->getWebDataServices()->getVatsimDataFileReader()->getFlightPlanRemarksForCallsign(callsign); }
return "";
}
CUserList CAirspaceMonitor::getUsers() const
{
CUserList users;
@@ -1293,6 +1301,11 @@ namespace BlackCore
return this->m_network && this->m_network->isConnected();
}
bool CAirspaceMonitor::supportsVatsimDataFile() const
{
return sApp && sApp->getWebDataServices() && sApp->getWebDataServices()->getVatsimDataFileReader();
}
CLength CAirspaceMonitor::calculateDistanceToOwnAircraft(const CAircraftSituation &situation) const
{
CLength distance = getOwnAircraft().calculateGreatCircleDistance(situation);