Ref T485 Adjust CLogMessage and CStatusMessage call sites to use the new API.

This commit is contained in:
Mat Sutcliffe
2018-12-23 20:12:49 +00:00
parent cba820cbce
commit 225ff81252
118 changed files with 724 additions and 721 deletions

View File

@@ -368,7 +368,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).validationError("No valid plugin for '%1'") << simulator.toQString();
CLogMessage(this).validationError(u"No valid plugin for '%1'") << simulator.toQString();
}
// update provider, own name, title

View File

@@ -249,7 +249,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).warning("Need a (valid) callsign to write a log");
CLogMessage(this).warning(u"Need a (valid) callsign to write a log");
ok = true; // already a warning
}
}
@@ -267,7 +267,7 @@ namespace BlackSimPlugin
{
Q_ASSERT_X(false, Q_FUNC_INFO, "Unhandled button");
}
if (!ok) { CLogMessage(this).warning("Cannot parse command for button: %1") << sender->objectName(); }
if (!ok) { CLogMessage(this).warning(u"Cannot parse command for button: %1") << sender->objectName(); }
}
void CSimulatorEmulatedMonitorDialog::enableInterpolationLogButtons(bool enable)

View File

@@ -132,7 +132,7 @@ namespace BlackSimPlugin
// Copy the Host Address
if (FAILED(hr = enumHostsResponseMsg->pAddressSender->Duplicate(hostNode.getHostAddressPtr())))
{
CLogMessage(this).warning("Failed to duplicate host address!");
CLogMessage(this).warning(u"Failed to duplicate host address!");
return hr;
}
@@ -176,14 +176,14 @@ namespace BlackSimPlugin
IID_IDirectPlay8Peer,
reinterpret_cast<void **>(&m_directPlayPeer))))
{
CLogMessage(this).warning("Failed to create DirectPlay8Peer object!");
CLogMessage(this).warning(u"Failed to create DirectPlay8Peer object!");
return hr;
}
// Init DirectPlay
if (FAILED(hr = m_directPlayPeer->Initialize(&m_callbackWrapper, m_callbackWrapper.messageHandler, 0)))
{
CLogMessage(this).warning("Failed to initialize directplay peer!");
CLogMessage(this).warning(u"Failed to initialize directplay peer!");
return hr;
}
@@ -191,7 +191,7 @@ namespace BlackSimPlugin
if (!isServiceProviderValid(&CLSID_DP8SP_TCPIP))
{
hr = E_FAIL;
CLogMessage(this).warning("Service provider is invalid!");
CLogMessage(this).warning(u"Service provider is invalid!");
return hr;
}
@@ -208,7 +208,7 @@ namespace BlackSimPlugin
if (hr != DPNERR_BUFFERTOOSMALL)
{
CLogMessage(this).warning("Failed to enumerate service providers!");
CLogMessage(this).warning(u"Failed to enumerate service providers!");
return false;
}
@@ -219,7 +219,7 @@ namespace BlackSimPlugin
if (FAILED(hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, dpnSPInfo, &dwSize, &dwItems, 0)))
{
CLogMessage(this).warning("Failed to enumerate service providers!");
CLogMessage(this).warning(u"Failed to enumerate service providers!");
return false;
}
@@ -240,14 +240,14 @@ namespace BlackSimPlugin
IID_IDirectPlay8Address,
reinterpret_cast<void **>(&m_deviceAddress))))
{
CLogMessage(this).warning("Failed to create DirectPlay8Address instance!");
CLogMessage(this).warning(u"Failed to create DirectPlay8Address instance!");
return hr;
}
// Set the SP for our Device Address
if (FAILED(hr = m_deviceAddress->SetSP(&CLSID_DP8SP_TCPIP)))
{
CLogMessage(this).warning("Failed to set SP!");
CLogMessage(this).warning(u"Failed to set SP!");
return hr;
}
@@ -292,7 +292,7 @@ namespace BlackSimPlugin
DPNSEND_SYNC | DPNSEND_NOLOOPBACK)))
{
const QString m(message);
CLogMessage(this).warning("DirectPlay: Failed to send message!");
CLogMessage(this).warning(u"DirectPlay: Failed to send message!");
CLogMessage(this).debug() << m;
}
return hr;

View File

@@ -141,7 +141,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).info("Hosting successfully started");
CLogMessage(this).info(u"Hosting successfully started");
m_hostStatus = Hosting;
}
@@ -171,7 +171,7 @@ namespace BlackSimPlugin
if (m_hostStatus == Terminated) return hr;
CLogMessage(this).info("Hosting terminated!");
CLogMessage(this).info(u"Hosting terminated!");
if (FAILED(hr = m_directPlayPeer->TerminateSession(nullptr, 0, 0)))
{
return logDirectPlayError(hr);

View File

@@ -87,7 +87,7 @@ namespace BlackSimPlugin
FS_PBH pbhstrct;
pbhstrct.pbh = positionVelocity.pbh;
int pitch = qRound(std::floor(pbhstrct.pitch / CFs9Sdk::pitchMultiplier()));
if (pitch < -90 || pitch > 89) { CLogMessage().warning("FS9: Pitch value out of limits: %1") << pitch; }
if (pitch < -90 || pitch > 89) { CLogMessage().warning(u"FS9: Pitch value out of limits: %1") << pitch; }
int bank = qRound(std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier()));
// MSFS has inverted pitch and bank angles
@@ -187,7 +187,7 @@ namespace BlackSimPlugin
{
emit aircraftRenderingChanged(remoteAircraftCopy);
}
CLogMessage(this).info("FS9: Added aircraft %1") << callsign.toQString();
CLogMessage(this).info(u"FS9: Added aircraft %1") << callsign.toQString();
return true;
}
@@ -199,7 +199,7 @@ namespace BlackSimPlugin
fs9Client->quit();
m_hashFs9Clients.remove(callsign);
updateAircraftRendered(callsign, false);
CLogMessage(this).info("FS9: Removed aircraft %1") << callsign.toQString();
CLogMessage(this).info(u"FS9: Removed aircraft %1") << callsign.toQString();
return true;
}
@@ -453,7 +453,7 @@ namespace BlackSimPlugin
if (m_isConnecting || isOk(m_lobbyClient->connectFs9ToHost(m_fs9Host->getHostAddress())))
{
m_isConnecting = true;
CLogMessage(this).info("swift is joining FS9 to the multiplayer session...");
CLogMessage(this).info(u"swift is joining FS9 to the multiplayer session...");
}
}

View File

