refs #324 Remove timeout implementation from MSFS plugins

This commit is contained in:
Roland Winklmeier
2014-10-05 20:05:02 +02:00
parent 5fe4ea3039
commit faf931742a
5 changed files with 6 additions and 30 deletions

View File

@@ -94,12 +94,6 @@ namespace BlackSimPlugin
QMutexLocker locker(&m_mutexInterpolator);
if (m_interpolator.getTimeOfLastReceivedSituation().secsTo(QDateTime::currentDateTimeUtc()) > 15)
{
emit clientTimedOut(m_callsign);
return;
}
if (m_interpolator.hasEnoughAircraftSituations())
{
CAircraftSituation situation = m_interpolator.getCurrentSituation();

View File

@@ -65,9 +65,6 @@ namespace BlackSimPlugin
signals:
//! Client timed out
void clientTimedOut(const QString &callsign);
//! Client status changed
void statusChanged(const QString &callsign, BlackSimPlugin::Fs9::CFs9Client::ClientStatus);

View File

@@ -126,7 +126,6 @@ namespace BlackSimPlugin
client->moveToThread(clientThread);
connect(clientThread, &QThread::started, client, &CFs9Client::init);
connect(client, &CFs9Client::clientTimedOut, this, &CSimulatorFs9::ps_removeAircraft);
connect(client, &CFs9Client::statusChanged, this, &CSimulatorFs9::ps_changeClientStatus);
m_fs9ClientThreads.insert(client, clientThread);
m_hashFs9Clients.insert(callsign, client);
@@ -155,7 +154,12 @@ namespace BlackSimPlugin
void CSimulatorFs9::removeRemoteAircraft(const CCallsign &callsign)
{
ps_removeAircraft(callsign.toQString());
if(!m_hashFs9Clients.contains(callsign)) return;
CFs9Client *fs9Client = m_hashFs9Clients.value(callsign);
// Send an async disconnect signal. When finished we will clean up
QMetaObject::invokeMethod(fs9Client, "disconnectFrom");
}
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CAircraft &ownAircraft)
@@ -342,16 +346,6 @@ namespace BlackSimPlugin
}
}
void CSimulatorFs9::ps_removeAircraft(const QString &callsign)
{
if(!m_hashFs9Clients.contains(callsign)) return;
CFs9Client *fs9Client = m_hashFs9Clients.value(callsign);
// Send an async disconnect signal. When finished we will clean up
QMetaObject::invokeMethod(fs9Client, "disconnectFrom");
}
void CSimulatorFs9::updateOwnAircraftFromSim(const CAircraft &ownAircraft)
{
m_ownAircraft.setCom1System(ownAircraft.getCom1System());

View File

@@ -140,9 +140,6 @@ namespace BlackSimPlugin
void ps_changeClientStatus(const QString &callsign, BlackSimPlugin::Fs9::CFs9Client::ClientStatus status);
//! Remove client by callsign QString
void ps_removeAircraft(const QString &callsign);
private:
//! Called when data about our own aircraft are received

View File

@@ -482,12 +482,6 @@ namespace BlackSimPlugin
{
foreach(CSimConnectObject simObj, m_simConnectObjects)
{
if (simObj.getInterpolator()->getTimeOfLastReceivedSituation().secsTo(QDateTime::currentDateTimeUtc()) > 15)
{
removeRemoteAircraft(simObj);
continue;
}
if (simObj.getInterpolator()->hasEnoughAircraftSituations())
{
SIMCONNECT_DATA_INITPOSITION position;