Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.cpp
T
berrux-dev 855b0a6101 Remove modules not compiled by this branch's release build
Lts/Common: drop the 17 submodules excluded from the RELEASE_BUILD
branch of Lts/Common/CMakeLists.txt (CodeGen, LtsAppManager, LtsBotan,
LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor,
LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
LtsScriptTimeline, LtsSession, LtsTimeline, LtsTimelineClassic,
LtsVirtualKeyboard, LtsWidgets, TopicEditorBase). Only the 13
subdirectories actually built remain.

TrainingAreaBase: drop sources of targets excluded by
IF(NOT RELEASE_BUILD) / IF(BUILD_RTI) (svcTabClient, svcTabServer,
svcTrainingAreaBase exe, RecordReplayPlugin customization) and the 7
plugin directories not added in the release path (AdlerJson,
ApacheHlaJson, DebugJsonDir, HlaJson, Nmea, UAS, WlsTetra). Only
tabTelegrams, svcTabCommon and the TetraJson plugin are compiled.

Cross-checked: no kept compiled source includes headers from the
removed modules (GuiPluginInterface - the only LtsWidgets consumer -
is itself NOT RELEASE_BUILD-guarded).
2026-10-13 19:19:55 +02:00

68 lines
2.1 KiB
C++
Executable File

#include "aes_handler.h"
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
namespace ApHlaJson
{
AesHandler::AesHandler(QObject *parent)
: QObject(parent)
, m_requestHelper(new LtsUtils::RequestHelper(this))
{}
bool AesHandler::init(MainDispatcher* mainDispatcher)
{
m_ftcAes = AreaEffectSimulation::Interface::Ftc::create(mainDispatcher->ddsHandler()->ddsConnector());
m_dtcPpm = ParticipantManagement::Interface::Dtc::create(mainDispatcher->ddsHandler()->ddsConnector());
if (!m_ftcAes)
return false;
if (!m_ftcAes->enableAirSupportImpactModify())
{
ERROR_LOG(m_logger) << "Can not enableAirSupportImpactModify ";
return false;
}
return true;
}
bool AesHandler::sendAesModifyRequest(const QJsonObject &data)
{
int equipmentNumber = data[QStringLiteral("header")].toObject()[QStringLiteral("equipmentNumber")].toInt();
AreaEffectSimulation::AirSupportImpactModifyRequest request;
request.chargeTypeId(data[QStringLiteral("chargeTypeId")].toInt());
request.externalId(data[QStringLiteral("eventId")].toInt());
request.name(data[QStringLiteral("name")].toString().toStdString());
request.impactPosition(Core::GeoPosition2D(data[QStringLiteral("impactPosition")].toObject()[QStringLiteral("lon")].toDouble(),
data[QStringLiteral("impactPosition")].toObject()[QStringLiteral("lat")].toDouble()));
request.flightTime(0);
qint64 requestedTime = static_cast<qint64>(data[QStringLiteral("header")].toObject()[QStringLiteral("timeStamp")].toDouble());
if (requestedTime < QDateTime::currentMSecsSinceEpoch())
requestedTime = QDateTime::currentMSecsSinceEpoch() + 500;
request.effectStart(requestedTime);
QJsonDocument doc(data);
if (equipmentNumber)
request.participantId(m_dtcPpm->participantIdByEquipmentNumber(equipmentNumber));
m_requestHelper->startSingleRequest([this, request]()
{
return m_ftcAes->airSupportImpactModifyRequest(request, this);
});
return true;
}
void AesHandler::onAirSupportImpactModifyReply(const Core::FunctionReplyObject &reply)
{
m_requestHelper->requestReply(reply);
}
}