/** * Plugin Ces Virtual Mines * $Id$ * $HeadURL$ * $Author$ * Created by Gerlinde Rudolphus, SLTE, 2016-04-14 */ #include "plugin.h" #include namespace CesGasPipes { std::shared_ptr CesGasPipesPlugin::createInterface(CentralEffectSimulation::Plugin::DataProvider *pdp, const std::shared_ptr &dDSConnector, NGL::Settings *settings, CentralEffectSimulation::MainHandler *mainHandler) { return std::make_shared(pdp, dDSConnector, settings, mainHandler); } CesGasPipesInterfaceImpl::CesGasPipesInterfaceImpl(CentralEffectSimulation::Plugin::DataProvider *pdp, const std::shared_ptr &dDSConnector, NGL::Settings *settings, CentralEffectSimulation::MainHandler *mainHandler) : m_pdp(pdp) , m_ddsConnector(dDSConnector) , m_mainHandler(mainHandler) , m_ddsHandler(m_mainHandler->dds()) , m_db(m_mainHandler->db()) , m_handlerParticipant(m_mainHandler->handlerParticipant()) , m_logger(CentralEffectSimulation::getLogger("Plugin.GasPipes.CesMinesInterfaceImpl")) { Q_UNUSED(settings) } CesGasPipesInterfaceImpl::~CesGasPipesInterfaceImpl() { // m_handlerParticipantBoobyTrap.reset(); // m_handlerParticipantOffRouteMine.reset(); } bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; INFO_LOG(m_logger) << "CesGasPipesInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; // // initialize handlerBoobyTrap // m_handlerParticipantBoobyTrap = std::make_shared(m_ddsHandler, // m_handlerParticipant, // this); // if (!m_handlerParticipantBoobyTrap->init()) // { // ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantBoobyTrap failed."; // return false; // } // // initialize offRouteMine // m_handlerParticipantOffRouteMine = std::make_shared(m_ddsHandler, // m_handlerParticipant, // this); // if (!m_handlerParticipantOffRouteMine->init()) // { // ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantOffRouteMine failed."; // return false; // } return true; } QString CesGasPipesInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CesGasPipesInterfaceImpl::echo").arg(message)); INFO_LOG(m_logger) << "CesGasPipesInterfaceImpl::echo return:" << ret; DEBUG_LOG(m_logger) << "DEBUG: CesGasPipesInterfaceImpl::echo return:" << ret; return ret; } } //namespace CesGasPipes