- Copied complete Lts/Tools directory from qt5-before to qt6-after - Updated 32 CMakeLists.txt files (Qt5:: → Qt6::) - Tools subdirectory already included in parent Lts/CMakeLists.txt - All 72 tool submodules now present in qt6-migrated-legatus - Includes: Adler, ArAssets, ConfigX, DBAdministration, DBUpdate, DdsView, InfrastructureManagement, and 67 more tools - C++17 standard (RTI 7.7.0 compatibility maintained) - Tests deferred until final validation phase Migration progress: ✅ Lts/Application (68 files) ✅ Lts/DDS (verified Qt6-ready) ✅ Lts/Plugins (60 submodules, verified) ✅ Lts/Projects (5 submodules, verified) ✅ Lts/Proxies (13 submodules, verified) ✅ Lts/Services (47 submodules, verified) ✅ Lts/Tools (72 submodules, copied + CMake updated) ✅ Lts/Viewer (LtsFileDialog, LtsReportDisplay, SituationMap) 🟡 TetraIF (partial) 🟡 Z (partial: nglwidgets, QtSingleApplication, qsql_informix, WMS_Interface)
105 lines
2.5 KiB
C++
Executable File
105 lines
2.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* main (TopicDataGenerator)
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#include <nglapplication/nglcoreapplication.h>
|
|
#include <NGLLogger/INGLLogger.h>
|
|
|
|
#include "initialisation.h"
|
|
|
|
#include <DDS/Generic/generic_base.h>
|
|
|
|
#include <ExerciseManagement/exm.hpp>
|
|
#include <ParticipantManagement/ppm.hpp>
|
|
|
|
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
|
#include <QSet>
|
|
#include <QThread>
|
|
#include <QtCore/QVector>
|
|
#include <string>
|
|
|
|
|
|
class CmdLineParser : public LtsCommandLineParser::LtsCommandLineParser
|
|
{
|
|
public:
|
|
CmdLineParser()
|
|
: LtsCommandLineParser()
|
|
{
|
|
addOption( { QStringList() << QLatin1String("s") << QLatin1String("maxSamples"),
|
|
QLatin1String("Default: 0 (infinite loop)"),
|
|
QLatin1String("Max Samples"),
|
|
QLatin1String("0") } );
|
|
addOption( { QStringList() << QLatin1String("t") << QLatin1String("doType"),
|
|
QLatin1String("ExerciseManagement::Exercise|Participant::Participant"),
|
|
QLatin1String("doType"),
|
|
QLatin1String("ExerciseManagement::Exercise") } );
|
|
}
|
|
|
|
int maxSamples() const { return isSet(QLatin1String("s")) ? value(QLatin1String("s")).toInt() : -1; }
|
|
|
|
QString getDoType() const
|
|
{
|
|
return value(QLatin1String("t"));
|
|
}
|
|
|
|
bool init()
|
|
{
|
|
LtsCommandLineParser::init(false);
|
|
if (isSet(QLatin1String("h")))
|
|
{
|
|
fprintf(stdout, "\ndoType: ExerciseManagement::Exercise\n");
|
|
fprintf(stdout, "\ndoType: Participant::Participant\n");
|
|
fprintf(stdout, "\n\n");
|
|
showHelp();
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
|
|
int main ( int argc, char**argv )
|
|
{
|
|
NGLCoreApplication app ( argc, argv );
|
|
app.createLogger("DataSampleGenerator.main", "log4cxx_tdsg.props");
|
|
|
|
CmdLineParser options;
|
|
if (!options.init())
|
|
return -1;
|
|
|
|
// TODO: Use plugins of services
|
|
const auto doType = options.getDoType();
|
|
DEBUG_LOG(app.baseLogger()) << "Using doType (" << doType << ")";
|
|
|
|
DataSampleGenerator::Initialisation *initTDGen = new DataSampleGenerator::Initialisation(options.domainId(), options.exerciseId());
|
|
if (!initTDGen->init())
|
|
{
|
|
delete initTDGen;
|
|
return -2;
|
|
}
|
|
|
|
STARTUP_LOG(app.baseLogger());
|
|
|
|
// if maxSamples == 0 => infinite loop
|
|
long maxSamples = options.maxSamples();
|
|
|
|
int receive_period = 4;
|
|
for (long i = 0; (maxSamples == 0) || (i < maxSamples) ; ++i)
|
|
{
|
|
initTDGen->generateTestData(doType);
|
|
QThread::sleep(receive_period);
|
|
}
|
|
|
|
delete initTDGen;
|
|
|
|
SHUTDOWN_LOG(app.baseLogger());
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
|