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
-9
@@ -54,7 +54,7 @@ bool BuildingModel::isValid(const LtsUtils::QPoint3D &point)
|
||||
|
||||
bool BuildingModel::isValid(const Core::GeoPosition &point)
|
||||
{
|
||||
return !qFuzzyIsNull(point.lon()) && !qFuzzyIsNull(point.lat()) && point.z() > invalidGeoPosition().z();
|
||||
return !qFuzzyIsNull(point.lon) && !qFuzzyIsNull(point.lat) && point.z > invalidGeoPosition().z;
|
||||
}
|
||||
|
||||
LtsUtils::QPoint3D BuildingModel::invalidPosition()
|
||||
@@ -93,10 +93,10 @@ bool BuildingModel::init(
|
||||
m_buildingId = buildingId;
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START, m_buildingId=" << m_buildingId;
|
||||
|
||||
m_angle = mse.angle() * M_PI / 180.;
|
||||
m_refPosGeo = mse.geoPosition();
|
||||
m_refPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mse.geoPosition().lon(), mse.geoPosition().lat());
|
||||
m_refPos = {m_refPosUtm.x, m_refPosUtm.y, m_refPosGeo.z()};
|
||||
m_angle = mse.angle * M_PI / 180.;
|
||||
m_refPosGeo = mse.geoPosition;
|
||||
m_refPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mse.geoPosition.lon, mse.geoPosition.lat);
|
||||
m_refPos = {m_refPosUtm.x, m_refPosUtm.y, m_refPosGeo.z};
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " START, m_buildingId=" << m_buildingId
|
||||
<< ", m_angle=" << m_angle
|
||||
@@ -104,8 +104,8 @@ bool BuildingModel::init(
|
||||
<< ", m_refPos=" << m_refPos;
|
||||
|
||||
|
||||
for (const InfrastructureManagement::FootprintElement &footprintElement : std::as_const(mfp.elements()))
|
||||
m_footprint << QPointF(footprintElement.relPosition().offsetX(), footprintElement.relPosition().offsetY());
|
||||
for (const InfrastructureManagement::FootprintElement &footprintElement : std::as_const(mfp.elements))
|
||||
m_footprint << QPointF(footprintElement.relPosition.offsetX, footprintElement.relPosition.offsetY);
|
||||
if (m_footprint.isEmpty())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading MainFootprint for building " << m_buildingId;
|
||||
@@ -303,9 +303,9 @@ LtsUtils::QPoint3D BuildingModel::fromGeographic(const Core::GeoPosition &point)
|
||||
{
|
||||
// qCritical() << " point.z = " << point.z();
|
||||
// qCritical() << " m_refPos = " << m_refPos.x() << " - " << m_refPos.y() << " - " << m_refPos.z();
|
||||
const LtsCoordTrans::UtmCoordinate utm = LtsCoordTrans::UtmCoordinate::fromGeographic(point.lon(), point.lat());
|
||||
const LtsCoordTrans::UtmCoordinate utm = LtsCoordTrans::UtmCoordinate::fromGeographic(point.lon, point.lat);
|
||||
// qCritical() << " utm = " << utm.mgrs(7);
|
||||
return toReference({utm.x, utm.y, point.z()});
|
||||
return toReference({utm.x, utm.y, point.z});
|
||||
}
|
||||
|
||||
QVector<LtsUtils::QPoint3D> BuildingModel::fromGeographic(const std::vector<Core::GeoPosition> &points) const
|
||||
|
||||
+142
-141
@@ -16,6 +16,7 @@
|
||||
#include <QtCore/QPointF>
|
||||
#include <QtGui/QPolygonF>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QTransform>
|
||||
|
||||
#include <LtsUtilsCore/dds_bitarray.h>
|
||||
@@ -92,34 +93,34 @@ bool HandlerAesData::init()
|
||||
void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onBoobyTrapChanged"
|
||||
<< " id=" << data.id()
|
||||
<< " impactPosition=" << data.impactPosition()
|
||||
<< " impactRadius=" << data.impactRadius()
|
||||
<< " effectStateId=" << data.effectStateId();
|
||||
<< " id=" << data.id
|
||||
<< " impactPosition=" << data.impactPosition
|
||||
<< " impactRadius=" << data.impactRadius
|
||||
<< " effectStateId=" << data.effectStateId;
|
||||
|
||||
if (data.isDeleted()
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
if (data.isDeleted
|
||||
|| data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
if (!data.triggered())
|
||||
if (!data.triggered)
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onBoobyTrapChanged"
|
||||
<< " data.id=" << data.id()
|
||||
<< " effectStateId=" << data.effectStateId();
|
||||
<< " data.id=" << data.id
|
||||
<< " effectStateId=" << data.effectStateId;
|
||||
|
||||
if (!data.effectStart.is_set())
|
||||
if (!data.effectStart.has_value())
|
||||
return;
|
||||
|
||||
if ((m_ddsHandler->currentPartitionTime() - (data.effectStart.get() + data.effectDuration())) > 2000)
|
||||
if ((m_ddsHandler->currentPartitionTime() - (data.effectStart.get() + data.effectDuration)) > 2000)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onBoobyTrap outdated";
|
||||
return;
|
||||
}
|
||||
AreaEffectSimulation::AesItemView itemView;
|
||||
AreaEffectSimulation::AesType aesType = AreaEffectSimulation::AesType::AtBoobyTrap;
|
||||
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(data.id(), aesType, itemView);
|
||||
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(data.id, aesType, itemView);
|
||||
|
||||
checkBuildingsHit(itemView);
|
||||
}
|
||||
@@ -132,40 +133,40 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d
|
||||
void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onAesItemViewChanged"
|
||||
<< " data.aesTypeId()=" << data.aesTypeId();
|
||||
<< " data.aesTypeId()=" << data.aesTypeId;
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId;
|
||||
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
{
|
||||
INFO_LOG(m_logger) << "AesEffectState::EsExpired"
|
||||
<< " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " effectStart=" << data.effectStart()
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - data.effectStart() ;
|
||||
<< " effectStart=" << data.effectStart
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - data.effectStart ;
|
||||
if (m_ddsHandler->currentPartitionTime() == 0)
|
||||
return;
|
||||
|
||||
if ((data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
|| (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary))
|
||||
if ((data.aesTypeId == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
|| (data.aesTypeId == AreaEffectSimulation::AesType::AtBoobyTrapSecondary))
|
||||
{
|
||||
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AtOffRouteMineSecondary id=" << data.id() / 1000;
|
||||
auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int)(data.id() / 1000));
|
||||
if (!offRouteMine.effectStart.is_set())
|
||||
DEBUG_LOG(m_logger) << "AtOffRouteMineSecondary id=" << data.id / 1000;
|
||||
auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int)(data.id / 1000));
|
||||
if (!offRouteMine.effectStart.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart.is_set()";
|
||||
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart.has_value()";
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " effectStart=" << offRouteMine.effectStart()
|
||||
<< " effectDuration=" << offRouteMine.effectDuration()
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart.get() + offRouteMine.effectDuration()) ;
|
||||
<< " effectStart=" << offRouteMine.effectStart
|
||||
<< " effectDuration=" << offRouteMine.effectDuration
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart.get() + offRouteMine.effectDuration) ;
|
||||
|
||||
if ((m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart.get() + offRouteMine.effectDuration())) < 2000)
|
||||
if ((m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart.get() + offRouteMine.effectDuration)) < 2000)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary Mine wird ausgeloeset.";
|
||||
checkBuildingsHit(data);
|
||||
@@ -177,22 +178,22 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary id=" << data.id() / 1000;
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary id=" << data.id / 1000;
|
||||
//auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int) (data.id() / 1000));
|
||||
auto boobyTrap = m_ddsHandler->dtcAes()->boobyTrap((int)(data.id() / 1000));
|
||||
if (!boobyTrap.effectStart.is_set())
|
||||
auto boobyTrap = m_ddsHandler->dtcAes()->boobyTrap((int)(data.id / 1000));
|
||||
if (!boobyTrap.effectStart.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart.is_set()";
|
||||
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart.has_value()";
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " effectStart=" << boobyTrap.effectStart()
|
||||
<< " effectDuration=" << boobyTrap.effectDuration()
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart.get() + boobyTrap.effectDuration()) ;
|
||||
<< " effectStart=" << boobyTrap.effectStart
|
||||
<< " effectDuration=" << boobyTrap.effectDuration
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart.get() + boobyTrap.effectDuration) ;
|
||||
|
||||
if ((m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart.get() + boobyTrap.effectDuration())) < 2000)
|
||||
if ((m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart.get() + boobyTrap.effectDuration)) < 2000)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary Mine wird ausgeloeset.";
|
||||
checkBuildingsHit(data);
|
||||
@@ -207,20 +208,20 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
|
||||
|
||||
DEBUG_LOG(m_logger) << "removeStates data";
|
||||
removeStates(data);
|
||||
DEBUG_LOG(m_logger) << "m_aesItemViewsUtm remove id" << data.aesItemId();
|
||||
m_aesItemViewsUtm.remove(data.aesItemId());
|
||||
DEBUG_LOG(m_logger) << "m_aesItemViewsUtm remove id" << data.aesItemId;
|
||||
m_aesItemViewsUtm.remove(data.aesItemId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data)
|
||||
{
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtExplosionArea)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtExplosionArea)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId;
|
||||
// remove State for each building
|
||||
for (CentralEffectSimulation::BitfieldStates &bfs : m_bitfieldStatesBld)
|
||||
bfs.remove(data.aesItemId());
|
||||
bfs.remove(data.aesItemId);
|
||||
} // end removeStates
|
||||
|
||||
void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::ChargeStruct &chargeStruct,
|
||||
@@ -238,24 +239,24 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char
|
||||
for (const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint : std::as_const(footprints))
|
||||
{
|
||||
|
||||
const Core::GeoPosition2D impactPosition2D(impactPosition.lon(), impactPosition.lat());
|
||||
const Core::GeoPosition2D impactPosition2D(impactPosition.lon, impactPosition.lat);
|
||||
if (inFootprint(impactPosition, footprint, impactRadius))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId
|
||||
<< " chargeTypeId = " << chargeStruct.chargeTypeId()
|
||||
<< " chargeTypeId = " << chargeStruct.chargeTypeId
|
||||
<< " id = " << id
|
||||
<< " currentPartitionTime = " << m_ddsHandler->currentPartitionTime()
|
||||
<< " impactPosition2D.lon = " << impactPosition2D.lon()
|
||||
<< " impactPosition2D.lat = " << impactPosition2D.lat();
|
||||
<< " impactPosition2D.lon = " << impactPosition2D.lon
|
||||
<< " impactPosition2D.lat = " << impactPosition2D.lat;
|
||||
|
||||
Buildings::SendCesHitOnBuildingRequest requestBld(
|
||||
footprint.mseId,
|
||||
chargeStruct.chargeTypeId(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(chargeStruct.chargeTypeId()).destructiveFactor(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(chargeStruct.chargeTypeId()).penetrationFactor(),
|
||||
chargeStruct.chargeTypeId,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(chargeStruct.chargeTypeId).destructiveFactor,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(chargeStruct.chargeTypeId).penetrationFactor,
|
||||
id,
|
||||
m_ddsHandler->currentPartitionTime(),
|
||||
Core::GeoPosition(impactPosition2D.lon(), impactPosition2D.lat(), 0.0),
|
||||
Core::GeoPosition(impactPosition2D.lon, impactPosition2D.lat, 0.0),
|
||||
QStringLiteral("properties").toStdString());
|
||||
m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this);
|
||||
}
|
||||
@@ -292,8 +293,8 @@ void HandlerAesData::onStartTimeReached()
|
||||
|
||||
// Timer stoppen und loeschen
|
||||
AreaEffectSimulation::ChargeEffect data = m_chargeEffects.value(chargeEffectId);
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct(data.chargeTypeId(),data.igniterTypeId(), data.igniterFunctionId());
|
||||
calculateBuildingExplosion(chargeStruct, data.position(), data.id());
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct(data.chargeTypeId,data.igniterTypeId, data.igniterFunctionId);
|
||||
calculateBuildingExplosion(chargeStruct, data.position, data.id);
|
||||
sender()->deleteLater();
|
||||
m_chargeEffects.remove(chargeEffectId);
|
||||
}
|
||||
@@ -303,7 +304,7 @@ void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEff
|
||||
DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged";
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
const long long effectStart = data.effectStart();
|
||||
const long long effectStart = data.effectStart;
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged"
|
||||
<< ", effectStart=" << effectStart
|
||||
@@ -318,23 +319,23 @@ void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEff
|
||||
}
|
||||
// Startzeit entspricht der aktuellen Zeit
|
||||
if ( effectStart > m_ddsHandler->currentPartitionTime() - TIMEDIFFVALID
|
||||
&& effectStart < m_ddsHandler->currentPartitionTime() + data.effectDuration() )
|
||||
&& effectStart < m_ddsHandler->currentPartitionTime() + data.effectDuration )
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Startzeit entspricht der aktuellen Zeit";
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct;
|
||||
chargeStruct.chargeTypeId(data.chargeTypeId());
|
||||
chargeStruct.igniterTypeId(data.igniterTypeId());
|
||||
calculateBuildingExplosion(chargeStruct, data.position(), data.id());
|
||||
chargeStruct.chargeTypeId = data.chargeTypeId;
|
||||
chargeStruct.igniterTypeId = data.igniterTypeId;
|
||||
calculateBuildingExplosion(chargeStruct, data.position, data.id);
|
||||
}
|
||||
// Startzeit in der Zukunft:
|
||||
else if (effectStart > m_ddsHandler->currentPartitionTime() + data.effectDuration())
|
||||
else if (effectStart > m_ddsHandler->currentPartitionTime() + data.effectDuration)
|
||||
{
|
||||
// Start mit Timer
|
||||
DEBUG_LOG(m_logger) << "Startzeit in der Zukunft"
|
||||
<< ", id :" << data.id()
|
||||
<< ", id :" << data.id
|
||||
<< ", duration=" << effectStart - m_ddsHandler->currentPartitionTime();
|
||||
m_chargeEffects.insert(data.id(), data);
|
||||
startTimer(data.id(), effectStart - m_ddsHandler->currentPartitionTime());
|
||||
m_chargeEffects.insert(data.id, data);
|
||||
startTimer(data.id, effectStart - m_ddsHandler->currentPartitionTime());
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "END onChargeEffectChanged";
|
||||
|
||||
@@ -346,30 +347,30 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
{
|
||||
m_explosionSingleState.remove(data.id());
|
||||
m_explosionSingleState.remove(data.id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
|
||||
m_explosionSingleState.remove(data.id());
|
||||
m_explosionSingleState.remove(data.id);
|
||||
return;
|
||||
}
|
||||
// Only handle transitions from prepared or fired to activated
|
||||
if ((m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||
m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsFired) &&
|
||||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
if ((m_explosionSingleState.value(data.id) == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||
m_explosionSingleState.value(data.id) == AreaEffectSimulation::AesEffectState::EsFired) &&
|
||||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
|
||||
handleExplosion = true;
|
||||
}
|
||||
m_explosionSingleState.insert(data.id(), data.effectStateId());
|
||||
m_explosionSingleState.insert(data.id, data.effectStateId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionSingle";
|
||||
if (handleExplosion)
|
||||
{
|
||||
calculateBuildingExplosion(data.chargeStruct(), data.impactPosition(), data.id());
|
||||
calculateBuildingExplosion(data.chargeStruct, data.impactPosition, data.id);
|
||||
}
|
||||
} // onExplosionSingleChanged
|
||||
|
||||
@@ -377,10 +378,10 @@ void HandlerAesData::onAirSupportImpactChanged(const AreaEffectSimulation::AirSu
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got onAirSupportImpactChanged()";
|
||||
AreaEffectSimulation::ExplosionSingle esData;
|
||||
esData.id(data.id());
|
||||
esData.chargeStruct().chargeTypeId(data.chargeStruct().chargeTypeId());
|
||||
esData.impactPosition(data.impactPosition());
|
||||
esData.effectStateId(data.effectStateId());
|
||||
esData.id = data.id;
|
||||
esData.chargeStruct.chargeTypeId = data.chargeStruct.chargeTypeId;
|
||||
esData.impactPosition = data.impactPosition;
|
||||
esData.effectStateId = data.effectStateId;
|
||||
onExplosionSingleChanged(esData, modType);
|
||||
}
|
||||
|
||||
@@ -400,7 +401,7 @@ void HandlerAesData::onEffectsChanged(const AreaEffectSimulation::Effects &effec
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
if (effects.aesTypeId != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << " Got typechecked effects " << effects;
|
||||
@@ -470,22 +471,22 @@ bool HandlerAesData::inFootprint(const Core::GeoPosition2D &geoPosition,
|
||||
|
||||
void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data)
|
||||
{
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "preCalculateImpacts";
|
||||
// Find AES ItemView and set Bounding-Box of Aes-Field
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
const int aesItemId = data.aesItemId;
|
||||
|
||||
// Search corresponding itemView. If not available no impact to participant.
|
||||
// Use dtcAes since sender (AES) publishes TriggeredImpacts and AesItemView
|
||||
//
|
||||
AreaEffectSimulation::AesItemView aesItemView;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> dtcAes = m_ddsHandler->dtcAes();
|
||||
if (!dtcAes->aesItemViewFromEntityId(aesItemId, data.aesTypeId(), aesItemView))
|
||||
if (!dtcAes->aesItemViewFromEntityId(aesItemId, data.aesTypeId, aesItemView))
|
||||
{
|
||||
static long msgCnt = 0;
|
||||
WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"
|
||||
WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId << " No aesItemView available"
|
||||
<< " (cnt=" << ++msgCnt << ")";
|
||||
return;
|
||||
}
|
||||
@@ -543,7 +544,7 @@ void HandlerAesData::onSetBuildingStatesReply(const Core::FunctionReplyObject &r
|
||||
void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data, const AreaEffectSimulation::AesItemView &aesItemView,
|
||||
const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint)
|
||||
{
|
||||
const int aesItemId = data.aesItemId();
|
||||
const int aesItemId = data.aesItemId;
|
||||
bool bIsExplosionCluster = false;
|
||||
ProjectDataManagement::IgniterFunctionBase ignFuncBase = ProjectDataManagement::IgniterFunctionBase::IfbImpact;
|
||||
|
||||
@@ -556,14 +557,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions,
|
||||
};
|
||||
|
||||
if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
{
|
||||
bIsExplosionCluster = true;
|
||||
ignFuncBase = igniterFunctionBaseExplosionCluster(aesItemId); // assume that fuseType does not differ within a single ExplosionArea
|
||||
DEBUG_LOG(m_logger) << "Calculate, bIsExplosionCluster = " << bIsExplosionCluster
|
||||
<< ", ignFuncBase = " << ignFuncBase;
|
||||
}
|
||||
else if (s_relevantTypes.contains(data.aesTypeId().underlying()))
|
||||
else if (s_relevantTypes.contains(data.aesTypeId))
|
||||
DEBUG_LOG(m_logger) << "Calculate";
|
||||
else
|
||||
{
|
||||
@@ -571,11 +572,11 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
return;
|
||||
}
|
||||
|
||||
if (aesItemId != aesItemView.aesItemId())
|
||||
if (aesItemId != aesItemView.aesItemId)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "mismatch: "
|
||||
<< ", TriggeredExplosions.aesItemId=" << data.aesItemId()
|
||||
<< ", AesItemView.aesItemId=" << aesItemView.aesItemId();
|
||||
<< ", TriggeredExplosions.aesItemId=" << data.aesItemId
|
||||
<< ", AesItemView.aesItemId=" << aesItemView.aesItemId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -589,24 +590,24 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
for (int i : std::as_const(bitfieldState))
|
||||
DEBUG_LOG(m_logger) << "bitfieldState for " << aesItemId << ": " << i;
|
||||
|
||||
for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx)
|
||||
for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount; ++bitFieldIdx)
|
||||
{
|
||||
// no break, because every bit can be a hit
|
||||
if (LtsUtils::BitArray::testBit(data.bitfield(), bitFieldIdx))
|
||||
if (LtsUtils::BitArray::testBit(data.bitfield, bitFieldIdx))
|
||||
continue;
|
||||
|
||||
// get position of impact to corresponding bit
|
||||
if (aesItemView.form().size() <= size_t(bitFieldIdx))
|
||||
if (aesItemView.form.size() <= size_t(bitFieldIdx))
|
||||
continue;
|
||||
|
||||
const Core::GeoPosition &impactPosition = aesItemView.form()[bitFieldIdx];
|
||||
const Core::GeoPosition &impactPosition = aesItemView.form[bitFieldIdx];
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION
|
||||
<< " impactPosition: lat/lon" << impactPosition.lat() << "/" << impactPosition.lon() << " z=" << impactPosition.z()
|
||||
<< " impactPosition: lat/lon" << impactPosition.lat << "/" << impactPosition.lon << " z=" << impactPosition.z
|
||||
<< " UTM=" << CentralEffectSimulation::debug(CentralEffectSimulation::geographic2Utm(impactPosition));
|
||||
|
||||
// check, if impact-pos + munition-radius touch the building
|
||||
// get radius of munition
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeStruct());
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeStruct);
|
||||
if (inFootprint(impactPosition, footprint, impactRadius))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "In Footprint of mseId = " << footprint.mseId;
|
||||
@@ -620,7 +621,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
<< ", bitFieldIdx= " << bitFieldIdx
|
||||
<< ", ignFuncBase = " << ignFuncBase;
|
||||
|
||||
if (! qFuzzyIsNull(impactPosition.z()))
|
||||
if (! qFuzzyIsNull(impactPosition.z))
|
||||
{
|
||||
// since HandlerBuildingModel::handleDetonationLocationRequest has already
|
||||
// calculated to fuseType, the impactPosition is the detonationLocation:
|
||||
@@ -628,7 +629,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
//
|
||||
|
||||
double detonationDistance = 0;
|
||||
switch (ignFuncBase.underlying())
|
||||
switch (ignFuncBase)
|
||||
{
|
||||
case ProjectDataManagement::IgniterFunctionBase::IfbProximity:
|
||||
detonationDistance = -5;
|
||||
@@ -646,9 +647,9 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
|
||||
Buildings::SendCesHit3DonBuildingRequest requestBld(
|
||||
footprint.mseId,
|
||||
aesItemView.chargeStruct().chargeTypeId(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct().chargeTypeId()).destructiveFactor(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct().chargeTypeId()).penetrationFactor(),
|
||||
aesItemView.chargeStruct.chargeTypeId,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct.chargeTypeId).destructiveFactor,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct.chargeTypeId).penetrationFactor,
|
||||
aesItemId,
|
||||
m_ddsHandler->currentPartitionTime(),
|
||||
impactPosition,
|
||||
@@ -667,12 +668,12 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
// z-Value is 0 -> old / ! AtExplosionClusterSingleExplosions
|
||||
Buildings::SendCesHitOnBuildingRequest requestBld(
|
||||
footprint.mseId,
|
||||
aesItemView.chargeStruct().chargeTypeId(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct().chargeTypeId()).destructiveFactor(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct().chargeTypeId()).penetrationFactor(),
|
||||
aesItemView.chargeStruct.chargeTypeId,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct.chargeTypeId).destructiveFactor,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(aesItemView.chargeStruct.chargeTypeId).penetrationFactor,
|
||||
aesItemId,
|
||||
m_ddsHandler->currentPartitionTime(),
|
||||
Core::GeoPosition(impactPosition.lon(), impactPosition.lat(), 0.0),
|
||||
Core::GeoPosition(impactPosition.lon, impactPosition.lat, 0.0),
|
||||
QStringLiteral("properties").toStdString());
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId
|
||||
@@ -692,31 +693,31 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
|
||||
void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effects, const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint)
|
||||
{
|
||||
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
if (effects.aesTypeId != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|
||||
return;
|
||||
|
||||
const int aesItemId = effects.aesItemId();
|
||||
const int aesItemId = effects.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << aesItemId;
|
||||
|
||||
const AreaEffectSimulation::ExplosionCluster &ec = m_ddsHandler->dtcAes()->explosionCluster(effects.aesItemId());
|
||||
if (ec.id() != aesItemId)
|
||||
const AreaEffectSimulation::ExplosionCluster &ec = m_ddsHandler->dtcAes()->explosionCluster(effects.aesItemId);
|
||||
if (ec.id != aesItemId)
|
||||
return;
|
||||
|
||||
const ProjectDataManagement::IgniterFunctionBase ignFuncBase = igniterFunctionBaseExplosionCluster(aesItemId);
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(ec.chargeStruct());
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(ec.chargeStruct);
|
||||
|
||||
|
||||
CentralEffectSimulation::BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId];
|
||||
QSet<int> &bitfieldState = bitfieldStates[aesItemId];
|
||||
|
||||
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = effects.singleEffects();
|
||||
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = effects.singleEffects;
|
||||
int indexBitFieldIdx = -1;
|
||||
for (const AreaEffectSimulation::SingleEffect &singleEffect : std::as_const(singleEffectsRef))
|
||||
{
|
||||
++indexBitFieldIdx;
|
||||
|
||||
// just SesTriggered are relevant:
|
||||
if (singleEffect.singleEffectState() != AreaEffectSimulation::AesSingleEffectState::SesTriggered)
|
||||
if (singleEffect.singleEffectState != AreaEffectSimulation::AesSingleEffectState::SesTriggered)
|
||||
continue;
|
||||
|
||||
// already processed?
|
||||
@@ -724,7 +725,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
continue;
|
||||
|
||||
// is building in range?
|
||||
const Core::GeoPosition &impactPositionGeo = singleEffect.position();
|
||||
const Core::GeoPosition &impactPositionGeo = singleEffect.position;
|
||||
if (!inFootprint(impactPositionGeo, footprint, impactRadius))
|
||||
continue;
|
||||
|
||||
@@ -744,13 +745,13 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
DEBUG_LOG(m_logger) << "findBuildingsBetween returns mseIdAsStr =" << mseIdAsStr;
|
||||
|
||||
|
||||
const ProjectDataManagement::BuildingChargeEffect &bldgChargeEffect = m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(ec.chargeStruct().chargeTypeId());
|
||||
if (bldgChargeEffect.id() <= 0)
|
||||
ERROR_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, chargeTypeId not found: =" << ec.chargeStruct().chargeTypeId();
|
||||
const ProjectDataManagement::BuildingChargeEffect &bldgChargeEffect = m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(ec.chargeStruct.chargeTypeId);
|
||||
if (bldgChargeEffect.id <= 0)
|
||||
ERROR_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, chargeTypeId not found: =" << ec.chargeStruct.chargeTypeId;
|
||||
|
||||
|
||||
qint32 destructiveFactor = bldgChargeEffect.destructiveFactor();
|
||||
qint32 penetrationFactor = bldgChargeEffect.penetrationFactor();
|
||||
qint32 destructiveFactor = bldgChargeEffect.destructiveFactor;
|
||||
qint32 penetrationFactor = bldgChargeEffect.penetrationFactor;
|
||||
|
||||
if ((destructiveFactor <= 0) || (penetrationFactor <= 0))
|
||||
WARNING_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, destructiveFactor or penetrationFactor invalid"
|
||||
@@ -769,25 +770,25 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
properties += mseIdAsStr;
|
||||
|
||||
|
||||
const AreaEffectSimulation::AesZPlacement zPlacement = static_cast<AreaEffectSimulation::AesZPlacement>(singleEffect.zPlacement());
|
||||
const AreaEffectSimulation::AesZPlacement zPlacement = static_cast<AreaEffectSimulation::AesZPlacement>(singleEffect.zPlacement);
|
||||
|
||||
if (zPlacement == AreaEffectSimulation::AesZPlacement::ZpDraped)
|
||||
{
|
||||
// z-Value is 0 -> old:
|
||||
Buildings::SendCesHitOnBuildingRequest requestBld(
|
||||
footprint.mseId,
|
||||
ec.chargeStruct().chargeTypeId(),
|
||||
ec.chargeStruct.chargeTypeId,
|
||||
destructiveFactor,
|
||||
penetrationFactor,
|
||||
aesItemId,
|
||||
m_ddsHandler->currentPartitionTime(),
|
||||
Core::GeoPosition(impactPositionGeo.lon(), impactPositionGeo.lat(), 0.0),
|
||||
Core::GeoPosition(impactPositionGeo.lon, impactPositionGeo.lat, 0.0),
|
||||
properties.toStdString());
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId
|
||||
<< " bitFieldIdx= " << indexBitFieldIdx
|
||||
<< ", impactPositionGeo= " << impactPositionGeo
|
||||
<< ", chargeTypeId= " << ec.chargeStruct().chargeTypeId()
|
||||
<< ", chargeTypeId= " << ec.chargeStruct.chargeTypeId
|
||||
<< ", destructiveFactor= " << destructiveFactor
|
||||
<< ", penetrationFactor= " << penetrationFactor;
|
||||
m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this);
|
||||
@@ -801,7 +802,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
Core::GeoPosition detonationLocation = impactPositionGeo;
|
||||
|
||||
double detonationDistance = 0;
|
||||
switch (ignFuncBase.underlying())
|
||||
switch (ignFuncBase)
|
||||
{
|
||||
case ProjectDataManagement::IgniterFunctionBase::IfbProximity:
|
||||
detonationDistance = -5;
|
||||
@@ -821,7 +822,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
|
||||
Buildings::SendCesHit3DonBuildingRequest requestBld(
|
||||
footprint.mseId,
|
||||
ec.chargeStruct().chargeTypeId(),
|
||||
ec.chargeStruct.chargeTypeId,
|
||||
destructiveFactor,
|
||||
penetrationFactor,
|
||||
aesItemId,
|
||||
@@ -835,7 +836,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
<< " bitFieldIdx= " << indexBitFieldIdx
|
||||
<< ", impactPosition= " << impactPositionGeo
|
||||
<< ", zPlacement= " << zPlacement
|
||||
<< ", chargeTypeId= " << ec.chargeStruct().chargeTypeId()
|
||||
<< ", chargeTypeId= " << ec.chargeStruct.chargeTypeId
|
||||
<< ", destructiveFactor= " << destructiveFactor
|
||||
<< ", penetrationFactor= " << penetrationFactor;
|
||||
|
||||
@@ -851,16 +852,16 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
QPolygonF polyGeo;
|
||||
|
||||
DEBUG_LOG(m_logger) << "checkBuildingsHit " << ", aesItemId=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "checkBuildingsHit " << ", aesItemId=" << data.aesItemId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary data.form().size()=" << data.form().size();
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary data.form().size()=" << data.form.size();
|
||||
// BoobyTrap
|
||||
polyGeo.reserve(data.form().size());
|
||||
for (const auto &pointGeo : std::as_const(data.form()))
|
||||
polyGeo.reserve(data.form.size());
|
||||
for (const auto &pointGeo : std::as_const(data.form))
|
||||
{
|
||||
QPointF point;
|
||||
point.setX(pointGeo.lon());
|
||||
point.setY(pointGeo.lat());
|
||||
point.setX(pointGeo.lon);
|
||||
point.setY(pointGeo.lat);
|
||||
DEBUG_LOG(m_logger) << "point= " << point.x() << "/" << point.y();
|
||||
polyGeo.append(point);
|
||||
}
|
||||
@@ -877,28 +878,28 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " BuildingId=" << buildingId;
|
||||
Buildings::Building tmpBldg;
|
||||
tmpBldg.buildingId(buildingId);
|
||||
tmpBldg.buildingId = buildingId;
|
||||
|
||||
Core::GeoPosition impactPosition;
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
{
|
||||
impactPosition.lat(m_ddsHandler->dtcAes()->boobyTrap(data.aesItemId()).impactPosition().lat());
|
||||
impactPosition.lon(m_ddsHandler->dtcAes()->boobyTrap(data.aesItemId()).impactPosition().lon());
|
||||
impactPosition.lat = m_ddsHandler->dtcAes()->boobyTrap(data.aesItemId).impactPosition.lat;
|
||||
impactPosition.lon = m_ddsHandler->dtcAes()->boobyTrap(data.aesItemId).impactPosition.lon;
|
||||
}
|
||||
else if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
else if (data.aesTypeId == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
{
|
||||
int zone = -1;
|
||||
LtsCoordTrans::UtmCoordinate bottomLeft = LtsCoordTrans::UtmCoordinate::fromGeographic(data.boundingBoxBottomLeft().lon(), data.boundingBoxBottomLeft().lat(), zone);
|
||||
LtsCoordTrans::UtmCoordinate topRight = LtsCoordTrans::UtmCoordinate::fromGeographic(data.boundingBoxTopRight().lon(), data.boundingBoxTopRight().lat(), zone);
|
||||
LtsCoordTrans::UtmCoordinate bottomLeft = LtsCoordTrans::UtmCoordinate::fromGeographic(data.boundingBoxBottomLeft.lon, data.boundingBoxBottomLeft.lat, zone);
|
||||
LtsCoordTrans::UtmCoordinate topRight = LtsCoordTrans::UtmCoordinate::fromGeographic(data.boundingBoxTopRight.lon, data.boundingBoxTopRight.lat, zone);
|
||||
|
||||
|
||||
LtsCoordTrans::UtmCoordinate impactPosPoint(topRight.zone, ((topRight.x + bottomLeft.x) / 2), ((topRight.y + bottomLeft.y) / 2), true);
|
||||
impactPosPoint.zone = topRight.zone;
|
||||
|
||||
QPointF pointGeo = impactPosPoint.geographic();
|
||||
impactPosition.lon(pointGeo.x());
|
||||
impactPosition.lat(pointGeo.y());
|
||||
DEBUG_LOG(m_logger) << "impactPosition lon/lat=" << impactPosition.lon() << "/" << impactPosition.lat()
|
||||
impactPosition.lon = pointGeo.x();
|
||||
impactPosition.lat = pointGeo.y();
|
||||
DEBUG_LOG(m_logger) << "impactPosition lon/lat=" << impactPosition.lon << "/" << impactPosition.lat
|
||||
<< " impactPosPoint.zone" << impactPosPoint.zone
|
||||
<< " impactPosPoint=" << impactPosPoint.x << "/" << impactPosPoint.y
|
||||
<< " topRight=" << topRight.x << "/" << topRight.y
|
||||
@@ -906,17 +907,17 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
}
|
||||
|
||||
Buildings::SendCesHitOnBuildingRequest requestBld(
|
||||
tmpBldg.buildingId(),
|
||||
data.chargeStruct().chargeTypeId(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(data.chargeStruct().chargeTypeId()).destructiveFactor(),
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(data.chargeStruct().chargeTypeId()).penetrationFactor(),
|
||||
data.aesItemId(),
|
||||
tmpBldg.buildingId,
|
||||
data.chargeStruct.chargeTypeId,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(data.chargeStruct.chargeTypeId).destructiveFactor,
|
||||
m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(data.chargeStruct.chargeTypeId).penetrationFactor,
|
||||
data.aesItemId,
|
||||
m_ddsHandler->currentPartitionTime(),
|
||||
impactPosition,
|
||||
QStringLiteral("properties").toStdString());
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << data.aesItemId()
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << data.aesItemId
|
||||
<< ", impactPosition= " << impactPosition;
|
||||
m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this);
|
||||
}
|
||||
|
||||
+5
-5
@@ -59,14 +59,14 @@ public:
|
||||
AreaEffectSimulation::AesItemView itemView(const int &aesId) const { return m_aesItemViews.value(aesId); }
|
||||
ProjectDataManagement::IgniterFunctionBase igniterFunctionBaseExplosionCluster(const int &aesId) const
|
||||
{
|
||||
auto chargeStruct = m_ddsHandler->dtcAes()->explosionCluster(aesId).chargeStruct();
|
||||
return m_ddsHandler->dtcPdm()->getChargeTypeIgniterTypeIgniterFunction(chargeStruct.chargeTypeId(),
|
||||
chargeStruct.igniterTypeId(),
|
||||
chargeStruct.igniterFunctionId()).igniterFunctionBaseId();
|
||||
auto chargeStruct = m_ddsHandler->dtcAes()->explosionCluster(aesId).chargeStruct;
|
||||
return m_ddsHandler->dtcPdm()->getChargeTypeIgniterTypeIgniterFunction(chargeStruct.chargeTypeId,
|
||||
chargeStruct.igniterTypeId,
|
||||
chargeStruct.igniterFunctionId).igniterFunctionBaseId;
|
||||
}
|
||||
int chargeTypeId(const int &aesId) const
|
||||
{
|
||||
return m_ddsHandler->dtcAes()->explosionCluster(aesId).chargeStruct().chargeTypeId();
|
||||
return m_ddsHandler->dtcAes()->explosionCluster(aesId).chargeStruct.chargeTypeId;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
+70
-70
@@ -89,8 +89,8 @@ HandlerBuildingModelInterface::LineBuildingIntersectionResult HandlerBuildingMod
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest;
|
||||
newRequest.line(line);
|
||||
newRequest.requestId(requestIdOpt);
|
||||
newRequest.line = line;
|
||||
newRequest.requestId = requestIdOpt;
|
||||
|
||||
const bool justForLineOfSight = false;
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionReply &reply =
|
||||
@@ -101,9 +101,9 @@ HandlerBuildingModelInterface::LineBuildingIntersectionResult HandlerBuildingMod
|
||||
|
||||
LineBuildingIntersectionResult result;
|
||||
result.requestId = requestIdOpt;
|
||||
result.errorString = reply.errorString();
|
||||
result.errorParams = reply.errorParams();
|
||||
result.intersection = reply.intersection();
|
||||
result.errorString = reply.errorString;
|
||||
result.errorParams = reply.errorParams;
|
||||
result.intersection = reply.intersection;
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return result;
|
||||
@@ -114,8 +114,8 @@ HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest;
|
||||
newRequest.line(line);
|
||||
newRequest.requestId(requestIdOpt);
|
||||
newRequest.line = line;
|
||||
newRequest.requestId = requestIdOpt;
|
||||
|
||||
const bool justForLineOfSight = true;
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionReply &reply =
|
||||
@@ -126,9 +126,9 @@ HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel
|
||||
|
||||
LineBuildingIntersectsResult result;
|
||||
result.requestId = requestIdOpt;
|
||||
result.errorString = reply.errorString();
|
||||
result.errorParams = reply.errorParams();
|
||||
result.intersects = ! std::isnan(reply.intersection().lat()); // ! std::isnan
|
||||
result.errorString = reply.errorString;
|
||||
result.errorParams = reply.errorParams;
|
||||
result.intersects = ! std::isnan(reply.intersection.lat); // ! std::isnan
|
||||
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
||||
return result;
|
||||
@@ -136,7 +136,7 @@ HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel
|
||||
|
||||
void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType)
|
||||
{
|
||||
const int mseBldgId = data.id();
|
||||
const int mseBldgId = data.id;
|
||||
|
||||
TRACE_LOG(m_logger) << "MainStructureElement === " << data;
|
||||
|
||||
@@ -152,7 +152,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
}
|
||||
|
||||
// skip "Outdoor Cameras / Announcement Units"
|
||||
if (data.structureElementTypeId() != InfrastructureManagement::StructureElementType::Building)
|
||||
if (data.structureElementTypeId != InfrastructureManagement::StructureElementType::Building)
|
||||
return;
|
||||
|
||||
// Vor allem in der GUEZ-DB sind ca 23 Gebäude per Hand eingefügt. (Sakralbau, Bahnhof, Wasserwerk etc.)
|
||||
@@ -160,13 +160,13 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
// Für diese steht natürlich kein Verwundungsmodell zur Verfügung.
|
||||
// Wie können wir diese erkennen und hier überspringen?
|
||||
// Ich habe keine bessere Möglichkeit gefunden als diese:
|
||||
const Core::GeoPosition &geoPos = data.geoPosition();
|
||||
if (qFuzzyIsNull(geoPos.z()))
|
||||
const Core::GeoPosition &geoPos = data.geoPosition;
|
||||
if (qFuzzyIsNull(geoPos.z))
|
||||
{
|
||||
INFO_LOG(m_logger) << "BuildingId " << mseBldgId
|
||||
<< " kann übersprungen werden, da von Hand importiert."
|
||||
<< ", name: '" << data.name() << "'"
|
||||
<< ", name: '" << data.description() << "'";
|
||||
<< ", name: '" << data.name << "'"
|
||||
<< ", name: '" << data.description << "'";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << mseBldgId
|
||||
<< " properties=" << data.properties();
|
||||
<< " properties=" << data.properties;
|
||||
|
||||
|
||||
// const QVector<int> buildingIds = m_ddsHandler->dtcIsm()->getBuildingIdsByExercise(exerciseId);
|
||||
@@ -194,9 +194,9 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
// QMap<int, InfrastructureManagement::VulnerabilityModelData> vulnerabilityModelData;
|
||||
|
||||
// InfrastructureManagement::VulnerabilityModelData vulnerabilityModelDataEle;
|
||||
QByteArray vulnerabilityModelData = m_ddsHandler->dtcIsm()->getVulnerabilityModelData(data.id());
|
||||
QByteArray vulnerabilityModelData = m_ddsHandler->dtcIsm()->getVulnerabilityModelData(data.id);
|
||||
TRACE_LOG(m_logger) << "vulnerabilityModelData=" << vulnerabilityModelData
|
||||
<< " id=" << data.id();
|
||||
<< " id=" << data.id;
|
||||
|
||||
|
||||
// int id = -1;
|
||||
@@ -245,7 +245,7 @@ void HandlerBuildingModel::onGetLineBuildingIntersectionRequest(const rti::core:
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionRequest &request)
|
||||
{
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectionRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectionRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId << "'";
|
||||
|
||||
const bool justForLineOfSight = false;
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionReply &reply = getLineBuildingIntersectionInternal(request, justForLineOfSight);
|
||||
@@ -253,34 +253,34 @@ void HandlerBuildingModel::onGetLineBuildingIntersectionRequest(const rti::core:
|
||||
// sendReply
|
||||
m_ddsHandler->ftsCes()->getLineBuildingIntersectionReply(cookie, reply);
|
||||
|
||||
DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectionRequest, request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectionRequest, request '" << request.requestId << "'";
|
||||
}
|
||||
|
||||
void HandlerBuildingModel::onGetLineBuildingIntersectsRequest(const rti::core::SampleIdentity &cookie,
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectsRequest &request)
|
||||
{
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectsRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectsRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId << "'";
|
||||
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest;
|
||||
newRequest.line(request.line());
|
||||
newRequest.requestId(request.requestId());
|
||||
newRequest.line = request.line;
|
||||
newRequest.requestId = request.requestId;
|
||||
|
||||
const bool justForLineOfSight = true;
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionReply &reply = getLineBuildingIntersectionInternal(newRequest, justForLineOfSight);
|
||||
|
||||
// sendReply
|
||||
CentralEffectSimulation::GetLineBuildingIntersectsReply newReply;
|
||||
newReply.id(reply.id());
|
||||
newReply.errorString(reply.errorString());
|
||||
newReply.errorParams(reply.errorParams());
|
||||
newReply.requestId(reply.requestId());
|
||||
newReply.intersects(! std::isnan(reply.intersection().lat())); // ! std::isnan
|
||||
newReply.id = reply.id;
|
||||
newReply.errorString = reply.errorString;
|
||||
newReply.errorParams = reply.errorParams;
|
||||
newReply.requestId = reply.requestId;
|
||||
newReply.intersects = ! std::isnan(reply.intersection.lat); // ! std::isnan
|
||||
|
||||
m_ddsHandler->ftsCes()->getLineBuildingIntersectsReply(cookie, newReply);
|
||||
|
||||
DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectsRequest, request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectsRequest, request '" << request.requestId << "'";
|
||||
}
|
||||
|
||||
|
||||
@@ -301,29 +301,29 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
|
||||
DEBUG_LOG(m_logger) << "START getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"
|
||||
<< ", request.line().size() = " << request.line().size();
|
||||
DEBUG_LOG(m_logger) << "START getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId << "'"
|
||||
<< ", request.line().size() = " << request.line.size();
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionReply reply;
|
||||
reply.requestId(request.requestId());
|
||||
reply.requestId = request.requestId;
|
||||
// prepare invalid 'answer'
|
||||
reply.intersection(s_invalidPos);
|
||||
reply.intersection = s_invalidPos;
|
||||
|
||||
// empty (poly-)line
|
||||
// (think of a trajectory)
|
||||
const std::vector<Core::GeoPosition> &polylineRef = request.line();
|
||||
const std::vector<Core::GeoPosition> &polylineRef = request.line;
|
||||
if (polylineRef.size() < 2)
|
||||
{
|
||||
reply.errorString("insufficiant number of points");
|
||||
WARNING_LOG(m_logger) << "getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"
|
||||
<< ", error: '" << reply.errorString() << "'";
|
||||
reply.errorString = "insufficiant number of points";
|
||||
WARNING_LOG(m_logger) << "getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId << "'"
|
||||
<< ", error: '" << reply.errorString << "'";
|
||||
return reply;
|
||||
}
|
||||
|
||||
QPolygonF polygon2D;
|
||||
polygon2D.reserve(polylineRef.size());
|
||||
for (const Core::GeoPosition &geoPos : std::as_const(polylineRef))
|
||||
polygon2D << QPointF(geoPos.lon(), geoPos.lat());
|
||||
polygon2D << QPointF(geoPos.lon, geoPos.lat);
|
||||
|
||||
// Only the buildings where the line/trajectory flies over the building footprint are taken into account.
|
||||
bool completeEnclosed = false;
|
||||
@@ -389,11 +389,11 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
|
||||
const Buildings::BuildingState &buildingState = dtcBld->buildingState(bldgId);
|
||||
// if buildingState is not found, assume intact:
|
||||
if (/*(buildingState.id() == bldgId) && */(buildingState.damagePercent() >= 80))
|
||||
if (/*(buildingState.id() == bldgId) && */(buildingState.damagePercent >= 80))
|
||||
{
|
||||
WARNING_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< ", lineSegmentIdx=" << lineSegmentIdx
|
||||
<< ", damagePercent > 80% (" << buildingState.damagePercent() << ")";
|
||||
<< ", damagePercent > 80% (" << buildingState.damagePercent << ")";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -467,8 +467,8 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
// justForLineOfSight :
|
||||
if (justForLineOfSight)
|
||||
{
|
||||
reply.intersection(intersection);
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, return due to justForLineOfSight " << request.requestId() << "'";
|
||||
reply.intersection = intersection;
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, return due to justForLineOfSight " << request.requestId << "'";
|
||||
return reply;
|
||||
}
|
||||
// : justForLineOfSight
|
||||
@@ -482,7 +482,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
DEBUG_LOG(m_logger) << "Building " << buildingModel->buildingId() << " was hit prior to building " << buildingId << ".";
|
||||
buildingId = buildingModel->buildingId();
|
||||
distance = dist;
|
||||
reply.intersection(intersection);
|
||||
reply.intersection = intersection;
|
||||
if (segmentIdxOfIntersectionPtrOut)
|
||||
*segmentIdxOfIntersectionPtrOut = lineSegmentIdx;
|
||||
|
||||
@@ -491,7 +491,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
} // for (const int bldgId : std::as_const(relevantBuildings))
|
||||
} // for(lineIt = polylineRef.begin(); lineIt != polylineRef.end()-1; ++lineIt)
|
||||
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, request '" << request.requestId() << "'"
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, request '" << request.requestId << "'"
|
||||
<< " buildingIdOut=" << *buildingIdOut;
|
||||
|
||||
return reply;
|
||||
@@ -506,10 +506,10 @@ void HandlerBuildingModel::onDetonationLocationRequest(
|
||||
const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::DetonationLocationRequest &request
|
||||
)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Received DetonationLocationRequest for aesId: " << request.id();
|
||||
DEBUG_LOG(m_logger) << "Received DetonationLocationRequest for aesId: " << request.id;
|
||||
const CentralEffectSimulation::DetonationLocationReply reply = handleDetonationLocationRequest(request);
|
||||
if (!reply.errorString().empty())
|
||||
WARNING_LOG(m_logger) << "DetonationLocationRequest for aesId " << request.id() << " failed: " << reply.errorString();
|
||||
if (!reply.errorString.empty())
|
||||
WARNING_LOG(m_logger) << "DetonationLocationRequest for aesId " << request.id << " failed: " << reply.errorString;
|
||||
// if
|
||||
m_ddsHandler->ftsCes()->detonationLocationReply(cookie, reply);
|
||||
}
|
||||
@@ -528,17 +528,17 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
|
||||
// prepare reply and store some values from request:
|
||||
CentralEffectSimulation::DetonationLocationReply reply;
|
||||
reply.id(request.id()); // AES: aesItemId
|
||||
reply.index(request.index()); // AES: explosionIndex
|
||||
reply.id = request.id; // AES: aesItemId
|
||||
reply.index = request.index; // AES: explosionIndex
|
||||
|
||||
if ( m_buildingModels.size() <= 0)
|
||||
return reply;
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest lbRequest;
|
||||
lbRequest.requestId("handleDetonationLocationRequest");
|
||||
lbRequest.line(request.trajectory());
|
||||
lbRequest.requestId = "handleDetonationLocationRequest";
|
||||
lbRequest.line = request.trajectory;
|
||||
|
||||
const std::vector<Core::GeoPosition>& reqTrajRef = request.trajectory();
|
||||
const std::vector<Core::GeoPosition>& reqTrajRef = request.trajectory;
|
||||
|
||||
if (reqTrajRef.size() < 2)
|
||||
{
|
||||
@@ -548,10 +548,10 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
|
||||
// next step: determine detonationDistance according fuseType:
|
||||
double detonationDistance = 0;
|
||||
ProjectDataManagement::IgniterFunctionBase ignFuncBase = m_ddsHandler->getIgniterFunctionBaseFromChargeTypeId(request.chargeTypeId(),
|
||||
request.igniterTypeId(),
|
||||
request.igniterFunctionId());
|
||||
switch (ignFuncBase.underlying())
|
||||
ProjectDataManagement::IgniterFunctionBase ignFuncBase = m_ddsHandler->getIgniterFunctionBaseFromChargeTypeId(request.chargeTypeId,
|
||||
request.igniterTypeId,
|
||||
request.igniterFunctionId);
|
||||
switch (ignFuncBase)
|
||||
{
|
||||
case ProjectDataManagement::IgniterFunctionBase::IfbProximity: detonationDistance = -5; break;
|
||||
case ProjectDataManagement::IgniterFunctionBase::IfbImpact: detonationDistance = 0; break;
|
||||
@@ -568,7 +568,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionReply &lbiReply =
|
||||
getLineBuildingIntersectionInternal(lbRequest, justForLineOfSight, &buildingId, &validSizeOfOriginalTraj);
|
||||
|
||||
const LtsCoordTrans::LtsCoordinate bldgIntersectionCoord(lbiReply.intersection());
|
||||
const LtsCoordTrans::LtsCoordinate bldgIntersectionCoord(lbiReply.intersection);
|
||||
const bool bHasBuildingIntersection = BuildingModel::isValid(bldgIntersectionCoord.geoPosition());
|
||||
if (bHasBuildingIntersection)
|
||||
{
|
||||
@@ -623,8 +623,8 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
<< ", detonationLocation: " << detonationLocation.toString(true)
|
||||
<< ", buildingId: " << buildingId;
|
||||
|
||||
reply.position(detonationLocation.geoPosition());
|
||||
reply.buildingId(buildingId);
|
||||
reply.position = detonationLocation.geoPosition();
|
||||
reply.buildingId = buildingId;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -650,8 +650,8 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
<< ", trajectoryCopy.size()=" << trajectoryCopy.size() << " back: " << trajectoryCopy.back()
|
||||
<< ", detonationLocation: " << detonationLocation.toString(true)
|
||||
<< ", buildingId: " << buildingId;
|
||||
reply.buildingId(buildingId);
|
||||
reply.position(detonationLocation.geoPosition());
|
||||
reply.buildingId = buildingId;
|
||||
reply.position = detonationLocation.geoPosition();
|
||||
}
|
||||
|
||||
// otherwise let reply.position be untouched.
|
||||
@@ -674,18 +674,18 @@ Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::v
|
||||
// geometrySize-3]; - see comment below
|
||||
// ^^^
|
||||
auto p1 = trajectoryGeometry[geometrySize - 3];
|
||||
LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(p1.lon(), p1.lat()); // ToDo: Zone des Bldgs?
|
||||
QVector3D segStart(utm1.x, utm1.y, p1.z());
|
||||
LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(p1.lon, p1.lat); // ToDo: Zone des Bldgs?
|
||||
QVector3D segStart(utm1.x, utm1.y, p1.z);
|
||||
|
||||
auto p2 = trajectoryGeometry[geometrySize - 1];
|
||||
LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(p2.lon(), p2.lat()); // ToDo: Zone des Bldgs?
|
||||
QVector3D segEnd(utm2.x, utm2.y, p2.z());
|
||||
LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(p2.lon, p2.lat); // ToDo: Zone des Bldgs?
|
||||
QVector3D segEnd(utm2.x, utm2.y, p2.z);
|
||||
|
||||
QVector3D flightVec = segEnd - segStart;
|
||||
|
||||
INFO_LOG(m_logger) << "flightVec1 "
|
||||
<< ", utm1 " << utm1 << " , z " << p1.z()
|
||||
<< ", utm2 " << utm2 << " , z " << p2.z()
|
||||
<< ", utm1 " << utm1 << " , z " << p1.z
|
||||
<< ", utm2 " << utm2 << " , z " << p2.z
|
||||
<< ", flightVec " << flightVec;
|
||||
|
||||
// 'auto p1 = trajectoryGeometry[geometrySize-3];'
|
||||
@@ -722,8 +722,8 @@ Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::v
|
||||
Core::GeoPosition geoPosDeto(pointDeto.x(), pointDeto.y(), detonationLoc.z());
|
||||
|
||||
DEBUG_LOG(m_logger) << "flightVec2 "
|
||||
<< ", utm1 " << utm1 << " , z " << p1.z()
|
||||
<< ", utm2 " << utm2 << " , z " << p2.z()
|
||||
<< ", utm1 " << utm1 << " , z " << p1.z
|
||||
<< ", utm2 " << utm2 << " , z " << p2.z
|
||||
<< ", flightVec " << flightVec
|
||||
<< ", detonationLoc " << detonationLoc
|
||||
<< ", utmDeto " << utmDeto;
|
||||
|
||||
+56
-56
@@ -86,26 +86,26 @@ void HandlerBuildingOwnership::onSetOwnershipRequest(const rti::core::SampleIden
|
||||
INFO_LOG(m_logger) << "onSetOwnershipRequest: " << request;
|
||||
|
||||
// remove Ownership, if partyId == 0
|
||||
if (request.partyId() == 0)
|
||||
removeFromDbBuildingId(request.buildingId());
|
||||
if (request.partyId == 0)
|
||||
removeFromDbBuildingId(request.buildingId);
|
||||
|
||||
const QVector<int> floors = m_handlerBuildingData->getFloorsFromBuilding(request.buildingId());
|
||||
const QVector<int> floors = m_handlerBuildingData->getFloorsFromBuilding(request.buildingId);
|
||||
for (int floorId : floors)
|
||||
saveBuildingOwnership(floorId, request.partyId(), request.buildingId());
|
||||
saveBuildingOwnership(floorId, request.partyId, request.buildingId);
|
||||
|
||||
if (!floors.isEmpty())
|
||||
sendBuildingOwnership(request.buildingId());
|
||||
sendBuildingOwnership(request.buildingId);
|
||||
|
||||
m_ddsHandler->ftsCes()->setOwnershipReply(cookie, Core::FunctionReplyObject(request.buildingId()));
|
||||
m_ddsHandler->ftsCes()->setOwnershipReply(cookie, Core::FunctionReplyObject(request.buildingId));
|
||||
}
|
||||
|
||||
void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos)
|
||||
{
|
||||
|
||||
const int participantId = partPos.participantId();
|
||||
const int participantId = partPos.participantId;
|
||||
INFO_LOG(m_logger) << "BuildingOwnership onParticipantPositionChanged participantId=" << participantId
|
||||
<< " vulnerabilityState=" << partPos.vulnerabilityState
|
||||
<< " buildingId=" << partPos.buildingId()
|
||||
<< " buildingId=" << partPos.buildingId
|
||||
<< " notfightMode=" << partPos.notfightMode;
|
||||
|
||||
// [GUEZE-2256] 3D Wirksim - Funktionsraum Nicht Kampffaehig
|
||||
@@ -113,8 +113,8 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS
|
||||
if (partPos.notfightMode)
|
||||
return;
|
||||
|
||||
int floorId = m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId());
|
||||
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
int floorId = m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId);
|
||||
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
m_participantFloor.remove(participantId);
|
||||
else
|
||||
m_participantFloor.insert(participantId, floorId);
|
||||
@@ -131,23 +131,23 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS
|
||||
// ///////////////////////////////////
|
||||
void HandlerBuildingOwnership::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onMainStructureElementChanged id=" << data.id()
|
||||
<< " modelId =" << data.modelId();
|
||||
if (modType == DataModification::eRemoved || data.modelId() <= 0)
|
||||
INFO_LOG(m_logger) << "onMainStructureElementChanged id=" << data.id
|
||||
<< " modelId =" << data.modelId;
|
||||
if (modType == DataModification::eRemoved || data.modelId <= 0)
|
||||
{
|
||||
m_buildingOwnership.remove(data.id());
|
||||
m_buildingOwnership.remove(data.id);
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonArray jsonArray = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object().value(QLatin1String("available_in_exercise")).toArray();
|
||||
QJsonArray jsonArray = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties)).object().value(QLatin1String("available_in_exercise")).toArray();
|
||||
DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument.size()=" << jsonArray.size();
|
||||
QVector<int> result;
|
||||
result.reserve(jsonArray.size());
|
||||
|
||||
// Check if present in the current exercise and remove
|
||||
if (m_buildingOwnership.contains(data.id()))
|
||||
if (m_buildingOwnership.contains(data.id))
|
||||
{
|
||||
int id = data.id();
|
||||
int id = data.id;
|
||||
m_buildingOwnership.remove(id);
|
||||
m_ddsHandler->dtsCes()->removeBuildingOwnershipByKey(id);
|
||||
}
|
||||
@@ -159,16 +159,16 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got MainStructureElement"
|
||||
<< " data.id()=" << data.id()
|
||||
<< " data.modelId=" << data.modelId();
|
||||
if (!m_buildingOwnership.contains(data.id()))
|
||||
<< " data.id()=" << data.id
|
||||
<< " data.modelId=" << data.modelId;
|
||||
if (!m_buildingOwnership.contains(data.id))
|
||||
{
|
||||
// insert in m_buildingOwnership and publish to dds
|
||||
CentralEffectSimulation::BuildingOwnership bo;
|
||||
bo.buildingId(data.id());
|
||||
bo.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
bo.buildingId = data.id;
|
||||
bo.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
updateOwnerships(&bo);
|
||||
m_buildingOwnership.insert(data.id(), bo);
|
||||
m_buildingOwnership.insert(data.id, bo);
|
||||
m_ddsHandler->dtsCes()->publish(bo);
|
||||
} // if
|
||||
} // for
|
||||
@@ -193,7 +193,7 @@ int HandlerBuildingOwnership::calculateOwnershipByParticipantId(const int partic
|
||||
{
|
||||
INFO_LOG(m_logger) << "BuildingOwnership calculateOwnershipByParticipantId participantId=" << participantId;
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(participantId);
|
||||
return calculateOwnershipByFloorId(m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId()));
|
||||
return calculateOwnershipByFloorId(m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId));
|
||||
}
|
||||
|
||||
int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId)
|
||||
@@ -216,7 +216,7 @@ int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId)
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &localPartPos = m_handlerParticipant->position(iteratorParticipant);
|
||||
if (localPartPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
continue; // Don't count participants with catastrophic Kill
|
||||
const int partyId = localPartPos.partyId();
|
||||
const int partyId = localPartPos.partyId;
|
||||
++partyCount[partyId];
|
||||
}
|
||||
}
|
||||
@@ -241,10 +241,10 @@ int HandlerBuildingOwnership::getOwnership(int buildingId, int floorId) const
|
||||
if (itBldg == m_buildingOwnership.end())
|
||||
return -1;
|
||||
const CentralEffectSimulation::BuildingOwnership &bo = itBldg.value();
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo.ownerships())
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo.ownerships)
|
||||
{
|
||||
if (ownership.floorId() == floorId)
|
||||
return ownership.partyId();
|
||||
if (ownership.floorId == floorId)
|
||||
return ownership.partyId;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -282,27 +282,27 @@ void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::Buildin
|
||||
INFO_LOG(m_logger) << "BuildingOwnership updateOwnerships";
|
||||
QMap <int, int> ownershipMap;
|
||||
|
||||
const QVector<int> floors = m_handlerBuildingData->getFloorsFromBuilding(bo->buildingId());
|
||||
const QVector<int> floors = m_handlerBuildingData->getFloorsFromBuilding(bo->buildingId);
|
||||
DEBUG_LOG(m_logger) << "updateOwnerships floors.size= " << floors.size();
|
||||
for (const int floorId : floors)
|
||||
ownershipMap[floorId] = 0;
|
||||
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo->ownerships())
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo->ownerships)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "updateOwnerships floorId=" << ownership.floorId() << ": " << ownership.partyId();
|
||||
ownershipMap[ownership.floorId()] = ownership.partyId();
|
||||
DEBUG_LOG(m_logger) << "updateOwnerships floorId=" << ownership.floorId << ": " << ownership.partyId;
|
||||
ownershipMap[ownership.floorId] = ownership.partyId;
|
||||
}
|
||||
|
||||
bo->ownerships().resize(0);
|
||||
bo->ownerships().reserve(ownershipMap.size());
|
||||
bo->ownerships.resize(0);
|
||||
bo->ownerships.reserve(ownershipMap.size());
|
||||
|
||||
CentralEffectSimulation::Ownership ownership;
|
||||
for (auto it = ownershipMap.cbegin(); it != ownershipMap.cend(); ++it)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << it.key() << ": " << it.value();
|
||||
ownership.floorId(it.key());
|
||||
ownership.partyId(it.value());
|
||||
bo->ownerships().push_back(ownership);
|
||||
ownership.floorId = it.key();
|
||||
ownership.partyId = it.value();
|
||||
bo->ownerships.push_back(ownership);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -318,20 +318,20 @@ void HandlerBuildingOwnership::saveBuildingOwnership(int floorId, int partyId, i
|
||||
{
|
||||
CentralEffectSimulation::BuildingOwnership &bo = *it;
|
||||
// Vorhanden Eintrag für das Stockwerk suchen:
|
||||
for (CentralEffectSimulation::Ownership &ownership : bo.ownerships())
|
||||
for (CentralEffectSimulation::Ownership &ownership : bo.ownerships)
|
||||
{
|
||||
if (ownership.floorId() == floorId)
|
||||
if (ownership.floorId == floorId)
|
||||
{
|
||||
ownership.partyId(partyId);
|
||||
ownership.partyId = partyId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Neuen Eintrag für das Stockwerk anlegen
|
||||
CentralEffectSimulation::Ownership ownership;
|
||||
ownership.floorId(floorId);
|
||||
ownership.partyId(partyId);
|
||||
bo.ownerships().push_back(std::move(ownership));
|
||||
ownership.floorId = floorId;
|
||||
ownership.partyId = partyId;
|
||||
bo.ownerships.push_back(std::move(ownership));
|
||||
m_buildingOwnership.insert(buildingId, bo);
|
||||
return;
|
||||
}
|
||||
@@ -340,10 +340,10 @@ void HandlerBuildingOwnership::saveBuildingOwnership(int floorId, int partyId, i
|
||||
CentralEffectSimulation::BuildingOwnership bo;
|
||||
CentralEffectSimulation::Ownership ownership;
|
||||
|
||||
bo.buildingId(buildingId);
|
||||
ownership.floorId(floorId);
|
||||
ownership.partyId(partyId);
|
||||
bo.ownerships().resize(1, ownership);
|
||||
bo.buildingId = buildingId;
|
||||
ownership.floorId = floorId;
|
||||
ownership.partyId = partyId;
|
||||
bo.ownerships.resize(1, ownership);
|
||||
m_buildingOwnership.insert(buildingId, bo);
|
||||
}
|
||||
|
||||
@@ -351,8 +351,8 @@ void HandlerBuildingOwnership::sendBuildingOwnership(int buildingId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "sendBuildingOwnership for building: " << buildingId;
|
||||
CentralEffectSimulation::BuildingOwnership bo = m_buildingOwnership.value(buildingId);
|
||||
bo.buildingId(buildingId);
|
||||
bo.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
bo.buildingId = buildingId;
|
||||
bo.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
updateOwnerships(&bo);
|
||||
m_ddsHandler->dtsCes()->publish(bo);
|
||||
insertInDb(bo);
|
||||
@@ -388,16 +388,16 @@ void HandlerBuildingOwnership::insertInDb(const CentralEffectSimulation::Buildin
|
||||
{
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
removeFromDbBuildingId(bo.buildingId());
|
||||
INFO_LOG(m_logger) << "insertInDb buildingId: " << bo.buildingId()
|
||||
<< ", bo.ownerships().size(): " << bo.ownerships().size();
|
||||
removeFromDbBuildingId(bo.buildingId);
|
||||
INFO_LOG(m_logger) << "insertInDb buildingId: " << bo.buildingId
|
||||
<< ", bo.ownerships().size(): " << bo.ownerships.size();
|
||||
CentralEffectSimulation::Database::CesOwnership newOwnership;
|
||||
newOwnership.buildingId = bo.buildingId();
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo.ownerships())
|
||||
newOwnership.buildingId = bo.buildingId;
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo.ownerships)
|
||||
{
|
||||
newOwnership.id = 0;
|
||||
newOwnership.floorId = ownership.floorId();
|
||||
newOwnership.partyId = ownership.partyId();
|
||||
newOwnership.floorId = ownership.floorId;
|
||||
newOwnership.partyId = ownership.partyId;
|
||||
DEBUG_LOG(m_logger) << "ownership: floorId = " << newOwnership.floorId
|
||||
<< " partyId = " << newOwnership.partyId;
|
||||
if (!m_db->insert(newOwnership))
|
||||
|
||||
+77
-77
@@ -102,17 +102,17 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId()
|
||||
<< " data.aesItemId()" << data.aesItemId()
|
||||
<< " data.aesTypeId()" << data.aesTypeId();
|
||||
switch (data.effectStateId().underlying())
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId
|
||||
<< " data.aesItemId()" << data.aesItemId
|
||||
<< " data.aesTypeId()" << data.aesTypeId;
|
||||
switch (data.effectStateId)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
double chargeHeight; // Alle Stockwerke beruecksichtigen
|
||||
double chargeDepression; // Alle Kellerraeume beruecksichtigen
|
||||
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtNContamination)
|
||||
{
|
||||
chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen
|
||||
chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen
|
||||
@@ -121,37 +121,37 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
}
|
||||
else
|
||||
{
|
||||
chargeHeight = m_aesBCContaminations.value(data.aesItemId()).upperOffset();
|
||||
chargeDepression = m_aesBCContaminations.value(data.aesItemId()).lowerOffset();
|
||||
chargeHeight = m_aesBCContaminations.value(data.aesItemId).upperOffset;
|
||||
chargeDepression = m_aesBCContaminations.value(data.aesItemId).lowerOffset;
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: chargeHeight=" << chargeHeight
|
||||
<< " chargeDepression=" << chargeDepression;
|
||||
}
|
||||
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtBCContamination
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtBCContamination
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtNContamination)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "return1: AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "return1: AesItemView: " << data.effectStateId;
|
||||
return;
|
||||
}
|
||||
|
||||
// Gebaeude die von einem sesshaften Kampfstoff betroffen sind, müssen als kontaminiert gelten.
|
||||
const ProjectDataManagement::VolatilityType volatilityType = m_ddsHandler->volatilityTypeId(data.chargeStruct());
|
||||
const ProjectDataManagement::VolatilityType volatilityType = m_ddsHandler->volatilityTypeId(data.chargeStruct);
|
||||
if (volatilityType != ProjectDataManagement::VolatilityType::Resident
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtNContamination)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "return2: AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "return2: AesItemView: " << data.effectStateId;
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerContamination::onAesItemViewChanged data.aesItemId=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "HandlerContamination::onAesItemViewChanged data.aesItemId=" << data.aesItemId;
|
||||
auto dtcIsm = m_ddsHandler->dtcIsm();
|
||||
// Form in UTM-Polygon wandeln
|
||||
int exerciseId = m_ddsHandler->getExerciseId();
|
||||
QPolygonF polygonGeo;
|
||||
|
||||
// Convert Form to UTM
|
||||
for (unsigned int i = 0; i < data.form().size(); i++)
|
||||
polygonGeo.append(QPointF(data.form()[i].lon(), data.form()[i].lat()));
|
||||
for (unsigned int i = 0; i < data.form.size(); i++)
|
||||
polygonGeo.append(QPointF(data.form[i].lon, data.form[i].lat));
|
||||
|
||||
bool completeEnclosed = true;
|
||||
bool isGroundLevel = false;
|
||||
@@ -178,16 +178,16 @@ void HandlerContamination::calculateBuilding(int buildingId,
|
||||
QVector<int> effectedRooms;
|
||||
QVector<int> effectedFloors;
|
||||
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtBCContamination
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtBCContamination
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtNContamination)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "return: NO BC-Contamination AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "return: NO BC-Contamination AesItemView: " << data.effectStateId;
|
||||
return;
|
||||
}
|
||||
|
||||
const ProjectDataManagement::VolatilityType volatilityType = m_ddsHandler->volatilityTypeId(data.chargeStruct());
|
||||
const ProjectDataManagement::VolatilityType volatilityType = m_ddsHandler->volatilityTypeId(data.chargeStruct);
|
||||
if ( volatilityType != ProjectDataManagement::VolatilityType::Resident
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtNContamination)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "buildingId=" << buildingId;
|
||||
@@ -201,35 +201,35 @@ void HandlerContamination::calculateBuilding(int buildingId,
|
||||
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
|
||||
|
||||
// [GUEZE-2752] N-Contamination: Only Contamionation inside Range1
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination
|
||||
&& !isInsideRange1(buildingId, data.aesItemId()))
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtNContamination
|
||||
&& !isInsideRange1(buildingId, data.aesItemId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!isInsideRange1 buildingId=" << buildingId;
|
||||
return;
|
||||
}
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBCContamination
|
||||
&& !isInsideBCContamination(buildingId, data.aesItemId()))
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBCContamination
|
||||
&& !isInsideBCContamination(buildingId, data.aesItemId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AtBCContamination !isInsideRange buildingId=" << buildingId << "return";
|
||||
return;
|
||||
}
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination
|
||||
&& isInsideInnerCircle(buildingId, data.aesItemId()))
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtNContamination
|
||||
&& isInsideInnerCircle(buildingId, data.aesItemId))
|
||||
{
|
||||
constexpr int TIME_2_SECONDS = 2000;
|
||||
// Only actual explosion not old N-Fields
|
||||
if ( m_ddsHandler->dtcCore()->partitionTime().timeStamp() < (data.effectStart() + TIME_2_SECONDS))
|
||||
if ( m_ddsHandler->dtcCore()->partitionTime().timeStamp < (data.effectStart + TIME_2_SECONDS))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "VulnerabilityState=CatastrophicKill";
|
||||
vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest buildingId=" << buildingId
|
||||
<< " data.aesTypeId()=" << data.aesTypeId()
|
||||
<< " isInsideInnerCircle(buildingId, data.aesItemId()=" << isInsideInnerCircle(buildingId, data.aesItemId());
|
||||
<< " data.aesTypeId()=" << data.aesTypeId
|
||||
<< " isInsideInnerCircle(buildingId, data.aesItemId()=" << isInsideInnerCircle(buildingId, data.aesItemId);
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle buildingId=" << buildingId;
|
||||
setBuildingContaminationStateRequest(buildingId, data.aesItemId(), vulnerabilityState, effectedRooms);
|
||||
setBuildingContaminationStateRequest(buildingId, data.aesItemId, vulnerabilityState, effectedRooms);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,12 +245,12 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "onBuildingStateChanged"
|
||||
<< " id=" << data.id()
|
||||
<< " aesId=" << data.aesId()
|
||||
<< " contaminationStates().size=" << data.contaminationStates().size();
|
||||
<< " id=" << data.id
|
||||
<< " aesId=" << data.aesId
|
||||
<< " contaminationStates().size=" << data.contaminationStates.size();
|
||||
// Reset:
|
||||
if (data.contaminationStates().empty())
|
||||
m_contaminationState.remove(data.id());
|
||||
if (data.contaminationStates.empty())
|
||||
m_contaminationState.remove(data.id);
|
||||
// If a building is reset in an area where there is an active nuclear weapon, it will not be recontaminated -> in this case,
|
||||
// regular checks should be carried out to see if the building needs to be contaminated
|
||||
// Buildings that have been reset or decontaminated will be recontaminated as long as the nuclear weapon is still present
|
||||
@@ -258,16 +258,16 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
const auto aesItemViews = m_ddsHandler->dtcAes()->aesItemViews();
|
||||
for (const auto &aesItemView : std::as_const(aesItemViews))
|
||||
{
|
||||
if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
if (aesItemView.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Wirkfeld aesItemView.id()=" << aesItemView.id()
|
||||
<< " aesItemView.aesItemId()=" << aesItemView.aesItemId()
|
||||
<< " fuer Gebaeude " << data.id() << " neu berechnen";
|
||||
DEBUG_LOG(m_logger) << "Wirkfeld aesItemView.id()=" << aesItemView.id
|
||||
<< " aesItemView.aesItemId()=" << aesItemView.aesItemId
|
||||
<< " fuer Gebaeude " << data.id << " neu berechnen";
|
||||
|
||||
double chargeHeight = 0.0;
|
||||
double chargeDepression = 0.0;
|
||||
|
||||
if (aesItemView.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination)
|
||||
if (aesItemView.aesTypeId == AreaEffectSimulation::AesType::AtNContamination)
|
||||
{
|
||||
chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen
|
||||
chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen
|
||||
@@ -276,16 +276,16 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_aesBCContaminations.contains(aesItemView.aesItemId()))
|
||||
if ( m_aesBCContaminations.contains(aesItemView.aesItemId))
|
||||
{
|
||||
chargeHeight = m_aesBCContaminations.value(aesItemView.aesItemId()).upperOffset();
|
||||
chargeDepression = m_aesBCContaminations.value(aesItemView.aesItemId()).lowerOffset();
|
||||
chargeHeight = m_aesBCContaminations.value(aesItemView.aesItemId).upperOffset;
|
||||
chargeDepression = m_aesBCContaminations.value(aesItemView.aesItemId).lowerOffset;
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: chargeHeight=" << chargeHeight
|
||||
<< " chargeDepression=" << chargeDepression;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: m_aesBCContaminations not contains:"<< aesItemView.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: m_aesBCContaminations not contains:"<< aesItemView.aesItemId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,18 +293,18 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
auto dtcIsm = m_ddsHandler->dtcIsm();
|
||||
int exerciseId = m_ddsHandler->getExerciseId();
|
||||
QPolygonF polygonGeo;
|
||||
polygonGeo.reserve(aesItemView.form().size());
|
||||
polygonGeo.reserve(aesItemView.form.size());
|
||||
// Convert Form to UTM
|
||||
for (const auto point : aesItemView.form())
|
||||
polygonGeo.append(QPointF(point.lon(), point.lat()));
|
||||
for (const auto point : aesItemView.form)
|
||||
polygonGeo.append(QPointF(point.lon, point.lat));
|
||||
bool completeEnclosed = true;
|
||||
bool isGroundLevel = false;
|
||||
|
||||
const QVector<int> &buildingIds = dtcIsm.get()->getBuildingByPolygon(exerciseId, polygonGeo, completeEnclosed, isGroundLevel);
|
||||
if (buildingIds.contains(data.id() ))
|
||||
calculateBuilding(data.id(), aesItemView, chargeHeight, chargeDepression);
|
||||
if (buildingIds.contains(data.id ))
|
||||
calculateBuilding(data.id, aesItemView, chargeHeight, chargeDepression);
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Building not in Area BuildingId=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "Building not in Area BuildingId=" << data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,8 +317,8 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
{
|
||||
Buildings::ContaminationState contaminationState;
|
||||
|
||||
contaminationState.aesId(aesId);
|
||||
contaminationState.vulnerabilityState(vulnerabilityState);
|
||||
contaminationState.aesId = aesId;
|
||||
contaminationState.vulnerabilityState = vulnerabilityState;
|
||||
// contaminationState.vulne
|
||||
|
||||
DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest"
|
||||
@@ -326,11 +326,11 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
<< " aesId=" << aesId
|
||||
<< " vulnerabilityState=" << vulnerabilityState
|
||||
<< " rooms.size=" << rooms.size();
|
||||
contaminationState.rooms().resize(rooms.size());
|
||||
contaminationState.rooms.resize(rooms.size());
|
||||
for (int i = 0; i < rooms.size(); i++)
|
||||
{
|
||||
contaminationState.rooms()[i] = rooms[i];
|
||||
contaminationState.vulnerabilityState(vulnerabilityState);
|
||||
contaminationState.rooms[i] = rooms[i];
|
||||
contaminationState.vulnerabilityState = vulnerabilityState;
|
||||
DEBUG_LOG(m_logger) << " room[" << i << "]=" << rooms[i];
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
if (!m_contaminationState.contains(buildingId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Neue Kontamination BuildingId=" << buildingId
|
||||
<< " requestContamination aesId=" << requestContamination.contaminationState().aesId();
|
||||
<< " requestContamination aesId=" << requestContamination.contaminationState.aesId;
|
||||
|
||||
m_ddsHandler->ftcBld()->setBuildingContaminationStateRequest(requestContamination, this);
|
||||
m_contaminationState.insert(buildingId, requestContamination);
|
||||
@@ -353,7 +353,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
if (lastRequestContamination != requestContamination)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Änderung der Kontamination BuildingId=" << buildingId
|
||||
<< " aesId=" << requestContamination.contaminationState().aesId();
|
||||
<< " aesId=" << requestContamination.contaminationState.aesId;
|
||||
m_ddsHandler->ftcBld()->setBuildingContaminationStateRequest(requestContamination, this);
|
||||
m_contaminationState.insert(buildingId, requestContamination);
|
||||
return;
|
||||
@@ -416,10 +416,10 @@ void HandlerContamination::onSetBuildingContaminationStateReply(const Core::Func
|
||||
void HandlerContamination::onBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType)
|
||||
{
|
||||
if ((modType == DataModification::eRemoved)
|
||||
|| data.isDeleted())
|
||||
m_aesBCContaminations.remove(data.id());
|
||||
|| data.isDeleted)
|
||||
m_aesBCContaminations.remove(data.id);
|
||||
else
|
||||
m_aesBCContaminations.insert(data.id(), data);
|
||||
m_aesBCContaminations.insert(data.id, data);
|
||||
}
|
||||
|
||||
// Returns true if the building is in the inner circle at the time of impact and should fail as a result.
|
||||
@@ -429,20 +429,20 @@ bool HandlerContamination::isInsideInnerCircle(int buildingId, int aesId)
|
||||
InfrastructureManagement::MainStructureElement mse = m_ddsHandler->dtcIsm()->mainStructureElement(buildingId);
|
||||
AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle borderLengthInner=" << nContamination.borderLengthInner()
|
||||
<< " borderLengthOuter=" << nContamination.borderLengthOuter()
|
||||
<< " impactRadius=" << nContamination.impactRadius();
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle borderLengthInner=" << nContamination.borderLengthInner
|
||||
<< " borderLengthOuter=" << nContamination.borderLengthOuter
|
||||
<< " impactRadius=" << nContamination.impactRadius;
|
||||
|
||||
int zone = -1;
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition(), zone);
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition, zone);
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " zone=" << zone;
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone);
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition, zone);
|
||||
DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
|
||||
double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm);
|
||||
|
||||
if (squareDistance < nContamination.impactRadius() * nContamination.impactRadius())
|
||||
if (squareDistance < nContamination.impactRadius * nContamination.impactRadius)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return true";
|
||||
return true;
|
||||
@@ -464,18 +464,18 @@ bool HandlerContamination::isInsideBCContamination(int buildingId, int aesId)
|
||||
//AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId);
|
||||
AreaEffectSimulation::BCContamination bcContamination = m_ddsHandler->dtcAes()->bCContamination(aesId);
|
||||
|
||||
DEBUG_LOG(m_logger) << " impactRadius=" << bcContamination.impactRadius();
|
||||
DEBUG_LOG(m_logger) << " impactRadius=" << bcContamination.impactRadius;
|
||||
|
||||
int zone = -1;
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(bcContamination.impactPosition(), zone);
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(bcContamination.impactPosition, zone);
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " zone=" << zone;
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone);
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition, zone);
|
||||
DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
|
||||
double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm);
|
||||
|
||||
if (squareDistance < bcContamination.impactRadius() * bcContamination.impactRadius())
|
||||
if (squareDistance < bcContamination.impactRadius * bcContamination.impactRadius)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return true";
|
||||
return true;
|
||||
@@ -496,20 +496,20 @@ bool HandlerContamination::isInsideRange1(int buildingId, int aesId)
|
||||
InfrastructureManagement::MainStructureElement mse = m_ddsHandler->dtcIsm()->mainStructureElement(buildingId);
|
||||
AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 borderLengthInner=" << nContamination.borderLengthInner()
|
||||
<< " borderLengthOuter=" << nContamination.borderLengthOuter()
|
||||
<< " impactRadius=" << nContamination.impactRadius();
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 borderLengthInner=" << nContamination.borderLengthInner
|
||||
<< " borderLengthOuter=" << nContamination.borderLengthOuter
|
||||
<< " impactRadius=" << nContamination.impactRadius;
|
||||
|
||||
int zone = -1;
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition(), zone);
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition, zone);
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " zone=" << zone;
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone);
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition, zone);
|
||||
DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
|
||||
double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm);
|
||||
|
||||
if (squareDistance < nContamination.borderLengthInner() * nContamination.borderLengthInner())
|
||||
if (squareDistance < nContamination.borderLengthInner * nContamination.borderLengthInner)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 return true";
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user