/** * @RDE_HEADER@ * Plugin Provider for standalone SRP / THP * $Id$ * $HeadURL$ * $Author$ * Created by Christian Ehrlicher, SLSE, 2016-02-29 */ #pragma once #include #include #include #include #include #include namespace DDSConnector { class DdsConnector; } namespace THP { class BuildingPluginProvider; class SitMapPluginProvider final : public SituationMap::PluginProvider { Q_OBJECT public: using SituationMap::PluginProvider::PluginProvider; QString toString() const override; bool init(const std::shared_ptr &ddsConnector); void emitPartitionTimeChanged(qint64 curTime) { m_curPartitionTime = curTime; emit partitionTimeChanged(curTime); } void setExerciseId(int exerciseId) { m_exerciseId = exerciseId; } int exerciseId() const override { return m_exerciseId; } bool isSessionValid() const override { return true; } qint64 partitionTime() const override { return m_curPartitionTime; } int partitionId() const override { return -1; } int operatorId() const override { return 42; } LtsAppDescriptor::App appId() const override { return LtsAppDescriptor::App::ThpSituationReplay; } bool isVisibleParty(int) const override { return true; } QString workspaceId() const override { return {}; } bool isReplayPartition() const override { return false; } std::shared_ptr aesDtc() const override { return m_aesDtc; } std::shared_ptr aesInfoIfc() const override { return {}; } std::shared_ptr almDtc() const override { return {}; } std::shared_ptr almFtc() const override { return {}; } std::shared_ptr almInfoIfc() const override { return {}; } std::shared_ptr asmDtc() const override { return {}; } std::shared_ptr asmFtc() const override { return {}; } std::shared_ptr bldDtc() const override { return m_bldDtc; } std::shared_ptr bldFtc() const override { return {}; } std::shared_ptr bldInfoIfc() const override { return {}; } std::shared_ptr cesDtc() const override { return m_cesDtc; } std::shared_ptr exmDtc() const override { return {}; } std::shared_ptr exmFtc() const override { return {}; } std::shared_ptr fltDtc() const override { return {}; } std::shared_ptr fltFtc() const override { return {}; } std::shared_ptr fltParticipantIfc() const override { return m_fltParticipantIfc; } std::shared_ptr fltAesIfc() const override { return m_fltAesIfc; } std::shared_ptr fltBuildingComponentIfc() const override { return m_fltBuildingComponentIfc; } std::shared_ptr gimDtc() const override { return m_gimDtc; } std::shared_ptr gimIfc() const override { return {}; } std::shared_ptr gnaDtc() const override { return {}; } std::shared_ptr gnaIfc() const override { return {}; } std::shared_ptr ismDtc() const override; std::shared_ptr ismDataIfc() const override; std::shared_ptr ismGuiIfc() const override { return {}; } std::shared_ptr opmDtc() const override { return {}; } std::shared_ptr opmFtc() const override { return {}; } std::shared_ptr ppmDtc() const override { return m_ppmDtc; } std::shared_ptr ppmFtc() const override { return {}; } std::shared_ptr ppmParticipantInfoIfc() const override { return {}; } std::shared_ptr pdmDtc() const override { return m_pdmDtc; } std::shared_ptr srpDtc() const override { return m_srpDtc; } std::shared_ptr ocParticipantInfoIfc() const override { return {}; } std::shared_ptr smoServiceMonitorIfc() const override { return {}; } std::shared_ptr tgtDtc() const override { return {}; } std::shared_ptr cmoDtc() const override { return {}; } // for BuildingPluginProvider BuildingPluginProvider *buildingPluginProvider() { return m_buildingPluginProvider.get(); } private: std::shared_ptr m_aesDtc; std::shared_ptr m_bldDtc; std::shared_ptr m_cesDtc; std::shared_ptr m_fltParticipantIfc; std::shared_ptr m_fltAesIfc; std::shared_ptr m_fltBuildingComponentIfc; std::shared_ptr m_gimDtc; mutable std::shared_ptr m_ismDtc; mutable std::shared_ptr m_ismForeign; std::shared_ptr m_ppmDtc; std::shared_ptr m_srpDtc; std::shared_ptr m_pdmDtc; qint64 m_curPartitionTime = 0; int m_exerciseId = 0; std::shared_ptr m_buildingPluginProvider; std::shared_ptr m_ddsConnector; }; class BuildingPluginProvider final : public BuildingViewer::PluginProvider { Q_OBJECT public: using BuildingViewer::PluginProvider::PluginProvider; BuildingPluginProvider() = default; QString toString() const override { return m_smPluginProvider->toString(); } bool init(const std::shared_ptr &ddsConnector, SitMapPluginProvider *smPluginProvider); void emitPartitionTimeChanged(qint64 curTime) { m_smPluginProvider->emitPartitionTimeChanged(curTime); } int exerciseId() const override { return m_smPluginProvider->exerciseId(); } qint64 partitionTime() const override { return m_smPluginProvider->partitionTime(); } bool isReplayPartition() const override { return false; } bool isVisibleParty(int partyId) const override { return m_smPluginProvider->isVisibleParty(partyId); } LtsSession::DdsConnectionParams connParams() const override { return m_connectionParams; } std::shared_ptr asbIfc() const override { return m_asbIfc; } std::shared_ptr avmDataIfc() const override { return nullptr; } // optional std::shared_ptr bldDtc() const override { return m_smPluginProvider->bldDtc(); } std::shared_ptr bldInfoIfc() const override { return m_smPluginProvider->bldInfoIfc(); } // optional std::shared_ptr ismDtc() const override { return m_smPluginProvider->ismDtc(); } std::shared_ptr ismDataIfc() const override { return m_smPluginProvider->ismDataIfc(); } std::shared_ptr aesDtc() const override { return m_smPluginProvider->aesDtc(); } // optional std::shared_ptr ppmDtc() const override { return m_smPluginProvider->ppmDtc(); } // optional std::shared_ptr pdmDtc() const override { return m_smPluginProvider->pdmDtc(); } // optional std::shared_ptr srpDtc() const override { return m_smPluginProvider->srpDtc(); } // optional std::shared_ptr ppmParticipantInfoIfc() const override { return m_smPluginProvider->ppmParticipantInfoIfc(); } // optional private: SitMapPluginProvider *m_smPluginProvider{nullptr}; std::shared_ptr m_asbIfc; LtsSession::DdsConnectionParams m_connectionParams; }; }