Remove unused code from the Release 2 scope modules

Trim mostly-deletion changes (~700 lines) across the modules the Release
2 build compiles: unused telegrams and receiver/handler code in
TrainingAreaBase (telegrams, recv_from_dds_aes/fts, ism/main/pdm/position
handlers), dead members in SqlBrowser and ProjectDataManagement,
unused LtsPluginManager loader paths, LtsSession unit-test, WlsTetra and
DdsView cleanups, plus the stale include_directories removal in
Lts/CMakeLists.txt. Continues the Release 2 source prune (keep only what
the build compiles).

Excluded from this commit by design: the machine-specific .envrc
(MIGRATE_PIPELINE_ROOT path fix stays uncommitted) and the untracked
qt5-before/ reference tree.
This commit is contained in:
berrux-dev committed 2026-11-17 17:28:48 +01:00
1 parent e60a860283
commit 84f8cfb41f
45 files changed
+30 -724

No files matched your search

@@ -12,7 +12,6 @@ else()
set(Qt6_WebSockets "")
endif()
SET(SRCS
logger.cpp
logger.h
@@ -8,7 +8,6 @@
*/
#include "logger.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace WlsTetra
@@ -44,17 +44,12 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS
return checkResult(client, message, result);
}
ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: LtsWebSocket::AbstractClientMessage(client, type, typeId, uuid, data)
, m_dataManager(dataManager)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
SendBiteRequest::SendBiteRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: ClientMessage(dataManager, client, type, typeId, uuid, data)
{}
@@ -24,15 +24,10 @@ class DataManager;
namespace ClientMessages
{
class ClientMessageFactory final : public LtsWebSocket::AbstractClientMessageFactory
{
public:
explicit ClientMessageFactory(DataManager *dataManager);
LtsWebSocket::AbstractClientMessage *createMessage(LtsWebSocket::ReplyHandler *client,
const QString &message);
@@ -41,8 +36,6 @@ private:
};
class ClientMessage : public LtsWebSocket::AbstractClientMessage
{
protected:
@@ -21,9 +21,7 @@ using namespace JsonKeys;
namespace Messages
{
QString ReplyMessage::toJsonString() const
{
return QString::fromUtf8(QJsonDocument(m_jsonRepresentation).toJson(QJsonDocument::Compact));
@@ -35,8 +33,6 @@ ReplyMessage::ReplyMessage(const QString &type, const int typeId, const QString
}
OkMessage::OkMessage(const OkMessage::OkData &data)
: ReplyMessage(OK(), 1, data.uuid)
{
@@ -47,8 +43,6 @@ OkMessage::OkMessage(const OkMessage::OkData &data)
}));
}
ErrorMessage::ErrorMessage(const ErrorMessage::ErrorData &data)
: ReplyMessage(ERROR_(), -1, data.uuid)
{
@@ -59,9 +53,6 @@ ErrorMessage::ErrorMessage(const ErrorMessage::ErrorData &data)
}));
}
QJsonObject BiteDataMessage::ErrorText::toJson() const
{
return QJsonObject({{LANG(), lang},
@@ -81,7 +72,6 @@ QJsonObject BiteDataMessage::BasicError::toJson() const
return QJsonObject({{ERROR_TEXT(), text}});
}
QJsonObject BiteDataMessage::BiteError::toJson() const
{
return QJsonObject({{ERROR_TEXT(), vecToPath(errorTexts)},
@@ -92,7 +82,6 @@ QJsonObject BiteDataMessage::BiteError::toJson() const
});
}
BiteDataMessage::BiteDataMessage(const BiteDataMessage::BiteData &data, const QString &uuid)
: ReplyMessage(BITE_DATA(), 2, uuid)
{
@@ -108,7 +97,6 @@ BiteDataMessage::BiteDataMessage(const BiteDataMessage::BiteData &data, const QS
}));
}
PositionMessage::PositionMessage(const PositionMessage::PositionData &data, const QString &uuid)
: ReplyMessage(POSITION_DATA(), 3, uuid)
{
@@ -120,9 +108,6 @@ PositionMessage::PositionMessage(const PositionMessage::PositionData &data, cons
{LAST_POSITION_UPDATE(), data.gpsTime}
}));
}
}
}
}
@@ -27,11 +27,8 @@ namespace Messages
class ReplyMessage : public LtsWebSocket::ReplyMessage
{
public:
ReplyMessage() = default;
virtual ~ReplyMessage() = default;
virtual QString toJsonString() const;
protected:
@@ -73,7 +70,6 @@ public:
{}
};
class OkMessage final
: public ReplyMessage
{
@@ -7,7 +7,6 @@
*/
#include "dds_handler.h"
#include <DDS/DDSConnector/publisher.h>
#include <DDS/DDSConnector/dds_connector.h>
#include <DDS/Core/pacemaker.h>
@@ -1,6 +1,3 @@
#include "exm_handler.h"
#include "main_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
@@ -34,7 +31,6 @@ ExerciseManagement::Exercise ExmHandler::exercise(int exerciseId)
return m_exmDtc->exercise(exerciseId);
}
void ExmHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
{
if (!data.radioGroupId.has_value() || data.radioGroupId.get() == 0)
@@ -68,6 +64,4 @@ void ExmHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, Dat
if (bExercise2RadioGroupChanged)
emit exercise2RadioGroupChanged();
}
}
@@ -1,6 +1,3 @@
#pragma once
#include <ExerciseManagement/exm_dtc.h>
#include <unordered_map>
@@ -15,9 +12,7 @@ class ExmHandler final : public QObject
Q_OBJECT
public:
explicit ExmHandler(MainHandler *mainHandler);
bool init();
std::unordered_map<int, int> exercise2RadioGroup() const { return m_exercise2RadioGroup; }
ExerciseManagement::Exercise exercise(int exerciseId);
@@ -1,6 +1,4 @@
#include "ism_handler.h"
#include <utility>
#include "main_handler.h"
@@ -42,20 +40,6 @@ bool IsmHandler::init()
ERROR_LOG(m_logger) << "Can not read data from ISM";
return false;
}
return true;
}
@@ -77,8 +61,6 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode)
int assetId = m_dtcIsm->getAssetIdFromOpticalCode(ipsCode);
OpsData opsData;
if ( assetId < 0)
{
WARNING_LOG(m_logger) << "No asset for ops code=" << ipsCode << " found";
@@ -87,14 +69,6 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode)
opsData.opsCode = ipsCode;
opsData.assetId = assetId;
DEBUG_LOG(m_logger) << "OpsData.structureElementId=" << opsData.structureElementId
<< " assetId=" << opsData.assetId
<< " mountingPointTypeId=" << opsData.mountingPointTypeId
@@ -102,14 +76,11 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode)
<< " mainStructureElementId=" << opsData.mainStructureElementId
<< " roomId=" << opsData.roomId;
{
{
DEBUG_LOG(m_logger) <<"---------------- UPDATE OPS-Data ------------------";
updateOpsData(opsData, true);
opsData= m_opsData[opsData.opsCode] ;
}
return opsData;
}
@@ -171,10 +142,8 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou
case DataModification::eModified:
{
OpsData opsData;
opsData.opsCode = m_dtcIsm->getOpticalCodeFromAssetId(data.assetId);
opsData.assetId = data.assetId;
updateOpsData(opsData, true);
break;
}
@@ -189,8 +158,6 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou
void IsmHandler::rotateBuildingFootprint(int mseId)
{
if ( m_relBuildingFootprintsRotated.contains(mseId))
{
DEBUG_LOG(m_logger) << " mainStructureElements.Rotate already done id=" << mseId;
@@ -225,7 +192,6 @@ void IsmHandler::rotateBuildingFootprint(int mseId)
void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType)
{
switch (modType)
{
case DataModification::eAdded:
@@ -234,9 +200,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
int exerciseId = m_mainHandler->ddsHandler()->getExerciseId();
if ( !m_dtcIsm->isElementAssignedToExercise(data, exerciseId))
{
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id << " remove";
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id << " remove";
m_buildingBoundingBoxes.remove(data.id);
m_relBuildingFootprints.remove(data.id);
m_relBuildingFootprintsRotated.remove((data.id));
@@ -250,7 +214,6 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
continue;
removeOpsDataByStructureElementId(se.id);
}
QMutableHashIterator<int, OpsData> iter(m_opsData);
while (iter.hasNext())
@@ -267,10 +230,6 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
return;
}
for (const InfrastructureManagement::StructureElement &se : data.elements)
{
if (se.mountingPointTypeId != InfrastructureManagement::MountingPointType::IndoorIPS &&
@@ -284,9 +243,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
updateOpsData(it.value());
}
DEBUG_LOG(m_logger) << " mainStructureElements Vor Rotate id=" << data.id;
QMap<int, InfrastructureManagement::MainFootprint> mainFootprints = m_dtcIsm->getFootprintsByExerciseId(exerciseId);
QMap<int, InfrastructureManagement::MainFootprint> mainFootprints = m_dtcIsm->getFootprintsByExerciseId(exerciseId);
if (mainFootprints.contains(data.id))
{
rotateBuildingFootprint(data.id);
@@ -315,9 +272,7 @@ void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFoot
{
case DataModification::eAdded:
case DataModification::eModified:
{
{
DEBUG_LOG(m_logger) << "mainStructureElements onMainFootprintChanged id=" << data.id;
double minX = 0;
double maxX = 0;
@@ -445,11 +400,8 @@ void IsmHandler::updateOpsData(OpsData &data, bool force)
const auto &mainStructureElements = m_dtcIsm->mainStructureElements();
for (const auto &mse : std::as_const(mainStructureElements))
{
if (!force && !m_dtcIsm->isElementAssignedToExercise(mse, exerciseId))
continue;
for (const InfrastructureManagement::StructureElement &se : mse.elements)
@@ -500,13 +452,9 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons
return false;
}
DEBUG_LOG(m_logger) << "mainStructureElementId=" << mainStructureElementId
<< " position=" << position;
int exerciseId = m_mainHandler->ddsHandler()->getExerciseId();
InfrastructureManagement::MainStructureElement mse = m_dtcIsm->mainStructureElement(mainStructureElementId);
@@ -516,29 +464,21 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons
if (!m_buildingBoundingBoxes.contains(mainStructureElementId))
return false;
TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition);
TetraIcd::RelativePosition relPosition = m_mainHandler->posHandler()->geographicToRelative(position);
DEBUG_LOG(m_logger) << "relBldgPosition=" << relBldgPosition.offsetX << "/" << relBldgPosition.offsetY
<< ", relPosition=" << relPosition.offsetX << "/" << relPosition.offsetY;
QPointF relPositionMgrs(relPosition.offsetX, relPosition.offsetY);
QPolygonF relBuildingFootprint = m_relBuildingFootprintsRotated[mainStructureElementId];
QPointF relPositionF(relPosition.offsetX - relBldgPosition.offsetX, relPosition.offsetY - relBldgPosition.offsetY);
if (relBuildingFootprint.containsPoint(relPositionF, Qt::OddEvenFill))
{
DEBUG_LOG(m_logger) << "Position is inside Building-Footprint";
return true;
}
DEBUG_LOG(m_logger) << "relBuildingFootprint.size=" << relBuildingFootprint.size();
for (int i = 0; i < relBuildingFootprint.size() ; i++)
{
@@ -613,6 +553,4 @@ double IsmHandler::squareLen(const QPointF &p1, const QPointF &p2)
double vy = p2.y() - p1.y();
return vx * vx + vy * vy;
}
}
@@ -1,5 +1,4 @@
#pragma once
#include <QtCore/QObject>
#include <QtCore/QMap>
@@ -41,10 +40,7 @@ public:
bool init();
OpsData dataFromOpsCode(int ipsCode) ;
int getAssetTypeIdFromStructureElementId (int structureElementId) {return m_structure_ElementId2AssetTypeId.value(structureElementId);}
int getAssetTypeIdFromStructureElementId (int structureElementId) {return m_structure_ElementId2AssetTypeId.value(structureElementId);}
bool posInExtendedBuildingFootprint(int mainStructureElementId, const Core::GeoPosition &position, const int mountPointTypeId) const;
private Q_SLOTS:
@@ -67,24 +63,16 @@ private:
NGL::INGLLogger &m_logger;
MainHandler *m_mainHandler;
QHash<int, OpsData> m_opsData;
QHash<int, OpsData> m_opsData;
QMap<int, int> m_structure_ElementId2AssetTypeId;
QMap<int, int> m_structureElementId2AssetId;
QMap<int, int> m_assetId2StructureElementId;
QMap<int, int> m_assetId2StructureElementId;
QMap<int, QRectF> m_buildingBoundingBoxes;
QMap<int, QPolygonF> m_relBuildingFootprints;
QMap<int, QPolygonF> m_relBuildingFootprintsRotated;
QMap<int, QPolygonF> m_relBuildingFootprintsRotated;
QMap<int, QRectF> m_buildingBoundingBoxesMgrs;
QMap<int, QPolygonF> m_relBuildingFootprintsRotatedMgrs;
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_dtcIsm;
int m_distanceIpsToGps;
int m_distanceOpsToGps;
};
@@ -1,8 +1,5 @@
#include "logger.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace TrainingAreaBase
@@ -27,5 +24,4 @@ namespace TrainingAreaBase
abort();
}
}
}
@@ -1,6 +1,4 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
@@ -19,10 +19,8 @@
#include <LtsPluginManager/lts_plugin_loader.h>
#include <TrainingAreaBase/tab_record_replay_plugin.h>
#include <TrainingAreaBase/tab_record_replay_plugin_custom.h>
#include <nglsettings/nglsettings_connections.h>
#include <ngldb/nsqlquery.h>
#include <QUuid>
#include <QJsonDocument>
#include <QSqlDatabase>
@@ -42,18 +40,15 @@ MainHandler::~MainHandler()
LtsPluginManager::LtsPluginLoader::getInstance()->unloadAllPlugins();
m_interfaces.clear();
m_ifcConnectionState.clear();
m_rxHandler.reset();
m_txHandler.reset();
m_ftsHandler.reset();
m_posHandler.reset();
m_ppmHandler.reset();
m_pdmHandler.reset();
m_exmHandler.reset();
m_ismHandler.reset();
m_aesHandler.reset();
m_ddsHandler.reset();
m_dbHandler.reset();
}
@@ -168,8 +163,6 @@ bool MainHandler::init(int domainId, int exerciseId)
for (const std::shared_ptr<Plugin::Interface> &ifc : m_interfaces)
m_txHandler->addTxHandler(ifc->sendToTab());
// WebSocketServer
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler successful.";
@@ -181,8 +174,6 @@ bool MainHandler::init(int domainId, int exerciseId)
}
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::CorePortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler successful.";
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
return true;
}
@@ -234,7 +225,6 @@ bool MainHandler::loadPlugin(const LtsPluginManager::PluginInstance &pi)
connect(ifc.get(), &Plugin::Interface::directMessage, this, &MainHandler::onDirectMessage);
m_interfaces.push_back(ifc);
m_ccsMap = m_pdmHandler->dtc()->canComponentStrings();
m_bctMap = m_pdmHandler->dtc()->biteComponentTexts();
@@ -356,7 +346,6 @@ void MainHandler::onConnectionState(const QString &name, bool connectionState)
{
m_ifcConnectionState.insert(name, connectionState);
}
DEBUG_LOG(m_logger) << "Publishing connection states: " << m_ifcConnectionState.size();
TrainingAreaBase::Connections connections;
@@ -371,17 +360,13 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
{
DEBUG_LOG(m_logger) << "Got direct message " << jsonMessage;
WebSocketInterface::Messages::BiteDataMessage::BiteData biteData;
QJsonObject obj = QJsonDocument::fromJson(jsonMessage).object();
biteData.equipNo = obj.value(WebSocketInterface::JsonKeys::EQUIP_NO()).toInt();
biteData.isLicensed = obj.value(QStringLiteral("doLicence")).toBool();
qint64 biteState = obj.value(QStringLiteral("biteState")).toInt();
qint64 configState = obj.value(QStringLiteral("configState")).toInt();
qint64 batteryState = obj.value(QStringLiteral("batteryState")).toInt();
qint64 configError = obj.value(QStringLiteral("configError")).toInt();
QJsonArray biteError = obj.value(QStringLiteral("biteError")).toArray();
if (biteData.equipNo <= 0)
@@ -515,7 +500,6 @@ void MainHandler::onPositionChanged(int equipNo, const ParticipantManagement::Pa
positionData.equipNo = equipNo;
positionData.pos = pos.pos;
positionData.gpsTime = pos.sampleTime;
WebSocketInterface::Messages::PositionMessage *msg = new WebSocketInterface::Messages::PositionMessage(positionData, QUuid::createUuid().toString());
if (m_handlerWebSocket != nullptr)
@@ -1,5 +1,4 @@
#pragma once
#include <QtCore/QObject>
@@ -24,9 +23,6 @@
#include "tab_plugin_interface.h"
#include "WebSocketInterface/websocket_interface_handler.h"
#include <ngldb/db_service_handler.h>
#include "logger.h"
namespace NGLDB
@@ -65,7 +61,6 @@ public:
std::shared_ptr<PpmHandler> ppmHandler() const { return m_ppmHandler; }
std::shared_ptr<PositionHandler> posHandler() const { return m_posHandler; }
int exerciseId() const override { return m_ddsHandler->ddsConnector()->getPartitionId(); }
bool useTetraScrambling() const override;
ProjectDataManagement::RadioGroup exerciseRadioGroup() const override;
@@ -107,8 +102,7 @@ private:
std::shared_ptr<PositionHandler> m_posHandler;
std::vector<std::shared_ptr<Plugin::Interface>> m_interfaces;
std::shared_ptr<WebSocketInterface::WebSocketInterfaceHandler> m_handlerWebSocket;
ExerciseManagement::Exercise m_exerciseData;
QMap<int, ProjectDataManagement::CanComponentString> m_ccsMap;
QMap<int, ProjectDataManagement::BiteComponentText> m_bctMap;
@@ -1,10 +1,7 @@
#include "pdm_handler.h"
#include <utility>
#include "main_handler.h"
#include <ProjectDataManagement/pdm_dtc.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
@@ -38,8 +35,6 @@ bool PdmHandler::init()
bool PdmHandler::initializePdm()
{
if (!m_dtcPdm->waitForHistoricalDataChargeType(20000) ||
!m_dtcPdm->waitForHistoricalDataGearType(20000) ||
@@ -176,32 +171,11 @@ int PdmHandler::vulnerabilityKindId(int tasVulnerabilityKindId, int equipmentNum
return it.value().taVulnerabilityKind;
}
QMap<int, ProjectDataManagement::RadioGroup> PdmHandler::radioGroups()
{
initializePdm();
return m_radioGroups;
}
static const int s_unknownMarker = 0x80000000;
int PdmHandler::chargeTypeIdFromGearAndChargeTasCode(int gearTasCode, int chargeTasCode)
@@ -1,6 +1,4 @@
#include "position_handler.h"
#include "exm_handler.h"
#include "logger.h"
@@ -50,14 +48,9 @@ bool PositionHandler::initCoordinateConversion() const
const LtsCoordTrans::UtmCoordinate bottomLeft(LtsCoordTrans::UtmCoordinate::fromGeographic(ta.bottomLeft.lon, ta.bottomLeft.lat));
const QPointF mid(bottomLeft.geographic(ta.width / 2, ta.height / 2));
const QPointF mid(bottomLeft.geographic(ta.width / 2, ta.height / 2));
QString mgrs = LtsCoordTrans::mgrsFromGeographic(mid.x(), mid.y(), -1);
mgrs += QStringLiteral("00000000000000");
m_utm2Geographic = LtsCoordTrans::UtmCoordinate::fromMgrs(mgrs);
LtsCoordTrans::UtmCoordinate topRight(bottomLeft);
@@ -116,10 +109,7 @@ QPointF PositionHandler::geographicToRelativePointF(const Core::GeoPosition2D &p
QPointF PositionHandler::geographicToRelativePointF(const Core::GeoPosition &p) const
{
initCoordinateConversion();
const LtsCoordTrans::UtmCoordinate point(LtsCoordTrans::UtmCoordinate::fromGeographic(p.lon, p.lat, m_utm2Geographic.zone));
return QPointF(point.x - m_utm2Geographic.x, point.y - m_utm2Geographic.y);
}
@@ -140,7 +130,6 @@ TetraIcd::RelativePosition PositionHandler::geographicToRelative(const Core::Geo
const LtsCoordTrans::UtmCoordinate &PositionHandler::baseCoordinate() const
{
initCoordinateConversion();
return m_utm2Geographic;
}
@@ -165,8 +154,6 @@ double PositionHandler::speed (const TetraIcd::RelativePosition &relPos, const i
<< " timeStamp=" << timeStamp
<< " lastParticipantPosition=" << lastParticipantPosition.time
<< " deltaTime=" << deltaTime;
double speed = line.length() / (deltaTime / 1000);
return speed;
}
@@ -37,7 +37,6 @@ public:
TetraIcd::RelativePosition geographicToRelative(const Core::GeoPosition2D &p, double z) const;
const LtsCoordTrans::UtmCoordinate &baseCoordinate() const;
static bool isPositionMarkedInvalid(const TetraIcd::RelativePosition &p)
{
static_assert(std::is_integral<decltype(p.offsetX)>::value, "RelativePosition.offsetX must be an integer!");
@@ -48,10 +47,8 @@ public:
(invalidPos == (p.offsetY & threeBytes)));
}
double speed(const TetraIcd::RelativePosition &relPos, const int equipNo, const qint64 timeStamp) const;
bool isTimeToPerformSpeedCheckExceeded(const int equipNo, const qint64 timeStamp, const int maxTime) const;
void setLastPosition(int equipNo, const TrainingAreaBase::TabPosition &pos);
void setLastMountPointTypeId(int equipNo, const int lastMountPointTypeId);
void setLastBuildingId(int equipNo, const int lastBuildingId);
@@ -61,7 +58,6 @@ public:
int lastMountPointTypeId(const int equipNo) const;
int lastBuildingId(const int equipNo) const;
int lastRoomId(const int equipNo) const;
bool isInTrainingArea(const TetraIcd::RelativePosition &relPos) const;
private:
@@ -73,7 +69,6 @@ private:
mutable std::shared_ptr<AssetManagement::Interface::Dtc> m_dtcAsm;
mutable LtsCoordTrans::UtmCoordinate m_utm2Geographic;
QHash<int, ParticipantPosition> m_lastPosition;
mutable QPointF m_relPosBottomLeft;
mutable QPointF m_relPosTopRight;
};
@@ -1,6 +1,4 @@
#include "ppm_handler.h"
#include "main_handler.h"
#include "send_to_tab.h"
@@ -20,9 +20,7 @@ class PpmHandler final : public QObject
Q_OBJECT
public:
explicit PpmHandler(MainHandler *mainHandler);
bool init();
std::shared_ptr<ParticipantManagement::Interface::Dtc> getDtc() { return m_ppmDtc; }
std::unordered_map<int, std::unordered_set<int>> exerciseEquipmentAssignment() const { return m_exerciseEquipmentAssignments; }
@@ -1,6 +1,4 @@
#include "recv_from_dds_aes.h"
#include <utility>
#include "main_handler.h"
@@ -15,15 +13,11 @@
namespace TrainingAreaBase
{
AesStateHandler::AesStateHandler(MainHandler *mainHandler)
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_dbInterface(mainHandler->dbHandler()->db())
, m_exerciseId(mainHandler->exerciseId()) {}
template<>
void RecvFromDdsAes::txData(const TrainingAreaBase::TetraIcd::DusMineReactivation &tele)
{
@@ -38,8 +32,6 @@ bool AesStateHandler::init()
{
const auto cb = [this](const Database::AesId2TaId & item)
{
m_tetraId2ddsId[item.aesTetraId] = item.aesDdsId;
m_ddsId2TetraId[item.aesDdsId] = item.aesTetraId;
DEBUG_LOG(m_logger) << "AES internal DDS id: " << item.aesDdsId << " - tetra id: " << item.aesTetraId;
@@ -59,7 +51,6 @@ bool AesStateHandler::init()
int AesStateHandler::createAesTetraId(int aesDdsId, bool &alreadyExists)
{
alreadyExists = false;
Database::AesId2TaId aes2Ta;
aes2Ta.aesTetraId = getAesTetraId(aesDdsId);
if (aes2Ta.aesTetraId != 0)
@@ -107,9 +98,6 @@ bool AesStateHandler::update(int aesDdsId, int aesTetraId, bool bSentToTetra)
return true;
}
RecvFromDdsAes::RecvFromDdsAes(MainHandler *mainHandler,
const std::shared_ptr<SendToTab> &txCallback,
QObject *parent)
@@ -128,7 +116,6 @@ RecvFromDdsAes::RecvFromDdsAes(MainHandler *mainHandler,
connect(m_checkOutdatedTelegramsTimer, &QTimer::timeout,
this, &RecvFromDdsAes::onCheckOutdatedTelegrams);
m_sendDusMineReactivtionTimer->setSingleShot(true);
m_sendDusMineReactivtionTimer->setInterval(200);
connect(m_sendDusMineReactivtionTimer, &QTimer::timeout,
@@ -372,9 +359,6 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
return true;
}
template <typename T>
void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modType, TetraIcd::AreaEffectSimulationType aesType)
{
@@ -442,8 +426,6 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
}
else
{
if (!(std::is_same<T, AreaEffectSimulation::FunctionalArea>::value) ||
(data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated))
handleSendToTetra(data, aesType);
@@ -545,12 +527,9 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
return;
if (data.aesTypeId != AreaEffectSimulation::AesType::AtMineAreaSingleMines)
return;
if (data.aesItemId == 0)
return;
bool completeUntriggered = true;
for (size_t i = 0; i < data.bitfield.size() && completeUntriggered; ++i)
{
@@ -572,7 +551,6 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
if (completeUntriggered)
return;
auto it = m_currentMineArea.find(data.aesItemId);
if (it != m_currentMineArea.end())
{
@@ -605,9 +583,7 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
}
TetraIcd::MineAreaSingleMineState out;
out.aesDdsId = data.aesItemId;
out.mineCount = data.impactCount;
out.mineState.reserve(data.bitfield.size());
for (const auto &c : data.bitfield)
@@ -625,23 +601,16 @@ void RecvFromDdsAes::onDusMineStateChanged(const AreaEffectSimulation::DusMineSt
if (vec.size() == 0)
return;
for (const auto &mine : vec)
{
if (!m_mainHandler->pdmHandler()->isReactivatableChargeType({mine.chargeTypeId, 0,0}))
continue;
if (mine != m_allReactivatableDusMines.value(mine.eqId))
{
if (!mine.triggered &&
m_allReactivatableDusMines.contains(mine.eqId) && m_allReactivatableDusMines.value(mine.eqId).triggered
)
m_minesToSend << mine.eqId;
m_allReactivatableDusMines.insert(mine.eqId, mine);
}
}
@@ -711,16 +680,11 @@ void setCommonCombatParams(T &out, const S &in, const int aesTetraId)
out.effectDuration = in.effectDuration;
}
void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data, DataModification modType)
{
if (modType == DataModification::eRemoved)
return;
if (data.aesTypeId != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
return;
@@ -728,32 +692,23 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
if (aesItemId <= 0)
return;
const AreaEffectSimulation::ExplosionCluster &aes = m_dtcAes->explosionCluster(aesItemId);
if (aes.id != aesItemId)
return;
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct);
if (!bIsLaserGuidable)
return;
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = data.singleEffects;
if (!singleEffectsRef.empty())
{
bool bAlreadyExists = false;
const int aesTetraId = m_aesStateHandler->createAesTetraId(aesItemId, bAlreadyExists);
DEBUG_LOG(m_logger) << "RecvFromDdsAes::onEffectsChanged(Effects, "
<< aesTetraId << ")";
TetraIcd::CreateAreaExplosion cAes;
setCommonCombatParams(cAes, aes, aesTetraId);
if(cAes.effectStart > 0)
{
@@ -763,11 +718,9 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
cAes.effectStart += (delayMSec);
}
const AreaEffectSimulation::SingleEffect &firstSingleEffect = singleEffectsRef.front();
const Core::GeoPosition &fsePosition = firstSingleEffect.position;
cAes.relCorner = m_posHandler->geographicToRelative(fsePosition);
cAes.width = qRound(aes.area.width);
cAes.height = qRound(aes.area.height);
cAes.rotationAngle = aes.area.rotation;
@@ -784,14 +737,7 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints))
mhPointsRef.emplace_back(m_posHandler->geographicToRelative(pos, 0));
cAes.chargeTypeId = 254;
cAes.chargeTypeId = 254;
txData(cAes);
}
}
@@ -810,9 +756,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirS
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.header.equipmentNumber = 0;
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
@@ -846,7 +790,6 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::BCCo
cAes.validityTimeWind = aes.weatherTimestamp;
cAes.relPositionValidityTimeWind = m_posHandler->geographicToRelative(aes.weatherPosition, 0);
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
@@ -890,8 +833,6 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
cAes.impactCount = aes.cannonCount * aes.cannonRounds;
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct);
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
@@ -903,17 +844,13 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionCluster &aes, int aesTetraId)
{
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct);
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation "
<< ", aes " << aes
<< ", bIsLaserGuidable " << bIsLaserGuidable;
if (bIsLaserGuidable)
{
return;
}
@@ -925,10 +862,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, "
<< aesTetraId << ")";
TetraIcd::CreateAreaExplosion cAes;
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
cAes.width = qRound(aes.area.width);
cAes.height = qRound(aes.area.height);
@@ -948,9 +882,6 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
int chargeTypeId = 0;
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
chargeTypeId = pdm()->legacyChargeTypeIgniterType(aes.chargeStruct.chargeTypeId, aes.chargeStruct.igniterTypeId, aes.chargeStruct.igniterFunctionId);
if (chargeTypeId > 0)
cAes.chargeTypeId = chargeTypeId;
else
@@ -960,7 +891,6 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
if (cAes.chargeTypeId <= 0)
return;
txData(cAes);
}
@@ -979,8 +909,6 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
cAes.header.equipmentNumber = equipmentNumber;
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct));
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
@@ -1002,13 +930,8 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine
TetraIcd::CreateMineArea cAes;
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.layingDepth = aes.width;
cAes.layingDensity = aes.density;
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
@@ -1069,9 +992,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::NCon
cAes.borderLengthOuter = qRound(aes.borderLengthOuter);
cAes.spanAngle = aes.spanAngle;
cAes.rotationAngle = aes.rotationAngle;
cAes.chargeTypeId = aes.chargeStruct.chargeTypeId;
txData(cAes);
}
@@ -1111,9 +1032,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Tech
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(TechnicalArea, "
<< aesTetraId << ")";
TetraIcd::TechnicalArea fAes;
fAes.aesDdsId = aes.id;
fAes.name = aes.name;
fAes.taType = static_cast<TetraIcd::TechnicalArea::Type>(aes.type);
fAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
@@ -1148,15 +1067,12 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::DusS
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::GasPipe &aes, int aesTetraId)
{
Q_UNUSED(aes);
Q_UNUSED(aesTetraId);
}
void RecvFromDdsAes::sendModifyEffectSimulationName(TetraIcd::AreaEffectSimulationType aesType, int aesTetraId, const std::string &name, int aesId)
{
if (aesTetraId == 0)
{
WARNING_LOG(m_logger) << "Trying to modify an effect simulation name but have no aes identification: " << name;
@@ -1167,10 +1083,8 @@ void RecvFromDdsAes::sendModifyEffectSimulationName(TetraIcd::AreaEffectSimulati
TetraIcd::ModifyAreaEffectSimulationName mAes;
mAes.aesType = aesType;
mAes.aesDdsId = aesId;
mAes.aesDdsId = aesId;
mAes.name = name;
txData(mAes);
}
@@ -1181,8 +1095,6 @@ void RecvFromDdsAes::sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationTy
if (aesType == TetraIcd::AreaEffectSimulationType::GasPipeDetonation)
return;
const int aesTetraId = m_aesStateHandler->getAesTetraId(aesDdsId);
if (aesTetraId == 0)
{
@@ -1237,8 +1149,6 @@ void RecvFromDdsAes::sendPauseEffectSimulation(int aesDdsId)
TetraIcd::PauseEffectSimulation dAes;
dAes.aesDdsId = aesDdsId;
txData(dAes);
}
@@ -1269,7 +1179,6 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
TetraIcd::ResumeEffectSimulation dAes;
dAes.aesDdsId = aes.id;
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id,
aes.cannonCount * aes.cannonRounds,
aes.originalEffectDuration,
@@ -1281,7 +1190,6 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
txData(dAes);
}
template<>
void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::ExplosionCluster &aes)
{
@@ -1370,6 +1278,5 @@ void RecvFromDdsAes::fillCentralChangesTable(const T &data)
{
dataChanged(data);
}
}
@@ -1,6 +1,4 @@
#pragma once
#include <QtCore/QObject>
@@ -60,8 +58,6 @@ private:
int m_exerciseId;
};
class RecvFromDdsAes : public QObject
{
Q_OBJECT
@@ -95,21 +91,15 @@ public:
}
void resetAllDusMines();
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> dtcAes() const { return m_dtcAes;}
private:
template<typename T>
void handleEffectSimulation(const T &data, DataModification modType, TetraIcd::AreaEffectSimulationType aesType);
template<typename T>
void fillCentralChangesTable(const T &data);
template <typename T>
void handleSendToTetra(const T &data, TetraIcd::AreaEffectSimulationType aesType);
void onAirSupportImpactChanged(const AreaEffectSimulation::AirSupportImpact &data, DataModification modType);
void onBcContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType);
void onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType);
@@ -147,7 +137,6 @@ private:
static_assert(std::is_base_of<AreaEffectSimulation::AesItem, T>::value, "Given type for sendResumeEffectSimulation is not an aes item!");
}
void doSpecialization(const AreaEffectSimulation::ExplosionArea &data, std::unordered_map<int, AreaEffectSimulation::ExplosionArea> &cont)
{
cont[data.id].remainExplosionNumber = data.remainExplosionNumber; }
@@ -170,8 +159,6 @@ private:
DEBUG_LOG(m_logger) << "new AES Item: " << data;
return true;
}
it->second.effectStateId = data.effectStateId;
doSpecialization(data, cont);
@@ -182,12 +169,11 @@ private:
return false;
}
T tmp(it->second);
tmp.name = data.name; tmp.sampleTime = data.sampleTime; onlyNameChanged = (tmp == data);
tmp.name = data.name;
tmp.sampleTime = data.sampleTime;
onlyNameChanged = (tmp == data);
std::swap(it->second, dataTmp);
DEBUG_LOG(m_logger) << "changed AES Item: " << data;
return true;
}
@@ -202,14 +188,14 @@ private:
bool dataChanged(const AreaEffectSimulation::ExplosionArea &current, bool &onlyNameChanged)
{
AreaEffectSimulation::ExplosionArea copy(current);
copy.remainExplosionNumber = 0; return dataChanged(copy, m_currentExplosionArea, onlyNameChanged);
copy.remainExplosionNumber = 0;
return dataChanged(copy, m_currentExplosionArea, onlyNameChanged);
}
bool dataChanged(const AreaEffectSimulation::ExplosionCluster &current, bool &onlyNameChanged)
{
AreaEffectSimulation::ExplosionCluster copy(current);
copy.remainExplosionNumber = 0; return dataChanged(copy, m_currentExplosionCluster, onlyNameChanged);
copy.remainExplosionNumber = 0;
return dataChanged(copy, m_currentExplosionCluster, onlyNameChanged);
}
bool dataChanged(const AreaEffectSimulation::ExplosionSingle &current, bool &onlyNameChanged)
@@ -240,17 +226,14 @@ private:
{
return dataChanged(current, m_currentGasPipes, onlyNameChanged);
}
bool dataChanged(const AreaEffectSimulation::BoobyTrap &current)
{
bool placeholder;
Q_UNUSED(placeholder);
return dataChanged(current, m_currentBoobyTraps, placeholder);
}
bool dataChanged(const AreaEffectSimulation::OffRouteMine &current)
{
bool placeholder;
@@ -320,7 +303,6 @@ private:
}
std::shared_ptr<PdmHandler> pdm();
template<typename T>
void txData(const T &tele)
{
@@ -348,19 +330,12 @@ private:
std::unordered_map<int, AreaEffectSimulation::TechnicalArea> m_currentTechnicalArea;
std::unordered_map<int, AreaEffectSimulation::DusSingleMine> m_currentDusSingleMine;
std::unordered_map<int, AreaEffectSimulation::GasPipe> m_currentGasPipes;
std::unordered_map<int, AreaEffectSimulation::BoobyTrap> m_currentBoobyTraps;
std::unordered_map<int, AreaEffectSimulation::OffRouteMine> m_currentOffRouteMines;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<SendToTab> m_txCallback;
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
std::shared_ptr<AesStateHandler> m_aesStateHandler;
QMap<int, AreaEffectSimulation::AesEffectState> m_currentEffectState;
QMap<int, AreaEffectSimulation::DusMine> m_allReactivatableDusMines;
QVector<int> m_minesToSend;
@@ -368,7 +343,6 @@ private:
MainHandler *m_mainHandler;
QTimer *m_checkOutdatedTelegramsTimer;
QTimer *m_sendDusMineReactivtionTimer;
QVector<TetraIcd::TrainingAreaTelegram*> m_sentAesTelegrams;
QVector<int> m_sentAesTelegramsAesIds;
};
@@ -11,14 +11,10 @@
#include "main_handler.h"
#include "ism_handler.h"
#include "settings.h"
#include <LtsUtilsCore/json.h>
namespace TrainingAreaBase
{
RecvFromDdsFts::RecvFromDdsFts(MainHandler *mainHandler, const std::shared_ptr<Interface::Fts> &ftsTab,
const std::shared_ptr<SendToTab> &txCallback)
: Interface::Fts::DemandBiteRequestHandler(ftsTab)
@@ -222,7 +218,6 @@ void RecvFromDdsFts::onSendGeopairingDataRequest(const rti::core::SampleIdentity
data.payloadType = TetraIcd::OpaquePayloadDataBase::Type::Geopairing;
data.header.equipmentNumber = request.equipmentNumber;
data.payload = request.payload;
m_ftsTab->sendGeopairingDataReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
@@ -232,7 +227,6 @@ void RecvFromDdsFts::onSendTargetDataRequest(const rti::core::SampleIdentity &co
data.payloadType = TetraIcd::OpaquePayloadDataBase::Type::Target;
data.header.equipmentNumber = request.equipmentNumber;
data.payload = request.payload;
m_ftsTab->sendTargetDataReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
@@ -6,10 +6,8 @@
* $Author$
*/
#include "tab_record_replay_plugin_custom.h"
namespace TrainingAreaBase
{
@@ -67,8 +65,7 @@ bool RecordReplayPluginCustom::ppmDdsTopicsFromDatabase(NSqlQuery &q, qint64 fro
if (!readEquipmentPosition(q, fromTime, toTime)) return false;
if (!readEquipmentState(q, fromTime, toTime)) return false;
if (!readSpecialSensorData(q, fromTime, toTime)) return false;
return true;
}
@@ -1,9 +1,6 @@
#include "training_area_telegrams.h"
#include <utility>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
@@ -12,7 +9,6 @@ namespace TrainingAreaBase
{
namespace TetraIcd
{
JsonException::JsonException(const QJsonObject &obj, const QString &key)
: m_obj(obj)
, m_key(key)
@@ -3063,10 +3059,8 @@ namespace TrainingAreaBase
UAVAction UAVAction::fromJson(const QJsonObject &obj)
{
UAVAction ret;
get(obj, TASK(), ret.task);
get(obj, POSITION(), ret.absPosition);
return ret;
}
@@ -3075,16 +3069,13 @@ namespace TrainingAreaBase
return QJsonObject{{TASK(), enumToJson(task)}, {POSITION(), absPosition.toJson()}};
}
UAVPerformMission UAVPerformMission::fromJson(const QJsonObject &obj)
{
UAVPerformMission ret;
get(obj, HEADER(), ret.header);
get(obj, ACTIONS(), ret.actions);
get(obj, MISSION_NAME(), ret.missionName);
get(obj, MISSION_ID(), ret.missionId);
return ret;
}
@@ -3093,14 +3084,11 @@ namespace TrainingAreaBase
return QJsonObject{{HEADER(), header.toJson()}, {ACTIONS(), arrayToJson(actions)}, {MISSION_NAME(), missionName}, {MISSION_ID(), missionId}};
}
UAVStatus UAVStatus::fromJson(const QJsonObject &obj)
{
UAVStatus ret;
get(obj, HEADER(), ret.header);
get(obj, UAVSTATE(), ret.uavState);
return ret;
}
@@ -3109,14 +3097,11 @@ namespace TrainingAreaBase
return QJsonObject{{HEADER(), header.toJson()}, {UAVSTATE(), enumToJson(uavState)}};
}
UAVRadioLinkConnectionStatus UAVRadioLinkConnectionStatus::fromJson(const QJsonObject &obj)
{
UAVRadioLinkConnectionStatus ret;
get(obj, HEADER(), ret.header);
get(obj, UAVCONNECTIONSTATE(), ret.uavConnectionState);
return ret;
}
@@ -3125,16 +3110,13 @@ namespace TrainingAreaBase
return QJsonObject{{HEADER(), header.toJson()}, {UAVCONNECTIONSTATE(), enumToJson(uavConnectionState)}};
}
UAVMissionStatus UAVMissionStatus::fromJson(const QJsonObject &obj)
{
UAVMissionStatus ret;
get(obj, HEADER(), ret.header);
get(obj, CURRENT_ACTION(), ret.currentAction);
get(obj, CURRENT_MISSION_NAME(), ret.currentMissionName);
get(obj, MISSION_ENDED(), ret.missionEnded);
return ret;
}
@@ -3146,14 +3128,11 @@ namespace TrainingAreaBase
{MISSION_ENDED(), missionEnded}};
}
UAVChangeState UAVChangeState::fromJson(const QJsonObject &obj)
{
UAVChangeState ret;
get(obj, HEADER(), ret.header);
get(obj, REQUESTED_STATE(), ret.requestedState);
return ret;
}
@@ -3165,11 +3144,9 @@ namespace TrainingAreaBase
ExFireReadiness ExFireReadiness::fromJson(const QJsonObject &obj)
{
ExFireReadiness ret;
get(obj, HEADER(), ret.header);
get(obj, PARTY_ID(), ret.partyId);
get(obj, REFERENCE(), ret.reference);
return ret;
}
@@ -3181,7 +3158,6 @@ namespace TrainingAreaBase
ExFiredReport ExFiredReport::fromJson(const QJsonObject &obj)
{
ExFiredReport ret;
get(obj, HEADER(), ret.header);
get(obj, PARTY_ID(), ret.partyId);
get(obj, REFERENCE(), ret.reference);
@@ -3198,7 +3174,6 @@ namespace TrainingAreaBase
ExConfirmationReport ExConfirmationReport::fromJson(const QJsonObject &obj)
{
ExConfirmationReport ret;
get(obj, HEADER(), ret.header);
get(obj, PARTY_ID(), ret.partyId);
get(obj, REFERENCE(), ret.reference);