mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
Ref T312, plugin manager listener chec function (simulator available?)
This commit is contained in:
@@ -41,7 +41,7 @@ namespace BlackCore
|
|||||||
ISimulatorFactory *factory = getFactory(pluginId);
|
ISimulatorFactory *factory = getFactory(pluginId);
|
||||||
if (!factory)
|
if (!factory)
|
||||||
{
|
{
|
||||||
CLogMessage(this).warning("Could not load plugin %1.") << pluginId;
|
CLogMessage(this).warning("Could not load plugin '%1'.") << pluginId;
|
||||||
m_plugins.remove(pluginId);
|
m_plugins.remove(pluginId);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -71,6 +71,20 @@ namespace BlackCore
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CPluginManagerSimulator::checkAvailableListeners()
|
||||||
|
{
|
||||||
|
if (m_plugins.isEmpty()) { return 0; }
|
||||||
|
|
||||||
|
int c = 0;
|
||||||
|
for (PluginExtended &pi : m_plugins.values())
|
||||||
|
{
|
||||||
|
if (!pi.listener) { continue; }
|
||||||
|
pi.listener->check();
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
void CPluginManagerSimulator::collectPlugins()
|
void CPluginManagerSimulator::collectPlugins()
|
||||||
{
|
{
|
||||||
IPluginManager::collectPlugins();
|
IPluginManager::collectPlugins();
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ namespace BlackCore
|
|||||||
//! Get all simulator driver plugins
|
//! Get all simulator driver plugins
|
||||||
BlackMisc::Simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const;
|
BlackMisc::Simulation::CSimulatorPluginInfoList getAvailableSimulatorPlugins() const;
|
||||||
|
|
||||||
|
//! Check if simulator is connected
|
||||||
|
int checkAvailableListeners();
|
||||||
|
|
||||||
//! \copydoc BlackCore::IPluginManager::collectPlugins()
|
//! \copydoc BlackCore::IPluginManager::collectPlugins()
|
||||||
virtual void collectPlugins() override;
|
virtual void collectPlugins() override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user