mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Issue #77 Rename
This commit is contained in:
@@ -501,7 +501,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||
|
||||
// entry checks
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(!newRemoteAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||
Q_ASSERT_X(newRemoteAircraft.hasModelString(), Q_FUNC_INFO, "missing model string");
|
||||
|
||||
@@ -557,7 +557,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||
|
||||
// only remove from sim
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
if (callsign.isEmpty()) { return false; } // can happen if an object is not an aircraft
|
||||
|
||||
// really remove from simulator
|
||||
@@ -622,7 +622,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFlightgear::updateRemoteAircraft()
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
|
||||
const int remoteAircraftNo = this->getAircraftInRangeCount();
|
||||
if (remoteAircraftNo < 1) { return; }
|
||||
@@ -1042,7 +1042,7 @@ namespace BlackSimPlugin
|
||||
void CSimulatorFlightgearListener::checkConnection()
|
||||
{
|
||||
if (this->isShuttingDown()) { return; }
|
||||
Q_ASSERT_X(!CThreadUtils::isCurrentThreadApplicationThread(), Q_FUNC_INFO, "Expect to run in background");
|
||||
Q_ASSERT_X(!CThreadUtils::thisIsMainThread(), Q_FUNC_INFO, "Expect to run in background");
|
||||
|
||||
QString dbusAddress = m_fgSswiftBusServerSetting.getThreadLocal();
|
||||
if (CDBusServer::isSessionOrSystemAddress(dbusAddress))
|
||||
|
||||
@@ -515,7 +515,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDownOrDisconnected()) { return; }
|
||||
if (weatherGrid.isEmpty()) { return; }
|
||||
|
||||
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
||||
if (!CThreadUtils::isInThisThread(this))
|
||||
{
|
||||
BLACK_VERIFY_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Wrong thread");
|
||||
QPointer<CSimulatorFs9> myself(this);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CFsuipc::open(bool force)
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
DWORD dwResult;
|
||||
m_lastErrorMessage = "";
|
||||
m_lastErrorIndex = 0;
|
||||
@@ -119,7 +119,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CFsuipc::close()
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
if (m_opened)
|
||||
{
|
||||
CLogMessage(this).info(u"Closing FSUIPC: %1") << m_fsuipcVersion;
|
||||
@@ -150,7 +150,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CFsuipc::write(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
if (!this->isOpened()) { return false; }
|
||||
|
||||
quint16 com1ActiveRaw = static_cast<quint16>(aircraft.getCom1System().getFrequencyActive().value(CFrequencyUnit::MHz()) * 100);
|
||||
@@ -180,7 +180,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CFsuipc::write(const CTransponder &xpdr)
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
if (!this->isOpened()) { return false; }
|
||||
|
||||
// should be the same as writing via SimConnect data area
|
||||
@@ -196,7 +196,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CFsuipc::write(const CWeatherGrid &weatherGrid)
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
if (!this->isOpened()) { return false; }
|
||||
|
||||
if (weatherGrid.isEmpty()) { return false; }
|
||||
@@ -333,7 +333,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CFsuipc::setSimulatorTime(int hour, int minute)
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
if (!this->isOpened()) { return false; }
|
||||
|
||||
// should be the same as writing via SimConnect data area
|
||||
@@ -355,7 +355,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CFsuipc::read(CSimulatedAircraft &aircraft, bool cockpit, bool situation, bool aircraftParts)
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||
DWORD dwResult = 0;
|
||||
char localFsTimeRaw[3];
|
||||
char modelNameRaw[256];
|
||||
|
||||
@@ -1513,7 +1513,7 @@ namespace BlackSimPlugin
|
||||
const bool probe = newRemoteAircraft.isTerrainProbe();
|
||||
|
||||
// entry checks
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||
Q_ASSERT_X(newRemoteAircraft.hasModelString(), Q_FUNC_INFO, "missing model string");
|
||||
|
||||
@@ -1701,7 +1701,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
if (coordinate.isNull()) { return false; }
|
||||
if (!this->isUsingFsxTerrainProbe()) { return false; }
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
|
||||
// static const QString modelString("OrcaWhale");
|
||||
// static const QString modelString("Water Drop"); // not working on P3Dx86/FSX, no requests on that id possible
|
||||
@@ -1745,7 +1745,7 @@ namespace BlackSimPlugin
|
||||
bool CSimulatorFsxCommon::physicallyRemoveRemoteAircraft(const CCallsign &callsign)
|
||||
{
|
||||
// only remove from sim
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
if (callsign.isEmpty()) { return false; } // can happen if an object is not an aircraft
|
||||
|
||||
// clean up anyway
|
||||
@@ -1939,7 +1939,7 @@ namespace BlackSimPlugin
|
||||
void CSimulatorFsxCommon::updateRemoteAircraft()
|
||||
{
|
||||
static_assert(sizeof(DataDefinitionRemoteAircraftPartsWithoutLights) == sizeof(double) * 10, "DataDefinitionRemoteAircraftPartsWithoutLights has an incorrect size.");
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
|
||||
// Freeze interpolation while paused
|
||||
if (this->isPaused() && m_pausedSimFreezesInterpolation) { return; }
|
||||
@@ -2395,7 +2395,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDownOrDisconnected()) { return; }
|
||||
if (weatherGrid.isEmpty()) { return; }
|
||||
|
||||
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
||||
if (!CThreadUtils::isInThisThread(this))
|
||||
{
|
||||
BLACK_VERIFY_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Wrong thread");
|
||||
QPointer<CSimulatorFsxCommon> myself(this);
|
||||
@@ -2841,7 +2841,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFsxCommonListener::checkConnection()
|
||||
{
|
||||
Q_ASSERT_X(!CThreadUtils::isCurrentThreadApplicationThread(), Q_FUNC_INFO, "Expect to run in background");
|
||||
Q_ASSERT_X(!CThreadUtils::thisIsMainThread(), Q_FUNC_INFO, "Expect to run in background");
|
||||
|
||||
// check before we access the sim. connection
|
||||
if (this->isShuttingDown() || this->thread()->isInterruptionRequested())
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDown()) { return false; }
|
||||
if (!this->isConnected()) { return false; }
|
||||
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
const bool hasHeight = reference.hasMSLGeodeticHeight();
|
||||
const double latDeg = reference.latitude().value(CAngleUnit::deg());
|
||||
const double lngDeg = reference.longitude().value(CAngleUnit::deg());
|
||||
|
||||
@@ -765,7 +765,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||
|
||||
// entry checks
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(!newRemoteAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||
Q_ASSERT_X(newRemoteAircraft.hasModelString(), Q_FUNC_INFO, "missing model string");
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace BlackSimPlugin
|
||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||
|
||||
// only remove from sim
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
if (callsign.isEmpty()) { return false; } // can happen if an object is not an aircraft
|
||||
|
||||
// really remove from simulator
|
||||
@@ -901,7 +901,7 @@ namespace BlackSimPlugin
|
||||
if (weatherGrid.isEmpty()) { return; }
|
||||
if (!this->isWeatherActivated()) { return; }
|
||||
|
||||
if (!CThreadUtils::isCurrentThreadObjectThread(this))
|
||||
if (!CThreadUtils::isInThisThread(this))
|
||||
{
|
||||
|
||||
BLACK_VERIFY_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Wrong thread");
|
||||
@@ -1003,7 +1003,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorXPlane::updateRemoteAircraft()
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "thread");
|
||||
|
||||
const int remoteAircraftNo = this->getAircraftInRangeCount();
|
||||
if (remoteAircraftNo < 1) { return; }
|
||||
@@ -1467,7 +1467,7 @@ namespace BlackSimPlugin
|
||||
void CSimulatorXPlaneListener::checkConnection()
|
||||
{
|
||||
if (this->isShuttingDown()) { return; }
|
||||
Q_ASSERT_X(!CThreadUtils::isCurrentThreadApplicationThread(), Q_FUNC_INFO, "Expect to run in background");
|
||||
Q_ASSERT_X(!CThreadUtils::thisIsMainThread(), Q_FUNC_INFO, "Expect to run in background");
|
||||
QElapsedTimer t; t.start();
|
||||
|
||||
QString via;
|
||||
|
||||
Reference in New Issue
Block a user