Files
qt-migration-legatus/qt5-before/dlbo/Lts/Tools/DotMatrixDisplay/displayPanelSimulatorMain.cpp
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
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>
2026-09-15 18:20:26 +00:00

127 lines
4.3 KiB
C++

/**
* @RDE_HEADER@
* Display Panel Simulator main programm; collects commandline options
* $Id$
* $HeadURL$
* $Author$
* Created by Florian Schult, SLSE, 2016-03-18
*/
#include <nglapplication/nglapplication.h>
#include <NGLLogger/INGLLogger.h>
#include <memory>
#include "displayPanelSimulatorWidget.h"
#include "nglsettings.h"
#include "cmdlineparser.h"
/**
* Main entry point for program.
*/
int main(int argc, char *argv[])
{
NGLApplication application(argc, argv);
application.setOrganizationName(QStringLiteral("RME"));
application.setApplicationName(QStringLiteral("Dot Matrix Display Simulator"));
application.createLogger("DispSim", "log4cxx_displayPanelSimulator.props");
int ret = -1;
{
std::unique_ptr<CmdLineParser> parser(new CmdLineParser);
if (!parser->init())
return ret;
QCommandLineOption modeOption({ QLatin1String("m"), QLatin1String("mode")}, QLatin1String("mode (not valid for use with -c)"), QLatin1String("?"));
QCommandLineOption portOption({ QLatin1String("p"), QLatin1String("port")}, QLatin1String("Port(s), comma separated; better be over 9000"), QLatin1String("9000"));
QCommandLineOption showPortOption({ QLatin1String("s"), QLatin1String("showport")}, QLatin1String("Set, for showing the portnumbers"));
QCommandLineOption countOption({ QLatin1String("c"), QLatin1String("count")}, QLatin1String("Ports added on startport; ignored, when port has multiple"), QLatin1String("-1"));
QCommandLineOption windowOption({ QLatin1String("w"), QLatin1String("window")}, QLatin1String("Starts application in window mode (overrides ini)"));
QCommandLineOption inifileOption({ QLatin1String("i"), QLatin1String("inifile")}, QLatin1String("Path/Name for saving and loading settings to an .ini File"), QLatin1String("my.ini"));
QCommandLineOption graphicOption({ QLatin1String("g"), QLatin1String("graphic")}, QLatin1String("Path/Name for loading a graphic from a .png File"), QLatin1String("rde.ico"));
parser->addOption(modeOption);
parser->addOption(portOption);
parser->addOption(showPortOption);
parser->addOption(countOption);
parser->addOption(windowOption);
parser->addOption(inifileOption);
parser->addOption(graphicOption);
parser->addHelpOption();
parser->process(application);
// ---------- Getting mode ----------
if (parser->isSet(modeOption))
parser->setMode(parser->value(modeOption));
QString mode = parser->mode();
// ---------- Getting ports ----------
QStringList portList = parser->value(portOption).split(QLatin1Char(','));
// QStringList portList = parser->port().split(QLatin1Char(','));
portList.removeAll(QStringLiteral("0"));
QVector<int> portNumbers;
// ---------- Count ports ----------
if (parser->isSet(countOption))
{
int count = parser->value(countOption).toInt();
parser->setPortCount(count);
}
if (portList.count() > 1)
{
portNumbers.reserve(portList.size());
for (const QString &s : qAsConst(portList))
portNumbers << s.toInt();
}
else if (portList.count() == 1 && !portList.first().isEmpty())
{
portNumbers.reserve(parser->portCount());
for (int i = 0; i < parser->portCount(); ++i)
portNumbers << (portList[0].toInt() + i);
}
else
{
// no port given -> use default
}
// ---------- Getting showPort option ----------
if (parser->isSet(showPortOption))
parser->setShowPort(true);
// ---------- Getting window option ----------
if (parser->isSet(windowOption))
parser->setWindow(true);
// ---------- Getting inifile option ----------
if (parser->isSet(inifileOption))
parser->setIni(parser->value(inifileOption));
NGLSettings::instance(parser->ini());
// ---------- Gettings Image Path/Name ----------
if (parser->isSet(graphicOption))
parser->setImagePath(parser->value(graphicOption));
NGL::INGLLogger &logger = application.baseLogger();
STARTUP_LOG(logger);
std::unique_ptr<DisplayPanelSimulatorWidget> displayPanelWidget(new DisplayPanelSimulatorWidget);
if (displayPanelWidget->initialize(mode, portNumbers, !parser->windowMode(), parser->showPort(), parser->imagePath()) != 0)
exit(-1);
ret = application.exec();
SHUTDOWN_LOG(logger);
}
return ret;
}