mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Use string conversion for FSX listener
This commit is contained in:
@@ -2106,7 +2106,7 @@ namespace BlackSimPlugin
|
|||||||
SIMCONNECT_RECV_OPEN *event = (SIMCONNECT_RECV_OPEN *)pData;
|
SIMCONNECT_RECV_OPEN *event = (SIMCONNECT_RECV_OPEN *)pData;
|
||||||
simListener->m_simulatorVersion = QString("%1.%2.%3.%4").arg(event->dwApplicationVersionMajor).arg(event->dwApplicationVersionMinor).arg(event->dwApplicationBuildMajor).arg(event->dwApplicationBuildMinor);
|
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_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_simulatorName = CSimulatorFsxCommon::fsxCharToQString(event->szApplicationName);
|
||||||
simListener->m_simulatorDetails = QString("Name: '%1' Version: %2 SimConnect: %3").arg(simListener->m_simulatorName, simListener->m_simulatorVersion, simListener->m_simConnectVersion);
|
simListener->m_simulatorDetails = QString("Name: '%1' Version: %2 SimConnect: %3").arg(simListener->m_simulatorName, simListener->m_simulatorVersion, simListener->m_simConnectVersion);
|
||||||
CLogMessage(static_cast<CSimulatorFsxCommonListener *>(nullptr)).info("Connect to %1: '%2'") << simListener->getPluginInfo().getIdentifier() << simListener->backendInfo();
|
CLogMessage(static_cast<CSimulatorFsxCommonListener *>(nullptr)).info("Connect to %1: '%2'") << simListener->getPluginInfo().getIdentifier() << simListener->backendInfo();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ namespace BlackSimPlugin
|
|||||||
//! \private
|
//! \private
|
||||||
static DWORD unitTestRequestId(CSimConnectObject::SimObjectType type);
|
static DWORD unitTestRequestId(CSimConnectObject::SimObjectType type);
|
||||||
|
|
||||||
|
//! Encapsulates creating QString from FSX string data
|
||||||
|
static QString fsxCharToQString(const char *fsxChar, int size = -1);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! SimConnect callback
|
//! SimConnect callback
|
||||||
//! \note all tasks called in this function (i.e, all called functions) must perform fast or shall be called asynchronously
|
//! \note all tasks called in this function (i.e, all called functions) must perform fast or shall be called asynchronously
|
||||||
@@ -417,9 +420,6 @@ namespace BlackSimPlugin
|
|||||||
//! Insert an new SimConnect object
|
//! Insert an new SimConnect object
|
||||||
CSimConnectObject insertNewSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, DWORD requestId);
|
CSimConnectObject insertNewSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, DWORD requestId);
|
||||||
|
|
||||||
//! Encapsulates creating QString from FSX string data
|
|
||||||
static QString fsxCharToQString(const char *fsxChar, int size = -1);
|
|
||||||
|
|
||||||
static constexpr int GuessRemoteAircraftPartsCycle = 20; //!< guess every n-th cycle
|
static constexpr int GuessRemoteAircraftPartsCycle = 20; //!< guess every n-th cycle
|
||||||
static constexpr int SkipUpdateCyclesForCockpit = 10; //!< skip x cycles before updating cockpit again
|
static constexpr int SkipUpdateCyclesForCockpit = 10; //!< skip x cycles before updating cockpit again
|
||||||
static constexpr int IgnoreReceiveExceptions = 10; //!< skip exceptions when displayed more than x times
|
static constexpr int IgnoreReceiveExceptions = 10; //!< skip exceptions when displayed more than x times
|
||||||
|
|||||||
Reference in New Issue
Block a user