Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1718 files changed
+126739
-18495
No files matched your search
+9
@@ -8,6 +8,15 @@
|
||||
#
|
||||
# LIBRARY for AesEffectClusterModel (which is used at AirSupportPlugin)
|
||||
#
|
||||
# Build the targets in this directory as separate translation units (NOT a unity
|
||||
# build). aes_explosions_edit_adler.cpp and
|
||||
# aes_explosions_edit_adler_standalone.cpp each define the same file-scope statics
|
||||
# (VALUE_VALID_PROPERTY_NAME / LAST_VALUE / s_timeUntilMinimumSec, internal linkage,
|
||||
# both in namespace AreaEffectSimulation). Separate TUs keep the copies independent
|
||||
# (legacy structure); a unity TU sees two definitions in one scope and fails with
|
||||
# "redefinition of '... AreaEffectSimulation::...'" (behavior-neutral to disable).
|
||||
set(CMAKE_UNITY_BUILD FALSE)
|
||||
|
||||
# Make ${Qt6_Widgets} optional
|
||||
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Widgets)
|
||||
set(Qt6_Widgets ${Qt6_Widgets})
|
||||
|
||||
+11
-11
@@ -74,14 +74,14 @@ bool CustomViewExplosion::init(const QModelIndex &idx)
|
||||
bool CustomViewExplosion::calculateIcon(const ExplosionArea &area, const QColor &color)
|
||||
{
|
||||
Database::AesExplosionArea ea;
|
||||
ea.impactPosition = QPointF(area.area().cornerBottomLeft().lon(),
|
||||
area.area().cornerBottomLeft().lat());
|
||||
ea.rotationAngle = area.area().rotation();
|
||||
ea.impactWidth = area.area().width();
|
||||
ea.impactLength = area.area().height();
|
||||
ea.impactPosition = QPointF(area.area.cornerBottomLeft.lon,
|
||||
area.area.cornerBottomLeft.lat);
|
||||
ea.rotationAngle = area.area.rotation;
|
||||
ea.impactWidth = area.area.width;
|
||||
ea.impactLength = area.area.height;
|
||||
|
||||
QPolygonF poly = AreaEffectSimulation::Polygons::explosionArea(ea);
|
||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(area.effectStateId());
|
||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(area.effectStateId);
|
||||
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
||||
m_ui->lblIcon->setPixmap(pix);
|
||||
|
||||
@@ -91,17 +91,17 @@ bool CustomViewExplosion::calculateIcon(const ExplosionArea &area, const QColor
|
||||
bool CustomViewExplosion::calculateIcon(const ExplosionSingle &single, const QColor &color)
|
||||
{
|
||||
Database::AesExplosionSingle es;
|
||||
es.impactPosition = QPointF(single.impactPosition().lon(), single.impactPosition().lat());
|
||||
es.impactPosition = QPointF(single.impactPosition.lon, single.impactPosition.lat);
|
||||
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> pdmDtc;
|
||||
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc))
|
||||
return false;
|
||||
|
||||
double radius = pdmDtc->impactRadius(single.chargeStruct().chargeTypeId(),
|
||||
single.chargeStruct().igniterTypeId(),
|
||||
single.chargeStruct().igniterFunctionId());
|
||||
double radius = pdmDtc->impactRadius(single.chargeStruct.chargeTypeId,
|
||||
single.chargeStruct.igniterTypeId,
|
||||
single.chargeStruct.igniterFunctionId);
|
||||
QPolygonF poly = AreaEffectSimulation::Polygons::explosionSingle(es, radius);
|
||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(single.effectStateId());
|
||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(single.effectStateId);
|
||||
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
||||
m_ui->lblIcon->setPixmap(pix);
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
+39
-39
@@ -61,32 +61,32 @@ bool EffectClusterModel::initModel(LtsSession::LtsSession *session)
|
||||
EffectCluster EffectClusterModel::toEffectCluster(const ExplosionCluster &data)
|
||||
{
|
||||
EffectCluster ec;
|
||||
ec.id(data.id());
|
||||
ec.name(data.name());
|
||||
ec.effectSourceId(data.effectSourceId());
|
||||
ec.effectStateId(data.effectStateId());
|
||||
ec.chargeStruct(data.chargeStruct());
|
||||
ec.effectDuration(data.effectDuration());
|
||||
ec.effectStart(data.effectStart());
|
||||
ec.area(data.area());
|
||||
ec.esmParticipantIds(data.esmParticipantIds());
|
||||
ec.explosionGeometry(data.explosionGeometry());
|
||||
ec.element(data.element());
|
||||
ec.firePurposeId(data.firePurposeId());
|
||||
ec.firingPosition(data.firingPosition());
|
||||
ec.fireRequestTime(data.fireRequestTime());
|
||||
ec.tla(data.tla());
|
||||
ec.sampleTime(data.sampleTime());
|
||||
ec.effectMarkingInTa(data.effectMarkingInTa());
|
||||
ec.externalId(data.externalId());
|
||||
ec.remainExplosionNumber(data.remainExplosionNumber());
|
||||
ec.participantId(data.participantId());
|
||||
ec.partyId(data.partyId());
|
||||
ec.properties(data.properties());
|
||||
ec.id = data.id;
|
||||
ec.name = data.name;
|
||||
ec.effectSourceId = data.effectSourceId;
|
||||
ec.effectStateId = data.effectStateId;
|
||||
ec.chargeStruct = data.chargeStruct;
|
||||
ec.effectDuration = data.effectDuration;
|
||||
ec.effectStart = data.effectStart;
|
||||
ec.area = data.area;
|
||||
ec.esmParticipantIds = data.esmParticipantIds;
|
||||
ec.explosionGeometry = data.explosionGeometry;
|
||||
ec.element = data.element;
|
||||
ec.firePurposeId = data.firePurposeId;
|
||||
ec.firingPosition = data.firingPosition;
|
||||
ec.fireRequestTime = data.fireRequestTime;
|
||||
ec.tla = data.tla;
|
||||
ec.sampleTime = data.sampleTime;
|
||||
ec.effectMarkingInTa = data.effectMarkingInTa;
|
||||
ec.externalId = data.externalId;
|
||||
ec.remainExplosionNumber = data.remainExplosionNumber;
|
||||
ec.participantId = data.participantId;
|
||||
ec.partyId = data.partyId;
|
||||
ec.properties = data.properties;
|
||||
|
||||
ec.isCentral(data.isCentral());
|
||||
ec.isDeleted(data.isDeleted());
|
||||
ec.isUsed(data.isUsed());
|
||||
ec.isCentral = data.isCentral;
|
||||
ec.isDeleted = data.isDeleted;
|
||||
ec.isUsed = data.isUsed;
|
||||
|
||||
return ec;
|
||||
}
|
||||
@@ -115,29 +115,29 @@ QVariant EffectClusterModel::data(const QModelIndex &idx, int role) const
|
||||
{
|
||||
case ColGearType:
|
||||
{
|
||||
const int chargeTypeId = ec.chargeStruct().chargeTypeId();
|
||||
const int chargeTypeId = ec.chargeStruct.chargeTypeId;
|
||||
|
||||
const int gearTypeId = m_pdmDtc->gearTypeIdFromChargeTypeId(chargeTypeId).value(0, 0);
|
||||
return m_pdmDtc->trGearTypeName(gearTypeId);
|
||||
}
|
||||
break;
|
||||
case ColIgniterType:
|
||||
return m_pdmDtc->trIgniterTypeShortName(ec.chargeStruct().igniterTypeId());
|
||||
return m_pdmDtc->trIgniterTypeShortName(ec.chargeStruct.igniterTypeId);
|
||||
break;
|
||||
case ColFiringPosition:
|
||||
{
|
||||
const Core::GeoPosition &firingPositionRef = ec.firingPosition();
|
||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(firingPositionRef.lon(), firingPositionRef.lat());
|
||||
if (!qFuzzyIsNull(firingPositionRef.z()))
|
||||
mgrs.append(QStringLiteral(" ") + QString::number(firingPositionRef.z(), 'f', 2));
|
||||
const Core::GeoPosition &firingPositionRef = ec.firingPosition;
|
||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(firingPositionRef.lon, firingPositionRef.lat);
|
||||
if (!qFuzzyIsNull(firingPositionRef.z))
|
||||
mgrs.append(QStringLiteral(" ") + QString::number(firingPositionRef.z, 'f', 2));
|
||||
return mgrs;
|
||||
}
|
||||
break;
|
||||
case ColExplosionGeometry:
|
||||
return AreaEffectSimulation::toString(ec.explosionGeometry());
|
||||
return AreaEffectSimulation::toString(ec.explosionGeometry);
|
||||
break;
|
||||
case ColTlaZog:
|
||||
return ec.tla();
|
||||
return ec.tla;
|
||||
break;
|
||||
|
||||
|
||||
@@ -149,11 +149,11 @@ QVariant EffectClusterModel::data(const QModelIndex &idx, int role) const
|
||||
|
||||
|
||||
case ColAnnotationString:
|
||||
return QString::fromStdString(ec.annotationString());
|
||||
return QString::fromStdString(ec.annotationString);
|
||||
break;
|
||||
|
||||
case ColZpElement:
|
||||
return QString::fromStdString(ec.element());
|
||||
return QString::fromStdString(ec.element);
|
||||
break;
|
||||
|
||||
|
||||
@@ -174,11 +174,11 @@ QVariant EffectClusterModel::data(const QModelIndex &idx, int role) const
|
||||
QString tooltip(QStringLiteral("<html>"));
|
||||
|
||||
const QString &hdr = this->headerData(BcName, Qt::Horizontal, Qt::DisplayRole).toString();
|
||||
tooltip.append(QStringLiteral("<p>%1: %2</p>").arg(hdr, QString::fromStdString(ec.name())));
|
||||
tooltip.append(QStringLiteral("<p>%1: %2</p>").arg(hdr, QString::fromStdString(ec.name)));
|
||||
|
||||
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass::Artillery)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass::Mortar)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass::Rocket);
|
||||
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass::GearClass_Artillery)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass::GearClass_Mortar)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass::GearClass_Rocket);
|
||||
|
||||
toolTipHelper(this, idx, ColGearType, tooltip);
|
||||
if (bIsArtilleryOrMortar)
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
#include <aeseffectclustermodel_export.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ void AesEffector::setState(const AreaEffectSimulation::AesEffectorState &newStat
|
||||
{
|
||||
m_state = newState;
|
||||
|
||||
switch(newState.underlying())
|
||||
switch(newState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectorState::EsNotReadyToFire:
|
||||
m_ui->lblState->setText(tr("Not ready to fire"));
|
||||
@@ -76,7 +76,7 @@ void AesEffector::setState(const AreaEffectSimulation::AesEffectorState &newStat
|
||||
|
||||
void AesEffector::onPbNextStateClicked()
|
||||
{
|
||||
switch (m_state.underlying()) {
|
||||
switch (m_state) {
|
||||
case AreaEffectSimulation::AesEffectorState::EsFired:
|
||||
emit reportFired();
|
||||
break;
|
||||
|
||||
+98
-98
@@ -137,7 +137,7 @@ ExplosionEdit::ExplosionEdit(const QString &menuGroup, ExplosionType type, Proje
|
||||
m_ui->cbParty->setEnabled(false);
|
||||
}
|
||||
else
|
||||
m_uiRequirements->addRequirement({m_ui->lbxParticipant, [this]() { return (m_participant.id() != 0); }});
|
||||
m_uiRequirements->addRequirement({m_ui->lbxParticipant, [this]() { return (m_participant.id != 0); }});
|
||||
|
||||
enaDisa();
|
||||
|
||||
@@ -181,7 +181,7 @@ void ExplosionEdit::retranslate()
|
||||
{
|
||||
QString title;
|
||||
|
||||
switch (m_gearClass.underlying())
|
||||
switch (m_gearClass)
|
||||
{
|
||||
case ProjectDataManagement::GearClass::GearClass_Artillery:
|
||||
if (m_type == etSingle)
|
||||
@@ -217,7 +217,7 @@ void ExplosionEdit::retranslate()
|
||||
m_ui->lblDimension->setText(tr("Dimension [m]:"));
|
||||
}
|
||||
|
||||
setFireButton(m_aesItem.effectStateId());
|
||||
setFireButton(m_aesItem.effectStateId);
|
||||
|
||||
updateMaxLabel(false);
|
||||
}
|
||||
@@ -274,40 +274,40 @@ void ExplosionEdit::enableUiElements(bool enable)
|
||||
if (!enable)
|
||||
{
|
||||
bool hasChanges = hasUnsavedChanges();
|
||||
m_ui->sbDurationSeconds->setValue(m_aesItem.effectDuration() / 1000);
|
||||
m_ui->sbDurationSeconds->setValue(m_aesItem.effectDuration / 1000);
|
||||
if (!hasChanges)
|
||||
__unchange__();
|
||||
}
|
||||
|
||||
setFireButton(m_aesItem.effectStateId());
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|
||||
setFireButton(m_aesItem.effectStateId);
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsExpired)
|
||||
{
|
||||
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
|
||||
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
AesItem baseData;
|
||||
if (m_type == etSingle)
|
||||
{
|
||||
ExplosionSingle singleData = m_dtc->explosionSingle(m_aesItem.id());
|
||||
ExplosionSingle singleData = m_dtc->explosionSingle(m_aesItem.id);
|
||||
setSingleData(singleData);
|
||||
baseData = singleData;
|
||||
}
|
||||
else if (m_type == etArea)
|
||||
{
|
||||
ExplosionArea areaData = m_dtc->explosionArea(m_aesItem.id());
|
||||
ExplosionArea areaData = m_dtc->explosionArea(m_aesItem.id);
|
||||
setAreaData(areaData);
|
||||
baseData = areaData;
|
||||
}
|
||||
setBaseData(baseData, false);
|
||||
setFireButton(baseData.effectStateId());
|
||||
setFireButton(baseData.effectStateId);
|
||||
__unchange__();
|
||||
if (name != m_ui->leIdentifier->text())
|
||||
m_ui->leIdentifier->setText(name);
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsPaused)
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsPaused)
|
||||
__unchange__();
|
||||
}
|
||||
|
||||
@@ -322,23 +322,23 @@ void ExplosionEdit::setBaseData(const AesItem &baseData, bool copy)
|
||||
m_aesItem = baseData;
|
||||
if (copy)
|
||||
{
|
||||
m_aesItem.id(0);
|
||||
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
|
||||
m_aesItem.id = 0;
|
||||
m_aesItem.effectStateId = AreaEffectSimulation::AesEffectState::EsUnknown;
|
||||
}
|
||||
m_ui->leIdentifier->setText(QString::fromUtf8(baseData.name().c_str()));
|
||||
int idx = m_ui->cbChargeType->findData(baseData.chargeStruct().chargeTypeId());
|
||||
m_ui->leIdentifier->setText(QString::fromUtf8(baseData.name.c_str()));
|
||||
int idx = m_ui->cbChargeType->findData(baseData.chargeStruct.chargeTypeId);
|
||||
if (idx < 0)
|
||||
{
|
||||
auto ct = m_chargeTypeMap[baseData.chargeStruct().chargeTypeId()].chargeType;
|
||||
m_ui->cbChargeType->addItem(m_pdmDtc->trChargeTypeShortName(ct.id(), true), ct.id());
|
||||
idx = m_ui->cbChargeType->findData(ct.id());
|
||||
auto ct = m_chargeTypeMap[baseData.chargeStruct.chargeTypeId].chargeType;
|
||||
m_ui->cbChargeType->addItem(m_pdmDtc->trChargeTypeShortName(ct.id, true), ct.id);
|
||||
idx = m_ui->cbChargeType->findData(ct.id);
|
||||
}
|
||||
m_ui->cbChargeType->setCurrentIndex(idx);
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(baseData.effectStart().is_set() ? baseData.effectStart().get() : 0);
|
||||
m_ui->sbDurationSeconds->setValue(baseData.effectDuration() / 1000);
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(baseData.effectStart.has_value() ? baseData.effectStart.get() : 0);
|
||||
m_ui->sbDurationSeconds->setValue(baseData.effectDuration / 1000);
|
||||
|
||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(partyForItem(baseData)));
|
||||
m_ui->cbEffectMarkingInTa->setChecked(baseData.effectMarkingInTa());
|
||||
m_ui->cbEffectMarkingInTa->setChecked(baseData.effectMarkingInTa);
|
||||
m_editable = m_editable && isModifiable() && !isOnlyNameModifiable() && m_session->app() != LtsAppDescriptor::App::OC;
|
||||
|
||||
}
|
||||
@@ -362,7 +362,7 @@ bool ExplosionEdit::init(int aesItemId, bool copy,
|
||||
return false;
|
||||
|
||||
bool readable = false;
|
||||
switch (m_gearClass.underlying())
|
||||
switch (m_gearClass)
|
||||
{
|
||||
case ProjectDataManagement::GearClass::GearClass_Artillery:
|
||||
m_editable = (LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::SingleExplosionsEditArtillery) && m_type == etSingle) ||
|
||||
@@ -427,18 +427,18 @@ bool ExplosionEdit::init(int aesItemId, bool copy,
|
||||
|
||||
const auto firePurposes = m_pdmDtc->firePurposes();
|
||||
for (const auto &firePurpose : firePurposes)
|
||||
m_ui->cbPurpose->addItem(m_pdmDtc->trFirePurposeName(firePurpose.id()), firePurpose.id());
|
||||
m_ui->cbPurpose->addItem(m_pdmDtc->trFirePurposeName(firePurpose.id), firePurpose.id);
|
||||
|
||||
const auto chargesForGearClass =
|
||||
m_pdmDtc->chargesForGearClass(m_gearClass);
|
||||
for (const ProjectDataManagement::ChargeType &chargeType : chargesForGearClass)
|
||||
m_chargeTypeMap[chargeType.id()].chargeType = chargeType;
|
||||
m_chargeTypeMap[chargeType.id].chargeType = chargeType;
|
||||
const auto chargeAdmins = m_dtc->chargeAdministrations();
|
||||
for (const ChargeAdministration &val : chargeAdmins)
|
||||
{
|
||||
if (!m_chargeTypeMap.contains(val.chargeTypeId()))
|
||||
if (!m_chargeTypeMap.contains(val.chargeTypeId))
|
||||
continue;
|
||||
m_chargeTypeMap[val.chargeTypeId()].available.insert(val.partyId(), val.amount() - val.planned());
|
||||
m_chargeTypeMap[val.chargeTypeId].available.insert(val.partyId, val.amount - val.planned);
|
||||
}
|
||||
|
||||
m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty);
|
||||
@@ -460,7 +460,7 @@ bool ExplosionEdit::init(int aesItemId, bool copy,
|
||||
baseData = areaData;
|
||||
}
|
||||
setBaseData(baseData, copy);
|
||||
setFireButton(baseData.effectStateId());
|
||||
setFireButton(baseData.effectStateId);
|
||||
}
|
||||
else
|
||||
setFireButton(AreaEffectSimulation::AesEffectState::EsUnknown);
|
||||
@@ -479,22 +479,22 @@ bool ExplosionEdit::init(int aesItemId, bool copy,
|
||||
|
||||
QString ExplosionEdit::dialogIdentifier() const
|
||||
{
|
||||
switch (m_gearClass.underlying())
|
||||
switch (m_gearClass)
|
||||
{
|
||||
case ProjectDataManagement::GearClass::GearClass_Artillery:
|
||||
if (m_type == etSingle)
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionSingleArtillery") : QStringLiteral("EditExplosionSingleArtillery%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionSingleArtillery") : QStringLiteral("EditExplosionSingleArtillery%1").arg(m_aesItem.id);
|
||||
else if (m_type == etArea)
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionAreaArtillery") : QStringLiteral("EditExplosionAreaArtillery%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionAreaArtillery") : QStringLiteral("EditExplosionAreaArtillery%1").arg(m_aesItem.id);
|
||||
else
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionSingleCentralArtillery") : QStringLiteral("EditExplosionSingleCentralArtillery%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionSingleCentralArtillery") : QStringLiteral("EditExplosionSingleCentralArtillery%1").arg(m_aesItem.id);
|
||||
case ProjectDataManagement::GearClass::GearClass_Mortar:
|
||||
if (m_type == etSingle)
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionSingleMortar") : QStringLiteral("EditExplosionSingleMortar%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionSingleMortar") : QStringLiteral("EditExplosionSingleMortar%1").arg(m_aesItem.id);
|
||||
else if (m_type == etArea)
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionAreaMortar") : QStringLiteral("EditExplosionAreaMortar%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionAreaMortar") : QStringLiteral("EditExplosionAreaMortar%1").arg(m_aesItem.id);
|
||||
else
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionSingleCentralMortar") : QStringLiteral("EditExplosionSingleCentralMortar%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionSingleCentralMortar") : QStringLiteral("EditExplosionSingleCentralMortar%1").arg(m_aesItem.id);
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
@@ -506,13 +506,13 @@ QString ExplosionEdit::dialogIdentifier() const
|
||||
void ExplosionEdit::onChargeCountChanged(const AreaEffectSimulation::ChargeAdministration &data, DataModification modType)
|
||||
{
|
||||
|
||||
if (!m_chargeTypeMap.contains(data.chargeTypeId()))
|
||||
if (!m_chargeTypeMap.contains(data.chargeTypeId))
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eRemoved || data.amount() - data.planned() <= 0)
|
||||
m_chargeTypeMap[data.chargeTypeId()].available.remove(data.partyId());
|
||||
if (modType == DataModification::eRemoved || data.amount - data.planned <= 0)
|
||||
m_chargeTypeMap[data.chargeTypeId].available.remove(data.partyId);
|
||||
else
|
||||
m_chargeTypeMap[data.chargeTypeId()].available.insert(data.partyId(), data.amount() - data.planned());
|
||||
m_chargeTypeMap[data.chargeTypeId].available.insert(data.partyId, data.amount - data.planned);
|
||||
onPartyChanged();
|
||||
updateCannonsRounds(true);
|
||||
updateMaxLabel(true);
|
||||
@@ -549,7 +549,7 @@ void ExplosionEdit::setFireButton(AreaEffectSimulation::AesEffectState effectSta
|
||||
effectState == AesEffectState::EsPrepared ||
|
||||
effectState == AesEffectState::EsCreated ||
|
||||
effectState == AesEffectState::EsPaused)
|
||||
&& m_aesItem.id() > 0)
|
||||
&& m_aesItem.id > 0)
|
||||
m_ui->pbFire->setEnabled(true);
|
||||
else
|
||||
m_ui->pbFire->setEnabled(false);
|
||||
@@ -558,7 +558,7 @@ void ExplosionEdit::setFireButton(AreaEffectSimulation::AesEffectState effectSta
|
||||
void ExplosionEdit::updateCannonsRounds(bool modifiedFromExternal)
|
||||
{
|
||||
|
||||
if (m_ui->sbCannons->value() > maxAvailableRounds() && m_editable && m_aesItem.id() <= 0)
|
||||
if (m_ui->sbCannons->value() > maxAvailableRounds() && m_editable && m_aesItem.id <= 0)
|
||||
{
|
||||
m_ui->sbCannons->setValue(1);
|
||||
m_ui->sbRounds->setValue(1);
|
||||
@@ -586,64 +586,64 @@ void ExplosionEdit::updateMaxLabel(bool modifiedFromExternal)
|
||||
|
||||
quint32 ExplosionEdit::partyForItem(const AesItem &aesItem) const
|
||||
{
|
||||
if (aesItem.participantId().is_set())
|
||||
if (aesItem.participantId.has_value())
|
||||
{
|
||||
if (m_participant.id() == aesItem.participantId().get())
|
||||
return m_participant.partyId();
|
||||
if (m_participant.id == aesItem.participantId.get())
|
||||
return m_participant.partyId;
|
||||
else
|
||||
return m_ppmDtc->participant(aesItem.participantId().get()).partyId();
|
||||
return m_ppmDtc->participant(aesItem.participantId.get()).partyId;
|
||||
}
|
||||
else if (aesItem.partyId().is_set())
|
||||
return aesItem.partyId().get();
|
||||
else if (aesItem.partyId.has_value())
|
||||
return aesItem.partyId.get();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void ExplosionEdit::setSingleData(const ExplosionSingle &singleData)
|
||||
{
|
||||
QPointF impactPosition(singleData.impactPosition().lon(), singleData.impactPosition().lat());
|
||||
QPointF impactPosition(singleData.impactPosition.lon, singleData.impactPosition.lat);
|
||||
if (!impactPosition.isNull())
|
||||
m_ui->positionEdit->setCoordinate(impactPosition);
|
||||
|
||||
m_ui->dteRequestTime->setMsecsSinceEpoch(singleData.fireRequestTime());
|
||||
m_ui->cbPurpose->setCurrentText(QString::fromUtf8(singleData.purpose().c_str()));
|
||||
m_ui->sbAltitude->setValue(singleData.altitude());
|
||||
m_ui->dteRequestTime->setMsecsSinceEpoch(singleData.fireRequestTime);
|
||||
m_ui->cbPurpose->setCurrentText(QString::fromUtf8(singleData.purpose.c_str()));
|
||||
m_ui->sbAltitude->setValue(singleData.altitude);
|
||||
|
||||
if (m_aesItem.id() > 0)
|
||||
m_chargeTypeMap[singleData.chargeStruct().chargeTypeId()].available[partyForItem(singleData)] += 1;
|
||||
if (m_aesItem.id > 0)
|
||||
m_chargeTypeMap[singleData.chargeStruct.chargeTypeId].available[partyForItem(singleData)] += 1;
|
||||
|
||||
const double radius = m_pdmDtc->impactRadius(singleData.chargeStruct().chargeTypeId(),singleData.chargeStruct().igniterTypeId(), singleData.chargeStruct().igniterFunctionId());
|
||||
const double radius = m_pdmDtc->impactRadius(singleData.chargeStruct.chargeTypeId,singleData.chargeStruct.igniterTypeId, singleData.chargeStruct.igniterFunctionId);
|
||||
m_ui->sbDimensionX->setValue(2 * radius);
|
||||
}
|
||||
|
||||
void ExplosionEdit::setAreaData(const ExplosionArea &areaData, bool copy)
|
||||
{
|
||||
const Area &area = areaData.area();
|
||||
if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) ||
|
||||
!qFuzzyCompare(area.cornerBottomLeft().lat(), 0))
|
||||
const Area &area = areaData.area;
|
||||
if (!qFuzzyCompare(area.cornerBottomLeft.lon, 0) ||
|
||||
!qFuzzyCompare(area.cornerBottomLeft.lat, 0))
|
||||
{
|
||||
QPointF bottomLeft(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
|
||||
m_ui->positionEdit->setCoordinate(Polygons::bottomLeft2CenterPoint(bottomLeft, area.width(), area.height(), area.rotation()));
|
||||
QPointF bottomLeft(area.cornerBottomLeft.lon, area.cornerBottomLeft.lat);
|
||||
m_ui->positionEdit->setCoordinate(Polygons::bottomLeft2CenterPoint(bottomLeft, area.width, area.height, area.rotation));
|
||||
}
|
||||
|
||||
m_ui->sbDimensionX->setValue(area.width());
|
||||
m_ui->sbDimensionY->setValue(area.height());
|
||||
m_ui->sbAimingAxis->setValue(fmod((90.0 + area.rotation()) * 6400 / 360, 6400));
|
||||
m_ui->sbCannons->setValue(areaData.cannonCount() == 0 ? 4 : areaData.cannonCount());
|
||||
m_ui->sbRounds->setValue(areaData.cannonRounds() == 0 ? 9 : areaData.cannonRounds());
|
||||
if (m_aesItem.id() > 0 && !copy)
|
||||
m_ui->sbDimensionX->setValue(area.width);
|
||||
m_ui->sbDimensionY->setValue(area.height);
|
||||
m_ui->sbAimingAxis->setValue(fmod((90.0 + area.rotation) * 6400 / 360, 6400));
|
||||
m_ui->sbCannons->setValue(areaData.cannonCount == 0 ? 4 : areaData.cannonCount);
|
||||
m_ui->sbRounds->setValue(areaData.cannonRounds == 0 ? 9 : areaData.cannonRounds);
|
||||
if (m_aesItem.id > 0 && !copy)
|
||||
{
|
||||
if (!m_chargeTypeMap.contains(areaData.chargeStruct().chargeTypeId()))
|
||||
ERROR_LOG(m_logger) << "SetAreaData called with a charge Type, that has doesn't match. Id " << areaData.chargeStruct().chargeTypeId() << "is not in m_chargeTypeMap";
|
||||
if (!areaData.partyId().is_set())
|
||||
if (!m_chargeTypeMap.contains(areaData.chargeStruct.chargeTypeId))
|
||||
ERROR_LOG(m_logger) << "SetAreaData called with a charge Type, that has doesn't match. Id " << areaData.chargeStruct.chargeTypeId << "is not in m_chargeTypeMap";
|
||||
if (!areaData.partyId.has_value())
|
||||
ERROR_LOG(m_logger) << "SetAreaData called without a party set. m_chargeTypeMap might be corrupted.";
|
||||
m_chargeTypeMap[areaData.chargeStruct().chargeTypeId()].available[areaData.partyId().get()] += areaData.cannonCount() * areaData.cannonRounds();
|
||||
m_chargeTypeMap[areaData.chargeStruct.chargeTypeId].available[areaData.partyId.get()] += areaData.cannonCount * areaData.cannonRounds;
|
||||
}
|
||||
|
||||
|
||||
m_ui->dteRequestTime->setMsecsSinceEpoch(areaData.fireRequestTime());
|
||||
m_ui->cbPurpose->setCurrentText(QString::fromUtf8(areaData.purpose().c_str()));
|
||||
m_ui->sbAltitude->setValue(areaData.altitude());
|
||||
m_ui->dteRequestTime->setMsecsSinceEpoch(areaData.fireRequestTime);
|
||||
m_ui->cbPurpose->setCurrentText(QString::fromUtf8(areaData.purpose.c_str()));
|
||||
m_ui->sbAltitude->setValue(areaData.altitude);
|
||||
}
|
||||
|
||||
|
||||
@@ -723,7 +723,7 @@ void ExplosionEdit::onPartyChanged()
|
||||
for (const Charges &charge : std::as_const(m_chargeTypeMap))
|
||||
{
|
||||
if (charge.available.contains(partyId) && charge.available[partyId] > 0)
|
||||
m_ui->cbChargeType->addItem(m_pdmDtc->trChargeTypeShortName(charge.chargeType.id(), true), charge.chargeType.id());
|
||||
m_ui->cbChargeType->addItem(m_pdmDtc->trChargeTypeShortName(charge.chargeType.id, true), charge.chargeType.id);
|
||||
}
|
||||
|
||||
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(chargeTypeId) < 0 ? 0 : m_ui->cbChargeType->findData(chargeTypeId));
|
||||
@@ -761,19 +761,19 @@ bool ExplosionEdit::apply()
|
||||
|
||||
if (m_type == etSingle)
|
||||
{
|
||||
const ExplosionSingleModifyRequest req(m_aesItem.id(),
|
||||
const ExplosionSingleModifyRequest req(m_aesItem.id,
|
||||
name,
|
||||
LtsUtils::toOptional(effectStart),
|
||||
m_aesItem.effectSourceId(),
|
||||
LtsUtils::toOptional(static_cast<int64_t>(effectStart)),
|
||||
m_aesItem.effectSourceId,
|
||||
chargeType,
|
||||
pos,
|
||||
LtsUtils::toOptional(partyId),
|
||||
LtsUtils::toOptional(0),
|
||||
fireRequestTime,
|
||||
static_cast<int64_t>(fireRequestTime),
|
||||
altitude,
|
||||
purpose,
|
||||
m_ui->cbEffectMarkingInTa->isChecked(),
|
||||
dds::core::optional<rti::core::int64>());
|
||||
dds::core::optional<int64_t>());
|
||||
|
||||
m_requestHelper->addRequest([this, req]()
|
||||
{
|
||||
@@ -782,22 +782,22 @@ bool ExplosionEdit::apply()
|
||||
}
|
||||
else if (m_type == etArea)
|
||||
{
|
||||
const ExplosionAreaModifyRequest req(m_aesItem.id(),
|
||||
const ExplosionAreaModifyRequest req(m_aesItem.id,
|
||||
name,
|
||||
LtsUtils::toOptional(effectStart),
|
||||
LtsUtils::toOptional(static_cast<int64_t>(effectStart)),
|
||||
duration,
|
||||
m_aesItem.effectSourceId(),
|
||||
m_aesItem.effectSourceId,
|
||||
chargeType,
|
||||
area,
|
||||
LtsUtils::toOptional(partyId),
|
||||
LtsUtils::toOptional(0),
|
||||
cannons,
|
||||
rounds,
|
||||
fireRequestTime,
|
||||
static_cast<int64_t>(fireRequestTime),
|
||||
altitude,
|
||||
purpose,
|
||||
m_ui->cbEffectMarkingInTa->isChecked(),
|
||||
dds::core::optional<rti::core::int64>());
|
||||
dds::core::optional<int64_t>());
|
||||
m_requestHelper->addRequest([this, req]()
|
||||
{
|
||||
return m_ftc->explosionAreaModifyRequest(req, this);
|
||||
@@ -810,16 +810,16 @@ bool ExplosionEdit::apply()
|
||||
void ExplosionEdit::onFireClicked()
|
||||
{
|
||||
m_ui->pbFire->setEnabled(false);
|
||||
if ((m_aesItem.effectStateId() != AesEffectState::EsActivated &&
|
||||
m_aesItem.effectStateId() != AesEffectState::EsPaused &&
|
||||
m_aesItem.effectStateId() != AesEffectState::EsCreated &&
|
||||
m_aesItem.effectStateId() != AesEffectState::EsPrepared)
|
||||
|| m_aesItem.id() <= 0)
|
||||
if ((m_aesItem.effectStateId != AesEffectState::EsActivated &&
|
||||
m_aesItem.effectStateId != AesEffectState::EsPaused &&
|
||||
m_aesItem.effectStateId != AesEffectState::EsCreated &&
|
||||
m_aesItem.effectStateId != AesEffectState::EsPrepared)
|
||||
|| m_aesItem.id <= 0)
|
||||
return;
|
||||
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsCreated ||
|
||||
m_aesItem.effectStateId() == AesEffectState::EsPrepared)
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsCreated ||
|
||||
m_aesItem.effectStateId == AesEffectState::EsPrepared)
|
||||
{
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + 3000);
|
||||
m_ui->dteEffectStart->setChecked(true);
|
||||
@@ -835,9 +835,9 @@ void ExplosionEdit::onFireClicked()
|
||||
|
||||
m_requestHelper->addRequest([ = ]()
|
||||
{
|
||||
return m_ftc->explosionAreaPauseResumeRequest(ExplosionAreaPauseResumeRequest(m_aesItem.id(),
|
||||
m_aesItem.effectStateId() != AesEffectState::EsActivated,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
return m_ftc->explosionAreaPauseResumeRequest(ExplosionAreaPauseResumeRequest(m_aesItem.id,
|
||||
m_aesItem.effectStateId != AesEffectState::EsActivated,
|
||||
dds::core::optional<int64_t>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
dds::core::optional<int32_t>())
|
||||
, this);
|
||||
@@ -849,7 +849,7 @@ void ExplosionEdit::onParticipantClicked()
|
||||
{
|
||||
ParticipantManagement::ParticipantSelection *ps = new ParticipantManagement::ParticipantSelection(m_session, this);
|
||||
ps->init();
|
||||
ps->setParticipantSelected(m_participant.partyId(), m_participant.id());
|
||||
ps->setParticipantSelected(m_participant.partyId, m_participant.id);
|
||||
|
||||
connect(ps, &ParticipantManagement::ParticipantSelection::selectedParticipants, this, &ExplosionEdit::onParticipant);
|
||||
ps->exec();
|
||||
@@ -860,16 +860,16 @@ void ExplosionEdit::onParticipant(const QVector<int> &participants)
|
||||
if (participants.isEmpty())
|
||||
return;
|
||||
|
||||
if (participants[0] == m_participant.id())
|
||||
if (participants[0] == m_participant.id)
|
||||
return;
|
||||
m_participant = m_ppmDtc->participant(participants[0]);
|
||||
|
||||
m_symbolWatcher->setSymbolResult(m_asbIfc->findImage(m_participant));
|
||||
m_ui->lblDesignator->setText(QString::fromStdString(m_participant.designator()));
|
||||
m_ui->lblTactIdentifier->setText(QString::fromStdString(m_participant.tacticalIdentifier()));
|
||||
m_ui->lblDesignator->setText(QString::fromStdString(m_participant.designator));
|
||||
m_ui->lblTactIdentifier->setText(QString::fromStdString(m_participant.tacticalIdentifier));
|
||||
|
||||
|
||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(m_participant.partyId()));
|
||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(m_participant.partyId));
|
||||
slotChangesMade();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||
#include <ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_gui_plugin_interface.h>
|
||||
|
||||
+4
-4
@@ -232,7 +232,7 @@ AreaEffectSimulation::BaseEdit *InterfaceImpl::showEditWindow(int aesEntityId, b
|
||||
|
||||
BaseEdit *InterfaceImpl::showEditWindow(int aesEntityId, ProjectDataManagement::EffectSource effectSource, QWidget *parent)
|
||||
{
|
||||
switch (effectSource.underlying())
|
||||
switch (effectSource)
|
||||
{
|
||||
case ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE:
|
||||
{
|
||||
@@ -326,9 +326,9 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowExplosionClusterListDialog(QWidget *
|
||||
ExplosionList *listWidget;
|
||||
|
||||
listWidget = new ExplosionClusterList(menuGroup(),
|
||||
{ProjectDataManagement::GearClass::Artillery,
|
||||
ProjectDataManagement::GearClass::Mortar,
|
||||
ProjectDataManagement::GearClass::Rocket},
|
||||
{ProjectDataManagement::GearClass::GearClass_Artillery,
|
||||
ProjectDataManagement::GearClass::GearClass_Mortar,
|
||||
ProjectDataManagement::GearClass::GearClass_Rocket},
|
||||
parent);
|
||||
|
||||
if (listWidget->init(m_session))
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_gui_plugin.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_gui_plugin.h>
|
||||
#include "aes_explosion_gui_plugin_interface.h"
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ bool ExplosionList::init(LtsSession::LtsSession *session)
|
||||
return false;
|
||||
|
||||
m_bHasAddEditOperatorRights = false;
|
||||
switch (m_gearClass.underlying())
|
||||
switch (m_gearClass)
|
||||
{
|
||||
case ProjectDataManagement::GearClass::GearClass_Artillery:
|
||||
|
||||
@@ -288,7 +288,7 @@ void ExplosionAreaList::createModel()
|
||||
|
||||
|
||||
ExplosionClusterList::ExplosionClusterList(const QString &menuGroup, const QVector<ProjectDataManagement::GearClass> &gcs, QWidget *parent)
|
||||
: ExplosionList(menuGroup, etExplosionCluster, ProjectDataManagement::GearClass::Artillery, parent), m_model(nullptr), m_gearClasses(gcs)
|
||||
: ExplosionList(menuGroup, etExplosionCluster, ProjectDataManagement::GearClass::GearClass_Artillery, parent), m_model(nullptr), m_gearClasses(gcs)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_itemlist.h>
|
||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
+185
-185
@@ -81,8 +81,8 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, in
|
||||
static QHash<int, QPair<int, int>> contraintsDistance;
|
||||
if (contraintsDistance.isEmpty())
|
||||
{
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000});
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {800, 7800});
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Artillery), {3500, 40000});
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Mortar), {800, 7800});
|
||||
|
||||
|
||||
}
|
||||
@@ -90,8 +90,8 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, in
|
||||
static QHash<int, QPair<int, int>> contraintsDistanceVulcano;
|
||||
if (contraintsDistanceVulcano.isEmpty())
|
||||
{
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000});
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000});
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Artillery), {10000, 70000});
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Rocket), {10000, 70000});
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -121,15 +121,15 @@ QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gear
|
||||
static QHash<int, QPair<int, int>> contraintsFlightDuration;
|
||||
if (contraintsFlightDuration.isEmpty())
|
||||
{
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150});
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60});
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Artillery), {6, 150});
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Mortar), {20, 60});
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
|
||||
if (contraintsFlightDurationVulcano.isEmpty())
|
||||
{
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999});
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999});
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Artillery), {0, 999});
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Rocket), {0, 999});
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -165,15 +165,15 @@ QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass,
|
||||
static QHash<int, QPair<int, int>> contraintsPeak;
|
||||
if (contraintsPeak.isEmpty())
|
||||
{
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000});
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000});
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Artillery), {250, 15000});
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Mortar), {500, 3000});
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsPeakVulcano;
|
||||
if (contraintsPeakVulcano.isEmpty())
|
||||
{
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500});
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500});
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Artillery), {1000, 37500});
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::GearClass_Rocket), {1000, 37500});
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -278,7 +278,7 @@ ExplosionsEdit::ExplosionsEdit(const QString &menuGroup, QWidget *parent)
|
||||
|
||||
|
||||
|
||||
if (!m_explosionClusterData.isObjectModifiable())
|
||||
if (!m_explosionClusterData.isObjectModifiable)
|
||||
return true;
|
||||
|
||||
bool bEffectStartValid = true;
|
||||
@@ -416,7 +416,7 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
|
||||
}
|
||||
|
||||
|
||||
m_explosionClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
|
||||
m_explosionClusterData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
|
||||
|
||||
|
||||
@@ -464,14 +464,14 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
|
||||
{
|
||||
const ExplosionCluster &exData = m_dtc->explosionCluster(aesItemId);
|
||||
setExplosionClusterData(exData);
|
||||
m_ui->gbEffectMarkingInTa->setChecked(exData.effectMarkingInTa());
|
||||
m_ui->gbEffectMarkingInTa->setChecked(exData.effectMarkingInTa);
|
||||
|
||||
if (copy)
|
||||
{
|
||||
m_aesItem.id(0);
|
||||
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
|
||||
m_explosionClusterData.id(m_aesItem.id());
|
||||
m_explosionClusterData.effectStateId(m_aesItem.effectStateId());
|
||||
m_aesItem.id = 0;
|
||||
m_aesItem.effectStateId = AreaEffectSimulation::AesEffectState::EsUnknown;
|
||||
m_explosionClusterData.id = m_aesItem.id;
|
||||
m_explosionClusterData.effectStateId = m_aesItem.effectStateId;
|
||||
}
|
||||
}
|
||||
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged, this, &ExplosionsEdit::onPartyChanged, Qt::UniqueConnection);
|
||||
@@ -514,7 +514,7 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
|
||||
|
||||
doCalculations();
|
||||
|
||||
RocketUtility::enaDisaWirkmittel(m_ui->cbGearClass, m_currentGeometry.underlying());
|
||||
RocketUtility::enaDisaWirkmittel(m_ui->cbGearClass, m_currentGeometry);
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
|
||||
@@ -525,12 +525,12 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " START, ecData=" << ecData;
|
||||
|
||||
m_ui->leZpNumber->setText(QString::fromStdString(ecData.name()));
|
||||
m_ui->leElement->setText(QString::fromStdString(ecData.element()));
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(ecData.effectStart().is_set() ? ecData.effectStart().get() : 0);
|
||||
m_ui->leZpNumber->setText(QString::fromStdString(ecData.name));
|
||||
m_ui->leElement->setText(QString::fromStdString(ecData.element));
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(ecData.effectStart.has_value() ? ecData.effectStart.get() : 0);
|
||||
|
||||
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry);
|
||||
switch (geometryType)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
@@ -554,40 +554,40 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
|
||||
}
|
||||
onGeometrySelected(static_cast<int>(geometryType));
|
||||
|
||||
m_ui->sbDurationSec->setValue(ecData.effectDuration() / 1000);
|
||||
m_ui->sbDurationSec->setValue(ecData.effectDuration / 1000);
|
||||
|
||||
|
||||
{
|
||||
QSignalBlocker locked(m_ui->cbGearClass);
|
||||
ProjectDataManagement::GearClass gc = m_pdmDtc->gearClassFromChargeTypeId(ecData.chargeStruct().chargeTypeId());
|
||||
m_ui->cbGearClass->setCurrentIndex(m_ui->cbGearClass->findData(static_cast<int>(gc.underlying())));
|
||||
ProjectDataManagement::GearClass gc = m_pdmDtc->gearClassFromChargeTypeId(ecData.chargeStruct.chargeTypeId);
|
||||
m_ui->cbGearClass->setCurrentIndex(m_ui->cbGearClass->findData(static_cast<int>(gc)));
|
||||
onGearClassChanged();
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
QSignalBlocker locked(m_ui->cbParty);
|
||||
if (ecData.partyId().is_set())
|
||||
if (ecData.partyId.has_value())
|
||||
{
|
||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(ecData.partyId().get()));
|
||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(ecData.partyId.get()));
|
||||
onPartyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
if (ecData.participantId().is_set())
|
||||
if (ecData.participantId.has_value())
|
||||
{
|
||||
m_ui->cbParticipantUnits->setCurrentIndex(m_ui->cbParticipantUnits->findData(ecData.participantId().get()));
|
||||
m_ui->cbParticipantUnits->setCurrentIndex(m_ui->cbParticipantUnits->findData(ecData.participantId.get()));
|
||||
onParticipantUnitChanged({});
|
||||
}
|
||||
}
|
||||
|
||||
FlightCurve fc(-1, -1, -1, -1, -1, -1, -1, -1);
|
||||
if (ecData.flightCurve().is_set())
|
||||
fc = ecData.flightCurve().get();
|
||||
if (ecData.flightCurve.has_value())
|
||||
fc = ecData.flightCurve.get();
|
||||
|
||||
if (fc.dropAngle() <= s_dropAngleDown)
|
||||
if (fc.dropAngle <= s_dropAngleDown)
|
||||
{
|
||||
m_ui->rbDropAngleDown->setChecked(true);
|
||||
m_ui->rbDropAngleUp->setChecked(false);
|
||||
@@ -598,65 +598,65 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
|
||||
m_ui->rbDropAngleUp->setChecked(true);
|
||||
}
|
||||
|
||||
m_ui->sbCannons->setValue(ecData.impactCount());
|
||||
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(ecData.chargeStruct().chargeTypeId()));
|
||||
m_ui->cbIgniterType->setCurrentIndex(m_ui->cbIgniterType->findData(ecData.chargeStruct().igniterTypeId()));
|
||||
m_ui->cbFirePurpose->setCurrentIndex(m_ui->cbFirePurpose->findData(ecData.firePurposeId()));
|
||||
m_ui->sbCannons->setValue(ecData.impactCount);
|
||||
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(ecData.chargeStruct.chargeTypeId));
|
||||
m_ui->cbIgniterType->setCurrentIndex(m_ui->cbIgniterType->findData(ecData.chargeStruct.igniterTypeId));
|
||||
m_ui->cbFirePurpose->setCurrentIndex(m_ui->cbFirePurpose->findData(ecData.firePurposeId));
|
||||
|
||||
m_ui->sbZog->setValue(ecData.tla());
|
||||
m_ui->sbZog->setValue(ecData.tla);
|
||||
|
||||
const AreaEffectSimulation::Area &areaRef = ecData.area();
|
||||
const QPointF bottomLeft(areaRef.cornerBottomLeft().lon(), areaRef.cornerBottomLeft().lat());
|
||||
const QPointF centerpoint = Polygons::bottomLeft2CenterPoint(bottomLeft, areaRef.width(), areaRef.height(), areaRef.rotation());
|
||||
const AreaEffectSimulation::Area &areaRef = ecData.area;
|
||||
const QPointF bottomLeft(areaRef.cornerBottomLeft.lon, areaRef.cornerBottomLeft.lat);
|
||||
const QPointF centerpoint = Polygons::bottomLeft2CenterPoint(bottomLeft, areaRef.width, areaRef.height, areaRef.rotation);
|
||||
if (!bottomLeft.isNull())
|
||||
{
|
||||
m_ui->positionEdit->setCoordinate(centerpoint);
|
||||
setCoord(centerpoint);
|
||||
}
|
||||
|
||||
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
if (ecData.explosionGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
{
|
||||
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2);
|
||||
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
|
||||
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height / 2);
|
||||
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width / 2);
|
||||
m_ui->sbAimingAxis->setValue(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height());
|
||||
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width());
|
||||
m_ui->sbAimingAxis->setValue(fmod((90.0 + areaRef.rotation()) * 6400 / 360, 6400));
|
||||
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height);
|
||||
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width);
|
||||
m_ui->sbAimingAxis->setValue(fmod((90.0 + areaRef.rotation) * 6400 / 360, 6400));
|
||||
}
|
||||
|
||||
if (!ecData.esmParticipantIds().empty())
|
||||
if (!ecData.esmParticipantIds.empty())
|
||||
{
|
||||
m_ui->cbActors->setCurrentIndex(m_ui->cbActors->findData(ecData.esmParticipantIds().at(0)));
|
||||
if (ecData.esmParticipantIds().size() > 1)
|
||||
m_ui->cbActors_2->setCurrentIndex(m_ui->cbActors_2->findData(ecData.esmParticipantIds().at(1)));
|
||||
m_ui->cbActors->setCurrentIndex(m_ui->cbActors->findData(ecData.esmParticipantIds.at(0)));
|
||||
if (ecData.esmParticipantIds.size() > 1)
|
||||
m_ui->cbActors_2->setCurrentIndex(m_ui->cbActors_2->findData(ecData.esmParticipantIds.at(1)));
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
if (fc.requestedFlightDuration() > 0)
|
||||
if (fc.requestedFlightDuration > 0)
|
||||
{
|
||||
|
||||
switchTo(FlighDurationOrPeakHeight::FDPH_flightDuration);
|
||||
setValueAccordingContraints(fc.requestedFlightDuration() / 1000.0, FlighDurationOrPeakHeight::FDPH_flightDuration);
|
||||
setValueAccordingContraints(fc.requestedFlightDuration / 1000.0, FlighDurationOrPeakHeight::FDPH_flightDuration);
|
||||
}
|
||||
if (fc.requestedRelativePeakHeight() > 0)
|
||||
if (fc.requestedRelativePeakHeight > 0)
|
||||
{
|
||||
|
||||
switchTo(FlighDurationOrPeakHeight::FDPH_peakHeight);
|
||||
setValueAccordingContraints(fc.requestedRelativePeakHeight(), FlighDurationOrPeakHeight::FDPH_peakHeight);
|
||||
setValueAccordingContraints(fc.requestedRelativePeakHeight, FlighDurationOrPeakHeight::FDPH_peakHeight);
|
||||
}
|
||||
|
||||
LaserGuiding lg(0, 0, -1, std::numeric_limits<int>::min());
|
||||
if (ecData.laserGuiding().is_set())
|
||||
lg = ecData.laserGuiding().get();
|
||||
if (ecData.laserGuiding.has_value())
|
||||
lg = ecData.laserGuiding.get();
|
||||
|
||||
m_ui->sbLcAttack_Prf->setValue(lg.lcAttack());
|
||||
m_ui->sbLcTermination_Prf->setValue(lg.lcTermination());
|
||||
m_ui->sbLcAttack_Prf->setValue(lg.lcAttack);
|
||||
m_ui->sbLcTermination_Prf->setValue(lg.lcTermination);
|
||||
|
||||
m_ui->spCloudBase->setValue(lg.cloudBase());
|
||||
m_ui->spCloudBase->setValue(lg.cloudBase);
|
||||
|
||||
onExplosionClusterChanged(ecData, DataModification::eAdded);
|
||||
}
|
||||
@@ -700,7 +700,7 @@ void ExplosionsEdit::onChargeTypeChanged()
|
||||
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
|
||||
|
||||
|
||||
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
|
||||
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
|
||||
{
|
||||
int igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
|
||||
const double impactRadius = m_pdmDtc->impactRadius(chargeTypeId, igniterTypeId, 0);
|
||||
@@ -790,7 +790,7 @@ void ExplosionsEdit::getPosition()
|
||||
m_previewPolygon.clear();
|
||||
m_previewCircleRadius = 0.0;
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
{
|
||||
@@ -920,7 +920,7 @@ void ExplosionsEdit::onPolylineData(const QPolygonF &polyline)
|
||||
m_ui->sbDimensionX_BreiteRadius->setValue(distance);
|
||||
|
||||
const Core::GeoPosition coordGeo2(utm2.geographic().x(), utm2.geographic().y(), 0);
|
||||
const double height2 = getElevation(coordGeo2.lon(), coordGeo2.lat());
|
||||
const double height2 = getElevation(coordGeo2.lon, coordGeo2.lat);
|
||||
m_ui->sbHeight2SBox->setValue(height2);
|
||||
DEBUG_LOG(m_logger) << "sbHeight2SBox setValue=" << height2;
|
||||
|
||||
@@ -948,7 +948,7 @@ void ExplosionsEdit::setCoord(const QPointF &coord)
|
||||
const Core::GeoPosition coordGeo(coord.x(), coord.y(), 0);
|
||||
m_coordGeo = coordGeo;
|
||||
|
||||
const double height = getElevation(coordGeo.lon(), coordGeo.lat());
|
||||
const double height = getElevation(coordGeo.lon, coordGeo.lat);
|
||||
m_ui->sbHeight1SBox->setValue(height);
|
||||
|
||||
updateActorComboBox(coordGeo);
|
||||
@@ -986,8 +986,8 @@ void ExplosionsEdit::fillParticipantUnit()
|
||||
for (auto &superiorId : superiorIds)
|
||||
{
|
||||
const ParticipantManagement::Participant &part = m_ppmDtc->participant(superiorId);
|
||||
unitList.push_back(std::tuple<QString, int, int>(QString::fromStdString(part.designator()) + QStringLiteral(" (%1)").arg(units.value(superiorId).count()),
|
||||
part.id(),
|
||||
unitList.push_back(std::tuple<QString, int, int>(QString::fromStdString(part.designator) + QStringLiteral(" (%1)").arg(units.value(superiorId).count()),
|
||||
part.id,
|
||||
units.value(superiorId).count()));
|
||||
}
|
||||
std::sort(unitList.begin(), unitList.end());
|
||||
@@ -1065,7 +1065,7 @@ void ExplosionsEdit::onAimingAxisChanged(int aimingAxis)
|
||||
m_ui->positionEdit_2->setCoordinate(utm2New.geographic());
|
||||
|
||||
const Core::GeoPosition coordGeo(utm2New.geographic().x(), utm2New.geographic().y(), 0);
|
||||
const double height = getElevation(coordGeo.lon(), coordGeo.lat());
|
||||
const double height = getElevation(coordGeo.lon, coordGeo.lat);
|
||||
m_ui->sbHeight1SBox->setValue(height);
|
||||
}
|
||||
|
||||
@@ -1273,7 +1273,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
|
||||
return;
|
||||
|
||||
|
||||
if ((m_explosionClusterData.effectStateId() == AesEffectState::EsPaused) || (m_explosionClusterData.effectStateId() == AesEffectState::EsExpired))
|
||||
if ((m_explosionClusterData.effectStateId == AesEffectState::EsPaused) || (m_explosionClusterData.effectStateId == AesEffectState::EsExpired))
|
||||
return;
|
||||
|
||||
DoCalculationsExitGuard exitGuard(this, executeEnableUiElements);
|
||||
@@ -1421,7 +1421,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
|
||||
return;
|
||||
}
|
||||
|
||||
const qint64 calculatedFlightDurationMsec = trajectoryOut.back().relativeTime();
|
||||
const qint64 calculatedFlightDurationMsec = trajectoryOut.back().relativeTime;
|
||||
m_temporaryData.m_estimatedFlightDurationMsec = Polygons::explosionClusterEstimatedMaxFlightDuration2DMSec(calculatedFlightDurationMsec);
|
||||
m_temporaryData.m_idealTapAbsoluteGeoOut = idealTapAbsoluteGeoOut;
|
||||
|
||||
@@ -1435,7 +1435,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
|
||||
.arg(std::round(betaRad * LtsCoordTrans::rad2deg() * 10) / 10)
|
||||
.arg(std::round(vOut))
|
||||
.arg(std::round(calculatedFlightDurationMsec / 1000.0))
|
||||
.arg(std::round(m_temporaryData.m_idealTapAbsoluteGeoOut.z()));
|
||||
.arg(std::round(m_temporaryData.m_idealTapAbsoluteGeoOut.z));
|
||||
|
||||
QSignalBlocker locked(m_ui->sBox_flightDuration);
|
||||
m_ui->sBox_flightDuration->setValue(std::round(calculatedFlightDurationMsec / 1000.0));
|
||||
@@ -1601,12 +1601,12 @@ void ExplosionsEdit::onPartitionTimeChanged(qint64 newPartitionTimeMsec)
|
||||
|
||||
QString ExplosionsEdit::dialogIdentifier() const
|
||||
{
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionsArtillery") : QStringLiteral("EditExplosionsArtillery%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionsArtillery") : QStringLiteral("EditExplosionsArtillery%1").arg(m_aesItem.id);
|
||||
}
|
||||
|
||||
void ExplosionsEdit::onExplosionClusterChanged(const ExplosionCluster &ecData, DataModification modType)
|
||||
{
|
||||
if (ecData.id() != m_aesItem.id())
|
||||
if (ecData.id != m_aesItem.id)
|
||||
return;
|
||||
|
||||
BaseEdit::onAreaChanged(ecData, modType);
|
||||
@@ -1620,7 +1620,7 @@ void ExplosionsEdit::onExplosionClusterChanged(const ExplosionCluster &ecData, D
|
||||
|
||||
if (
|
||||
|
||||
(!ecData.isObjectModifiable()))
|
||||
(!ecData.isObjectModifiable))
|
||||
{
|
||||
INFO_LOG(m_logger) << " object becames not modifiable";
|
||||
enableUiFireButton();
|
||||
@@ -1635,13 +1635,13 @@ void ExplosionsEdit::onExplosionClusterChanged(const ExplosionCluster &ecData, D
|
||||
}
|
||||
|
||||
m_explosionClusterData = ecData;
|
||||
m_currentGeometry = m_explosionClusterData.explosionGeometry();
|
||||
m_currentGeometry = m_explosionClusterData.explosionGeometry;
|
||||
|
||||
if (ecData.flightCurve().is_set())
|
||||
if (ecData.flightCurve.has_value())
|
||||
{
|
||||
const FlightCurve &fc = ecData.flightCurve().get();
|
||||
m_ui->leCalcFlightDuration->setText(QString(QStringLiteral("%1 sec")).arg(fc.calculatedFlightDuration() / 1000.0));
|
||||
m_ui->leCalcPeakHeight->setText(QString(QStringLiteral("%1 m abs")).arg(fc.calculatedPeakHeightAbs()));
|
||||
const FlightCurve &fc = ecData.flightCurve.get();
|
||||
m_ui->leCalcFlightDuration->setText(QString(QStringLiteral("%1 sec")).arg(fc.calculatedFlightDuration / 1000.0));
|
||||
m_ui->leCalcPeakHeight->setText(QString(QStringLiteral("%1 m abs")).arg(fc.calculatedPeakHeightAbs));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1649,13 +1649,13 @@ void ExplosionsEdit::onExplosionClusterChanged(const ExplosionCluster &ecData, D
|
||||
m_ui->leCalcPeakHeight->setText(QString(QStringLiteral("- m abs")));
|
||||
}
|
||||
|
||||
m_ui->leDescription->setText(QString::fromStdString(ecData.annotationString()));
|
||||
m_ui->leDescription->setText(QString::fromStdString(ecData.annotationString));
|
||||
m_ui->leDescription->setToolTip(m_ui->leDescription->text());
|
||||
|
||||
if (!m_ui->sbDurationSec->isEnabled())
|
||||
{
|
||||
const bool hasChanges = hasUnsavedChanges();
|
||||
m_ui->sbDurationSec->setValue(m_explosionClusterData.effectDuration() / 1000);
|
||||
m_ui->sbDurationSec->setValue(m_explosionClusterData.effectDuration / 1000);
|
||||
if (!hasChanges)
|
||||
__unchange__();
|
||||
}
|
||||
@@ -1740,10 +1740,10 @@ void ExplosionsEdit::retranslate()
|
||||
void ExplosionsEdit::enableUiElements()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " enableUiElements()"
|
||||
<< ", m_explosionClusterData.id() = " << m_explosionClusterData.id() << ", isModifiable() = " << isModifiable()
|
||||
<< ", m_explosionClusterData.id() = " << m_explosionClusterData.id << ", isModifiable() = " << isModifiable()
|
||||
<< ", isOnlyNameModifiable() = " << isOnlyNameModifiable() << ", ena = " << (isModifiable() && !isOnlyNameModifiable());
|
||||
|
||||
if (m_explosionClusterData.id() == 0)
|
||||
if (m_explosionClusterData.id == 0)
|
||||
enableUiElements(true);
|
||||
else
|
||||
enableUiElements(isModifiable() && !isOnlyNameModifiable());
|
||||
@@ -1792,8 +1792,8 @@ void ExplosionsEdit::enableUiElements(bool enable)
|
||||
|
||||
|
||||
|
||||
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
|
||||
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
|
||||
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId != AesEffectState::EsActivated);
|
||||
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId != AesEffectState::EsActivated);
|
||||
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
|
||||
@@ -1804,15 +1804,15 @@ void ExplosionsEdit::enableUiElements(bool enable)
|
||||
|
||||
int numberTrajectoriesRef = 0;
|
||||
{
|
||||
const int simToRestrict = m_aesItem.id();
|
||||
const int simToRestrict = m_aesItem.id;
|
||||
|
||||
auto cb = [simToRestrict, &numberTrajectoriesRef](const AreaEffectSimulation::TrajectoryTimeAware &traj)
|
||||
{
|
||||
|
||||
|
||||
if (traj.originatorTypeId() != ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
||||
if (traj.originatorTypeId != ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation)
|
||||
return;
|
||||
const int aesItemId = traj.originatorId();
|
||||
const int aesItemId = traj.originatorId;
|
||||
if (simToRestrict == aesItemId)
|
||||
++numberTrajectoriesRef;
|
||||
};
|
||||
@@ -1821,7 +1821,7 @@ void ExplosionsEdit::enableUiElements(bool enable)
|
||||
|
||||
DEBUG_LOG(m_logger) << "************* enableUiElements numberTrajectoriesRef=" << numberTrajectoriesRef;
|
||||
|
||||
if ((numberTrajectoriesRef > 0) && !isPointSimilar(m_explosionClusterData.explosionGeometry()))
|
||||
if ((numberTrajectoriesRef > 0) && !isPointSimilar(m_explosionClusterData.explosionGeometry))
|
||||
{
|
||||
|
||||
enableUiFireButton();
|
||||
@@ -1829,7 +1829,7 @@ void ExplosionsEdit::enableUiElements(bool enable)
|
||||
else
|
||||
{
|
||||
|
||||
m_ui->pbFire->setEnabled(enable && m_aesItem.id() > 0);
|
||||
m_ui->pbFire->setEnabled(enable && m_aesItem.id > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1871,7 +1871,7 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
|
||||
|
||||
|
||||
bool enableBasics = (m_aesItem.id() > 0)
|
||||
bool enableBasics = (m_aesItem.id > 0)
|
||||
&& isDataSufficiant();
|
||||
|
||||
INFO_LOG(m_logger) << " enableBasics = " << enableBasics;
|
||||
@@ -1879,17 +1879,17 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
if (!enableBasics)
|
||||
return;
|
||||
|
||||
if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
if (m_explosionClusterData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
return;
|
||||
|
||||
int numberTrajectoriesRef = 0;
|
||||
{
|
||||
const int simToRestrict = m_aesItem.id();
|
||||
const int simToRestrict = m_aesItem.id;
|
||||
|
||||
auto cb = [simToRestrict, &numberTrajectoriesRef](const AreaEffectSimulation::TrajectoryTimeAware &traj)
|
||||
{
|
||||
|
||||
if ((traj.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation) && (simToRestrict == traj.originatorId()))
|
||||
if ((traj.originatorTypeId == ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation) && (simToRestrict == traj.originatorId))
|
||||
++numberTrajectoriesRef;
|
||||
};
|
||||
m_dtc->trajectoryTimeAwares(cb);
|
||||
@@ -1900,12 +1900,12 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
|
||||
|
||||
|
||||
if ((numberTrajectoriesRef <= 0) && (m_explosionClusterData.effectDuration() == m_explosionClusterData.originalEffectDuration()))
|
||||
if ((numberTrajectoriesRef <= 0) && (m_explosionClusterData.effectDuration == m_explosionClusterData.originalEffectDuration))
|
||||
{
|
||||
INFO_LOG(m_logger) << " Firing has NOT started yet";
|
||||
return;
|
||||
}
|
||||
else if (numberTrajectoriesRef >= m_explosionClusterData.impactCount())
|
||||
else if (numberTrajectoriesRef >= m_explosionClusterData.impactCount)
|
||||
{
|
||||
INFO_LOG(m_logger) << " Firing has finished";
|
||||
return;
|
||||
@@ -1927,7 +1927,7 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
else
|
||||
{
|
||||
|
||||
if (m_explosionClusterData.effectStateId() == AesEffectState::EsPaused)
|
||||
if (m_explosionClusterData.effectStateId == AesEffectState::EsPaused)
|
||||
bPause = false;
|
||||
}
|
||||
}
|
||||
@@ -1944,7 +1944,7 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
{
|
||||
|
||||
|
||||
if ((m_explosionClusterData.impactCount() > 1) && (m_explosionClusterData.impactCount() >= m_explosionClusterData.remainExplosionNumber()))
|
||||
if ((m_explosionClusterData.impactCount > 1) && (m_explosionClusterData.impactCount >= m_explosionClusterData.remainExplosionNumber))
|
||||
{
|
||||
m_ui->pbFire->setEnabled(true);
|
||||
m_ui->pbFire->setText(tr("Start"));
|
||||
@@ -1964,7 +1964,7 @@ void ExplosionsEdit::showPreviewObject()
|
||||
if (!has2DMap(false))
|
||||
return;
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
if (m_previewPolygon.isEmpty())
|
||||
@@ -2011,7 +2011,7 @@ bool ExplosionsEdit::isDataSufficiant()
|
||||
|
||||
|
||||
bool bHasTargetArea = !m_coord.isNull();
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
|
||||
@@ -2036,32 +2036,32 @@ bool ExplosionsEdit::isDataSufficiant()
|
||||
bool ExplosionsEdit::apply()
|
||||
{
|
||||
ExplosionClusterModifyRequest request;
|
||||
request.id(m_aesItem.id());
|
||||
request.element(m_ui->leElement->text().toStdString());
|
||||
request.name(m_ui->leZpNumber->text().toStdString());
|
||||
request.id = m_aesItem.id;
|
||||
request.element = m_ui->leElement->text().toStdString();
|
||||
request.name = m_ui->leZpNumber->text().toStdString();
|
||||
|
||||
if (m_ui->dteEffectStart->isChecked())
|
||||
request.effectStart().set(m_ui->dteEffectStart->msecsSinceEpoch());
|
||||
request.effectStart.set(m_ui->dteEffectStart->msecsSinceEpoch());
|
||||
if (m_ui->sbDurationSec->isVisible())
|
||||
request.effectDuration(m_ui->sbDurationSec->value() * 1000);
|
||||
request.effectDuration = m_ui->sbDurationSec->value() * 1000;
|
||||
|
||||
const bool bIsPoint = isPointSimilar(m_currentGeometry);
|
||||
|
||||
|
||||
request.explosionGeometry(m_currentGeometry);
|
||||
request.explosionGeometry = m_currentGeometry;
|
||||
|
||||
Core::GeoPosition2D bottomLeftGeo;
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AesExplosionGeometry::EgRadial:
|
||||
{
|
||||
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0));
|
||||
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
|
||||
|
||||
request.area().cornerBottomLeft(bottomLeftGeo);
|
||||
request.area().height(m_ui->sbDimensionY_Tiefe->value() * 2);
|
||||
request.area().width(m_ui->sbDimensionX_BreiteRadius->value() * 2);
|
||||
request.area.cornerBottomLeft = bottomLeftGeo;
|
||||
request.area.height = m_ui->sbDimensionY_Tiefe->value() * 2;
|
||||
request.area.width = m_ui->sbDimensionX_BreiteRadius->value() * 2;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2075,9 +2075,9 @@ bool ExplosionsEdit::apply()
|
||||
(m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400));
|
||||
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
|
||||
|
||||
request.area().cornerBottomLeft(bottomLeftGeo);
|
||||
request.area().height(m_ui->sbDimensionY_Tiefe->value());
|
||||
request.area().width(m_ui->sbDimensionX_BreiteRadius->value());
|
||||
request.area.cornerBottomLeft = bottomLeftGeo;
|
||||
request.area.height = m_ui->sbDimensionY_Tiefe->value();
|
||||
request.area.width = m_ui->sbDimensionX_BreiteRadius->value();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2092,9 +2092,9 @@ bool ExplosionsEdit::apply()
|
||||
(m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400));
|
||||
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
|
||||
|
||||
request.area().cornerBottomLeft(bottomLeftGeo);
|
||||
request.area().height(m_ui->sbDimensionY_Tiefe->value());
|
||||
request.area().width(m_ui->sbDimensionX_BreiteRadius->value());
|
||||
request.area.cornerBottomLeft = bottomLeftGeo;
|
||||
request.area.height = m_ui->sbDimensionY_Tiefe->value();
|
||||
request.area.width = m_ui->sbDimensionX_BreiteRadius->value();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2111,24 +2111,24 @@ bool ExplosionsEdit::apply()
|
||||
|
||||
if (esmParticipantId1 > 0 || esmParticipantId2 > 0)
|
||||
{
|
||||
request.esmParticipantIds().reserve(2);
|
||||
request.esmParticipantIds.reserve(2);
|
||||
if (esmParticipantId1 > 0)
|
||||
request.esmParticipantIds().push_back(esmParticipantId1);
|
||||
request.esmParticipantIds.push_back(esmParticipantId1);
|
||||
if (esmParticipantId2 > 0 && esmParticipantId1 != esmParticipantId2 && m_ui->cbActors_2->isEnabled())
|
||||
request.esmParticipantIds().push_back(esmParticipantId2);
|
||||
request.esmParticipantIds.push_back(esmParticipantId2);
|
||||
}
|
||||
|
||||
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
request.area().rotation(0);
|
||||
if (bIsPoint || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
request.area.rotation = 0;
|
||||
else
|
||||
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
|
||||
request.area.rotation = (m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400;
|
||||
|
||||
request.tla(m_ui->sbZog->value());
|
||||
request.tla = m_ui->sbZog->value();
|
||||
|
||||
|
||||
if (bIsPoint)
|
||||
{
|
||||
request.mhpCount(1);
|
||||
request.mhpCount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2144,43 +2144,43 @@ bool ExplosionsEdit::apply()
|
||||
}
|
||||
|
||||
if (mtpCount > sbCannonsCount)
|
||||
request.mhpCount(sbCannonsCount);
|
||||
request.mhpCount = sbCannonsCount;
|
||||
else
|
||||
request.mhpCount(mtpCount);
|
||||
request.mhpCount = mtpCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
request.partyId().set(m_ui->cbParty->currentData().toInt());
|
||||
request.partyId.set(m_ui->cbParty->currentData().toInt());
|
||||
|
||||
bool bOk = false;
|
||||
request.participantId().set(m_ui->cbParticipantUnits->currentData(Qt::UserRole).toInt(&bOk));
|
||||
request.participantId.set(m_ui->cbParticipantUnits->currentData(Qt::UserRole).toInt(&bOk));
|
||||
if (!bOk)
|
||||
request.participantId(0);
|
||||
request.participantId = 0;
|
||||
|
||||
|
||||
request.impactCount(m_ui->sbCannons->value());
|
||||
request.impactCount = m_ui->sbCannons->value();
|
||||
|
||||
request.chargeStruct().chargeTypeId(m_ui->cbChargeType->currentData().toInt());
|
||||
request.chargeStruct().igniterTypeId(m_ui->cbIgniterType->currentData().toInt());
|
||||
request.firePurposeId(m_ui->cbFirePurpose->currentData().toInt());
|
||||
request.chargeStruct.chargeTypeId = m_ui->cbChargeType->currentData().toInt();
|
||||
request.chargeStruct.igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
|
||||
request.firePurposeId = m_ui->cbFirePurpose->currentData().toInt();
|
||||
|
||||
|
||||
{
|
||||
request.peakHeight(-1);
|
||||
request.flightDuration(-1);
|
||||
request.peakHeight = -1;
|
||||
request.flightDuration = -1;
|
||||
|
||||
const bool usePeakHeight = m_ui->sBox_peakHeight->styleSheet().isEmpty();
|
||||
const bool useFlightDuration = m_ui->sBox_flightDuration->styleSheet().isEmpty();
|
||||
if (usePeakHeight == useFlightDuration)
|
||||
request.peakHeight(m_ui->sBox_peakHeight->value());
|
||||
request.peakHeight = m_ui->sBox_peakHeight->value();
|
||||
else if (useFlightDuration)
|
||||
request.flightDuration(m_ui->sBox_flightDuration->value() * 1000);
|
||||
request.flightDuration = m_ui->sBox_flightDuration->value() * 1000;
|
||||
else
|
||||
request.peakHeight(m_ui->sBox_peakHeight->value());
|
||||
request.peakHeight = m_ui->sBox_peakHeight->value();
|
||||
}
|
||||
|
||||
if (request.flightDuration() >= 600 * 1000)
|
||||
if (request.flightDuration >= 600 * 1000)
|
||||
{
|
||||
for (int i = 0; i < 10; ++i)
|
||||
FATAL_LOG(m_logger) << LOGFUNCTION << " !!!!!!!!!!!!!!"
|
||||
@@ -2188,29 +2188,29 @@ bool ExplosionsEdit::apply()
|
||||
<< " m_ui->sBox_flightDuration->value() " << m_ui->sBox_flightDuration->value();
|
||||
}
|
||||
|
||||
request.partyId().set(m_ui->cbParty->currentData().toInt());
|
||||
request.effectMarkingInTa(m_ui->gbEffectMarkingInTa->isChecked());
|
||||
request.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
|
||||
request.partyId.set(m_ui->cbParty->currentData().toInt());
|
||||
request.effectMarkingInTa = m_ui->gbEffectMarkingInTa->isChecked();
|
||||
request.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal;
|
||||
|
||||
if (isGuiVulcano())
|
||||
{
|
||||
request.launchVelocity(TrajectoryGeneratorVulcano::defaultv0());
|
||||
request.launchAngleDeg(0);
|
||||
request.dropAngle(currentDropAngleDegree());
|
||||
request.launchVelocity = TrajectoryGeneratorVulcano::defaultv0();
|
||||
request.launchAngleDeg = 0;
|
||||
request.dropAngle = currentDropAngleDegree();
|
||||
|
||||
if (request.effectStart().is_set())
|
||||
request.tapTime(request.effectStart().get() - (TrajectoryGeneratorVulcano::defaultTapTimeSec() * 1000));
|
||||
if (request.effectStart.has_value())
|
||||
request.tapTime = request.effectStart.get() - (TrajectoryGeneratorVulcano::defaultTapTimeSec() * 1000);
|
||||
|
||||
request.lcAttack(m_ui->sbLcAttack_Prf->value());
|
||||
request.lcTermination(m_ui->sbLcTermination_Prf->value());
|
||||
request.lcAttack = m_ui->sbLcAttack_Prf->value();
|
||||
request.lcTermination = m_ui->sbLcTermination_Prf->value();
|
||||
|
||||
const int cloudBaseValue = m_ui->spCloudBase->value();
|
||||
|
||||
|
||||
if (cloudBaseValue == m_ui->spCloudBase->minimum())
|
||||
request.cloudBase(std::numeric_limits<int>::min());
|
||||
request.cloudBase = std::numeric_limits<int>::min();
|
||||
else
|
||||
request.cloudBase(cloudBaseValue);
|
||||
request.cloudBase = cloudBaseValue;
|
||||
|
||||
}
|
||||
|
||||
@@ -2229,7 +2229,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
|
||||
m_currentGeometry = newGeometry;
|
||||
|
||||
RocketUtility::enaDisaWirkmittel(m_ui->cbGearClass, m_currentGeometry.underlying());
|
||||
RocketUtility::enaDisaWirkmittel(m_ui->cbGearClass, m_currentGeometry);
|
||||
|
||||
|
||||
if (m_sitMapGuiIfc)
|
||||
@@ -2247,7 +2247,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
if (m_sitMapGuiIfc)
|
||||
m_sitMapGuiIfc->removePreviewObject();
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
@@ -2351,13 +2351,13 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
void ExplosionsEdit::onFireClicked()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) ||
|
||||
(m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState::EsFired)
|
||||
if (((m_aesItem.effectStateId == AesEffectState::EsUnknown) ||
|
||||
(m_aesItem.effectStateId == AesEffectState::EsError) || (m_aesItem.effectStateId == AesEffectState::EsExpired)
|
||||
|| (m_aesItem.effectStateId == AesEffectState::EsRemoved) || (m_aesItem.effectStateId == AesEffectState::EsReceived)
|
||||
|| (m_aesItem.effectStateId == AesEffectState::EsFired)
|
||||
|
||||
)
|
||||
|| m_aesItem.id() <= 0)
|
||||
|| m_aesItem.id <= 0)
|
||||
return;
|
||||
|
||||
if (!isDataSufficiant())
|
||||
@@ -2373,9 +2373,9 @@ void ExplosionsEdit::onFireClicked()
|
||||
|
||||
m_ui->pbFire->setEnabled(false);
|
||||
|
||||
const bool bIsObjectModifiable = m_explosionClusterData.isObjectModifiable();
|
||||
const bool bIsObjectModifiable = m_explosionClusterData.isObjectModifiable;
|
||||
|
||||
if ((m_aesItem.effectStateId() == AesEffectState::EsCreated || m_aesItem.effectStateId() == AesEffectState::EsPrepared) && bIsObjectModifiable)
|
||||
if ((m_aesItem.effectStateId == AesEffectState::EsCreated || m_aesItem.effectStateId == AesEffectState::EsPrepared) && bIsObjectModifiable)
|
||||
{
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + m_temporaryData.m_estimatedFlightDurationMsec + 5000);
|
||||
m_ui->dteEffectStart->setChecked(true);
|
||||
@@ -2415,9 +2415,9 @@ void ExplosionsEdit::onFireClicked()
|
||||
m_requestHelper->addRequest(
|
||||
[=]()
|
||||
{
|
||||
return m_ftc->explosionClusterPauseResumeRequest(ExplosionClusterPauseResumeRequest(m_aesItem.id(),
|
||||
return m_ftc->explosionClusterPauseResumeRequest(ExplosionClusterPauseResumeRequest(m_aesItem.id,
|
||||
resumeExecution,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int64_t>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
dds::core::optional<int32_t>()),
|
||||
this);
|
||||
@@ -2441,7 +2441,7 @@ void ExplosionsEdit::onGearClassChanged()
|
||||
fillParties();
|
||||
onPartyChanged();
|
||||
|
||||
ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
|
||||
ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::GearClass_Mortar;
|
||||
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
|
||||
if (!lastVal.isNull())
|
||||
lastGearClassType = static_cast<ProjectDataManagement::GearClass>(lastVal.toInt());
|
||||
@@ -2482,7 +2482,7 @@ void ExplosionsEdit::onGearClassChanged()
|
||||
}
|
||||
|
||||
|
||||
m_ui->cbGearClass->setProperty(LAST_VALUE, newGearClassType);
|
||||
m_ui->cbGearClass->setProperty(LAST_VALUE, static_cast<int>(newGearClassType));
|
||||
|
||||
doCalculations();
|
||||
}
|
||||
@@ -2501,24 +2501,24 @@ void ExplosionsEdit::gatherParticipantUnits(const int &partyId, QHash<int, QSet<
|
||||
|
||||
auto cb = [this, &partyId, &units, gearClassId](const ParticipantManagement::Participant &part)
|
||||
{
|
||||
if (part.isDeleted() || part.partyId() != partyId)
|
||||
if (part.isDeleted || part.partyId != partyId)
|
||||
return;
|
||||
|
||||
const ParticipantManagement::ParticipantData &ppData = m_ppmDtc->convertParticipantToParticipantData(part);
|
||||
const ParticipantManagement::Type &ppType = m_ppmDtc->type(ppData.typeId());
|
||||
const ParticipantManagement::Type &ppType = m_ppmDtc->type(ppData.typeId);
|
||||
|
||||
if (m_ppmDtc->isAdlerVerbund(ppType.id()))
|
||||
if (m_ppmDtc->isAdlerVerbund(ppType.id))
|
||||
return;
|
||||
const QJsonObject typeProperties(QJsonDocument::fromJson(QByteArray::fromStdString(ppType.properties())).object());
|
||||
const QJsonObject typeProperties(QJsonDocument::fromJson(QByteArray::fromStdString(ppType.properties)).object());
|
||||
|
||||
|
||||
|
||||
|
||||
if (typeProperties.isEmpty() || ppType.typeClass() == ParticipantManagement::TypeClass::Unit ||
|
||||
if (typeProperties.isEmpty() || ppType.typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
!typeProperties[QStringLiteral("isArtillery")].toBool(false) || typeProperties[QStringLiteral("gearClassId")].toInt(-1) != gearClassId)
|
||||
return;
|
||||
|
||||
units[part.superiorId()] += part.id();
|
||||
units[part.superiorId] += part.id;
|
||||
};
|
||||
m_ppmDtc->participants(cb);
|
||||
|
||||
@@ -2526,9 +2526,9 @@ void ExplosionsEdit::gatherParticipantUnits(const int &partyId, QHash<int, QSet<
|
||||
for (auto it = units.begin(); it != units.end();)
|
||||
{
|
||||
const ParticipantManagement::Participant &pp = m_ppmDtc->participant(it.key());
|
||||
const ParticipantManagement::Type &typ = m_ppmDtc->type(pp.typeId());
|
||||
const QJsonObject typeProperties(QJsonDocument::fromJson(QByteArray::fromStdString(typ.properties())).object());
|
||||
if ((typ.typeClass() != ParticipantManagement::TypeClass::Unit && typ.typeClass() != ParticipantManagement::TypeClass::GroundVehicle)
|
||||
const ParticipantManagement::Type &typ = m_ppmDtc->type(pp.typeId);
|
||||
const QJsonObject typeProperties(QJsonDocument::fromJson(QByteArray::fromStdString(typ.properties)).object());
|
||||
if ((typ.typeClass != ParticipantManagement::TypeClass::Unit && typ.typeClass != ParticipantManagement::TypeClass::GroundVehicle)
|
||||
|| !typeProperties[QStringLiteral("isArtillery")].toBool(false))
|
||||
it = units.erase(it++);
|
||||
else
|
||||
@@ -2563,11 +2563,11 @@ bool ExplosionsEdit::isValidParty(qint32 partyId)
|
||||
return m_ppmDtc->participants(static_cast<std::function<bool(const ParticipantManagement::Participant &)>>(
|
||||
[this, partyId, gearClassId](const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
if (participant.partyId() != partyId || participant.isDeleted())
|
||||
if (participant.partyId != partyId || participant.isDeleted)
|
||||
return false;
|
||||
|
||||
const ParticipantManagement::Type type = m_ppmDtc->type(participant.typeId());
|
||||
const QJsonObject typeProperties = QJsonDocument::fromJson(QByteArray::fromStdString(type.properties())).object();
|
||||
const ParticipantManagement::Type type = m_ppmDtc->type(participant.typeId);
|
||||
const QJsonObject typeProperties = QJsonDocument::fromJson(QByteArray::fromStdString(type.properties)).object();
|
||||
const qint32 typeGearClass = typeProperties.value(QStringLiteral("gearClassId")).toInt(-1);
|
||||
|
||||
return typeGearClass == gearClassId;
|
||||
@@ -2601,17 +2601,17 @@ void ExplosionsEdit::fillCharges()
|
||||
for (const ProjectDataManagement::ChargeType &chargeType : std::as_const(chargesForGearClass))
|
||||
{
|
||||
|
||||
const bool bIsVulcano = chargeTypeIdIsVulcano(chargeType.id());
|
||||
const bool bIsVulcano = chargeTypeIdIsVulcano(chargeType.id);
|
||||
|
||||
const double impactRadius4Debug = m_pdmDtc->impactRadius(chargeType.id(), 0, 0);
|
||||
bool isAdlerChargeType = m_pdmDtc->isAdlerChargeType(chargeType.id());
|
||||
const double impactRadius4Debug = m_pdmDtc->impactRadius(chargeType.id, 0, 0);
|
||||
bool isAdlerChargeType = m_pdmDtc->isAdlerChargeType(chargeType.id);
|
||||
|
||||
DEBUG_LOG(m_logger) << " fillCharges"
|
||||
<< ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano
|
||||
<< ", id=" << chargeType.id << ", name= " << chargeType.name << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano
|
||||
<< ", impactRadius4Debug = " << impactRadius4Debug << ", isAdlerChargeType = " << isAdlerChargeType;
|
||||
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::Artillery))
|
||||
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::GearClass_Artillery))
|
||||
continue;
|
||||
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
|
||||
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name), chargeType.id);
|
||||
}
|
||||
|
||||
|
||||
@@ -2630,8 +2630,8 @@ void ExplosionsEdit::fillGearClasses()
|
||||
const auto &gearClasses = m_pdmDtc->gearTypes();
|
||||
for (auto type : std::as_const(gearClasses))
|
||||
{
|
||||
if (m_gearClassFilter.contains(type.gearClassId()) && m_pdmDtc->getAdlerWeaponSystemId(type.id()) <= 3)
|
||||
m_ui->cbGearClass->addItem(m_pdmDtc->trGearTypeName(type.id()), type.gearClassId().underlying());
|
||||
if (m_gearClassFilter.contains(type.gearClassId) && m_pdmDtc->getAdlerWeaponSystemId(type.id) <= 3)
|
||||
m_ui->cbGearClass->addItem(m_pdmDtc->trGearTypeName(type.id), static_cast<int>(type.gearClassId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2649,7 +2649,7 @@ bool ExplosionsEdit::isOnlyNameModifiable() const
|
||||
{
|
||||
|
||||
|
||||
const bool ret = BaseClass::isOnlyNameModifiable() || !m_explosionClusterData.isObjectModifiable();
|
||||
const bool ret = BaseClass::isOnlyNameModifiable() || !m_explosionClusterData.isObjectModifiable;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||
#include <ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_gui_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
|
||||
+79
-79
@@ -95,11 +95,11 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
|
||||
m_geometrieButtonGroup->setExclusive(true);
|
||||
|
||||
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
|
||||
m_gearClassFilter = {ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::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::Rocket;
|
||||
m_gearClassFilter += ProjectDataManagement::GearClass::GearClass_Rocket;
|
||||
|
||||
m_uiRequirements->addRequirement(
|
||||
{m_ui->lbxActors,
|
||||
@@ -186,12 +186,12 @@ bool ExplosionsEditAdler::init(int aesItemId, bool copy, LtsSession::LtsSession
|
||||
if (aesItemId > 0)
|
||||
{
|
||||
const EffectCluster &ecData = m_dtc->effectCluster(aesItemId);
|
||||
DEBUG_LOG(m_logger) << "chargeTypeId: " << ecData.chargeStruct().chargeTypeId();
|
||||
DEBUG_LOG(m_logger) << "chargeTypeId: " << ecData.chargeStruct.chargeTypeId;
|
||||
m_effectClusterData = ecData;
|
||||
setEffectClusterData(ecData);
|
||||
|
||||
setPbStateChangeName();
|
||||
m_ui->gbEffectMarkingInTa->setChecked(m_aesItem.effectMarkingInTa()); // always true for explosion cluster
|
||||
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);
|
||||
@@ -218,7 +218,7 @@ void ExplosionsEditAdler::showPreviewObject()
|
||||
if (!has2DMap(false)) // showMsgBoxIfNot2D
|
||||
return;
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
if (m_previewPolygon.isEmpty())
|
||||
@@ -258,7 +258,7 @@ bool ExplosionsEditAdler::isDataSufficiant()
|
||||
|
||||
// target:
|
||||
bool bHasTargetArea = !m_coord.isNull();
|
||||
switch (m_currentGeometry.underlying())
|
||||
switch (m_currentGeometry)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
bHasTargetArea &= m_ui->lblDimensionYDepth->text().toInt() > 0;
|
||||
@@ -283,25 +283,25 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
m_aesItem = ecData;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " START, ecData=" << ecData;
|
||||
|
||||
m_ui->lblZpNumber->setText(QString::fromStdString(ecData.name()));
|
||||
m_ui->lblZpNumber->setText(QString::fromStdString(ecData.name));
|
||||
|
||||
qint64 effectStart = 0;
|
||||
|
||||
if (ecData.effectStart().is_set())
|
||||
if (ecData.effectStart.has_value())
|
||||
{
|
||||
const QJsonObject propsObj(QJsonDocument::fromJson(QByteArray::fromStdString(ecData.properties())).object());
|
||||
const QJsonObject propsObj(QJsonDocument::fromJson(QByteArray::fromStdString(ecData.properties)).object());
|
||||
const FiringType firingType = static_cast<FiringType>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
|
||||
|
||||
effectStart = ecData.effectStart().get();
|
||||
effectStart = ecData.effectStart.get();
|
||||
|
||||
if (firingType == FiringType::FireWithIndicationTTF)
|
||||
effectStart -= ecData.effectors().size() ? ecData.effectors().at(0).flightTime() : 0;
|
||||
effectStart -= ecData.effectors.size() ? ecData.effectors.at(0).flightTime : 0;
|
||||
}
|
||||
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(effectStart);
|
||||
|
||||
// Geometry/Area
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry);
|
||||
switch (geometryType)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
@@ -324,26 +324,26 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
break;
|
||||
} // switch
|
||||
|
||||
if (ecData.effectDuration() == DEFAULT_EFFECT_DURATION)
|
||||
if (ecData.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||
m_ui->lblDuration->setText(QStringLiteral("---"));
|
||||
else
|
||||
m_ui->lblDuration->setText(QString::number(ecData.effectDuration() / 1000)); // msecs -> secs
|
||||
m_ui->lblDuration->setText(QString::number(ecData.effectDuration / 1000)); // msecs -> secs
|
||||
|
||||
// 1st GearClass
|
||||
ProjectDataManagement::GearClass gc = m_pdmDtc->gearClassFromChargeTypeId(ecData.chargeStruct().chargeTypeId());
|
||||
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()));
|
||||
if (ecData.partyId.has_value())
|
||||
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()));
|
||||
if (ecData.participantId.has_value())
|
||||
m_ui->lblParticipantUnits->setText(QString::fromStdString(m_ppmDtc->participant(ecData.participantId.get()).name));
|
||||
|
||||
m_ui->lblChargeType->setText(m_pdmDtc->adlerChargeTypeName(ecData.chargeStruct().chargeTypeId()));
|
||||
m_ui->lblIgniterType->setText(m_pdmDtc->adlerIgniterTypeName(ecData.chargeStruct().igniterTypeId()));
|
||||
m_ui->lblIgniterFunction->setText(m_pdmDtc->adlerIgniterFunctionName(ecData.chargeStruct().igniterFunctionId()));
|
||||
m_ui->lblChargeType->setText(m_pdmDtc->adlerChargeTypeName(ecData.chargeStruct.chargeTypeId));
|
||||
m_ui->lblIgniterType->setText(m_pdmDtc->adlerIgniterTypeName(ecData.chargeStruct.igniterTypeId));
|
||||
m_ui->lblIgniterFunction->setText(m_pdmDtc->adlerIgniterFunctionName(ecData.chargeStruct.igniterFunctionId));
|
||||
|
||||
int impactCount = 0;
|
||||
|
||||
@@ -355,55 +355,55 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
delete item->widget();
|
||||
delete item;
|
||||
}
|
||||
for (const auto &effectorData : ecData.effectors())
|
||||
for (const auto &effectorData : ecData.effectors)
|
||||
{
|
||||
setEffector(effectorData.participantId(), m_dtc->effector(effectorData.participantId()).effectorState());
|
||||
impactCount += effectorData.chargeAmount();
|
||||
setEffector(effectorData.participantId, m_dtc->effector(effectorData.participantId).effectorState);
|
||||
impactCount += effectorData.chargeAmount;
|
||||
}
|
||||
|
||||
m_ui->layoutEffectors->setColumnStretch(m_effectorNumber + 1 % m_maxColumns, 1);
|
||||
m_ui->lblCannons->setText(QString::number(impactCount));
|
||||
m_ui->lblFirePurpose->setText(m_pdmDtc->trFirePurposeName(ecData.firePurposeId()));
|
||||
m_ui->lblFirePurpose->setText(m_pdmDtc->trFirePurposeName(ecData.firePurposeId));
|
||||
|
||||
m_ui->lblZog->setText(QString::number(ecData.tla())); // tla == zog
|
||||
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());
|
||||
const QPointF centerpoint = Polygons::bottomLeft2CenterPoint(bottomLeft, areaRef.width(), areaRef.height(), areaRef.rotation());
|
||||
const AreaEffectSimulation::Area &areaRef = ecData.area;
|
||||
const QPointF bottomLeft(areaRef.cornerBottomLeft.lon, areaRef.cornerBottomLeft.lat);
|
||||
const QPointF centerpoint = Polygons::bottomLeft2CenterPoint(bottomLeft, areaRef.width, areaRef.height, areaRef.rotation);
|
||||
if (!bottomLeft.isNull())
|
||||
{
|
||||
m_ui->positionEdit->setCoordinate(centerpoint);
|
||||
m_coord = centerpoint;
|
||||
const Core::GeoPosition coordGeo(centerpoint.x(), centerpoint.y(), 0);
|
||||
bool isSmoke = m_pdmDtc->isSmoke(ecData.chargeStruct().chargeTypeId(), ecData.chargeStruct().igniterTypeId(), ecData.chargeStruct().igniterFunctionId());
|
||||
bool isSmoke = m_pdmDtc->isSmoke(ecData.chargeStruct.chargeTypeId, ecData.chargeStruct.igniterTypeId, ecData.chargeStruct.igniterFunctionId);
|
||||
m_esmActorCbx->fillActorComboBox(m_ui->cbActors, coordGeo, isSmoke, 0);
|
||||
m_esmActorCbx->fillActorComboBox(m_ui->cbActors_2, coordGeo, isSmoke, 0);
|
||||
}
|
||||
|
||||
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
if (ecData.explosionGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
{
|
||||
m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height() / 2))));
|
||||
m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width() / 2))));
|
||||
m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height / 2))));
|
||||
m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width / 2))));
|
||||
m_ui->lblAimingAxis->setText(QString::number(0));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height()))));
|
||||
m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width()))));
|
||||
m_ui->lblAimingAxis->setText(QString::number(static_cast<int>(std::round(fmod((areaRef.rotation()) * 6400 / 360, 6400)))));
|
||||
m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height))));
|
||||
m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width))));
|
||||
m_ui->lblAimingAxis->setText(QString::number(static_cast<int>(std::round(fmod((areaRef.rotation) * 6400 / 360, 6400)))));
|
||||
}
|
||||
setEffectClusterDataFromJson(ecData.properties());
|
||||
if (!ecData.esmParticipantIds().empty())
|
||||
setEffectClusterDataFromJson(ecData.properties);
|
||||
if (!ecData.esmParticipantIds.empty())
|
||||
{
|
||||
m_ui->cbActors->setCurrentIndex(m_ui->cbActors->findData(ecData.esmParticipantIds().at(0)));
|
||||
if (ecData.esmParticipantIds().size() > 1)
|
||||
m_ui->cbActors_2->setCurrentIndex(m_ui->cbActors_2->findData(ecData.esmParticipantIds().at(1)));
|
||||
m_ui->cbActors->setCurrentIndex(m_ui->cbActors->findData(ecData.esmParticipantIds.at(0)));
|
||||
if (ecData.esmParticipantIds.size() > 1)
|
||||
m_ui->cbActors_2->setCurrentIndex(m_ui->cbActors_2->findData(ecData.esmParticipantIds.at(1)));
|
||||
}
|
||||
if (ecData.effectors().size())
|
||||
setOWUWFromTrajectory(ecData.effectors().at(0).trajectoryRelative());
|
||||
if (ecData.effectors.size())
|
||||
setOWUWFromTrajectory(ecData.effectors.at(0).trajectoryRelative);
|
||||
|
||||
// enable second Actor if possible
|
||||
const int amountFireMarker = m_pdmDtc->getAmountFireMarkers(ecData.firePurposeId());
|
||||
const int amountFireMarker = m_pdmDtc->getAmountFireMarkers(ecData.firePurposeId);
|
||||
m_ui->cbActors_2->setEnabled(amountFireMarker > 1);
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
@@ -414,7 +414,7 @@ void ExplosionsEditAdler::setEffector(int participantId, const AreaEffectSimulat
|
||||
const ParticipantManagement::Participant &part = m_ppmDtc->participant(participantId);
|
||||
|
||||
auto *effectorWidget = new AesEffector(this);
|
||||
effectorWidget->init(participantId, QString::fromStdString(part.tacticalIdentifier()), QString::fromStdString(part.name()), effectorState);
|
||||
effectorWidget->init(participantId, QString::fromStdString(part.tacticalIdentifier), QString::fromStdString(part.name), effectorState);
|
||||
effectorWidget->setStateButtonVisible(false);
|
||||
|
||||
const int row = m_effectorNumber / m_maxColumns;
|
||||
@@ -430,7 +430,7 @@ void ExplosionsEditAdler::setEffector(int participantId, const AreaEffectSimulat
|
||||
QString ExplosionsEditAdler::dialogIdentifier() const
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "dialogIdentifier";
|
||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddExplosionsArtillery") : QStringLiteral("EditExplosionsArtillery%1").arg(m_aesItem.id());
|
||||
return m_aesItem.id <= 0 ? QStringLiteral("AddExplosionsArtillery") : QStringLiteral("EditExplosionsArtillery%1").arg(m_aesItem.id);
|
||||
}
|
||||
|
||||
void ExplosionsEditAdler::onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject)
|
||||
@@ -442,7 +442,7 @@ void ExplosionsEditAdler::onAcknowledgeExternalAesItemReply(const Core::Function
|
||||
void ExplosionsEditAdler::onEffectClusterChanged(const EffectCluster &ecData, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onExplosionClusterChanged";
|
||||
if (ecData.id() != m_aesItem.id())
|
||||
if (ecData.id != m_aesItem.id)
|
||||
return;
|
||||
|
||||
BaseEdit::onAreaChanged(ecData, modType);
|
||||
@@ -454,15 +454,15 @@ void ExplosionsEditAdler::onEffectClusterChanged(const EffectCluster &ecData, Da
|
||||
}
|
||||
|
||||
m_effectClusterData = ecData;
|
||||
m_currentGeometry = m_effectClusterData.explosionGeometry();
|
||||
m_currentGeometry = m_effectClusterData.explosionGeometry;
|
||||
|
||||
setEffectClusterData(ecData);
|
||||
setPbStateChangeName();
|
||||
|
||||
if (m_effectClusterData.effectDuration() == DEFAULT_EFFECT_DURATION)
|
||||
if (m_effectClusterData.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||
m_ui->lblDuration->setText(QStringLiteral("---"));
|
||||
else
|
||||
m_ui->lblDuration->setText(QString::number(m_effectClusterData.effectDuration() / 1000)); // msec -> sec
|
||||
m_ui->lblDuration->setText(QString::number(m_effectClusterData.effectDuration / 1000)); // msec -> sec
|
||||
|
||||
enableUiElements();
|
||||
if (unchangeable())
|
||||
@@ -556,10 +556,10 @@ void ExplosionsEditAdler::enableUiElements(bool enable)
|
||||
m_ui->rbAngleGroupLower->setEnabled(enable);
|
||||
m_ui->rbAngleGroupUpper->setEnabled(enable);
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsReceived)
|
||||
m_ui->pbStateChange->setEnabled(true);
|
||||
else
|
||||
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
|
||||
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -573,17 +573,17 @@ bool ExplosionsEditAdler::apply()
|
||||
int esmParticipantId2 = m_ui->cbActors_2->currentData().toInt(); // participant ID
|
||||
|
||||
EffectClusterModifyActorRequest request;
|
||||
request.aesId(m_aesItem.id());
|
||||
request.aesId = m_aesItem.id;
|
||||
DEBUG_LOG(m_logger) << "currentIndex: " << m_ui->cbActors->currentIndex() << ", currentText: " << m_ui->cbActors->currentText()
|
||||
<< ", participantId1: " << esmParticipantId1;
|
||||
|
||||
if (esmParticipantId1 > 0 || esmParticipantId2 > 0)
|
||||
{
|
||||
request.esmParticipantIds().reserve(2);
|
||||
request.esmParticipantIds.reserve(2);
|
||||
if (esmParticipantId1 > 0)
|
||||
request.esmParticipantIds().push_back(esmParticipantId1);
|
||||
request.esmParticipantIds.push_back(esmParticipantId1);
|
||||
if (esmParticipantId2 > 0 && esmParticipantId1 != esmParticipantId2 && m_ui->cbActors_2->isEnabled())
|
||||
request.esmParticipantIds().push_back(esmParticipantId2);
|
||||
request.esmParticipantIds.push_back(esmParticipantId2);
|
||||
}
|
||||
|
||||
m_requestHelper->addRequest([this, request]() { return m_ftc->effectClusterModifyActorRequest(request, this); });
|
||||
@@ -593,28 +593,28 @@ bool ExplosionsEditAdler::apply()
|
||||
//
|
||||
void ExplosionsEditAdler::setPbStateChangeName()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onPbStateChangeName: AesEffectState: " << m_aesItem.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "onPbStateChangeName: AesEffectState: " << m_aesItem.effectStateId;
|
||||
|
||||
if ((m_aesItem.effectStateId() != AesEffectState::EsReceived && m_aesItem.effectStateId() != AesEffectState::EsCreated) || m_aesItem.id() <= 0)
|
||||
if ((m_aesItem.effectStateId != AesEffectState::EsReceived && m_aesItem.effectStateId != AesEffectState::EsCreated) || m_aesItem.id <= 0)
|
||||
return;
|
||||
|
||||
m_ui->pbStateChange->show();
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsReceived)
|
||||
m_ui->pbStateChange->setText(tr("Acknowledge"));
|
||||
else
|
||||
{
|
||||
m_ui->pbStateChange->setText(tr("Ready to fire"));
|
||||
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
|
||||
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
|
||||
}
|
||||
}
|
||||
|
||||
void ExplosionsEditAdler::onPbStateChangeClicked()
|
||||
{
|
||||
if ((m_aesItem.effectStateId() != AesEffectState::EsReceived && m_aesItem.effectStateId() != AesEffectState::EsCreated) || m_aesItem.id() <= 0)
|
||||
if ((m_aesItem.effectStateId != AesEffectState::EsReceived && m_aesItem.effectStateId != AesEffectState::EsCreated) || m_aesItem.id <= 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << " onPbStateChangeClicked: AesEffectState = " << m_aesItem.effectStateId();
|
||||
DEBUG_LOG(m_logger) << " onPbStateChangeClicked: AesEffectState = " << m_aesItem.effectStateId;
|
||||
|
||||
m_ui->pbStateChange->setDisabled(true);
|
||||
|
||||
@@ -622,21 +622,21 @@ void ExplosionsEditAdler::onPbStateChangeClicked()
|
||||
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); });
|
||||
QTimer::singleShot(2000, [this]() { m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState != AreaEffectSimulation::AesEffectorState::EsReadyToFire); });
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
if (m_aesItem.effectStateId == AesEffectState::EsReceived)
|
||||
{
|
||||
AreaEffectSimulation::AcknowledgeExternalAesItemRequest request;
|
||||
request.aesId(m_aesItem.id());
|
||||
DEBUG_LOG(m_logger) << "Send acknowledgeExternalAesItemRequest with aesId: " << request.aesId();
|
||||
request.aesId = m_aesItem.id;
|
||||
DEBUG_LOG(m_logger) << "Send acknowledgeExternalAesItemRequest with aesId: " << request.aesId;
|
||||
m_requestHelper->addRequest([this, request]() { return m_ftc->acknowledgeExternalAesItemRequest(request, this); });
|
||||
}
|
||||
else
|
||||
{
|
||||
AreaEffectSimulation::SetAesItemEffectorStateRequest request;
|
||||
request.aesId(m_aesItem.id());
|
||||
request.newEffectorState(AesEffectorState::EsReadyToFire);
|
||||
DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << request.aesId() << ", AesEffectorState: " << request.newEffectorState();
|
||||
request.aesId = m_aesItem.id;
|
||||
request.newEffectorState = AesEffectorState::EsReadyToFire;
|
||||
DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << request.aesId << ", AesEffectorState: " << request.newEffectorState;
|
||||
m_requestHelper->addRequest([this, request]() { return m_ftc->setAesItemEffectorStateRequest(request, this); });
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ void ExplosionsEditAdler::onPbStateChangeClicked()
|
||||
|
||||
void ExplosionsEditAdler::onEffectorChanged(const AreaEffectSimulation::Effector &data, DataModification modType)
|
||||
{
|
||||
if (data.aesItemId() != m_aesItem.id())
|
||||
if (data.aesItemId != m_aesItem.id)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < m_ui->layoutEffectors->count(); ++i)
|
||||
@@ -655,24 +655,24 @@ void ExplosionsEditAdler::onEffectorChanged(const AreaEffectSimulation::Effector
|
||||
{
|
||||
if (AesEffector *effectorWidget = qobject_cast<AesEffector *>(widget))
|
||||
{
|
||||
if (effectorWidget->effectorId() != data.id())
|
||||
if (effectorWidget->effectorId() != data.id)
|
||||
continue;
|
||||
|
||||
effectorWidget->setState(data.effectorState());
|
||||
effectorWidget->setState(data.effectorState);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modType == DataModification::eAdded)
|
||||
setEffector(data.participantId(), data.effectorState());
|
||||
setEffector(data.participantId, data.effectorState);
|
||||
}
|
||||
|
||||
bool ExplosionsEditAdler::isOnlyNameModifiable() const
|
||||
{
|
||||
// BaseClass::isOnlyNameModifiable() -> EsPaused || EsActivated
|
||||
// m_effectClusterData.isObjectModifiable -> since PreStart and s_calculationOffsetMSec
|
||||
const bool ret = BaseClass::isOnlyNameModifiable() || !m_effectClusterData.isObjectModifiable();
|
||||
const bool ret = BaseClass::isOnlyNameModifiable() || !m_effectClusterData.isObjectModifiable;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -694,9 +694,9 @@ void ExplosionsEditAdler::setOWUWFromTrajectory(const std::vector<Core::Relative
|
||||
if (vecGeometry.size() < 2)
|
||||
return;
|
||||
|
||||
const double dz = vecGeometry.at(1).offsetZ() - vecGeometry.at(0).offsetZ();
|
||||
const QLineF line(vecGeometry.at(0).offsetX(), vecGeometry.at(0).offsetY(),
|
||||
vecGeometry.at(1).offsetX(), vecGeometry.at(1).offsetY());
|
||||
const double dz = vecGeometry.at(1).offsetZ - vecGeometry.at(0).offsetZ;
|
||||
const QLineF line(vecGeometry.at(0).offsetX, vecGeometry.at(0).offsetY,
|
||||
vecGeometry.at(1).offsetX, vecGeometry.at(1).offsetY);
|
||||
|
||||
double angleArc = std::atan2(dz, line.length());
|
||||
double angleDegree = angleArc * (180.0 / M_PI);
|
||||
@@ -753,7 +753,7 @@ void ExplosionsEditAdler::setEffectClusterDataFromJson(const std::string &proper
|
||||
m_ui->lblTargetSubType->setText(m_pdmDtc->trTargetSubTypeName(targetSubTypeId));
|
||||
|
||||
const int angleGroup = propsObj[AdlerJson::JsonKeys::WINKELGRUPPE()].toInt();
|
||||
if (angleGroup == ProjectDataManagement::L43_AngleGroup::Lower)
|
||||
if (angleGroup == static_cast<int>(ProjectDataManagement::L43_AngleGroup::Lower))
|
||||
m_ui->rbAngleGroupLower->setChecked(true);
|
||||
else
|
||||
m_ui->rbAngleGroupUpper->setChecked(true);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||
#include <EffectShowManagement/esm_gui_combobox_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
|
||||
+238
-238
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -6,7 +6,7 @@
|
||||
#include "LtsElevation/lts_elevation_manager.h"
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <ElevationMap/elevation_map_manager.h>
|
||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||
#include <EffectShowManagement/esm_gui_combobox_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_data_plugin_interface.h>
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
||||
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
+51
-51
@@ -47,7 +47,7 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geome
|
||||
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
|
||||
const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
|
||||
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::GearClass_Rocket)
|
||||
{
|
||||
QStandardItem *item = cboModel->item(indexCounter);
|
||||
|
||||
@@ -70,7 +70,7 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geome
|
||||
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
|
||||
const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
|
||||
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
|
||||
if (currentGearClass == ProjectDataManagement::GearClass::GearClass_Rocket)
|
||||
{
|
||||
QStandardItem *item = cboModel->item(indexCounter);
|
||||
|
||||
@@ -98,7 +98,7 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geome
|
||||
|
||||
void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc)
|
||||
{
|
||||
switch (request.explosionGeometry().underlying())
|
||||
switch (request.explosionGeometry)
|
||||
{
|
||||
case AesExplosionGeometry::EgAimPoint:
|
||||
case AesExplosionGeometry::EgPoint:
|
||||
@@ -123,23 +123,23 @@ void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, c
|
||||
|
||||
wirkmittel.wirkzeit = 6;
|
||||
|
||||
const UtmCoordinate areaBottomLeftUtm = UtmCoordinate::fromGeographic(request.area().cornerBottomLeft().lon(), request.area().cornerBottomLeft().lat());
|
||||
const UtmCoordinate areaBottomLeftUtm = UtmCoordinate::fromGeographic(request.area.cornerBottomLeft.lon, request.area.cornerBottomLeft.lat);
|
||||
|
||||
QTransform transform;
|
||||
transform.translate(areaBottomLeftUtm.x, areaBottomLeftUtm.y);
|
||||
transform.rotate(-request.area().rotation());
|
||||
transform.rotate(-request.area.rotation);
|
||||
|
||||
const double yLocal = request.area().height() / 2;
|
||||
const double yLocal = request.area.height / 2;
|
||||
|
||||
int mhpSliceCounter = 1;
|
||||
|
||||
for (EffectorData ¤tEffector : request.effectors())
|
||||
for (EffectorData ¤tEffector : request.effectors)
|
||||
{
|
||||
wirkmittel.geschoss.anzahl = currentEffector.chargeAmount();
|
||||
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));
|
||||
double xLocal = request.area.width * (static_cast<double>(mhpSliceCounter++) / (request.effectors.size() + 1));
|
||||
|
||||
// transform local point to UTM
|
||||
const QPointF localPoint(xLocal, yLocal);
|
||||
@@ -150,10 +150,10 @@ void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, c
|
||||
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();
|
||||
treffpunkt.koordinate.koordinate.latitude = currentEffector.mhpPosition().lat() * LtsCoordTrans::rad2deg();
|
||||
currentEffector.mhpPosition.lon = mhpGeo.x();
|
||||
currentEffector.mhpPosition.lat = mhpGeo.y();
|
||||
treffpunkt.koordinate.koordinate.longitude = currentEffector.mhpPosition.lon * LtsCoordTrans::rad2deg();
|
||||
treffpunkt.koordinate.koordinate.latitude = currentEffector.mhpPosition.lat * LtsCoordTrans::rad2deg();
|
||||
|
||||
wirkmittel.treffpunkte.clear();
|
||||
wirkmittel.treffpunkte.append(treffpunkt);
|
||||
@@ -161,32 +161,32 @@ void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, c
|
||||
QJsonObject wirkmittelObj;
|
||||
AdlerJson::wirkmittelFeuerkommandoRaketeToJson(wirkmittelObj, wirkmittel);
|
||||
|
||||
currentEffector.properties(QJsonDocument(wirkmittelObj).toJson().toStdString());
|
||||
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()); // TODO
|
||||
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); // TODO
|
||||
TrajectoryGeoPosition trajectoryWithoutTime;
|
||||
|
||||
TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime);
|
||||
|
||||
currentEffector.flightTime(60000.0);
|
||||
const double flightTimeStep = currentEffector.flightTime() / static_cast<double>(trajectoryWithoutTime.size());
|
||||
currentEffector.flightTime = 60000.0;
|
||||
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());
|
||||
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)
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat());
|
||||
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat);
|
||||
|
||||
currentEffector.trajectoryRelative().emplace_back(utmCurrentPos.x - utmStartPos.x,
|
||||
utmCurrentPos.y - utmStartPos.y, pos.z(), currentFlightTime);
|
||||
currentEffector.trajectoryRelative.emplace_back(utmCurrentPos.x - utmStartPos.x,
|
||||
utmCurrentPos.y - utmStartPos.y, pos.z, currentFlightTime);
|
||||
|
||||
currentFlightTime += flightTimeStep;
|
||||
}
|
||||
@@ -203,19 +203,19 @@ void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, co
|
||||
wirkmittel.wirkzeit = 6;
|
||||
treffpunkt.anzahl = 1;
|
||||
|
||||
const UtmCoordinate areaBottomLeftUtm = UtmCoordinate::fromGeographic(request.area().cornerBottomLeft().lon(), request.area().cornerBottomLeft().lat());
|
||||
const QPointF areaCenterGeo = areaBottomLeftUtm.geographic(request.area().width() / 2, request.area().height() / 2);
|
||||
const UtmCoordinate areaBottomLeftUtm = UtmCoordinate::fromGeographic(request.area.cornerBottomLeft.lon, request.area.cornerBottomLeft.lat);
|
||||
const QPointF areaCenterGeo = areaBottomLeftUtm.geographic(request.area.width / 2, request.area.height / 2);
|
||||
|
||||
for (EffectorData ¤tEffector : request.effectors())
|
||||
for (EffectorData ¤tEffector : request.effectors)
|
||||
{
|
||||
wirkmittel.geschoss.anzahl = currentEffector.chargeAmount();
|
||||
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();
|
||||
treffpunkt.koordinate.koordinate.latitude = currentEffector.mhpPosition().lat() * LtsCoordTrans::rad2deg();
|
||||
currentEffector.mhpPosition.lon = areaCenterGeo.x();
|
||||
currentEffector.mhpPosition.lat = areaCenterGeo.y();
|
||||
treffpunkt.koordinate.koordinate.longitude = currentEffector.mhpPosition.lon * LtsCoordTrans::rad2deg();
|
||||
treffpunkt.koordinate.koordinate.latitude = currentEffector.mhpPosition.lat * LtsCoordTrans::rad2deg();
|
||||
|
||||
wirkmittel.treffpunkte.clear();
|
||||
wirkmittel.treffpunkte.append(treffpunkt);
|
||||
@@ -223,32 +223,32 @@ void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, co
|
||||
QJsonObject wirkmittelObj;
|
||||
AdlerJson::wirkmittelFeuerkommandoRaketeToJson(wirkmittelObj, wirkmittel);
|
||||
|
||||
currentEffector.properties(QJsonDocument(wirkmittelObj).toJson().toStdString());
|
||||
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());
|
||||
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);
|
||||
TrajectoryGeoPosition trajectoryWithoutTime;
|
||||
|
||||
TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime);
|
||||
|
||||
currentEffector.flightTime(60000.0);
|
||||
const double flightTimeStep = currentEffector.flightTime() / static_cast<double>(trajectoryWithoutTime.size());
|
||||
currentEffector.flightTime = 60000.0;
|
||||
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());
|
||||
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)
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat());
|
||||
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat);
|
||||
|
||||
currentEffector.trajectoryRelative().emplace_back(utmCurrentPos.x - utmStartPos.x,
|
||||
utmCurrentPos.y - utmStartPos.y, pos.z(), currentFlightTime);
|
||||
currentEffector.trajectoryRelative.emplace_back(utmCurrentPos.x - utmStartPos.x,
|
||||
utmCurrentPos.y - utmStartPos.y, pos.z, currentFlightTime);
|
||||
|
||||
currentFlightTime += flightTimeStep;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user