Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -31,8 +31,7 @@ private:
const QByteArray m_msg;
};
XmlReader::XmlReader()
{}
XmlReader::XmlReader() : m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
bool XmlReader::readServiceFile(const QString &svcFile,
const QString &idlServiceInfoFile,
@@ -79,18 +78,18 @@ bool XmlReader::readServiceFile(const QString &svcFile,
QFile f(svcFile);
if (!f.exists())
{
ERROR_LOG() << "Service file '" << svcFile << "' not found!";
ERROR_LOG(m_logger) << "Service file '" << svcFile << "' not found!";
return false;
}
if (!f.open(QIODevice::ReadOnly))
{
m_errorString = QLatin1String("Can not open service file '") + svcFile +
QLatin1String("' for reading: ") + f.errorString();
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
INFO_LOG() << "SvcFile: " << svcFile;
INFO_LOG(m_logger) << "SvcFile: " << svcFile;
QString errMsg;
@@ -102,7 +101,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
m_errorString = QLatin1String("Error parsing service file '") + svcFile + QLatin1String("': ") +
errMsg + QLatin1String(" at ") + QString::number(errLine) +
QLatin1Char(':') + QString::number(errColumn);
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -118,7 +117,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
{
m_errorString = QLatin1String("Xml file '") + svcFile +
QLatin1String("' is not a valid service file: service name/namespace is missing");
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
m_svcNamespace = getAttribute(domRoot, QStringLiteral("namespace"));
@@ -129,13 +128,13 @@ bool XmlReader::readServiceFile(const QString &svcFile,
QString devModeStr = getAttribute(domRoot, QStringLiteral("devMode"), true);
m_svcDevMode = devModeStr == QStringLiteral("1") ||
devModeStr == QStringLiteral("true");
INFO_LOG() << "devMode: " << m_svcDevMode;
INFO_LOG(m_logger) << "devMode: " << m_svcDevMode;
const QString groupNamesString = getAttribute(domRoot, QStringLiteral("groups"), true);
if (!groupNamesString.isEmpty())
{
m_groupNames = groupNamesString.split(QLatin1Char(','), Qt::SkipEmptyParts);
INFO_LOG() << "groups: " << groupNamesString;
INFO_LOG(m_logger) << "groups: " << groupNamesString;
}
else
m_groupNames.clear();
@@ -150,12 +149,12 @@ bool XmlReader::readServiceFile(const QString &svcFile,
if (m_exerciseDependency != ExerciseDependency::Global &&
m_exerciseDependency != ExerciseDependency::GlobalAndExercise)
{
WARNING_LOG() << "Service " << getServiceNamespace()
WARNING_LOG(m_logger) << "Service " << getServiceNamespace()
<< " is not marked as exercise independent but should be started in group Core/Master";
}
}
INFO_LOG() << "exerciseDependency: " << (int)m_exerciseDependency;
INFO_LOG(m_logger) << "exerciseDependency: " << (int)m_exerciseDependency;
if ( domRoot.hasAttribute(QStringLiteral("prio")))
{
m_prio = getAttribute(domRoot, QStringLiteral("prio"), 0).toInt();
@@ -167,7 +166,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing dbServiceStructs: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -178,7 +177,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing dbtables: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -189,7 +188,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing dbviews: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -200,7 +199,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing enumerations: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -211,7 +210,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing custom dtc functions: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -222,7 +221,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing idl strucs: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -233,7 +232,7 @@ bool XmlReader::readServiceFile(const QString &svcFile,
catch (const XmlReaderException &ex)
{
m_errorString = QLatin1String("Error parsing function topics: ") + QLatin1String(ex.what());
ERROR_LOG() << m_errorString;
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -331,7 +330,7 @@ void XmlReader::parseDBSserviceStructs(const QDomElement &rootElement)
domDbStruct = domDbStruct.nextSiblingElement(domDbStruct.tagName());
}
INFO_LOG() << "Read " << m_structsToGenerate.size() << " database service struct(s)";
INFO_LOG(m_logger) << "Read " << m_structsToGenerate.size() << " database service struct(s)";
}
void XmlReader::parseDBTables(const QDomElement &rootElement)
@@ -373,7 +372,7 @@ void XmlReader::parseDBTables(const QDomElement &rootElement)
domDbTable = domDbTable.nextSiblingElement(domDbTable.tagName());
}
INFO_LOG() << "Read " << m_tables.size() << " database table(s)";
INFO_LOG(m_logger) << "Read " << m_tables.size() << " database table(s)";
}
void XmlReader::parseDBViews(const QDomElement &rootElement)
@@ -393,7 +392,7 @@ void XmlReader::parseDBViews(const QDomElement &rootElement)
vi->filter = getAttribute(domDbView, QStringLiteral("filter"));
vi->exerciseDependency = string2ExerciseDependency(getAttribute(domDbView, QStringLiteral("exerciseDependency"), true));
DEBUG_LOG() << "Base table = " << vi->baseTable;
DEBUG_LOG(m_logger) << "Base table = " << vi->baseTable;
m_views.insert(vi->name, vi);
@@ -401,7 +400,7 @@ void XmlReader::parseDBViews(const QDomElement &rootElement)
domDbView = domDbView.nextSiblingElement(domDbView.tagName());
}
INFO_LOG() << "Read " << m_views.size() << " database view(s)";
INFO_LOG(m_logger) << "Read " << m_views.size() << " database view(s)";
}
void XmlReader::parseEnumerations(const QDomElement &rootElement)
@@ -432,7 +431,7 @@ void XmlReader::parseEnumerations(const QDomElement &rootElement)
domEnum = domEnum.nextSiblingElement(domEnum.tagName());
}
INFO_LOG() << "Read " << m_enumerations.size() << " enumeration(s)";
INFO_LOG(m_logger) << "Read " << m_enumerations.size() << " enumeration(s)";
}
void XmlReader::parseCustomDtcFunctions(const QDomElement &rootElement)
@@ -452,7 +451,7 @@ void XmlReader::parseCustomDtcFunctions(const QDomElement &rootElement)
}
domElement = domElement.nextSiblingElement(domElement.tagName());
}
INFO_LOG() << "Read " << m_enumerations.size() << " customDtcFunction(s)";
INFO_LOG(m_logger) << "Read " << m_enumerations.size() << " customDtcFunction(s)";
}
@@ -510,7 +509,7 @@ void XmlReader::parseTopicTypes(const QDomElement &rootElement)
}
INFO_LOG() << "Read " << m_idlStructsToGenerate.size() << " idl struct(s)";
INFO_LOG(m_logger) << "Read " << m_idlStructsToGenerate.size() << " idl struct(s)";
}
void XmlReader::parseFunctionTopics(const QDomElement &rootElement)
@@ -566,7 +565,7 @@ ColumnInformation XmlReader::parseTableColumn(const QDomElement &column, const Q
}
if (ci.columnName.toLower() != ci.columnName)
WARNING_LOG() << "Column " << ci.columnName << " in Table "
WARNING_LOG(m_logger) << "Column " << ci.columnName << " in Table "
<< tableName << " has has upper-case chars which is not allowed!";
return ci;
@@ -726,18 +725,18 @@ DbNotifcationInformation XmlReader::parseDbNotification(const QDomElement &custo
TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalServiceName, const QString &topicTypeName)
{
DEBUG_LOG() << "externalServiceName: " << externalServiceName << ", topicTypeName: " << topicTypeName;
DEBUG_LOG(m_logger) << "externalServiceName: " << externalServiceName << ", topicTypeName: " << topicTypeName;
if (!loadExternalService(externalServiceName))
{
WARNING_LOG() << "Could not find service " << externalServiceName
WARNING_LOG(m_logger) << "Could not find service " << externalServiceName
<< " referenced by external topic " << topicTypeName;
return TopicTypeInformation();
}
auto extXmlReader = m_externalXmlInformations.value(externalServiceName);
if (!extXmlReader)
{
ERROR_LOG() << "Could not find service xml file for service '" << externalServiceName << "'";
ERROR_LOG(m_logger) << "Could not find service xml file for service '" << externalServiceName << "'";
return TopicTypeInformation();
}
@@ -749,7 +748,7 @@ TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalSer
m_usedServices[externalServiceName] = true;
return tti;
}
WARNING_LOG() << "Could not find topic " << topicTypeName
WARNING_LOG(m_logger) << "Could not find topic " << topicTypeName
<< " in external service definition for service "
<< externalServiceName;
return TopicTypeInformation();
@@ -757,18 +756,18 @@ TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalSer
EnumInformation XmlReader::getExternalEnumeration(const QString &externalServiceName, const QString &enumName, bool verbose)
{
DEBUG_LOG() << "externalServiceName: " << externalServiceName << ", topicTypeName: " << enumName;
DEBUG_LOG(m_logger) << "externalServiceName: " << externalServiceName << ", topicTypeName: " << enumName;
if (!loadExternalService(externalServiceName))
{
WARNING_LOG() << "Could not find service '" << externalServiceName << "'"
WARNING_LOG(m_logger) << "Could not find service '" << externalServiceName << "'"
<< " referenced by external enumeration " << enumName;
return EnumInformation();
}
auto extXmlReader = m_externalXmlInformations.value(externalServiceName);
if (!extXmlReader)
{
ERROR_LOG() << "Could not find service xml file for service '" << externalServiceName << "'";
ERROR_LOG(m_logger) << "Could not find service xml file for service '" << externalServiceName << "'";
return EnumInformation();
}
@@ -783,7 +782,7 @@ EnumInformation XmlReader::getExternalEnumeration(const QString &externalService
}
if (verbose)
{
WARNING_LOG() << "Could not find enumeration " << enumName
WARNING_LOG(m_logger) << "Could not find enumeration " << enumName
<< " in external service definition for '"
<< externalServiceName << "'";
}
@@ -821,11 +820,11 @@ bool XmlReader::loadExternalService(const QString &serviceName)
if (fileName.isEmpty())
return false;
DEBUG_LOG() << "xml file for " << serviceName << ": " << fileName;
DEBUG_LOG(m_logger) << "xml file for " << serviceName << ": " << fileName;
auto extXmlReader = QSharedPointer<XmlReader>(new XmlReader);
if (!extXmlReader->readServiceFile(fileName, QString(), this))
{
WARNING_LOG() << "Error reading service file " << fileName
WARNING_LOG(m_logger) << "Error reading service file " << fileName
<< " for service " << serviceName;
return false;
}
@@ -842,7 +841,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile)
QFile f(idlServiceInfoFile);
if (!f.open(QIODevice::ReadOnly))
{
WARNING_LOG() << "Could not read idl service info file " << idlServiceInfoFile;
WARNING_LOG(m_logger) << "Could not read idl service info file " << idlServiceInfoFile;
return;
}
const QList<QByteArray> files = f.readAll().split('\n');
@@ -859,7 +858,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile)
{
const auto svcAbbreveation = fn.split(QLatin1Char('.')).at(0).split(QLatin1Char('_')).at(0);
m_xmlFiles[svcAbbreveation] = fileName;
DEBUG_LOG() << "xml: " << svcAbbreveation << " = " << fileName;
DEBUG_LOG(m_logger) << "xml: " << svcAbbreveation << " = " << fileName;
}
else
{
@@ -867,7 +866,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile)
if (svcAbbreveation.endsWith(QLatin1String("_enums")))
continue;
m_idlFiles[svcAbbreveation] = fileName;
DEBUG_LOG() << "idl: " << svcAbbreveation << " = " << fileName;
DEBUG_LOG(m_logger) << "idl: " << svcAbbreveation << " = " << fileName;
}
}
}
@@ -893,7 +892,7 @@ void XmlReader::getServiceNameInfoFromFilePath(const QStringList &parts)
const QString abbreviation = parts.last().split(QLatin1Char('.')).first().split(QLatin1Char('_')).first();
const QString serviceName = parts.at(parts.size() - 2);
DEBUG_LOG() << "serviceName: " << serviceName << " = " << abbreviation;
DEBUG_LOG(m_logger) << "serviceName: " << serviceName << " = " << abbreviation;
m_fullServiceName2Abbreviation[serviceName] = abbreviation;
}