Ref T322, in airspace monitor update ATC station distance

This commit is contained in:
Klaus Basan
2018-09-03 13:46:20 +02:00
committed by Roland Winklmeier
parent be6ae734a0
commit fa3555b792
2 changed files with 23 additions and 0 deletions

View File

@@ -185,6 +185,18 @@ namespace BlackCore
return CFlightPlanRemarks();
}
CAtcStationList CAirspaceMonitor::getAtcStationsOnlineRecalculated()
{
m_atcStationsOnline.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation());
return m_atcStationsOnline;
}
CAtcStationList CAirspaceMonitor::getAtcStationsBookedRecalculated()
{
m_atcStationsBooked.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation());
return m_atcStationsBooked;
}
CUserList CAirspaceMonitor::getUsers() const
{
CUserList users;
@@ -439,6 +451,8 @@ namespace BlackCore
m_atcStationsBooked = newBookedStations;
}
m_bookingsRequested = false; // we already emit here
m_atcStationsBooked.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation());
emit this->changedAtcStationsBooked(); // all booked stations reloaded
}
@@ -547,6 +561,9 @@ namespace BlackCore
// subsequent queries
this->sendInitialAtcQueries(callsign);
// update distances
m_atcStationsOnline.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftSituation());
emit this->changedAtcStationsOnline();
// Remark: this->changedAtcStationOnlineConnectionStatus
// will be sent in psFsdAtisVoiceRoomReceived

View File

@@ -97,9 +97,15 @@ namespace BlackCore
//! Returns the current online ATC stations (consolidated with booked stations)
BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const { return m_atcStationsOnline; }
//! Recalculate distance to own aircraft
BlackMisc::Aviation::CAtcStationList getAtcStationsOnlineRecalculated();
//! Returns the current booked ATC stations (consolidated with online stations)
BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const { return m_atcStationsBooked; }
//! Recalculate distance to own aircraft
BlackMisc::Aviation::CAtcStationList getAtcStationsBookedRecalculated();
//! Returns the closest ATC station operating on the given frequency, if any
BlackMisc::Aviation::CAtcStation getAtcStationForComUnit(const BlackMisc::Aviation::CComSystem &comSystem) const;