@@ -96,11 +96,11 @@ namespace BlackSimPlugin
.arg(QLatin1Char(48 + (0x0f & (FSUIPC_Version >> 16))))
.arg((FSUIPC_Version & 0xffff) ? QString(QLatin1Char('a' + static_cast<char>(FSUIPC_Version & 0xff) - 1)) : "");
m_fsuipcVersion = QStringLiteral("FSUIPC %1 (%2)").arg(ver, sim);
CLogMessage(this).info("FSUIPC connected: %1") << m_fsuipcVersion;
CLogMessage(this).info(u"FSUIPC connected: %1") << m_fsuipcVersion;
}
else
{
CLogMessage(this).warning("FSUIPC opened, but verification failed");
CLogMessage(this).warning(u"FSUIPC opened, but verification failed");
m_opened = false;
FSUIPC_Close(); // under any circumstances close
}
@@ -110,7 +110,7 @@ namespace BlackSimPlugin
const int index = static_cast<int>(dwResult);
m_lastErrorIndex = index;
m_lastErrorMessage = CFsuipc::errorMessages().at(index);
CLogMessage(this).warning("FSUIPC not connected: %1") << m_lastErrorMessage;
CLogMessage(this).warning(u"FSUIPC not connected: %1") << m_lastErrorMessage;
m_opened = false;
FSUIPC_Close(); // under any circumstances close
}
@@ -123,7 +123,7 @@ namespace BlackSimPlugin
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
if (m_opened)
{
CLogMessage(this).info("Closing FSUIPC: %1") << m_fsuipcVersion;
CLogMessage(this).info(u"Closing FSUIPC: %1") << m_fsuipcVersion;
}
FSUIPC_Close(); // Closing when it wasn't open is okay, so this is safe here
m_closeCount++;
@@ -345,7 +345,7 @@ namespace BlackSimPlugin
m_openCount++;
if (m_openCount < 10)
{
CLogMessage(this).warning("Used FSUIPC open/close workaround");
CLogMessage(this).warning(u"Used FSUIPC open/close workaround");
}
}
@@ -454,7 +454,7 @@ namespace BlackSimPlugin
// MSFS has inverted pitch and bank angles
pitchRaw = ~pitchRaw;
bankRaw = ~bankRaw;
if (pitchRaw < -90 || pitchRaw > 89) { CLogMessage(this).warning("FSUIPC: Pitch value out of limits: %1") << pitchRaw; }
if (pitchRaw < -90 || pitchRaw > 89) { CLogMessage(this).warning(u"FSUIPC: Pitch value out of limits: %1") << pitchRaw; }
// speeds, situation
CAngle pitch = CAngle(pitchRaw, CAngleUnit::deg());
@@ -504,7 +504,7 @@ namespace BlackSimPlugin
{
m_lastErrorIndex = result;
m_lastErrorMessage = CFsuipc::errorMessage(result);
CLogMessage(this).warning("FSUIPC read error '%1'") << m_lastErrorMessage;
CLogMessage(this).warning(u"FSUIPC read error '%1'") << m_lastErrorMessage;
}
return read;
}

View File

@@ -63,7 +63,7 @@ namespace BlackSimPlugin
{
const bool on = parser.toBool(2);
const bool s = this->useFsuipc(on);
CLogMessage(this, CLogCategory::cmdLine()).info("FSUIPC is '%1'") << boolToOnOff(s);
CLogMessage(this, CLogCategory::cmdLine()).info(u"FSUIPC is '%1'") << boolToOnOff(s);
return s;
}
return CSimulatorPluginCommon::parseDetails(parser);

View File

@@ -125,7 +125,7 @@ namespace BlackSimPlugin
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraftTitle, "TITLE", nullptr, SIMCONNECT_DATATYPE_STRING256);
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: initOwnAircraft %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: initOwnAircraft %1") << hr;
}
return hr;
}
@@ -170,7 +170,7 @@ namespace BlackSimPlugin
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: initRemoteAircraftSituation %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: initRemoteAircraftSituation %1") << hr;
}
return hr;
}
@@ -185,7 +185,7 @@ namespace BlackSimPlugin
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataRemoteAircraftGetPosition, "STATIC CG TO GROUND", "Feet");
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: initRemoteAircraftSimData DataRemoteAircraftGetPosition %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: initRemoteAircraftSimData DataRemoteAircraftGetPosition %1") << hr;
}
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataRemoteAircraftModelData, "STATIC CG TO GROUND", "Feet");
@@ -197,7 +197,7 @@ namespace BlackSimPlugin
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataRemoteAircraftModelData, "TITLE", nullptr, SIMCONNECT_DATATYPE_STRING256);
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: initRemoteAircraftSimData DataRemoteAircraftModelData %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: initRemoteAircraftSimData DataRemoteAircraftModelData %1") << hr;
}
return hr;
@@ -210,7 +210,7 @@ namespace BlackSimPlugin
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataSimEnvironment, "LOCAL TIME", "", SIMCONNECT_DATATYPE_INT32);
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: initSimulatorEnvironment %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: initSimulatorEnvironment %1") << hr;
}
return hr;
}
@@ -224,7 +224,7 @@ namespace BlackSimPlugin
hr += SimConnect_MapClientDataNameToID(hSimConnect, "SquawkBox Data", ClientAreaSquawkBox);
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: SimConnect_MapClientDataNameToID %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: SimConnect_MapClientDataNameToID %1") << hr;
return hr;
}
@@ -232,7 +232,7 @@ namespace BlackSimPlugin
hr += SimConnect_CreateClientData(hSimConnect, ClientAreaSquawkBox, sbSize, SIMCONNECT_CREATE_CLIENT_DATA_FLAG_DEFAULT);
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: SimConnect_CreateClientData %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: SimConnect_CreateClientData %1") << hr;
return hr;
}
@@ -245,7 +245,7 @@ namespace BlackSimPlugin
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: SB data area data definitions %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: SB data area data definitions %1") << hr;
return hr;
}
@@ -257,7 +257,7 @@ namespace BlackSimPlugin
hr += SimConnect_SetClientData(hSimConnect, ClientAreaSquawkBox, CSimConnectDefinitions::DataClientAreaSbRunning, SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT, 0, 1, &sbRunning);
if (isFailure(hr))
{
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error("SimConnect error: SimConnect_SetClientData %1") << hr;
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: SimConnect_SetClientData %1") << hr;
}
return hr;
}

View File

@@ -207,7 +207,7 @@ namespace BlackSimPlugin
{
const bool written = CFileUtils::writeStringToFile(iniFile, fileName);
if (!written && madeDir) { d.removeRecursively(); } // clean up own created dir
if (written) { CLogMessage(this).info("Written '%1'") << fileName; }
if (written) { CLogMessage(this).info(u"Written '%1'") << fileName; }
}
// always refresh info, as the dialog can also be used to delete the file
this->setSimConnectInfo();
@@ -259,7 +259,7 @@ namespace BlackSimPlugin
const CStatusMessage saveMsg = m_p3dVersion.setAndSave(version);
if (saveMsg.isSuccess())
{
const CStatusMessage m = CStatusMessage(this).info("Changed P3D version to '%1'. Requires a new start of swift to become effective!") << version;
const CStatusMessage m = CStatusMessage(this).info(u"Changed P3D version to '%1'. Requires a new start of swift to become effective!") << version;
this->showOverlayMessage(m);
}
}

View File

