Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+27
-27
@@ -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 ¤tInfo : 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 ¤t : 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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user