Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen

- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -34,7 +34,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate flm_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS svcFlmCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY2(AAR SV WS svcFlmCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcFlmCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -65,7 +65,7 @@ SET(SRCS_client
# generate flm_ftc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY(WS AAR SV svcFlmClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY2(WS AAR SV svcFlmClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcFlmClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -95,7 +95,7 @@ SET(SRCS_server
# generate flm_[d|f]ts.h, flm_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY(WS AAR SV svcFlmServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY2(WS AAR SV svcFlmServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcFlmServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -53,7 +53,6 @@ FlmTests::FlmTests(QObject *parent)
, m_fileContentId(-1)
, m_operatorId(99)
, m_bTestsSuccessful(true)
, m_logger(getLogger("Test"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
@@ -66,7 +65,7 @@ FlmTests::~FlmTests()
// ------------------------------------------------------------------------------
bool FlmTests::init(int domainId, int testId, int folderId, int fileContentId, int operatorId)
{
INFO_LOG(m_logger) << "init begin";
INFO_LOG() << "init begin";
m_testId = testId;
m_folderId = folderId;
@@ -80,33 +79,33 @@ bool FlmTests::init(int domainId, int testId, int folderId, int fileContentId, i
return false;
m_ddsConnector->initPublisherSubscriber();
TRACE_LOG(m_logger) << "create dtc";
TRACE_LOG() << "create dtc";
m_dtc = FileManagement::Interface::Dtc::create(m_ddsConnector);
TRACE_LOG(m_logger) << "init dtc";
TRACE_LOG() << "init dtc";
bool bRet = m_dtc->enableAll();
TRACE_LOG(m_logger) << "init dtc end - bRet = " << bRet;
TRACE_LOG() << "init dtc end - bRet = " << bRet;
TRACE_LOG(m_logger) << "create ftc";
TRACE_LOG() << "create ftc";
m_ftc = FileManagement::Interface::Ftc::create(m_ddsConnector);
TRACE_LOG(m_logger) << "init ftc";
TRACE_LOG() << "init ftc";
bRet &= m_ftc->enableAll();
TRACE_LOG(m_logger) << "init ftc end - bRet = " << bRet;
TRACE_LOG() << "init ftc end - bRet = " << bRet;
// initialize database
m_dbHandler = std::make_shared<DbHandler>();
if(!m_dbHandler->init(0, Settings::settings()))
{
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
ERROR_LOG() << "Initialisation dbHandler failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
DEBUG_LOG() << "Initialisation dbHandler succesful.";
m_db = m_dbHandler->db();
DEBUG_LOG(m_logger) << "########### Domain Id = " << domainId;
DEBUG_LOG(m_logger) << "########### Test Id = " << testId;
DEBUG_LOG(m_logger) << "########### Folder Id = " << folderId;
DEBUG_LOG(m_logger) << "########### File Content Id = " << fileContentId;
DEBUG_LOG(m_logger) << "########### Operator Id = " << operatorId;
DEBUG_LOG() << "########### Domain Id = " << domainId;
DEBUG_LOG() << "########### Test Id = " << testId;
DEBUG_LOG() << "########### Folder Id = " << folderId;
DEBUG_LOG() << "########### File Content Id = " << fileContentId;
DEBUG_LOG() << "########### Operator Id = " << operatorId;
return bRet;
}
@@ -114,7 +113,7 @@ bool FlmTests::init(int domainId, int testId, int folderId, int fileContentId, i
// ------------------------------------------------------------------------------
void FlmTests::startTest()
{
INFO_LOG(m_logger) << "********* startTest **************";
INFO_LOG() << "********* startTest **************";
switch (m_testId)
{
// folder
@@ -169,11 +168,11 @@ void FlmTests::startTest()
tryCreateSymbol();
break;
default:
ERROR_LOG(m_logger) << "Unknown test case !";
ERROR_LOG() << "Unknown test case !";
failExit();
break;
}
INFO_LOG(m_logger) << "********* endTest **************";
INFO_LOG() << "********* endTest **************";
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -182,13 +181,13 @@ void FlmTests::startTest()
// ------------------------------------------------------------------------------
void FlmTests::tryCreateFolder()
{
INFO_LOG(m_logger) << "trying to send FolderCreateRequest";
INFO_LOG() << "trying to send FolderCreateRequest";
int parentFolderId = m_folderId;
if (parentFolderId == 0)
parentFolderId = 1;
DEBUG_LOG(m_logger) << "Creating Folder under folder id = " << parentFolderId;
DEBUG_LOG() << "Creating Folder under folder id = " << parentFolderId;
// Creating hidden folder
m_folderId = createFolder(parentFolderId, QStringLiteral("Test Folder"), true);
@@ -198,7 +197,7 @@ void FlmTests::tryCreateFolder()
parentFolderId = m_folderId;
m_folderId = 0;
DEBUG_LOG(m_logger) << "Creating Subfolder for folder id = " << parentFolderId;
DEBUG_LOG() << "Creating Subfolder for folder id = " << parentFolderId;
m_folderId = createFolder(parentFolderId, QStringLiteral("Test Sub Folder"));
@@ -210,19 +209,19 @@ void FlmTests::tryCreateFolder()
// ------------------------------------------------------------------------------
void FlmTests::tryModifyFolder()
{
INFO_LOG(m_logger) << "trying to send folder modify request ";
INFO_LOG() << "trying to send folder modify request ";
DEBUG_LOG(m_logger) << "m_folderId = " << m_folderId;
DEBUG_LOG() << "m_folderId = " << m_folderId;
m_dtc->waitForHistoricalDataFolder();
const FileManagement::Folder &fld = m_dtc->folder(m_folderId);
FileManagement::FolderModifyRequest data;
DEBUG_LOG(m_logger) << "fld.id() = " << fld.id();
DEBUG_LOG() << "fld.id() = " << fld.id();
if (fld.id() == 0)
{
ERROR_LOG(m_logger) << "Cannot find Folder Id = " << m_folderId;
ERROR_LOG() << "Cannot find Folder Id = " << m_folderId;
failExit();
}
else
@@ -241,7 +240,7 @@ void FlmTests::tryModifyFolder()
if (!m_ftc->folderModifyRequest(FolderModifyRequest(data), this))
{
ERROR_LOG(m_logger) << "Error requesting modify data";
ERROR_LOG() << "Error requesting modify data";
failExit();
}
QTRY_VERIFY(m_folderId > 0);
@@ -253,11 +252,11 @@ void FlmTests::tryModifyFolder()
// ------------------------------------------------------------------------------
void FlmTests::tryRemoveFolder()
{
INFO_LOG(m_logger) << "trying to send FolderRemoveRequest ";
INFO_LOG() << "trying to send FolderRemoveRequest ";
m_dtc->waitForHistoricalDataFolder();
if (!m_ftc->folderRemoveRequest(FolderRemoveRequest(m_folderId), this))
{
ERROR_LOG(m_logger) << "Error requesting delete data";
ERROR_LOG() << "Error requesting delete data";
failExit();
}
QTest::qWait(1000);
@@ -279,7 +278,7 @@ int FlmTests::createFolder(int parentFolderId, const QString &folderName, bool i
if (!m_ftc->folderModifyRequest(req, this))
{
ERROR_LOG(m_logger) << "Error creating folder with parent = " << parentFolderId << " and name = " << folderName ;
ERROR_LOG() << "Error creating folder with parent = " << parentFolderId << " and name = " << folderName ;
failExit();
}
@@ -291,7 +290,7 @@ int FlmTests::createFolder(int parentFolderId, const QString &folderName, bool i
// ------------------------------------------------------------------------------
void FlmTests::tryCreateFileContent()
{
INFO_LOG(m_logger) << "trying to send file content create request ";
INFO_LOG() << "trying to send file content create request ";
m_dtc->waitForHistoricalDataFileContent();
FileContentModifyRequest data;
@@ -314,7 +313,7 @@ void FlmTests::tryCreateFileContent()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -334,7 +333,7 @@ void FlmTests::tryCreateFileContent()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -353,11 +352,11 @@ void FlmTests::tryCreateFileContent()
file.setFileName(QCoreApplication::applicationDirPath()+fileName);
if (!file.open(QFile::ReadOnly))
{
ERROR_LOG(m_logger) << "Error opening file " << fileName;
ERROR_LOG() << "Error opening file " << fileName;
failExit();
}
QByteArray rawImage = file.readAll();
DEBUG_LOG(m_logger) << "Read file " << fileName;
DEBUG_LOG() << "Read file " << fileName;
file.close();
data.content(LtsUtils::convert<std::vector<uint8_t>>(rawImage));
@@ -365,7 +364,7 @@ void FlmTests::tryCreateFileContent()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -383,11 +382,11 @@ void FlmTests::tryCreateFileContent()
file.setFileName(QCoreApplication::applicationDirPath()+fileName);
if (!file.open(QFile::ReadOnly))
{
ERROR_LOG(m_logger) << "Error opening file " << fileName;
ERROR_LOG() << "Error opening file " << fileName;
failExit();
}
rawImage = file.readAll();
DEBUG_LOG(m_logger) << "Read file " << fileName;
DEBUG_LOG() << "Read file " << fileName;
file.close();
data.content(LtsUtils::convert<std::vector<uint8_t>>(rawImage));
@@ -395,7 +394,7 @@ void FlmTests::tryCreateFileContent()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -404,30 +403,30 @@ void FlmTests::tryCreateFileContent()
// ------------------------------------------------------------------------------
void FlmTests::tryModifyFileContent()
{
INFO_LOG(m_logger) << "trying to send file content modify request ";
INFO_LOG() << "trying to send file content modify request ";
DEBUG_LOG(m_logger) << "m_fileContentId = " << m_fileContentId;
DEBUG_LOG() << "m_fileContentId = " << m_fileContentId;
m_dtc->waitForHistoricalDataFileContent();
const FileManagement::FileContent &flc = m_dtc->fileContent(m_fileContentId);
FileManagement::FileContentModifyRequest data;
DEBUG_LOG(m_logger) << "flc.id() = " << flc.id();
DEBUG_LOG() << "flc.id() = " << flc.id();
if (flc.id() == 0)
{
ERROR_LOG(m_logger) << "Cannot find File Content Id = " << m_fileContentId;
ERROR_LOG() << "Cannot find File Content Id = " << m_fileContentId;
failExit();
}
else
{
if (!checkContentSize(m_fileContentId))
{
ERROR_LOG(m_logger) << "Content size 0";
ERROR_LOG() << "Content size 0";
failExit();
}
DEBUG_LOG(m_logger) << "Content size = " << m_content.size();
DEBUG_LOG() << "Content size = " << m_content.size();
data.id(flc.id());
data.name(flc.name());
@@ -455,7 +454,7 @@ void FlmTests::tryModifyFileContent()
if (!m_ftc->fileContentModifyRequest(FileContentModifyRequest(data), this))
{
ERROR_LOG(m_logger) << "Error requesting modify data";
ERROR_LOG() << "Error requesting modify data";
failExit();
}
@@ -472,7 +471,7 @@ bool FlmTests::checkContentSize(int fileId)
m_content.clear();
if (!m_ftc->getFileContentDataRequest(request, this))
{
ERROR_LOG(m_logger) << "Cannot retrieve file content for id = " << fileId;
ERROR_LOG() << "Cannot retrieve file content for id = " << fileId;
return false;
}
@@ -484,25 +483,25 @@ bool FlmTests::checkContentSize(int fileId)
// ------------------------------------------------------------------------------
void FlmTests::tryUpdateStatus()
{
INFO_LOG(m_logger) << "trying update status file content";
INFO_LOG() << "trying update status file content";
DEBUG_LOG(m_logger) << "m_fileContentId = " << m_fileContentId;
DEBUG_LOG() << "m_fileContentId = " << m_fileContentId;
m_dtc->waitForHistoricalDataFileContent();
const FileManagement::FileContent &flc = m_dtc->fileContent(m_fileContentId);
DEBUG_LOG(m_logger) << "flc.id() = " << flc.id();
DEBUG_LOG() << "flc.id() = " << flc.id();
if (flc.id() == 0)
{
ERROR_LOG(m_logger) << "Cannot find File Content Id = " << m_fileContentId;
ERROR_LOG() << "Cannot find File Content Id = " << m_fileContentId;
failExit();
}
else
{
if (!m_db->updateStatus(m_fileContentId, FileManagement::FileStatus::Deleted, m_operatorId))
{
ERROR_LOG(m_logger) << "Cannot update status for File Content Id = " << m_fileContentId;
ERROR_LOG() << "Cannot update status for File Content Id = " << m_fileContentId;
failExit();
}
@@ -510,7 +509,7 @@ void FlmTests::tryUpdateStatus()
if (!checkContentSize(m_fileContentId))
{
ERROR_LOG(m_logger) << "Content size 0";
ERROR_LOG() << "Content size 0";
failExit();
}
@@ -521,11 +520,11 @@ void FlmTests::tryUpdateStatus()
// ------------------------------------------------------------------------------
void FlmTests::tryRemoveFileContent()
{
INFO_LOG(m_logger) << "trying to send FileContentRemoveRequest ";
INFO_LOG() << "trying to send FileContentRemoveRequest ";
m_dtc->waitForHistoricalDataFileContent();
if (!m_ftc->fileContentRemoveRequest(FileContentRemoveRequest(m_fileContentId), this))
{
ERROR_LOG(m_logger) << "Error requesting delete data";
ERROR_LOG() << "Error requesting delete data";
failExit();
}
QTest::qWait(1000);
@@ -534,11 +533,11 @@ void FlmTests::tryRemoveFileContent()
// ------------------------------------------------------------------------------
void FlmTests::tryExportFileContent()
{
INFO_LOG(m_logger) << "trying to send FileContentExportRequest ";
INFO_LOG() << "trying to send FileContentExportRequest ";
m_dtc->waitForHistoricalDataFileContent();
if (!m_ftc->fileContentExportRequest(FileContentExportRequest(m_fileContentId), this))
{
ERROR_LOG(m_logger) << "Error requesting export data";
ERROR_LOG() << "Error requesting export data";
failExit();
}
@@ -546,7 +545,7 @@ void FlmTests::tryExportFileContent()
if (!checkContentSize(m_fileContentId))
{
ERROR_LOG(m_logger) << "Content size 0";
ERROR_LOG() << "Content size 0";
failExit();
}
@@ -556,7 +555,7 @@ void FlmTests::tryExportFileContent()
// ------------------------------------------------------------------------------
void FlmTests::tryCreatePlan()
{
INFO_LOG(m_logger) << "trying to send file content create request ";
INFO_LOG() << "trying to send file content create request ";
FileContentModifyRequest data;
@@ -576,7 +575,7 @@ void FlmTests::tryCreatePlan()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -585,7 +584,7 @@ void FlmTests::tryCreatePlan()
// ------------------------------------------------------------------------------
void FlmTests::tryCreateFav()
{
INFO_LOG(m_logger) << "trying to send file content create request ";
INFO_LOG() << "trying to send file content create request ";
FileContentModifyRequest data;
@@ -605,7 +604,7 @@ void FlmTests::tryCreateFav()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -614,7 +613,7 @@ void FlmTests::tryCreateFav()
// ------------------------------------------------------------------------------
void FlmTests::tryCreateSymbol()
{
INFO_LOG(m_logger) << "trying to send file content create request ";
INFO_LOG() << "trying to send file content create request ";
FileContentModifyRequest data;
@@ -634,7 +633,7 @@ void FlmTests::tryCreateSymbol()
m_fileContentId = 0;
if (!m_ftc->fileContentModifyRequest(data, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTRY_VERIFY(m_fileContentId > 0);
@@ -646,15 +645,15 @@ void FlmTests::tryGetContent()
GetFileContentDataRequest request;
request.fileContentId(m_fileContentId);
INFO_LOG(m_logger) << "trying to send content request for file Id = " << m_fileContentId;
INFO_LOG() << "trying to send content request for file Id = " << m_fileContentId;
if (!m_ftc->getFileContentDataRequest(request, this))
{
ERROR_LOG(m_logger) << "Error requesting content for id : " << m_fileContentId;
ERROR_LOG() << "Error requesting content for id : " << m_fileContentId;
failExit();
}
QTRY_VERIFY(m_content.size() > 0);
DEBUG_LOG(m_logger) << "Got content size: " << m_content.size();
DEBUG_LOG() << "Got content size: " << m_content.size();
}
// ------------------------------------------------------------------------------
@@ -662,16 +661,16 @@ void FlmTests::onGetFileContentDataReply(const GetFileContentDataReply &replyObj
{
if (replyObject.errorString().size() > 0)
{
ERROR_LOG(m_logger) << "Got onGetFileContentDataReply error: " << replyObject.errorString();
ERROR_LOG() << "Got onGetFileContentDataReply error: " << replyObject.errorString();
failExit();
}
INFO_LOG(m_logger) << "Got reply with id " << replyObject.id()
INFO_LOG() << "Got reply with id " << replyObject.id()
<< " and errorString " << replyObject.errorString();
m_content = replyObject.content();
DEBUG_LOG(m_logger) << "Content size: " << m_content.size();
DEBUG_LOG() << "Content size: " << m_content.size();
// QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -680,19 +679,19 @@ void FlmTests::onGetFileContentDataReply(const GetFileContentDataReply &replyObj
// ------------------------------------------------------------------------------
void FlmTests::tryGetAllTemplates()
{
INFO_LOG(m_logger) << "tryGetAllTemplates";
INFO_LOG() << "tryGetAllTemplates";
QList<FileContent> allTemplates;
m_dtc->waitForHistoricalDataFileContent();
if (!m_dtc->getAllTemplates(allTemplates))
{
ERROR_LOG(m_logger) << "Error requesting dtc data";
ERROR_LOG() << "Error requesting dtc data";
failExit();
}
DEBUG_LOG(m_logger) << "Found " << allTemplates.size() << " templates";
DEBUG_LOG() << "Found " << allTemplates.size() << " templates";
for (const FileContent &fc : std::as_const(allTemplates))
DEBUG_LOG(m_logger) << "Found template (id, name) = (" << fc.id() << ", " << fc.name() << ")";
DEBUG_LOG() << "Found template (id, name) = (" << fc.id() << ", " << fc.name() << ")";
QTest::qWait(1000);
}
@@ -700,19 +699,19 @@ void FlmTests::tryGetAllTemplates()
// ------------------------------------------------------------------------------
void FlmTests::tryGetAllPlans()
{
INFO_LOG(m_logger) << "tryGetAllPlans";
INFO_LOG() << "tryGetAllPlans";
QStringList allPlans;
m_dtc->waitForHistoricalDataFileContent();
if (!m_dtc->getAllFiles(FileManagement::FileType::TacticalPlan, m_folderId, allPlans))
{
ERROR_LOG(m_logger) << "Error requesting dtc data";
ERROR_LOG() << "Error requesting dtc data";
failExit();
}
DEBUG_LOG(m_logger) << "Found " << allPlans.size() << " plans";
DEBUG_LOG() << "Found " << allPlans.size() << " plans";
for (const QString &plan : std::as_const(allPlans))
DEBUG_LOG(m_logger) << "Found plan = " << plan;
DEBUG_LOG() << "Found plan = " << plan;
QTest::qWait(1000);
}
@@ -720,19 +719,19 @@ void FlmTests::tryGetAllPlans()
// ------------------------------------------------------------------------------
void FlmTests::tryGetAllFavs()
{
INFO_LOG(m_logger) << "tryGetAllFavs";
INFO_LOG() << "tryGetAllFavs";
QStringList allFavs;
m_dtc->waitForHistoricalDataFileContent();
if (!m_dtc->getAllFiles(FileManagement::FileType::OperatorFavourite, m_folderId, allFavs))
{
ERROR_LOG(m_logger) << "Error requesting dtc data";
ERROR_LOG() << "Error requesting dtc data";
failExit();
}
DEBUG_LOG(m_logger) << "Found " << allFavs.size() << " favs";
DEBUG_LOG() << "Found " << allFavs.size() << " favs";
for (const QString &fav : std::as_const(allFavs))
DEBUG_LOG(m_logger) << "Found fav = " << fav;
DEBUG_LOG() << "Found fav = " << fav;
QTest::qWait(1000);
}
@@ -740,19 +739,19 @@ void FlmTests::tryGetAllFavs()
// ------------------------------------------------------------------------------
void FlmTests::tryGetAllSymbols()
{
INFO_LOG(m_logger) << "tryGetAllSymbols";
INFO_LOG() << "tryGetAllSymbols";
QStringList allSymbols;
m_dtc->waitForHistoricalDataFileContent();
if (!m_dtc->getAllFiles(FileManagement::FileType::OperatorDefinedSymbol, m_folderId, allSymbols))
{
ERROR_LOG(m_logger) << "Error requesting dtc data";
ERROR_LOG() << "Error requesting dtc data";
failExit();
}
DEBUG_LOG(m_logger) << "Found " << allSymbols.size() << " symbols";
DEBUG_LOG() << "Found " << allSymbols.size() << " symbols";
for (const QString &symbol : std::as_const(allSymbols))
DEBUG_LOG(m_logger) << "Found symbol = " << symbol;
DEBUG_LOG() << "Found symbol = " << symbol;
QTest::qWait(1000);
}
@@ -761,7 +760,7 @@ void FlmTests::tryGetAllSymbols()
// ------------------------------------------------------------------------------
void FlmTests::onError(const QString &reason)
{
ERROR_LOG(m_logger) << "Got Reply error: " << reason;
ERROR_LOG() << "Got Reply error: " << reason;
failExit();
}
@@ -773,7 +772,7 @@ void FlmTests::onReply(const Core::FunctionReplyObject &replyObject)
onError(replyObject.translated());
return;
}
INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id()
INFO_LOG() << "Got Reply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
// QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -781,7 +780,7 @@ void FlmTests::onReply(const Core::FunctionReplyObject &replyObject)
// ------------------------------------------------------------------------------
void FlmTests::failExit()
{
ERROR_LOG(m_logger) << "FAIL EXIT !";
ERROR_LOG() << "FAIL EXIT !";
m_bTestsSuccessful = false;
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -791,11 +790,11 @@ void FlmTests::onFolderModifyReply(const Core::FunctionReplyObject &replyObject)
{
if (replyObject.error())
{
ERROR_LOG(m_logger) << "Got onFolderModifyReply error: " << replyObject();
ERROR_LOG() << "Got onFolderModifyReply error: " << replyObject();
failExit();
return;
}
INFO_LOG(m_logger) << "Got modifyFolderReply with id " << replyObject.id()
INFO_LOG() << "Got modifyFolderReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
m_folderId = replyObject.id();
}
@@ -805,11 +804,11 @@ void FlmTests::onFileContentModifyReply(const Core::FunctionReplyObject &replyOb
{
if (replyObject.error())
{
ERROR_LOG(m_logger) << "Got onFileContentModifyReply error: " << replyObject();
ERROR_LOG() << "Got onFileContentModifyReply error: " << replyObject();
failExit();
return;
}
INFO_LOG(m_logger) << "Got modifyFileReply with id " << replyObject.id()
INFO_LOG() << "Got modifyFileReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
m_fileContentId = replyObject.id();
}
@@ -49,7 +49,6 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS
ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: LtsWebSocket::AbstractClientMessage(client, type, typeId, uuid, data)
, m_dataManager(dataManager)
, m_logger(getLogger("ClientMessage"))
{}
// ####### ClientMessage end #######
@@ -24,7 +24,6 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
, m_messageFactory(nullptr)
, m_dataManager(nullptr)
, m_mainHandler(mainHandler)
, m_logger(getLogger("WebSocketInterfaceHandler"))
{
}
@@ -37,7 +36,7 @@ bool WebSocketInterfaceHandler::init()
{
cleanup();
DEBUG_LOG(m_logger) << "... ok";
DEBUG_LOG() << "... ok";
m_dataManager = new DataManager(m_mainHandler);
@@ -45,16 +44,16 @@ bool WebSocketInterfaceHandler::init()
m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this);
DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer";
DEBUG_LOG() << "Initialising LtsWebSocketServer";
if (!m_webSocketServer->init(QStringLiteral("FLM"), Settings::getWebSocketServerPortRange(1)))
{
ERROR_LOG(m_logger) << "Failed to initialise LtsWebSocketServer";
ERROR_LOG() << "Failed to initialise LtsWebSocketServer";
return false;
}
DEBUG_LOG(m_logger) << "... ok";
DEBUG_LOG() << "... ok";
DEBUG_LOG(m_logger) << "Connection signals and slots";
DEBUG_LOG(m_logger) << "... ok";
DEBUG_LOG() << "Connection signals and slots";
DEBUG_LOG() << "... ok";
return true;
}
@@ -32,6 +32,5 @@ protected:
protected:
MainHandler *m_mainHandler;
LOGGER_T m_logger;
};
}
@@ -16,16 +16,15 @@ namespace FileManagement
DdsHandler::DdsHandler(int domainId)
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
}
bool DdsHandler::init(const QStringList &qosFileList)
{
if (!m_ddsConnector->init(qosFileList))
{
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
ERROR_LOG() << "Error initializing dds connections - aborting";
return false;
}
@@ -41,13 +40,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
m_ddsFts = FileManagement::Interface::Fts::create(m_ddsConnector);
bool bRet = m_ddsDts->enableAll();
INFO_LOG(m_logger) << "Dts initialised";
INFO_LOG() << "Dts initialised";
bRet &= m_ddsDtc->enableAll();
INFO_LOG(m_logger) << "Dtc initialised";
INFO_LOG() << "Dtc initialised";
bRet &= m_ddsFts->enableAll();
INFO_LOG(m_logger) << "Fts initialised";
INFO_LOG() << "Fts initialised";
return bRet;
}
@@ -46,8 +46,6 @@ private:
std::shared_ptr<FileManagement::Interface::Dts> m_ddsDts;
std::shared_ptr<FileManagement::Interface::Dtc> m_ddsDtc;
std::shared_ptr<FileManagement::Interface::Fts> m_ddsFts;
NGL::INGLLogger &m_logger;
};
}
@@ -10,7 +10,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "flm_export.h"
#include "svcflmcommon_export.h"
namespace FileManagement
{
@@ -29,7 +29,6 @@ MainHandler::MainHandler(QObject *parent)
, m_handlerFolder(nullptr)
, m_handlerFileContent(nullptr)
, m_handlerWebSocket(nullptr)
, m_logger(getLogger("MainHandler"))
{}
MainHandler::~MainHandler()
@@ -49,29 +48,29 @@ bool MainHandler::init(int domainId)
m_dbHandler = std::make_shared<DbHandler>();
if (!m_dbHandler->init(0, Settings::settings()))
{
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
ERROR_LOG() << "Initialisation dbHandler failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
DEBUG_LOG() << "Initialisation dbHandler succesful.";
// initialize DDS
m_ddsHandler.reset(new DdsHandler(domainId));
if (!m_ddsHandler->init())
{
ERROR_LOG(m_logger) << "Initialisation ddsHandler failed.";
ERROR_LOG() << "Initialisation ddsHandler failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful.";
DEBUG_LOG() << "Initialisation ddsHandler succesful.";
// read project specific data from database
// publish project specific data
// initialize all handlers
if (!initFlmHandler())
{
ERROR_LOG(m_logger) << "Initialisation FlmHandler failed.";
ERROR_LOG() << "Initialisation FlmHandler failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation FlmHandler succesful.";
DEBUG_LOG() << "Initialisation FlmHandler succesful.";
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
@@ -87,52 +86,52 @@ int MainHandler::exerciseId() const
bool MainHandler::initFlmHandler()
{
DEBUG_LOG(m_logger) << "Start Initialisation FlmHandler";
DEBUG_LOG() << "Start Initialisation FlmHandler";
// FileTypeInfo
m_handlerFileTypeInfo.reset(new HandlerFileTypeInfo(this));
DEBUG_LOG(m_logger) << "Reset HandlerFileTypeInfo successful.";
DEBUG_LOG() << "Reset HandlerFileTypeInfo successful.";
if (!m_handlerFileTypeInfo->init())
{
ERROR_LOG(m_logger) << "Initialisation of HandlerFileTypeInfo failed.";
ERROR_LOG() << "Initialisation of HandlerFileTypeInfo failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation HandlerFileTypeInfo succesful.";
DEBUG_LOG() << "Initialisation HandlerFileTypeInfo succesful.";
// Folder
m_handlerFolder.reset(new HandlerFolder(this));
DEBUG_LOG(m_logger) << "Reset HandlerFolder successful.";
DEBUG_LOG() << "Reset HandlerFolder successful.";
if (!m_handlerFolder->init())
{
ERROR_LOG(m_logger) << "Initialisation of HandlerFolder failed.";
ERROR_LOG() << "Initialisation of HandlerFolder failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation HandlerFolder successful.";
DEBUG_LOG() << "Initialisation HandlerFolder successful.";
// FileContent
m_handlerFileContent.reset(new HandlerFileContent(this));
DEBUG_LOG(m_logger) << "Reset HandlerFileContent successful.";
DEBUG_LOG() << "Reset HandlerFileContent successful.";
if (!m_handlerFileContent->init())
{
ERROR_LOG(m_logger) << "Initialisation of HandlerFileContent failed.";
ERROR_LOG() << "Initialisation of HandlerFileContent failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation HandlerFileContent successful.";
DEBUG_LOG() << "Initialisation HandlerFileContent successful.";
// WebSocketServer
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler successful.";
DEBUG_LOG() << "Reset WebSocketInterfaceHandler successful.";
if (!m_handlerWebSocket->init())
{
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed.";
return false;
}
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer);
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler successful.";
DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler successful.";
@@ -140,7 +139,7 @@ bool MainHandler::initFlmHandler()
m_thpScriptServer.reset(new ThpScriptServer(this));
DEBUG_LOG(m_logger) << "Initialisation ThpTcpScriptServer successful.";
DEBUG_LOG() << "Initialisation ThpTcpScriptServer successful.";
@@ -150,10 +149,10 @@ bool MainHandler::initFlmHandler()
m_pdfServer.reset(new PdfServer(this, this));
if (!m_pdfServer->init())
{
ERROR_LOG(m_logger) << "Initialisation PdfServer failed.";
ERROR_LOG() << "Initialisation PdfServer failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation PdfServer successful.";
DEBUG_LOG() << "Initialisation PdfServer successful.";
return true;
}
@@ -56,8 +56,5 @@ private:
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_handlerWebSocket;
std::unique_ptr<ThpScriptServer> m_thpScriptServer;
std::unique_ptr<PdfServer> m_pdfServer;
NGL::INGLLogger &m_logger;
};
} // namespace FileManagement
@@ -11,7 +11,7 @@
#include "base.h"
#include <DDS/Core/function_reply_object.h>
#include <DDS/Core/core_types.h>
// Generated
#include <FileManagement/flm_db.h>
@@ -11,7 +11,7 @@
#include "base.h"
#include <DDS/Core/function_reply_object.h>
#include <DDS/Core/core_types.h>
// Generated
#include <FileManagement/flm_db.h>
@@ -11,7 +11,7 @@
#include "base.h"
#include <DDS/Core/function_reply_object.h>
#include <DDS/Core/core_types.h>
// Generated
#include <FileManagement/flm_db.h>
@@ -18,21 +18,20 @@ namespace FileManagement
CBI_PdfDownload::CBI_PdfDownload(unsigned short port)
: CommandInterface(port, "PDF_DOWNLOAD")
, m_logger(getLogger("PdfDownload"))
{}
void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
setAutoWriteEOL(false);
DEBUG_LOG(m_logger) << "Got command for PDF download";
DEBUG_LOG() << "Got command for PDF download";
if (args.count() != 1)
{
ERROR_LOG(m_logger) << "Invalid arg count";
ERROR_LOG() << "Invalid arg count";
return;
}
DEBUG_LOG(m_logger) << "Argument count ok";
DEBUG_LOG() << "Argument count ok";
bool bOk;
int documentId = args.at(0).toInt(&bOk);
@@ -41,10 +40,10 @@ void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
const QString err(QStringLiteral("Invalid file id: '%1'").arg(QString::fromUtf8(args.at(0))));
writeError(err);
ERROR_LOG(m_logger) << err;
ERROR_LOG() << err;
return;
}
DEBUG_LOG(m_logger) << "Argument ok";
DEBUG_LOG() << "Argument ok";
MainHandler *mainHandler = static_cast<MainHandler *>(TcpServer::instance(port())->userData());
@@ -55,22 +54,22 @@ void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
const QString err(QStringLiteral("File with ID '%1' does not exist").arg(QString::fromUtf8(args.at(0))));
writeError(err);
ERROR_LOG(m_logger) << err;
ERROR_LOG() << err;
return;
}
DEBUG_LOG(m_logger) << "File ID valid";
DEBUG_LOG() << "File ID valid";
if (fileContent.fileTypeId != FileManagement::FileType::Pdf)
{
const QString err(QStringLiteral("File with ID '%1' is not of type Pdf").arg(QString::fromUtf8(args.at(0))));
writeError(err);
ERROR_LOG(m_logger) << err;
ERROR_LOG() << err;
return;
}
DEBUG_LOG(m_logger) << "FileType valid";
DEBUG_LOG() << "FileType valid";
// success
DEBUG_LOG(m_logger) << "File ok, sending file \"" << fileContent.name << "\" with ID " << fileContent.id;
DEBUG_LOG() << "File ok, sending file \"" << fileContent.name << "\" with ID " << fileContent.id;
writeData(fileContent.content);
}
@@ -29,6 +29,5 @@ protected:
void handleCommandInternal(const QVector<QByteArray> &args) override;
private:
NGL::INGLLogger &m_logger;
};
} // namespace FileManagement
@@ -19,7 +19,6 @@ namespace FileManagement
PdfServer::PdfServer(MainHandler *mainHandler, QObject *parent)
: QObject(parent)
, m_tcpServer(TcpServer::instance(NGL::Connections::port(NGL::Connections::eConnection::FLM_PDF_SERVER)))
, m_logger(getLogger("PdfServer"))
{
m_tcpServer->setUserData(mainHandler);
m_tcpServer->setUseWorkerThreads(false);
@@ -28,6 +28,5 @@ public:
private:
TcpServer *m_tcpServer;
NGL::INGLLogger &m_logger;
};
} // namespace FileManagement
@@ -63,19 +63,19 @@ Logger::Logger(LoggerFactory *loggerFactory, QObject *parent)
void Logger::debug(const QString &message)
{
/*DEBUG_LOG*/ERROR_LOG(m_logger) << message;
/*DEBUG_LOG*/ERROR_LOG() << message;
}
void Logger::warning(const QString &message)
{
WARNING_LOG(m_logger) << message;
WARNING_LOG() << message;
}
void Logger::error(const QString &message)
{
ERROR_LOG(m_logger) << message;
ERROR_LOG() << message;
}
@@ -83,11 +83,10 @@ void Logger::error(const QString &message)
ThpScriptServer::ThpScriptServer(QObject *parent)
: AbstractServer(parent)
, mWsSvr(new QWebSocketServer({}, QWebSocketServer::NonSecureMode, this))
, m_logger(getLogger("ThpScriptServer"))
{
if (!listen(NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER)))
{
ERROR_LOG(m_logger) << "cannot listen on port " << NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER);
ERROR_LOG() << "cannot listen on port " << NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER);
Q_ASSERT(false);
}
@@ -149,7 +148,7 @@ ThpScriptServer::ThpScriptServer(QObject *parent)
default:
{
ERROR_LOG(m_logger) << "ws unknown path: " << cli->requestUrl().path();
ERROR_LOG() << "ws unknown path: " << cli->requestUrl().path();
failed = true;
break;
}
@@ -193,7 +192,7 @@ const QString ThpScriptServer::readContentFile() const
f->deleteLater();
if (!f->open(QIODevice::ReadOnly))
{
WARNING_LOG(m_logger) << "Error opening " << f->fileName() << " for reading: " << f->errorString();
WARNING_LOG() << "Error opening " << f->fileName() << " for reading: " << f->errorString();
return QStringLiteral("[]");
}
@@ -225,7 +224,7 @@ bool ThpScriptServer::newHttpConnection(httq::HttpRequest *request)
}
catch(const DataStreamError &err)
{
DEBUG_LOG(m_logger) << "handler threw DataStreamError: " << err.what();
DEBUG_LOG() << "handler threw DataStreamError: " << err.what();
// do not delete request as a failed datastream deletes it itself
return false;
}
@@ -305,7 +304,7 @@ ThpServerInformation ThpScriptServer::fromJson(const QJsonValue &val)
void ThpScriptServer::errorHandler(httq::HttpRequest *request, const HttpException &e) const
{
DEBUG_LOG(m_logger) << "handler threw error: " << e.error << " (http status = " << e.status << ")";
DEBUG_LOG() << "handler threw error: " << e.error << " (http status = " << e.status << ")";
QJsonObject root;
@@ -326,7 +325,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
QFile contentFile(thpDirectory() + QStringLiteral("content.json"), this);
if (!contentFile.open(QIODevice::ReadWrite))
{
ERROR_LOG(m_logger) << "Error opening file '" << contentFile.fileName() << "' for read/write: " << contentFile.errorString();
ERROR_LOG() << "Error opening file '" << contentFile.fileName() << "' for read/write: " << contentFile.errorString();
throw(HttpException(QStringLiteral("cannot open content file '%1': %2").arg(contentFile.fileName(), contentFile.errorString())));
}
@@ -341,7 +340,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
if (err.error != QJsonParseError::NoError)
{
ERROR_LOG(m_logger) << "content file's json invalid at" << err.offset << ":" << err.errorString();
ERROR_LOG() << "content file's json invalid at" << err.offset << ":" << err.errorString();
throw(HttpException(QStringLiteral("content file's json invalid at %1: %2").arg(err.offset).arg(err.errorString())));
}
@@ -369,7 +368,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
if (!contentFile.resize(0) || !contentFile.write(QJsonDocument(arr).toJson()))
{
ERROR_LOG(m_logger) << "Error writing content.json: " << contentFile.errorString();
ERROR_LOG() << "Error writing content.json: " << contentFile.errorString();
throw(HttpException(QStringLiteral("error writing content file: %1").arg(contentFile.errorString())));
}
@@ -535,7 +534,7 @@ bool ThpScriptServer::handleRequestSync(httq::HttpRequest &request) noexcept(fal
default:
{
WARNING_LOG(m_logger) << "unsupported method for /thp2";
WARNING_LOG() << "unsupported method for /thp2";
throw HttpException(L("unsupported method for /thp2: %1").arg((int)request.method()), 405);
}
}
@@ -625,7 +624,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!QFile::remove(destFile))
{
const QString err(QStringLiteral("Cannot remove old THP upload file %1 - removing THP not possible").arg(destFile));
ERROR_LOG(m_logger) << err;
ERROR_LOG() << err;
throw(HttpException(err));
}
@@ -664,7 +663,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!QDir().mkpath(destDir))
{
const QString err(QStringLiteral("Cannot create directory %1 - THP upload not possible").arg(destDir));
ERROR_LOG(m_logger) << err;
ERROR_LOG() << err;
throw(HttpException(err));
}
@@ -673,7 +672,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (fi.exists() && !QFile::remove(destFile))
{
const QString err(QStringLiteral("Cannot remove old THP upload file %1 - THP upload not possible").arg(destDir));
ERROR_LOG(m_logger) << err;
ERROR_LOG() << err;
throw(HttpException(err));
}
@@ -702,7 +701,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!d.exists() && !d.mkpath(destDir))
{
const QString errstr(QStringLiteral("Can create directory '%1' - THP upload not possible").arg(destDir));
ERROR_LOG(m_logger) << errstr;
ERROR_LOG() << errstr;
throw(HttpException(errstr));
}
@@ -711,7 +710,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (fi.exists() && !QFile::remove(destFile))
{
const QString errstr(QStringLiteral("Can not remove old file '%1'").arg(destDir));
ERROR_LOG(m_logger) << errstr;
ERROR_LOG() << errstr;
throw(HttpException(errstr));
}
@@ -720,7 +719,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!f->rename(destFile))
{
const QString errstr(QStringLiteral("Can not rename %1 to %2: %3").arg(tmpFilename, destFile, f->errorString()));
ERROR_LOG(m_logger) << errstr;
ERROR_LOG() << errstr;
throw(HttpException(errstr));
}
@@ -744,7 +743,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
default:
{
WARNING_LOG(m_logger) << "unsupported method";
WARNING_LOG() << "unsupported method";
throw(HttpException(QStringLiteral("unsupported method"), 405));
}
}
@@ -52,7 +52,6 @@ public:
void error(const QString &message) override;
private:
NGL::INGLLogger &m_logger;
};
@@ -76,8 +75,6 @@ public :
private:
QWebSocketServer *mWsSvr;
NGL::INGLLogger &m_logger;
static QJsonObject noError();
bool newHttpConnection(httq::HttpRequest *request) override;
virtual QWebSocketServer *webSocketServer() const override { return mWsSvr; }