mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
JSON plugin metadata initial
* Added json files along with FILE macro for all drivers * Get CSimulatorInfo from JSON rather than from ISimulatorFactory
This commit is contained in:
committed by
Roland Winklmeier
parent
c5a1a6048b
commit
afc22397bb
@@ -573,13 +573,15 @@ namespace BlackCore
|
||||
CLogMessage(this).info("Try to load plugin: %1") << fileName;
|
||||
QString pluginPath = m_pluginsDir.absoluteFilePath(fileName);
|
||||
QPluginLoader loader(pluginPath);
|
||||
QJsonObject json = loader.metaData();
|
||||
QObject *plugin = loader.instance();
|
||||
if (plugin)
|
||||
{
|
||||
ISimulatorFactory *factory = qobject_cast<ISimulatorFactory *>(plugin);
|
||||
if (factory)
|
||||
{
|
||||
CSimulatorInfo simulatorInfo = factory->getSimulatorInfo();
|
||||
// CSimulatorInfo simulatorInfo = factory->getSimulatorInfo();
|
||||
CSimulatorInfo simulatorInfo(json);
|
||||
m_simulatorFactories.insert(factory);
|
||||
|
||||
ISimulatorListener *listener = factory->createListener(this);
|
||||
|
||||
@@ -257,6 +257,7 @@ namespace BlackCore
|
||||
|
||||
//! Simulator listener instance
|
||||
virtual ISimulatorListener *createListener(QObject *parent = nullptr) = 0;
|
||||
|
||||
};
|
||||
|
||||
//! Common base class with providers, interface and some base functionality
|
||||
|
||||
Reference in New Issue
Block a user