Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
140 lines
4.2 KiB
C++
140 lines
4.2 KiB
C++
// **************************************************************************
|
|
//
|
|
// (C) Copyright 2009 Swiss SIMTEC AG
|
|
//
|
|
// **************************************************************************
|
|
//
|
|
// $HeadURL$
|
|
// $LastChangedBy$
|
|
// $LastChangedDate$
|
|
// $LastChangedRevision$
|
|
//
|
|
// **************************************************************************
|
|
|
|
#include "LogViewTabWidget.hpp"
|
|
#include <QFrame>
|
|
#include <QGridLayout>
|
|
#include "LogViewField.hpp"
|
|
#include "LogViewTelegram.hpp"
|
|
#include "LogViewTelegramDialog.hpp"
|
|
#include "LogViewSpinBox.hpp"
|
|
#include "LogViewTelegram.hpp"
|
|
#include "LogViewTetraTelegramsParser.hpp"
|
|
|
|
namespace N_LogView
|
|
{
|
|
|
|
// ---------------------------------------------------------------
|
|
LogViewTabWidget::LogViewTabWidget(LogViewField* a_field, LogViewTelegramDialog* a_parent, LogViewSpinBox* a_spinBox)
|
|
: QTabWidget(a_parent)
|
|
, LogViewWidget(a_field, this, a_parent, false)
|
|
, m_TelegramDialog(a_parent)
|
|
, m_SpinBox(a_spinBox)
|
|
{
|
|
setVisible(false);
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
void LogViewTabWidget::changeSize(const int a_newSize)
|
|
{
|
|
// add new tabs
|
|
for (int i = count(); i < a_newSize; i++)
|
|
addTab(m_Field, true, i);
|
|
|
|
// remove old tabs
|
|
while (count() > a_newSize)
|
|
{
|
|
QStringList path = m_Field->jsonPath();
|
|
path += QStringLiteral("index: %1").arg(count() - 1);
|
|
m_TelegramDialog->removeItemsFromEditInfoList(path);
|
|
removeTab(count() - 1);
|
|
}
|
|
while (m_Field->childCount() > a_newSize)
|
|
m_Field->removeLastChild();
|
|
|
|
|
|
setVisible(a_newSize > 0);
|
|
m_TelegramDialog->makePretty(); // fixme: funktioniert so nicht, muss als signal realisiert werden
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
// Writes the content into telegram.
|
|
// Returns true if successful.
|
|
// ---------------------------------------------------------------
|
|
bool LogViewTabWidget::saveContent(LogViewTelegram* a_telegram)
|
|
{
|
|
if (a_telegram->isJsonTelegram())
|
|
return true;
|
|
// if m_SpinBox is NULL, we have a static array => no size has to be stored
|
|
if (m_SpinBox)
|
|
{
|
|
if (!isValid())
|
|
return false;
|
|
a_telegram->setUIntX(LogViewTelegram::SIZE_CENTRAL_DYN_ARRAY_SIZE, count());
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
void LogViewTabWidget::addTab(LogViewField* a_field, const bool a_isEmpty, int arrayIdx)
|
|
{
|
|
if (arrayIdx < 0)
|
|
{
|
|
WARNING_LOG(m_logger) << "Invalid array index given: " << arrayIdx;
|
|
return;
|
|
}
|
|
|
|
QFrame *frame = new QFrame;
|
|
QGridLayout *box = new QGridLayout(frame);
|
|
QTabWidget::addTab(frame, QStringLiteral("%1 %2").arg(a_field->cleanName()).arg(count()+1));
|
|
if (a_isEmpty)
|
|
a_field->setHasContent(false);
|
|
auto *childTree = a_field->child(arrayIdx);
|
|
while (!childTree)
|
|
{
|
|
const auto *first = a_field->child(0);
|
|
if (first)
|
|
{
|
|
LogViewField *fNew = first->clone(arrayIdx);
|
|
a_field->addChild(fNew);
|
|
childTree = a_field->child(arrayIdx);
|
|
}
|
|
else
|
|
{
|
|
LogViewTetraTelegramsParser *p = LogViewTelegram::jsonParser();
|
|
const StructInformation si = p->structFromType(a_field->type());
|
|
if (si.type != a_field->type())
|
|
{
|
|
WARNING_LOG(m_logger) << "Could not find type '" << a_field->type() << "' - can not add substructure";
|
|
return;
|
|
}
|
|
LogViewField *tc = new LogViewField(a_field->name() + QStringLiteral("TabChild"), LogViewField::e_FieldKindTabChild, a_field->xdrElement());
|
|
tc->setJsonPath(a_field->jsonPath());
|
|
a_field->addChild(tc);
|
|
const QString path(QStringLiteral("index: %1"));
|
|
LogViewTelegram::addFieldTreeStruct(QJsonObject(), tc, si, path.arg(arrayIdx), m_logger);
|
|
childTree = a_field->child(arrayIdx);
|
|
}
|
|
}
|
|
m_TelegramDialog->showTree(childTree, box);
|
|
|
|
// todo: sind nach dem dyn. array noch weitere Felder, so wird addTab nicht richtig funktionieren, weil die
|
|
// neuen Felder des Tabs am Ende von m_EditInfoList hinzugefügt werden => diese müssen mittendrin (an der richtigen
|
|
// position) eingefügt werden.
|
|
|
|
// update spinbox
|
|
if (m_SpinBox)
|
|
{
|
|
int spinValue = m_SpinBox->value();
|
|
if (spinValue < count())
|
|
m_SpinBox->setValue(count());
|
|
}
|
|
|
|
setVisible(true);
|
|
}
|
|
|
|
} // namespace N_LogView
|