mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 17:30:12 +08:00
Fixing some bugs in simulator, use CCrashHandler::instance()->crashAndLogAppendInfo IF NOT shutting down
This commit is contained in:
committed by
Mat Sutcliffe
parent
1fb97755ce
commit
fccaf1fae1
@@ -174,8 +174,9 @@ namespace BlackCore
|
|||||||
void ISimulator::reloadWeatherSettings()
|
void ISimulator::reloadWeatherSettings()
|
||||||
{
|
{
|
||||||
// log crash info about weather
|
// log crash info about weather
|
||||||
if (this->isShuttingDown()) { CCrashHandler::instance()->crashAndLogAppendInfo(u"Simulator weather: " % boolToYesNo(m_isWeatherActivated)); }
|
if (!this->isShuttingDown()) { CCrashHandler::instance()->crashAndLogAppendInfo(u"Simulator weather: " % boolToYesNo(m_isWeatherActivated)); }
|
||||||
if (!m_isWeatherActivated) { return; }
|
if (!m_isWeatherActivated) { return; }
|
||||||
|
|
||||||
m_lastWeatherPosition.setNull();
|
m_lastWeatherPosition.setNull();
|
||||||
const CWeatherScenario selectedWeatherScenario = m_weatherScenarioSettings.get();
|
const CWeatherScenario selectedWeatherScenario = m_weatherScenarioSettings.get();
|
||||||
if (CWeatherScenario::isRealWeatherScenario(selectedWeatherScenario))
|
if (CWeatherScenario::isRealWeatherScenario(selectedWeatherScenario))
|
||||||
@@ -196,7 +197,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
// log crash info about weather
|
// log crash info about weather
|
||||||
if (this->isShuttingDown()) { CCrashHandler::instance()->crashAndLogAppendInfo(selectedWeatherScenario.toQString(true)); }
|
if (!this->isShuttingDown()) { CCrashHandler::instance()->crashAndLogAppendInfo(selectedWeatherScenario.toQString(true)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void ISimulator::clearAllRemoteAircraftData()
|
void ISimulator::clearAllRemoteAircraftData()
|
||||||
@@ -1010,7 +1011,7 @@ namespace BlackCore
|
|||||||
const bool r = setup.isRenderingRestricted();
|
const bool r = setup.isRenderingRestricted();
|
||||||
const bool e = setup.isRenderingEnabled();
|
const bool e = setup.isRenderingEnabled();
|
||||||
|
|
||||||
if (sApp && !sApp->isShuttingDown()) { CCrashHandler::instance()->crashAndLogAppendInfo(u"Rendering setup: " % setup.toQString(true)); }
|
if (!this->isShuttingDown()) { CCrashHandler::instance()->crashAndLogAppendInfo(u"Rendering setup: " % setup.toQString(true)); }
|
||||||
emit this->renderRestrictionsChanged(r, e, setup.getMaxRenderedAircraft(), setup.getMaxRenderedDistance());
|
emit this->renderRestrictionsChanged(r, e, setup.getMaxRenderedAircraft(), setup.getMaxRenderedDistance());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1115,17 +1116,18 @@ namespace BlackCore
|
|||||||
|
|
||||||
bool ISimulator::disconnectFrom()
|
bool ISimulator::disconnectFrom()
|
||||||
{
|
{
|
||||||
m_averageFps = -1.0;
|
m_averageFps = -1.0;
|
||||||
m_simTimeRatio = 1.0;
|
m_simTimeRatio = 1.0;
|
||||||
m_trackMilesShort = 0.0;
|
m_trackMilesShort = 0.0;
|
||||||
m_minutesLate = 0.0;
|
m_minutesLate = 0.0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ISimulator::logicallyReAddRemoteAircraft(const CCallsign &callsign)
|
bool ISimulator::logicallyReAddRemoteAircraft(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
if (this->isShuttingDown()) { return false; }
|
if (this->isShuttingDown()) { return false; }
|
||||||
if (callsign.isEmpty()) { return false; }
|
if (callsign.isEmpty()) { return false; }
|
||||||
|
|
||||||
this->stopHighlighting();
|
this->stopHighlighting();
|
||||||
this->logicallyRemoveRemoteAircraft(callsign);
|
this->logicallyRemoveRemoteAircraft(callsign);
|
||||||
if (!this->isAircraftInRange(callsign)) { return false; }
|
if (!this->isAircraftInRange(callsign)) { return false; }
|
||||||
@@ -1214,7 +1216,7 @@ namespace BlackCore
|
|||||||
void ISimulator::finishUpdateRemoteAircraftAndSetStatistics(qint64 startTime, bool limited)
|
void ISimulator::finishUpdateRemoteAircraftAndSetStatistics(qint64 startTime, bool limited)
|
||||||
{
|
{
|
||||||
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
||||||
const qint64 dt = now - startTime;
|
const qint64 dt = now - startTime;
|
||||||
m_statsCurrentUpdateTimeMs = dt;
|
m_statsCurrentUpdateTimeMs = dt;
|
||||||
m_statsUpdateAircraftTimeTotalMs += dt;
|
m_statsUpdateAircraftTimeTotalMs += dt;
|
||||||
m_statsUpdateAircraftRuns++;
|
m_statsUpdateAircraftRuns++;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace BlackMisc
|
|||||||
// crash info
|
// crash info
|
||||||
void triggerCrashInfoWrite();
|
void triggerCrashInfoWrite();
|
||||||
|
|
||||||
BlackMisc::CCrashInfo m_crashAndLogInfo; //!< info representing details
|
BlackMisc::CCrashInfo m_crashAndLogInfo; //!< info representing details
|
||||||
BlackMisc::CDigestSignal m_dsCrashAndLogInfo { this, &CCrashHandler::triggerCrashInfoWrite, 10000, 5 };
|
BlackMisc::CDigestSignal m_dsCrashAndLogInfo { this, &CCrashHandler::triggerCrashInfoWrite, 10000, 5 };
|
||||||
|
|
||||||
#ifdef BLACK_USE_CRASHPAD
|
#ifdef BLACK_USE_CRASHPAD
|
||||||
|
|||||||
Reference in New Issue
Block a user