diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index a5a579158..10f145d86 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -78,4 +78,9 @@ namespace BlackCore Q_UNUSED(s) } + QString ISimulatorListener::backendInfo() const + { + return m_info.toQString(); + } + } // namespace diff --git a/src/blackcore/simulator.h b/src/blackcore/simulator.h index 0ada04222..52086bb87 100644 --- a/src/blackcore/simulator.h +++ b/src/blackcore/simulator.h @@ -247,6 +247,9 @@ namespace BlackCore //! Corresponding info const BlackMisc::Simulation::CSimulatorPluginInfo &getPluginInfo() const { return m_info; } + //! Info about the backend system (if available) + virtual QString backendInfo() const; + public slots: //! Start listening for the simulator to start. virtual void start() = 0; diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 1d54a5d41..3fbf774a9 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -1321,6 +1321,10 @@ namespace BlackSimPlugin void CSimulatorFsxCommonListener::start() { + m_simulatorVersion.clear(); + m_simConnectVersion.clear(); + m_simulatorName.clear(); + m_simulatorDetails.clear(); m_timer->start(); } @@ -1329,6 +1333,12 @@ namespace BlackSimPlugin m_timer->stop(); } + QString CSimulatorFsxCommonListener::backendInfo() const + { + if (m_simulatorName.isEmpty()) { return ISimulatorListener::backendInfo(); } + return m_simulatorDetails; + } + void CSimulatorFsxCommonListener::checkConnection() { Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing sApp"); @@ -1391,8 +1401,8 @@ namespace BlackSimPlugin simListener->m_simulatorVersion = QString("%1.%2.%3.%4").arg(event->dwApplicationVersionMajor).arg(event->dwApplicationVersionMinor).arg(event->dwApplicationBuildMajor).arg(event->dwApplicationBuildMinor); simListener->m_simConnectVersion = QString("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor); simListener->m_simulatorName = QString(event->szApplicationName); - simListener->m_simulatorDetails = QString("Open: AppName=\"%1\" AppVersion=%2 SimConnectVersion=%3").arg(simListener->m_simulatorName, simListener->m_simulatorVersion, simListener->m_simConnectVersion); - CLogMessage(static_cast(nullptr)).info("Connect to FSX/P3D: %1") << sApp->swiftVersionString(); + simListener->m_simulatorDetails = QString("Name: '%1' Version: %2 SimConnect: %3").arg(simListener->m_simulatorName, simListener->m_simulatorVersion, simListener->m_simConnectVersion); + CLogMessage(static_cast(nullptr)).info("Connect to FSX/P3D: '%1'") << simListener->backendInfo(); break; } case SIMCONNECT_RECV_ID_EXCEPTION: diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h index a28a3522c..c9168b9f2 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h @@ -291,6 +291,9 @@ namespace BlackSimPlugin //! Constructor CSimulatorFsxCommonListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info); + //! \copydoc BlackCore::ISimulatorListener::backendInfo + virtual QString backendInfo() const override; + public slots: //! \copydoc BlackCore::ISimulatorListener::start virtual void start() override;