Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1 parent
eb1d949edc
commit
815e16368e
1718 files changed
+126739
-18495
No files matched your search
@@ -31,7 +31,8 @@ LogViewField::LogViewField(const QString& a_name, const E_FieldKind a_kind, cons
|
||||
m_HasContent(true),
|
||||
m_bDeleteXdr(false),
|
||||
m_Kind(a_kind),
|
||||
m_XdrElement(a_xdrElement)
|
||||
m_XdrElement(a_xdrElement),
|
||||
m_logger(getLogger("LogViewField"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -134,5 +134,6 @@ namespace N_LogView
|
||||
const LogViewXdrElement *m_XdrElement;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <CoPrtCnv/CoPrtCnvRadioTelegram.hpp>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtWidgets/QApplication>
|
||||
@@ -72,6 +73,7 @@ LogViewGui::LogViewGui(QWidget* a_parent)
|
||||
, m_InjectionThread(nullptr)
|
||||
, m_replayTimer(new QTimer(this))
|
||||
, m_currentReplayRow(-1)
|
||||
, m_logger(getLogger("LogViewGui"))
|
||||
{
|
||||
setWindowIcon(QIcon(QLatin1String(":icons/16x16/rde_16x16.png")));
|
||||
|
||||
@@ -655,10 +657,10 @@ void LogViewGui::updateLogfile()
|
||||
|
||||
QString filePath(fileInfo.absolutePath() + QLatin1Char('/'));
|
||||
const QString baseName = fileInfo.baseName();
|
||||
const QVector<QStringRef> parts = baseName.splitRef(QLatin1Char('_'));
|
||||
const QStringList parts = baseName.split(QLatin1Char('_'));
|
||||
|
||||
for (int iterator = 0; iterator < parts.size() - 2; ++iterator)
|
||||
filePath += parts.at(iterator).toString() + QLatin1Char('_');
|
||||
for (int iterator = 0; iterator < parts.size() - 2; ++iterator)
|
||||
filePath += parts.at(iterator) + QLatin1Char('_');
|
||||
|
||||
QString nextFile(filePath + nextDate + QLatin1Char('.') + fileInfo.completeSuffix());
|
||||
QString checkFile(filePath + checkDate + QLatin1Char('.') + fileInfo.completeSuffix());
|
||||
@@ -912,9 +914,9 @@ void LogViewGui::startInjectionThread()
|
||||
settings.beginGroup(QLatin1String("LogFiles"));
|
||||
QString filePath = settings.value(QLatin1String("Dir")).toString();
|
||||
QString exerciseName;
|
||||
QVector<QStringRef> parts = filePath.splitRef(QLatin1Char('/'));
|
||||
QStringList parts = filePath.split(QLatin1Char('/'));
|
||||
if (parts.size() >= 2)
|
||||
exerciseName = QLatin1Char('_') + parts.at(parts.size() - 2).toString();
|
||||
exerciseName = QLatin1Char('_') + parts.at(parts.size() - 2);
|
||||
|
||||
QString portFilePath = QCoreApplication::applicationDirPath() + QDir::separator() + QLatin1String("PrtCnv") + exerciseName + QLatin1String(".dat");
|
||||
QFileInfo checkPortFile(portFilePath);
|
||||
|
||||
@@ -122,6 +122,7 @@ protected:
|
||||
QAction *m_reloadAction;
|
||||
QTimer *m_replayTimer;
|
||||
int m_currentReplayRow;
|
||||
NGL::INGLLogger &m_logger;
|
||||
protected:
|
||||
void readTelegramsFromLogFile(const QString& a_fileName, const qint64 a_filePos = 0);
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ LogViewInjectionThread::LogViewInjectionThread()
|
||||
, m_SendingPossible(false)
|
||||
, m_Socket(nullptr)
|
||||
, m_Timer(nullptr)
|
||||
, m_logger(getLogger("LogViewInjectionThread"))
|
||||
{
|
||||
|
||||
QSettings settings;
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace N_LogView
|
||||
QTimer *m_Timer;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
protected:
|
||||
protected slots:
|
||||
void tryToConnect();
|
||||
|
||||
@@ -48,7 +48,8 @@ int main(int argc, char *argv[])
|
||||
settings.endGroup();
|
||||
|
||||
QScreen *screen = QGuiApplication::screens().value(screenNbr, QGuiApplication::primaryScreen());
|
||||
N_LogView::LogViewGui* logViewGui = new N_LogView::LogViewGui(screen);
|
||||
Q_UNUSED(screen) // Qt6 removed QDesktopWidget (legacy passed QApplication::desktop()->screen(screenNbr) as the QWidget parent). The window is created parentless; LogViewGui restores its own size/position from QSettings (move(POS)).
|
||||
N_LogView::LogViewGui* logViewGui = new N_LogView::LogViewGui(nullptr);
|
||||
logViewGui->show();
|
||||
int ret = app.exec();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ QVariant ParticipantModel::data(const QModelIndex &index, int role) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (role == Qt::BackgroundColorRole)
|
||||
if (role == Qt::BackgroundRole)
|
||||
{
|
||||
if (p.first == 0)
|
||||
return QVariant();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGui/QAbstractTableModel>
|
||||
#include <QtCore/QAbstractTableModel>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QSortFilterProxyModel>
|
||||
#include <set>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "LogViewField.hpp"
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QLocale>
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtWidgets/QMessageBox>
|
||||
@@ -73,6 +74,7 @@ LogViewTelegram::LogViewTelegram(const LogViewTelegram &o)
|
||||
, m_data(o.m_data)
|
||||
, m_json(o.m_json)
|
||||
, m_TetraTelegram(nullptr)
|
||||
, m_logger(getLogger("LogViewTelegram"))
|
||||
{
|
||||
if (!m_data.isEmpty())
|
||||
m_TetraTelegram = new N_CoPrtCnv::CoPrtCnvRadioTelegram(m_data);
|
||||
@@ -100,6 +102,7 @@ LogViewTelegram::LogViewTelegram(const N_CoPrtCnv::CoPrtCnvLogHeader::E_CoPrtCnv
|
||||
, m_LogTime(0)
|
||||
, m_GpsTime(0)
|
||||
, m_TetraTelegram(nullptr)
|
||||
, m_logger(getLogger("LogViewTelegram"))
|
||||
{
|
||||
const uint32_t &waitTime = qgetenv("LogViewWaitTime").toUInt();
|
||||
if (waitTime > 0)
|
||||
@@ -143,6 +146,7 @@ LogViewTelegram::LogViewTelegram(const N_CoPrtCnv::CoPrtCnvLogHeader::E_CoPrtCnv
|
||||
, m_GpsTime(0)
|
||||
, m_data(a_telegramData)
|
||||
, m_TetraTelegram(nullptr)
|
||||
, m_logger(getLogger("LogViewTelegram"))
|
||||
{
|
||||
const uint32_t &waitTime = qgetenv("LogViewWaitTime").toUInt();
|
||||
if (waitTime > 0)
|
||||
@@ -1522,7 +1526,7 @@ void LogViewTelegram::updateJsonValue(const QStringList &path, const QJsonValue
|
||||
if (!key.startsWith(indexMarker))
|
||||
return;
|
||||
|
||||
const int arrayIdx = key.midRef(indexMarker.size()).toInt();
|
||||
const int arrayIdx = key.mid(indexMarker.size()).toInt();
|
||||
while (arr.size() <= arrayIdx)
|
||||
arr.append(QJsonValue());
|
||||
|
||||
@@ -1630,7 +1634,7 @@ void LogViewTelegram::showMessageBox(const QString& a_errorText, const QString&
|
||||
QLatin1String("gesendete") : QLatin1String("gelesene"));
|
||||
QMessageBox::warning(QApplication::topLevelWidgets()[0], a_title,
|
||||
QString::fromUtf8("Das %5 Telegramm mit Protokoll %6 von %1 (Unix-Zeit: %2) und Länge %3 ist fehlerhaft:<br><br><b>%4</b>")
|
||||
.arg(dt.toString(Qt::SystemLocaleLongDate)).arg(logTimeSec).arg(m_data.size()).arg(a_errorText, destStr).arg(m_Protocol));
|
||||
.arg(QLocale::system().toString(dt, QLocale::LongFormat)).arg(logTimeSec).arg(m_data.size()).arg(a_errorText, destStr).arg(m_Protocol));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -362,6 +362,8 @@ namespace N_LogView
|
||||
uint8_t getData(const uint16_t a_offset) const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
friend class LogViewTabWidget;
|
||||
|
||||
};
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace N_LogView
|
||||
LogViewTelegramDialog::LogViewTelegramDialog(QWidget *a_parent, const bool a_readonly)
|
||||
: QDialog(a_parent)
|
||||
, m_ReadOnly(a_readonly)
|
||||
, m_logger(getLogger("LogViewTelegramDialog"))
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,8 @@ private:
|
||||
QLineEdit *m_NameEdit = nullptr;
|
||||
QLineEdit *m_WaitTimeEdit = nullptr;
|
||||
bool m_ReadOnly = false;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -57,6 +57,7 @@ TelegramEdit::TelegramEdit(QWidget *parent)
|
||||
, m_DoLoop(false)
|
||||
, m_InjectionThread(nullptr)
|
||||
, m_EditModel(new TelegramEditModel(this))
|
||||
, m_logger(getLogger("LogViewTelegramEdit"))
|
||||
{
|
||||
m_addTeleAction->setShortcut(tr("Ctrl+A"));
|
||||
m_editTeleAction->setShortcut(tr("Ctrl+E"));
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "LogViewTelegram.hpp"
|
||||
#include <QtGui/QModelIndex>
|
||||
#include <QtCore/QModelIndex>
|
||||
|
||||
class QAction;
|
||||
class QTableView;
|
||||
@@ -60,6 +60,9 @@ protected:
|
||||
int m_curEditTelegramRow;
|
||||
|
||||
TelegramEditModel *m_EditModel;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
static QString s_DIR();
|
||||
static QString s_EDIT_TELEGRAM_GROUP();
|
||||
static QString s_TELEGRAMLIST_FILE_ID();
|
||||
|
||||
@@ -87,16 +87,16 @@ bool LogViewTetraTelegramsParser::parse(const QString &filename)
|
||||
const QString content = QString::fromUtf8(f.readAll());
|
||||
f.close();
|
||||
|
||||
const QVector<QStringRef> lines = content.splitRef(QLatin1Char('\n'));
|
||||
QVector<QStringRef> linesTrimmed;
|
||||
const QStringList lines = content.split(QLatin1Char('\n'));
|
||||
QStringList linesTrimmed;
|
||||
linesTrimmed.reserve(lines.size());
|
||||
for (const QStringRef &line : lines)
|
||||
for (const QString &line : lines)
|
||||
linesTrimmed += line.trimmed();
|
||||
|
||||
int i = 0;
|
||||
while (i < linesTrimmed.size())
|
||||
{
|
||||
const QStringRef &line = linesTrimmed.at(i);
|
||||
const QString &line = linesTrimmed.at(i);
|
||||
if (line.startsWith(QLatin1String("struct")))
|
||||
{
|
||||
i = parseStruct(linesTrimmed, i);
|
||||
@@ -136,22 +136,22 @@ void LogViewTetraTelegramsParser::insertPod(const QString &type, int byteLen, bo
|
||||
}
|
||||
|
||||
|
||||
int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringRef> &lines, int iStartPos)
|
||||
int LogViewTetraTelegramsParser::parseStruct(const QStringList &lines, int iStartPos)
|
||||
{
|
||||
const QVector<QStringRef> tokens = tokenize(lines.at(iStartPos));
|
||||
const QStringList tokens = tokenize(lines.at(iStartPos));
|
||||
if (tokens.size() < 2)
|
||||
return -1;
|
||||
const QStringRef &structType = tokens.at(1);
|
||||
if (structType.endsWith(QLatin1Char(';')))
|
||||
return iStartPos;
|
||||
const QString &structType = tokens.at(1);
|
||||
if (structType.endsWith(QLatin1Char(';')))
|
||||
return iStartPos;
|
||||
|
||||
StructInformation si;
|
||||
si.type = structType.toString();
|
||||
si.type = structType;
|
||||
if (tokens.size() > 2)
|
||||
{
|
||||
if (tokens.at(2) != QLatin1String(":"))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse struct: '" << lines.at(iStartPos).toString() << "', line: " << iStartPos + 1;
|
||||
WARNING_LOG(m_logger) << "Could not parse struct: '" << lines.at(iStartPos) << "', line: " << iStartPos + 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -159,29 +159,29 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringRef> &lines, i
|
||||
{
|
||||
if (!si.baseStruct.isEmpty())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse struct: '" << lines.at(iStartPos).toString() << "', line: " << iStartPos + 1;
|
||||
WARNING_LOG(m_logger) << "Could not parse struct: '" << lines.at(iStartPos) << "', line: " << iStartPos + 1;
|
||||
return -1;
|
||||
}
|
||||
QStringRef base = tokens.at(i);
|
||||
QString base = tokens.at(i);
|
||||
if (base == QLatin1String("public") ||
|
||||
base == QLatin1String("protected") ||
|
||||
base == QLatin1String("private"))
|
||||
continue;
|
||||
if (base.endsWith(QLatin1Char(',')))
|
||||
base.chop(1);
|
||||
if (base.endsWith(QLatin1Char('>')))
|
||||
if (base.endsWith(QLatin1Char('>')))
|
||||
{
|
||||
si.isVisible = true;
|
||||
continue;
|
||||
}
|
||||
si.baseStruct = tokens.at(i).toString();
|
||||
si.baseStruct = tokens.at(i);
|
||||
}
|
||||
}
|
||||
|
||||
int i = iStartPos + 1;
|
||||
while (i < lines.size())
|
||||
{
|
||||
const QVector<QStringRef> tokens = tokenize(lines.at(i));
|
||||
const QStringList tokens = tokenize(lines.at(i));
|
||||
if (!validStructTokens(tokens))
|
||||
{
|
||||
++i;
|
||||
@@ -204,17 +204,17 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringRef> &lines, i
|
||||
const int parserCommentPos = tokens.at(2) == QLatin1String("=") ? 4 : 2;
|
||||
if (tokens.size() > parserCommentPos)
|
||||
{
|
||||
const QStringRef &comment = tokens.at(parserCommentPos);
|
||||
DEBUG_LOG(m_logger) << "comment: " << comment.toString();
|
||||
const QString &comment = tokens.at(parserCommentPos);
|
||||
DEBUG_LOG(m_logger) << "comment: " << comment;
|
||||
if (comment.startsWith(QLatin1String("//@array: ")))
|
||||
{
|
||||
const QStringRef hint = comment.mid(QLatin1String("//@array: ").size());
|
||||
QString structStr = QLatin1String("struct ") + si.type + QLatin1String("::") + tokens.at(0).toString() + QLatin1Char('\n') + hint.toString();
|
||||
const QString hint = comment.mid(QLatin1String("//@array: ").size());
|
||||
QString structStr = QLatin1String("struct ") + si.type + QLatin1String("::") + tokens.at(0) + QLatin1Char('\n') + hint;
|
||||
structStr.replace(QLatin1Char(';'), QLatin1String(";\n"));
|
||||
DEBUG_LOG(m_logger) << "structStr: " << structStr;
|
||||
parseStruct(structStr.splitRef(QLatin1Char('\n')), 0);
|
||||
parseStruct(structStr.split(QLatin1Char('\n')), 0);
|
||||
|
||||
mi.type = si.type + QLatin1String("::") + tokens.at(0).toString();
|
||||
mi.type = si.type + QLatin1String("::") + tokens.at(0);
|
||||
mi.isArray = true;
|
||||
}
|
||||
if (comment == QLatin1String("//@invisible"))
|
||||
@@ -222,13 +222,13 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringRef> &lines, i
|
||||
}
|
||||
}
|
||||
|
||||
QStringRef name = tokens.at(1);
|
||||
QString name = tokens.at(1);
|
||||
if (name.endsWith(QLatin1Char(';')))
|
||||
name.chop(1);
|
||||
if (mi.type.isEmpty())
|
||||
mi.type += tokens.at(0).toString();
|
||||
mi.type += tokens.at(0);
|
||||
categorizeMember(mi);
|
||||
mi.name = name.toString();
|
||||
mi.name = name;
|
||||
if (mi.isEnum && !mi.type.contains(QLatin1String("::")))
|
||||
{
|
||||
|
||||
@@ -265,29 +265,29 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringRef> &lines, i
|
||||
return i;
|
||||
}
|
||||
|
||||
int LogViewTetraTelegramsParser::parseEnum(const QVector<QStringRef> &lines, int iStartPos, const QString &ns, StructInformation *si)
|
||||
int LogViewTetraTelegramsParser::parseEnum(const QStringList &lines, int iStartPos, const QString &ns, StructInformation *si)
|
||||
{
|
||||
const QVector<QStringRef> tokens = tokenize(lines.at(iStartPos));
|
||||
const QStringList tokens = tokenize(lines.at(iStartPos));
|
||||
if (tokens.size() < 2)
|
||||
return -1;
|
||||
QStringRef enumName = tokens.at(1);
|
||||
QString enumName = tokens.at(1);
|
||||
if (enumName == QLatin1String("class"))
|
||||
{
|
||||
if (tokens.size() < 3)
|
||||
return -1;
|
||||
enumName = tokens.at(2);
|
||||
}
|
||||
if (enumName.endsWith(QLatin1Char(';')))
|
||||
return iStartPos;
|
||||
if (enumName.endsWith(QLatin1Char(';')))
|
||||
return iStartPos;
|
||||
|
||||
EnumInformation ei;
|
||||
ei.type = enumName.toString();
|
||||
ei.type = enumName;
|
||||
ei.ns = ns;
|
||||
|
||||
int i = iStartPos + 1;
|
||||
while (i < lines.size())
|
||||
{
|
||||
const QVector<QStringRef> tokens = tokenize(lines.at(i).split(QStringLiteral("//")).first());
|
||||
const QStringList tokens = tokenize(lines.at(i).split(QStringLiteral("//")).first());
|
||||
if (tokens.isEmpty() ||
|
||||
(tokens.at(0) == QLatin1String("{")))
|
||||
{
|
||||
@@ -308,19 +308,19 @@ int LogViewTetraTelegramsParser::parseEnum(const QVector<QStringRef> &lines, int
|
||||
else
|
||||
mi.type = ns + QStringLiteral("::") + ei.type;
|
||||
mi.isEnum = true;
|
||||
mi.name = tokens.at(1).toString();
|
||||
mi.name = tokens.at(1);
|
||||
si->member.push_back(std::move(mi));
|
||||
break;
|
||||
}
|
||||
WARNING_LOG(m_logger) << "Could not parse enum: '" << lines.at(i).toString() << "', line: " << i + 1;
|
||||
WARNING_LOG(m_logger) << "Could not parse enum: '" << lines.at(i) << "', line: " << i + 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
EnumValue ev;
|
||||
ev.key = tokens.at(0).toString();
|
||||
ev.key = tokens.at(0);
|
||||
if (tokens.size() == 3)
|
||||
{
|
||||
QStringRef value = tokens.at(2);
|
||||
QString value = tokens.at(2);
|
||||
if (value.endsWith(QLatin1Char(',')))
|
||||
value.chop(1);
|
||||
ev.value = value.toInt();
|
||||
@@ -346,28 +346,28 @@ int LogViewTetraTelegramsParser::parseEnum(const QVector<QStringRef> &lines, int
|
||||
return i;
|
||||
}
|
||||
|
||||
int LogViewTetraTelegramsParser::parseConstraint(const QVector<QStringRef> &lines, int iStartPos)
|
||||
int LogViewTetraTelegramsParser::parseConstraint(const QStringList &lines, int iStartPos)
|
||||
{
|
||||
const QVector<QStringRef> tokens = tokenize(lines.at(iStartPos));
|
||||
const QStringList tokens = tokenize(lines.at(iStartPos));
|
||||
if (tokens.size() != 4)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(iStartPos).toString() << "'";
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(iStartPos) << "'";
|
||||
return -1;
|
||||
}
|
||||
const QStringRef &cs = tokens.at(3);
|
||||
const QString &cs = tokens.at(3);
|
||||
if (!cs.startsWith(QLatin1String("Constraints<")) || !cs.endsWith(QLatin1Char('>')))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(iStartPos).toString() << "'";
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(iStartPos) << "'";
|
||||
return -1;
|
||||
}
|
||||
QStringRef structName = cs.mid(QLatin1String("Constraints<").size());
|
||||
QString structName = cs.mid(QLatin1String("Constraints<").size());
|
||||
structName.chop(1);
|
||||
DEBUG_LOG(m_logger) << "Constraint: " << structName.toString();
|
||||
DEBUG_LOG(m_logger) << "Constraint: " << structName;
|
||||
|
||||
int i = iStartPos + 1;
|
||||
while (i < lines.size())
|
||||
{
|
||||
const QVector<QStringRef> tokens = tokenize(lines.at(i));
|
||||
const QStringList tokens = tokenize(lines.at(i));
|
||||
if (tokens.isEmpty() ||
|
||||
(tokens.at(0) == QLatin1String("{")))
|
||||
{
|
||||
@@ -381,14 +381,14 @@ int LogViewTetraTelegramsParser::parseConstraint(const QVector<QStringRef> &line
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
const QVector<QStringRef> parts = tokens.at(6).split(QLatin1String("::"));
|
||||
const QStringList parts = tokens.at(6).split(QLatin1String("::"));
|
||||
if (parts.size() != 2)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(i).toString() << "'";
|
||||
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(i) << "'";
|
||||
return -1;
|
||||
}
|
||||
|
||||
QStringRef enumKey = parts.at(1);
|
||||
QString enumKey = parts.at(1);
|
||||
if (enumKey.endsWith(QLatin1Char(';')))
|
||||
enumKey.chop(1);
|
||||
bool bFound = false;
|
||||
@@ -396,14 +396,14 @@ int LogViewTetraTelegramsParser::parseConstraint(const QVector<QStringRef> &line
|
||||
{
|
||||
if (v.key == enumKey)
|
||||
{
|
||||
m_visibleTelegrams.insert(v.value, structName.toString());
|
||||
m_visibleTelegrams.insert(v.value, structName);
|
||||
bFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!bFound)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not find enum value '" << enumKey.toString() << "' in enum TelegramId";
|
||||
WARNING_LOG(m_logger) << "Could not find enum value '" << enumKey << "' in enum TelegramId";
|
||||
return -1;
|
||||
}
|
||||
++i;
|
||||
@@ -434,7 +434,7 @@ void LogViewTetraTelegramsParser::categorizeMember(MemberInformation &mi) const
|
||||
mi.isBinary = (mi.type == QLatin1String("std::vector<unsigned char>") || mi.type == QLatin1String("QByteArray"));
|
||||
}
|
||||
|
||||
static inline void bracketCount(const QStringRef &str, int &cntLt, int &cntGt)
|
||||
static inline void bracketCount(const QString &str, int &cntLt, int &cntGt)
|
||||
{
|
||||
cntLt = 0;
|
||||
cntGt = 0;
|
||||
@@ -447,21 +447,33 @@ static inline void bracketCount(const QStringRef &str, int &cntLt, int &cntGt)
|
||||
}
|
||||
}
|
||||
|
||||
QVector<QStringRef> LogViewTetraTelegramsParser::tokenize(const QStringRef &line) const
|
||||
QStringList LogViewTetraTelegramsParser::tokenize(const QString &line) const
|
||||
{
|
||||
QVector<QStringRef> ret = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
||||
QStringList ret = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||
// QStringRef is gone in Qt6: remember the offset of each token within
|
||||
// the original line so the merge logic below can rebuild substrings
|
||||
// (the equivalent of QStringRef(token.string(), position, length)).
|
||||
QVector<int> positions;
|
||||
positions.reserve(ret.size());
|
||||
int from = 0;
|
||||
for (const QString &t : ret)
|
||||
{
|
||||
const int pos = line.indexOf(t, from);
|
||||
positions.push_back(pos);
|
||||
from = pos + t.size() + 1;
|
||||
}
|
||||
int i = 0;
|
||||
while (i < ret.size())
|
||||
{
|
||||
const QStringRef &token = ret.at(i);
|
||||
const QString &token = ret.at(i);
|
||||
if (token.startsWith(QLatin1String("//")))
|
||||
{
|
||||
|
||||
|
||||
if (i == ret.size() - 1)
|
||||
break;
|
||||
const QStringRef &lastToken = ret.last();
|
||||
const QStringRef newToken = QStringRef(token.string(), token.position(), lastToken.position() - token.position() + lastToken.size());
|
||||
DEBUG_LOG(m_logger) << "New Token: " << newToken.toString();
|
||||
const QString &lastToken = ret.last();
|
||||
const QString newToken = line.mid(positions.at(i), positions.last() - positions.at(i) + lastToken.size());
|
||||
DEBUG_LOG(m_logger) << "New Token: " << newToken;
|
||||
ret.resize(i + 1);
|
||||
ret[i] = newToken;
|
||||
break;
|
||||
@@ -476,9 +488,9 @@ QVector<QStringRef> LogViewTetraTelegramsParser::tokenize(const QStringRef &line
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
const QStringRef &nextToken = ret.at(i + 1);
|
||||
const QStringRef newToken = QStringRef(token.string(), token.position(), nextToken.position() - token.position() + nextToken.size());
|
||||
DEBUG_LOG(m_logger) << "New Token: " << newToken.toString();
|
||||
const QString &nextToken = ret.at(i + 1);
|
||||
const QString newToken = line.mid(positions.at(i), positions.at(i + 1) - positions.at(i) + nextToken.size());
|
||||
DEBUG_LOG(m_logger) << "New Token: " << newToken;
|
||||
ret.removeAt(i + 1);
|
||||
ret[i] = newToken;
|
||||
}
|
||||
@@ -486,7 +498,7 @@ QVector<QStringRef> LogViewTetraTelegramsParser::tokenize(const QStringRef &line
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool LogViewTetraTelegramsParser::validStructTokens(const QVector<QStringRef> &tokens)
|
||||
bool LogViewTetraTelegramsParser::validStructTokens(const QStringList &tokens)
|
||||
{
|
||||
if (tokens.isEmpty() ||
|
||||
(tokens.at(0) == QLatin1String("{")) ||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVector>
|
||||
#include "logger.h"
|
||||
|
||||
@@ -72,17 +73,18 @@ public:
|
||||
static QString getInnerType(const QString &type);
|
||||
private:
|
||||
void insertPod(const QString &type, int byteLen, bool isSigned, bool isIntegral, bool isBoolean = false);
|
||||
int parseStruct(const QVector<QStringRef> &lines, int iStartPos);
|
||||
int parseEnum(const QVector<QStringRef> &lines, int iStartPos, const QString &ns, StructInformation *si = nullptr);
|
||||
int parseConstraint(const QVector<QStringRef> &lines, int iStartPos);
|
||||
int parseStruct(const QStringList &lines, int iStartPos);
|
||||
int parseEnum(const QStringList &lines, int iStartPos, const QString &ns, StructInformation *si = nullptr);
|
||||
int parseConstraint(const QStringList &lines, int iStartPos);
|
||||
void categorizeMember(MemberInformation &mi) const;
|
||||
QVector<QStringRef> tokenize(const QStringRef &line) const;
|
||||
static bool validStructTokens(const QVector<QStringRef> &tokens);
|
||||
QStringList tokenize(const QString &line) const;
|
||||
static bool validStructTokens(const QStringList &tokens);
|
||||
private:
|
||||
EnumInformation m_telegramIdEnum;
|
||||
QVector<EnumInformation> m_enums;
|
||||
QHash<QString, StructInformation> m_structs;
|
||||
QHash<QString, PodInformation> m_pods;
|
||||
QHash<int, QString> m_visibleTelegrams;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
@@ -30,6 +30,7 @@ LogViewWidget::LogViewWidget(LogViewField* a_field, QWidget* a_widget, QWidget*
|
||||
, m_Widget(a_widget)
|
||||
, m_Field(a_field)
|
||||
, m_Parent(a_parent)
|
||||
, m_logger(getLogger("LogViewWidget"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ protected:
|
||||
LogViewField *m_Field;
|
||||
|
||||
QWidget *m_Parent;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -54,6 +54,8 @@ namespace N_LogView
|
||||
QString m_Name;
|
||||
E_ElementKind m_Kind;
|
||||
QString getKindName() const;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -37,6 +37,7 @@ LogViewXdrParser::LogViewXdrParser()
|
||||
, m_WordListIndex(0)
|
||||
, m_ActElement(nullptr)
|
||||
, m_State(e_ParseMain)
|
||||
, m_logger(getLogger("LogViewXdrParser"))
|
||||
{}
|
||||
|
||||
LogViewXdrParser::~LogViewXdrParser()
|
||||
@@ -317,15 +318,15 @@ void LogViewXdrParser::parseDefine(const QString &a_line)
|
||||
int sepPos = line.indexOf(QLatin1Char(' '));
|
||||
if (sepPos >= 0)
|
||||
{
|
||||
const QString name = line.leftRef(sepPos).trimmed().toString();
|
||||
QStringRef substitution = line.midRef(sepPos).trimmed();
|
||||
const QString name = line.left(sepPos).trimmed();
|
||||
QString substitution = line.mid(sepPos).trimmed();
|
||||
sepPos = substitution.indexOf(QLatin1Char(' '));
|
||||
if (sepPos >= 0)
|
||||
substitution = substitution.left(sepPos).trimmed();
|
||||
|
||||
|
||||
bool ok = false;
|
||||
const int64_t value = calcValue(substitution.toString(), ok);
|
||||
const int64_t value = calcValue(substitution, ok);
|
||||
if (ok)
|
||||
{
|
||||
|
||||
@@ -352,7 +353,7 @@ void LogViewXdrParser::parseEnum(const QString &a_line, const uint16_t a_enumSiz
|
||||
if (a_line.endsWith(QLatin1String(" {")))
|
||||
{
|
||||
m_State = e_ParseEnum;
|
||||
const QString name = a_line.leftRef(a_line.length()-2).trimmed().toString();
|
||||
const QString name = a_line.left(a_line.length()-2).trimmed();
|
||||
m_ActElement = new LogViewXdrStruct(name, LogViewXdrElement::e_KindEnum, a_enumSize);
|
||||
if (!addToElementMap(name, m_ActElement))
|
||||
{
|
||||
@@ -617,8 +618,8 @@ bool LogViewXdrParser::parseEnumLine(const QString& a_line, QString& a_name, QSt
|
||||
int sepPos = line.lastIndexOf(QLatin1Char('='));
|
||||
if (-1 != sepPos)
|
||||
{
|
||||
a_name = line.leftRef(sepPos).trimmed().toString();
|
||||
a_value = line.midRef(sepPos+1).trimmed().toString();
|
||||
a_name = line.left(sepPos).trimmed();
|
||||
a_value = line.mid(sepPos+1).trimmed();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -870,7 +871,7 @@ void LogViewXdrParser::fillWordList(const QString& a_line)
|
||||
line.replace(QLatin1Char('}'), QLatin1String(" } "));
|
||||
line.replace(QLatin1Char(':'), QLatin1String(" : "));
|
||||
line.replace(QLatin1Char(';'), QLatin1String(" ; "));
|
||||
m_WordList = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
||||
m_WordList = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||
m_WordListIndex = 0;
|
||||
|
||||
|
||||
|
||||
@@ -174,6 +174,7 @@ namespace N_LogView
|
||||
bool addToElementMap(const QString& a_name, LogViewXdrElement* a_element);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user