Lts/Common: drop the 17 submodules excluded from the RELEASE_BUILD branch of Lts/Common/CMakeLists.txt (CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation, LtsScriptTimeline, LtsSession, LtsTimeline, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets, TopicEditorBase). Only the 13 subdirectories actually built remain. TrainingAreaBase: drop sources of targets excluded by IF(NOT RELEASE_BUILD) / IF(BUILD_RTI) (svcTabClient, svcTabServer, svcTrainingAreaBase exe, RecordReplayPlugin customization) and the 7 plugin directories not added in the release path (AdlerJson, ApacheHlaJson, DebugJsonDir, HlaJson, Nmea, UAS, WlsTetra). Only tabTelegrams, svcTabCommon and the TetraJson plugin are compiled. Cross-checked: no kept compiled source includes headers from the removed modules (GuiPluginInterface - the only LtsWidgets consumer - is itself NOT RELEASE_BUILD-guarded).
84 lines
2.1 KiB
C++
Executable File
84 lines
2.1 KiB
C++
Executable File
|
|
|
|
|
|
#include "main_dispatcher.h"
|
|
#include "main_handler_tx.h"
|
|
#include "hla_dispatcher.h"
|
|
#include "hla_handler_tx.h"
|
|
#include <nglsettings/nglsettings_settings.h>
|
|
#include <QtCore/QTimer>
|
|
|
|
namespace ApHlaJson
|
|
{
|
|
MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
|
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &recvFromTabCb,
|
|
const std::shared_ptr<TrainingAreaBase::TxMixin> &sendToTab,
|
|
NGL::Settings *settings)
|
|
: m_hlaDispatcher(nullptr)
|
|
, m_recvFromTabCb(recvFromTabCb)
|
|
, m_sendToTab(sendToTab)
|
|
, m_mainHandlerTx(nullptr)
|
|
, m_pdp(pdp)
|
|
, m_settings(settings)
|
|
, m_domainId(pdp->domainId())
|
|
, m_exerciseId(pdp->exerciseId())
|
|
{
|
|
INFO_LOG(m_logger) << "ApHla started, Domain Id: " << m_domainId << " ExerciseId: " << m_exerciseId;
|
|
}
|
|
|
|
MainDispatcher::~MainDispatcher()
|
|
{
|
|
m_mainHandlerTx = nullptr;
|
|
m_recvFromTabCb = nullptr;
|
|
m_ddsHandler = nullptr;
|
|
m_ppmHandler = nullptr;
|
|
m_pdmHandler = nullptr;
|
|
m_aesHandler = nullptr;
|
|
delete m_hlaDispatcher;
|
|
}
|
|
|
|
bool MainDispatcher::init()
|
|
{
|
|
m_ddsHandler = std::make_shared<DdsHandler>(m_domainId, m_exerciseId);
|
|
if (!m_ddsHandler->init())
|
|
return false;
|
|
|
|
m_pdmHandler = std::make_shared<PdmHandler>();
|
|
|
|
m_pdmHandler->init(this);
|
|
|
|
m_ppmHandler = std::make_shared<PpmHandler>();
|
|
|
|
m_ppmHandler->init(this);
|
|
|
|
m_aesHandler = std::make_shared<AesHandler>();
|
|
|
|
m_aesHandler->init(this);
|
|
|
|
m_hlaDispatcher = new HlaDispatcher(m_pdp, m_recvFromTabCb, m_sendToTab, m_settings, m_ppmHandler, m_pdmHandler, m_aesHandler);
|
|
m_mainHandlerTx = std::make_shared<MainHandlerTx>(std::dynamic_pointer_cast<HlaHandlerTx>(m_hlaDispatcher->sendToTab()));
|
|
m_hlaDispatcher->init();
|
|
|
|
m_hlaDispatcher->connectWebsocket();
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
std::shared_ptr<TrainingAreaBase::SendToTab> MainDispatcher::sendToTab()
|
|
{
|
|
return std::static_pointer_cast<TrainingAreaBase::SendToTab>(m_mainHandlerTx);
|
|
}
|
|
|
|
bool MainDispatcher::canSendData() const
|
|
{
|
|
return m_hlaDispatcher->canSendData();
|
|
}
|
|
|
|
void MainDispatcher::exerciseChanged()
|
|
{
|
|
m_hlaDispatcher->exerciseChanged();
|
|
}
|
|
|
|
}
|