Initialize m_pluginInfoList in constructor.

Implement initPlugin().
Im[plement getString().
This commit is contained in:
Gerhard Hoffmann 2023-11-16 08:31:50 +01:00
parent 46ab0ec80f
commit f0762e272f

View File

@ -22,13 +22,15 @@ ATBVMCPlugin::ATBVMCPlugin(QObject *parent)
, m_pluginState(PLUGIN_STATE::NOT_INITIALIZED)
, m_vmc(nullptr) {
m_pluginInfo.clear();
m_pluginInfo << QString(" Interface: ") + INTERFACE;
m_pluginInfo << QString("Interface Version: ") + INTERFACE_VERSION;
m_pluginInfo << QString(" PluginName: ") + PLUGIN_NAME;
m_pluginInfo << QString(" Version: ") + PLUGIN_VERSION;
m_pluginInfo << QString(" git-describe: ") + PLUGIN_GIT_DESCRIBE;
m_pluginInfo << QString(" Extended version: ") + PLUGIN_EXTENDED_VERSION;
m_pluginInfoList.clear();
m_pluginInfoList << QString(" Interface: ") + INTERFACE;
m_pluginInfoList << QString("Interface Version: ") + INTERFACE_VERSION;
m_pluginInfoList << QString(" PluginName: ") + PLUGIN_NAME;
m_pluginInfoList << QString(" Version: ") + PLUGIN_VERSION;
m_pluginInfoList << QString(" git-describe: ") + PLUGIN_GIT_DESCRIBE;
m_pluginInfoList << QString(" Extended version: ") + PLUGIN_EXTENDED_VERSION;
m_pluginInfo = m_pluginInfoList.join('\n');
}
ATBVMCPlugin::~ATBVMCPlugin() {
@ -38,12 +40,34 @@ ATBVMCPlugin::~ATBVMCPlugin() {
}
}
QStringList ATBVMCPlugin::getPluginInfo() {
QStringList ATBVMCPlugin::getPluginInfoList() {
return m_pluginInfoList;
}
QString const &ATBVMCPlugin::getPluginInfo() {
return m_pluginInfo;
}
// ----------------------------------------------------------------------------
// interface:
PLUGIN_STATE ATBVMCPlugin::initDCPlugin(QObject *eventReceiver, const QSettings & settings) {
Q_UNUSED(eventReceiver);
Q_UNUSED(settings);
return PLUGIN_STATE::NOT_INITIALIZED;
}
PLUGIN_STATE ATBVMCPlugin::initPlugin(QObject *eventReceiver, QObject *atbSystem, QObject *hmiConfig, QSettings const &settings) {
return initVMCPlugin(eventReceiver, atbSystem, hmiConfig, settings);
}
PLUGIN_STATE ATBVMCPlugin::initPlugin(QObject *eventReceiver, QSettings const &settings) {
Q_UNUSED(eventReceiver);
Q_UNUSED(settings);
return PLUGIN_STATE::NOT_INITIALIZED;
}
PLUGIN_STATE ATBVMCPlugin::initVMCPlugin(QObject *appControl,
QObject *atbSystem,
QObject *hmiConfig,
@ -78,21 +102,43 @@ PLUGIN_STATE ATBVMCPlugin::getState() {
return m_pluginState;
}
QString ATBVMCPlugin::getLastError() {
QString const &ATBVMCPlugin::getLastError() {
return m_errorCode;
}
QString ATBVMCPlugin::getLastErrorDescription() {
QString const &ATBVMCPlugin::getLastErrorDescription() {
return m_errorDescription;
}
#if 0
// helpers e.g. for debug / log
QString ATBVMCPlugin::getString(RESULT_STATE /*resultState*/) {
return "";
QString const &ATBVMCPlugin::getString(RESULT_STATE resultState) {
static QString str;
switch (resultState) {
case RESULT_STATE::SUCCESS:
str = QString("RESULT_STATE::SUCCESS");
break;
case RESULT_STATE::ERROR_BACKEND:
str = QString("RESULT_STATE::ERROR_BACKEND");
break;
case RESULT_STATE::ERROR_TIMEOUT:
str = QString("RESULT_STATE::ERROR_TIMEOUT");
break;
case RESULT_STATE::ERROR_PROCESS:
str = QString("RESULT_STATE::ERROR_PROCESS");
break;
case RESULT_STATE::ERROR_RETRY:
str = QString("RESULT_STATE::ERROR_RETRY");
break;
case RESULT_STATE::INFO:
str = QString("RESULT_STATE::INFO");
break;
}
return str;
}
void ATBVMCPlugin::onChangedProgramModeToSELL() {
@ -126,7 +172,6 @@ void ATBVMCPlugin::reset() {
}
#endif
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(ATBVMCPlugin, ATBVMCPlugin)