mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
Ref T229, FSX/P3D character encoding
* we have to use an encoding function for FSX/P3D string * encapsulated, so we can later can/improve it
This commit is contained in:
@@ -217,8 +217,8 @@ namespace BlackSimPlugin
|
|||||||
case CStatusMessage::SeverityWarning: type = SIMCONNECT_TEXT_TYPE_PRINT_YELLOW; break;
|
case CStatusMessage::SeverityWarning: type = SIMCONNECT_TEXT_TYPE_PRINT_YELLOW; break;
|
||||||
case CStatusMessage::SeverityError: type = SIMCONNECT_TEXT_TYPE_PRINT_RED; break;
|
case CStatusMessage::SeverityError: type = SIMCONNECT_TEXT_TYPE_PRINT_RED; break;
|
||||||
}
|
}
|
||||||
HRESULT hr = SimConnect_Text(m_hSimConnect, type, 7.5, EventTextMessage,
|
const HRESULT hr = SimConnect_Text(m_hSimConnect, type, 7.5, EventTextMessage,
|
||||||
static_cast<DWORD>(m.size()), m.data());
|
static_cast<DWORD>(m.size()), m.data());
|
||||||
Q_UNUSED(hr);
|
Q_UNUSED(hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1634,6 +1634,11 @@ namespace BlackSimPlugin
|
|||||||
return simObject;
|
return simObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CSimulatorFsxCommon::fsxCharToQString(const char *fsxChar, int size)
|
||||||
|
{
|
||||||
|
return QString::fromLatin1(fsxChar, size);
|
||||||
|
}
|
||||||
|
|
||||||
CCallsignSet CSimulatorFsxCommon::physicallyRemoveAircraftNotInProvider()
|
CCallsignSet CSimulatorFsxCommon::physicallyRemoveAircraftNotInProvider()
|
||||||
{
|
{
|
||||||
const CCallsignSet toBeRemoved(getCallsignsMissingInProvider());
|
const CCallsignSet toBeRemoved(getCallsignsMissingInProvider());
|
||||||
|
|||||||
@@ -330,6 +330,9 @@ namespace BlackSimPlugin
|
|||||||
//! Request for lights (request in range of lights)?
|
//! Request for lights (request in range of lights)?
|
||||||
static bool isRequestForLights(DWORD requestId) { return requestId >= (RequestSimDataStart + RequestLightsOffset) && requestId < (RequestSimDataStart + RequestLightsOffset + MaxSimObjects); }
|
static bool isRequestForLights(DWORD requestId) { return requestId >= (RequestSimDataStart + RequestLightsOffset) && requestId < (RequestSimDataStart + RequestLightsOffset + MaxSimObjects); }
|
||||||
|
|
||||||
|
//! 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
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace BlackSimPlugin
|
|||||||
SIMCONNECT_RECV_OPEN *event = (SIMCONNECT_RECV_OPEN *)pData;
|
SIMCONNECT_RECV_OPEN *event = (SIMCONNECT_RECV_OPEN *)pData;
|
||||||
simulatorFsxP3D->m_simulatorVersion = QString("%1.%2.%3.%4").arg(event->dwApplicationVersionMajor).arg(event->dwApplicationVersionMinor).arg(event->dwApplicationBuildMajor).arg(event->dwApplicationBuildMinor);
|
simulatorFsxP3D->m_simulatorVersion = QString("%1.%2.%3.%4").arg(event->dwApplicationVersionMajor).arg(event->dwApplicationVersionMinor).arg(event->dwApplicationBuildMajor).arg(event->dwApplicationBuildMinor);
|
||||||
simulatorFsxP3D->m_simConnectVersion = QString("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor);
|
simulatorFsxP3D->m_simConnectVersion = QString("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor);
|
||||||
simulatorFsxP3D->m_simulatorName = QString(event->szApplicationName);
|
simulatorFsxP3D->m_simulatorName = CSimulatorFsxCommon::fsxCharToQString(event->szApplicationName);
|
||||||
simulatorFsxP3D->m_simulatorDetails = QString("Name: '%1' Version: %2 SimConnect: %3").arg(simulatorFsxP3D->m_simulatorName, simulatorFsxP3D->m_simulatorVersion, simulatorFsxP3D->m_simConnectVersion);
|
simulatorFsxP3D->m_simulatorDetails = QString("Name: '%1' Version: %2 SimConnect: %3").arg(simulatorFsxP3D->m_simulatorName, simulatorFsxP3D->m_simulatorVersion, simulatorFsxP3D->m_simConnectVersion);
|
||||||
CLogMessage(static_cast<CSimulatorFsxCommon *>(nullptr)).info("Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << simulatorFsxP3D->m_simulatorDetails;
|
CLogMessage(static_cast<CSimulatorFsxCommon *>(nullptr)).info("Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << simulatorFsxP3D->m_simulatorDetails;
|
||||||
simulatorFsxP3D->setSimConnected();
|
simulatorFsxP3D->setSimConnected();
|
||||||
|
|||||||
Reference in New Issue
Block a user