Files
qt5-legatus-legacy/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.cpp
T
2026-08-13 18:33:10 +02:00

89 lines
3.0 KiB
C++
Executable File

/**
* Plugin CES Geo Pairing
* $Id$
* $HeadURL$
* $Author$
* Created by Gerlinde Rudolphus, SLTE, 2016-04-14
*/
#include "plugin.h"
#include "settings.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace CesGeoPairing
{
std::shared_ptr<CentralEffectSimulation::Plugin::Interface> CesGeoPairingPlugin::createInterface(CentralEffectSimulation::Plugin::DataProvider *pdp,
const std::shared_ptr<DDSConnector::DdsConnector> &dDSConnector,
NGL::Settings *settings,
CentralEffectSimulation::MainHandler *mainHandler)
{
return std::make_shared<CesGeoPairingInterfaceImpl>(pdp, dDSConnector, settings, mainHandler);
}
CesGeoPairingInterfaceImpl::CesGeoPairingInterfaceImpl(CentralEffectSimulation::Plugin::DataProvider *pdp,
const std::shared_ptr<DDSConnector::DdsConnector> dDSConnector,
NGL::Settings *settings,
CentralEffectSimulation::MainHandler *mainHandler)
: m_pdp(pdp)
, m_ddsConnector(dDSConnector)
, m_mainHandler(mainHandler)
, m_ddsHandler(m_mainHandler->dds())
, m_db(m_mainHandler->db())
, m_handlerParticipant(m_mainHandler->handlerParticipant())
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("CES.Plugin.GeoPairingInterfaceImpl"))
{
Q_UNUSED(settings)
}
CesGeoPairingInterfaceImpl::~CesGeoPairingInterfaceImpl()
{
m_handlerGeoPairing.reset();
}
bool CesGeoPairingInterfaceImpl::init(int domainId, int exerciseId)
{
m_domainId = domainId;
m_exerciseId = exerciseId;
INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::init()"
<< " m_domainId=" << m_domainId
<< " m_exerciseId=" << m_exerciseId;
// initialize ballisticService
m_ballisticService = std::make_shared<N_Ballistic::BallisticService>();
// initialize handlerGeoPairing
m_handlerGeoPairing = std::make_shared<HandlerGeoPairing>(m_ddsHandler,
m_handlerParticipant,
m_ballisticService,
this);
if (!m_handlerGeoPairing->init())
{
ERROR_LOG(m_logger) << "Initialisation m_handlerGeoPairing failed.";
return false;
}
INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::init() return true";
return true;
}
QString CesGeoPairingInterfaceImpl::echo(const QString &message)
{
QString ret(QStringLiteral("<<<< %1 >>>> CesGeoPairingInterfaceImpl::echo").arg(message));
INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::echo return:" << ret;
DEBUG_LOG(m_logger) << "DEBUG: CesGeoPairingInterfaceImpl::echo return:" << ret;
return ret;
}
} //namespace CesGeoPairing