Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* MainHandler for TetraRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace WirelessLocationSystem
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
m_wlsParticipantHandler = nullptr;
|
||||
m_wlsHandler = nullptr;
|
||||
m_wsHandler = nullptr;
|
||||
m_ismHandler = nullptr;
|
||||
m_ddsHandler = nullptr;
|
||||
}
|
||||
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
const int exerciseId = 0;
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
return false;
|
||||
|
||||
m_wlsParticipantHandler = std::make_shared<WlsParticipantHandler>();
|
||||
m_wsHandler = std::make_shared<WebSocketHandler>();
|
||||
m_ismHandler = std::make_shared<IsmHandler>();
|
||||
m_wlsHandler = std::make_shared<WlsHandler>();
|
||||
|
||||
if (!m_ismHandler->init(this))
|
||||
return false;
|
||||
|
||||
if (!m_wlsHandler->init(m_wlsParticipantHandler.get(), // TODO: if using shared pointers, then *use* them
|
||||
m_wsHandler.get(),
|
||||
Settings::wlsListenPort()))
|
||||
return false;
|
||||
|
||||
if (!m_wsHandler->init(m_wlsHandler,
|
||||
m_wlsParticipantHandler,
|
||||
m_ismHandler,
|
||||
Settings::webSocketListenPort()))
|
||||
return false;
|
||||
m_wlsParticipantHandler->init(m_wsHandler.get(), // TODO: if using shared pointers, then *use* them
|
||||
m_wlsHandler.get());
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace WirelessLocationSystem
|
||||
Reference in new issue
Block a user