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
+95
-73
@@ -1,8 +1,14 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* AreaEffectSimulation - Explosions Edit Dialog
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Steve Tougnia, SLTE, 2023-09-05
|
||||
*/
|
||||
|
||||
#include "aes_explosions_edit_adler.h"
|
||||
|
||||
// #include "aes_explosions_edit_helper.h"
|
||||
#include "aes_effector.h"
|
||||
#include "ui_aes_explosions_edit_adler.h"
|
||||
|
||||
@@ -10,18 +16,18 @@
|
||||
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
||||
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
#include <AreaEffectSimulation/Utils/aes_helper.h>
|
||||
#include <AreaEffectSimulation/Utils/polygons.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
#include <Plugins/AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||
#include <Services/AreaEffectSimulation/Utils/aes_helper.h>
|
||||
#include <Services/AreaEffectSimulation/Utils/polygons.h>
|
||||
#include <Services/ParticipantManagement/ppm_translation.h>
|
||||
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <AreaEffectSimulation/settings.h>
|
||||
#include <Services/AreaEffectSimulation/settings.h>
|
||||
|
||||
#include <AdvancedSymbology/asb_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/Gui/ParticipantSelection/participant_selection.h>
|
||||
#include <Plugins/AdvancedSymbology/asb_data_plugin_interface.h>
|
||||
#include <Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection.h>
|
||||
|
||||
#include <AreaEffectSimulation/aes_translation.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -33,20 +39,23 @@
|
||||
#include <ExerciseManagement/exm_data_plugin_interface.h>
|
||||
#include <LtsElevation/lts_elevation_manager.h>
|
||||
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtWidgets/QSpinBox>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QButtonGroup>
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
#include <QJsonDocument>
|
||||
#include <QSpinBox>
|
||||
#include <QTimer>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
static const char *const VALUE_VALID_PROPERTY_NAME = "VALUE_VALID";
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief ExplosionsEditAdler::ExplosionsEditAdler
|
||||
* \param menuGroup
|
||||
* \param parent
|
||||
*/
|
||||
QString ExplosionsEditAdler::toString(ExplosionsEditAdler::FlighDurationOrPeakHeight val)
|
||||
{
|
||||
switch (val)
|
||||
@@ -64,12 +73,12 @@ QString ExplosionsEditAdler::toString(ExplosionsEditAdler::FlighDurationOrPeakHe
|
||||
return QStringLiteral("PHFD_Unknow");
|
||||
}
|
||||
|
||||
|
||||
// Maximaler Winkel fuer untere Winkelgruppe
|
||||
static double maxAngleUW = 45.0;
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// class ExplosionsEditAdler
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *parent)
|
||||
: BaseEdit(menuGroup, QStringLiteral("ExplosionsEditAdler"), parent)
|
||||
@@ -86,11 +95,11 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
|
||||
m_geometrieButtonGroup->setExclusive(true);
|
||||
|
||||
m_gearClassFilter = {ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar};
|
||||
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
|
||||
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
||||
const bool enableRocket = ps->value(QStringLiteral("aes"), QStringLiteral("enableRocket"), false).toBool();
|
||||
if (enableRocket)
|
||||
m_gearClassFilter += ProjectDataManagement::GearClass::GearClass_Rocket;
|
||||
m_gearClassFilter += ProjectDataManagement::GearClass::Rocket;
|
||||
|
||||
m_uiRequirements->addRequirement(
|
||||
{m_ui->lbxActors,
|
||||
@@ -98,21 +107,21 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
|
||||
|
||||
connect(m_ui->pbClear, &QPushButton::clicked, m_ui->positionEdit, &LtsCoordWidget::LtsCoordWidget::clear);
|
||||
|
||||
|
||||
// "Einschießen" is hidden for now
|
||||
m_ui->lblFire->hide();
|
||||
m_ui->einschlJaBtn->hide();
|
||||
m_ui->einschlNoBtn->hide();
|
||||
|
||||
|
||||
// "Wirkungsfeuer" is hidden for now
|
||||
m_ui->lblFire_2->hide();
|
||||
m_ui->wirkungJaBtn->hide();
|
||||
m_ui->wirkungNoBtn->hide();
|
||||
|
||||
|
||||
|
||||
// DMF EffectMarkingInTa hide currently always true
|
||||
// m_ui->cbEffectMarkingInTa->hide();
|
||||
|
||||
m_ui->rbAngleGroupLower->setChecked(true);
|
||||
|
||||
// disable Tab Additional/Charge for now
|
||||
m_ui->tabWidget->setTabEnabled(1, false);
|
||||
m_ui->tabWidget->setTabEnabled(2, false);
|
||||
|
||||
@@ -121,8 +130,9 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief ExplosionsEditAdler::~ExplosionsEditAdler
|
||||
*/
|
||||
ExplosionsEditAdler::~ExplosionsEditAdler()
|
||||
{
|
||||
if (m_sitMapGuiIfc)
|
||||
@@ -130,8 +140,12 @@ ExplosionsEditAdler::~ExplosionsEditAdler()
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief AreaEffectSimulation::ExplosionsEditAdler::init
|
||||
* \param aesItemId
|
||||
* \param session
|
||||
* \return
|
||||
*/
|
||||
bool ExplosionsEditAdler::init(int aesItemId, bool copy, LtsSession::LtsSession *session)
|
||||
{
|
||||
|
||||
@@ -146,7 +160,7 @@ bool ExplosionsEditAdler::init(int aesItemId, bool copy, LtsSession::LtsSession
|
||||
if (!session->getForeignGuiInterface(m_esmActorCbx))
|
||||
return false;
|
||||
|
||||
|
||||
// P _D_ M
|
||||
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get pdmDtc";
|
||||
@@ -162,7 +176,7 @@ bool ExplosionsEditAdler::init(int aesItemId, bool copy, LtsSession::LtsSession
|
||||
m_dtc->waitForHistoricalDataExplosionCluster(1000);
|
||||
m_ftc->enableAcknowledgeExternalAesItem();
|
||||
|
||||
|
||||
// P _P_ M
|
||||
if (!m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
|
||||
{
|
||||
ERROR_LOG(m_logger) << " failed to get ppmDtc";
|
||||
@@ -177,7 +191,7 @@ bool ExplosionsEditAdler::init(int aesItemId, bool copy, LtsSession::LtsSession
|
||||
setEffectClusterData(ecData);
|
||||
|
||||
setPbStateChangeName();
|
||||
m_ui->gbEffectMarkingInTa->setChecked(m_aesItem.effectMarkingInTa());
|
||||
m_ui->gbEffectMarkingInTa->setChecked(m_aesItem.effectMarkingInTa()); // always true for explosion cluster
|
||||
}
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::effectClusterChanged, this, &ExplosionsEditAdler::onEffectClusterChanged, Qt::UniqueConnection);
|
||||
@@ -196,11 +210,12 @@ bool ExplosionsEditAdler::init(int aesItemId, bool copy, LtsSession::LtsSession
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief ExplosionsEditAdlerStandAlone::showPreviewObject
|
||||
*/
|
||||
void ExplosionsEditAdler::showPreviewObject()
|
||||
{
|
||||
if (!has2DMap(false))
|
||||
if (!has2DMap(false)) // showMsgBoxIfNot2D
|
||||
return;
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
@@ -232,16 +247,16 @@ void ExplosionsEditAdler::showPreviewObject()
|
||||
|
||||
bool ExplosionsEditAdler::isDataSufficiant()
|
||||
{
|
||||
|
||||
// identifier:
|
||||
if (m_ui->lblZpNumber->text().isEmpty())
|
||||
return false;
|
||||
|
||||
|
||||
// originator:
|
||||
bool hasParticipant = !m_ui->lblParticipantUnits->text().isEmpty();
|
||||
if (!hasParticipant)
|
||||
return false;
|
||||
|
||||
|
||||
// target:
|
||||
bool bHasTargetArea = !m_coord.isNull();
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
@@ -255,7 +270,7 @@ bool ExplosionsEditAdler::isDataSufficiant()
|
||||
if (!bHasTargetArea)
|
||||
return false;
|
||||
|
||||
|
||||
// ammo
|
||||
const bool bHasAmmo = !m_ui->lblChargeType->text().isEmpty();
|
||||
if (!bHasAmmo)
|
||||
return false;
|
||||
@@ -285,7 +300,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(effectStart);
|
||||
|
||||
|
||||
// Geometry/Area
|
||||
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
|
||||
switch (geometryType)
|
||||
{
|
||||
@@ -305,24 +320,24 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
m_ui->geometrieRadialBtn->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
|
||||
// empty
|
||||
break;
|
||||
}
|
||||
} // switch
|
||||
|
||||
if (ecData.effectDuration() == DEFAULT_EFFECT_DURATION)
|
||||
m_ui->lblDuration->setText(QStringLiteral("---"));
|
||||
else
|
||||
m_ui->lblDuration->setText(QString::number(ecData.effectDuration() / 1000));
|
||||
m_ui->lblDuration->setText(QString::number(ecData.effectDuration() / 1000)); // msecs -> secs
|
||||
|
||||
|
||||
// 1st GearClass
|
||||
ProjectDataManagement::GearClass gc = m_pdmDtc->gearClassFromChargeTypeId(ecData.chargeStruct().chargeTypeId());
|
||||
m_ui->lblGearClass->setText(ProjectDataManagement::toString(gc));
|
||||
|
||||
|
||||
// 2nd Party
|
||||
if (ecData.partyId().is_set())
|
||||
m_ui->lblParty->setText(ParticipantManagement::trPartyName(m_ppmDtc->party(ecData.partyId().get()).name()));
|
||||
|
||||
|
||||
// 3rd Originator
|
||||
if (ecData.participantId().is_set())
|
||||
m_ui->lblParticipantUnits->setText(QString::fromStdString(m_ppmDtc->participant(ecData.participantId().get()).name()));
|
||||
|
||||
@@ -332,7 +347,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
|
||||
int impactCount = 0;
|
||||
|
||||
|
||||
// delete existing widgets
|
||||
QLayoutItem *item = nullptr;
|
||||
while((item = m_ui->layoutEffectors->takeAt(0)) != nullptr)
|
||||
{
|
||||
@@ -350,7 +365,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
m_ui->lblCannons->setText(QString::number(impactCount));
|
||||
m_ui->lblFirePurpose->setText(m_pdmDtc->trFirePurposeName(ecData.firePurposeId()));
|
||||
|
||||
m_ui->lblZog->setText(QString::number(ecData.tla()));
|
||||
m_ui->lblZog->setText(QString::number(ecData.tla())); // tla == zog
|
||||
|
||||
const AreaEffectSimulation::Area &areaRef = ecData.area();
|
||||
const QPointF bottomLeft(areaRef.cornerBottomLeft().lon(), areaRef.cornerBottomLeft().lat());
|
||||
@@ -387,7 +402,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
if (ecData.effectors().size())
|
||||
setOWUWFromTrajectory(ecData.effectors().at(0).trajectoryRelative());
|
||||
|
||||
|
||||
// enable second Actor if possible
|
||||
const int amountFireMarker = m_pdmDtc->getAmountFireMarkers(ecData.firePurposeId());
|
||||
m_ui->cbActors_2->setEnabled(amountFireMarker > 1);
|
||||
|
||||
@@ -408,8 +423,10 @@ void ExplosionsEditAdler::setEffector(int participantId, const AreaEffectSimulat
|
||||
m_effectorNumber++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief ExplosionsEditAdler::dialogIdentifier
|
||||
* \return
|
||||
*/
|
||||
QString ExplosionsEditAdler::dialogIdentifier() const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "dialogIdentifier";
|
||||
@@ -445,7 +462,7 @@ void ExplosionsEditAdler::onEffectClusterChanged(const EffectCluster &ecData, Da
|
||||
if (m_effectClusterData.effectDuration() == DEFAULT_EFFECT_DURATION)
|
||||
m_ui->lblDuration->setText(QStringLiteral("---"));
|
||||
else
|
||||
m_ui->lblDuration->setText(QString::number(m_effectClusterData.effectDuration() / 1000));
|
||||
m_ui->lblDuration->setText(QString::number(m_effectClusterData.effectDuration() / 1000)); // msec -> sec
|
||||
|
||||
enableUiElements();
|
||||
if (unchangeable())
|
||||
@@ -453,6 +470,8 @@ void ExplosionsEditAdler::onEffectClusterChanged(const EffectCluster &ecData, Da
|
||||
m_ui->pbStateChange->setEnabled(false);
|
||||
m_ui->gbEffectMarkingInTa->setEnabled(false);
|
||||
}
|
||||
|
||||
__unchange__();
|
||||
}
|
||||
|
||||
QPointF ExplosionsEditAdler::centerOfFiringUnitGeo(int particpantUnitId)
|
||||
@@ -467,7 +486,7 @@ QPointF ExplosionsEditAdler::centerOfFiringUnitGeo(int particpantUnitId)
|
||||
const LtsUtils::QPoint3D ¢erCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, particpantUnitId, singlePositionsOut_unused, m_logger);
|
||||
if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x()))
|
||||
{
|
||||
|
||||
// may happen in real life: so WARNING_LOG to DEBUG_LOG
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " calculateFiringUnitCenterNonRecursive failed, particpantUnitId = " << particpantUnitId;
|
||||
return {};
|
||||
}
|
||||
@@ -499,11 +518,12 @@ void ExplosionsEditAdler::showCenterOfFiringUnit(int particpantUnitId)
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " END particpantUnitId: " << particpantUnitId;
|
||||
m_sitMapGuiIfc->objectIndicatorToPoint(centerFiringUnitGeo);
|
||||
m_sitMapGuiIfc->objectIndicatorToPoint(centerFiringUnitGeo); // you can provide a duration: lifetimeMsec = -1
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief ExplosionsEditAdler::retranslate
|
||||
*/
|
||||
void ExplosionsEditAdler::retranslate()
|
||||
{
|
||||
QString title = tr("ADLER Artillery");
|
||||
@@ -542,13 +562,15 @@ void ExplosionsEditAdler::enableUiElements(bool enable)
|
||||
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief ExplosionsEditAdler::apply
|
||||
* \return
|
||||
*/
|
||||
bool ExplosionsEditAdler::apply()
|
||||
{
|
||||
|
||||
int esmParticipantId1 = m_ui->cbActors->currentData().toInt();
|
||||
int esmParticipantId2 = m_ui->cbActors_2->currentData().toInt();
|
||||
// DMF (Actors)
|
||||
int esmParticipantId1 = m_ui->cbActors->currentData().toInt(); // participant ID
|
||||
int esmParticipantId2 = m_ui->cbActors_2->currentData().toInt(); // participant ID
|
||||
|
||||
EffectClusterModifyActorRequest request;
|
||||
request.aesId(m_aesItem.id());
|
||||
@@ -568,7 +590,7 @@ bool ExplosionsEditAdler::apply()
|
||||
|
||||
return m_requestHelper->startRequests();
|
||||
}
|
||||
|
||||
//
|
||||
void ExplosionsEditAdler::setPbStateChangeName()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onPbStateChangeName: AesEffectState: " << m_aesItem.effectStateId();
|
||||
@@ -599,7 +621,7 @@ void ExplosionsEditAdler::onPbStateChangeClicked()
|
||||
if (m_ui->gbEffectMarkingInTa->isChecked())
|
||||
apply();
|
||||
|
||||
|
||||
// Re-Enable PB, so we can call it another time, if it does not react...
|
||||
QTimer::singleShot(2000, [this]() { m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire); });
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|
||||
@@ -648,8 +670,8 @@ void ExplosionsEditAdler::onEffectorChanged(const AreaEffectSimulation::Effector
|
||||
|
||||
bool ExplosionsEditAdler::isOnlyNameModifiable() const
|
||||
{
|
||||
|
||||
|
||||
// BaseClass::isOnlyNameModifiable() -> EsPaused || EsActivated
|
||||
// m_effectClusterData.isObjectModifiable -> since PreStart and s_calculationOffsetMSec
|
||||
const bool ret = BaseClass::isOnlyNameModifiable() || !m_effectClusterData.isObjectModifiable();
|
||||
return ret;
|
||||
}
|
||||
@@ -658,7 +680,7 @@ void ExplosionsEditAdler::resetTempAndAnnotationStr()
|
||||
{
|
||||
INFO_LOG(m_logger) << " RESET resetTempAndAnnotationStr";
|
||||
m_temporaryData.reset();
|
||||
|
||||
// updateAnnotationStr();
|
||||
}
|
||||
|
||||
void ExplosionsEditAdler::addAnnotationStr(const QString &newAnno)
|
||||
@@ -740,4 +762,4 @@ void ExplosionsEditAdler::setEffectClusterDataFromJson(const std::string &proper
|
||||
m_ui->lblFiringType->setText(AreaEffectSimulation::toString(firingType));
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace AreaEffectSimulation
|
||||
+537
-378
File diff suppressed because it is too large.
Load diff
+31
-23
@@ -1,18 +1,24 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Namespace for rocket related functions
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Hannes Fritsche, ESZS, 2026-06-03
|
||||
*/
|
||||
|
||||
#include "aes_rocket_utility.h"
|
||||
|
||||
#include <QtWidgets/QComboBox>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QJsonObject>
|
||||
#include <QtGui/QStandardItemModel>
|
||||
#include <QComboBox>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#include <AreaEffectSimulation/aes.hpp>
|
||||
#include <AreaEffectSimulation/Trajectory/trajectory_generator.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <LtsUtils/LtsUtilsCore/qpoint3d.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||
#include <Proxies/TrainingAreaBase/Plugins/AdlerJson/telegrams.h>
|
||||
|
||||
@@ -41,7 +47,7 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
|
||||
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
|
||||
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt());
|
||||
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::GearClass_Rocket)
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
|
||||
{
|
||||
QStandardItem *item = cboModel->item(indexCounter);
|
||||
|
||||
@@ -50,7 +56,7 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
|
||||
|
||||
item->setFlags(item->flags() | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
|
||||
|
||||
|
||||
// we do not break the loop here because there may be more rocket wirkmittel in the future
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -64,7 +70,7 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
|
||||
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
|
||||
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt());
|
||||
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::GearClass_Rocket)
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
|
||||
{
|
||||
QStandardItem *item = cboModel->item(indexCounter);
|
||||
|
||||
@@ -73,14 +79,14 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
|
||||
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEnabled & ~Qt::ItemIsSelectable);
|
||||
|
||||
|
||||
// if rocket ist currently selected, we have to set another index
|
||||
if (indexCounter == currentIndex && wirkmittelCombobox->count() > 1)
|
||||
{
|
||||
const int newIndex = currentIndex == 0 ? 1 : 0;
|
||||
|
||||
wirkmittelCombobox->setCurrentIndex(newIndex);
|
||||
}
|
||||
|
||||
// we do not break the loop here because there may be more rocket wirkmittel in the future
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -132,18 +138,18 @@ void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, c
|
||||
wirkmittel.geschoss.anzahl = currentEffector.chargeAmount();
|
||||
treffpunkt.anzahl = wirkmittel.geschoss.anzahl;
|
||||
|
||||
|
||||
// calculate local x
|
||||
double xLocal = request.area().width() * (static_cast<double>(mhpSliceCounter++) / (request.effectors().size() + 1));
|
||||
|
||||
|
||||
// transform local point to UTM
|
||||
const QPointF localPoint(xLocal, yLocal);
|
||||
const QPointF utmPoint = transform.map(localPoint);
|
||||
|
||||
|
||||
// tranform utm point to geographic WGS84 coordinate
|
||||
const UtmCoordinate currentUtm(areaBottomLeftUtm.zone, utmPoint.x(), utmPoint.y());
|
||||
const QPointF mhpGeo = currentUtm.geographic();
|
||||
|
||||
|
||||
// treffpunkt
|
||||
currentEffector.mhpPosition().lon(mhpGeo.x());
|
||||
currentEffector.mhpPosition().lat(mhpGeo.y());
|
||||
treffpunkt.koordinate.koordinate.longitude = currentEffector.mhpPosition().lon() * LtsCoordTrans::rad2deg();
|
||||
@@ -157,14 +163,14 @@ void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, c
|
||||
|
||||
currentEffector.properties(QJsonDocument(wirkmittelObj).toJson().toStdString());
|
||||
|
||||
|
||||
// trajectory
|
||||
const ParticipantManagement::ParticipantPosition &participantPosition = ppmDtc->participantPosition(currentEffector.participantId());
|
||||
const LtsUtils::QPoint3D trajectoryStart(participantPosition.pos().lon(),
|
||||
participantPosition.pos().lat(),
|
||||
participantPosition.pos().z());
|
||||
const LtsUtils::QPoint3D trajectoryEnd(currentEffector.mhpPosition().lon(),
|
||||
currentEffector.mhpPosition().lat(),
|
||||
currentEffector.mhpPosition().z());
|
||||
currentEffector.mhpPosition().z()); // TODO
|
||||
TrajectoryGeoPosition trajectoryWithoutTime;
|
||||
|
||||
TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime);
|
||||
@@ -173,6 +179,7 @@ void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, c
|
||||
const double flightTimeStep = currentEffector.flightTime() / static_cast<double>(trajectoryWithoutTime.size());
|
||||
double currentFlightTime = 0.0;
|
||||
|
||||
currentEffector.trajectoryRelative().clear(); // LS_711_akkumulierende_flugkurven_bei_rakete
|
||||
const LtsCoordTrans::UtmCoordinate utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPosition.pos().lon(), participantPosition.pos().lat());
|
||||
for (const Core::GeoPosition &pos : trajectoryWithoutTime)
|
||||
{
|
||||
@@ -204,7 +211,7 @@ void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, co
|
||||
wirkmittel.geschoss.anzahl = currentEffector.chargeAmount();
|
||||
treffpunkt.anzahl = wirkmittel.geschoss.anzahl;
|
||||
|
||||
|
||||
// treffpunkt
|
||||
currentEffector.mhpPosition().lon(areaCenterGeo.x());
|
||||
currentEffector.mhpPosition().lat(areaCenterGeo.y());
|
||||
treffpunkt.koordinate.koordinate.longitude = currentEffector.mhpPosition().lon() * LtsCoordTrans::rad2deg();
|
||||
@@ -218,7 +225,7 @@ void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, co
|
||||
|
||||
currentEffector.properties(QJsonDocument(wirkmittelObj).toJson().toStdString());
|
||||
|
||||
|
||||
// trajectory
|
||||
const ParticipantManagement::ParticipantPosition &participantPosition = ppmDtc->participantPosition(currentEffector.participantId());
|
||||
const LtsUtils::QPoint3D trajectoryStart(participantPosition.pos().lon(),
|
||||
participantPosition.pos().lat(),
|
||||
@@ -234,6 +241,7 @@ void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, co
|
||||
const double flightTimeStep = currentEffector.flightTime() / static_cast<double>(trajectoryWithoutTime.size());
|
||||
double currentFlightTime = 0.0;
|
||||
|
||||
currentEffector.trajectoryRelative().clear(); // LS_711_akkumulierende_flugkurven_bei_rakete
|
||||
const LtsCoordTrans::UtmCoordinate utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPosition.pos().lon(), participantPosition.pos().lat());
|
||||
for (const Core::GeoPosition &pos : trajectoryWithoutTime)
|
||||
{
|
||||
@@ -244,8 +252,8 @@ void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, co
|
||||
|
||||
currentFlightTime += flightTimeStep;
|
||||
}
|
||||
}
|
||||
} // for (EffectorData ¤tEffector : request.effectors())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace RocketUtility
|
||||
} // namespace AreaEffectSimulation
|
||||
Reference in new issue
Block a user