mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Query real names for ATC stations again,
so we learn about changed "persons" (i.e. real name) see https://discordapp.com/channels/539048679160676382/632279098244333581/655740912336633868
This commit is contained in:
committed by
Mat Sutcliffe
parent
524a9b3793
commit
b3ad7ccdd9
@@ -115,9 +115,11 @@ namespace BlackCore
|
|||||||
connect(m_analyzer, &CAirspaceAnalyzer::timeoutAircraft, this, &CAirspaceMonitor::onPilotDisconnected, Qt::QueuedConnection);
|
connect(m_analyzer, &CAirspaceAnalyzer::timeoutAircraft, this, &CAirspaceMonitor::onPilotDisconnected, Qt::QueuedConnection);
|
||||||
connect(m_analyzer, &CAirspaceAnalyzer::timeoutAtc, this, &CAirspaceMonitor::onAtcControllerDisconnected, Qt::QueuedConnection);
|
connect(m_analyzer, &CAirspaceAnalyzer::timeoutAtc, this, &CAirspaceMonitor::onAtcControllerDisconnected, Qt::QueuedConnection);
|
||||||
|
|
||||||
// timer
|
// timers
|
||||||
connect(&m_processTimer, &QTimer::timeout, this, &CAirspaceMonitor::process);
|
connect(&m_fastProcessTimer, &QTimer::timeout, this, &CAirspaceMonitor::fastProcessing);
|
||||||
m_processTimer.start(ProcessIntervalMs);
|
connect(&m_slowProcessTimer, &QTimer::timeout, this, &CAirspaceMonitor::slowProcessing);
|
||||||
|
m_fastProcessTimer.start(FastProcessIntervalMs);
|
||||||
|
m_slowProcessTimer.start(SlowProcessIntervalMs);
|
||||||
|
|
||||||
// dot command
|
// dot command
|
||||||
CAirspaceMonitor::registerHelp();
|
CAirspaceMonitor::registerHelp();
|
||||||
@@ -417,14 +419,20 @@ namespace BlackCore
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAirspaceMonitor::process()
|
void CAirspaceMonitor::fastProcessing()
|
||||||
{
|
{
|
||||||
if (this->isConnectedAndNotShuttingDown())
|
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||||
{
|
|
||||||
// only send one
|
// only send one query
|
||||||
const bool send = this->sendNextStaggeredAtisQuery();
|
const bool send = this->sendNextStaggeredAtisQuery();
|
||||||
if (!send) { this->sendNextStaggeredPilotDataQuery(); }
|
if (!send) { this->sendNextStaggeredPilotDataQuery(); }
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAirspaceMonitor::slowProcessing()
|
||||||
|
{
|
||||||
|
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||||
|
this->queryAllOnlineAtcStations();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAirspaceMonitor::clear()
|
void CAirspaceMonitor::clear()
|
||||||
@@ -1299,7 +1307,11 @@ namespace BlackCore
|
|||||||
const CLength maxRange(isVatsim ? 125 : -1, CLengthUnit::NM());
|
const CLength maxRange(isVatsim ? 125 : -1, CLengthUnit::NM());
|
||||||
this->setMaxRange(maxRange);
|
this->setMaxRange(maxRange);
|
||||||
}
|
}
|
||||||
if (newStatus.isDisconnected()) { clear(); }
|
|
||||||
|
if (newStatus.isDisconnected())
|
||||||
|
{
|
||||||
|
this->clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAirspaceMonitor::onPilotDisconnected(const CCallsign &callsign)
|
void CAirspaceMonitor::onPilotDisconnected(const CCallsign &callsign)
|
||||||
@@ -1438,6 +1450,18 @@ namespace BlackCore
|
|||||||
m_fsdClient->sendClientQueryServer(callsign);
|
m_fsdClient->sendClientQueryServer(callsign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAirspaceMonitor::queryAllOnlineAtcStations()
|
||||||
|
{
|
||||||
|
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||||
|
const CAtcStationList onlineStations = this->getAtcStationsOnlineRecalculated();
|
||||||
|
for (const CAtcStation &station : onlineStations)
|
||||||
|
{
|
||||||
|
const CCallsign cs = station.getCallsign();
|
||||||
|
if (cs.isEmpty()) { continue; }
|
||||||
|
m_fsdClient->sendClientQueryRealName(cs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CAirspaceMonitor::sendNextStaggeredAtisQuery()
|
bool CAirspaceMonitor::sendNextStaggeredAtisQuery()
|
||||||
{
|
{
|
||||||
if (m_queryAtis.isEmpty()) { return false; }
|
if (m_queryAtis.isEmpty()) { return false; }
|
||||||
|
|||||||
@@ -294,12 +294,19 @@ namespace BlackCore
|
|||||||
int m_maxDistanceNM = 125; //!< position range / FSD range
|
int m_maxDistanceNM = 125; //!< position range / FSD range
|
||||||
int m_maxDistanceNMHysteresis = qRound(1.1 * m_maxDistanceNM);
|
int m_maxDistanceNMHysteresis = qRound(1.1 * m_maxDistanceNM);
|
||||||
|
|
||||||
// Processing interval
|
// Processing for queries etc. (fast)
|
||||||
static constexpr int ProcessIntervalMs = 50; // in ms
|
static constexpr int FastProcessIntervalMs = 50; //!< interval in ms
|
||||||
QTimer m_processTimer;
|
QTimer m_fastProcessTimer; //!< process timer for fast updates
|
||||||
|
|
||||||
//! Processing by timer
|
//! Processing by timer
|
||||||
void process();
|
void fastProcessing();
|
||||||
|
|
||||||
|
// Processing for validations etc. (slow)
|
||||||
|
static constexpr int SlowProcessIntervalMs = 125 * 1000; //!< interval in ms
|
||||||
|
QTimer m_slowProcessTimer; //!< process timer for slow updates
|
||||||
|
|
||||||
|
//! Slow processing
|
||||||
|
void slowProcessing();
|
||||||
|
|
||||||
// model matching times
|
// model matching times
|
||||||
static constexpr qint64 MMCheckAgainMs = 2000;
|
static constexpr qint64 MMCheckAgainMs = 2000;
|
||||||
@@ -321,6 +328,9 @@ namespace BlackCore
|
|||||||
//! Network queries for ATC
|
//! Network queries for ATC
|
||||||
void sendInitialAtcQueries(const BlackMisc::Aviation::CCallsign &callsign);
|
void sendInitialAtcQueries(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
|
//! Query all online ATC stations
|
||||||
|
void queryAllOnlineAtcStations();
|
||||||
|
|
||||||
//! Network queries for ATIS
|
//! Network queries for ATIS
|
||||||
bool sendNextStaggeredAtisQuery();
|
bool sendNextStaggeredAtisQuery();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user