mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Issue #77 getLogCategories returns a simple QStringList instead of our own class
This commit is contained in:
@@ -198,14 +198,14 @@ namespace BlackCore
|
||||
|
||||
int CContextSimulator::checkListeners()
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_plugins) { return 0; }
|
||||
return m_plugins->checkAvailableListeners();
|
||||
}
|
||||
|
||||
int CContextSimulator::getSimulatorStatus() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return 0; }
|
||||
return m_simulatorPlugin.second->getSimulatorStatus();
|
||||
}
|
||||
@@ -213,7 +213,7 @@ namespace BlackCore
|
||||
CSimulatorPluginInfo CContextSimulator::getSimulatorPluginInfo() const
|
||||
{
|
||||
static const CSimulatorPluginInfo unspecified;
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return unspecified; }
|
||||
if (m_simulatorPlugin.first.getSimulator().contains("emulated", Qt::CaseInsensitive)) { return m_simulatorPlugin.second->getSimulatorPluginInfo(); }
|
||||
return m_simulatorPlugin.first;
|
||||
@@ -221,14 +221,14 @@ namespace BlackCore
|
||||
|
||||
CSimulatorInternals CContextSimulator::getSimulatorInternals() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CSimulatorInternals(); }
|
||||
return m_simulatorPlugin.second->getSimulatorInternals();
|
||||
}
|
||||
|
||||
CAirportList CContextSimulator::getAirportsInRange(bool recalculateDistance) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
// If no ISimulator object is available, return a dummy.
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CAirportList(); }
|
||||
return m_simulatorPlugin.second->getAirportsInRange(recalculateDistance);
|
||||
@@ -236,7 +236,7 @@ namespace BlackCore
|
||||
|
||||
CAircraftModelList CContextSimulator::getModelSet() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
const CSimulatorInfo simulator = this->getModelSetLoaderSimulator();
|
||||
if (!simulator.isSingleSimulator()) { return CAircraftModelList(); }
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace BlackCore
|
||||
|
||||
CSimulatorInfo CContextSimulator::getModelSetLoaderSimulator() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.second)
|
||||
{
|
||||
if (m_simulatorPlugin.second->isConnected())
|
||||
@@ -265,7 +265,7 @@ namespace BlackCore
|
||||
void CContextSimulator::setModelSetLoaderSimulator(const CSimulatorInfo &simulator)
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (this->isSimulatorAvailable()) { return; } // if a plugin is loaded, do ignore this
|
||||
m_modelSetSimulator.set(simulator);
|
||||
const CAircraftModelList models = this->getModelSet(); // cache synced
|
||||
@@ -274,13 +274,13 @@ namespace BlackCore
|
||||
|
||||
CSimulatorInfo CContextSimulator::simulatorsWithInitializedModelSet() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
return CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().simulatorsWithInitializedCache();
|
||||
}
|
||||
|
||||
CStatusMessageList CContextSimulator::verifyPrerequisites() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
CStatusMessageList msgs;
|
||||
if (!sApp || !sApp->isNetworkAccessible())
|
||||
{
|
||||
@@ -296,20 +296,20 @@ namespace BlackCore
|
||||
|
||||
QStringList CContextSimulator::getModelSetStrings() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
return this->getModelSet().getModelStringList(false);
|
||||
}
|
||||
|
||||
bool CContextSimulator::isKnownModelInSet(const QString &modelString) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
const bool known = this->getModelSet().containsModelString(modelString);
|
||||
return known;
|
||||
}
|
||||
|
||||
int CContextSimulator::removeModelsFromSet(const CAircraftModelList &removeModels)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (removeModels.isEmpty()) { return 0; }
|
||||
const CSimulatorInfo simulator = m_modelSetSimulator.get();
|
||||
if (!simulator.isSingleSimulator()) { return 0; }
|
||||
@@ -326,48 +326,48 @@ namespace BlackCore
|
||||
|
||||
QStringList CContextSimulator::getModelSetCompleterStrings(bool sorted) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << sorted; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << sorted; }
|
||||
return this->getModelSet().toCompleterStrings(sorted);
|
||||
}
|
||||
|
||||
int CContextSimulator::getModelSetCount() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return 0; }
|
||||
return this->getModelSet().size();
|
||||
}
|
||||
|
||||
void CContextSimulator::disableModelsForMatching(const CAircraftModelList &removedModels, bool incremental)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
m_aircraftMatcher.disableModelsForMatching(removedModels, incremental);
|
||||
}
|
||||
|
||||
CAircraftModelList CContextSimulator::getDisabledModelsForMatching() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CAircraftModelList(); }
|
||||
return m_aircraftMatcher.getDisabledModelsForMatching();
|
||||
}
|
||||
|
||||
void CContextSimulator::restoreDisabledModels()
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
m_aircraftMatcher.restoreDisabledModels();
|
||||
}
|
||||
|
||||
bool CContextSimulator::isValidationInProgress() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_validator) { return false; }
|
||||
return m_validator->isValidating();
|
||||
}
|
||||
|
||||
bool CContextSimulator::triggerModelSetValidation(const CSimulatorInfo &simulator)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_validator) { return false; }
|
||||
const QString simDir = simulator.isSingleSimulator() ? m_multiSimulatorSettings.getSimulatorDirectoryOrDefault(simulator) : "";
|
||||
return m_validator->triggerValidation(simulator, simDir);
|
||||
@@ -375,7 +375,7 @@ namespace BlackCore
|
||||
|
||||
CAircraftModelList CContextSimulator::getModelSetModelsStartingWith(const QString &modelString) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << modelString; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << modelString; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CAircraftModelList(); }
|
||||
|
||||
return this->getModelSet().findModelsStartingWith(modelString);
|
||||
@@ -383,7 +383,7 @@ namespace BlackCore
|
||||
|
||||
bool CContextSimulator::setTimeSynchronization(bool enable, const CTime &offset)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return false; }
|
||||
|
||||
const bool c = m_simulatorPlugin.second->setTimeSynchronization(enable, offset);
|
||||
@@ -395,42 +395,42 @@ namespace BlackCore
|
||||
|
||||
bool CContextSimulator::isTimeSynchronized() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return false; }
|
||||
return m_simulatorPlugin.second->isTimeSynchronized();
|
||||
}
|
||||
|
||||
CInterpolationAndRenderingSetupGlobal CContextSimulator::getInterpolationAndRenderingSetupGlobal() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return m_renderSettings.get(); }
|
||||
return m_simulatorPlugin.second->getInterpolationSetupGlobal();
|
||||
}
|
||||
|
||||
CInterpolationSetupList CContextSimulator::getInterpolationAndRenderingSetupsPerCallsign() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CInterpolationSetupList(); }
|
||||
return m_simulatorPlugin.second->getInterpolationSetupsPerCallsign();
|
||||
}
|
||||
|
||||
CInterpolationAndRenderingSetupPerCallsign CContextSimulator::getInterpolationAndRenderingSetupPerCallsignOrDefault(const CCallsign &callsign) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CInterpolationAndRenderingSetupPerCallsign(); }
|
||||
return m_simulatorPlugin.second->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
}
|
||||
|
||||
bool CContextSimulator::setInterpolationAndRenderingSetupsPerCallsign(const CInterpolationSetupList &setups, bool ignoreSameAsGlobal)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return false; }
|
||||
return m_simulatorPlugin.second->setInterpolationSetupsPerCallsign(setups, ignoreSameAsGlobal);
|
||||
}
|
||||
|
||||
void CContextSimulator::setInterpolationAndRenderingSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << setup; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << setup; }
|
||||
|
||||
// anyway save for future reference
|
||||
const CStatusMessage m = m_renderSettings.setAndSave(setup);
|
||||
@@ -443,7 +443,7 @@ namespace BlackCore
|
||||
|
||||
CStatusMessageList CContextSimulator::getInterpolationMessages(const CCallsign &callsign) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (callsign.isEmpty()) { return CStatusMessageList(); }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CStatusMessageList(); }
|
||||
return m_simulatorPlugin.second->getInterpolationMessages(callsign);
|
||||
@@ -451,7 +451,7 @@ namespace BlackCore
|
||||
|
||||
CTime CContextSimulator::getTimeSynchronizationOffset() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return CTime(0, CTimeUnit::hrmin()); }
|
||||
return m_simulatorPlugin.second->getTimeSynchronizationOffset();
|
||||
}
|
||||
@@ -975,19 +975,19 @@ namespace BlackCore
|
||||
|
||||
CStatusMessageList CContextSimulator::getMatchingMessages(const CCallsign &callsign) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << callsign; }
|
||||
return m_matchingMessages[callsign];
|
||||
}
|
||||
|
||||
MatchingLog CContextSimulator::isMatchingMessagesEnabled() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
return m_logMatchingMessages;
|
||||
}
|
||||
|
||||
void CContextSimulator::enableMatchingMessages(MatchingLog enabled)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << matchingLogToString(enabled); }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << matchingLogToString(enabled); }
|
||||
if (m_logMatchingMessages == enabled) { return; }
|
||||
m_logMatchingMessages = enabled;
|
||||
emit IContext::changedLogOrDebugSettings();
|
||||
@@ -995,7 +995,7 @@ namespace BlackCore
|
||||
|
||||
CMatchingStatistics CContextSimulator::getCurrentMatchingStatistics(bool missingOnly) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << missingOnly; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << missingOnly; }
|
||||
const CMatchingStatistics statistics = m_aircraftMatcher.getCurrentStatistics();
|
||||
return missingOnly ?
|
||||
statistics.findMissingOnly() :
|
||||
@@ -1004,7 +1004,7 @@ namespace BlackCore
|
||||
|
||||
void CContextSimulator::setMatchingSetup(const CAircraftMatcherSetup &setup)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << setup.toQString(); }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << setup.toQString(); }
|
||||
m_aircraftMatcher.setSetup(setup);
|
||||
const CStatusMessage msg = m_matchingSettings.setAndSave(setup);
|
||||
CLogMessage::preformatted(msg);
|
||||
@@ -1012,13 +1012,13 @@ namespace BlackCore
|
||||
|
||||
CAircraftMatcherSetup CContextSimulator::getMatchingSetup() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
return m_aircraftMatcher.getSetup();
|
||||
}
|
||||
|
||||
CStatusMessageList CContextSimulator::copyFsxTerrainProbe(const CSimulatorInfo &simulator)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << simulator.toQString(); }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << simulator.toQString(); }
|
||||
|
||||
CStatusMessageList msgs;
|
||||
if (!simulator.isFsxP3DFamily())
|
||||
@@ -1098,7 +1098,7 @@ namespace BlackCore
|
||||
else if (p1 == "parts") { rs.setEnabledAircraftParts(on); }
|
||||
else { return false; }
|
||||
this->setInterpolationAndRenderingSetupGlobal(rs);
|
||||
CLogMessage(this, CLogCategory::cmdLine()).info(u"Setup is: '%1'") << rs.toQString(true);
|
||||
CLogMessage(this, CLogCategories::cmdLine()).info(u"Setup is: '%1'") << rs.toQString(true);
|
||||
return true;
|
||||
}
|
||||
if (parser.matchesCommand("plugin") || parser.matchesCommand("drv") || parser.matchesCommand("driver"))
|
||||
@@ -1117,21 +1117,21 @@ namespace BlackCore
|
||||
|
||||
void CContextSimulator::highlightAircraft(const CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const CTime &displayTime)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << aircraftToHighlight << enableHighlight << displayTime; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << aircraftToHighlight << enableHighlight << displayTime; }
|
||||
if (!m_simulatorPlugin.second) { return; }
|
||||
m_simulatorPlugin.second->highlightAircraft(aircraftToHighlight, enableHighlight, displayTime);
|
||||
}
|
||||
|
||||
bool CContextSimulator::followAircraft(const CCallsign &callsign)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << callsign; }
|
||||
if (!m_simulatorPlugin.second) { return false; }
|
||||
return m_simulatorPlugin.second->followAircraft(callsign);
|
||||
}
|
||||
|
||||
void CContextSimulator::recalculateAllAircraft()
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second) { return; }
|
||||
m_simulatorPlugin.second->recalculateAllAircraft();
|
||||
}
|
||||
@@ -1155,41 +1155,41 @@ namespace BlackCore
|
||||
|
||||
bool CContextSimulator::isWeatherActivated() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return m_isWeatherActivated; }
|
||||
return m_simulatorPlugin.second->isWeatherActivated();
|
||||
}
|
||||
|
||||
void CContextSimulator::setWeatherActivated(bool activated)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_simulatorPlugin.second || m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
m_simulatorPlugin.second->setWeatherActivated(activated);
|
||||
}
|
||||
|
||||
void CContextSimulator::requestWeatherGrid(const CCoordinateGeodetic &position, const CIdentifier &identifier)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << identifier; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << identifier; }
|
||||
m_weatherManager.requestWeatherGrid(position, identifier);
|
||||
}
|
||||
|
||||
bool CContextSimulator::requestElevationBySituation(const CAircraftSituation &situation)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << situation; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << situation; }
|
||||
if (!m_simulatorPlugin.second || !m_simulatorPlugin.second->isConnected()) { return false; }
|
||||
return m_simulatorPlugin.second->requestElevationBySituation(situation);
|
||||
}
|
||||
|
||||
CElevationPlane CContextSimulator::findClosestElevationWithinRange(const CCoordinateGeodetic &reference, const CLength &range) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << reference.convertToQString(true) << range; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << reference.convertToQString(true) << range; }
|
||||
if (!m_simulatorPlugin.second || !m_simulatorPlugin.second->isConnected()) { return CElevationPlane::null(); }
|
||||
return m_simulatorPlugin.second->findClosestElevationWithinRange(reference, range);
|
||||
}
|
||||
|
||||
int CContextSimulator::doMatchingsAgain()
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
const CCallsignSet callsigns = this->getAircraftInRangeCallsigns();
|
||||
if (callsigns.isEmpty()) { return 0; }
|
||||
int delayMs = 25;
|
||||
@@ -1208,7 +1208,7 @@ namespace BlackCore
|
||||
|
||||
bool CContextSimulator::doMatchingAgain(const CCallsign &callsign)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign.asString(); }
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << callsign.asString(); }
|
||||
if (!this->isAircraftInRange(callsign)) { return false; }
|
||||
if (!this->isSimulatorAvailable()) { return false; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user