- BUILD_RTI conditional compilation für RTI Connext DDS dependencies - Namespace fixes in core_dtc.h (Core:: → DDS::Core::) - CMakeLists.txt: BUILD_RTI option und conditional dependencies - Handler minelayer: namespace closing mit BUILD_RTI guard - Build erfolgreich mit BUILD_RTI=OFF validiert Signed-off-by: Torsten Wierschin <torsten.wierschin@life-maps.com>
112 lines
2.7 KiB
C++
Executable File
112 lines
2.7 KiB
C++
Executable File
|
|
|
|
|
|
#include "plugin_instance.h"
|
|
|
|
#include "from_tab.h"
|
|
#include "uav_ia_manager.h"
|
|
|
|
#include <TrainingAreaBase/send_to_dds.h>
|
|
#include <TrainingAreaBase/training_area_telegrams.h>
|
|
#include <CentralEffectSimulation/ces_dtc.h>
|
|
#include <ProjectDataManagement/pdm_dtc.h>
|
|
#include <ParticipantManagement/ppm.hpp>
|
|
#include <FileManagement/flm_dtc.h>
|
|
#include <FileManagement/flm_ftc.h>
|
|
|
|
#include <TmsIfAdapter/module_loader.h>
|
|
#include <TmsIfAdapter/tms_if_adapter.h>
|
|
#include <TmsIfAdapter/uav_commander.h>
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
namespace UAS
|
|
{
|
|
TmsIfModuleHandle::TmsIfModuleHandle() : m_handle(ModuleLoader::load(QString(QCoreApplication::applicationDirPath() + QStringLiteral("/../lib/")).toStdString())),
|
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
|
|
|
|
|
TmsIfModuleHandle::~TmsIfModuleHandle()
|
|
{
|
|
try
|
|
{
|
|
ModuleLoader::unload(m_handle);
|
|
}
|
|
catch(std::exception &ex)
|
|
{
|
|
qDebug() << "failed to unload tms-if adapter module! " << ex.what();
|
|
}
|
|
}
|
|
|
|
|
|
PluginInstance::PluginInstance(TrainingAreaBase::Plugin::DataProvider *dataProvider,
|
|
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &sendToDds,
|
|
const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler,
|
|
NGL::Settings *settings)
|
|
: m_exerciseId(dataProvider->exerciseId())
|
|
, m_sendToDds(sendToDds)
|
|
, m_settings(settings)
|
|
, m_tmsIfAdapter(ModuleLoader::get(m_tmsIfModuleHandle()))
|
|
, m_ddsHandler(ddsHandler)
|
|
, m_dtcPdm(ProjectDataManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector()))
|
|
, m_dtcPpm(ParticipantManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector()))
|
|
, m_uavIAManager(new UAVInterfaceAdapterManager(m_ddsHandler, m_sendToDds, m_tmsIfAdapter, m_exerciseId, this))
|
|
, m_fromTab(new FromTab(ddsHandler, m_sendToDds, m_uavIAManager, m_exerciseId))
|
|
{
|
|
DEBUG_LOG(m_logger) << "UAS PluginInstance running!";
|
|
|
|
if (!m_dtcPdm)
|
|
{
|
|
WARNING_LOG(m_logger) << "m_dtcPdm failed";
|
|
throw std::runtime_error("m_dtcPdm failed");
|
|
}
|
|
m_dtcPdm->enableChargeType();
|
|
m_dtcPdm->waitForHistoricalDataChargeType(3000);
|
|
|
|
|
|
if (!m_dtcPpm)
|
|
{
|
|
WARNING_LOG(m_logger) << "m_dtcPpm failed";
|
|
throw std::runtime_error("m_dtcPpm failed");
|
|
}
|
|
m_dtcPpm->enableParticipant();
|
|
m_dtcPpm->waitForHistoricalDataParticipant(3000);
|
|
|
|
|
|
|
|
if (m_tmsIfAdapter.isReady())
|
|
{
|
|
m_uavIAManager->init();
|
|
}
|
|
else
|
|
{
|
|
m_tmsIfAdapter.set_isReady_Callback([this]()
|
|
{
|
|
m_uavIAManager->init();
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
bool PluginInstance::init()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
|
|
std::shared_ptr<TrainingAreaBase::SendToTab> PluginInstance::sendToTab()
|
|
{
|
|
return m_fromTab;
|
|
}
|
|
|
|
|
|
bool PluginInstance::canSendData() const
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|