mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T27, store flight plan remarks in VATSIM reader
This can be used in airspace monitor
This commit is contained in:
committed by
Mathew Sutcliffe
parent
39bd8aa2bb
commit
042f725e54
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user