mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +08:00
Ref T298, adjusting used aircraft matcher (using setup)
This commit is contained in:
@@ -67,10 +67,10 @@ namespace BlackSample
|
|||||||
streamOut << "Ambigious models: " << cfgParser.getAircraftCfgEntriesList().detectAmbiguousTitles().join(", ") << endl;
|
streamOut << "Ambigious models: " << cfgParser.getAircraftCfgEntriesList().detectAmbiguousTitles().join(", ") << endl;
|
||||||
|
|
||||||
// sync definitions, remove redundant ones
|
// sync definitions, remove redundant ones
|
||||||
CAircraftMatcher matcher(CAircraftMatcher::All);
|
CAircraftMatcher matcher;
|
||||||
matcher.setModelSet(vpRulesReader.getAsModelsFromCache(), CSimulatorInfo::FSX);
|
matcher.setModelSet(vpRulesReader.getAsModelsFromCache(), CSimulatorInfo::FSX);
|
||||||
|
|
||||||
CAircraftIcaoCode icao("C172");
|
const CAircraftIcaoCode icao("C172");
|
||||||
streamOut << "Searching for " << icao << endl;
|
streamOut << "Searching for " << icao << endl;
|
||||||
streamOut << matcher.getModelSet().findByIcaoDesignators(icao, CAirlineIcaoCode()) << endl;
|
streamOut << matcher.getModelSet().findByIcaoDesignators(icao, CAirlineIcaoCode()) << endl;
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ namespace BlackCore
|
|||||||
CContextSimulator::registerHelp();
|
CContextSimulator::registerHelp();
|
||||||
|
|
||||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Need sApp");
|
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Need sApp");
|
||||||
// m_enableMatchingMessages = CBuildConfig::isLocalDeveloperDebugBuild() || sApp->isDeveloperFlagSet();
|
|
||||||
m_enableMatchingMessages = true; // there seems to be no big disadavantage in always enabling it
|
m_enableMatchingMessages = true; // there seems to be no big disadavantage in always enabling it
|
||||||
m_plugins->collectPlugins();
|
m_plugins->collectPlugins();
|
||||||
this->restoreSimulatorPlugins();
|
this->restoreSimulatorPlugins();
|
||||||
@@ -403,7 +402,7 @@ namespace BlackCore
|
|||||||
Q_UNUSED(c);
|
Q_UNUSED(c);
|
||||||
|
|
||||||
// Once the simulator signaled it is ready to simulate, add all known aircraft
|
// Once the simulator signaled it is ready to simulate, add all known aircraft
|
||||||
m_initallyAddAircrafts = true;
|
m_initallyAddAircraft = true;
|
||||||
m_matchingMessages.clear();
|
m_matchingMessages.clear();
|
||||||
|
|
||||||
// try to connect to simulator
|
// try to connect to simulator
|
||||||
@@ -548,7 +547,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CContextSimulator::onSimulatorStatusChanged(ISimulator::SimulatorStatus status)
|
void CContextSimulator::onSimulatorStatusChanged(ISimulator::SimulatorStatus status)
|
||||||
{
|
{
|
||||||
if (m_initallyAddAircrafts && status.testFlag(ISimulator::Simulating))
|
if (m_initallyAddAircraft && status.testFlag(ISimulator::Simulating))
|
||||||
{
|
{
|
||||||
// use network to initally add aircraft
|
// use network to initally add aircraft
|
||||||
IContextNetwork *networkContext = this->getIContextNetwork();
|
IContextNetwork *networkContext = this->getIContextNetwork();
|
||||||
@@ -562,7 +561,7 @@ namespace BlackCore
|
|||||||
BLACK_VERIFY_X(!simulatedAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "Need callsign");
|
BLACK_VERIFY_X(!simulatedAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "Need callsign");
|
||||||
this->xCtxAddedRemoteAircraftReadyForModelMatching(simulatedAircraft);
|
this->xCtxAddedRemoteAircraftReadyForModelMatching(simulatedAircraft);
|
||||||
}
|
}
|
||||||
m_initallyAddAircrafts = false;
|
m_initallyAddAircraft = false;
|
||||||
}
|
}
|
||||||
if (!status.testFlag(ISimulator::Connected))
|
if (!status.testFlag(ISimulator::Connected))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CContextSimulator();
|
virtual ~CContextSimulator() override;
|
||||||
|
|
||||||
//! Gracefully shut down, e.g. for plugin unloading
|
//! Gracefully shut down, e.g. for plugin unloading
|
||||||
void gracefulShutdown();
|
void gracefulShutdown();
|
||||||
@@ -238,12 +238,12 @@ namespace BlackCore
|
|||||||
void initByLastUsedModelSet();
|
void initByLastUsedModelSet();
|
||||||
|
|
||||||
QPair<BlackMisc::Simulation::CSimulatorPluginInfo, QPointer<ISimulator>> m_simulatorPlugin; //!< Currently loaded simulator plugin
|
QPair<BlackMisc::Simulation::CSimulatorPluginInfo, QPointer<ISimulator>> m_simulatorPlugin; //!< Currently loaded simulator plugin
|
||||||
CPluginManagerSimulator *m_plugins = nullptr;
|
CPluginManagerSimulator *m_plugins = nullptr; //!< plugin manager
|
||||||
BlackMisc::CRegularThread m_listenersThread; //!< waiting for plugin
|
BlackMisc::CRegularThread m_listenersThread; //!< waiting for plugin
|
||||||
CWeatherManager m_weatherManager { this };
|
CWeatherManager m_weatherManager { this }; //!< weather management
|
||||||
CAircraftMatcher m_aircraftMatcher; //!< Model matcher
|
CAircraftMatcher m_aircraftMatcher { this }; //!< model matcher
|
||||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages;
|
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages;
|
||||||
bool m_initallyAddAircrafts = false;
|
bool m_initallyAddAircraft = false;
|
||||||
bool m_enableMatchingMessages = true;
|
bool m_enableMatchingMessages = true;
|
||||||
bool m_isWeatherActivated = false;
|
bool m_isWeatherActivated = false;
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace BlackGui
|
|||||||
BlackMisc::Simulation::CAircraftModel defaultModel() const;
|
BlackMisc::Simulation::CAircraftModel defaultModel() const;
|
||||||
|
|
||||||
QScopedPointer<Ui::CModelMatcherComponent> ui;
|
QScopedPointer<Ui::CModelMatcherComponent> ui;
|
||||||
BlackCore::CAircraftMatcher m_matcher { BlackCore::CAircraftMatcher::All, this };
|
BlackCore::CAircraftMatcher m_matcher { this }; //!< used matcher
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user