- 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>
161 lines
3.8 KiB
C++
Executable File
161 lines
3.8 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* MainHandler for FileManagement
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2017-04-03
|
|
*/
|
|
|
|
#include "main_handler.h"
|
|
#include "handler_file_type_info.h"
|
|
#include "handler_folder.h"
|
|
#include "handler_file_content.h"
|
|
#include "settings.h"
|
|
//#include "thp_script_server.h"
|
|
#include "thp_script_httq.h"
|
|
#include "pdf_server.h"
|
|
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
#include <DDS/Core/pacemaker.h>
|
|
|
|
namespace FileManagement
|
|
{
|
|
MainHandler::MainHandler(QObject *parent)
|
|
: QObject(parent)
|
|
, m_ddsHandler(nullptr)
|
|
, m_dbHandler(nullptr)
|
|
, m_handlerFileTypeInfo(nullptr)
|
|
, m_handlerFolder(nullptr)
|
|
, m_handlerFileContent(nullptr)
|
|
, m_handlerWebSocket(nullptr)
|
|
{}
|
|
|
|
MainHandler::~MainHandler()
|
|
{
|
|
m_thpScriptServer = nullptr;
|
|
m_pdfServer = nullptr;
|
|
m_handlerFileTypeInfo = nullptr;
|
|
m_handlerFolder = nullptr;
|
|
m_handlerFileContent = nullptr;
|
|
m_ddsHandler = nullptr;
|
|
m_dbHandler = nullptr;
|
|
}
|
|
|
|
bool MainHandler::init(int domainId)
|
|
{
|
|
// initialize database
|
|
m_dbHandler = std::make_shared<DbHandler>();
|
|
if (!m_dbHandler->init(0, Settings::settings()))
|
|
{
|
|
ERROR_LOG() << "Initialisation dbHandler failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation dbHandler succesful.";
|
|
|
|
// initialize DDS
|
|
m_ddsHandler.reset(new DdsHandler(domainId));
|
|
if (!m_ddsHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation ddsHandler failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation ddsHandler succesful.";
|
|
|
|
// read project specific data from database
|
|
// publish project specific data
|
|
// initialize all handlers
|
|
if (!initFlmHandler())
|
|
{
|
|
ERROR_LOG() << "Initialisation FlmHandler failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation FlmHandler succesful.";
|
|
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
|
|
|
return true;
|
|
}
|
|
|
|
int MainHandler::exerciseId() const
|
|
{
|
|
if (dds())
|
|
return dds()->ddsConnector()->getPartitionId();
|
|
return -1;
|
|
}
|
|
|
|
bool MainHandler::initFlmHandler()
|
|
{
|
|
DEBUG_LOG() << "Start Initialisation FlmHandler";
|
|
|
|
// FileTypeInfo
|
|
m_handlerFileTypeInfo.reset(new HandlerFileTypeInfo(this));
|
|
DEBUG_LOG() << "Reset HandlerFileTypeInfo successful.";
|
|
|
|
if (!m_handlerFileTypeInfo->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation of HandlerFileTypeInfo failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation HandlerFileTypeInfo succesful.";
|
|
|
|
// Folder
|
|
m_handlerFolder.reset(new HandlerFolder(this));
|
|
DEBUG_LOG() << "Reset HandlerFolder successful.";
|
|
|
|
if (!m_handlerFolder->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation of HandlerFolder failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation HandlerFolder successful.";
|
|
|
|
// FileContent
|
|
m_handlerFileContent.reset(new HandlerFileContent(this));
|
|
DEBUG_LOG() << "Reset HandlerFileContent successful.";
|
|
|
|
if (!m_handlerFileContent->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation of HandlerFileContent failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation HandlerFileContent successful.";
|
|
|
|
// WebSocketServer
|
|
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
|
|
DEBUG_LOG() << "Reset WebSocketInterfaceHandler successful.";
|
|
|
|
if (!m_handlerWebSocket->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed.";
|
|
return false;
|
|
}
|
|
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer);
|
|
DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler successful.";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_thpScriptServer.reset(new ThpScriptServer(this));
|
|
DEBUG_LOG() << "Initialisation ThpTcpScriptServer successful.";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_pdfServer.reset(new PdfServer(this, this));
|
|
if (!m_pdfServer->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation PdfServer failed.";
|
|
return false;
|
|
}
|
|
DEBUG_LOG() << "Initialisation PdfServer successful.";
|
|
|
|
return true;
|
|
}
|
|
|
|
} // namespace FileManagement
|