@@ -120,7 +120,7 @@ bool resolveSimConnectSymbol(QLibrary &library, FuncPtr &funcPtr, const char *fu
funcPtr = reinterpret_cast<FuncPtr>(library.resolve(funcName));
if (! funcPtr)
{
CLogMessage(CLogCategory::driver()).error("Failed to resolve %1: %2") << funcName << library.errorString();
CLogMessage(CLogCategory::driver()).error(u"Failed to resolve %1: %2") << funcName << library.errorString();
return false;
}
return true;
@@ -211,21 +211,21 @@ bool loadAndResolveP3DSimConnect(P3DSimConnectVersion version)
const bool resolvedP3DSimConnectSymbols = resolveP3DSimConnectSymbols(simConnectDll);
if (!resolvedCommon)
{
CLogMessage(CLogCategory::driver()).error("Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName;
CLogMessage(CLogCategory::driver()).error(u"Failed to resolve common symbols from SimConnect.dll: '%1'") << simConnectFileName;
return false;
}
if (!resolvedP3DSimConnectSymbols)
{
CLogMessage(CLogCategory::driver()).error("Failed to resolve P3D symbols from SimConnect.dll: '%1'") << simConnectFileName;
CLogMessage(CLogCategory::driver()).error(u"Failed to resolve P3D symbols from SimConnect.dll: '%1'") << simConnectFileName;
return false;
}
CLogMessage(CLogCategory::driver()).info("Loaded and resolved P3D symbols from SimConnect.dll: '%1'") << simConnectFileName;
CLogMessage(CLogCategory::driver()).info(u"Loaded and resolved P3D symbols from SimConnect.dll: '%1'") << simConnectFileName;
return resolvedCommon && resolvedP3DSimConnectSymbols;
}
else
{
CLogMessage(CLogCategory::driver()).error("Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString();
CLogMessage(CLogCategory::driver()).error(u"Failed to load SimConnect.dll: '%1' '%2'") << simConnectFileName << simConnectDll.errorString();
return false;
}
}
@@ -289,7 +289,7 @@ bool loadAndResolveFsxSimConnect(bool manifestProbing)
}
else
{
CLogMessage(CLogCategory::driver()).error("Failed to load SimConnect.dll: %1") << simConnectDll.errorString();
CLogMessage(CLogCategory::driver()).error(u"Failed to load SimConnect.dll: %1") << simConnectDll.errorString();
return false;
}
}

View File

