save for the weekend

This commit is contained in:
Gerhard Hoffmann 2023-11-10 14:17:22 +01:00
parent 0ee7df32b5
commit 3bbf36cdd7
4 changed files with 19 additions and 2 deletions

View File

@ -21,7 +21,9 @@ ATBVMCPlugin::ATBVMCPlugin(QObject *parent)
, m_serialPortName("") , m_serialPortName("")
, m_useDebug(false) , m_useDebug(false)
, m_pluginState(PLUGIN_STATE::NOT_INITIALIZED) , m_pluginState(PLUGIN_STATE::NOT_INITIALIZED)
, m_eventReceiver(nullptr) { , m_eventReceiver(nullptr)
, m_settings(nullptr)
, m_config(nullptr) {
} }
ATBVMCPlugin::~ATBVMCPlugin() { ATBVMCPlugin::~ATBVMCPlugin() {
@ -35,7 +37,14 @@ PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *eventReceiver,
// Beachte: QSettings hat .fileName(). // Beachte: QSettings hat .fileName().
// Damit kann man dann ATBSystem benutzen. // 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: ------------------------------------------ // mandantory ATBAPP plugin methods: ------------------------------------------

View File

@ -31,6 +31,7 @@ public:
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// interface: // interface:
PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, QSettings const &settings); PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, QSettings const &settings);
PLUGIN_STATE initVMCPlugin(QObject *eventReceiver, ATBHMIconfig *config);
// mandantory ATBAPP plugin methods: ------------------------------------------ // mandantory ATBAPP plugin methods: ------------------------------------------
PLUGIN_STATE getState() override; PLUGIN_STATE getState() override;
@ -62,6 +63,7 @@ private:
PLUGIN_STATE m_pluginState; PLUGIN_STATE m_pluginState;
QObject* m_eventReceiver; QObject* m_eventReceiver;
QSettings const *m_settings; QSettings const *m_settings;
ATBHMIconfig *m_config;
}; };
#endif // ATBDEVICECONTROLLERPLUGIN_H #endif // ATBDEVICECONTROLLERPLUGIN_H

View File

@ -51,6 +51,7 @@ public:
virtual ~UnifiedDCVMCInterface() {} virtual ~UnifiedDCVMCInterface() {}
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) = 0; virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QSettings const &settings) = 0;
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, ATBHMIconfig *config) = 0;
// mandantory ATBAPP plugin methods: // mandantory ATBAPP plugin methods:
virtual PLUGIN_STATE getState() = 0; virtual PLUGIN_STATE getState() = 0;

View File

@ -6,6 +6,7 @@
#include <QSettings> #include <QSettings>
#include <QString> #include <QString>
#include "ATBHMIconfig.h"
#include "ATBAPPplugin.h" #include "ATBAPPplugin.h"
#include "UnifiedDCVMCInterface.h" #include "UnifiedDCVMCInterface.h"
@ -34,6 +35,10 @@ public:
return initVMCPlugin(eventReceiver, settings); return initVMCPlugin(eventReceiver, settings);
} }
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, ATBHMIconfig *config) override {
return initVMCPlugin(eventReceiver, config->getSettings());
}
virtual ~VMCInterface() {} virtual ~VMCInterface() {}
/** /**