106 lines
3.6 KiB
C++
Executable File
106 lines
3.6 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Plugin Provider for standalone SRP / THP
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
|
*/
|
|
|
|
#include "thp_plugin_provider.h"
|
|
#include <AreaEffectSimulation/aes_dtc.h>
|
|
#include <AdvancedSymbology/Data/asb_foreign_interface_impl.h>
|
|
#include <Buildings/bld_dtc.h>
|
|
#include <CentralEffectSimulation/ces_dtc.h>
|
|
#include <GuezIedManagement/gim_dtc.h>
|
|
#include <InfrastructureManagement/ism_dtc.h>
|
|
#include <InfrastructureManagement/Data/ism_foreign_data_plugin.h>
|
|
#include <ParticipantManagement/ppm_dtc.h>
|
|
#include <ProjectDataManagement/pdm_dtc.h>
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
|
|
#include "thp_situation_filter_interface_impl.h"
|
|
|
|
namespace THP
|
|
{
|
|
|
|
QString SitMapPluginProvider::toString() const
|
|
{
|
|
return QString();
|
|
}
|
|
|
|
bool SitMapPluginProvider::init(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
|
{
|
|
m_ddsConnector = ddsConnector;
|
|
|
|
m_buildingPluginProvider = std::make_shared<BuildingPluginProvider>();
|
|
|
|
m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(ddsConnector);
|
|
m_aesDtc->enableAll();
|
|
m_bldDtc = Buildings::Interface::Dtc::create(ddsConnector);
|
|
m_bldDtc->enableAll();
|
|
m_cesDtc = CentralEffectSimulation::Interface::Dtc::create(ddsConnector);
|
|
m_cesDtc->enableAll();
|
|
m_gimDtc = GuezIedManagement::Interface::Dtc::create(ddsConnector);
|
|
m_gimDtc->enableAll();
|
|
// m_ismDtc = InfrastructureManagement::Interface::Dtc::create(ddsConnector);
|
|
// m_ismDtc->enableAll();
|
|
// m_ismForeign = std::make_shared<InfrastructureManagement::ForeignInterfaceImpl>(m_ismDtc);
|
|
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(ddsConnector);
|
|
m_ppmDtc->enableAll();
|
|
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(ddsConnector);
|
|
m_pdmDtc->enableAll();
|
|
|
|
// needs m_ppmDtc
|
|
m_fltParticipantIfc = std::make_shared<FilterManagement::ThpFilterInterfaceImpl>(m_ppmDtc);
|
|
m_fltAesIfc = std::make_shared<FilterManagement::ThpFilterInterfaceImpl>(m_ppmDtc);
|
|
m_fltBuildingComponentIfc = std::make_shared<FilterManagement::ThpFilterInterfaceImpl>(m_ppmDtc);
|
|
// m_fltParticipantIfc = m_fltAesIfc; // Not sure, lets try
|
|
|
|
return m_buildingPluginProvider->init(ddsConnector, this);
|
|
}
|
|
|
|
|
|
bool BuildingPluginProvider::init(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector,
|
|
SitMapPluginProvider *smPluginProvider)
|
|
{
|
|
Q_ASSERT(smPluginProvider);
|
|
m_smPluginProvider = smPluginProvider;
|
|
connect(m_smPluginProvider, &SitMapPluginProvider::partitionTimeChanged,
|
|
this, &BuildingPluginProvider::partitionTimeChanged);
|
|
|
|
m_connectionParams.domainId = ddsConnector->getDomainId();
|
|
m_connectionParams.partitionId = ddsConnector->getPartitionId();
|
|
m_connectionParams.exerciseId = ddsConnector->getPartitionId();
|
|
m_connectionParams.tcpConnectionUrl = ddsConnector->getTcpConnectionUrl();
|
|
|
|
m_asbIfc = std::make_shared<AdvancedSymbology::ForeignInterfaceImpl>(m_smPluginProvider->ppmDtc(),
|
|
m_smPluginProvider->aesDtc(),
|
|
m_smPluginProvider->gimDtc());
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
std::shared_ptr<InfrastructureManagement::ForeignDataInterface> SitMapPluginProvider::ismDataIfc() const
|
|
{
|
|
if (!m_ismForeign)
|
|
m_ismForeign = std::make_shared<InfrastructureManagement::ForeignInterfaceImpl>(ismDtc());
|
|
|
|
return m_ismForeign;
|
|
}
|
|
|
|
|
|
std::shared_ptr<InfrastructureManagement::Interface::Dtc> SitMapPluginProvider::ismDtc() const
|
|
{
|
|
if (!m_ismDtc)
|
|
{
|
|
m_ismDtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector);
|
|
m_ismDtc->enableAll();
|
|
}
|
|
|
|
return m_ismDtc;
|
|
}
|
|
|
|
} // namespace THP
|