@@ -207,7 +207,7 @@ namespace BlackSimPlugin
if (isFailure(hr))
{
this->triggerAutoTraceSendId();
CLogMessage(this).warning("Setting transponder mode failed (SB offsets)");
CLogMessage(this).warning(u"Setting transponder mode failed (SB offsets)");
}
changed = true;
}
@@ -276,9 +276,9 @@ namespace BlackSimPlugin
CStatusMessageList msgs;
if (!CBuildConfig::isLocalDeveloperDebugBuild()) { return msgs; }
msgs = CSimulatorFsCommon::debugVerifyStateAfterAllAircraftRemoved();
if (!m_simConnectObjects.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_simConnectObjects not empty: '%1'") << m_simConnectObjects.getAllCallsignStringsAsString(true)); }
if (!m_simConnectObjectsPositionAndPartsTraces.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_simConnectObjectsPositionAndPartsTraces not empty: '%1'") << m_simConnectObjectsPositionAndPartsTraces.getAllCallsignStringsAsString(true)); }
if (!m_addAgainAircraftWhenRemoved.isEmpty()) { msgs.push_back(CStatusMessage(this).error("m_addAgainAircraftWhenRemoved not empty: '%1'") << m_addAgainAircraftWhenRemoved.getCallsignStrings(true).join(", ")); }
if (!m_simConnectObjects.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_simConnectObjects not empty: '%1'") << m_simConnectObjects.getAllCallsignStringsAsString(true)); }
if (!m_simConnectObjectsPositionAndPartsTraces.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_simConnectObjectsPositionAndPartsTraces not empty: '%1'") << m_simConnectObjectsPositionAndPartsTraces.getAllCallsignStringsAsString(true)); }
if (!m_addAgainAircraftWhenRemoved.isEmpty()) { msgs.push_back(CStatusMessage(this).error(u"m_addAgainAircraftWhenRemoved not empty: '%1'") << m_addAgainAircraftWhenRemoved.getCallsignStrings(true).join(", ")); }
return msgs;
}
@@ -369,7 +369,7 @@ namespace BlackSimPlugin
HRESULT hr = SimConnect_SetClientData(m_hSimConnect, ClientAreaSquawkBox, CSimConnectDefinitions::DataClientAreaSbConnected, SIMCONNECT_CLIENT_DATA_SET_FLAG_DEFAULT, 0, 1, &sbNetworkConnected);
if (isFailure(hr))
{
CLogMessage(this).warning("Setting network connected failed (SB offsets)");
CLogMessage(this).warning(u"Setting network connected failed (SB offsets)");
}
ISimulator::setFlightNetworkConnected(connected);
@@ -472,7 +472,7 @@ namespace BlackSimPlugin
void CSimulatorFsxCommon::onSimStopped()
{
// stopping events in FSX: Load menu, weather and season
CLogMessage(this).info("Simulator stopped: %1") << this->getSimulatorDetails();
CLogMessage(this).info(u"Simulator stopped: %1") << this->getSimulatorDetails();
const SimulatorStatus oldStatus = this->getSimulatorStatus();
m_simSimulating = false;
m_simulatingChangedTs = QDateTime::currentMSecsSinceEpoch();
@@ -493,7 +493,7 @@ namespace BlackSimPlugin
void CSimulatorFsxCommon::onSimExit()
{
CLogMessage(this).info("Simulator exit: %1") << this->getSimulatorDetails();
CLogMessage(this).info(u"Simulator exit: %1") << this->getSimulatorDetails();
// reset complete state, we are going down
m_simulatingChangedTs = QDateTime::currentMSecsSinceEpoch();
@@ -582,7 +582,7 @@ namespace BlackSimPlugin
static const QString format("hh:mm:ss.zzz");
const QString untilString = QDateTime::fromMSecsSinceEpoch(traceUntil).toString(format);
CLogMessage(this).info("Triggered auto trace until %1") << untilString;
CLogMessage(this).info(u"Triggered auto trace until %1") << untilString;
const QPointer<CSimulatorFsxCommon> myself(this);
QTimer::singleShot(traceTimeMs * 1.2, this, [ = ]
{
@@ -590,7 +590,7 @@ namespace BlackSimPlugin
if (!myself) { return; }
if (m_traceAutoUntilTs > QDateTime::currentMSecsSinceEpoch()) { return; }
if (m_traceAutoUntilTs < 0) { return; } // alread off
CLogMessage(this).info("Auto trace id off");
CLogMessage(this).info(u"Auto trace id off");
m_traceAutoUntilTs = -1;
});
return true;
@@ -607,7 +607,7 @@ namespace BlackSimPlugin
if (simulatorOwnAircraft.pitch < -90.0 || simulatorOwnAircraft.pitch >= 90.0)
{
CLogMessage(this).warning("FSX: Pitch value (own aircraft) out of limits: %1") << simulatorOwnAircraft.pitch;
CLogMessage(this).warning(u"FSX: Pitch value (own aircraft) out of limits: %1") << simulatorOwnAircraft.pitch;
}
CAircraftSituation aircraftSituation;
aircraftSituation.setMSecsSinceEpoch(ts);
@@ -884,7 +884,7 @@ namespace BlackSimPlugin
// no callsign
if (callsign.isEmpty())
{
msg = CLogMessage(this).error("Cannot confirm AI object, empty callsign");
msg = CLogMessage(this).error(u"Cannot confirm AI object, empty callsign");
break;
}
@@ -894,12 +894,12 @@ namespace BlackSimPlugin
{
if (aircraftStillInRange)
{
msg = CLogMessage(this).warning("Callsign '%1' removed in meantime from AI objects, but still in range") << callsign.toQString();
msg = CLogMessage(this).warning(u"Callsign '%1' removed in meantime from AI objects, but still in range") << callsign.toQString();
}
else
{
this->removeFromAddPendingAndAddAgainAircraft(callsign);
msg = CLogMessage(this).info("Callsign '%1' removed in meantime and no longer in range") << callsign.toQString();
msg = CLogMessage(this).info(u"Callsign '%1' removed in meantime and no longer in range") << callsign.toQString();
}
break;
}
@@ -909,7 +909,7 @@ namespace BlackSimPlugin
if (!simObject.hasValidRequestAndObjectId() || simObject.isPendingRemoved())
{
msg = CStatusMessage(this).warning("Object for callsign '%1'/id: %2 removed in meantime/invalid") << callsign.toQString() << simObject.getObjectId();
msg = CStatusMessage(this).warning(u"Object for callsign '%1'/id: %2 removed in meantime/invalid") << callsign.toQString() << simObject.getObjectId();
break;
}
@@ -919,7 +919,7 @@ namespace BlackSimPlugin
if (!released)
{
msg = CStatusMessage(this).error("Cannot confirm model '%1' %2") << remoteAircraft.getModelString() << simObject.toQString();
msg = CStatusMessage(this).error(u"Cannot confirm model '%1' %2") << remoteAircraft.getModelString() << simObject.toQString();
break;
}
@@ -942,7 +942,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).warning("Verified aircraft '%1' model '%2', request/object id: %3 %4 was already marked rendered") << callsign.asString() << remoteAircraft.getModelString() << simObject.getRequestId() << simObject.getObjectId();
CLogMessage(this).warning(u"Verified aircraft '%1' model '%2', request/object id: %3 %4 was already marked rendered") << callsign.asString() << remoteAircraft.getModelString() << simObject.getRequestId() << simObject.getObjectId();
}
}
while (false);
@@ -970,7 +970,7 @@ namespace BlackSimPlugin
m_simConnectObjects.removeByOtherSimObject(simObject);
this->removeFromAddPendingAndAddAgainAircraft(simObject.getCallsign());
CLogMessage(this).warning("Model failed to be added: '%1' details: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true);
CLogMessage(this).warning(u"Model failed to be added: '%1' details: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true);
CStatusMessage verifyMsg;
const bool canBeUsed = this->verifyFailedAircraftInfo(simObject, verifyMsg); // aircraft.cfg existing?
if (!verifyMsg.isEmpty()) { CLogMessage::preformatted(verifyMsg); }
@@ -978,14 +978,14 @@ namespace BlackSimPlugin
if (!canBeUsed || simObject.getAddingExceptions() >= ThresholdAddException)
{
const CStatusMessage m = !canBeUsed ?
CLogMessage(this).warning("Model '%1' %2 failed verification and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() :
CLogMessage(this).warning("Model '%1' %2 failed %3 time(s) before and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() << simObject.getAddingExceptions();
CLogMessage(this).warning(u"Model '%1' %2 failed verification and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() :
CLogMessage(this).warning(u"Model '%1' %2 failed %3 time(s) before and will be disabled") << simObject.getAircraftModelString() << simObject.toQString() << simObject.getAddingExceptions();
this->updateAircraftEnabled(simObject.getCallsign(), false); // disable
emit this->physicallyAddingRemoteModelFailed(simObject.getAircraft(), true, m);
}
else
{
CLogMessage(this).info("Will try '%1' again, aircraft: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true);
CLogMessage(this).info(u"Will try '%1' again, aircraft: %2") << simObject.getAircraftModelString() << simObject.getAircraft().toQString(true);
CSimConnectObject simObjAddAgain(simObject);
simObjAddAgain.increaseAddingExceptions();
@@ -1018,18 +1018,18 @@ namespace BlackSimPlugin
{
if (entries.containsTitle(model.getModelString()))
{
messages.push_back(CStatusMessage(this).info("Model '%1' exists in re-parsed file '%2'.") << model.getModelString() << model.getFileName());
messages.push_back(CStatusMessage(this).info(u"Model '%1' exists in re-parsed file '%2'.") << model.getModelString() << model.getFileName());
canBeUsed = true; // all OK
}
else
{
messages.push_back(CStatusMessage(this).warning("Model '%1' no longer in re-parsed file '%2'. Models are: %3.") << model.getModelString() << model.getFileName() << entries.getTitlesAsString(true));
messages.push_back(CStatusMessage(this).warning(u"Model '%1' no longer in re-parsed file '%2'. Models are: %3.") << model.getModelString() << model.getFileName() << entries.getTitlesAsString(true));
canBeUsed = false; // absolute no chance to use that one
}
}
else
{
messages.push_back(CStatusMessage(this).warning("CS: '%1' Cannot parse file: '%2' (existing: %3)") << model.getCallsign().asString() << model.getFileName() << boolToYesNo(model.hasExistingCorrespondingFile()));
messages.push_back(CStatusMessage(this).warning(u"CS: '%1' Cannot parse file: '%2' (existing: %3)") << model.getCallsign().asString() << model.getFileName() << boolToYesNo(model.hasExistingCorrespondingFile()));
}
}
else
@@ -1065,7 +1065,7 @@ namespace BlackSimPlugin
simObject.setConfirmedAdded(true); // terrain probe
simObject.resetTimestampToNow();
cs = simObject.getCallsign();
CLogMessage(this).info("Probe: '%1' '%2' confirmed, %3") << simObject.getCallsignAsString() << simObject.getAircraftModelString() << simObject.toQString();
CLogMessage(this).info(u"Probe: '%1' '%2' confirmed, %3") << simObject.getCallsignAsString() << simObject.getAircraftModelString() << simObject.toQString();
// fails for probe
// SIMCONNECT_DATA_REQUEST_ID requestId = this->obtainRequestIdForSimObjTerrainProbe();
@@ -1075,7 +1075,7 @@ namespace BlackSimPlugin
if (!verified)
{
CLogMessage(this).info("Disable probes: '%1' failed to relase control") << cs.asString();
CLogMessage(this).info(u"Disable probes: '%1' failed to relase control") << cs.asString();
m_useFsxTerrainProbe = false;
}
@@ -1137,7 +1137,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).warning("Pending aircraft without model string will be removed");
CLogMessage(this).warning(u"Pending aircraft without model string will be removed");
m_addPendingAircraft.removeByOtherSimObject(oldestSimObject);
}
}
@@ -1187,19 +1187,19 @@ namespace BlackSimPlugin
m_simConnectObjects.removeByOtherSimObject(simObject); // we have it in pending now, no need to keep it in this list
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
msg = CLogMessage(this).warning("Aircraft removed, '%1' '%2' object id '%3' out of reality bubble or other reason. Interpolator: '%4'")
msg = CLogMessage(this).warning(u"Aircraft removed, '%1' '%2' object id '%3' out of reality bubble or other reason. Interpolator: '%4'")
<< callsign.toQString() << simObject.getAircraftModelString()
<< objectID << simObject.getInterpolatorInfo(setup.getInterpolatorMode());
}
else if (simObject.getAddingDirectlyRemoved() < ThresholdAddedAndDirectlyRemoved)
{
const CStatusMessage m = CLogMessage(this).warning("Aircraft removed again multiple times and will be disabled, '%1' '%2' object id '%3'") << callsign.toQString() << simObject.getAircraftModelString() << objectID;
const CStatusMessage m = CLogMessage(this).warning(u"Aircraft removed again multiple times and will be disabled, '%1' '%2' object id '%3'") << callsign.toQString() << simObject.getAircraftModelString() << objectID;
this->updateAircraftEnabled(simObject.getCallsign(), false);
emit this->physicallyAddingRemoteModelFailed(simObject.getAircraft(), true, m);
}
else
{
msg = CLogMessage(this).warning("Removed '%1' from simulator, but was not initiated by us (swift): %1 '%2' object id %3") << callsign.toQString() << simObject.getAircraftModelString() << objectID;
msg = CLogMessage(this).warning(u"Removed '%1' from simulator, but was not initiated by us (swift): %1 '%2' object id %3") << callsign.toQString() << simObject.getAircraftModelString() << objectID;
}
// in all cases add verification details
@@ -1272,7 +1272,7 @@ namespace BlackSimPlugin
{
const bool trace = parser.toBool(2);
this->setTraceSendId(trace);
CLogMessage(this, CLogCategory::cmdLine()).info("Tracing %1 driver sendIds is '%2'") << this->getSimulatorPluginInfo().getIdentifier() << boolToOnOff(trace);
CLogMessage(this, CLogCategory::cmdLine()).info(u"Tracing %1 driver sendIds is '%2'") << this->getSimulatorPluginInfo().getIdentifier() << boolToOnOff(trace);
return true;
}
@@ -1281,7 +1281,7 @@ namespace BlackSimPlugin
{
const bool on = parser.toBool(2);
this->setUsingSbOffsetValues(on);
CLogMessage(this, CLogCategory::cmdLine()).info("SB offsets is '%1'") << boolToOnOff(on);
CLogMessage(this, CLogCategory::cmdLine()).info(u"SB offsets is '%1'") << boolToOnOff(on);
return true;
}
@@ -1354,12 +1354,12 @@ namespace BlackSimPlugin
{
// 2nd time, an error / avoid multiple messages
// idea: if it happens once ignore
CLogMessage(this).error("%1: Dispatch error") << this->getSimulatorPluginInfo().getIdentifier();
CLogMessage(this).error(u"%1: Dispatch error") << this->getSimulatorPluginInfo().getIdentifier();
}
else if (m_dispatchErrors > 5)
{
// this normally happens during a FSX crash or shutdown with simconnect
CLogMessage(this).error("%1: Multiple dispatch errors, disconnecting") << this->getSimulatorPluginInfo().getIdentifier();
CLogMessage(this).error(u"%1: Multiple dispatch errors, disconnecting") << this->getSimulatorPluginInfo().getIdentifier();
this->disconnectFrom();
}
return;
@@ -1405,7 +1405,7 @@ namespace BlackSimPlugin
if (!outdatedAdded.isEmpty())
{
const CCallsignSet callsigns = outdatedAdded.getAllCallsigns(false);
CLogMessage(this).warning("Removed %1 outdated objects pending for added: %2") << outdatedAdded.size() << callsigns.getCallsignsAsString(true);
CLogMessage(this).warning(u"Removed %1 outdated objects pending for added: %2") << outdatedAdded.size() << callsigns.getCallsignsAsString(true);
this->updateMultipleAircraftEnabled(callsigns, false);
static const QString msgText("%1 oudated adding, %2");
@@ -1441,7 +1441,7 @@ namespace BlackSimPlugin
// same model, nothing will change, otherwise add again when removed
if (sameModel)
{
CLogMessage(this).info("CS: '%1' re-added same model '%2'") << newRemoteAircraft.getCallsignAsString() << newModelString;
CLogMessage(this).info(u"CS: '%1' re-added same model '%2'") << newRemoteAircraft.getCallsignAsString() << newModelString;
// we restore rendered flag in case we are sure we are rendered
// this is used with rematching
@@ -1464,12 +1464,12 @@ namespace BlackSimPlugin
const CAircraftSituationList situations(this->remoteAircraftSituations(callsign));
if (situations.isEmpty())
{
CLogMessage(this).warning("No valid situations for '%1', will be added as pending") << callsign.asString();
CLogMessage(this).warning(u"No valid situations for '%1', will be added as pending") << callsign.asString();
canAdd = false;
}
else
{
CLogMessage(this).warning("Invalid aircraft situation for new aircraft '%1', use closest situation") << callsign.asString();
CLogMessage(this).warning(u"Invalid aircraft situation for new aircraft '%1', use closest situation") << callsign.asString();
situation = situations.findClosestTimeDistanceAdjusted(QDateTime::currentMSecsSinceEpoch());
Q_ASSERT_X(!situation.isPositionOrAltitudeNull(), Q_FUNC_INFO, "Invalid situation for new aircraft");
}
@@ -1480,7 +1480,7 @@ namespace BlackSimPlugin
if (CBuildConfig::isLocalDeveloperDebugBuild())
{
BLACK_VERIFY_X(invalidSituation, Q_FUNC_INFO, "Expect valid situation");
CLogMessage(this).warning("Invalid situation for '%1'") << callsign;
CLogMessage(this).warning(u"Invalid situation for '%1'") << callsign;
}
}
@@ -1499,7 +1499,7 @@ namespace BlackSimPlugin
// create AI after crosschecking it
if (!probe && !this->isAircraftInRange(callsign))
{
CLogMessage(this).info("Skipping adding of '%1' since it is no longer in range") << callsign.asString();
CLogMessage(this).info(u"Skipping adding of '%1' since it is no longer in range") << callsign.asString();
return false;
}
@@ -1540,12 +1540,12 @@ namespace BlackSimPlugin
if (!underflowStatus.isEmpty())
{
CStatusMessage(this).warning("Underflow detecion for '%1', details '%2'") << callsign.asString() << underflowStatus.getMessage();
CStatusMessage(this).warning(u"Underflow detecion for '%1', details '%2'") << callsign.asString() << underflowStatus.getMessage();
}
if (isFailure(hr))
{
const CStatusMessage msg = CStatusMessage(this).error("SimConnect, can not create AI traffic: '%1' '%2'") << callsign.toQString() << modelString;
const CStatusMessage msg = CStatusMessage(this).error(u"SimConnect, can not create AI traffic: '%1' '%2'") << callsign.toQString() << modelString;
CLogMessage::preformatted(msg);
emit this->physicallyAddingRemoteModelFailed(newRemoteAircraft, true, msg);
}
@@ -1600,7 +1600,7 @@ namespace BlackSimPlugin
if (this->physicallyAddAITerrainProbe(coordinate, n)) { c++; }
}
CLogMessage(this).info("Adding %1 FSX terrain probes") << number;
CLogMessage(this).info(u"Adding %1 FSX terrain probes") << number;
m_addedProbes = c;
return c;
}
@@ -1628,7 +1628,7 @@ namespace BlackSimPlugin
{
// problem: we try to delete an aircraft just requested to be added
// best solution so far, call remove again with a delay
CLogMessage(this).warning("'%1' requested to be removed, but pending added (%2) / or pending lights(%3). Object will be removed again: %4")
CLogMessage(this).warning(u"'%1' requested to be removed, but pending added (%2) / or pending lights(%3). Object will be removed again: %4")
<< callsign.asString() << boolToYesNo(pendingAdded)
<< boolToYesNo(stillWaitingForLights) << simObject.toQString();
simObject.setRemovedWhileAdding(true); // next time kill
@@ -1636,7 +1636,7 @@ namespace BlackSimPlugin
QTimer::singleShot(2000, this, [ = ]
{
if (!myself) { return; }
CLogMessage(this).info("Next trail to remove '%1'") << callsign.asString();
CLogMessage(this).info(u"Next trail to remove '%1'") << callsign.asString();
myself->physicallyRemoveRemoteAircraft(callsign);
});
return false; // not yet deleted
@@ -1660,7 +1660,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).warning("Removing aircraft '%1' from simulator failed") << callsign.asString();
CLogMessage(this).warning(u"Removing aircraft '%1' from simulator failed") << callsign.asString();
}
// mark in provider
@@ -1711,7 +1711,7 @@ namespace BlackSimPlugin
hr += SimConnect_SubscribeToSystemEvent(m_hSimConnect, SystemEventFlightLoaded, "FlightLoaded");
if (isFailure(hr))
{
CLogMessage(this).error("FSX plugin error: %1") << "SimConnect_SubscribeToSystemEvent failed";
CLogMessage(this).error(u"FSX plugin error: %1") << "SimConnect_SubscribeToSystemEvent failed";
return hr;
}
@@ -1755,7 +1755,7 @@ namespace BlackSimPlugin
if (isFailure(hr))
{
CLogMessage(this).error("FSX plugin error: %1") << "SimConnect_MapClientEventToSimEvent failed";
CLogMessage(this).error(u"FSX plugin error: %1") << "SimConnect_MapClientEventToSimEvent failed";
return hr;
}
@@ -1764,7 +1764,7 @@ namespace BlackSimPlugin
hr += SimConnect_SubscribeToFacilities(m_hSimConnect, SIMCONNECT_FACILITY_LIST_TYPE_AIRPORT, requestId);
if (isFailure(hr))
{
CLogMessage(this).error("FSX plugin error: %1") << "SimConnect_SubscribeToFacilities failed";
CLogMessage(this).error(u"FSX plugin error: %1") << "SimConnect_SubscribeToFacilities failed";
return hr;
}
return hr;
@@ -1782,7 +1782,7 @@ namespace BlackSimPlugin
HRESULT hr = this->initEvents();
if (isFailure(hr))
{
CLogMessage(this).error("FSX plugin: initEvents failed");
CLogMessage(this).error(u"FSX plugin: initEvents failed");
return hr;
}
@@ -1790,7 +1790,7 @@ namespace BlackSimPlugin
hr += this->initDataDefinitionsWhenConnected();
if (isFailure(hr))
{
CLogMessage(this).error("FSX plugin: initDataDefinitionsWhenConnected failed");
CLogMessage(this).error(u"FSX plugin: initDataDefinitionsWhenConnected failed");
return hr;
}
@@ -2088,7 +2088,7 @@ namespace BlackSimPlugin
if (position.Airspeed < 2)
{
position.OnGround = 1U;
if (details) { *details = CStatusMessage(getLogCategories()).warning("Force GND flag for underflow protection"); }
if (details) { *details = CStatusMessage(getLogCategories()).warning(u"Force GND flag for underflow protection"); }
break;
}
}
@@ -2193,12 +2193,12 @@ namespace BlackSimPlugin
if (isFailure(hr1, hr2))
{
CLogMessage(this).warning("Sending time sync failed!");
CLogMessage(this).warning(u"Sending time sync failed!");
}
else
{
m_syncTimeDeferredCounter = 5; // allow some time to sync
CLogMessage(this).info("Synchronized time to UTC: '%1'") << myTime.toString();
CLogMessage(this).info(u"Synchronized time to UTC: '%1'") << myTime.toString();
}
}
@@ -2474,7 +2474,7 @@ namespace BlackSimPlugin
}
else
{
CLogMessage(this).warning("Removing probe '%1' from simulator failed") << probeSimObject.getObjectId();
CLogMessage(this).warning(u"Removing probe '%1' from simulator failed") << probeSimObject.getObjectId();
}
}
m_simConnectObjects.removeAllProbes();
@@ -2689,7 +2689,7 @@ namespace BlackSimPlugin
simListener->m_simConnectVersion = QStringLiteral("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor);
simListener->m_simulatorName = CSimulatorFsxCommon::fsxCharToQString(event->szApplicationName);
simListener->m_simulatorDetails = QStringLiteral("Name: '%1' Version: %2 SimConnect: %3").arg(simListener->m_simulatorName, simListener->m_simulatorVersion, simListener->m_simConnectVersion);
const CStatusMessage msg = CStatusMessage(simListener).info("Connect to %1: '%2'") << simListener->getPluginInfo().getIdentifier() << simListener->backendInfo();
const CStatusMessage msg = CStatusMessage(simListener).info(u"Connect to %1: '%2'") << simListener->getPluginInfo().getIdentifier() << simListener->backendInfo();
// avoid the same message over and over again
if (msg.getMessage() != simListener->m_lastMessage.getMessage())

View File

@@ -56,7 +56,7 @@ namespace BlackSimPlugin
const QString details = QStringLiteral("Name: '%1' Version: %2 SimConnect: %3").arg(name, version, simConnectVersion);
simulatorFsxP3D->setSimulatorDetails(name, details, version);
simulatorFsxP3D->m_simConnectVersion = simConnectVersion;
CLogMessage(simulatorFsxP3D).info("Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << details;
CLogMessage(simulatorFsxP3D).info(u"Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << details;
simulatorFsxP3D->setSimConnected();
break; // SIMCONNECT_RECV_ID_OPEN
}
@@ -95,10 +95,10 @@ namespace BlackSimPlugin
{
const bool removed = simulatorFsxP3D->m_simConnectObjects.remove(simObject.getCallsign());
Q_UNUSED(removed);
CLogMessage(simulatorFsxP3D).warning("Adding probe failed: %1 %2") << simObject.getCallsign().asString() << simObject.getAircraftModelString();
CLogMessage(simulatorFsxP3D).warning(u"Adding probe failed: %1 %2") << simObject.getCallsign().asString() << simObject.getAircraftModelString();
if (simulatorFsxP3D->isUsingFsxTerrainProbe())
{
CLogMessage(simulatorFsxP3D).warning("Disabling terrain probe");
CLogMessage(simulatorFsxP3D).warning(u"Disabling terrain probe");
simulatorFsxP3D->setUsingFsxTerrainProbe(false);
}
logGenericExceptionInfo = false;
@@ -118,7 +118,7 @@ namespace BlackSimPlugin
ex.sprintf("Exception=%lu | SendID=%lu | Index=%lu | cbData=%lu", exceptionId, sendId, index, data);
const QString exceptionString(CSimConnectUtilities::simConnectExceptionToString(static_cast<DWORD>(exception->dwException)));
const QString sendIdDetails = simulatorFsxP3D->getSendIdTraceDetails(sendId);
CLogMessage(simulatorFsxP3D).warning("Caught simConnect exception: '%1' '%2' | send details: '%3'")
CLogMessage(simulatorFsxP3D).warning(u"Caught simConnect exception: '%1' '%2' | send details: '%3'")
<< exceptionString << ex
<< (sendIdDetails.isEmpty() ? "N/A" : sendIdDetails);
}
@@ -221,7 +221,7 @@ namespace BlackSimPlugin
{
const CSimConnectObject simObject = simulatorFsxP3D->getSimObjectForObjectId(objectId);
const CSimulatedAircraft remoteAircraft(simObject.getAircraft());
const CStatusMessage msg = CStatusMessage(simulatorFsxP3D).error("Cannot add object %1, cs: '%2' model: '%3'") << objectId << remoteAircraft.getCallsignAsString() << remoteAircraft.getModelString();
const CStatusMessage msg = CStatusMessage(simulatorFsxP3D).error(u"Cannot add object %1, cs: '%2' model: '%3'") << objectId << remoteAircraft.getCallsignAsString() << remoteAircraft.getModelString();
CLogMessage::preformatted(msg);
emit simulatorFsxP3D->physicallyAddingRemoteModelFailed(remoteAircraft, false, msg);
}
@@ -312,7 +312,7 @@ namespace BlackSimPlugin
{
if (CBuildConfig::isLocalDeveloperDebugBuild())
{
CLogMessage(simulatorFsxP3D).error("Unknown subrequest (aircraft): '%1' %2")
CLogMessage(simulatorFsxP3D).error(u"Unknown subrequest (aircraft): '%1' %2")
<< CSimConnectDefinitions::simObjectRequestToString(subRequest)
<< simObject.toQString();
}
@@ -341,7 +341,7 @@ namespace BlackSimPlugin
{
if (CBuildConfig::isLocalDeveloperDebugBuild())
{
CLogMessage(simulatorFsxP3D).error("Unknown subrequest (probe): '%1' %2")
CLogMessage(simulatorFsxP3D).error(u"Unknown subrequest (probe): '%1' %2")
<< CSimConnectDefinitions::simObjectRequestToString(subRequest)
<< probeObj.toQString();
}

View File

@@ -138,7 +138,7 @@ namespace BlackSimPlugin
}
else
{
const CStatusMessage msg = CStatusMessage(this).error("SimConnect, can not request ground info: '%1' '%2'") << requestId << callsign.asString();
const CStatusMessage msg = CStatusMessage(this).error(u"SimConnect, can not request ground info: '%1' '%2'") << requestId << callsign.asString();
CLogMessage::preformatted(msg);
}
@@ -236,7 +236,7 @@ namespace BlackSimPlugin
HRESULT hr = s_ok();
if (isFailure(hr))
{
CLogMessage(this).error("P3D plugin error: %1") << "initEventsP3D failed";
CLogMessage(this).error(u"P3D plugin error: %1") << "initEventsP3D failed";
return hr;
}
return hr;

View File

@@ -468,7 +468,7 @@ namespace BlackSimPlugin
Q_UNUSED(offset);
if (enable)
{
CLogMessage(this).info("X-Plane provides real time synchronization, use this one");
CLogMessage(this).info(u"X-Plane provides real time synchronization, use this one");
}
return false;
}
@@ -566,7 +566,7 @@ namespace BlackSimPlugin
}
}
while (dir.cdUp());
CLogMessage(this).warning("Failed to find CSL package for %1") << modelFile;
CLogMessage(this).warning(u"Failed to find CSL package for %1") << modelFile;
return {};
}
@@ -583,14 +583,14 @@ namespace BlackSimPlugin
if (!this->isAircraftInRange(newRemoteAircraft.getCallsign()))
{
// next cycle will be called by callbacks or timer
CLogMessage(this).warning("Aircraft '%1' no longer in range, will not add") << newRemoteAircraft.getCallsign();
CLogMessage(this).warning(u"Aircraft '%1' no longer in range, will not add") << newRemoteAircraft.getCallsign();
return false;
}
if (this->canAddAircraft())
{
// no aircraft pending, add
CLogMessage(this).info("Adding '%1' to XPlane") << newRemoteAircraft.getCallsign();
CLogMessage(this).info(u"Adding '%1' to XPlane") << newRemoteAircraft.getCallsign();
const qint64 now = QDateTime::currentMSecsSinceEpoch();
m_addingInProgressAircraft.insert(newRemoteAircraft.getCallsign(), now);
const QString callsign = newRemoteAircraft.getCallsign().asString();
@@ -990,17 +990,17 @@ namespace BlackSimPlugin
if (!addedRemoteAircraft.hasCallsign())
{
CLogMessage(this).warning("Aircraft '%1' no longer in range, will be removed") << callsign;
CLogMessage(this).warning(u"Aircraft '%1' no longer in range, will be removed") << callsign;
this->triggerRemoveAircraft(cs, TimeoutAdding);
return;
}
CLogMessage(this).info("Added aircraft '%1'") << callsign;
CLogMessage(this).info(u"Added aircraft '%1'") << callsign;
if (!wasPending)
{
// timeout?
// slow adding?
CLogMessage(this).warning("Added callsign '%1' was not in progress anymore. Timeout?") << callsign;
CLogMessage(this).warning(u"Added callsign '%1' was not in progress anymore. Timeout?") << callsign;
}
const bool rendered = true;
@@ -1021,12 +1021,12 @@ namespace BlackSimPlugin
if (failedRemoteAircraft.hasCallsign())
{
CLogMessage(this).warning("Adding aircraft failed: '%1'") << callsign;
CLogMessage(this).warning(u"Adding aircraft failed: '%1'") << callsign;
failedRemoteAircraft.setRendered(false);
}
else
{
CLogMessage(this).warning("Adding '%1' failed, but aircraft no longer in range, will be removed") << callsign;
CLogMessage(this).warning(u"Adding '%1' failed, but aircraft no longer in range, will be removed") << callsign;
}
const bool wasPending = (m_addingInProgressAircraft.remove(cs) > 0);
@@ -1053,7 +1053,7 @@ namespace BlackSimPlugin
// next add cycle
const CSimulatedAircraft newRemoteAircraft = m_pendingToBeAddedAircraft.front();
m_pendingToBeAddedAircraft.pop_front();
CLogMessage(this).info("Adding next pending aircraft '%1', pending %2, in progress %3") << newRemoteAircraft.getCallsignAsString() << m_pendingToBeAddedAircraft.size() << m_addingInProgressAircraft.size();
CLogMessage(this).info(u"Adding next pending aircraft '%1', pending %2, in progress %3") << newRemoteAircraft.getCallsignAsString() << m_pendingToBeAddedAircraft.size() << m_addingInProgressAircraft.size();
this->physicallyAddRemoteAircraft(newRemoteAircraft);
}
@@ -1082,7 +1082,7 @@ namespace BlackSimPlugin
for (const CCallsign &cs : as_const(timeoutCallsigns))
{
m_addingInProgressAircraft.remove(cs);
CLogMessage(this).warning("Adding for '%1' timed out") << cs.asString();
CLogMessage(this).warning(u"Adding for '%1' timed out") << cs.asString();
}
return timeoutCallsigns.size();
@@ -1214,20 +1214,20 @@ namespace BlackSimPlugin
QString xswiftbusVersion = service.getVersionNumber();
if (! swiftVersion.contains(xswiftbusVersion))
{
CLogMessage(this).error("You are using an incorrect version of XSwiftBus. Make sure to install %1 into X-Plane plugins!") << xswiftbusVersion;
CLogMessage(this).error(u"You are using an incorrect version of XSwiftBus. Make sure to install %1 into X-Plane plugins!") << xswiftbusVersion;
return;
}
if (!traffic.initialize())
{
CLogMessage(this).error("Connection to XSwiftBus successful, but could not initialize XSwiftBus. Check X-Plane Log.txt.");
CLogMessage(this).error(u"Connection to XSwiftBus successful, but could not initialize XSwiftBus. Check X-Plane Log.txt.");
return;
}
MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes();
if (! info.hasAcquired)
{
CLogMessage(this).error("Connection to XSwiftBus successful, but could not acquire multiplayer planes. %1 has acquired them already. Disable %2 or remove it if not required and reload XSwiftBus.") << info.owner << info.owner;
CLogMessage(this).error(u"Connection to XSwiftBus successful, but could not acquire multiplayer planes. %1 has acquired them already. Disable %2 or remove it if not required and reload XSwiftBus.") << info.owner << info.owner;
return;
}

