diff --git a/plugins/amda/include/AmdaPlugin.h b/plugins/amda/include/AmdaPlugin.h new file mode 100644 index 0000000..437be74 --- /dev/null +++ b/plugins/amda/include/AmdaPlugin.h @@ -0,0 +1,25 @@ +#ifndef SCIQLOP_AMDAPLUGIN_H +#define SCIQLOP_AMDAPLUGIN_H + +#include "AmdaGlobal.h" + +#include + +#include + +#include + +Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaPlugin) + +class DataSourceItem; + +class SCIQLOP_AMDA_EXPORT AmdaPlugin : public QObject, public IPlugin { + Q_OBJECT + Q_INTERFACES(IPlugin) + Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE "amda.json") +public: + /// @sa IPlugin::initialize() + void initialize() override; +}; + +#endif // SCIQLOP_AMDAPLUGIN_H diff --git a/plugins/amda/resources/amda.json b/plugins/amda/resources/amda.json new file mode 100644 index 0000000..62cfbfd --- /dev/null +++ b/plugins/amda/resources/amda.json @@ -0,0 +1,3 @@ +{ + "name" : "Amda" +} diff --git a/plugins/amda/src/AmdaPlugin.cpp b/plugins/amda/src/AmdaPlugin.cpp new file mode 100644 index 0000000..016069b --- /dev/null +++ b/plugins/amda/src/AmdaPlugin.cpp @@ -0,0 +1,29 @@ +#include "AmdaPlugin.h" + +#include + +#include + +Q_LOGGING_CATEGORY(LOG_AmdaPlugin, "AmdaPlugin") + +namespace { + +/// Name of the data source +const auto DATA_SOURCE_NAME = QStringLiteral("AMDA"); + +} // namespace + +void AmdaPlugin::initialize() +{ + if (auto app = sqpApp) { + // Registers to the data source controller + auto &dataSourceController = app->dataSourceController(); + auto dataSourceUid = dataSourceController.registerDataSource(DATA_SOURCE_NAME); + + // Sets data source tree + /// @todo ALX + } + else { + qCWarning(LOG_AmdaPlugin()) << tr("Can't access to SciQlop application"); + } +}