- Merged 292 changed files from dlbo snapshot - Fixed IDL enum collisions (PortType, PdmEventType) - Fixed Grantlee template for C++11 scoped enums - Fixed CMake VERSION_GREATER syntax - Added missing directories (THP, LtsRestClient, etc.) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
69 lines
2.0 KiB
C++
Executable File
69 lines
2.0 KiB
C++
Executable File
/**
|
|
* DdsHandler for DDS
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Philipp Dassow, NLST, 2018-01-23
|
|
*/
|
|
|
|
#include "dds_handler.h"
|
|
|
|
#include <DDS/Core/pacemaker.h>
|
|
|
|
namespace TrainingAreaBaseOC
|
|
{
|
|
|
|
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
|
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
|
, m_logger(getLogger("DdsHandler"))
|
|
{
|
|
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
|
}
|
|
|
|
bool DdsHandler::init(const QStringList &qosFileList)
|
|
{
|
|
if (!m_ddsConnector->init(qosFileList))
|
|
{
|
|
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
|
return false;
|
|
}
|
|
|
|
// default initialize Publisher and Subscriber
|
|
m_ddsConnector->initPublisherSubscriber();
|
|
|
|
m_dtcCore = Core::Interface::Dtc::create(m_ddsConnector);
|
|
bool bRet = m_dtcCore->enablePartitionTime();
|
|
|
|
// Pacemaker
|
|
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
|
|
|
m_dtsTaboc = Interface::Dts::create(m_ddsConnector);
|
|
bRet &= m_dtsTaboc->enableAll();
|
|
INFO_LOG(m_logger) << "Dts TrainingAreaBaseOc initialised";
|
|
|
|
m_dtcTaboc = Interface::Dtc::create(m_ddsConnector);
|
|
bRet &= m_dtsTaboc->enableSpecificsEquipment();
|
|
INFO_LOG(m_logger) << "Dtc TrainingAreaBaseOc initialised";
|
|
|
|
m_ftsTaboc = Interface::Fts::create(m_ddsConnector);
|
|
bRet &= m_ftsTaboc->enableAll();
|
|
INFO_LOG(m_logger) << "Fts TrainingAreaBaseOc initialised";
|
|
|
|
m_dtsTab = TrainingAreaBase::Interface::Dts::create(m_ddsConnector);
|
|
bRet &= (m_dtsTab->enableOcData() && m_dtsTab->enableFireSmokeMarkerData());
|
|
INFO_LOG(m_logger) << "Dts TrainingAreaBase initialised";
|
|
|
|
m_ftsTab = TrainingAreaBase::Interface::Fts::create(m_ddsConnector);
|
|
bRet &= (m_ftsTab->enableSendOcData() && m_ftsTab->enableSendFireSmokeMarkerData());
|
|
INFO_LOG(m_logger) << "Fts TrainingAreaBase initialised";
|
|
|
|
return bRet;
|
|
}
|
|
|
|
qint64 DdsHandler::currentPartitionTime() const
|
|
{
|
|
return m_dtcCore->partitionTime().timeStamp();
|
|
}
|
|
|
|
} // Namespace PDM
|