mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T312, added checkImpl/check in simulator listeners
This commit is contained in:
@@ -2101,6 +2101,20 @@ namespace BlackSimPlugin
|
||||
m_timer.stop();
|
||||
}
|
||||
|
||||
void CSimulatorFsxCommonListener::checkImpl()
|
||||
{
|
||||
if (!m_timer.isActive()) { return; }
|
||||
if (this->isShuttingDown()) { return; }
|
||||
|
||||
m_timer.start(); // restart because we will check just now
|
||||
QPointer<CSimulatorFsxCommonListener> myself(this);
|
||||
QTimer::singleShot(0, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
this->checkConnection();
|
||||
});
|
||||
}
|
||||
|
||||
QString CSimulatorFsxCommonListener::backendInfo() const
|
||||
{
|
||||
if (m_simulatorName.isEmpty()) { return ISimulatorListener::backendInfo(); }
|
||||
|
||||
@@ -521,6 +521,9 @@ namespace BlackSimPlugin
|
||||
//! \copydoc BlackCore::ISimulatorListener::stopImpl
|
||||
virtual void stopImpl() override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulatorListener::checkImpl
|
||||
virtual void checkImpl() override;
|
||||
|
||||
//! Test if connection can be established
|
||||
void checkConnection();
|
||||
|
||||
@@ -531,7 +534,7 @@ namespace BlackSimPlugin
|
||||
bool checkSimConnectDll() const;
|
||||
|
||||
private:
|
||||
QTimer m_timer { this }; //!< timer, "this" is needed otherwise warnings when move to new thread
|
||||
QTimer m_timer { this }; //!< timer, "this" is needed otherwise I get warnings when move to new thread
|
||||
QString m_simulatorVersion;
|
||||
QString m_simConnectVersion;
|
||||
QString m_simulatorName;
|
||||
|
||||
Reference in New Issue
Block a user