Adds first successful release run (tbc)

This commit is contained in:
torsten committed 2026-10-12 15:02:02 +00:00
1 parent 444ac417bf
commit 1a38b88229
22 files changed
+89 -34

No files matched your search

@@ -4,11 +4,19 @@
# $Author$
#
ADD_SUBDIRECTORY(Console)
# Create a separate library for logger functionality that can be linked by other targets
NGL_ADD_LIBRARY(LogViewLogger AAR SV STATIC
logger.cpp
logger.h
)
NGL_TARGET_LINK_LIBRARIES(LogViewLogger
NGLLogger
)
SET(my_SRCS
IntegerCalculator.cpp
IntegerCalculator.hpp
logger.cpp
logger.h
LogViewBooleanEdit.cpp
LogViewBooleanEdit.hpp
LogViewDateTimeEdit.cpp
@@ -79,6 +87,7 @@ if(QT6_GUI_AVAILABLE)
NGLLogger
nglapplication
ngltools
LogViewLogger
)
endif()
NGL_INSTALL_TARGET(LogView)
@@ -1,5 +1,6 @@
#include <nglapplication/nglapplication.h>
#include <QtGui/QScreen>
#include <QtGui/QWindow>
#include <QtCore/QSettings>
#include <QNetworkProxy>
#ifndef WIN32
@@ -48,7 +49,10 @@ 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);
N_LogView::LogViewGui* logViewGui = new N_LogView::LogViewGui(nullptr);
if (logViewGui->windowHandle()) {
logViewGui->windowHandle()->setScreen(screen);
}
logViewGui->show();
int ret = app.exec();
@@ -25,11 +25,12 @@ namespace N_LogView
{
LogViewTabWidget::LogViewTabWidget(LogViewField* a_field, LogViewTelegramDialog* a_parent, LogViewSpinBox* a_spinBox)
LogViewTabWidget::LogViewTabWidget(LogViewField* a_field, LogViewTelegramDialog* a_parent, LogViewSpinBox* a_spinBox, NGL::INGLLogger& logger)
: QTabWidget(a_parent)
, LogViewWidget(a_field, this, a_parent, false)
, m_TelegramDialog(a_parent)
, m_SpinBox(a_spinBox)
, m_logger(logger)
{
setVisible(false);
}
@@ -15,6 +15,7 @@
#include <QtWidgets/QTabWidget>
#include "LogViewWidget.hpp"
#include "logger.h"
namespace N_LogView
@@ -29,7 +30,7 @@ namespace N_LogView
Q_OBJECT
public:
LogViewTabWidget(LogViewField* a_field, LogViewTelegramDialog* a_parent, LogViewSpinBox* a_spinBox);
LogViewTabWidget(LogViewField* a_field, LogViewTelegramDialog* a_parent, LogViewSpinBox* a_spinBox, NGL::INGLLogger& logger);
bool saveContent(LogViewTelegram* a_telegram) override;
void addTab(LogViewField* a_field, const bool a_isEmpty, int arrayIdx);
@@ -43,6 +44,7 @@ namespace N_LogView
LogViewTelegramDialog* m_TelegramDialog;
LogViewSpinBox* m_SpinBox;
NGL::INGLLogger& m_logger;
};
@@ -24,11 +24,12 @@ namespace N_LogView
{
LogViewTableWidget::LogViewTableWidget(LogViewField* a_field, QWidget* a_parent, const bool a_readonly)
LogViewTableWidget::LogViewTableWidget(LogViewField* a_field, QWidget* a_parent, const bool a_readonly, NGL::INGLLogger& logger)
: QTableWidget(0, 2, a_parent)
, LogViewWidget(a_field, this, a_parent, a_readonly)
, m_IsFloat(false)
, m_IsEnum(false)
, m_logger(logger)
{
switch (m_Field->xdrElement()->getKind())
{
@@ -15,6 +15,7 @@
#include <QTableWidget>
#include "LogViewWidget.hpp"
#include "logger.h"
namespace N_LogView
{
@@ -24,7 +25,7 @@ namespace N_LogView
{
Q_OBJECT
public:
LogViewTableWidget(LogViewField* a_field, QWidget* a_parent, const bool a_readonly);
LogViewTableWidget(LogViewField* a_field, QWidget* a_parent, const bool a_readonly, NGL::INGLLogger& logger);
@@ -42,5 +43,6 @@ namespace N_LogView
private:
bool m_IsFloat;
bool m_IsEnum;
NGL::INGLLogger& m_logger;
};
}
@@ -102,7 +102,7 @@ LogViewTelegram::LogViewTelegram(const N_CoPrtCnv::CoPrtCnvLogHeader::E_CoPrtCnv
, m_LogTime(0)
, m_GpsTime(0)
, m_TetraTelegram(nullptr)
, m_logger(N_LogView::getLogger())
, m_logger(N_LogView::getLogger("LogViewTelegram"))
{
const uint32_t &waitTime = qgetenv("LogViewWaitTime").toUInt();
if (waitTime > 0)
@@ -146,7 +146,7 @@ LogViewTelegram::LogViewTelegram(const N_CoPrtCnv::CoPrtCnvLogHeader::E_CoPrtCnv
, m_GpsTime(0)
, m_data(a_telegramData)
, m_TetraTelegram(nullptr)
, m_logger(N_LogView::getLogger())
, m_logger(N_LogView::getLogger("LogViewTelegram"))
{
const uint32_t &waitTime = qgetenv("LogViewWaitTime").toUInt();
if (waitTime > 0)
@@ -1526,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());
@@ -262,6 +262,7 @@ namespace N_LogView
QJsonObject m_json;
N_CoPrtCnv::CoPrtCnvRadioTelegram *m_TetraTelegram;
NGL::INGLLogger& m_logger;
LogViewField *getFieldTree(const QString& a_type, const QString& a_name,
uint16_t a_arraySize, const LogViewXdrType* a_parentElement = nullptr,
@@ -35,7 +35,7 @@ class LogViewTelegramDialog : public QDialog
{
Q_OBJECT
public:
explicit LogViewTelegramDialog(QWidget *a_parent = nullptr, const bool a_readonly = true, NGL::INGLLogger& logger = N_LogView::getLogger());
explicit LogViewTelegramDialog(QWidget *a_parent = nullptr, const bool a_readonly = true, NGL::INGLLogger& logger = N_LogView::getLogger("LogViewTelegramDialog"));
void showDialog(const QSharedPointer<LogViewTelegram> &a_telegram);
void showDataDump(const QSharedPointer<LogViewTelegram> &a_telegram, bool showErrorMessage);
@@ -88,7 +88,11 @@ bool LogViewTetraTelegramsParser::parse(const QString &filename)
const QString content = QString::fromUtf8(f.readAll());
f.close();
const QVector<QStringView> lines = content.splitView(QLatin1Char('\n'));
const QStringList linesList = content.split(QLatin1Char('\n'));
QVector<QStringView> lines;
lines.reserve(linesList.size());
for (const QString &line : linesList)
lines += line;
QVector<QStringView> linesTrimmed;
linesTrimmed.reserve(lines.size());
for (const QStringView &line : lines)
@@ -213,7 +217,12 @@ int LogViewTetraTelegramsParser::parseStruct(const QVector<QStringView> &lines,
QString structStr = QLatin1String("struct ") + si.type + QLatin1String("::") + tokens.at(0).toString() + QLatin1Char('\n') + hint.toString();
structStr.replace(QLatin1Char(';'), QLatin1String(";\n"));
DEBUG_LOG(m_logger) << "structStr: " << structStr;
parseStruct(structStr.splitView(QLatin1Char('\n')), 0);
const QStringList structLines = structStr.split(QLatin1Char('\n'));
QVector<QStringView> structLinesView;
structLinesView.reserve(structLines.size());
for (const QString &line : structLines)
structLinesView += line;
parseStruct(structLinesView, 0);
mi.type = si.type + QLatin1String("::") + tokens.at(0).toString();
mi.isArray = true;
@@ -382,7 +391,7 @@ int LogViewTetraTelegramsParser::parseConstraint(const QVector<QStringView> &lin
++i;
continue;
}
const QVector<QStringView> parts = tokens.at(6).split(QLatin1String("::"));
const QVector<QStringView> parts = tokens.at(6).split(u"::");
if (parts.size() != 2)
{
WARNING_LOG(m_logger) << "Could not parse constraint: '" << lines.at(i).toString() << "'";
@@ -451,6 +460,17 @@ static inline void bracketCount(const QStringView &str, int &cntLt, int &cntGt)
QVector<QStringView> LogViewTetraTelegramsParser::tokenize(const QStringView &line) const
{
QVector<QStringView> ret = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
// Calculate positions for each token (Qt6 QStringView has no position() method)
QVector<int> positions(ret.size());
int currentPos = 0;
for (int j = 0; j < ret.size(); ++j)
{
// Find position of this token in the original line
positions[j] = line.indexOf(ret[j], currentPos);
currentPos = positions[j] + ret[j].size();
}
int i = 0;
while (i < ret.size())
{
@@ -461,7 +481,7 @@ QVector<QStringView> LogViewTetraTelegramsParser::tokenize(const QStringView &li
if (i == ret.size() - 1)
break;
const QStringView &lastToken = ret.last();
const QStringView newToken = line.mid(token.position(), lastToken.position() - token.position() + lastToken.size());
const QStringView newToken = line.mid(positions[i], positions.last() - positions[i] + lastToken.size());
DEBUG_LOG(m_logger) << "New Token: " << newToken.toString();
ret.resize(i + 1);
ret[i] = newToken;
@@ -478,7 +498,7 @@ QVector<QStringView> LogViewTetraTelegramsParser::tokenize(const QStringView &li
continue;
}
const QStringView &nextToken = ret.at(i + 1);
const QStringView newToken = line.mid(token.position(), nextToken.position() - token.position() + nextToken.size());
const QStringView newToken = line.mid(positions[i], positions[i + 1] - positions[i] + nextToken.size());
DEBUG_LOG(m_logger) << "New Token: " << newToken.toString();
ret.removeAt(i + 1);
ret[i] = newToken;
@@ -77,7 +77,7 @@ private:
int parseEnum(const QVector<QStringView> &lines, int iStartPos, const QString &ns, StructInformation *si = nullptr);
int parseConstraint(const QVector<QStringView> &lines, int iStartPos);
void categorizeMember(MemberInformation &mi) const;
QVector<QStringView> tokenize(QStringView line) const;
QVector<QStringView> tokenize(const QStringView &line) const;
static bool validStructTokens(const QVector<QStringView> &tokens);
private:
EnumInformation m_telegramIdEnum;
@@ -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"))
{
}
@@ -15,6 +15,7 @@
#include <QtWidgets/QWidget>
#include "logger.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
class QWidget;
class QFont;
@@ -77,6 +78,8 @@ protected:
LogViewField *m_Field;
QWidget *m_Parent;
LOGGER_T m_logger;
};
}
@@ -53,6 +53,7 @@ namespace N_LogView
protected:
QString m_Name;
E_ElementKind m_Kind;
LOGGER_T m_logger;
QString getKindName() const;
};
@@ -37,6 +37,7 @@ LogViewXdrParser::LogViewXdrParser()
, m_WordListIndex(0)
, m_ActElement(nullptr)
, m_State(e_ParseMain)
, m_logger(getLogger("LogViewXdrParser"))
{}
LogViewXdrParser::~LogViewXdrParser()
@@ -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;
@@ -19,6 +19,7 @@
#include "IntegerCalculator.hpp"
#include "logger.h"
#include "LogViewXdrStandardType.hpp"
#include "NGLLoggerBootstrap.h"
namespace N_LogView
{
@@ -174,6 +175,7 @@ namespace N_LogView
bool addToElementMap(const QString& a_name, LogViewXdrElement* a_element);
private:
LOGGER_T m_logger;
};
}