mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #417 Add support for FSX and FS9
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user