diff --git a/src/ATBAPP/ATBVMCPlugin.cpp b/src/ATBAPP/ATBVMCPlugin.cpp index 01cfce3..d38e0cb 100644 --- a/src/ATBAPP/ATBVMCPlugin.cpp +++ b/src/ATBAPP/ATBVMCPlugin.cpp @@ -21,7 +21,9 @@ ATBVMCPlugin::ATBVMCPlugin(QObject *parent) , m_serialPortName("") , m_useDebug(false) , m_pluginState(PLUGIN_STATE::NOT_INITIALIZED) - , m_eventReceiver(nullptr) { + , m_eventReceiver(nullptr) + , m_settings(nullptr) + , m_config(nullptr) { } ATBVMCPlugin::~ATBVMCPlugin() { @@ -35,7 +37,14 @@ PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *eventReceiver, // Beachte: QSettings hat .fileName(). // Damit kann man dann ATBSystem benutzen. - return PLUGIN_STATE::NOT_INITIALIZED; + return PLUGIN_STATE::INITIALIZED; +} + +PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *eventReceiver, ATBHMIconfig *config) { + m_eventReceiver = eventReceiver; + m_settings = &config->getSettings(); + m_config = config; + return PLUGIN_STATE::INITIALIZED; } // mandantory ATBAPP plugin methods: ------------------------------------------ diff --git a/src/ATBAPP/ATBVMCPlugin.h b/src/ATBAPP/ATBVMCPlugin.h index 61358f3..f1887ba 100644 --- a/src/ATBAPP/ATBVMCPlugin.h +++ b/src/ATBAPP/ATBVMCPlugin.h @@ -31,6 +31,7 @@ public: // ---------------------------------------------------------------------------- // interface: PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, QSettings const &settings); + PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, ATBHMIconfig *config); // mandantory ATBAPP plugin methods: ------------------------------------------ PLUGIN_STATE getState() override; @@ -62,6 +63,7 @@ private: PLUGIN_STATE m_pluginState; QObject* m_eventReceiver; QSettings const *m_settings; + ATBHMIconfig *m_config; }; #endif // ATBDEVICECONTROLLERPLUGIN_H diff --git a/src/ATBAPP/UnifiedDCVMCInterface.h b/src/ATBAPP/UnifiedDCVMCInterface.h index 2326243..1d11959 100644 --- a/src/ATBAPP/UnifiedDCVMCInterface.h +++ b/src/ATBAPP/UnifiedDCVMCInterface.h @@ -51,6 +51,7 @@ public: virtual ~UnifiedDCVMCInterface() {} virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) = 0; + virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, ATBHMIconfig *config) = 0; // mandantory ATBAPP plugin methods: virtual PLUGIN_STATE getState() = 0; diff --git a/src/ATBAPP/VMCInterface.h b/src/ATBAPP/VMCInterface.h index 2d1efc9..12e3bc0 100644 --- a/src/ATBAPP/VMCInterface.h +++ b/src/ATBAPP/VMCInterface.h @@ -6,6 +6,7 @@ #include #include +#include "ATBHMIconfig.h" #include "ATBAPPplugin.h" #include "UnifiedDCVMCInterface.h" @@ -34,6 +35,10 @@ public: return initVMCPlugin(eventReceiver, settings); } + virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, ATBHMIconfig *config) override { + return initVMCPlugin(eventReceiver, config->getSettings()); + } + virtual ~VMCInterface() {} /**