mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 11:45:40 +08:00
refs #417 Add support for FSX and FS9
This commit is contained in:
@@ -88,12 +88,6 @@ namespace BlackSimPlugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorFs9::asyncConnectTo()
|
|
||||||
{
|
|
||||||
// Since we are running the host in its own thread, it is async anyway
|
|
||||||
connectTo();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CSimulatorFs9::disconnectFrom()
|
bool CSimulatorFs9::disconnectFrom()
|
||||||
{
|
{
|
||||||
if (!m_simConnected) { return true; }
|
if (!m_simConnected) { return true; }
|
||||||
|
|||||||
@@ -52,9 +52,6 @@ namespace BlackSimPlugin
|
|||||||
//! \copydoc ISimulator::connectTo()
|
//! \copydoc ISimulator::connectTo()
|
||||||
virtual bool connectTo() override;
|
virtual bool connectTo() override;
|
||||||
|
|
||||||
//! \copydoc ISimulator::connectTo()
|
|
||||||
virtual void asyncConnectTo() override;
|
|
||||||
|
|
||||||
//! \copydoc ISimulator::disconnectFrom()
|
//! \copydoc ISimulator::disconnectFrom()
|
||||||
virtual bool disconnectFrom() override;
|
virtual bool disconnectFrom() override;
|
||||||
|
|
||||||
|
|||||||
@@ -78,30 +78,6 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsx::connectTo()
|
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()));
|
connect(&m_watcherConnect, SIGNAL(finished()), this, SLOT(ps_connectToFinished()));
|
||||||
|
|
||||||
@@ -115,6 +91,8 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
QFuture<bool> result = QtConcurrent::run(asyncConnectFunc);
|
QFuture<bool> result = QtConcurrent::run(asyncConnectFunc);
|
||||||
m_watcherConnect.setFuture(result);
|
m_watcherConnect.setFuture(result);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsx::disconnectFrom()
|
bool CSimulatorFsx::disconnectFrom()
|
||||||
|
|||||||
@@ -90,9 +90,6 @@ namespace BlackSimPlugin
|
|||||||
//! \copydoc ISimulator::connectTo()
|
//! \copydoc ISimulator::connectTo()
|
||||||
virtual bool connectTo() override;
|
virtual bool connectTo() override;
|
||||||
|
|
||||||
//! \copydoc ISimulator::asyncConnectTo()
|
|
||||||
virtual void asyncConnectTo() override;
|
|
||||||
|
|
||||||
//! \copydoc ISimulator::disconnectFrom()
|
//! \copydoc ISimulator::disconnectFrom()
|
||||||
virtual bool disconnectFrom() override;
|
virtual bool disconnectFrom() override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user