refs #417 Add support for FSX and FS9

This commit is contained in:
Michal Garapich
2015-05-29 21:57:53 +02:00
parent 23761fad13
commit b9b2b5770a
4 changed files with 2 additions and 36 deletions

View File

@@ -88,12 +88,6 @@ namespace BlackSimPlugin
return true;
}
void CSimulatorFs9::asyncConnectTo()
{
// Since we are running the host in its own thread, it is async anyway
connectTo();
}
bool CSimulatorFs9::disconnectFrom()
{
if (!m_simConnected) { return true; }

View File

@@ -52,9 +52,6 @@ namespace BlackSimPlugin
//! \copydoc ISimulator::connectTo()
virtual bool connectTo() override;
//! \copydoc ISimulator::connectTo()
virtual void asyncConnectTo() override;
//! \copydoc ISimulator::disconnectFrom()
virtual bool disconnectFrom() override;

View File

@@ -78,30 +78,6 @@ namespace BlackSimPlugin
}
bool CSimulatorFsx::connectTo()
{
if (m_simConnected) { return true; }
int oldStatus = getSimulatorStatus();
if (FAILED(SimConnect_Open(&m_hSimConnect, BlackMisc::CProject::systemNameAndVersionChar(), nullptr, 0, 0, 0)))
{
m_simConnected = false;
m_simPaused = false;
m_simSimulating = false;
emitSimulatorCombinedStatus(oldStatus);
return false;
}
else
{
if (m_useFsuipc) { this->m_fsuipc->connect(); } // connect FSUIPC too
}
initWhenConnected();
m_simconnectTimerId = startTimer(10);
m_simConnected = true;
emitSimulatorCombinedStatus(oldStatus);
return true;
}
void CSimulatorFsx::asyncConnectTo()
{
connect(&m_watcherConnect, SIGNAL(finished()), this, SLOT(ps_connectToFinished()));
@@ -115,6 +91,8 @@ namespace BlackSimPlugin
QFuture<bool> result = QtConcurrent::run(asyncConnectFunc);
m_watcherConnect.setFuture(result);
return true;
}
bool CSimulatorFsx::disconnectFrom()

View File

@@ -90,9 +90,6 @@ namespace BlackSimPlugin
//! \copydoc ISimulator::connectTo()
virtual bool connectTo() override;
//! \copydoc ISimulator::asyncConnectTo()
virtual void asyncConnectTo() override;
//! \copydoc ISimulator::disconnectFrom()
virtual bool disconnectFrom() override;