Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+141
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Provide access to Plugins via LtsSession
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "plugin_provider_lts_session.h"
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
|
||||
namespace SituationMap
|
||||
{
|
||||
PluginProviderLtsSession::PluginProviderLtsSession(const QPointer<LtsSession::LtsSession> &session)
|
||||
: m_session(session)
|
||||
{}
|
||||
|
||||
QString PluginProviderLtsSession::toString() const
|
||||
{
|
||||
return m_session ? m_session->toString() : QStringLiteral("????");
|
||||
}
|
||||
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Dtc> PluginProviderLtsSession::ismDtc() const
|
||||
{
|
||||
if (!m_ismDtc && m_session)
|
||||
m_session->getDtc<InfrastructureManagement::DataInterface>(m_ismDtc);
|
||||
|
||||
return m_ismDtc;
|
||||
}
|
||||
|
||||
std::shared_ptr<InfrastructureManagement::ForeignDataInterface> PluginProviderLtsSession::ismDataIfc() const
|
||||
{
|
||||
if (!m_ismDataIfc && m_session)
|
||||
m_session->getForeignDataInterface<InfrastructureManagement::DataInterface>(m_ismDataIfc);
|
||||
|
||||
return m_ismDataIfc;
|
||||
}
|
||||
|
||||
bool PluginProviderLtsSession::init(NGL::INGLLogger &logger)
|
||||
{
|
||||
if (!m_session)
|
||||
return false;
|
||||
m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc);
|
||||
m_session->getForeignGuiInterface<AreaEffectSimulation::ForeignInfoGuiInterface>(m_aesInfoIfc); // optional
|
||||
m_session->getDtc<AlarmManagement::DataInterface>(m_almDtc); // optional
|
||||
m_session->getFtc<AlarmManagement::DataInterface>(m_almFtc); // optional
|
||||
m_session->getForeignGuiInterface<AlarmManagement::ForeignInfoGuiInterface>(m_almInfoIfc); // optional
|
||||
m_session->getDtc<AssetManagement::DataInterface>(m_asmDtc); // optional
|
||||
m_session->getFtc<AssetManagement::DataInterface>(m_asmFtc); // optional
|
||||
m_session->getDtc<Buildings::DataInterface>(m_bldDtc); // optional
|
||||
m_session->getFtc<Buildings::DataInterface>(m_bldFtc); // optional
|
||||
m_session->getForeignGuiInterface<Buildings::ForeignInfoGuiInterface>(m_bldInfoIfc); // optional
|
||||
m_session->getDtc<CentralEffectSimulation::DataInterface>(m_cesDtc);
|
||||
m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc); // optional
|
||||
m_session->getFtc<ExerciseManagement::DataInterface>(m_exmFtc); // optional
|
||||
m_session->getDtc<FilterManagement::DataInterface>(m_fltDtc); // optional
|
||||
m_session->getFtc<FilterManagement::DataInterface>(m_fltFtc); // optional
|
||||
m_session->getForeignGuiInterface<FilterManagement::ForeignFltParticipantGuiInterface>(m_fltParticipantIfc); // not in global
|
||||
m_session->getForeignGuiInterface<FilterManagement::ForeignAesGuiInterface>(m_fltAesIfc); // not in global
|
||||
m_session->getForeignGuiInterface<FilterManagement::ForeignFltBuildingComponentGuiInterface>(m_fltBuildingComponentIfc); // not in global
|
||||
m_session->getDtc<GuezIedManagement::DataInterface>(m_gimDtc); // optional
|
||||
m_session->getForeignGuiInterface<GuezIedManagement::ForeignGuiInterface>(m_gimIfc); // optional
|
||||
m_session->getDtc<GuezNasat::DataInterface>(m_gnaDtc); // optional
|
||||
m_session->getForeignGuiInterface<GuezNasat::ForeignGuiInterface>(m_gnaIfc); // optional
|
||||
//m_session->getDtc<InfrastructureManagement::DataInterface>(m_ismDtc);
|
||||
//m_session->getForeignDataInterface<InfrastructureManagement::DataInterface>(m_ismDataIfc);
|
||||
m_session->getForeignGuiInterface<InfrastructureManagement::ForeignResourceManagementGuiInterface>(m_ismGuiIfc); // optional
|
||||
m_session->getDtc<OperatorManagement::DataInterface>(m_opmDtc); // optional
|
||||
m_session->getFtc<OperatorManagement::DataInterface>(m_opmFtc); // optional
|
||||
m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc);
|
||||
m_session->getFtc<ParticipantManagement::DataInterface>(m_ppmFtc);
|
||||
m_session->getForeignGuiInterface<ParticipantManagement::ForeignParticipantInfoGuiInterface>(m_ppmParticipantInfoIfc); // optional
|
||||
m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc);
|
||||
m_session->getForeignGuiInterface<OcSituationClient::ForeignParticipantInfoGuiInterface>(m_ocParticipantInfoIfc); // optional
|
||||
m_session->getForeignGuiInterface<ServiceMonitor::ForeignGuiInterface>(m_smoServiceMonitorIfc); // optional
|
||||
m_session->getDtc<TargetManagement::DataInterface>(m_tgtDtc); // optional
|
||||
m_session->getDtc<ComponentMonitor::DataInterface>(m_cmoDtc); // optional
|
||||
|
||||
bool bRet = true;
|
||||
if (!m_aesDtc)
|
||||
{
|
||||
WARNING_LOG(logger) << "Can not retrieve AreaEffectSimulation::DTC";
|
||||
bRet = false;
|
||||
}
|
||||
if (!m_cesDtc)
|
||||
{
|
||||
WARNING_LOG(logger) << "Can not retrieve CentralEffectSimulation::DTC";
|
||||
bRet = false;
|
||||
}
|
||||
if (!m_fltAesIfc && m_session->partitionType() != IDL::PartitionType::Global)
|
||||
{
|
||||
WARNING_LOG(logger) << "Can not retrieve FilterManagement::GuiIFC";
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
// GUEZE-1769: Schnappschuss und ABT: Entfernen Filter für Etagen / Komponenten
|
||||
// Nachtrag zu r 59394 (branch 23_1_guez_bugfixing)
|
||||
// Wenn das Plugin flt.building_cmpnt nur in Global geladen wird (ResourceApp),
|
||||
// dann muss es im plugin_provider_lts_session.cpp optional sein.
|
||||
// Check dementsprechend nun folgendermaßen:
|
||||
if (!m_fltBuildingComponentIfc && m_session->app() == LtsAppDescriptor::App::ResourceManager)
|
||||
{
|
||||
ERROR_LOG(logger) << "Can not retrieve FilterManagement::BuildingComponentGuiIfc";
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
// if (!m_ismDtc)
|
||||
// {
|
||||
// WARNING_LOG(logger) << "Can not retrieve InfrastructureManagement::DTC";
|
||||
// bRet = false;
|
||||
// }
|
||||
// if (!m_ismDataIfc)
|
||||
// {
|
||||
// WARNING_LOG(logger) << "Can not retrieve InfrastructureManagement::DataIFC";
|
||||
// bRet = false;
|
||||
// }
|
||||
if (!m_ppmDtc)
|
||||
{
|
||||
WARNING_LOG(logger) << "Can not retrieve ParticipantManagement::DTC";
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
connect(m_session.data(), &LtsSession::LtsSessionDataDds::partitionTimeChanged,
|
||||
this, &PluginProviderLtsSession::partitionTimeChanged, Qt::UniqueConnection);
|
||||
|
||||
connect(m_session.data(), &LtsSession::LtsSession::workspaceIdChanged,
|
||||
this, &PluginProviderLtsSession::workspaceIdChanged, Qt::UniqueConnection);
|
||||
|
||||
|
||||
if (!bRet)
|
||||
{
|
||||
FATAL_LOG(logger) << "SitMap - PluginProvider failed!!!";
|
||||
FATAL_LOG(logger) << "SitMap - PluginProvider failed!!!";
|
||||
FATAL_LOG(logger) << "SitMap - PluginProvider failed!!!";
|
||||
}
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
} // namespace SituationMap
|
||||
Reference in new issue
Block a user