Migrates residual Lts sources to generated rtiddsgen API

Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
berrux-dev committed 2026-09-23 12:05:37 +02:00
1 parent 5485a90385
commit 881d44f4dd
512 files changed
+6887 -6426

No files matched your search

@@ -260,10 +260,10 @@ void PdfListMessage::process()
data.pdfData.append({obj.value(FILE_ID()).toInt(),
obj.value(NAME()).toString(),
obj.value(FILE_SIZE()).toInt(),
FileManagement::FileCategory::inner_enum(obj.value(FILE_CATEGORY()).toInt()),
FileManagement::FileCategory(obj.value(FILE_CATEGORY()).toInt()),
obj.value(IS_TEMPLATE()).toBool(),
obj.value(PROPERTIES()),
FileManagement::FileStatus::inner_enum(obj.value(FILE_STATUS()).toInt()),
FileManagement::FileStatus(obj.value(FILE_STATUS()).toInt()),
obj.value(FOLDER_ID()).toInt(),
obj.value(PHASE_ID()).toInt(),
obj.value(OPERATOR_ID()).toInt(),
@@ -575,9 +575,9 @@ void HandlerBaseDownload::receiveFlmData()
data.name = query->value(i++).toString();
data.isTemplate = query->value(i++).toBool();
data.folderId = query->value(i++).toLongLong();
data.fileCategoryId = static_cast<FileManagement::FileCategory_def::type>(query->value(i++).toInt());
data.fileTypeId = static_cast<FileManagement::FileType_def::type>(query->value(i++).toInt());
data.fileStatusId = static_cast<FileManagement::FileStatus_def::type>(query->value(i++).toInt());
data.fileCategoryId = static_cast<FileManagement::FileCategory>(query->value(i++).toInt());
data.fileTypeId = static_cast<FileManagement::FileType>(query->value(i++).toInt());
data.fileStatusId = static_cast<FileManagement::FileStatus>(query->value(i++).toInt());
data.exerciseId = query->value(i++);
data.phaseId = query->value(i++);
data.operatorId = query->value(i++).toInt();
@@ -725,15 +725,15 @@ void HandlerBaseDownload::updateBaseDownloadReply()
void HandlerBaseDownload::onStartBaseDownloadRequest(const rti::core::SampleIdentity &cookie, const StartBaseDownloadRequest &request)
{
DEBUG_LOG(m_logger) << "Got Request, check for old one : " << request.hostname();
DEBUG_LOG(m_logger) << "Got Request, check for old one : " << request.hostname;
if (request.timeStamp() < (QDateTime::currentMSecsSinceEpoch() - 10 * 1000)) //(5Sekunden)
if (request.timeStamp < (QDateTime::currentMSecsSinceEpoch() - 10 * 1000)) //(5Sekunden)
{
DEBUG_LOG(m_logger) << "old call? ignore! ";
m_reply.progress(0);
m_reply.errorString(std::string());
m_reply.currentStep(std::string());
m_reply.replyState(Core::FtReplyState::Error);
m_reply.progress = 0;
m_reply.errorString = std::string();
m_reply.currentStep = std::string();
m_reply.replyState = Core::FtReplyState::Error;
m_fts->startBaseDownloadReply(m_baseDownloadCookie, m_reply);
@@ -742,13 +742,13 @@ void HandlerBaseDownload::onStartBaseDownloadRequest(const rti::core::SampleIden
// m_webSocket->setCurrentDownload(WebSocketInterface::CurrentDownload::BASE);
m_baseDownloadCookie = cookie;
m_exerciseId = request.exerciseId();
m_operatorId = request.loggedInOperatorId();
m_exerciseId = request.exerciseId;
m_operatorId = request.loggedInOperatorId;
m_hostname = Settings::remoteDbHostName();
m_reply.progress(0);
m_reply.errorString(std::string());
m_reply.currentStep(std::string());
m_reply.replyState(Core::FtReplyState::InProgress);
m_reply.progress = 0;
m_reply.errorString = std::string();
m_reply.currentStep = std::string();
m_reply.replyState = Core::FtReplyState::InProgress;
m_fts->startBaseDownloadReply(m_baseDownloadCookie, m_reply);
@@ -763,7 +763,7 @@ void HandlerBaseDownload::onLifeUpdateRequest(const rti::core::SampleIdentity &c
// handling PPM ExN data
using namespace ParticipantManagement;
m_exerciseId = request.timeStamp();
m_exerciseId = request.timeStamp;
//m_hostname = QStringLiteral("EXCDBS01");
openRemoteDbConnection(QStringLiteral("lts_ets_pro"));
openDbConnection(currentDatabaseName());
@@ -786,15 +786,15 @@ void HandlerBaseDownload::switchLog(HandlerBaseDownload::State state, const std:
{
NOTICE_LOG(m_logger) << "Switching state from " << m_currentState << " to " << state << " - " << currentStep;
m_currentState = state;
m_reply.currentStep(currentStep);
m_reply.currentStep = currentStep;
if (state != Finished)
{
m_reply.progress(m_reply.progress() + SingleStepSize);
m_reply.progress = m_reply.progress + SingleStepSize;
updateBaseDownloadReply();
}
else
m_reply.progress(100); // updateBaseDownloadReply is called in cleanup which is executed next
m_reply.progress = 100; // updateBaseDownloadReply is called in cleanup which is executed next
m_baseDownloadReplyUpdateTimer->start();
}
@@ -949,7 +949,7 @@ void HandlerBaseDownload::dropOldDatabase()
const int idx = dbNameTmpl.lastIndexOf(QLatin1Char('_'));
Q_ASSERT(idx > 0);
bool bOk;
const int curId = dbNameTmpl.midRef(idx + 1).toInt(&bOk);
const int curId = dbNameTmpl.mid(idx + 1).toInt(&bOk);
if (!openDbConnection(currentDatabaseName()))
{
@@ -967,7 +967,7 @@ void HandlerBaseDownload::dropOldDatabase()
while (q.next())
{
const QString val = q.value(0).toString();
const int revId = val.midRef(idx + 1).toInt(&bOk);
const int revId = val.mid(idx + 1).toInt(&bOk);
if (!bOk)
continue;
DEBUG_LOG(m_logger) << val << ", " << revId << ", " << curId;
@@ -1599,8 +1599,8 @@ void HandlerBaseDownload::cleanup(const Core::FtReplyState &replyState, const st
closeDb(m_remoteDbConnection);
// prepare reply
m_reply.errorString(errStr);
m_reply.replyState(replyState);
m_reply.errorString = errStr;
m_reply.replyState = replyState;
m_baseDownloadReplyUpdateTimer->stop();
@@ -1608,9 +1608,9 @@ void HandlerBaseDownload::cleanup(const Core::FtReplyState &replyState, const st
m_currentState = NotStarted;
m_exerciseId = 0;
m_reply.progress(0);
m_reply.errorString(std::string());
m_reply.currentStep(std::string());
m_reply.progress = 0;
m_reply.errorString = std::string();
m_reply.currentStep = std::string();
m_hostname = NGL::Connections::hostName(NGL::Connections::eConnection::SCM_WEBSOCKET);
}
@@ -1871,7 +1871,7 @@ void HandlerBaseDownload::copyOldFlmData(const QSqlDatabase &dbIn, const QSqlDat
for (auto data : qAsConst(flmData))
{
if (data.folderId == folderId || //snapshots
(data.fileTypeId.underlying() == FileManagement::FileType::Pdf)) //old PDF
(data.fileTypeId == FileManagement::FileType::Pdf)) //old PDF
{
data.id = 0;
flmDataToCopy.push_back(data);
@@ -2161,15 +2161,15 @@ void HandlerBaseDownload::updateLtsConfig()
const QMap<int32_t, ServiceManagement::GroupInformation> groups = m_scmDtc->groupInformations();
for (const auto &group : groups)
{
if (group.type() == Core::ServiceGroupType::Master ||
group.type() == Core::ServiceGroupType::Core)
if (group.type == Core::ServiceGroupType::Master ||
group.type == Core::ServiceGroupType::Core)
continue;
request.type(group.type());
request.domainId(group.domainId());
request.exercisePartitionId(group.exercisePartitionId());
request.replayPartitionId(group.replayPartitionId());
request.requestId(group.id());
m_stopGroupIds += group.id();
request.type = group.type;
request.domainId = group.domainId;
request.exercisePartitionId = group.exercisePartitionId;
request.replayPartitionId = group.replayPartitionId;
request.requestId = group.id;
m_stopGroupIds += group.id;
m_scmFtc->stopGroupRequest(request, this);
}
@@ -2201,19 +2201,19 @@ void HandlerBaseDownload::restartCoreGroup()
const QMap<int32_t, ServiceManagement::GroupInformation> groups = m_scmDtc->groupInformations();
for (const auto &group : groups)
{
if (group.type() != Core::ServiceGroupType::Core)
if (group.type != Core::ServiceGroupType::Core)
continue;
request.type(group.type());
request.domainId(group.domainId());
request.exercisePartitionId(group.exercisePartitionId());
request.replayPartitionId(group.replayPartitionId());
request.requestId(group.id());
request.type = group.type;
request.domainId = group.domainId;
request.exercisePartitionId = group.exercisePartitionId;
request.replayPartitionId = group.replayPartitionId;
request.requestId = group.id;
break; // only one core
}
// we are also restarted... so answer here directly with 'finished'
stateFinished();
if (request.type() != Core::ServiceGroupType::Core)
if (request.type != Core::ServiceGroupType::Core)
WARNING_LOG(m_logger) << "Could not find core group to restart...";
const auto restartCb = [this, request]()
@@ -2246,7 +2246,7 @@ QString HandlerBaseDownload::nextDatabaseName() const
const QString dbName = currentDatabaseName();
int idx = dbName.lastIndexOf(QLatin1Char('_'));
bool bOk;
int id = dbName.midRef(idx + 1).toInt(&bOk) + 1;
int id = dbName.mid(idx + 1).toInt(&bOk) + 1;
return bOk ? QString(dbName.left(idx + 1) + QString::number(id))
: QString(dbName + QLatin1Char('_') + QString::number(id));
}
@@ -72,7 +72,7 @@ void HandlerPdfDownload::handleServicePortsInformation(const QVector<WebSocketIn
{
for (const auto &port : service.ports)
{
if (port.type == Core::CorePortType::WebSocketServer)
if (port.type == static_cast<int>(Core::CorePortType::WebSocketServer))
{
flmPort = port.number;
break;
@@ -100,7 +100,7 @@ void HandlerPdfDownload::handlePdfListData(const WebSocketInterface::Messages::P
PdfListReply rep;
auto &documentInformation = rep.documents();
auto &documentInformation = rep.documents;
documentInformation.reserve(pdfListData.pdfData.size());
for (const WebSocketInterface::Messages::PdfListMessage::PdfInformation &currentInfo : pdfListData.pdfData)
documentInformation.emplace_back(currentInfo.id,
@@ -126,9 +126,9 @@ void HandlerPdfDownload::onGetPdfListRequest(const rti::core::SampleIdentity &co
m_currentPort = NGL::Connections::port(NGL::Connections::eConnection::SCM_WEBSOCKET);
m_pdfListCookie = cookie;
m_hostname = QString::fromStdString(request.hostname());
m_currentPort = request.portNumber();
m_exerciseId = request.exerciseId();
m_hostname = QString::fromStdString(request.hostname);
m_currentPort = request.portNumber;
m_exerciseId = request.exerciseId;
connect(m_webSocket.get(), &WebSocketInterface::WebSocketInterfaceHandler::connected, this, &HandlerPdfDownload::onConnected);
connect(m_webSocket.get(), &WebSocketInterface::WebSocketInterfaceHandler::disconnected, this, &HandlerPdfDownload::onDisconnected);
@@ -147,7 +147,7 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
{
QString str = QStringLiteral("Got PDF download request for ids: ");
for (int32_t id : request.documentIds())
for (int32_t id : request.documentIds)
str.append(QString::number(id) + QStringLiteral(" "));
DEBUG_LOG(m_logger) << str;
@@ -157,7 +157,7 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
{
QString errorStr = QStringLiteral("Not able to start PDF download. Hostname not set.");
ERROR_LOG(m_logger) << errorStr;
m_downloadReply.errorString(errorStr.toStdString());
m_downloadReply.errorString = errorStr.toStdString();
m_fts->startPdfDownloadReply(m_downloadCookie, m_downloadReply);
return;
}
@@ -174,7 +174,7 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
QVector<pdfInfo> pdfInfoVec;
for (const auto &current : qAsConst(m_pdfData))
{
if (!containsId(request.documentIds(), current.id))
if (!containsId(request.documentIds, current.id))
continue;
pdfInfoVec.append(current);
@@ -208,28 +208,28 @@ void HandlerPdfDownload::onOcPdfDownloadRequest(const rti::core::SampleIdentity
{
QString errorStr = QStringLiteral("Not able to open remote connection to DB");
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_ocPdfDownloadReply.errorString = errorStr.toStdString();
m_fts->ocPdfDownloadReply(m_ocPdfDownloadCookie, m_ocPdfDownloadReply);
return;
}
DEBUG_LOG(m_logger) << "Got PDF download request for ids: "<< request.folderId();
DEBUG_LOG(m_logger) << "Got PDF download request for ids: "<< request.folderId;
m_folderId = request.folderId();
m_folderId = request.folderId;
if(m_folderId == -1)
{
QString errorStr = QStringLiteral("Not able to start PDF download. Folder id not valid.");
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_ocPdfDownloadReply.errorString = errorStr.toStdString();
m_fts->ocPdfDownloadReply(m_ocPdfDownloadCookie, m_ocPdfDownloadReply);
return;
}
m_operatorName = QString::fromStdString(request.matrixOperator());
m_operatorName = QString::fromStdString(request.matrixOperator);
if (m_hostname.isEmpty())
{
QString errorStr = QStringLiteral("Not able to start PDF download. Hostname not set.");
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_ocPdfDownloadReply.errorString = errorStr.toStdString();
m_fts->ocPdfDownloadReply(m_ocPdfDownloadCookie, m_ocPdfDownloadReply);
return;
}
@@ -249,7 +249,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
if (!remoteDb->init(0, m_remoteDbConnection))
{
const QString err = tr("Can't open remote Database");
m_ocPdfDownloadReply.errorString(err.toStdString());
m_ocPdfDownloadReply.errorString = err.toStdString();
return;
}
@@ -283,14 +283,14 @@ void HandlerPdfDownload::exportOcPdfFileContent()
if(folderId < 0)
{
const QString err = tr("Can't find user folder in remote Database");
m_ocPdfDownloadReply.errorString(err.toStdString());
m_ocPdfDownloadReply.errorString = err.toStdString();
return;
}
/// check first if the pdf file is not alreay exist and oudated without loading file content
/// get ids of pdf file matching the named condition
QString where = QStringLiteral(" WHERE folder_id =%1 ").arg(QString::number(folderId)) +
QStringLiteral(" AND file_type_id=%1 ").arg(FileManagement::FileType_def::Pdf);
QStringLiteral(" AND file_type_id=%1 ").arg(static_cast<int>(FileManagement::FileType::Pdf));
QString tableName(QStringLiteral("flm.flm_file_content"));
@@ -330,7 +330,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
/// or file doesn't exist
/// folderId is used in the first statement so no need to reuse it for second one. just use id offlm_file_content
where = QStringLiteral(" WHERE id IN (%1)").arg(idsList.join(QStringLiteral(","))) +
QStringLiteral(" AND file_type_id=%1 ").arg(FileManagement::FileType_def::Pdf);
QStringLiteral(" AND file_type_id=%1 ").arg(static_cast<int>(FileManagement::FileType::Pdf));
tableName = (QStringLiteral("flm.flm_file_content"));
stmt = (QStringLiteral("SELECT id, name, file_status_id, content, last_modified FROM ") + tableName + where);
@@ -347,7 +347,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
int i = 0;
data.id = query->value(i++).toLongLong();
data.name = query->value(i++).toString();
data.fileStatusId = static_cast<FileManagement::FileStatus_def::type>(query->value(i++).toInt());
data.fileStatusId = static_cast<FileManagement::FileStatus>(query->value(i++).toInt());
data.content = query->value(i++).toByteArray();
data.lastModified = query->value(i++).toLongLong();
@@ -363,7 +363,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
{
const QString errorStr = tr("Not able to export PDF.");
ERROR_LOG(m_logger) << errorStr;
m_ocPdfDownloadReply.errorString(errorStr.toStdString());
m_ocPdfDownloadReply.errorString = errorStr.toStdString();
return;
}
@@ -384,7 +384,7 @@ void HandlerPdfDownload::exportOcPdfFileContent()
if(!file.open(QIODevice::WriteOnly))
{
QString err = tr("Failed to write file: ") + (data.name);
m_ocPdfDownloadReply.errorString(err.toStdString());
m_ocPdfDownloadReply.errorString = err.toStdString();
return;
}
@@ -464,18 +464,18 @@ void HandlerPdfDownload::onDisconnected()
void HandlerPdfDownload::onNewDownloadState(int progress, const QString &msg)
{
DEBUG_LOG(m_logger) << msg;
m_downloadReply.replyState(Core::FtReplyState::InProgress);
m_downloadReply.progress(progress);
m_downloadReply.currentStep(msg.toStdString());
m_downloadReply.replyState = Core::FtReplyState::InProgress;
m_downloadReply.progress = progress;
m_downloadReply.currentStep = msg.toStdString();
m_fts->startPdfDownloadReply(m_downloadCookie, m_downloadReply);
}
void HandlerPdfDownload::onAllDownloadsFinished()
{
DEBUG_LOG(m_logger) << "Downloads finished";
m_downloadReply.replyState(Core::FtReplyState::Completed);
m_downloadReply.currentStep(tr("Downloads finished").toStdString());
m_downloadReply.progress(100);
m_downloadReply.replyState = Core::FtReplyState::Completed;
m_downloadReply.currentStep = tr("Downloads finished").toStdString();
m_downloadReply.progress = 100;
m_fts->startPdfDownloadReply(m_downloadCookie, m_downloadReply);
}