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
+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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user