- 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>
184 lines
6.4 KiB
C++
Executable File
184 lines
6.4 KiB
C++
Executable File
/**
|
|
* MainHandler for ExerciseManagement
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#include "main_handler.h"
|
|
|
|
#include "asset_assignment_manager.h"
|
|
#include "av_control.h"
|
|
#include "fm_control.h"
|
|
#include "exercises_handler.h"
|
|
#include "dds_handler.h"
|
|
#include "handler_menu_struct.h"
|
|
#include "handler_frequency_planning_status.h"
|
|
#include "tvc_handler.h"
|
|
#include "cnr_handler.h"
|
|
#include "frequency_set_handler.h"
|
|
#include "frequency_planning_handler.h"
|
|
#include "cnr_tvc_profile_handler.h"
|
|
#include "active_exercises.h"
|
|
#include "stream_name_mapping_publisher.h"
|
|
#include "settings.h"
|
|
#include "handler_video_team.h"
|
|
#include "handler_video_receiver.h"
|
|
|
|
#include <avm_dts.h>
|
|
#include <avm_fts.h>
|
|
|
|
#include <nglsettings/nglsettings_connections.h>
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
#include <ngldb/db_service_handler.h>
|
|
|
|
#include <DDS/Core/pacemaker.h>
|
|
|
|
using namespace AudioVideoManagement;
|
|
|
|
MainHandler::MainHandler(QObject *parent)
|
|
: QObject(parent)
|
|
{}
|
|
|
|
MainHandler::~MainHandler() = default;
|
|
|
|
bool MainHandler::init(int domainId)
|
|
{
|
|
// initialize database
|
|
m_dbHandler.reset(new DbHandler());
|
|
if (!m_dbHandler->init(0, Settings::settings()))
|
|
{
|
|
ERROR_LOG() << "Initialisation dbHandler failed.";
|
|
return false;
|
|
}
|
|
m_dbInterface = m_dbHandler->db();
|
|
|
|
// initialize DDS
|
|
m_ddsHandler.reset(new DdsHandler(domainId));
|
|
if (!m_ddsHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation ddsHandler failed.";
|
|
return false;
|
|
}
|
|
|
|
m_avControl.reset(new AVControl(NGL::Connections::hostName(NGL::Connections::eConnection::AVS_ROOT),
|
|
NGL::Connections::port(NGL::Connections::eConnection::AVS_ROOT)));
|
|
m_avControl->connectToAVS();
|
|
|
|
m_fmControl.reset(new FMControl(NGL::Connections::hostName(NGL::Connections::eConnection::AVS_FM),
|
|
NGL::Connections::port(NGL::Connections::eConnection::AVS_FM)));
|
|
m_fmControl->connectToAVS();
|
|
|
|
|
|
// The ExercisesHandler must be initialized *before* Tvc- and CnrHandler
|
|
// as the ExercisesHandler clears (and refills) the device_config.
|
|
// Tvc- and CnrHandler also fill the device_config.
|
|
m_exHandler.reset(new ExercisesHandler(this));
|
|
// init() called below...
|
|
|
|
m_activeExercises.reset(new ActiveExercises(m_exHandler.get()));
|
|
|
|
m_videoTeamHandler.reset(new HandlerVideoTeam(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get(), m_activeExercises.get()));
|
|
connect(m_videoTeamHandler.get(), &HandlerVideoTeam::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded);
|
|
if (!m_videoTeamHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation HandlerVideoTeam failed.";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
m_frequencyPlanningStatusHandler.reset(new HandlerFrequencyPlanningStatus(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get()));
|
|
if (!m_frequencyPlanningStatusHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation HandlerFrequencyPlanningStatus failed.";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
// init() called here as it requires the HandlerVideoTeam which can only be created after ExercisesHandler
|
|
if (!m_exHandler->init())
|
|
return false;
|
|
|
|
|
|
m_menuStructHandler.reset(new HandlerMenuStruct(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get()));
|
|
if (!m_menuStructHandler->init())
|
|
return false;
|
|
|
|
m_tvcHandler.reset(new TvcHandler(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get(), m_activeExercises.get()));
|
|
connect(m_tvcHandler.get(), &TvcHandler::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded);
|
|
if (!m_tvcHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation tvcHandler failed";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
m_frequencySetHandler.reset(new FrequencySetHandler(m_ddsHandler->dts(), m_dbInterface.get()));
|
|
if (!m_frequencySetHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation FrequencySetHandler failed";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
m_frequencyPlanningHandler.reset(new FrequencyPlanningHandler(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get(), m_frequencySetHandler.get(), m_activeExercises.get()));
|
|
// init() done below because there is a circular dependency with CnrHandler
|
|
|
|
m_cnrHandler.reset(new CnrHandler(m_ddsHandler->dts(), m_ddsHandler->fts(), m_ddsHandler->ismDtc(), m_frequencyPlanningHandler.get(), m_dbInterface.get(), m_activeExercises.get()));
|
|
connect(m_cnrHandler.get(), &CnrHandler::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded);
|
|
|
|
m_frequencyPlanningHandler->setCnrHandler(m_cnrHandler.get());
|
|
if (!m_frequencyPlanningHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation FrequencyPlanningHandler failed";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
if (!m_cnrHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation cnrHandler failed";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
m_cnrTvcProfileHandler.reset(new CnrTvcProfileHandler(m_dbInterface.get(), m_ddsHandler->dts(), m_ddsHandler->fts(), m_cnrHandler.get(), m_tvcHandler.get()));
|
|
if (!m_cnrTvcProfileHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation RadioCircuitsHandler failed";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
m_streamNameMappingPublisher.reset(new StreamNameMappingPublisher(m_ddsHandler->ismDtc(), m_ddsHandler->dts()));
|
|
|
|
// initialize handler video receiver
|
|
m_videoReceiverHandler.reset(new HandlerVideoReceiver(this, m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get()));
|
|
if (!m_videoReceiverHandler->init())
|
|
{
|
|
ERROR_LOG() << "Initialisation HandlerVideoReceiver failed.";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
if (!m_ddsHandler->enableDtcClients())
|
|
{
|
|
ERROR_LOG() << "Initialisation DTCs failed.";
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
|
return false;
|
|
}
|
|
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
|
|
|
return true;
|
|
}
|
|
|
|
int MainHandler::exerciseId()
|
|
{
|
|
if (ddsHandler())
|
|
return ddsHandler()->ddsConnector()->getPartitionId();
|
|
return -1;
|
|
}
|
|
|