View File

@@ -47,7 +47,7 @@ namespace BlackSimPlugin
reply.waitForFinished();
if (reply.isError())
{
BlackMisc::CLogMessage(this).debug("CXSwiftBusTrafficProxy::acquireMultiplayerPlanes returned: %1") << reply.error().message();
BlackMisc::CLogMessage(this).debug(u"CXSwiftBusTrafficProxy::acquireMultiplayerPlanes returned: %1") << reply.error().message();
}
MultiplayerAcquireInfo info;
info.hasAcquired = reply.argumentAt<0>();

View File

@@ -69,7 +69,7 @@ namespace BlackWxPlugin
{
if (!sApp->isInternetAccessible())
{
CLogMessage(this).error("No weather download since network/internet not accessible");
CLogMessage(this).error(u"No weather download since network/internet not accessible");
return;
}
@@ -256,22 +256,22 @@ namespace BlackWxPlugin
g2int expand = 1;
gribfield *gfld = nullptr;
g2_getfld(readPtr, n + 1, unpack, expand, &gfld);
if (gfld->idsectlen < 12) { CLogMessage(this).warning("Identification section: wrong length!"); continue; }
if (gfld->idsectlen < 12) { CLogMessage(this).warning(u"Identification section: wrong length!"); continue; }
if (gfld->igdtnum != 0) { CLogMessage(this).warning("Can handle only grid definition template number = 0"); }
if (gfld->igdtnum != 0) { CLogMessage(this).warning(u"Can handle only grid definition template number = 0"); }
int nscan = gfld->igdtmpl[18];
int npnts = gfld->ngrdpts;
int nx = gfld->igdtmpl[7];
int ny = gfld->igdtmpl[8];
if (nscan != 0) { CLogMessage(this).error("Can only handle scanning mode NS:WE."); }
if (npnts != nx * ny) { CLogMessage(this).error("Cannot handle non-regular grid."); }
if (nscan != 0) { CLogMessage(this).error(u"Can only handle scanning mode NS:WE."); }
if (npnts != nx * ny) { CLogMessage(this).error(u"Cannot handle non-regular grid."); }
if (m_gfsWeatherGrid.empty()) { createWeatherGrid(gfld); }
if (gfld->ipdtnum == 0) { handleProductDefinitionTemplate40(gfld); }
else if (gfld->ipdtnum == 8) { handleProductDefinitionTemplate48(gfld); }
else { CLogMessage(this).warning("Cannot handle product definition template %1") << gfld->ipdtnum; continue; }
else { CLogMessage(this).warning(u"Cannot handle product definition template %1") << gfld->ipdtnum; continue; }
g2_free(gfld);
}
@@ -398,17 +398,17 @@ namespace BlackWxPlugin
if (latitude1 < -90.0 || latitude2 < -90.0 || latitude1 > 90.0 || latitude2 > 90.0)
{
CLogMessage(this).warning("Invalid grid definition: lat1 = %1 - lat2 = %2") << latitude1 << latitude2;
CLogMessage(this).warning(u"Invalid grid definition: lat1 = %1 - lat2 = %2") << latitude1 << latitude2;
return;
}
if (longitude1 < 0.0 || longitude2 < 0.0 || longitude1 > 360.0 || longitude2 > 360.0)
{
CLogMessage(this).warning("Invalid grid definition: lon1 = %1 - lon2 = %2") << longitude1 << longitude2;
CLogMessage(this).warning(u"Invalid grid definition: lon1 = %1 - lon2 = %2") << longitude1 << longitude2;
return;
}
if (npnts != nx * ny)
{
CLogMessage(this).warning("Invalid grid definition: npnts != nx * ny!");
CLogMessage(this).warning(u"Invalid grid definition: npnts != nx * ny!");
return;
}
@@ -418,7 +418,7 @@ namespace BlackWxPlugin
if (south > north)
{
CLogMessage(this).warning("Invalid grid definition: South = %1 - North = %2") << south << north;
CLogMessage(this).warning(u"Invalid grid definition: South = %1 - North = %2") << south << north;
return;
}
@@ -430,7 +430,7 @@ namespace BlackWxPlugin
{
if (fabs(dy - dlatitude) > 0.001)
{
CLogMessage(this).warning("Invalid grid definition: delta latitude is inconsistent");
CLogMessage(this).warning(u"Invalid grid definition: delta latitude is inconsistent");
return;
}
}
@@ -460,7 +460,7 @@ namespace BlackWxPlugin
{
if (fabs(dx - fabs(dlongitude)) > 0.001)
{
CLogMessage(this).warning("Invalid grid definition: delta longitude is inconsistent");
CLogMessage(this).warning(u"Invalid grid definition: delta longitude is inconsistent");
return;
}
}
@@ -511,7 +511,7 @@ namespace BlackWxPlugin
{
if (gfld->ipdtlen != 15)
{
CLogMessage(this).warning("Template 4.0 has wrong length");
CLogMessage(this).warning(u"Template 4.0 has wrong length");
return;
}
@@ -525,7 +525,7 @@ namespace BlackWxPlugin
// Make sure the key exists
if (!m_grib2ParameterTable.contains(key))
{
CLogMessage(this).warning("Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber;
CLogMessage(this).warning(u"Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber;
return;
}
@@ -539,7 +539,7 @@ namespace BlackWxPlugin
level = std::round(millibarToLevel(valueFirstFixedSurface));
break;
default:
CLogMessage(this).warning("Unexpected first fixed surface type: %1") << typeFirstFixedSurface;
CLogMessage(this).warning(u"Unexpected first fixed surface type: %1") << typeFirstFixedSurface;
return;
}
@@ -573,7 +573,7 @@ namespace BlackWxPlugin
{
if (gfld->ipdtlen != 29)
{
CLogMessage(this).warning("Template 4.8 has wrong length.");
CLogMessage(this).warning(u"Template 4.8 has wrong length.");
return;
}
@@ -585,7 +585,7 @@ namespace BlackWxPlugin
// Make sure the key exists
if (!m_grib2ParameterTable.contains(key))
{
CLogMessage(this).warning("Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber;
CLogMessage(this).warning(u"Unknown GRIB2 parameter: %1 - %2") << parameterCategory << parameterNumber;
return;
}