Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -1,15 +1,21 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hanna E. Rathje, SLSE, 2015-09-02
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace Buildings
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
@@ -31,10 +37,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
m_ddsDts = Buildings::Interface::Dts::create(m_ddsConnector);
|
||||
@@ -46,7 +52,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_dtcPdm = ProjectDataManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
|
||||
bool bRet = m_ddsDts->enableAll();
|
||||
|
||||
// m_ddsDts->enableRelayInfos();
|
||||
DEBUG_LOG(m_logger) << "Dts initialised";
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
@@ -61,4 +67,4 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return bRet;
|
||||
}
|
||||
|
||||
}
|
||||
} // Namespace PDM
|
||||
@@ -1,16 +1,23 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for Buildings
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
|
||||
namespace Buildings
|
||||
{
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -30,7 +37,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "WebSocketInterfaceHandler initialized Port=" << m_webSocketHandler->listenPort();
|
||||
m_ddsHandler->pacemaker()->addPort(m_webSocketHandler->listenPort(), Core::CorePortType::WebSocketServer);
|
||||
m_ddsHandler->pacemaker()->addPort(m_webSocketHandler->listenPort(), Core::PortType::WebSocketServer);
|
||||
|
||||
if (bRet)
|
||||
{
|
||||
@@ -59,7 +66,7 @@ bool MainHandler::initInternal(int domainId, int exerciseId)
|
||||
}
|
||||
INFO_LOG(m_logger) << "DbHandler initialized";
|
||||
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
return false;
|
||||
@@ -82,7 +89,7 @@ bool MainHandler::initInternal(int domainId, int exerciseId)
|
||||
if (!m_relayInfoHandler->init())
|
||||
return false;
|
||||
|
||||
|
||||
// WebSocketServer
|
||||
m_webSocketHandler = std::make_shared<WebSocketHandler>(m_bcHandler,this);
|
||||
|
||||
if (!m_webSocketHandler->init(Settings::getWebSocketServerPortRange(1)))
|
||||
@@ -122,4 +129,4 @@ std::shared_ptr<DatabaseInterface> MainHandler::db() const
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace Buildings
|
||||
@@ -1,5 +1,10 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for CombatNetRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Fritsche, SLSE, 2017-09-05
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
@@ -7,20 +12,21 @@
|
||||
#include <AudioVideoManagement/avm_ftc.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <InfrastructureManagement/ism_dtc.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace CombatNetRadio
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Global))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION;
|
||||
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
@@ -28,10 +34,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker.reset(new Core::Pacemaker(m_ddsConnector));
|
||||
|
||||
m_asmDtc = AssetManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
@@ -73,4 +79,4 @@ dds::domain::DomainParticipant DdsHandler::domainParticipant() const
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // Namespace CombatNetRadio
|
||||
@@ -1,12 +1,17 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for CombatNetRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Fritsche, SLSE, 2017-09-05
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "dds_handler.h"
|
||||
#include "active_exercises.h"
|
||||
#include "exercise_manager.h"
|
||||
#include "WebSocketInterface/websocket_interface_handler.h"
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
using namespace CombatNetRadio;
|
||||
|
||||
@@ -19,7 +24,7 @@ MainHandler::~MainHandler() = default;
|
||||
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION;
|
||||
|
||||
m_ddsHandler.reset(new DdsHandler(domainId));
|
||||
if (!m_ddsHandler->init())
|
||||
@@ -41,7 +46,7 @@ bool MainHandler::init(int domainId)
|
||||
}
|
||||
|
||||
m_ddsHandler->enableDtcs();
|
||||
|
||||
// Remove all Entries
|
||||
m_exerciseManager->onClientConnectionClosed(0);
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hanna E. Rathje, SLSE, 2015-09-02
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
@@ -7,7 +12,7 @@
|
||||
#include "cmo_fts.h"
|
||||
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_dtc.h>
|
||||
|
||||
@@ -16,6 +21,7 @@ namespace ComponentMonitor
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Global, exerciseId))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
@@ -31,14 +37,14 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_dtsCurrentRunningState.reset(m_ddsConnector->createDTS<DTS::CurrentRunningStateImpl>());
|
||||
assert(m_dtsCurrentRunningState.get());
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
m_ddsDts = ComponentMonitor::Interface::Dts::create(m_ddsConnector);
|
||||
@@ -52,17 +58,17 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
m_ismDtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
|
||||
|
||||
|
||||
// TODO: call at the end of main_handler init:
|
||||
//m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
void DdsHandler::enableDtcs()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " START Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
m_ismDtc->enableInstrumentationAsset();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " END Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Dtc> DdsHandler::ismDtc() const
|
||||
@@ -70,4 +76,4 @@ std::shared_ptr<InfrastructureManagement::Interface::Dtc> DdsHandler::ismDtc() c
|
||||
return m_ismDtc;
|
||||
}
|
||||
|
||||
}
|
||||
} // Namespace PDM
|
||||
@@ -1,10 +1,15 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hanna E. Rathje, SLSE, 2015-09-02
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/core_dts_types.h>
|
||||
#include <DDS/Core/core_dts_types.h>
|
||||
|
||||
#include <ComponentMonitor/cmo_dts.h>
|
||||
#include <ComponentMonitor/cmo_fts.h>
|
||||
@@ -53,7 +58,6 @@ public:
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Dtc> ismDtc() const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<DTS::CurrentRunningState> m_dtsCurrentRunningState;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
@@ -62,6 +66,10 @@ private:
|
||||
std::shared_ptr<ComponentMonitor::Interface::Fts> m_ddsFts;
|
||||
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc;
|
||||
|
||||
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace ComponentMonitor
|
||||
@@ -1,33 +1,39 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for AssetManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "initialization.h"
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <ngldb/db_service_handler.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace ComponentMonitor
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
m_cmoService = nullptr;
|
||||
m_ddsHandler = nullptr;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
}
|
||||
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
|
||||
// initialize DDS
|
||||
const int excerciseId = 0;
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, excerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
@@ -38,8 +44,8 @@ bool MainHandler::init(int domainId)
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful.";
|
||||
|
||||
|
||||
|
||||
// Initialization:
|
||||
// Keep in mind: ComponentMonitor::Initialization::run() is executed with a delay
|
||||
m_cmoService = std::make_shared<ComponentMonitor::Initialization>();
|
||||
if (!m_cmoService->initialize(m_ddsHandler))
|
||||
{
|
||||
@@ -52,4 +58,4 @@ bool MainHandler::init(int domainId)
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace ComponentMonitor
|
||||
@@ -1,18 +1,24 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for VideoOverlayManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-07-06
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace DifferentialGPS
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Global))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
@@ -25,15 +31,15 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher only
|
||||
m_ddsConnector->initPublisher();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
return true;
|
||||
}
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
}
|
||||
} // Namespace DifferentialGPS
|
||||
@@ -1,14 +1,17 @@
|
||||
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "mainthread.h"
|
||||
|
||||
#include "tetra_if_impl.h"
|
||||
#include "trimble_if.h"
|
||||
|
||||
#include <QtCore/QMutexLocker>
|
||||
#include <QtCore/QTimer>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <QMutexLocker>
|
||||
#include <QTimer>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace DifferentialGPS
|
||||
{
|
||||
@@ -18,6 +21,7 @@ MainThread::MainThread(QObject *parent)
|
||||
, m_dgpsTimer(new QTimer(this))
|
||||
, m_tetraIfNum(0)
|
||||
, m_trimbleIfNum(0)
|
||||
, m_logger(getLogger("MainThread"))
|
||||
, m_broadcastTime(QTime::currentTime())
|
||||
, m_broadcastCycle_ms(10000)
|
||||
{
|
||||
@@ -75,7 +79,7 @@ bool MainThread::init(int domainId)
|
||||
|
||||
void MainThread::addNewData(const QByteArray &ba, int trimbleIfNum)
|
||||
{
|
||||
const int cycle_ms = m_broadcastCycle_ms + (m_broadcastCycle_ms / 5);
|
||||
const int cycle_ms = m_broadcastCycle_ms + (m_broadcastCycle_ms / 5); // Zykluszeit + 20%
|
||||
QTime currentTime = QTime::currentTime();
|
||||
|
||||
bool overtake = (trimbleIfNum == m_trimbleIfNum);
|
||||
@@ -84,7 +88,7 @@ void MainThread::addNewData(const QByteArray &ba, int trimbleIfNum)
|
||||
if (m_broadcastTime.msecsTo(currentTime) > cycle_ms)
|
||||
{
|
||||
overtake = true;
|
||||
m_trimbleIfNum = trimbleIfNum;
|
||||
m_trimbleIfNum = trimbleIfNum; // Lese ab jetzt bevorzugt von diesem IF
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +110,7 @@ void MainThread::addNewData(const QByteArray &ba, int trimbleIfNum)
|
||||
m_tetraIF[m_tetraIfNum]->startThread(m_tetraIfNum, this);
|
||||
}
|
||||
|
||||
m_broadcastTime = currentTime;
|
||||
m_broadcastTime = currentTime; // Die Broadcast-Zeit merken
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,4 +124,4 @@ bool MainThread::getNewData(QByteArray &ba)
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // namespace DifferentialGPS
|
||||
@@ -1,5 +1,10 @@
|
||||
|
||||
|
||||
/**
|
||||
* Initialization for GuezNasat
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by hjl, SLSE, 2016-11-14
|
||||
*/
|
||||
|
||||
#include "initialization.h"
|
||||
#include "settings.h"
|
||||
@@ -14,9 +19,9 @@
|
||||
#include <GuezNasat/gna_db.h>
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QTimer>
|
||||
|
||||
namespace GuezNasat
|
||||
{
|
||||
@@ -24,8 +29,8 @@ namespace GuezNasat
|
||||
Initialization::Initialization()
|
||||
: m_logger(getLogger("Initialization"))
|
||||
{
|
||||
}
|
||||
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Initialization::~Initialization()
|
||||
{
|
||||
@@ -37,15 +42,15 @@ Initialization::~Initialization()
|
||||
m_handlerParticipant = nullptr;
|
||||
m_ddsHandler = nullptr;
|
||||
m_dbHandler = nullptr;
|
||||
}
|
||||
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector,
|
||||
const QSqlDatabase &)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Start GuezNasat Initialization.";
|
||||
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(ddsConnector);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
@@ -53,31 +58,31 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// initialize database, we need an own DB connection
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(ddsConnector->getPartitionId(), Settings::settings()))
|
||||
|
||||
// if (!m_dbHandler->init(ddsConnector->getPartitionId(), sqlDb))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation DbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// create HandlerNasatAircraft
|
||||
m_handlerNasatAircraft.reset(new HandlerNasatAircraft(this));
|
||||
|
||||
|
||||
// create HandlerNasatAircraftParticipant
|
||||
m_handlerNasatAircraftParticipant.reset(new HandlerNasatAircraftParticipant(this));
|
||||
|
||||
|
||||
// create HandlerNasatNineLiner
|
||||
m_handlerNasatNineLiner.reset(new HandlerNasatNineLiner(this));
|
||||
|
||||
|
||||
// create HandlerNasatAircraftParticipant
|
||||
m_handlerNasatImpact.reset(new HandlerNasatImpact(this));
|
||||
|
||||
|
||||
// create ParticipantPositionPublisher
|
||||
m_handlerParticipant.reset(new HandlerParticipant(this));
|
||||
|
||||
|
||||
// Connection to NASAT
|
||||
if (Settings::useWebSocket())
|
||||
{
|
||||
INFO_LOG(m_logger) << "Using WebSocket";
|
||||
@@ -92,12 +97,12 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
|
||||
INFO_LOG(m_logger) << "GuezNasat Initialization initialized";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool Initialization::loadFromDatabase()
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << "START";
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << "START";
|
||||
|
||||
if (!m_ddsHandler ||
|
||||
!m_dbHandler ||
|
||||
@@ -135,12 +140,12 @@ bool Initialization::loadFromDatabase()
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// related to NLDEVCTRL-844: NASAT: Weiterleitung der Luftunterstützung sporadisch ausser Funktion
|
||||
// Waiting for all (relevant) exercises (AES) to be started, sounds better
|
||||
// But it´s complicated (some ServiceManagement topics would have to be considered)
|
||||
// 'AES process is started' is not enough, but when is the FTS available???
|
||||
// So accept a bailing out (in case of (re-)starting GNA while NASAT is sending data)
|
||||
// and keep it simple:
|
||||
#define START_DELAYED
|
||||
#ifdef START_DELAYED
|
||||
QTimer::singleShot(31000, m_jsonSocketHandler.get(), [this]() {
|
||||
@@ -156,7 +161,7 @@ bool Initialization::loadFromDatabase()
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketHandler failed.";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif // START_DELAYED
|
||||
|
||||
QObject::connect(m_jsonSocketHandler.get(), &AbstractSocketHandler::simulationStatusReceived,
|
||||
m_handlerNasatAircraft.get(), &HandlerNasatAircraft::simulationStatusChanged);
|
||||
@@ -171,7 +176,7 @@ bool Initialization::loadFromDatabase()
|
||||
QObject::connect(m_jsonSocketHandler.get(), &AbstractSocketHandler::nineLinerReceived,
|
||||
m_handlerNasatNineLiner.get(), &HandlerNasatNineLiner::nineLinerReceived);
|
||||
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << "END";
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << "END";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -180,4 +185,4 @@ std::shared_ptr<DatabaseInterface> Initialization::db() const
|
||||
return m_dbHandler->db();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace GuezNasat
|
||||
+15
-8
@@ -1,17 +1,24 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_exerciseHasHlaConnection(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_exerciseHasHlaConnection(false)
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -30,7 +37,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
@@ -55,4 +62,4 @@ void DdsHandler::onExerciseChanged(const ExerciseManagement::Exercise &ex, DataM
|
||||
emit exerciseHlaStateChanged(m_exerciseHasHlaConnection);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+11
-7
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/core_dts_types.h>
|
||||
#include <DDS/Core/core_dts_types.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
|
||||
#include <Common/logger.h>
|
||||
|
||||
@@ -32,14 +37,13 @@ public:
|
||||
Q_SIGNALS:
|
||||
void exerciseHlaStateChanged(bool bHlaEnabled);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onExerciseChanged(const ExerciseManagement::Exercise &ex, DataModification modType);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtcExm;
|
||||
bool m_exerciseHasHlaConnection;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+17
-10
@@ -1,21 +1,28 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include <Common/logger.h>
|
||||
#include "ngs_handler.h"
|
||||
#include "web_socket_handler.h"
|
||||
#include <Common/settings.h>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_exerciseId(0),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_exerciseId(0)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -26,7 +33,7 @@ MainHandler::~MainHandler()
|
||||
bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_exerciseId = exerciseId;
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
@@ -108,4 +115,4 @@ void MainHandler::onExerciseHlaStateChanged(bool bHlaEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+16
-9
@@ -1,17 +1,24 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_hlaIsActive(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_hlaIsActive(false)
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -30,7 +37,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
@@ -50,7 +57,7 @@ void DdsHandler::onExerciseChanged(const ExerciseManagement::Exercise &ex, DataM
|
||||
if (ex.id() != m_ddsConnector->getPartitionId())
|
||||
return;
|
||||
|
||||
|
||||
// HLA is active if ex.hasHlaInterface() && ex.state() == (Started || Paused):
|
||||
bool bHlaIsActive = ex.hasHlaInterface() &&
|
||||
(ex.state() == ExerciseManagement::ExerciseState::Started ||
|
||||
ex.state() == ExerciseManagement::ExerciseState::Paused);
|
||||
@@ -63,4 +70,4 @@ void DdsHandler::onExerciseChanged(const ExerciseManagement::Exercise &ex, DataM
|
||||
emit exerciseHlaStateChanged(m_hlaIsActive);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+11
-7
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/core_dts_types.h>
|
||||
#include <DDS/Core/core_dts_types.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
|
||||
#include <Common/logger.h>
|
||||
|
||||
@@ -33,14 +38,13 @@ public:
|
||||
Q_SIGNALS:
|
||||
void exerciseHlaStateChanged(bool bHlaEnabled);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onExerciseChanged(const ExerciseManagement::Exercise &ex, DataModification modType);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtcExm;
|
||||
bool m_hlaIsActive;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+17
-10
@@ -1,23 +1,30 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "ngs_handler.h"
|
||||
#include "web_socket_handler.h"
|
||||
#include "Common/identifierstruct.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include <Common/settings.h>
|
||||
#include <Common/logger.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_exerciseId(0),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_exerciseId(0)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -29,7 +36,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_exerciseId = exerciseId;
|
||||
IdentifierStruct::setOwnSiteId(exerciseId);
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
@@ -114,4 +121,4 @@ void MainHandler::onExerciseHlaStateChanged(bool bHlaEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+41
-21
@@ -1,23 +1,30 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for HighLevelArchitecture
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2017-04-07
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "ngs_handler.h"
|
||||
#include "web_socket_interface.h"
|
||||
#include "Common/identifierstruct.h"
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include <Common/settings.h>
|
||||
#include <Common/logger.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_exerciseId(0),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_exerciseId(0)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -27,29 +34,42 @@ MainHandler::~MainHandler()
|
||||
|
||||
bool MainHandler::init(int exerciseId)
|
||||
{
|
||||
NOTICE_LOG(m_logger) << Q_FUNC_INFO << ", exerciseId=" << exerciseId;
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << ", exerciseId=" << exerciseId;
|
||||
|
||||
m_exerciseId = 5;
|
||||
m_exerciseId = 5; // exerciseId;
|
||||
IdentifierStruct::setOwnSiteId(exerciseId);
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// NgsHandler
|
||||
//
|
||||
|
||||
/*
|
||||
if (!m_ngsHandler)
|
||||
{
|
||||
m_ngsHandler = std::make_shared<NgsHandler>();
|
||||
// connect(m_ngsHandler.get(), &NgsHandler::ngsHandlerReady,
|
||||
// m_wsHandler.get(), &WebSocketHandler::sendHlaConnectionState, Qt::UniqueConnection);
|
||||
if (!m_ngsHandler->init())
|
||||
{
|
||||
m_ngsHandler = nullptr;
|
||||
ERROR_LOG(m_logger) << "Could not init ngs - stopping application";
|
||||
QCoreApplication::quit();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// WsInterface
|
||||
//
|
||||
if (!m_wsInterface)
|
||||
{
|
||||
|
||||
// requests from ws will be sent to ngsHandler:
|
||||
m_wsInterface = std::make_shared<WsInterface>(m_ngsHandler, this);
|
||||
int port = 23456;
|
||||
if (!m_wsInterface->init(port))
|
||||
{
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION
|
||||
<< " WsInterface::init failed on port: " << port;
|
||||
return false;
|
||||
}
|
||||
@@ -64,4 +84,4 @@ bool MainHandler::isConnectedToHla() const
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace HighLevelArchitecture
|
||||
+185
-145
@@ -1,18 +1,23 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* AesHandler for AdlerJson Plugin
|
||||
* $Id: aes_handler.cpp 62899 2024-05-29 11:08:50Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#include "aes_handler.h"
|
||||
#include <utility>
|
||||
#include "Core/core_types.h"
|
||||
#include "DDS/Core/function_reply_object.h"
|
||||
#include "aes.hpp"
|
||||
#include "json_dispatcher.h"
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QPointF>
|
||||
#include <QtCore/QRectF>
|
||||
#include <QtCore/QString>
|
||||
#include <QtGui/QTransform>
|
||||
#include <QtCore/QVector>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QPointF>
|
||||
#include <QRectF>
|
||||
#include <QString>
|
||||
#include <QTransform>
|
||||
#include <QVector>
|
||||
|
||||
#include <time.h>
|
||||
#include <vector>
|
||||
@@ -31,6 +36,7 @@ namespace AdlerJson
|
||||
AesHandler::AesHandler(std::shared_ptr<TrainingAreaBase::Interface::Fts> ftsTab, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
, m_logger(getLogger("AesHandler"))
|
||||
{
|
||||
Q_UNUSED(ftsTab)
|
||||
}
|
||||
@@ -48,20 +54,20 @@ bool AesHandler::init(MainDispatcher *mainDispatcher)
|
||||
if (!m_ftcAes->enableAirSupportImpactModify() || !m_dtcAes->enableExplosionSingle())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not enableAirSupportImpactModify or enableExplosionSingle";
|
||||
|
||||
// return false;
|
||||
}
|
||||
|
||||
if (!m_dtcAes->enableExplosionCluster() || !m_ftcAes->enableExplosionClusterModify() || !m_ftcAes->enableExplosionClusterReleaseReceived()
|
||||
|| !m_ftcAes->enableExplosionClusterPauseResume() || !m_ftcAes->enableTrajectoryAdlerModify() || !m_ftcAes->enableEffectClusterFireHalt())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not enableExplosionCluster or enableExplosionClusterModify";
|
||||
|
||||
//
|
||||
}
|
||||
if (!m_dtcAes->enableEffectCluster() || !m_ftcAes->enableEffectClusterModify() || !m_ftcAes->enableEffectClusterReleaseReceived()
|
||||
|| !m_ftcAes->enableEffectClusterPauseResume() || !m_ftcAes->enableEffectClusterRemove())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not enableEffectnCluster or enableEffectClusterModify";
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "------ Connect Explosion Single Changed ------- ";
|
||||
@@ -88,13 +94,13 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
|
||||
|
||||
// If the error isn't a json object (we use this to reply the reference and party id, as the object is not on dds yet)
|
||||
// send an ExTq something went wront, either Data inconistencies or effector is alreaedy assigned.
|
||||
DEBUG_LOG(m_logger) << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated();
|
||||
ExTqTechnischeQuittung extq;
|
||||
extq.technischeDaten.beschreibung = replyObject.translated();
|
||||
extq.technischeDaten.status = Status_L32::DAT;
|
||||
|
||||
// I dont Like it.. as we might get two request at the same time.. overriding but should work most of the
|
||||
m_mainDispatcher->jsonDispatcher()->sendExTqTechnischeQuittung(extq, m_mainDispatcher->ppmHandler()->getDtc()->participant(m_participantId).partyId());
|
||||
return;
|
||||
}
|
||||
@@ -114,7 +120,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
|
||||
m_aesIdToFeuerkampfReferenz.insert(replyObject.id(), feuerkampfReferenz);
|
||||
NotificationManagement::CreateNotificationRequest req;
|
||||
|
||||
// The message of the Notification.
|
||||
QString content = QString::fromUtf8(tr_lts("Notification", "New Effect Cluster from SAA Verein= %1 <BR />[Open](//ExplosionGui/Adler/%2)"));
|
||||
QStringList argsList;
|
||||
argsList.append(m_wirkfeldPlanungsData.feuerkommando.verein);
|
||||
@@ -122,24 +128,24 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
|
||||
std::vector<std::string> args;
|
||||
args.reserve(argsList.size());
|
||||
for (const auto &str : std::as_const(argsList))
|
||||
for (const auto &str : qAsConst(argsList))
|
||||
args.emplace_back(str.toStdString());
|
||||
|
||||
req.notification().content(content.toStdString());
|
||||
req.notification().contentArgs(args);
|
||||
|
||||
// Which Exercise should parse the notification
|
||||
req.notification().exerciseId(m_mainDispatcher->exerciseId());
|
||||
|
||||
req.notification().timeStamp(m_mainDispatcher->ddsHandler()->partitionTime());
|
||||
|
||||
|
||||
// Priority: Highest: Klick Links immediatly
|
||||
// Priority: High: Show message Box
|
||||
req.notification().priority(NotificationManagement::Priority::High);
|
||||
|
||||
|
||||
// set priority after proccesed for all
|
||||
req.notification().processedPriority(NotificationManagement::Priority::Low);
|
||||
|
||||
//req.notification().title(tr_lts("Notification", "Wirkfeldplanung"));
|
||||
req.notification().title(tr_lts("Notification", "AES-Planning"));
|
||||
|
||||
// Who is the sender, most of the time a Service
|
||||
NotificationManagement::Address addressSender;
|
||||
addressSender.addressType(NotificationManagement::AddressType::Service);
|
||||
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByParty(partyId);
|
||||
@@ -148,16 +154,16 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
addressSender.name(saa->getSAAName().toStdString());
|
||||
}else
|
||||
{
|
||||
|
||||
// use Backup
|
||||
addressSender.name(QStringLiteral("TAB").toStdString());
|
||||
}
|
||||
req.notification().sender(addressSender);
|
||||
req.notification().notificationType(NotificationManagement::NotificationType::CombatOrder);
|
||||
req.notification().messageType(NotificationManagement::MessageType(NotificationManagement::MessageType::Success));
|
||||
|
||||
|
||||
// Notify all Adler User for Party
|
||||
std::vector<NotificationManagement::Address> recipentVec;
|
||||
|
||||
// Honestly... I don't know if this is the correct Right? but will do for now
|
||||
const QVector<int> recipientIds = m_mainDispatcher->ddsHandler()->dtcOpm()->getNotificationRecipents(m_mainDispatcher->exerciseId(),
|
||||
partyId,
|
||||
OperatorRights::AdlerExplosionClusterEdit,
|
||||
@@ -165,7 +171,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
std::vector<NotificationManagement::Address> recipientIdsDds;
|
||||
recipientIdsDds.reserve(recipientIds.size());
|
||||
|
||||
for (const auto &recipientId : std::as_const(recipientIds))
|
||||
for (const auto &recipientId : qAsConst(recipientIds))
|
||||
{
|
||||
NotificationManagement::Address addr;
|
||||
addr.addressId(recipientId);
|
||||
@@ -182,7 +188,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
}
|
||||
else
|
||||
WARNING_LOG(m_logger) << "No recipent found for exercise";
|
||||
|
||||
// sendTrajectoryAdlerModifyRequest(m_wirkfeldPlanungsData, m_participantId, m_wirkmittelIndex, m_aesId);
|
||||
}
|
||||
|
||||
void AesHandler::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
@@ -262,15 +268,22 @@ void AesHandler::handleEXFire(const Feuerkampfdaten &data, int wsId)
|
||||
outData.equipmentNumber() = particpantId;
|
||||
outData.reference() = data.feuerkampfReferenz.toStdString();
|
||||
outData.identifier() = data.verein.toStdString();
|
||||
outData.effectorId() = data.kenner.underlying();
|
||||
outData.effectorId() = data.kenner.underlying(); // static_cast<L27_EffectorId_def>((int)data.kenner);
|
||||
m_ddsHandler->dtsTab()->publish(outData);
|
||||
QTimer::singleShot(3000, [this, particpantId]() { m_ddsHandler->dtsTab()->removeEX_FireByKey(particpantId); });
|
||||
|
||||
const QString refTrimmed = data.feuerkampfReferenz.trimmed();
|
||||
handleAmmoCount(data, saa->getPartyId(), m_feuerkampfReferenzUsedFeuerHalt[refTrimmed]);
|
||||
|
||||
|
||||
// This is for pause Resume
|
||||
/*
|
||||
m_ftcAes->explosionClusterPauseResumeRequest(AreaEffectSimulation::ExplosionClusterPauseResumeRequest(aes.id(),
|
||||
false, // resumeExecution
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
dds::core::optional<int32_t>())
|
||||
, this);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
|
||||
@@ -286,8 +299,8 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
|
||||
<< "feuerkampfReferenz: " << data.feuerkampfReferenz;
|
||||
|
||||
handleAmmoCount(data, saa->getPartyId(), true);
|
||||
|
||||
|
||||
// The EX-FQ(nFN) message is used to count shots during a General CEASE FIRE or a Referenced CEASE FIRE.
|
||||
// After the CEASE FIRE is lifted, the remaining shots are transmitted again using an EX-FQ(FN) message.
|
||||
|
||||
const QString refTrimmed = data.feuerkampfReferenz.trimmed();
|
||||
m_feuerkampfReferenzUsedFeuerHalt[refTrimmed] = true;
|
||||
@@ -302,18 +315,18 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r
|
||||
ERROR_LOG(m_logger) << reply.translated();
|
||||
if (m_wirkmittelIndex == m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1)
|
||||
{
|
||||
|
||||
// TODO TAB->SAA EX-MQ
|
||||
DEBUG_LOG(m_logger) << "TAB->SAA EX-MQ"
|
||||
<< ", feuerkampfReferenz :" << m_wirkfeldPlanungsData.feuerkampfReferenz;
|
||||
|
||||
DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply " << reply.id();
|
||||
ExFeuerbereit exFB;
|
||||
|
||||
// exFB.feuerkampfdaten.feuerkampfReferenz = QString::fromStdString(data.element());
|
||||
exFB.feuerkampfdaten.feuerkampfReferenz = m_wirkfeldPlanungsData.feuerkampfReferenz;
|
||||
|
||||
// exFB.feuerkampfdaten.verein = QString::fromStdString(m_dtcPpm->participant(data.participantId().get()).name());
|
||||
exFB.feuerkampfdaten.verein = m_wirkfeldPlanungsData.feuerkommando.verein;
|
||||
|
||||
|
||||
// exFB.feuerkampfdaten.kenner =
|
||||
// m_mainDispatcher->jsonDispatcher()->sendExFeuerbereit(exFB, data.partyId().get());
|
||||
}
|
||||
if (m_wirkmittelIndex < m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1)
|
||||
{
|
||||
@@ -336,7 +349,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
QVector<int> subordinates = m_dtcPpm->getSubordinatesByParticipant(participantId);
|
||||
QVector<ParticipantManagement::ParticipantPosition> subordinatePositions;
|
||||
|
||||
for (int subordinate : std::as_const(subordinates))
|
||||
for (int subordinate : qAsConst(subordinates))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "subordinates(" << participantId << ") :" << subordinate;
|
||||
subordinatePositions.append(m_dtcPpm->participantPosition(subordinate));
|
||||
@@ -352,35 +365,46 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
|
||||
double grad = (data.zieldaten.zielachse / 6400.) * 360.0;
|
||||
|
||||
for (Flugbahnpunkt pos : std::as_const(data.feuerkommando.wirkmittel.at(wirkmittelIndex).flugbahnpunkt))
|
||||
for (Flugbahnpunkt pos : qAsConst(data.feuerkommando.wirkmittel.at(wirkmittelIndex).flugbahnpunkt))
|
||||
{
|
||||
|
||||
|
||||
/*
|
||||
DEBUG_LOG(m_logger) << "Flugbahnpunkt:"
|
||||
<< ", xRelativ :" << pos.xRelativ
|
||||
<< ", yRelativ :" << pos.yRelativ
|
||||
<< ", zRelativ :" << pos.zRelativ
|
||||
<< ", zeit :" << pos.zeit
|
||||
<< ", positionLaunch :" << positionLaunch.lon()
|
||||
<< " / " << positionLaunch.lat()
|
||||
<< " / " << positionLaunch.z()
|
||||
<< "<< utmLaunch :" << utmLaunch.x
|
||||
<< " / " << utmLaunch.y
|
||||
<< " / " << utmLaunch.zone;
|
||||
*/
|
||||
QPointF utm = QPointF(pos.xRelativ, pos.zRelativ);
|
||||
QPointF utmLaunchPt(utmLaunch.x, utmLaunch.y);
|
||||
|
||||
utm += utmLaunchPt;
|
||||
double z = positionLaunch.z() + pos.yRelativ;
|
||||
|
||||
|
||||
// see also: coordtrans_test::testRelativeMetricalOffet()
|
||||
LtsCoordTrans::UtmCoordinate utmCoord;
|
||||
utmCoord.x = utm.x();
|
||||
utmCoord.y = utm.y();
|
||||
utmCoord.zone = utmLaunch.zone;
|
||||
QPointF pntGeo = utmCoord.geographic();
|
||||
|
||||
|
||||
|
||||
|
||||
// Rotiert im Uhrzeigersinn um den Nullpunkt (0,0)
|
||||
// double grad = (data.zieldaten.zielachse / 6400.) * 360;
|
||||
// DEBUG_LOG(m_logger) << " milli rad to degree" <<(data.zieldaten.zielachse / 6400.) * 360;
|
||||
|
||||
|
||||
|
||||
// Rotiert im Uhrzeigersinn um den Nullpunkt (0,0)
|
||||
// DEBUG_LOG(m_logger) << " mmilirad: " <<data.zieldaten.zielachse;
|
||||
|
||||
|
||||
|
||||
|
||||
// double shussrichtung = effectorAdler.schussrichtung;
|
||||
// DEBUG_LOG(m_logger) << " millii rad to degree" <<grad;
|
||||
// use defatult degree from start to end! not target axis
|
||||
|
||||
|
||||
// double shussrichtung = effectorAdler.schussrichtung;
|
||||
QTransform matrix;
|
||||
matrix.rotate(-grad);
|
||||
|
||||
@@ -393,12 +417,12 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
pntGeo.setX(rotatePoint.x());
|
||||
pntGeo.setY(rotatePoint.y());
|
||||
|
||||
|
||||
|
||||
|
||||
// DEBUG_LOG(m_logger) << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone
|
||||
// << ", utmCoord.isValid() :" << utmCoord.isValid()
|
||||
// << ", pntGeo :" << pntGeo.x() << " / " << pntGeo.y() << " / " << z;
|
||||
|
||||
|
||||
|
||||
// LS-669: Soweit ich das sehen kann, müssen hier relative Koordinaten übertragen werden.
|
||||
const Core::RelativePositionRelativeTime relPos(pntGeo.x(), pntGeo.y(), z,
|
||||
std::round(pos.zeit * 1000.0));
|
||||
geometryRef.emplace_back(relPos);
|
||||
@@ -430,44 +454,44 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)"
|
||||
<< ", feuerkampfReferenz :" << data.feuerkampfReferenz << ", wirkmittel.size() :" << data.feuerkommando.wirkmittel.size();
|
||||
|
||||
// here we convert the FQBB to create EffectCluster
|
||||
if (!m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return";
|
||||
return;
|
||||
}
|
||||
const QString &verein = data.feuerkommando.verein;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// #ifdef LTS_DEBUG
|
||||
// const ParticipantManagement::Participant &part = m_dtcPpm->participant(89);
|
||||
// DEBUG_LOG(m_logger) << "participantId :" << part.id()
|
||||
// << ", partyId :" << part.partyId();
|
||||
// #else
|
||||
const int partyId = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId)->getPartyId();
|
||||
const bool isVerbund = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId)->getIsVerbund();
|
||||
const ParticipantManagement::Participant &part = m_mainDispatcher->ppmHandler()->findParticipantByInternalName(verein, partyId, isVerbund);
|
||||
|
||||
// #endif
|
||||
if (part.id() <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got EffectClusterData for " << verein << " but unit not found";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// get overall impacts
|
||||
m_wirkfeldPlanungsData = data;
|
||||
m_participantId = part.id();
|
||||
m_wirkmittelIndex = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// for (const auto &wm : data.feuerkommando.wirkmittel)
|
||||
// {
|
||||
// impactCount += wm.geschoss.anzahl;
|
||||
// mhpCount ++; //TODO we could get the correct point
|
||||
// //chargeTypeId = // TODO MAP wm.geschoss.geschosssorte
|
||||
// sendTrajectoryAdlerModifyRequest(data, part.id(), mhpCount);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// The worst part about the SAA we don't even get all the data needed to create a usefull effect cluster.
|
||||
// Sometimes we will get a geometry (e.g. for mortar) but most of the time the "Target area" is lost
|
||||
// in that case we need to create our own area from the target points.. and probably "guess" the target geometry
|
||||
|
||||
AreaEffectSimulation::AesExplosionGeometry geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
AreaEffectSimulation::Area area;
|
||||
@@ -477,7 +501,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
if (!createArea && data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Point)
|
||||
{
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
|
||||
// we need to set the area from pdm so we use the first actors charge type
|
||||
const auto &chargeData = data.feuerkommando.wirkmittel.at(0).geschoss;
|
||||
|
||||
const int chargeTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(chargeData.geschosssorte);
|
||||
@@ -492,27 +516,31 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
if (!createArea && data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Radial)
|
||||
{
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgRadial;
|
||||
|
||||
// In Radial we need to double the radius and also set it as height/width
|
||||
area.height(data.zieldaten.breiteRadius * 2);
|
||||
area.width(data.zieldaten.breiteRadius * 2);
|
||||
}
|
||||
else if (!createArea)
|
||||
else if (!createArea) // we need the rect or the line
|
||||
{
|
||||
|
||||
|
||||
// maye wrong?
|
||||
// not only maybe.. we need to swap .. yes..
|
||||
area.height(data.zieldaten.breiteRadius);
|
||||
area.width(data.zieldaten.tiefe);
|
||||
if (data.zieldaten.tiefe > 0)
|
||||
area.width(data.zieldaten.tiefe);
|
||||
else
|
||||
if (data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Linear)
|
||||
area.width(5); // E01562-472 [Verbund] ImpactWidth invalid. Ein Wirkfeld mit der Zielgeometrie "Linear" kann nicht verarbeitet werden.
|
||||
}
|
||||
|
||||
if (!createArea)
|
||||
{
|
||||
area.rotation((data.zieldaten.zielachse / 6400.) * 360);
|
||||
area.rotation((data.zieldaten.zielachse / 6400.) * 360); // UTM STRICH?
|
||||
|
||||
|
||||
// point is center
|
||||
const QPointF centerPoint(data.zieldaten.koordinate.koordinate.longitude * (M_PI / 180.0), data.zieldaten.koordinate.koordinate.latitude * (M_PI / 180.0));
|
||||
QRectF rect(QPointF(), QSizeF(area.height(), area.width()));
|
||||
rect.moveCenter(QPointF());
|
||||
|
||||
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
|
||||
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
DEBUG_LOG(m_logger) << "centerUtm="
|
||||
@@ -539,7 +567,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
DEBUG_LOG(m_logger) << " Need to generate area SINGLE";
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
|
||||
|
||||
// we need to set the area from pdm so we use the first actors charge type
|
||||
|
||||
const auto &wirkmittel = data.feuerkommando.wirkmittel.at(0);
|
||||
const auto &chargeData = wirkmittel.geschoss;
|
||||
@@ -553,12 +581,12 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
area.height(impactRadius * 2);
|
||||
area.width(impactRadius * 2);
|
||||
|
||||
|
||||
// point is center
|
||||
|
||||
const QPointF centerPoint(wirkmittel.auftreffpunkt.koordinate.longitude * (M_PI / 180.0), wirkmittel.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
|
||||
QRectF rect(QPointF(), QSizeF(area.height(), area.width()));
|
||||
rect.moveCenter(QPointF());
|
||||
|
||||
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
|
||||
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
DEBUG_LOG(m_logger) << "centerUtm="
|
||||
@@ -580,10 +608,10 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << " Need to generate area AREA";
|
||||
|
||||
// Area even though thez might all target the same point
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
|
||||
|
||||
// Now we take the charge data from the first effector
|
||||
// we need the impactradius to create an area
|
||||
const auto &chargeData = data.feuerkommando.wirkmittel.at(0).geschoss;
|
||||
const int chargeTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(chargeData.geschosssorte);
|
||||
const int igniterTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(chargeData.zuender);
|
||||
@@ -592,14 +620,14 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
|
||||
|
||||
// Now that we know the impact radius we create a boundingbox around all impact areas
|
||||
QList<AreaEffectSimulation::Area> areas;
|
||||
QList<QRectF> rects;
|
||||
int zone = 0;
|
||||
QVector<QPointF> vecPoints;
|
||||
for (const WirkmittelFeuerkommando &effector : std::as_const(data.feuerkommando.wirkmittel))
|
||||
for (const WirkmittelFeuerkommando &effector : qAsConst(data.feuerkommando.wirkmittel))
|
||||
{
|
||||
|
||||
// get the target point for the effector
|
||||
const QPointF centerPoint(effector.auftreffpunkt.koordinate.longitude * (M_PI / 180.0), effector.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
|
||||
|
||||
AreaEffectSimulation::Area areaEffector;
|
||||
@@ -608,7 +636,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
QRectF rect(QPointF(), QSizeF(areaEffector.height(), areaEffector.width()));
|
||||
rect.moveCenter(QPointF());
|
||||
|
||||
|
||||
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
|
||||
const QPointF bl = QTransform().rotate(90).map(rect.topLeft());
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
@@ -617,7 +645,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
areaEffector.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
|
||||
|
||||
rect.moveCenter(QPointF(centerUtm.x, centerUtm.y));
|
||||
|
||||
// now add Area to list
|
||||
areas.append(areaEffector);
|
||||
rects.append(rect);
|
||||
vecPoints.append(rect.topLeft());
|
||||
@@ -626,29 +654,29 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
vecPoints.append(rect.bottomRight());
|
||||
}
|
||||
|
||||
|
||||
// Finally use the rerturning rect as Area
|
||||
area = createMinimumRect(zone, vecPoints);
|
||||
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
}
|
||||
else if (data.feuerkommando.wirkmittelRakete.size() > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " Need to generate area AREA";
|
||||
|
||||
// Area even though thez might all target the same point
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
|
||||
|
||||
// Now we take the charge data from the first effector
|
||||
// we need the impactradius to create an area
|
||||
const auto &chargeData = data.feuerkommando.wirkmittelRakete.at(0).geschoss;
|
||||
const int chargeTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(chargeData.geschosssorte);
|
||||
const int igniterTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(chargeData.zuender);
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
|
||||
// Now that we know the impact radius we create a boundingbox around all impact areas
|
||||
int zone = 0;
|
||||
QVector<QPointF> vecPoints;
|
||||
for (const WirkmittelFeuerkommandoRakete &effector : std::as_const(data.feuerkommando.wirkmittelRakete))
|
||||
for (const WirkmittelFeuerkommandoRakete &effector : qAsConst(data.feuerkommando.wirkmittelRakete))
|
||||
{
|
||||
for (const Treffpunkt &treffpunkt : std::as_const(effector.treffpunkte))
|
||||
for (const Treffpunkt &treffpunkt : qAsConst(effector.treffpunkte))
|
||||
{
|
||||
const QPointF centerPoint(treffpunkt.koordinate.koordinate.longitude * (M_PI / 180.0), treffpunkt.koordinate.koordinate.latitude * (M_PI / 180.0));
|
||||
|
||||
@@ -658,7 +686,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
QRectF rect(QPointF(), QSizeF(areaEffector.height(), areaEffector.width()));
|
||||
rect.moveCenter(QPointF());
|
||||
|
||||
|
||||
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
|
||||
const QPointF bl = QTransform().rotate(90).map(rect.topLeft());
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
@@ -667,7 +695,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
areaEffector.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
|
||||
|
||||
rect.moveCenter(QPointF(centerUtm.x, centerUtm.y));
|
||||
|
||||
// now add Area to list
|
||||
vecPoints.append(rect.topLeft());
|
||||
vecPoints.append(rect.topRight());
|
||||
vecPoints.append(rect.bottomLeft());
|
||||
@@ -675,7 +703,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Finally use the returning rect as Area
|
||||
area = createMinimumRect(zone, vecPoints);
|
||||
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
}
|
||||
@@ -684,7 +712,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
AreaEffectSimulation::EffectClusterModifyRequest req;
|
||||
for (const AreaEffectSimulation::EffectCluster &clus : m_dtcAes->effectClusters())
|
||||
{
|
||||
|
||||
// ERROR_LOG(m_logger) << "Look for if: " << clus.element() << " is data: " << data.feuerkampfReferenz;
|
||||
if (clus.partyId() != part.partyId())
|
||||
continue;
|
||||
if (clus.isDeleted())
|
||||
@@ -704,19 +732,19 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
obj[QStringLiteral("useReceived")] = true;
|
||||
obj[QStringLiteral("effectSource")] = ProjectDataManagement::EffectSource::ES_ADLER;
|
||||
obj[AdlerJson::JsonKeys::ABFEUERUNGSART()] = static_cast<int>(data.abfeuerungsArt);
|
||||
|
||||
// TargetData is often only optional
|
||||
obj[AdlerJson::JsonKeys::TYP()] = m_mainDispatcher->pdmHandler()->getDtc()->getTargetTypeIdFromAdlerTargetType(data.zieldaten.typ);
|
||||
obj[AdlerJson::JsonKeys::SUB_TYP()] = m_mainDispatcher->pdmHandler()->getDtc()->getTargetSubTypeIdFromAdlerTargetSubType(data.zieldaten.subTyp);
|
||||
obj[AdlerJson::JsonKeys::ELEMENTE()] = data.zieldaten.elemente;
|
||||
obj[AdlerJson::JsonKeys::NUMMER()] = data.zieldaten.nummer;
|
||||
|
||||
obj[QStringLiteral("partyId")] = part.partyId();
|
||||
|
||||
// fill EffectorData
|
||||
std::vector<AreaEffectSimulation::EffectorData> effectorVec;
|
||||
|
||||
if (data.feuerkommando.wirkmittel.size() > 0)
|
||||
{
|
||||
for (const auto &effectorAdler : std::as_const(data.feuerkommando.wirkmittel))
|
||||
for (const auto &effectorAdler : qAsConst(data.feuerkommando.wirkmittel))
|
||||
{
|
||||
AreaEffectSimulation::EffectorData effectorData;
|
||||
effectorData.angleOfFall() = 0;
|
||||
@@ -750,10 +778,10 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
DEBUG_LOG(m_logger) << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
|
||||
for (const auto &flightPointAdler : std::as_const(effectorAdler.flugbahnpunkt))
|
||||
for (const auto &flightPointAdler : qAsConst(effectorAdler.flugbahnpunkt))
|
||||
{
|
||||
Core::RelativePositionRelativeTime flightPoint;
|
||||
flightPoint.offsetX() = 0;
|
||||
flightPoint.offsetX() = 0; // flightPointAdler.zRelativ;
|
||||
flightPoint.offsetY() = flightPointAdler.xRelativ;
|
||||
flightPoint.offsetZ() = flightPointAdler.yRelativ;
|
||||
flightPoint.relativeTime() = flightPointAdler.zeit * 1000;
|
||||
@@ -773,7 +801,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
}
|
||||
effectorData.trajectoryRelative() = flightCurve;
|
||||
effectorData.flightTime() = effectorAdler.flugzeit * 1000;
|
||||
effectorData.chargeStruct().igniterTypeId() = 1;
|
||||
effectorData.chargeStruct().igniterTypeId() = 1; // effectorAdler.geschoss.zuender; //XKCD
|
||||
effectorData.interval() = effectorAdler.geschoss.intervall;
|
||||
Core::GeoPosition mhpPos;
|
||||
mhpPos.lat() = effectorAdler.auftreffpunkt.koordinate.latitude * (M_PI / 180.0);
|
||||
@@ -791,14 +819,14 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.peakHeight() = effectorAdler.gipfelhoehe;
|
||||
effectorVec.push_back(effectorData);
|
||||
|
||||
|
||||
// We will override with the last one but okay should be suffice
|
||||
obj[AdlerJson::JsonKeys::LADUNG()] = m_mainDispatcher->pdmHandler()->getDtc()->getLoadTypeIdFromAdlerLoad(effectorAdler.geschoss.ladung);
|
||||
obj[AdlerJson::JsonKeys::LADUNGSNUMMER()] = effectorAdler.geschoss.ladungsNummer;
|
||||
}
|
||||
}
|
||||
else if (data.feuerkommando.wirkmittelRakete.size() > 0)
|
||||
{
|
||||
for (const auto &effectorAdler : std::as_const(data.feuerkommando.wirkmittelRakete))
|
||||
for (const auto &effectorAdler : qAsConst(data.feuerkommando.wirkmittelRakete))
|
||||
{
|
||||
AreaEffectSimulation::EffectorData effectorData;
|
||||
|
||||
@@ -820,10 +848,10 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
|
||||
effectorData.interval() = effectorAdler.geschoss.intervall;
|
||||
|
||||
|
||||
// create centroid
|
||||
Core::GeoPosition mhpPos;
|
||||
QPointF centroid;
|
||||
for (const auto &treffpunkt : std::as_const(effectorAdler.treffpunkte))
|
||||
for (const auto &treffpunkt : qAsConst(effectorAdler.treffpunkte))
|
||||
centroid += {treffpunkt.koordinate.koordinate.latitude, treffpunkt.koordinate.koordinate.longitude};
|
||||
|
||||
centroid /= effectorAdler.treffpunkte.size();
|
||||
@@ -843,7 +871,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
AdlerJson::wirkmittelFeuerkommandoRaketeToJson(properties, effectorAdler);
|
||||
effectorData.properties() = QJsonDocument(properties).toJson(QJsonDocument::Compact).toStdString();
|
||||
|
||||
|
||||
// trajectory without time start ------------------------------------------
|
||||
const ParticipantManagement::ParticipantPosition &participantPosition = m_dtcPpm->participantPosition(effectorData.participantId());
|
||||
const LtsUtils::QPoint3D trajectoryStart(participantPosition.pos().lon(), participantPosition.pos().lat(), participantPosition.pos().z());
|
||||
|
||||
@@ -853,15 +881,15 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
if (!AreaEffectSimulation::TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime))
|
||||
ERROR_LOG(m_logger) << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein;
|
||||
|
||||
// trajectory without time end -------------------------------------------
|
||||
|
||||
|
||||
// trajectory with time start -------------------------------------------
|
||||
effectorData.flightTime() = effectorAdler.flugzeit * 1000;
|
||||
const double flightTimeStep = effectorData.flightTime() / static_cast<double>(trajectoryWithoutTime.size());
|
||||
double currentFlightTime = 0.0;
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPosition.pos().lon(), participantPosition.pos().lat());
|
||||
for (const Core::GeoPosition &pos : std::as_const(trajectoryWithoutTime))
|
||||
for (const Core::GeoPosition &pos : qAsConst(trajectoryWithoutTime))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat());
|
||||
|
||||
@@ -870,7 +898,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
currentFlightTime += flightTimeStep;
|
||||
}
|
||||
|
||||
// trajectory with time end --------------------------------------------
|
||||
|
||||
obj[AdlerJson::JsonKeys::LADUNG()] = m_mainDispatcher->pdmHandler()->getDtc()->getLoadTypeIdFromAdlerLoad(effectorAdler.geschoss.ladung);
|
||||
obj[AdlerJson::JsonKeys::LADUNGSNUMMER()] = effectorAdler.geschoss.ladungsNummer;
|
||||
@@ -887,14 +915,14 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
req.effectMarkingInTa(true);
|
||||
req.partyId(part.partyId());
|
||||
req.explosionGeometry(geometry);
|
||||
req.firePurposeId(static_cast<int>(data.forderung.underlying()));
|
||||
req.firePurposeId(static_cast<int>(data.forderung.underlying())); // TODO Mapping
|
||||
req.effectSourceId(ProjectDataManagement::EffectSource::ES_ADLER);
|
||||
req.name(data.feuerkampfReferenz.toStdString());
|
||||
req.element(data.feuerkampfReferenz.toStdString());
|
||||
req.effectDuration(data.dauer * 1000);
|
||||
req.participantId(part.id());
|
||||
req.externalId(7);
|
||||
req.tla(data.zieldaten.zog);
|
||||
req.tla(data.zieldaten.zog); // defaults to 0 if not set
|
||||
|
||||
if (data.feuerkommando.wirkmittel.empty())
|
||||
DEBUG_LOG(m_logger) << "flugzeit :"
|
||||
@@ -907,9 +935,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
std::vector<ProjectDataManagement::L27_EffectorId> refWirkmittel;
|
||||
refWirkmittel.reserve(data.feuerkommando.wirkmittel.size());
|
||||
|
||||
for (const auto &wm : std::as_const(data.feuerkommando.wirkmittel))
|
||||
for (const auto &wm : qAsConst(data.feuerkommando.wirkmittel))
|
||||
{
|
||||
ammoCounter += wm.geschoss.anzahl;
|
||||
ammoCounter += wm.geschoss.anzahl; // Counts every Ammo that will be shooted
|
||||
DEBUG_LOG(m_logger) << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner;
|
||||
refWirkmittel.push_back(wm.kenner);
|
||||
}
|
||||
@@ -923,18 +951,18 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
QList<qint32> AesHandler::findAllPendingEffectCluster(int partyId)
|
||||
{
|
||||
|
||||
// QList<AreaEffectSimulation::EffectCluster> ret;
|
||||
QList<qint32> ret;
|
||||
const auto &effectClusters = m_dtcAes->effectClusters();
|
||||
for (const auto &effectCluster : std::as_const(effectClusters))
|
||||
for (const auto &effectCluster : qAsConst(effectClusters))
|
||||
{
|
||||
if (effectCluster.partyId() != partyId)
|
||||
continue;
|
||||
if (effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsReceived
|
||||
&& effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsCreated)
|
||||
continue;
|
||||
if (effectCluster.effectSourceId() != ProjectDataManagement::EffectSource_def::ES_ADLER
|
||||
)
|
||||
if (effectCluster.effectSourceId() != ProjectDataManagement::EffectSource_def::ES_ADLER /*&&
|
||||
effectCluster.effectSourceId() != ProjectDataManagement::EffectSource_def::ES_ADLER_STANDALONE*/)
|
||||
continue;
|
||||
|
||||
ret.append(effectCluster.id());
|
||||
@@ -942,8 +970,20 @@ QList<qint32> AesHandler::findAllPendingEffectCluster(int partyId)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* * handleAmmoCount handhabt die Munitionszählung (AmmoCount).
|
||||
* TODO: Behebung des Persistenz-Problems:
|
||||
* Aktuell gehen die Map-Daten bei einem Service-Restart verloren.
|
||||
* ! 'm_feuerkampReferenzAmmoCounter' ist nach Restart leer.
|
||||
* Dies kann zu Inkonsistenzen führen, falls die SAA eine VM (Vollzugsmeldung) erwartet,
|
||||
* der Zählerstand aber zurückgesetzt wurde.
|
||||
* ? Refactoring-Option:
|
||||
* Sobald der 'EffectCluster' die reale Munition der Adler-Bekämpfungspläne führt,
|
||||
* sollte diese Map durch den 'EffectCluster'-Counter ersetzt werden, um eine
|
||||
* "Single Source of Truth" zu gewährleisten.
|
||||
*
|
||||
* STAND (16.04.2026)
|
||||
*/
|
||||
void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug)
|
||||
{
|
||||
const QString refTrimmed = data.feuerkampfReferenz.trimmed();
|
||||
@@ -953,7 +993,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
|
||||
const auto &aesEffetClusters = m_dtcAes->effectClusters();
|
||||
|
||||
for (const auto &aes : std::as_const(aesEffetClusters))
|
||||
for (const auto &aes : qAsConst(aesEffetClusters))
|
||||
{
|
||||
if (aes.isDeleted() || aes.partyId() != saaPartyId || aes.element() != refTrimmed.toStdString())
|
||||
{
|
||||
@@ -984,7 +1024,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
{
|
||||
auto refKenners = m_feuerkampfReferenzWirkmittel.value(refTrimmed);
|
||||
|
||||
for (const auto &kenner : std::as_const(refKenners))
|
||||
for (const auto &kenner : qAsConst(refKenners))
|
||||
{
|
||||
ExVollzugsmeldung exvm;
|
||||
exvm.feuerkampfdaten.feuerkampfReferenz = data.feuerkampfReferenz;
|
||||
@@ -1000,7 +1040,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
req.id(aes.id());
|
||||
|
||||
m_ftcAes->effectClusterRemoveRequest(req);
|
||||
|
||||
// After remove effectCluster remove FeuerkampfReferenz from Maps
|
||||
m_feuerkampfReferenzUsedFeuerHalt.remove(refTrimmed);
|
||||
m_feuerkampfReferenzWirkmittel.remove(refTrimmed);
|
||||
m_feuerkampReferenzAmmoCounter.remove(refTrimmed);
|
||||
@@ -1016,7 +1056,7 @@ void AesHandler::removeAllPendingEffectCluster(int partyId)
|
||||
|
||||
INFO_LOG(m_logger) << "Pending effect cluster size: " << effectClusterIds.size();
|
||||
Core::RemoveElementRequest req;
|
||||
for (const qint32 id : std::as_const(effectClusterIds))
|
||||
for (const qint32 id : qAsConst(effectClusterIds))
|
||||
{
|
||||
req.id(id);
|
||||
INFO_LOG(m_logger) << "Remove effect cluster id: " << id;
|
||||
@@ -1076,10 +1116,10 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
|
||||
QJsonObject jsonData;
|
||||
jsonData[QStringLiteral("header")] = headerJson;
|
||||
jsonData[QStringLiteral("impactPosition")] = impactPosition;
|
||||
jsonData[QStringLiteral("impactPosition")] = impactPosition; // detonationLocation
|
||||
if (data.participantId().is_set())
|
||||
{
|
||||
jsonData[QStringLiteral("participantId")] = data.participantId().get();
|
||||
jsonData[QStringLiteral("participantId")] = data.participantId().get(); // firingObjectIdentifier
|
||||
}
|
||||
|
||||
telegram[QStringLiteral("data")] = jsonData;
|
||||
@@ -1121,20 +1161,20 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsCreated:
|
||||
{
|
||||
|
||||
|
||||
// Auftragsannahme (manuelle Quittung)
|
||||
// Could be send via notification managment??
|
||||
if (m_aesIdToFeuerkampfReferenz.contains(data.id()))
|
||||
{
|
||||
const QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object();
|
||||
const QString reference = probObject[AdlerJson::JsonKeys::FEUERKAMPFREFERENZ()].toString();
|
||||
|
||||
ExMqManuelleQuittung exmq;
|
||||
|
||||
// exmq.mqManuelleQuittungDaten.feuerkampfreferenz = QString::fromStdString(data.element());
|
||||
|
||||
exmq.mqManuelleQuittungDaten.feuerkampfreferenz = reference;
|
||||
m_mainDispatcher->jsonDispatcher()->sendExMqManuelleQuittung(exmq, data.partyId().get());
|
||||
|
||||
|
||||
// After that we'll remove it form the list to not send an MQ again!
|
||||
m_aesIdToFeuerkampfReferenz.remove(data.id());
|
||||
DEBUG_LOG(m_logger) << "SEND MQ for " << data.name() << " " << reference;
|
||||
break;
|
||||
@@ -1142,11 +1182,11 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste
|
||||
}
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived:
|
||||
case AreaEffectSimulation::AesEffectState::EsPrepared:
|
||||
case AreaEffectSimulation::AesEffectState::EsFired:
|
||||
case AreaEffectSimulation::AesEffectState::EsExpired:
|
||||
case AreaEffectSimulation::AesEffectState::EsFired: // EsFired! will be handled by fired topic
|
||||
case AreaEffectSimulation::AesEffectState::EsExpired: // EX Expired is not for ADLER it just need the ConfirmationReport
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
+28
-23
@@ -1,22 +1,28 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* AesHandler for AdlerJson Plugin
|
||||
* $Id: aes_handler.h 62304 2024-03-21 08:17:45Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Core/core_types.h"
|
||||
#include "DDS/Core/function_reply_object.h"
|
||||
#include "logger.h"
|
||||
#include "main_dispatcher.h"
|
||||
#include "telegrams.h"
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <LtsUtilsCore/data_modification_enum.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
|
||||
namespace AdlerJson
|
||||
{
|
||||
@@ -37,42 +43,39 @@ class AesHandler
|
||||
bool init(MainDispatcher *mainDispatcher);
|
||||
bool sendAesModifyRequest(const QJsonObject &obj);
|
||||
bool sendExplosionArea(const QJsonObject &data);
|
||||
|
||||
// DDS Overrides
|
||||
void onAirSupportImpactModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
|
||||
|
||||
// Internal
|
||||
void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType);
|
||||
void onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType);
|
||||
|
||||
void handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::CreateSingleExplosion &data);
|
||||
void handleEXFire(const Feuerkampfdaten &data, int wsId);
|
||||
void handleEXDontFire(const Feuerkampfdaten &data, int wsId);
|
||||
|
||||
// Reald Data
|
||||
void sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &data, int participantId, int wirkmittelIndex, int aesId);
|
||||
void handleEffectCluster(const WirkfeldplanungData &data, int wsId);
|
||||
|
||||
|
||||
//
|
||||
void removeAllPendingEffectCluster(int partyId);
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> getDtc() { return m_dtcAes; };
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> getFtc() { return m_ftcAes; };
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
AreaEffectSimulation::Area createMinimumRect(int zone, const QVector<QPointF> &points);
|
||||
|
||||
signals:
|
||||
void explosionSingleChanged(const QJsonObject &jsonObj);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QList<qint32> findAllPendingEffectCluster(int partyId);
|
||||
void handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug = false);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainDispatcher *m_mainDispatcher;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
|
||||
@@ -86,16 +89,18 @@ class AesHandler
|
||||
QHash<int, AreaEffectSimulation::AesEffectState> m_singleExplosions;
|
||||
|
||||
WirkfeldplanungData m_wirkfeldPlanungsData;
|
||||
QHash<int, QString> m_aesIdToFeuerkampfReferenz;
|
||||
QHash<int, QString> m_aesIdToFeuerkampfReferenz; // key = aesId, value = feuerkampfReferenz
|
||||
|
||||
QHash<QString, int> m_feuerkampReferenzAmmoCounter;
|
||||
QHash<QString, std::vector<ProjectDataManagement::L27_EffectorId>> m_feuerkampfReferenzWirkmittel;
|
||||
QHash<QString, bool> m_feuerkampfReferenzUsedFeuerHalt;
|
||||
QHash<QString, int> m_feuerkampReferenzAmmoCounter; // key = feuerkampfReferenz, value = AmmoCounter
|
||||
QHash<QString, std::vector<ProjectDataManagement::L27_EffectorId>> m_feuerkampfReferenzWirkmittel; // key = feuerkampfReferenz, value = Kenner
|
||||
QHash<QString, bool> m_feuerkampfReferenzUsedFeuerHalt; // key = feuerkampfReferenz, value = boolean -> if Feuerhalt was activ
|
||||
|
||||
int m_participantId;
|
||||
int m_wirkmittelIndex;
|
||||
int m_aesId;
|
||||
QHash<int, int> aesIdWsId;
|
||||
QHash<int, int> aesIdWsId; // key = aesId value = wsId
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
+96
-90
@@ -1,8 +1,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* JsonDispatcher for Apache Plugin
|
||||
* $Id: hla_dispatcher.cpp 62304 2024-03-21 08:17:45Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/hla_dispatcher.cpp $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#include "json_dispatcher.h"
|
||||
#include <utility>
|
||||
#include "json_handler_rx.h"
|
||||
#include "json_handler_tx.h"
|
||||
#include "settings.h"
|
||||
@@ -10,11 +15,11 @@
|
||||
#include <AreaEffectSimulation/aes_operator_rights.h>
|
||||
|
||||
#include <QHostInfo>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <QJsonDocument>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <QWebSocket>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <vector>
|
||||
|
||||
@@ -31,7 +36,7 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
||||
, m_recvFromTabCb(recvFromTabCb)
|
||||
, m_recvFromWebsocket(std::make_shared<JsonHandlerRx>(recvFromTabCb, sendToTabCb, this, mainDispatcher->aesHandler().get(), mainDispatcher->ppmHandler().get()))
|
||||
, m_sendToWebsocket(std::make_shared<JsonHandlerTx>(pdp, mainDispatcher))
|
||||
|
||||
// , m_ddsHandler(ddsHandler)
|
||||
, m_mainDispatcher(mainDispatcher)
|
||||
, m_flmHandler(flmHandler)
|
||||
, m_ppmHandler(mainDispatcher->ppmHandler())
|
||||
@@ -43,6 +48,7 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
||||
, m_webSocketInterface(std::make_shared<TrainingAreaBase::WebSocketHandler>())
|
||||
, m_webSocketReconnectTimer(new QTimer(this))
|
||||
, m_bWarnedOnce(false)
|
||||
, m_logger(getLogger("JsonDispatcher"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "JsonDispatcher::JsonDispatcher";
|
||||
|
||||
@@ -269,32 +275,32 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
if (saa.get()->getPartyId() == partyId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "saa already connected, reconnect!";
|
||||
|
||||
// exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Doppelt;
|
||||
onSAADeregistration(saa.get()->getWsId(), partyId);
|
||||
|
||||
// TODO: emit or answer with saa already connected
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "other saa connected to this party";
|
||||
|
||||
|
||||
|
||||
// exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Mehrfach;
|
||||
// TODO: emit or answer with other saa connected to this party
|
||||
}
|
||||
}
|
||||
else if (getSAAByParty(partyId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "party is used by other saa";
|
||||
|
||||
|
||||
// exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Belegt;
|
||||
// TODO: emit or answer party is used by other saa
|
||||
}
|
||||
|
||||
// else
|
||||
{
|
||||
auto newSaa = std::make_shared<SAAInterface>(wsId, partyId, saaName, szenarName, isVerbund);
|
||||
newSaa->init(m_ppmHandler, m_mainDispatcher->pdmHandler(), m_mainDispatcher->aesHandler(), m_dtsTab);
|
||||
|
||||
// cleanUp first
|
||||
cleanupSaaInterfaces(saaName, wsId, partyId);
|
||||
m_saaInterfaces.append(newSaa);
|
||||
|
||||
// We created a new SAA, start keep alive procedure
|
||||
int adlerOffset = m_settings->settings()->value(QLatin1String("TrainingAreaBase/AdlerKeepalive"), 30000).toInt();
|
||||
DEBUG_LOG(m_logger) << "adlerOffset =" << adlerOffset;
|
||||
if (adlerOffset > 0)
|
||||
@@ -307,22 +313,22 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
keepaliveTimer->start();
|
||||
}
|
||||
saa = newSaa;
|
||||
|
||||
// Won't cleanup in Debug as the simulator won't send continous EX_VerbindugsAnfrage
|
||||
|
||||
DEBUG_LOG(m_logger) << "emit or answer without error wsId: " << wsId;
|
||||
}
|
||||
exRC.sender = getSender();
|
||||
exRC.receiver = saa->getSAAName();
|
||||
|
||||
// Send Answer to SAA
|
||||
m_sendToWebsocket->onGenericTelegram1(wsId, exRC.toJson());
|
||||
|
||||
|
||||
// if we declined the registration don't update ppm/asm
|
||||
if (exRC.anBestaetigungsdaten.error != AdlerJson::L45_AnmeldebestaetigungFehlercode::Ok)
|
||||
return;
|
||||
|
||||
|
||||
// Initialize HQ-Folders if not exist
|
||||
m_flmHandler->initHQFolders(partyId);
|
||||
|
||||
// Modify Party
|
||||
const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::Connected;
|
||||
const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected);
|
||||
const int assetId = getAssetId(saaName);
|
||||
@@ -380,7 +386,7 @@ void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid)
|
||||
if (connectionTimer)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "connectionTimer->start()";
|
||||
connectionTimer->start();
|
||||
connectionTimer->start(); // Restarts the KeepAlive Timer
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "ConnectionTest from " << saa->getSAAName();
|
||||
EXConnectionTestReply exCTR;
|
||||
@@ -449,8 +455,8 @@ void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten
|
||||
QString content = QString::fromUtf8(tr_lts("Notification", "<B>Status: </B>%1<br /><B> Description: </B>%2"));
|
||||
|
||||
QStringList args;
|
||||
|
||||
|
||||
// INV = Meldung nicht gültig nach JSON-Schema.
|
||||
// DAT = Datenkonsistenzfehler.
|
||||
if (StatusL32Map.key(exceptionStatus.status) == QStringLiteral("INV"))
|
||||
args << QString::fromUtf8(tr_lts("Notification", "Message is not valid according to JSON schema."));
|
||||
|
||||
@@ -471,25 +477,17 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS)
|
||||
const bool isVerbund = true;
|
||||
auto saa = getSAAByWs(wsId);
|
||||
int partyId = saa->getPartyId();
|
||||
QStringList args;
|
||||
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQWS.einheit.verein, partyId, isVerbund);
|
||||
|
||||
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
|
||||
args.append(QString::number(part.id()));
|
||||
args.append(ortsIdMap.key(exSQWS.einheit.oi));
|
||||
args.append(QString::number(exSQWS.einheit.r));
|
||||
args.append(exSQWS.einheit.verein);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung Waffensystem content=" << content;
|
||||
createNotificationRequest(wsId,
|
||||
QString::fromUtf8(tr_lts("Notification","Weapon System Position Report")),
|
||||
NotificationManagement::MessageType_def::Info,
|
||||
NotificationManagement::NotificationType::AdlerNotification,
|
||||
content,
|
||||
args);
|
||||
|
||||
m_ppmHandler->parseSQWS(exSQWS, wsId);
|
||||
if (part.id() > 0)
|
||||
{
|
||||
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQWS.einheit);
|
||||
return;
|
||||
}
|
||||
QTimer::singleShot(5000, this, [this, wsId, partyId, isVerbund, exSQWS]() {
|
||||
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQWS.einheit);
|
||||
});
|
||||
}
|
||||
|
||||
void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS)
|
||||
@@ -498,25 +496,17 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS
|
||||
auto saa = getSAAByWs(wsId);
|
||||
int partyId = saa->getPartyId();
|
||||
const bool isVerbund = true;
|
||||
QStringList args;
|
||||
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQFS.feuereinheit.verein, partyId, isVerbund);
|
||||
|
||||
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
|
||||
args.append(QString::number(part.id()));
|
||||
args.append(ortsIdMap.key(exSQFS.feuereinheit.oi));
|
||||
args.append(QString::number(exSQFS.feuereinheit.r));
|
||||
args.append(exSQFS.feuereinheit.verein);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung Feuerstellung content=" << content;
|
||||
createNotificationRequest(wsId,
|
||||
QString::fromUtf8(tr_lts("Notification","Position Report: Firing Unit")),
|
||||
NotificationManagement::MessageType_def::Info,
|
||||
NotificationManagement::NotificationType::AdlerNotification,
|
||||
content,
|
||||
args);
|
||||
|
||||
m_ppmHandler->parseSQFS(exSQFS, wsId);
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQFS.feuereinheit.verein, partyId, isVerbund);
|
||||
if (part.id() > 0)
|
||||
{
|
||||
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQFS.feuereinheit);
|
||||
return;
|
||||
}
|
||||
QTimer::singleShot(5000, this, [this, wsId, partyId, isVerbund, exSQFS]() {
|
||||
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQFS.feuereinheit);
|
||||
});
|
||||
}
|
||||
|
||||
void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
|
||||
@@ -525,17 +515,35 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
|
||||
auto saa = getSAAByWs(wsId);
|
||||
int partyId = saa->getPartyId();
|
||||
const bool isVerbund = true;
|
||||
QStringList args;
|
||||
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQLP.einheit.verein, partyId, isVerbund);
|
||||
DEBUG_LOG(m_logger) << "ParticipantId=" << part.id();
|
||||
|
||||
|
||||
m_ppmHandler->parseSQLP(exSQLP, wsId);
|
||||
if (part.id() > 0)
|
||||
{
|
||||
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQLP.einheit);
|
||||
return;
|
||||
}
|
||||
QTimer::singleShot(5000, this, [this, wsId, partyId, exSQLP]() {
|
||||
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQLP.einheit);
|
||||
});
|
||||
}
|
||||
|
||||
void JsonDispatcher::sendParticipantInfoNotification(const int wsId, const int partyId, const bool isVerbund, const Einheit &einheit)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendParticipantInfoNotification";
|
||||
QStringList args;
|
||||
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(einheit.verein, partyId, isVerbund);
|
||||
DEBUG_LOG(m_logger) << "sendParticipantInfoNotification ParticipantId=" << part.id();
|
||||
|
||||
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
|
||||
|
||||
args.append(QString::number(part.id()));
|
||||
args.append(ortsIdMap.key(exSQLP.einheit.oi));
|
||||
args.append(QString::number(exSQLP.einheit.r));
|
||||
args.append(exSQLP.einheit.verein);
|
||||
args.append(ortsIdMap.key(einheit.oi));
|
||||
args.append(QString::number(einheit.r));
|
||||
args.append(einheit.verein);
|
||||
|
||||
createNotificationRequest(wsId,
|
||||
QString::fromUtf8(tr_lts("Notification","Loading Point Position Report")),
|
||||
@@ -543,9 +551,7 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
|
||||
NotificationManagement::NotificationType::AdlerNotification,
|
||||
content,
|
||||
args);
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung Ladeplatz content=" << content;
|
||||
|
||||
m_ppmHandler->parseSQLP(exSQLP, wsId);
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung content=" << content;
|
||||
}
|
||||
|
||||
void JsonDispatcher::onSAATrajectoryData(const int wsId, const Flugbahndaten &exFlugbahndaten, const QString referenceUuid)
|
||||
@@ -572,7 +578,7 @@ void JsonDispatcher::onSAATrajectoryData(const int wsId, const Flugbahndaten &ex
|
||||
TrajectoryIdentifier trajectoryIdentifier = m_trajectoryIdentifier.value(referenceUuidAlt);
|
||||
m_trajectoryIdentifier.remove(referenceUuidAlt);
|
||||
|
||||
|
||||
// Parse in party SAA
|
||||
const Core::GeoPosition positionLaunch = m_positionsLaunch.value(referenceUuidAlt);
|
||||
m_positionsLaunch.remove(referenceUuidAlt);
|
||||
saa->parseFlugbahndaten(exFlugbahndaten, trajectoryIdentifier.aesItemId, trajectoryIdentifier.explosionId, positionLaunch);
|
||||
@@ -645,7 +651,7 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer
|
||||
|
||||
const bool bRet = m_mainDispatcher->aesHandler()->getFtc()->effectClusterFireHaltRequest(req);
|
||||
|
||||
if (bRet && kategorie == ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_E && !feuerhaltdaten.entladenSchuss)
|
||||
if (bRet && kategorie == ProjectDataManagement::L22_FireHaltCategory::E && !feuerhaltdaten.entladenSchuss) //we can send the EXVollzugsmeldung immediatly
|
||||
{
|
||||
Feuerkampfdaten fkd;
|
||||
fkd.feuerkampfReferenz = feuerhaltdaten.feuerkampfReferenz;
|
||||
@@ -721,12 +727,12 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
|
||||
{
|
||||
TRACE_LOG(m_logger) << "Text Message received: " << doc.toJson() << ", wsId: " << wsId;
|
||||
}
|
||||
|
||||
// convert from json to internal representation, send to TAB
|
||||
int errorcode = 0;
|
||||
m_recvFromWebsocket->handleTelegram(wsId, telegram, errorcode);
|
||||
|
||||
|
||||
|
||||
// now that it's handled look at the error code and if it's EX_FLUGDATEN
|
||||
// then return errorcode
|
||||
|
||||
TRACE_LOG(m_logger) << "errorcode = " << errorcode;
|
||||
const int typeId = telegram[JsonKeys::TYPE_ID()].toInt();
|
||||
@@ -754,7 +760,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
|
||||
void JsonDispatcher::onTextMessageReceived(const QByteArray &message)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Text Message received: " << message;
|
||||
|
||||
// convert from json to internal representation, send to TAB
|
||||
m_recvFromWebsocket->handleTelegram(message);
|
||||
}
|
||||
|
||||
@@ -831,14 +837,14 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.sprenghoehe = static_cast<int>(request.explosionHeight());
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.winkelgruppe = AdlerJson::Winkelgruppe(request.angleGroup().underlying());
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
/// Daten aus dem ESG-Simulator
|
||||
|
||||
if (request.properties().empty())
|
||||
ERROR_LOG(m_logger) << "No properties available";
|
||||
DEBUG_LOG(m_logger) << ", request.aesItemId() :" << request.aesItemId();
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
DEBUG_LOG(m_logger) << "UUID=" << exFlugbahnberechnung.uuid;
|
||||
TrajectoryIdentifier trajectoryIdentifier;
|
||||
@@ -857,14 +863,14 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
|
||||
void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int partyId)
|
||||
{
|
||||
|
||||
|
||||
// as the saaInterfaces are a vector, you can append multiple saa by the same name or ws id or party Id and it will always return the first one.
|
||||
// so we add a cleanup function
|
||||
DEBUG_LOG(m_logger) << "cleanup saa partyId: " << partyId << " name: " << saaName << " wsId " << wsId;
|
||||
|
||||
const auto copy = m_saaInterfaces;
|
||||
for (const auto &saa : copy)
|
||||
{
|
||||
if ((partyId > 0 && saa.get()->getPartyId() == partyId) || (!saaName.isEmpty() && saa.get()->getSAAName() == saaName)
|
||||
if ((partyId > 0 && saa.get()->getPartyId() == partyId) || (!saaName.isEmpty() && saa.get()->getSAAName() == saaName) // the name should be uniqe!
|
||||
|| (wsId > 0 && saa.get()->getWsId() == wsId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Cleanup SAA " << saa->getSAAName() << " for Party: " << saa->getPartyId();
|
||||
@@ -873,9 +879,9 @@ void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Notifications:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
const QString &title,
|
||||
@@ -885,7 +891,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
{
|
||||
const qint64 currentTime = m_mainDispatcher->ddsHandler()->partitionTime();
|
||||
|
||||
|
||||
// 100 seconds
|
||||
const qint64 expiryTime = currentTime + 100 * 1000;
|
||||
NotificationManagement::NomNotification notif;
|
||||
|
||||
@@ -897,14 +903,14 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
WARNING_LOG(m_logger) << "No valid SAA for wsId";
|
||||
return;
|
||||
}
|
||||
|
||||
//QString content = QStringLiteral("[Open Notification List ](//nomEditGuiPlugin/)") + QStringLiteral("<br />");
|
||||
const int partyId = saa->getPartyId();
|
||||
const ParticipantManagement::Party party = m_ppmHandler->getDtc()->party(partyId);
|
||||
const QString partyStr = QString::fromStdString(party.name());
|
||||
|
||||
std::vector<std::string> args;
|
||||
args.reserve(contentArgs.size());
|
||||
for (const auto & str : std::as_const(contentArgs))
|
||||
for (const auto & str : qAsConst(contentArgs))
|
||||
args.emplace_back(str.toStdString());
|
||||
|
||||
notif.content(content.toStdString());
|
||||
@@ -924,7 +930,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
std::vector<NotificationManagement::Address> recipientIdsDds;
|
||||
recipientIdsDds.reserve(recipientIds.size());
|
||||
|
||||
for (const auto &recipientId : std::as_const(recipientIds))
|
||||
for (const auto &recipientId : qAsConst(recipientIds))
|
||||
{
|
||||
NotificationManagement::Address addr;
|
||||
addr.addressId(recipientId);
|
||||
@@ -943,7 +949,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
notif.sender(addrSender);
|
||||
|
||||
data.notification(notif);
|
||||
}
|
||||
} // end of getCreateNotificationRequestData()
|
||||
|
||||
void JsonDispatcher::createNotificationRequest(const int wsId,
|
||||
const QString &title,
|
||||
@@ -977,7 +983,7 @@ void JsonDispatcher::createNotificationRequest(const int wsId,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void JsonDispatcher::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
@@ -992,6 +998,6 @@ void JsonDispatcher::onCreateNotificationReply(const Core::FunctionReplyObject &
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
}
|
||||
|
||||
}
|
||||
} // end of onNotificationCreateReply()
|
||||
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
+26
-20
@@ -1,15 +1,21 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HlaDispatcher for AdlerJson Plugin
|
||||
* $Id: hla_dispatcher.h 62304 2024-03-21 08:17:45Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/hla_dispatcher.h $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <Core/core_types.h>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
#include <QWebSocket>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
|
||||
// #include "logger.h"
|
||||
#include "aes_handler.h"
|
||||
#include "asm_handler.h"
|
||||
#include "flm_handler.h"
|
||||
@@ -19,10 +25,10 @@
|
||||
#include "telegrams.h"
|
||||
#include "ws_interface.h"
|
||||
|
||||
|
||||
// #include <NotificationManagement/nom_ftc.h>
|
||||
#include <NotificationManagement/nom_enums.hpp>
|
||||
|
||||
|
||||
// #include <TrainingAreaBase/tab_dts.h>
|
||||
// #include <TrainingAreaBase/tab_fts.h>
|
||||
|
||||
class QTimer;
|
||||
namespace AdlerJson
|
||||
@@ -31,7 +37,7 @@ using namespace TrainingAreaBase;
|
||||
class JsonHandlerRx;
|
||||
class JsonHandlerTx;
|
||||
class DdsHandler;
|
||||
|
||||
// class EXStatus;
|
||||
|
||||
struct TrajectoryIdentifier
|
||||
{
|
||||
@@ -66,7 +72,7 @@ class JsonDispatcher final
|
||||
std::shared_ptr<SAAInterface> getSAAByParty(const int partyId);
|
||||
std::shared_ptr<SAAInterface> getSAAByWs(const int wsId);
|
||||
QString getSender() { return QStringLiteral("EXCON@GUEZ.DE"); }
|
||||
|
||||
// SendToTele
|
||||
bool sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const int partyId);
|
||||
bool sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, int partyId);
|
||||
bool sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDataIn, int partyId);
|
||||
@@ -74,7 +80,7 @@ class JsonDispatcher final
|
||||
bool sendExVollzugsmeldung(const ExVollzugsmeldung &exVZDataIn, int partyId);
|
||||
void onAdlerCalculateTrajectoryRequest(const rti::core::SampleIdentity &cookie, const TrainingAreaBase::AdlerCalculateTrajectoryRequest &request) override;
|
||||
int getAssetId(const QString &saaName) const;
|
||||
|
||||
// misc
|
||||
void cleanupSaaInterfaces(const QString &saaName, int wsId, int partyId);
|
||||
void getCreateNotificationRequestData(const int wsId,
|
||||
const QString &title,
|
||||
@@ -92,6 +98,7 @@ class JsonDispatcher final
|
||||
void onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS);
|
||||
void onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS);
|
||||
void onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP);
|
||||
void sendParticipantInfoNotification(const int wsId, const int partyId, const bool isVerbund, const Einheit &einheit);
|
||||
void onSAAHXGuidingLines(const int wsId, const Koordinierungsdaten &koordinierungsdaten);
|
||||
void onSAAHXGuidingLinesAndBoundaries(const int wsId, const Fuehrungsdaten &fuehrungsdaten);
|
||||
void onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuerhaltdaten);
|
||||
@@ -115,7 +122,6 @@ class JsonDispatcher final
|
||||
void websocketConnected(quint16 port);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QUrl webSocketUrl() const;
|
||||
bool isConnectionTest(QJsonDocument &doc);
|
||||
QString getParticipantInfoLink(const QString &verein, const int partyId, const bool isVerbund);
|
||||
@@ -123,11 +129,10 @@ class JsonDispatcher final
|
||||
std::shared_ptr<SAAInterface> getSAAByName(const QString &saaName);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<JsonHandlerRx> m_recvFromWebsocket;
|
||||
std::shared_ptr<JsonHandlerTx> m_sendToWebsocket;
|
||||
|
||||
// DDS
|
||||
MainDispatcher *m_mainDispatcher;
|
||||
std::shared_ptr<FlmHandler> m_flmHandler;
|
||||
std::shared_ptr<PpmHandler> m_ppmHandler;
|
||||
@@ -139,8 +144,8 @@ class JsonDispatcher final
|
||||
QVector<std::shared_ptr<SAAInterface>> m_saaInterfaces;
|
||||
QMap<int, QTimer *> m_connectionKeepaliveTimer;
|
||||
|
||||
QHash<QString, TrajectoryIdentifier> m_trajectoryIdentifier;
|
||||
QHash<QString, Core::GeoPosition> m_positionsLaunch;
|
||||
QHash<QString, TrajectoryIdentifier> m_trajectoryIdentifier; // key = exFlugbahnberechnung.uuid
|
||||
QHash<QString, Core::GeoPosition> m_positionsLaunch; // key = exFlugbahnberechnung.uuid
|
||||
|
||||
NGL::Settings *m_settings;
|
||||
QWebSocket *m_webSocket;
|
||||
@@ -149,6 +154,7 @@ class JsonDispatcher final
|
||||
bool m_bWarnedOnce;
|
||||
rti::core::SampleIdentity m_cookieCalculateTrajectoryAdler;
|
||||
int m_explosionIndex;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
+45
-35
@@ -1,12 +1,18 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* JsonHandlerRx for AdlerJson Plugin
|
||||
* $Id: hla_handler_rx.cpp 62899 2024-05-29 11:08:50Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/hla_handler_rx.cpp $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#include "json_handler_rx.h"
|
||||
#include "aes_handler.h"
|
||||
#include "json_dispatcher.h"
|
||||
#include "ppm_handler.h"
|
||||
#include "telegrams.h"
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace AdlerJson
|
||||
{
|
||||
@@ -14,14 +20,16 @@ JsonHandlerRx::JsonHandlerRx(const std::shared_ptr<TrainingAreaBase::RecvFromTab
|
||||
const std::shared_ptr<TrainingAreaBase::TxMixin> &sendToTabCb,
|
||||
JsonDispatcher *dispatcher,
|
||||
AesHandler *aesHandler,
|
||||
PpmHandler *ppmHandler) : m_rxHandler(recvFromTabCb)
|
||||
, m_txHandler(sendToTabCb)
|
||||
PpmHandler *ppmHandler)
|
||||
: m_rxHandler(recvFromTabCb)
|
||||
, m_txHandler(sendToTabCb) // std::static_pointer_cast<TrainingAreaBase::SendToTab>(sendToTabCb))
|
||||
, m_dispatcher(dispatcher)
|
||||
, m_bWarnedOnce(false)
|
||||
, m_bWarnedOnceTx(false)
|
||||
, m_aesHandler(aesHandler)
|
||||
, m_ppmHandler(ppmHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_ppmHandler(ppmHandler)
|
||||
, m_logger(getLogger("JsonHandlerRx"))
|
||||
{
|
||||
}
|
||||
bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &errorcode)
|
||||
{
|
||||
@@ -44,7 +52,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
{
|
||||
switch (typeId)
|
||||
{
|
||||
case AdlerJson::TelegramIds::EX_REGISTRATION_REQUEST():
|
||||
case AdlerJson::TelegramIds::EX_REGISTRATION_REQUEST(): // EX-Anmeldung
|
||||
{
|
||||
QJsonObject dataObj = telegram[JsonKeys::DATA()].toObject();
|
||||
int partyId = dataObj.value(JsonKeys::PARTY_ID()).toInt(0);
|
||||
@@ -56,20 +64,20 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
<< ", isVerbund= " << isVerbund << ", wsId= " << wsId;
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_DEREGISTRATION_REQUEST():
|
||||
case TelegramIds::EX_DEREGISTRATION_REQUEST(): // EX-Abmeldung
|
||||
{
|
||||
const int partyId = telegram[JsonKeys::DATA()].toObject().value(JsonKeys::PARTY_ID()).toInt(0);
|
||||
m_dispatcher->onSAADeregistration(wsId, partyId);
|
||||
WARNING_LOG(m_logger) << "[EX_DEREGISTRATION_REQUEST] EX-Abmeldung -------------------------------------";
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_CONNECTION_TEST_REQUEST():
|
||||
case TelegramIds::EX_CONNECTION_TEST_REQUEST(): // EX-Verbindungsanfrage
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_CONNECTION_TEST_REQUEST] EX-Verbindungsanfrage -------------------------------------";
|
||||
m_dispatcher->onSAAConnectionTest(wsId, uuid);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_STATUS():
|
||||
case TelegramIds::EX_STATUS(): // EX-Status
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX_STATUS] EX-Status -------------------------------------";
|
||||
auto data = telegram[JsonKeys::DATA()];
|
||||
@@ -81,17 +89,17 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
m_dispatcher->onSAAStatus(wsId, exStatus);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_TQ():
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX_TQ] Technische Quittierung -------------------------------------";
|
||||
const auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
bool bOk = true;
|
||||
TechnischeDaten technischeDaten;
|
||||
AdlerJson::technischeDatenFromJson(data, technischeDaten, bOk);
|
||||
m_dispatcher->onSAAExceptionStatus(wsId, technischeDaten);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_FIRE():
|
||||
case TelegramIds::EX_TQ(): // Technische Quittierung
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX_TQ] Technische Quittierung -------------------------------------";
|
||||
const auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
bool bOk = true;
|
||||
TechnischeDaten technischeDaten;
|
||||
AdlerJson::technischeDatenFromJson(data, technischeDaten, bOk);
|
||||
m_dispatcher->onSAAExceptionStatus(wsId, technischeDaten);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_FIRE(): // EX-FQ(FN) Feuern
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX-FQ(FN)] EX-Feuern -------------------------------------";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
@@ -99,12 +107,12 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
Feuerkampfdaten exFire;
|
||||
feuerkampfdatenFromJson(data, exFire, bOk);
|
||||
|
||||
|
||||
// send to AES
|
||||
|
||||
m_aesHandler->handleEXFire(exFire, wsId);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_AWES_PLANNING():
|
||||
case TelegramIds::EX_AWES_PLANNING(): // EX-FQ(BA-BB-FK) Wirkfeldplanung
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX_AWES_PLANNING] EX-FQ(BA-BB-FK) Wirkfeldplanung";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
@@ -121,7 +129,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
m_aesHandler->handleEffectCluster(wirkfeldplanungData, wsId);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_POSITION_REPORT_WEAPON():
|
||||
case TelegramIds::EX_POSITION_REPORT_WEAPON(): // Only sent by SAA ( Ex-SQ(WS) Stellungsmeldung Waffensystem)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_WEAPON] Ex-SQ(WS) Stellungsmeldung Waffensystem";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
@@ -138,7 +146,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_POSITION_REPORT_FIRE():
|
||||
case TelegramIds::EX_POSITION_REPORT_FIRE(): // Only sent by SAA ( Ex-SQ(FS) Stellungsmeldung Feuerstellung)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_FIRE] Ex-SQ(FS) Stellungsmeldung Feuerstellung";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
@@ -155,7 +163,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_POSITION_REPORT_LOADING_PLACE():
|
||||
case TelegramIds::EX_POSITION_REPORT_LOADING_PLACE(): // sent by SAA+EXCON ( EX-SQ(LP)Stellungsmeldung Ladeplatz)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_LOADING_PLACE] EX-SQ(LP)Stellungsmeldung Ladeplatz";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
@@ -172,7 +180,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_FLUGBAHNDATEN():
|
||||
case TelegramIds::EX_FLUGBAHNDATEN(): // sent by SAA (EX-Flugbahndaten)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_FLUGBAHNDATEN] EX-Flugbahndaten";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
@@ -191,39 +199,41 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
errorcode = static_cast<int>(flugbahndaten.fehlercode);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_GUIDING_LINES():
|
||||
case TelegramIds::EX_GUIDING_LINES(): // sent by SAA ( EX-HQ(K) Koordinierungsmassnahmen)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_GUIDING_LINES] EX-HQ Koordinierungsmassnahmen";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
const QString artStr = data.value(JsonKeys::ART()).toString(QStringLiteral("Koordinierungsmassnahmen"));
|
||||
Koordinierungsdaten koordinierungsdaten;
|
||||
bool bOk = true;
|
||||
koordinierungsdatenFromJson(data, koordinierungsdaten, bOk);
|
||||
|
||||
if (koordinierungsdaten.name.isEmpty())
|
||||
koordinierungsdaten.name = QString(QStringLiteral("%1 - %2")).arg(typeName).arg(uuid);
|
||||
koordinierungsdaten.name = QString(QStringLiteral("%1 - %2")).arg(typeName).arg(artStr);
|
||||
else
|
||||
koordinierungsdaten.name = QString(QStringLiteral("%1 - %2")).arg(typeName).arg(koordinierungsdaten.name);
|
||||
|
||||
m_dispatcher->onSAAHXGuidingLines(wsId, koordinierungsdaten);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_GUIDING_LINES_AND_BOUNDARIES():
|
||||
case TelegramIds::EX_GUIDING_LINES_AND_BOUNDARIES(): // sent by SAA ( EX-HQ(G)Fuehrungslinien und Grenzen)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[EX_GUIDING_LINES_AND_BOUNDARIES] EX-HQ(G)Fuehrungslinien und Grenzen ";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
const QString artStr = data.value(JsonKeys::ART()).toString(QStringLiteral("Fuehrungslinien und Grenzen"));
|
||||
Fuehrungsdaten fuehrungsdaten;
|
||||
bool bOk = true;
|
||||
fuehrungsdatenFromJson(data, fuehrungsdaten, bOk);
|
||||
|
||||
if (fuehrungsdaten.name.isEmpty())
|
||||
fuehrungsdaten.name = QString(QStringLiteral("%1 - %2")).arg(typeName).arg(uuid);
|
||||
fuehrungsdaten.name = QString(QStringLiteral("%1 - %2")).arg(typeName).arg(artStr);
|
||||
else
|
||||
fuehrungsdaten.name = QString(QStringLiteral("%1 - %2")).arg(typeName).arg(fuehrungsdaten.name);
|
||||
|
||||
m_dispatcher->onSAAHXGuidingLinesAndBoundaries(wsId, fuehrungsdaten);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_FIRE_HALT():
|
||||
case TelegramIds::EX_FIRE_HALT(): // sent by SAA (EX-FH Feuerhalt)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX_FIRE_HALT] Feuerhalt";
|
||||
|
||||
@@ -236,7 +246,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
m_dispatcher->onSSAEXFIREHALT(wsId, feuerhaltdaten);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_DONT_FIRE():
|
||||
case TelegramIds::EX_DONT_FIRE(): // send by SAA EX-FQ(nFN)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "[EX_DONT_FIRE] Dont Fire";
|
||||
auto data = telegram[QStringLiteral("data")].toObject();
|
||||
@@ -336,4 +346,4 @@ template <typename T> void JsonHandlerRx::txData(const T &data)
|
||||
m_txHandler->txData(data);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
+14
-7
@@ -1,13 +1,19 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MainDispatcher for AdlerJson Plugin
|
||||
* $Id: main_dispatcher.cpp 62899 2024-05-29 11:08:50Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.cpp $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#include "main_dispatcher.h"
|
||||
#include "TrainingAreaBase/dds_handler.h"
|
||||
#include "json_dispatcher.h"
|
||||
|
||||
//#include "json_handler_tx.h"
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <QtCore/QTimer>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <QTimer>
|
||||
|
||||
namespace AdlerJson
|
||||
{
|
||||
@@ -25,6 +31,7 @@ MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
||||
, m_ddsHandler(static_cast<std::shared_ptr<TrainingAreaBase::DdsHandler>>(ddsHandler))
|
||||
, m_domainId(pdp->domainId())
|
||||
, m_exerciseId(pdp->exerciseId())
|
||||
, m_logger(getLogger("MainDispatcher"))
|
||||
{
|
||||
INFO_LOG(m_logger) << "Plugin AdlerJson started";
|
||||
}
|
||||
@@ -80,7 +87,7 @@ bool MainDispatcher::init()
|
||||
void MainDispatcher::onWebsocketConnected(quint16 port)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ApAdler started, Domain Id: " << QString::number(port);
|
||||
m_ddsHandler->pacemaker()->addPort(port, Core::CorePortType::WebSocketAdlerServer);
|
||||
m_ddsHandler->pacemaker()->addPort(port, Core::PortType::WebSocketAdlerServer);
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
}
|
||||
@@ -100,4 +107,4 @@ void MainDispatcher::exerciseChanged()
|
||||
m_adlerDispatcher->exerciseChanged();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
+14
-7
@@ -1,13 +1,19 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MainDispatcher for AdlerJson Plugin
|
||||
* $Id: main_dispatcher.h 62899 2024-05-29 11:08:50Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.h $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include <TrainingAreaBase/dds_handler.h>
|
||||
|
||||
//#include "logger.h"
|
||||
#include "ppm_handler.h"
|
||||
#include "pdm_handler.h"
|
||||
#include "aes_handler.h"
|
||||
@@ -55,7 +61,6 @@ public:
|
||||
const char *name () const override { return tr_lts("dds", "ApHlaJson"); }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
JsonDispatcher *m_adlerDispatcher;
|
||||
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
@@ -74,6 +79,8 @@ private:
|
||||
|
||||
int m_domainId;
|
||||
int m_exerciseId;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
} // namespace AdlerJson
|
||||
|
||||
+336
-357
File diff suppressed because it is too large.
Load diff
+606
-603
File diff suppressed because it is too large.
Load diff
+15
-8
@@ -1,15 +1,22 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace ApHlaJson
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -21,13 +28,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace PatSimJson
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Hla
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <QObject>
|
||||
#include <QWebSocket>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
#include "ppm_handler.h"
|
||||
#include "aes_handler.h"
|
||||
@@ -50,10 +55,8 @@ Q_SIGNALS:
|
||||
void broadcastTelegramsRequest(int equipmentNumber, int broadcastIndex, int resetCounter);
|
||||
void hlaTelegramReceived(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QUrl webSocketUrl() const;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<HlaHandlerRx> m_recvFromHla;
|
||||
std::shared_ptr<HlaHandlerTx> m_sendToHla;
|
||||
@@ -61,6 +64,8 @@ private:
|
||||
QWebSocket *m_webSocket;
|
||||
QTimer *m_webSocketReconnectTimer;
|
||||
bool m_bWarnedOnce;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace HlaJson
|
||||
+12
-6
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Hla
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "dds_handler.h"
|
||||
#include "logger.h"
|
||||
#include "ppm_handler.h"
|
||||
@@ -61,7 +66,6 @@ public:
|
||||
const char *name() const override { return tr_lts("dds", "ApHlaJson"); }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
HlaDispatcher *m_hlaDispatcher;
|
||||
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
@@ -73,7 +77,9 @@ private:
|
||||
std::shared_ptr<PdmHandler> m_pdmHandler;
|
||||
std::shared_ptr<AesHandler> m_aesHandler;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
int m_domainId;
|
||||
int m_exerciseId;
|
||||
};
|
||||
}
|
||||
} // namespace HlaJson
|
||||
+10
-5
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from TX/RX directory
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include "../TetraJson/convert_from_json.h"
|
||||
#include "convert_to_json_file.h"
|
||||
|
||||
@@ -45,4 +50,4 @@ private:
|
||||
QString m_txDir;
|
||||
QString m_rxDir;
|
||||
};
|
||||
}
|
||||
} // namespace TetraRadio
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Hla
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <QObject>
|
||||
#include <QWebSocket>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
|
||||
class QTimer;
|
||||
@@ -41,10 +46,8 @@ Q_SIGNALS:
|
||||
void broadcastTelegramsRequest(int equipmentNumber, int broadcastIndex, int resetCounter);
|
||||
void wlsTelegramReceived(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QUrl webSocketUrl() const;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<HlaHandlerRx> m_recvFromHla;
|
||||
std::shared_ptr<HlaHandlerTx> m_sendToHla;
|
||||
@@ -52,6 +55,8 @@ private:
|
||||
QWebSocket *m_webSocket;
|
||||
QTimer *m_webSocketReconnectTimer;
|
||||
bool m_bWarnedOnce;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace HlaJson
|
||||
+12
-7
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Hla
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
|
||||
namespace HlaJson
|
||||
@@ -31,11 +36,11 @@ public:
|
||||
const char *name() const override { return tr_lts("dds", "HlaJson"); }
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
HlaDispatcher *m_wlsDispatcher;
|
||||
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<TrainingAreaBase::SendToTab> m_mainHandlerTx;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
} // namespace HlaJson
|
||||
+13
-7
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Wls
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
|
||||
namespace Nmea
|
||||
@@ -31,11 +36,12 @@ public:
|
||||
const char *name() const override { return tr_lts("dds", "Nme"); }
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
NmeaDispatcher *m_tetraDispatcher;
|
||||
NGL::Settings *m_settings;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<TrainingAreaBase::SendToTab> m_mainHandlerTx;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
} // namespace NmeaTabPlugin
|
||||
+15
-11
@@ -1,16 +1,21 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from PrtCnv
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtWebSockets/QWebSocketServer>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtNetwork/QUdpSocket>
|
||||
#include <QObject>
|
||||
#include <QWebSocketServer>
|
||||
#include <QWebSocket>
|
||||
#include <QTimer>
|
||||
#include <QUdpSocket>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
|
||||
namespace Nmea
|
||||
@@ -42,12 +47,10 @@ private slots:
|
||||
void readyRead();
|
||||
void reconnectTimerSlot();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void reconnect();
|
||||
QString getNmeaHost();
|
||||
int getNmeaPort();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<NmeaHandlerRx> m_rxHandler;
|
||||
std::shared_ptr<NmeaHandlerTx> m_txHandler;
|
||||
TrainingAreaBase::Plugin::DataProvider *m_dataProvider;
|
||||
@@ -56,7 +59,8 @@ private:
|
||||
QString m_nmeaHost;
|
||||
QUdpSocket *m_socket;
|
||||
QTimer *m_reconnectTimer;
|
||||
NGL::INGLLogger &m_logger;
|
||||
NGL::Settings *m_settings;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace WlsTetra
|
||||
+14
-10
@@ -1,5 +1,10 @@
|
||||
|
||||
|
||||
/**
|
||||
* Instance of the UAS plugin
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, ESZS, 2025-04-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -7,9 +12,9 @@
|
||||
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <TrainingAreaBase/dds_handler.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
|
||||
|
||||
namespace ProjectDataManagement { namespace Interface { class Dtc; } }
|
||||
@@ -37,8 +42,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void *m_handle { nullptr };
|
||||
};
|
||||
|
||||
@@ -52,7 +55,7 @@ public:
|
||||
const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler,
|
||||
NGL::Settings *settings);
|
||||
|
||||
std::shared_ptr<TrainingAreaBase::SendToTab> sendToTab() override;
|
||||
std::shared_ptr<TrainingAreaBase::SendToTab> sendToTab() override; // the implementation / our version if SendToTab, so that TAB can send us telegrams
|
||||
bool isDebugInterface() const override { return false; }
|
||||
bool canSendData() const override;
|
||||
void exerciseChanged() override {}
|
||||
@@ -65,13 +68,14 @@ private:
|
||||
int m_exerciseId;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_sendToDds;
|
||||
NGL::Settings *m_settings;
|
||||
TmsIfModuleHandle m_tmsIfModuleHandle;
|
||||
/*void * */ TmsIfModuleHandle m_tmsIfModuleHandle; //{ nullptr };
|
||||
TmsIfAdapter &m_tmsIfAdapter;
|
||||
std::shared_ptr<TrainingAreaBase::DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_dtcPdm;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Ftc> m_ftcPpm;
|
||||
UAVInterfaceAdapterManager *m_uavIAManager;
|
||||
std::shared_ptr<FromTab> m_fromTab;
|
||||
std::/*unique_ptr*/shared_ptr<FromTab> m_fromTab;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
} // namespace UAS
|
||||
+12
-7
@@ -1,11 +1,16 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Wls
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
|
||||
namespace WlsTetra
|
||||
@@ -32,12 +37,12 @@ public:
|
||||
const char *name() const override { return tr_lts("dds", "WlsTetra"); }
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
WlsDispatcher *m_wlsDispatcher;
|
||||
TetraDispatcher *m_tetraDispatcher;
|
||||
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<TrainingAreaBase::SendToTab> m_mainHandlerTx;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
} // namespace WlsTetra
|
||||
+15
-11
@@ -1,15 +1,20 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from PrtCnv
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtWebSockets/QWebSocketServer>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QObject>
|
||||
#include <QWebSocketServer>
|
||||
#include <QWebSocket>
|
||||
#include <QTimer>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <PrtCnv/PrtCnvApplication.hpp>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "tetra_prtcnv.h"
|
||||
#include "logger.h"
|
||||
|
||||
@@ -39,7 +44,6 @@ public:
|
||||
const char *name() const override { return tr_lts("dds", "TETRA"); }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool init(PrtCnv::PrtCnvApplication *prtCnvApp);
|
||||
|
||||
private Q_SLOTS:
|
||||
@@ -47,15 +51,15 @@ private Q_SLOTS:
|
||||
void onSendInitialData();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void disconnectSocket(QWebSocket *s);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<TetraHandlerRx> m_rxHandler;
|
||||
std::shared_ptr<TetraHandlerTx> m_txHandler;
|
||||
TetraPrtCnv *m_tetraPrtCnv;
|
||||
TrainingAreaBase::Plugin::DataProvider *m_dataProvider;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace WlsTetra
|
||||
+13
-8
@@ -1,12 +1,17 @@
|
||||
|
||||
|
||||
/**
|
||||
* Send / Receive telegrams to/from Wls
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
#include <QObject>
|
||||
#include <QWebSocket>
|
||||
#include <TrainingAreaBase/tab_plugin_interface.h>
|
||||
#include <Core/core_types.h>
|
||||
#include <DDS/Core/function_reply_object.h> // tr_lts
|
||||
#include "logger.h"
|
||||
|
||||
class QTimer;
|
||||
@@ -43,10 +48,8 @@ Q_SIGNALS:
|
||||
void wlsTelegramReceived(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele);
|
||||
void wlsTelegramSent(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QUrl webSocketUrl() const;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<WlsHandlerRx> m_recvFromWls;
|
||||
std::shared_ptr<WlsHandlerTx> m_sendToWls;
|
||||
@@ -54,6 +57,8 @@ private:
|
||||
QWebSocket *m_webSocket;
|
||||
QTimer *m_webSocketReconnectTimer;
|
||||
bool m_bWarnedOnce;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace WlsTetra
|
||||
@@ -1,23 +1,28 @@
|
||||
|
||||
|
||||
|
||||
#if BUILD_RTI
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <DDS/DDSConnector/publisher.h>
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <DDS/DTC/generic_dtc_impl.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
|
||||
namespace TrainingAreaBase
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_curMSecSinceEpoch(0)
|
||||
, m_exerciseId(exerciseId),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_exerciseId(exerciseId)
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -44,13 +49,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
|
||||
// Current exercise time
|
||||
m_dtcPartitionTime.reset(m_ddsConnector->createDTC<DTC::PartitionTimeImpl>());
|
||||
assert(m_dtcPartitionTime.get());
|
||||
m_dtcPartitionTime->setSubscriberCallback([this](const Core::PartitionTime & data, DataModification)
|
||||
@@ -58,15 +63,15 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_curMSecSinceEpoch = data.timeStamp();
|
||||
});
|
||||
|
||||
|
||||
// default dts:...
|
||||
m_dtsTab = TrainingAreaBase::Interface::Dts::create(m_ddsConnector);
|
||||
|
||||
|
||||
// enable all ...
|
||||
bool bRet = m_dtsTab->enableAll();
|
||||
|
||||
// ... but not EmergencyCall:
|
||||
m_dtsTab->enableEmergencyCall(false);
|
||||
|
||||
|
||||
// instead, prepare publishing of EmergencyCall to 'AllExercises':
|
||||
m_dtsEmergencyCallPublisher = std::make_shared<DDSConnector::Publisher>(m_ddsConnector->getDomainParticipant(),
|
||||
DDSConnector::DdsConnector::getPartitionString(IDL::PartitionType::AllExercises));
|
||||
m_dtsEmergencyCall = std::make_shared<DTS::EmergencyCallImpl>(m_ddsConnector->getDomainParticipant(),
|
||||
@@ -93,6 +98,4 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return bRet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // BUILD_RTI
|
||||
} // Namespace PDM
|
||||
@@ -1,11 +1,14 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if BUILD_RTI
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/core_dtc_types.h>
|
||||
#include <DDS/Core/core_dtc_types.h>
|
||||
|
||||
#include <TrainingAreaBase/tab_dts_types.h>
|
||||
#include <TrainingAreaBase/tab_dts.h>
|
||||
@@ -49,7 +52,6 @@ public:
|
||||
int getExerciseId() const { return m_exerciseId;}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<DTC::PartitionTimeImpl> m_dtcPartitionTime;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
@@ -64,8 +66,7 @@ private:
|
||||
|
||||
qint64 m_curMSecSinceEpoch = 0;
|
||||
int m_exerciseId;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // BUILD_RTI
|
||||
@@ -1,15 +1,19 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for TetraRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
#include "logger.h"
|
||||
#include "WebSocketInterface/Messages/reply_message.h"
|
||||
#include "WebSocketInterface/json_keys.h"
|
||||
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <LtsPluginManager/lts_plugin_loader.h>
|
||||
#include <TrainingAreaBase/tab_record_replay_plugin.h>
|
||||
@@ -18,9 +22,9 @@
|
||||
#include <nglsettings/nglsettings_connections.h>
|
||||
#include <ngldb/nsqlquery.h>
|
||||
|
||||
#include <QtCore/QUuid>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
#include <QUuid>
|
||||
#include <QJsonDocument>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
namespace TrainingAreaBase
|
||||
{
|
||||
@@ -29,6 +33,7 @@ MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_handlerWebSocket(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
@@ -54,12 +59,12 @@ MainHandler::~MainHandler()
|
||||
|
||||
bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
|
||||
// initialize database
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
|
||||
if (!m_dbHandler->init(exerciseId, Settings::settings()))
|
||||
return false;
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
return false;
|
||||
@@ -86,17 +91,52 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
m_ismHandler = std::make_shared<IsmHandler>(this);
|
||||
if (!m_ismHandler->init())
|
||||
return false;
|
||||
/*
|
||||
* Es gibt den Fall der Initialisierung, wenn der TAB Prozess neu gestartet wird.
|
||||
* Ist ein ABG zu diesem Zeitpunkt angemeldet und wird danach ein anderer Teilnehmer mit dem selben ABG angemeldet,
|
||||
* bleibt das Risiko bestehen, dass zwei Teilnehmer dasselbe ABG zum gleichen Zeitpunkt anzeigen.
|
||||
*
|
||||
*
|
||||
NSqlQuery q(databaseConnection());
|
||||
|
||||
TrainingAreaBase::RecordReplayPluginCustom *tabRecordReplay;
|
||||
tabRecordReplay = new TrainingAreaBase::RecordReplayPluginCustom;
|
||||
tabRecordReplay->initDtc(nullptr, exerciseId);
|
||||
|
||||
TrainingAreaBase::RecordReplayPlugin recordReplay;
|
||||
recordReplay.initDtc(nullptr, exerciseId);
|
||||
|
||||
if (!recordReplay.readParticipantSanitaryMaterialStockReportAt(q, QDateTime::currentMSecsSinceEpoch()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not read ParticipantSanitaryMaterialStockReport";
|
||||
// return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto &latestStock = tabRecordReplay->getParticipantSanitaryMaterialStockReportMap();
|
||||
|
||||
ERROR_LOG(m_logger) << "Starting to latest ParticipantSanitaryMaterialStock. Size: "
|
||||
<< latestStock.size();
|
||||
|
||||
for (const auto &stock : latestStock)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Stock for equipment number " << stock.equipmentNumber();
|
||||
if (stock.uniqueId() > 0 && !m_uniqueId2EquipmentNumber.contains(stock.uniqueId()))
|
||||
m_uniqueId2EquipmentNumber.insert(stock.uniqueId(), stock.equipmentNumber());
|
||||
}
|
||||
}
|
||||
|
||||
tabRecordReplay->deleteLater();
|
||||
*/
|
||||
}
|
||||
m_posHandler = std::make_shared<PositionHandler>(this);
|
||||
if (!m_posHandler->init())
|
||||
return false;
|
||||
|
||||
|
||||
// to TrainingArea
|
||||
m_txHandler = std::make_shared<TxMixin>();
|
||||
|
||||
|
||||
// from DDS
|
||||
m_ftsHandler = std::make_shared<RecvFromDdsFts>(this,
|
||||
m_ddsHandler->ftsTab(),
|
||||
m_txHandler);
|
||||
@@ -108,10 +148,10 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// to DDS
|
||||
m_rxHandler = std::make_shared<SendToDds>(this);
|
||||
|
||||
|
||||
// to/from TrainingArea
|
||||
auto cb = [&](const LtsPluginManager::PluginInstance &pi) { return loadPlugin(pi); };
|
||||
LtsPluginManager::LtsPluginLoader::getInstance()->loadPlugins(LtsPluginManager::PluginType::SPECIAL,
|
||||
cb,
|
||||
@@ -129,7 +169,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
|
||||
|
||||
|
||||
|
||||
// WebSocketServer
|
||||
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
|
||||
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler successful.";
|
||||
|
||||
@@ -138,7 +178,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
return false;
|
||||
}
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::CorePortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
|
||||
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler successful.";
|
||||
|
||||
|
||||
@@ -155,7 +195,7 @@ ProjectDataManagement::RadioGroup MainHandler::exerciseRadioGroup() const
|
||||
{
|
||||
if (exerciseId() == 0)
|
||||
{
|
||||
|
||||
// for exercise 0 we have to look for a base grp
|
||||
const QMap<int, ProjectDataManagement::RadioGroup> radioGrps = m_pdmHandler->radioGroups();
|
||||
|
||||
for (auto it = radioGrps.begin(); it != radioGrps.end(); ++it)
|
||||
@@ -205,7 +245,7 @@ TetraIcd::ExerciseEnvironmentData MainHandler::exerciseEnvironmentData() const
|
||||
TetraIcd::ExerciseEnvironmentData exData;
|
||||
exData.exerciseId = exerciseId();
|
||||
const auto &baseCoord = m_posHandler->baseCoordinate();
|
||||
|
||||
// 32UPD
|
||||
const QString zone = baseCoord.mgrs(0, false);
|
||||
if (zone.isEmpty())
|
||||
return exData;
|
||||
@@ -292,8 +332,8 @@ void MainHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, Da
|
||||
if (modType == DataModification::eModified)
|
||||
m_txHandler->txData(exerciseStateData());
|
||||
|
||||
|
||||
for (const std::shared_ptr<Plugin::Interface> &ifc : std::as_const(m_interfaces))
|
||||
// update Interfaces
|
||||
for (const std::shared_ptr<Plugin::Interface> &ifc : qAsConst(m_interfaces))
|
||||
ifc->exerciseChanged();
|
||||
}
|
||||
|
||||
@@ -308,7 +348,7 @@ void MainHandler::onConnectionState(const QString &name, bool connectionState)
|
||||
if (itC != m_ifcConnectionState.end())
|
||||
{
|
||||
if (itC.value() == connectionState)
|
||||
return;
|
||||
return; // already send to DDS
|
||||
itC.value() = connectionState;
|
||||
}
|
||||
else
|
||||
@@ -347,13 +387,13 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
|
||||
if (biteData.equipNo <= 0)
|
||||
return;
|
||||
|
||||
|
||||
// configuration errors
|
||||
for (int it = 0 ; it < 32; it++)
|
||||
{
|
||||
quint32 bitValue = 1U << it;
|
||||
QString name;
|
||||
QString isOk;
|
||||
for (const ProjectDataManagement::CanComponentString &ccs : std::as_const(m_ccsMap))
|
||||
for (const ProjectDataManagement::CanComponentString &ccs : qAsConst(m_ccsMap))
|
||||
{
|
||||
if (ccs.bitMask() == bitValue)
|
||||
{
|
||||
@@ -382,7 +422,7 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// basic errors
|
||||
if(configError != 0)
|
||||
{
|
||||
WebSocketInterface::Messages::BiteDataMessage::BasicError error;
|
||||
@@ -396,8 +436,8 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
|
||||
biteData.basicErrors.append(error);
|
||||
}
|
||||
|
||||
|
||||
for (const auto &ele : std::as_const(biteError))
|
||||
// componentErrors
|
||||
for (const auto &ele : qAsConst(biteError))
|
||||
{
|
||||
QString text;
|
||||
QJsonObject error = ele.toObject();
|
||||
@@ -488,4 +528,4 @@ void MainHandler::onPositionChanged(int equipNo, const ParticipantManagement::Pa
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace TrainingAreaBase
|
||||
@@ -1,8 +1,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* Handle incoming Function Topic Requests (and send them to Tetra)
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "recv_from_dds_fts.h"
|
||||
#include <utility>
|
||||
#include "main_handler.h"
|
||||
#include "ism_handler.h"
|
||||
#include "settings.h"
|
||||
@@ -50,6 +54,7 @@ RecvFromDdsFts::RecvFromDdsFts(MainHandler *mainHandler, const std::shared_ptr<I
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_ftsTab(ftsTab)
|
||||
, m_txCallback(txCallback)
|
||||
, m_logger(getLogger("RecvFromDdsFts"))
|
||||
{
|
||||
m_categorieData = loadRemainEffectStructMap();
|
||||
}
|
||||
@@ -60,7 +65,7 @@ void RecvFromDdsFts::onDemandBiteRequest(const rti::core::SampleIdentity &cookie
|
||||
data.withSelfTest = request.withSelfTest();
|
||||
|
||||
bool bRet = true;
|
||||
|
||||
// TODO: fixme
|
||||
for (const int equipNo : request.equipmentNumbers())
|
||||
{
|
||||
data.header.equipmentNumber = equipNo;
|
||||
@@ -80,7 +85,7 @@ void RecvFromDdsFts::onDemandInitRequest(const rti::core::SampleIdentity &cookie
|
||||
data.restockCharges = request.restockCharges();
|
||||
data.restockSanitationMaterial = request.restockSanitationMaterial();
|
||||
bool bRet = true;
|
||||
|
||||
// TODO: fixme
|
||||
for (const int equipNo : request.equipmentNumbers())
|
||||
{
|
||||
data.header.equipmentNumber = equipNo;
|
||||
@@ -119,7 +124,7 @@ void RecvFromDdsFts::onDemandVulnerabilityStateChangeRequest(const rti::core::Sa
|
||||
data.vulnerabilityVitalityIndex = getVulnerabilityVitalityIndexFromVitalityAndVba(request.vulnerabilityKind(), request.vitality());
|
||||
|
||||
bool bRet = true;
|
||||
|
||||
// TODO: fixme
|
||||
for (const int equipNo : request.equipmentNumbers())
|
||||
{
|
||||
data.header.equipmentNumber = equipNo;
|
||||
@@ -145,7 +150,7 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti
|
||||
request.subject().is_set() &&
|
||||
request.message().is_set())
|
||||
{
|
||||
|
||||
// Message to O/C
|
||||
TetraIcd::EquipmentMessageOC data;
|
||||
data.senderId = request.sender().get();
|
||||
data.subject = request.subject().get();
|
||||
@@ -153,7 +158,7 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti
|
||||
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
bool bRet = true;
|
||||
|
||||
// TODO: fixme
|
||||
for (const int equipNo : request.equipmentNumbers())
|
||||
{
|
||||
data.header.equipmentNumber = equipNo;
|
||||
@@ -178,7 +183,7 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti
|
||||
return;
|
||||
}
|
||||
bool bRet = true;
|
||||
|
||||
// TODO: fixme
|
||||
for (const int equipNo : request.equipmentNumbers())
|
||||
{
|
||||
data.header.equipmentNumber = equipNo;
|
||||
@@ -250,42 +255,42 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitRequest: " << request.equipmentNumber() << " - " << request.effectTime()
|
||||
<< " request.chargeTypeId=" << request.chargeTypeId()
|
||||
<< " request.pdmEventType()=" << request.pdmEventType()
|
||||
<< " request.eventType()=" << request.eventType()
|
||||
<< " request.aesId()=" << request.aesId()
|
||||
<< " aesTypeFromId=" << m_mainHandler->aesHandler()->aesTypeFromId(request.aesId());
|
||||
|
||||
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as SendCesHitRequest does not contain values
|
||||
if (m_mainHandler->pdmHandler()->isSmartChargeType({request.chargeTypeId(), 0,0}))
|
||||
{
|
||||
|
||||
// special handling for smart - must be send as singleFire
|
||||
m_ftsTab->sendCesHitReply(cookie,
|
||||
fillFro(request.participantId(),
|
||||
m_mainHandler->aesHandler()->sendSingleFireSMArt(request)));
|
||||
return;
|
||||
}
|
||||
TetraIcd::CesHitRequest data;
|
||||
|
||||
//test
|
||||
data.reserve2 = request.originatorEquipmentNumber();
|
||||
data.reserve1 = request.chargeTypeId();
|
||||
data.header.equipmentNumber = request.equipmentNumber();
|
||||
data.header.timeStamp = request.effectTime();
|
||||
const auto &ct = m_mainHandler->pdmHandler()->chargeTypeFromId(request.chargeTypeId());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ((request.pdmEventType() == ProjectDataManagement::PdmEventType::HitBuilding) && (ct.legacyId() > 0))
|
||||
// GUEZE-359 Steilfeuer mit Sekundaerwirkung wird als Mun 371, ... gesendet. Fuehrt zu Treffer DUS statt WirkSim
|
||||
//#ifdef GUEZ_MODE
|
||||
// if ( request.chargeTypeId() > 370 && request.chargeTypeId() < 390 )
|
||||
// {
|
||||
// data.chargeTasCodeDirect = 201; // immer den direkten code (fuer wirkfelder: pseudo-osag code >= 201)
|
||||
// data.chargeTasCodeIndirect = 201;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// data.chargeTasCodeDirect = ct.id(); // immer den direkten code (fuer wirkfelder: pseudo-osag code >= 201)
|
||||
// data.chargeTasCodeIndirect = ct.id();
|
||||
// }
|
||||
//#else
|
||||
if ((request.eventType() == ProjectDataManagement::EventType::HitBuilding) && (ct.legacyId() > 0))
|
||||
{
|
||||
data.chargeTasCodeDirect = 201;
|
||||
data.chargeTasCodeDirect = 201; // immer den direkten code (fuer wirkfelder: pseudo-osag code >= 201)
|
||||
data.chargeTasCodeIndirect = 201;
|
||||
}
|
||||
else if (ct.legacyId() > 0)
|
||||
@@ -298,25 +303,30 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
data.chargeTasCodeDirect = ct.id();
|
||||
data.chargeTasCodeIndirect = ct.id();
|
||||
}
|
||||
|
||||
//#endif
|
||||
data.mineId = request.mineId();
|
||||
if (request.aesId() != 0)
|
||||
{
|
||||
|
||||
//data.aesTetraIdUnused = m_mainHandler->aesHandler()->tetraIdFromDdsId(request.aesId());
|
||||
data.aesDdsId = request.aesId();
|
||||
|
||||
data.aesType = m_mainHandler->aesHandler()->aesTypeFromId(request.aesId());
|
||||
|
||||
//TODO: !!!!!! Use new EventType to check which AreaEffectSimulationType will be chosen.
|
||||
if (request.eventType() == ProjectDataManagement::EventType::ExplosionCluster)
|
||||
data.aesType = TetraIcd::AreaEffectSimulationType::ExplosionArea;
|
||||
else
|
||||
data.aesType = m_mainHandler->aesHandler()->aesTypeFromId(request.aesId());
|
||||
/*!
|
||||
\brief Take the new event type attribute to check if its is a HazardArea(DangerZone/Gefahrenbereich)
|
||||
*
|
||||
* */
|
||||
|
||||
|
||||
if ((request.pdmEventType() == ProjectDataManagement::PdmEventType::LeaveHazardDistance) ||
|
||||
(request.pdmEventType() == ProjectDataManagement::PdmEventType::EnterHazardDistance))
|
||||
if ((request.eventType() == ProjectDataManagement::EventType::LeaveHazardDistance) ||
|
||||
(request.eventType() == ProjectDataManagement::EventType::EnterHazardDistance))
|
||||
{
|
||||
INFO_LOG(m_logger) << "HarzardArea: " << request.effectTime();
|
||||
data.reserve1 = request.mineId();
|
||||
data.aesType = TetraIcd::AreaEffectSimulationType::DangerZoneExplosion;
|
||||
}
|
||||
else if (request.pdmEventType() == ProjectDataManagement::PdmEventType::AirSupport)
|
||||
else if (request.eventType() == ProjectDataManagement::EventType::AirSupport)
|
||||
{
|
||||
data.aesType = TetraIcd::AreaEffectSimulationType::AirSupport;
|
||||
}
|
||||
@@ -330,15 +340,15 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
data.remainEffectPercent = request.remainEffectPercent();
|
||||
data.relPosition = m_mainHandler->posHandler()->geographicToRelative(tabPos.position());
|
||||
|
||||
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as SendCesHitRequest does not contain values
|
||||
if (m_mainHandler->pdmHandler()->isSmartChargeType({request.chargeTypeId(),0,0}))
|
||||
data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
|
||||
else if ((request.pdmEventType() == ProjectDataManagement::PdmEventType::HitBuilding) ||
|
||||
(request.pdmEventType() == ProjectDataManagement::PdmEventType::HitEffectSimulation)
|
||||
)
|
||||
else if ((request.eventType() == ProjectDataManagement::EventType::HitBuilding) ||
|
||||
(request.eventType() == ProjectDataManagement::EventType::HitEffectSimulation) // GUEZE-2873 / GUEZE-2888
|
||||
) //Gebäude Sekudärwirkung
|
||||
{
|
||||
data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
|
||||
DEBUG_LOG(m_logger) << "PDM::EventType = " << request.pdmEventType()
|
||||
DEBUG_LOG(m_logger) << "PDM::EventType = " << request.eventType()
|
||||
<< " equipmentNumber=" << request.equipmentNumber()
|
||||
<< " originatorEquipmentNumber=" << data.originatorEquipmentNumber
|
||||
<< " chargeType=" << ct.id()
|
||||
@@ -346,19 +356,19 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
<< " -> remainEffectTasCodeDirect=" << data.remainEffectTasCodeDirect ;
|
||||
}
|
||||
else
|
||||
data.remainEffectTasCodeDirect = request.remainEffectPercent();
|
||||
data.remainEffectTasCodeDirect = request.remainEffectPercent();//calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
|
||||
|
||||
|
||||
// [GUEZE-3469] Funktionsraum dekontaminiert faelschlicherweise
|
||||
if (m_mainHandler->aesHandler()->aesTypeFromId(request.aesId()) == TetraIcd::AreaEffectSimulationType::FunctionalArea)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// GUEZSB60_ICD_52_Zentrale-TNE
|
||||
// 3.3.2.5.9.6 Trefferereignis Sekundärwirkung
|
||||
// 6 = Funktionsraum 0 = verlassen
|
||||
// 1 = betreten Meldung wird einmalig beim Betreten des Funktionraums und beim Verlassen gesendet.
|
||||
// Feld Munitionsart: Betriebsmodus (MS-Byte) / Wartezeit (LS-Byte) für Entgiftungsmaßnahmen
|
||||
// Feld Verursacher: Funktionsraumkennung
|
||||
// Feld Reserve1: Betriebsmodus (MS-Byte) / Wartezeit (LS-Byte) für Instandsetzungsmaßnahmen
|
||||
// Feld Reserve2: Betriebsmodus (MS-Byte) / Wartezeit (LS-Byte) für San.-dienstliche Versorgung
|
||||
|
||||
AreaEffectSimulation::FunctionalArea fa = m_mainHandler->aesHandler()->dtcAes()->functionalArea(request.aesId());
|
||||
DEBUG_LOG(m_logger) << "fa maintMode=" << fa.maintMode()
|
||||
@@ -374,7 +384,7 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
if (fa.deconMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
|
||||
{
|
||||
qint32 msb = AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime << 8;
|
||||
qint32 lsb = fa.deconTime() / 1000 / 60 / 10;
|
||||
qint32 lsb = fa.deconTime() / 1000 / 60 / 10; // dissolution in 10 minute steps
|
||||
data.chargeTasCodeIndirect = msb | lsb;
|
||||
DEBUG_LOG(m_logger) << "deconMode: remainEffectTasCodeDirect=" << data.chargeTasCodeIndirect
|
||||
<< " msb=" << msb
|
||||
@@ -383,7 +393,7 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
if (fa.maintMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
|
||||
{
|
||||
qint32 msb = AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime << 8;
|
||||
qint32 lsb = fa.maintTime() / 1000 / 60 / 10;
|
||||
qint32 lsb = fa.maintTime() / 1000 / 60 / 10; // dissolution in 10 minute steps
|
||||
data.reserve1 = msb | lsb;
|
||||
DEBUG_LOG(m_logger) << "maintMode: reserve1=" << data.reserve1
|
||||
<< " msb=" << msb
|
||||
@@ -392,7 +402,7 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
|
||||
if (fa.medicMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
|
||||
{
|
||||
qint32 msb = AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime << 8;
|
||||
qint32 lsb = fa.medicTime() / 1000 / 60 / 10;
|
||||
qint32 lsb = fa.medicTime() / 1000 / 60 / 10; // dissolution in 10 minute steps
|
||||
data.reserve2 = msb | lsb;
|
||||
DEBUG_LOG(m_logger) << "medicMode: reserve2=" << data.reserve2
|
||||
<< " msb=" << msb
|
||||
@@ -446,7 +456,7 @@ void RecvFromDdsFts::onSendParticipantConfigurationRequest(const rti::core::Samp
|
||||
{
|
||||
TetraIcd::ParticipantConfiguration data;
|
||||
data.header.equipmentNumber = request.equipmentNumber();
|
||||
|
||||
// positioning
|
||||
data.positionIntervallVehicle = request.positionIntervallVehicle();
|
||||
data.positionIntervallPersonell = request.positionIntervallPersonell();
|
||||
data.positionIntervallAircraft = request.positionIntervallAircraft();
|
||||
@@ -454,16 +464,16 @@ void RecvFromDdsFts::onSendParticipantConfigurationRequest(const rti::core::Samp
|
||||
data.heightbarrier = request.heightbarrier();
|
||||
data.faultPositionHandling = static_cast<TetraIcd::ParticipantConfiguration::FaultPositionHandling>(request.faultPositionHandling().underlying());
|
||||
data.switchingPositionIntervall = static_cast<TetraIcd::ParticipantConfiguration::SwitchingPositionIntervall>(request.switchingPositionIntervall().underlying());
|
||||
|
||||
// radio protocoll parameter
|
||||
data.waittimeAdditionalBroadcastDemand = request.waittimeAdditionalBroadcastDemand();
|
||||
data.factorWaittimeIncreaseAtHighload = request.factorWaittimeIncreaseHighload();
|
||||
|
||||
// automatic vulnerability increase
|
||||
data.waittimeAutomaticVulnerabilityIncreaseLevel1 = request.waittimeAutomaticVulnerabilityIncreaseLevel1();
|
||||
data.waittimeAutomaticVulnerabilityIncreaseLevel2 = request.waittimeAutomaticVulnerabilityIncreaseLevel2();
|
||||
data.waittimeAutomaticVulnerabilityIncreaseLevel3 = request.waittimeAutomaticVulnerabilityIncreaseLevel3();
|
||||
|
||||
// optical code
|
||||
data.opticalCode = static_cast<TetraIcd::ParticipantConfiguration::OpticalCode>(request.opticalCode().underlying());
|
||||
|
||||
// vulnerability model
|
||||
data.vulnerabilityModel = request.vulnerabilityModel();
|
||||
data.validTimeOps = request.validTimeOps();
|
||||
|
||||
@@ -474,7 +484,7 @@ void RecvFromDdsFts::onSendParticipantBlockedAreaRequest(const rti::core::Sample
|
||||
{
|
||||
TetraIcd::CesHitRequest data;
|
||||
data.header.equipmentNumber = request.equipmentNumber();
|
||||
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); // TODO
|
||||
data.aesType = TetraIcd::AreaEffectSimulationType::SpecialArea;
|
||||
data.remainEffectPercent = request.blockedAreaMode() == BlockedAreaMode::Enter ? 1 : 0;
|
||||
|
||||
@@ -485,7 +495,7 @@ void RecvFromDdsFts::onSendParticipantBeStillWarningRequest(const rti::core::Sam
|
||||
{
|
||||
TetraIcd::CesHitRequest data;
|
||||
data.header.equipmentNumber = request.equipmentNumber();
|
||||
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); // TODO
|
||||
data.aesType = TetraIcd::AreaEffectSimulationType::BeStillWarning;
|
||||
data.remainEffectPercent = 0;
|
||||
|
||||
@@ -500,7 +510,7 @@ void RecvFromDdsFts::onSendSetSanitationRequest(const rti::core::SampleIdentity
|
||||
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
data.proceduresTaken = request.sanitationProceduresTaken();
|
||||
data.sanitationResult = TetraIcd::SanitationResult::NoEffect;
|
||||
data.sanitationEvaluation = TetraIcd::SanitationEvaluation::Okay;
|
||||
data.sanitationEvaluation = TetraIcd::SanitationEvaluation::Okay; // To have a 0 for TETRA
|
||||
data.uniqeId = 0;
|
||||
data.originatorEquipmentNumber = request.originatorEquipmentNumber();
|
||||
data.qualification = static_cast<TetraIcd::Qualification>(request.qualification().underlying());
|
||||
@@ -528,7 +538,7 @@ void RecvFromDdsFts::onSendSelectiveReammunitionRequest(const rti::core::SampleI
|
||||
|
||||
void RecvFromDdsFts::onSendResetAllDusMinesRequest(const rti::core::SampleIdentity &cookie, const SendResetAllDusMinesRequest &request)
|
||||
{
|
||||
|
||||
// We actually just need to have the call, no contents.
|
||||
Q_UNUSED(request);
|
||||
|
||||
m_mainHandler->aesHandler()->resetAllDusMines();
|
||||
@@ -619,7 +629,7 @@ void RecvFromDdsFts::onSendUasWaypointRequest(const rti::core::SampleIdentity &c
|
||||
|
||||
mission.actions.push_back(action);
|
||||
|
||||
bool ret = m_txCallback->txData(mission);
|
||||
bool ret = m_txCallback->txData(mission); // send waypoint to uav via uas tab plugin
|
||||
m_ftsTab->sendUasWaypointReply(cookie, fillFro(request.equipmentNumber(), ret));
|
||||
}
|
||||
|
||||
@@ -678,7 +688,7 @@ Core::FunctionReplyObject RecvFromDdsFts::fillFro(int participantId, bool bSucce
|
||||
return Core::FunctionReplyObject(participantId, tr_lts("dds", "Error sending telegram to tetra."));
|
||||
}
|
||||
|
||||
|
||||
// Charge Type ID is already baseChargeType
|
||||
int RecvFromDdsFts::getDestructiveCategorie(const int destructiveFactor) const
|
||||
{
|
||||
int categorie = 0;
|
||||
@@ -702,17 +712,17 @@ QMap<int, QVector<RecvFromDdsFts::RemainEffectStruct>> RecvFromDdsFts::loadRemai
|
||||
{
|
||||
QMap<int, QVector<RemainEffectStruct>> map;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// remainingEffects liefert ein Array, in einem QJsonObject "verkleidet".
|
||||
// Dann werden alle keys ermittelt, damit man aus dem Array/QJsonObject
|
||||
// per value() wieder an die eigentlichen values kommt...
|
||||
// Sieht irgendwie sehr kompliziert aus. Sollte remainingEffects vielleicht besser ein array liefern???
|
||||
|
||||
QJsonObject obj = Settings::remainingEffects();
|
||||
|
||||
QVector<RemainEffectStruct> resVec;
|
||||
|
||||
QStringList keyList = obj.keys();
|
||||
for (const auto &key : std::as_const(keyList))
|
||||
for (const auto &key : qAsConst(keyList))
|
||||
{
|
||||
const auto &val = obj.value(key).toObject();
|
||||
|
||||
@@ -721,7 +731,7 @@ QMap<int, QVector<RecvFromDdsFts::RemainEffectStruct>> RecvFromDdsFts::loadRemai
|
||||
|
||||
QStringList x = val.keys();
|
||||
int i=0;
|
||||
for (const auto &resElement : std::as_const(x))
|
||||
for (const auto &resElement : qAsConst(x))
|
||||
{
|
||||
const auto val2 = val.value(resElement).toInt();
|
||||
|
||||
@@ -751,11 +761,11 @@ int RecvFromDdsFts::calculateRemainEffectTasCode(int chargeTypeIdBase, int remai
|
||||
const int categorie = getDestructiveCategorie(destructiveFactor);
|
||||
const auto &value = m_categorieData.value(categorie);
|
||||
|
||||
|
||||
// must be sorted, but loadRemainEffectStructMap() ensures this.
|
||||
for (const auto &remainEffect : value)
|
||||
{
|
||||
if (remainEffectPercent <= remainEffect.remainEffectMax)
|
||||
return (remainEffect.chargeTypeId());
|
||||
return (remainEffect.chargeTypeId()); // always return OSAG as the TNE is not capable of handling ULEIS IED charges (yet).
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Dassow, NLST, 2018-01-23
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.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(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -21,13 +28,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
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);
|
||||
@@ -58,4 +65,4 @@ qint64 DdsHandler::currentPartitionTime() const
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
}
|
||||
|
||||
}
|
||||
} // Namespace PDM
|
||||
@@ -1,9 +1,14 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Dassow, NLST, 2018-01-23
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <Core/core_dtc.h>
|
||||
#include <DDS/Core/core_dtc.h>
|
||||
|
||||
#include <TrainingAreaBaseOC/taboc_dts.h>
|
||||
#include <TrainingAreaBaseOC/taboc_fts.h>
|
||||
@@ -68,7 +73,6 @@ public:
|
||||
qint64 currentPartitionTime() const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
|
||||
@@ -77,6 +81,8 @@ private:
|
||||
std::shared_ptr<Interface::Fts> m_ftsTaboc;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Dts> m_dtsTab;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Fts> m_ftsTab;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,15 +1,21 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for OC-connection to the SFM
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Dassow, NLST, 2018-01-23
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
#include "logger.h"
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace TrainingAreaBaseOC
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_aesDtc(nullptr)
|
||||
, m_aesFtc(nullptr)
|
||||
, m_pdmDtc(nullptr)
|
||||
@@ -18,8 +24,9 @@ MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_rxHandler(nullptr)
|
||||
, m_ftsHandler(nullptr)
|
||||
, m_websocketHandler(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
, m_websocketHandler(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -35,7 +42,7 @@ MainHandler::~MainHandler()
|
||||
|
||||
bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
@@ -43,19 +50,19 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// create AES Dtc
|
||||
m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector());
|
||||
DEBUG_LOG(m_logger) << "Created AES Dtc";
|
||||
|
||||
|
||||
// create AES Ftc
|
||||
m_aesFtc = AreaEffectSimulation::Interface::Ftc::create(m_ddsHandler->ddsConnector());
|
||||
DEBUG_LOG(m_logger) << "Created AES Ftc";
|
||||
|
||||
|
||||
// create PDM Dtc
|
||||
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
|
||||
DEBUG_LOG(m_logger) << "Created PDM Dtc";
|
||||
|
||||
|
||||
// ConnectionHandler
|
||||
m_connectionHandler = std::make_shared<ConnectionHandler>();
|
||||
|
||||
if (!m_connectionHandler->init())
|
||||
@@ -64,10 +71,10 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// to DDS
|
||||
m_rxHandler = std::make_shared<SendToDds>(this);
|
||||
|
||||
|
||||
// CanagHandler / to TrainingArea
|
||||
m_canagHandler = std::make_shared<CanagHandler>(this);
|
||||
|
||||
if (!m_canagHandler->init())
|
||||
@@ -77,7 +84,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// from DDS
|
||||
m_ftsHandler = std::make_shared<RecvFromDdsFts>(this);
|
||||
#ifndef GUEZ_MODE
|
||||
m_websocketHandler = std::make_shared<WebsocketHandler>(this, exerciseId, m_ddsHandler->dtsTaboc(), m_ddsHandler->dtcTaboc());
|
||||
@@ -88,4 +95,4 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace TrainingAreaBaseOC
|
||||
@@ -1,15 +1,22 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, 0)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, 0))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -21,10 +28,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
@@ -43,4 +50,4 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return bRet;
|
||||
}
|
||||
|
||||
}
|
||||
} // Namespace WarehouseManagement
|
||||
+14
-7
@@ -1,16 +1,23 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "dds_handler_exercise.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
DdsHandlerExercise::DdsHandlerExercise(const dds::domain::DomainParticipant &dp, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(dp, IDL::PartitionType::Exercise, exerciseId)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
DdsHandlerExercise::DdsHandlerExercise(const dds::domain::DomainParticipant &dp, int exerciseId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(dp, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_logger(getLogger("DdsHandlerExercise"))
|
||||
{
|
||||
m_ddsConnector->setDomainParticipant(dp);
|
||||
DEBUG_LOG(m_logger) << "DdsHandlerExercise for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
@@ -23,7 +30,7 @@ bool DdsHandlerExercise::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
@@ -36,4 +43,4 @@ bool DdsHandlerExercise::init(const QStringList &qosFileList)
|
||||
return bRet;
|
||||
}
|
||||
|
||||
}
|
||||
} // Namespace WarehouseManagement
|
||||
@@ -1,13 +1,20 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for TetraRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
#include "main_handler.h"
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace WarehouseManagement
|
||||
{
|
||||
|
||||
MainHandler::MainHandler() : QObject(),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler()
|
||||
: QObject()
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -20,7 +27,7 @@ MainHandler::~MainHandler()
|
||||
|
||||
bool MainHandler::init(int domainId)
|
||||
{
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId);
|
||||
if (!m_ddsHandler->init())
|
||||
return false;
|
||||
@@ -47,4 +54,4 @@ bool MainHandler::init(int domainId)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace WarehouseManagement
|
||||
@@ -1,15 +1,22 @@
|
||||
|
||||
|
||||
/**
|
||||
* DdsHandler for DDS
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace WirelessLocationSystem
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, exerciseId)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, exerciseId))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -21,13 +28,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace WirelessLocationSystem
|
||||
+17
-10
@@ -1,16 +1,23 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for TetraRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace WirelessLocationSystem
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_ddsHandler(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -24,7 +31,7 @@ MainHandler::~MainHandler()
|
||||
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;
|
||||
@@ -37,7 +44,7 @@ bool MainHandler::init(int domainId)
|
||||
if (!m_ismHandler->init(this))
|
||||
return false;
|
||||
|
||||
if (!m_wlsHandler->init(m_wlsParticipantHandler.get(),
|
||||
if (!m_wlsHandler->init(m_wlsParticipantHandler.get(), // TODO: if using shared pointers, then *use* them
|
||||
m_wsHandler.get(),
|
||||
Settings::wlsListenPort()))
|
||||
return false;
|
||||
@@ -47,7 +54,7 @@ bool MainHandler::init(int domainId)
|
||||
m_ismHandler,
|
||||
Settings::webSocketListenPort()))
|
||||
return false;
|
||||
m_wlsParticipantHandler->init(m_wsHandler.get(),
|
||||
m_wlsParticipantHandler->init(m_wsHandler.get(), // TODO: if using shared pointers, then *use* them
|
||||
m_wlsHandler.get());
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
@@ -55,4 +62,4 @@ bool MainHandler::init(int domainId)
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace WirelessLocationSystem
|
||||
Reference in new issue
Block a user