/** * @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 #include #include #include #include #include #include #include #include #include #include "thp_situation_filter_interface_impl.h" namespace THP { QString SitMapPluginProvider::toString() const { return QString(); } bool SitMapPluginProvider::init(const std::shared_ptr &ddsConnector) { m_ddsConnector = ddsConnector; m_buildingPluginProvider = std::make_shared(); 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(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(m_ppmDtc); m_fltAesIfc = std::make_shared(m_ppmDtc); m_fltBuildingComponentIfc = std::make_shared(m_ppmDtc); // m_fltParticipantIfc = m_fltAesIfc; // Not sure, lets try return m_buildingPluginProvider->init(ddsConnector, this); } bool BuildingPluginProvider::init(const std::shared_ptr &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(m_smPluginProvider->ppmDtc(), m_smPluginProvider->aesDtc(), m_smPluginProvider->gimDtc()); return true; } std::shared_ptr SitMapPluginProvider::ismDataIfc() const { if (!m_ismForeign) m_ismForeign = std::make_shared(ismDtc()); return m_ismForeign; } std::shared_ptr SitMapPluginProvider::ismDtc() const { if (!m_ismDtc) { m_ismDtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector); m_ismDtc->enableAll(); } return m_ismDtc; } } // namespace THP