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:
1 parent
eb1d949edc
commit
815e16368e
1718 files changed
+126739
-18495
No files matched your search
+1
-1
@@ -252,7 +252,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
/*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id
|
||||
<< " alarmConfigItem.participantId=" << alarm.participantId
|
||||
<< " alarmConfigItem.eventTypeId=" << alarm.eventTypeId
|
||||
<< " eventDatalocal.eventTypeId()=" << eventDatalocal.eventTypeId().underlying()
|
||||
<< " eventDatalocal.eventTypeId()=" << eventDatalocal.eventTypeId()
|
||||
<< " alarm.operatorId=" << alarm.operatorId
|
||||
<< " friendyFire =" << friendlyFireBool;*/
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ bool HandlerParticipant::init()
|
||||
{
|
||||
const ParticipantManagement::Participant &participant = i.value();
|
||||
|
||||
if (participant.equipmentNumber.is_set())
|
||||
if (participant.equipmentNumber.has_value())
|
||||
{
|
||||
m_partId2EquipNoMap.insert(participant.id, participant.equipmentNumber.get());
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << participant.id << "EquimentNo=" << participant.equipmentNumber.get();
|
||||
@@ -110,7 +110,7 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged:" << data;
|
||||
m_participantHierarchy.insert(data.id,
|
||||
AlarmManagement::HandlerParticipant::ParticipantHierarchy(data));
|
||||
const int equipNo = data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0;
|
||||
const int equipNo = data.equipmentNumber.has_value() ? data.equipmentNumber.get() : 0;
|
||||
m_partId2EquipNoMap.insert(data.id, equipNo);
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -162,7 +162,7 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId);
|
||||
if (aesType != AreaEffectSimulation::AesType::AtEffectCluster)
|
||||
return;
|
||||
|
||||
@@ -199,7 +199,7 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType;
|
||||
++m_counterDds.cntEffectClusterEffects;
|
||||
|
||||
@@ -387,13 +387,13 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
QString dateTimeString = QDateTime::currentDateTime().toString(QStringLiteral("dd.MM.yyyy hh:mm"));
|
||||
m_reference = dateTimeString;
|
||||
|
||||
if (eaData.effectStart.is_set())
|
||||
if (eaData.effectStart.has_value())
|
||||
INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart.get()).toString();
|
||||
else
|
||||
INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
FlightCurve fc;
|
||||
// if (eaData.flightCurve.is_set())
|
||||
// if (eaData.flightCurve.has_value())
|
||||
// fc = eaData.flightCurve.get();
|
||||
|
||||
QJsonObject obj;
|
||||
@@ -407,7 +407,7 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
obj[QStringLiteral("subTyp")] = 0;
|
||||
obj[QStringLiteral("typ")] = 0;
|
||||
obj[QStringLiteral("useReceived")] = true;
|
||||
obj[QStringLiteral("effectSource")] = ProjectDataManagement::EffectSource::ES_ADLER;
|
||||
obj[QStringLiteral("effectSource")] = static_cast<int>(ProjectDataManagement::EffectSource::ES_ADLER);
|
||||
|
||||
QString propertiesStr = QString::fromStdString(QJsonDocument(obj).toJson(QJsonDocument::Compact).toStdString());
|
||||
|
||||
|
||||
+23
-23
@@ -185,7 +185,7 @@ void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluste
|
||||
|
||||
m_data = data;
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_data.effectStart.is_set())
|
||||
if (m_data.effectStart.has_value())
|
||||
startTimeMsec = m_data.effectStart.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id << ", state=" << m_data.effectStateId
|
||||
@@ -210,7 +210,7 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id << ", aesType=" << aesType;
|
||||
|
||||
switch (aesType) {
|
||||
@@ -233,7 +233,7 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType;
|
||||
++m_counterDds.cntExplosionClusterEffects;
|
||||
|
||||
@@ -442,10 +442,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1104(const QString &eaName)
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 5;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -492,10 +492,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1106(const QString &eaName)
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 6;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -547,10 +547,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForUBAHN(const QString &eaName
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 5;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -600,10 +600,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName)
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 89;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -636,13 +636,13 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName)
|
||||
|
||||
int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionCluster &eaData)
|
||||
{
|
||||
if (eaData.effectStart.is_set())
|
||||
if (eaData.effectStart.has_value())
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart.get()).toString();
|
||||
else
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
FlightCurve fc;
|
||||
if (eaData.flightCurve.is_set())
|
||||
if (eaData.flightCurve.has_value())
|
||||
fc = eaData.flightCurve.get();
|
||||
|
||||
const std::string properties = "{}";
|
||||
@@ -686,7 +686,7 @@ int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionC
|
||||
|
||||
int ModuleTestExplosionCluster::doExplosionClusterSingleEffectOnlyModifyRequest(const ExplosionClusterSingleEffectOnlyRequest &request)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart.get()).toString();
|
||||
else
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
@@ -2071,7 +2071,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = 371; // radius == 25, diameter == 50m
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 500;
|
||||
|
||||
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
@@ -2127,10 +2127,10 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = 374; // 374: isSMArt=true ; radius == 25, diameter == 50m
|
||||
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Vor eaData.flightCurve.is_set()";
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Vor eaData.flightCurve.has_value()";
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve.is_set()";
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve.has_value()";
|
||||
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 500;
|
||||
|
||||
@@ -2407,7 +2407,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 11100; // == 53deg bei 500 m/s -> apo: x: 12211 y/z= 8190
|
||||
eaData.flightCurve.get().launchVelocity = 500;
|
||||
eaData.flightCurve.get().launchAngle = 0; // calculated ; parameter is prepared for ADLER
|
||||
@@ -2464,7 +2464,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 11100; // == 53deg bei 500 m/s -> apo: x: 12211 y/z= 8190
|
||||
eaData.flightCurve.get().launchVelocity = 500;
|
||||
eaData.flightCurve.get().launchAngle = 0; // calculated ; parameter is prepared for ADLER
|
||||
@@ -2489,7 +2489,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
|
||||
|
||||
QTimer::singleShot(2000, this, [this] () { // local static is captured implicit by gcc and for MSVS
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_data.effectStart.is_set())
|
||||
if (m_data.effectStart.has_value())
|
||||
startTimeMsec = m_data.effectStart.get();
|
||||
|
||||
const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch();
|
||||
@@ -2568,7 +2568,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 11100; // == 53deg bei 500 m/s -> apo: x: 12211 y/z= 8190
|
||||
eaData.flightCurve.get().launchVelocity = 500;
|
||||
eaData.flightCurve.get().launchAngle = 0; // calculated ; parameter is prepared for ADLER
|
||||
@@ -2596,7 +2596,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
|
||||
QTimer::singleShot(2000, this, [this] () { // local static is captured implicit by gcc and for MSVS
|
||||
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_data.effectStart.is_set())
|
||||
if (m_data.effectStart.has_value())
|
||||
startTimeMsec = m_data.effectStart.get();
|
||||
|
||||
const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
+3
-3
@@ -126,7 +126,7 @@ void ModuleTestAesOthers::boobyTrapChanged(const BoobyTrap &data, DataModificati
|
||||
|
||||
m_dataBoobyTrap = data;
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_dataBoobyTrap.effectStart.is_set())
|
||||
if (m_dataBoobyTrap.effectStart.has_value())
|
||||
startTimeMsec = m_dataBoobyTrap.effectStart.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id << ", state=" << m_dataBoobyTrap.effectStateId
|
||||
@@ -145,7 +145,7 @@ void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModi
|
||||
|
||||
m_dataOffRouteMine = data;
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_dataOffRouteMine.effectStart.is_set())
|
||||
if (m_dataOffRouteMine.effectStart.has_value())
|
||||
startTimeMsec = m_dataOffRouteMine.effectStart.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id << ", state=" << m_dataOffRouteMine.effectStateId
|
||||
@@ -160,7 +160,7 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged, aesType=" << aesType;
|
||||
|
||||
switch (aesType)
|
||||
|
||||
+51
-51
@@ -28,7 +28,7 @@ bool TestAirSupportImpact::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataExplosionSingle();
|
||||
m_asData.id(-1);
|
||||
m_asData.id = -1;
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::airSupportImpactChanged,
|
||||
this, &TestAirSupportImpact::airSupportImpactChanged);
|
||||
@@ -42,9 +42,9 @@ bool TestAirSupportImpact::checkBaseData(const AreaEffectSimulation::AirSupportI
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.impactPosition() != b.impactPosition())
|
||||
if (a.impactPosition != b.impactPosition)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition() << " - " << b.impactPosition();
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition << " - " << b.impactPosition;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -57,15 +57,15 @@ void TestAirSupportImpact::tryCreate()
|
||||
{
|
||||
m_asData = AreaEffectSimulation::AirSupportImpact();
|
||||
AreaEffectSimulation::AirSupportImpact asData;
|
||||
asData.id(0);
|
||||
asData.name("chris");
|
||||
asData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
asData.chargeStruct().chargeTypeId(345863487);
|
||||
asData.impactPosition(Core::GeoPosition2D(0.15525, 0.926080));
|
||||
asData.partyId(7);
|
||||
asData.participantId(1234);
|
||||
asData.externalId(1);
|
||||
asData.flightTime(123);
|
||||
asData.id = 0;
|
||||
asData.name = "chris";
|
||||
asData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
asData.chargeStruct.chargeTypeId = 345863487;
|
||||
asData.impactPosition = Core::GeoPosition2D(0.15525, 0.926080);
|
||||
asData.partyId = 7;
|
||||
asData.participantId = 1234;
|
||||
asData.externalId = 1;
|
||||
asData.flightTime = 123;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send explosionSingleCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -74,14 +74,14 @@ void TestAirSupportImpact::tryCreate()
|
||||
if (!m_ftc->airSupportImpactModifyRequest(
|
||||
AirSupportImpactModifyRequest(
|
||||
0,
|
||||
asData.name(),
|
||||
asData.effectStart(),
|
||||
asData.chargeStruct().chargeTypeId(),
|
||||
asData.impactPosition(),
|
||||
asData.partyId(),
|
||||
asData.participantId(),
|
||||
asData.flightTime(),
|
||||
asData.externalId()),
|
||||
asData.name,
|
||||
asData.effectStart,
|
||||
asData.chargeStruct.chargeTypeId,
|
||||
asData.impactPosition,
|
||||
asData.partyId,
|
||||
asData.participantId,
|
||||
asData.flightTime,
|
||||
asData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during explosionSingleCreateRequest()";
|
||||
@@ -98,19 +98,19 @@ void TestAirSupportImpact::tryCreate()
|
||||
m_bExpectedFailure = false;
|
||||
m_expectedAesId = -1;
|
||||
|
||||
asData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
asData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
m_bIsCreatedRequest = true;
|
||||
if (!m_ftc->airSupportImpactModifyRequest(
|
||||
AirSupportImpactModifyRequest(
|
||||
0,
|
||||
asData.name(),
|
||||
asData.effectStart(),
|
||||
asData.chargeStruct().chargeTypeId(),
|
||||
asData.impactPosition(),
|
||||
asData.partyId(),
|
||||
asData.participantId(),
|
||||
asData.flightTime(),
|
||||
asData.externalId()),
|
||||
asData.name,
|
||||
asData.effectStart,
|
||||
asData.chargeStruct.chargeTypeId,
|
||||
asData.impactPosition,
|
||||
asData.partyId,
|
||||
asData.participantId,
|
||||
asData.flightTime,
|
||||
asData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during explosionSingleCreateRequest()";
|
||||
@@ -118,7 +118,7 @@ void TestAirSupportImpact::tryCreate()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_asData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_asData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating single explosion object";
|
||||
failExit();
|
||||
@@ -137,36 +137,36 @@ void TestAirSupportImpact::tryCreate()
|
||||
void TestAirSupportImpact::tryModify()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_asData.name("chris2");
|
||||
m_asData.effectStart(m_asData.effectStart.get() + 2000);
|
||||
m_asData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_asData.impactPosition(Core::GeoPosition2D(0.15525, 0.92607));
|
||||
m_asData.partyId(8);
|
||||
m_asData.participantId(1235);
|
||||
m_asData.flightTime(321);
|
||||
m_asData.name = "chris2";
|
||||
m_asData.effectStart = m_asData.effectStart.get() + 2000;
|
||||
m_asData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_asData.impactPosition = Core::GeoPosition2D(0.15525, 0.92607);
|
||||
m_asData.partyId = 8;
|
||||
m_asData.participantId = 1235;
|
||||
m_asData.flightTime = 321;
|
||||
const AreaEffectSimulation::AirSupportImpact asData(m_asData);
|
||||
m_asData = AreaEffectSimulation::AirSupportImpact();
|
||||
m_asData.id(asData.id());
|
||||
m_asData.id = asData.id;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->airSupportImpactModifyRequest(
|
||||
AirSupportImpactModifyRequest(
|
||||
asData.id(),
|
||||
asData.name(),
|
||||
asData.effectStart(),
|
||||
asData.chargeStruct().chargeTypeId(),
|
||||
asData.impactPosition(),
|
||||
asData.partyId(),
|
||||
asData.participantId(),
|
||||
asData.flightTime(),
|
||||
asData.externalId()),
|
||||
asData.id,
|
||||
asData.name,
|
||||
asData.effectStart,
|
||||
asData.chargeStruct.chargeTypeId,
|
||||
asData.impactPosition,
|
||||
asData.partyId,
|
||||
asData.participantId,
|
||||
asData.flightTime,
|
||||
asData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_asData.chargeStruct().chargeTypeId() == s_ChargeTypeId2;}))
|
||||
if (!waitForData([this]() { return m_asData.chargeStruct.chargeTypeId == s_ChargeTypeId2;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating single explosion object";
|
||||
failExit();
|
||||
@@ -186,9 +186,9 @@ void TestAirSupportImpact::waitExpire()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until explosion single expires";
|
||||
|
||||
if (!waitForData([this]() { return m_asData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_asData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of explosion single with id " << m_asData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of explosion single with id " << m_asData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ void TestAirSupportImpact::waitExpire()
|
||||
|
||||
void TestAirSupportImpact::airSupportImpactChanged(const AreaEffectSimulation::AirSupportImpact &data, DataModification modType)
|
||||
{
|
||||
if (m_asData.id() == -1)
|
||||
if (m_asData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_asData);
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ TestBase::TestBase(const char *loggerName, QObject *parent)
|
||||
, m_replyError(false)
|
||||
, m_bTestsSuccessful(true)
|
||||
, m_testId(0)
|
||||
, m_aesTypeName(QString::fromLatin1(loggerName).split(QLatin1Char('.')).last().toString())
|
||||
, m_aesTypeName(QString::fromLatin1(loggerName).split(QLatin1Char('.')).last())
|
||||
, m_logger(getLogger(loggerName))
|
||||
{}
|
||||
|
||||
|
||||
+6
-6
@@ -47,17 +47,17 @@ protected:
|
||||
void onAesChanged(const T &dataIn, DataModification modType, T &dataOut)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got " << m_aesTypeName << " with mod type " << (int)modType
|
||||
<< ", id: " << dataIn.id() << ", chargeType: " << dataIn.chargeStruct().chargeTypeId()
|
||||
<< ", effectState: " << dataIn.effectStateId();
|
||||
if (m_expectedAesId == dataIn.id())
|
||||
<< ", id: " << dataIn.id << ", chargeType: " << dataIn.chargeStruct.chargeTypeId
|
||||
<< ", effectState: " << dataIn.effectStateId;
|
||||
if (m_expectedAesId == dataIn.id)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Expected aes id - updating data for " << m_aesTypeName;
|
||||
dataOut = dataIn;
|
||||
}
|
||||
if (modType == DataModification::eRemoved && dataOut.id() == dataIn.id())
|
||||
if (modType == DataModification::eRemoved && dataOut.id == dataIn.id)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Removed " << m_aesTypeName << " with id " << dataIn.id();
|
||||
m_expectedAesId = dataIn.id();
|
||||
DEBUG_LOG(m_logger) << "Removed " << m_aesTypeName << " with id " << dataIn.id;
|
||||
m_expectedAesId = dataIn.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+82
-82
@@ -27,7 +27,7 @@ bool TestBCContamination::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataBCContamination();
|
||||
m_bcData.id(-1);
|
||||
m_bcData.id = -1;
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::bCContaminationChanged,
|
||||
this, &TestBCContamination::bCContaminationChanged);
|
||||
|
||||
@@ -40,14 +40,14 @@ bool TestBCContamination::checkBaseData(const AreaEffectSimulation::BCContaminat
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.impactPosition() != b.impactPosition())
|
||||
if (a.impactPosition != b.impactPosition)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition() << " - " << b.impactPosition();
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition << " - " << b.impactPosition;
|
||||
return false;
|
||||
}
|
||||
if (a.impactRadius() != b.impactRadius())
|
||||
if (a.impactRadius != b.impactRadius)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactRadius does not match: " << a.impactRadius() << " - " << b.impactRadius();
|
||||
WARNING_LOG(m_logger) << "impactRadius does not match: " << a.impactRadius << " - " << b.impactRadius;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -61,17 +61,17 @@ void TestBCContamination::tryCreateBCContamination()
|
||||
m_bcData = AreaEffectSimulation::BCContamination();
|
||||
AreaEffectSimulation::BCContamination bcData;
|
||||
|
||||
bcData.id(0);
|
||||
bcData.name("chris");
|
||||
bcData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
bcData.effectDuration(10234); // msec
|
||||
bcData.chargeStruct().chargeTypeId(345863487);
|
||||
bcData.impactPosition(Core::GeoPosition2D(0.16, 0.92));
|
||||
bcData.impactRadius(100); // 100m
|
||||
bcData.partyId(2);
|
||||
bcData.participantId(1234);
|
||||
bcData.upperOffset(6.0);
|
||||
bcData.lowerOffset(-1000.0);
|
||||
bcData.id = 0;
|
||||
bcData.name = "chris";
|
||||
bcData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
bcData.effectDuration = 10234; // msec
|
||||
bcData.chargeStruct.chargeTypeId = 345863487;
|
||||
bcData.impactPosition = Core::GeoPosition2D(0.16, 0.92);
|
||||
bcData.impactRadius = 100; // 100m
|
||||
bcData.partyId = 2;
|
||||
bcData.participantId = 1234;
|
||||
bcData.upperOffset = 6.0;
|
||||
bcData.lowerOffset = -1000.0;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send BCContaminationCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -82,22 +82,22 @@ void TestBCContamination::tryCreateBCContamination()
|
||||
if(!m_ftc->bCContaminationModifyRequest(
|
||||
BCContaminationModifyRequest(
|
||||
0,
|
||||
bcData.name(),
|
||||
bcData.effectStart(),
|
||||
bcData.effectDuration(),
|
||||
bcData.chargeStruct().chargeTypeId(),
|
||||
bcData.impactPosition(),
|
||||
bcData.impactRadius(),
|
||||
bcData.name,
|
||||
bcData.effectStart,
|
||||
bcData.effectDuration,
|
||||
bcData.chargeStruct.chargeTypeId,
|
||||
bcData.impactPosition,
|
||||
bcData.impactRadius,
|
||||
AesWeatherSource::AwsStatic,
|
||||
bcData.partyId(),
|
||||
bcData.participantId(),
|
||||
bcData.partyId,
|
||||
bcData.participantId,
|
||||
dds::core::optional<double>(), // propagationDirection
|
||||
dds::core::optional<double>(), // windSpeed
|
||||
dds::core::optional<Core::GeoPosition2D>(), // weatherPosition
|
||||
dds::core::optional<rti::core::int64>(), // weatherTimestamp
|
||||
dds::core::optional<long long>(), // externalId
|
||||
bcData.upperOffset(),
|
||||
bcData.lowerOffset(),
|
||||
dds::core::optional<rti::core::int64>(), // externalId
|
||||
bcData.upperOffset,
|
||||
bcData.lowerOffset,
|
||||
dds::core::optional<bool>()),
|
||||
this))
|
||||
{
|
||||
@@ -118,26 +118,26 @@ void TestBCContamination::tryCreateBCContamination()
|
||||
m_bIsCreatedRequest = true;
|
||||
m_expectedAesId = -1;
|
||||
|
||||
bcData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
bcData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
if (!m_ftc->bCContaminationModifyRequest(
|
||||
BCContaminationModifyRequest(
|
||||
0,
|
||||
bcData.name(),
|
||||
bcData.effectStart(),
|
||||
bcData.effectDuration(),
|
||||
bcData.chargeStruct().chargeTypeId(),
|
||||
bcData.impactPosition(),
|
||||
bcData.impactRadius(),
|
||||
bcData.name,
|
||||
bcData.effectStart,
|
||||
bcData.effectDuration,
|
||||
bcData.chargeStruct.chargeTypeId,
|
||||
bcData.impactPosition,
|
||||
bcData.impactRadius,
|
||||
AesWeatherSource::AwsStatic,
|
||||
bcData.partyId(),
|
||||
bcData.participantId(),
|
||||
bcData.partyId,
|
||||
bcData.participantId,
|
||||
dds::core::optional<double>(),
|
||||
dds::core::optional<double>(),
|
||||
dds::core::optional<Core::GeoPosition2D>(),
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<long long>(),
|
||||
bcData.upperOffset(),
|
||||
bcData.lowerOffset(),
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
bcData.upperOffset,
|
||||
bcData.lowerOffset,
|
||||
dds::core::optional<bool>()),
|
||||
this))
|
||||
{
|
||||
@@ -146,7 +146,7 @@ void TestBCContamination::tryCreateBCContamination()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_bcData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_bcData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating bc contamination object";
|
||||
failExit();
|
||||
@@ -165,39 +165,39 @@ void TestBCContamination::tryCreateBCContamination()
|
||||
void TestBCContamination::tryModifyBCContamination()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_bcData.name("chris2");
|
||||
m_bcData.effectStart(m_bcData.effectStart.get() + 2000);
|
||||
m_bcData.effectDuration(3200); // msec
|
||||
m_bcData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_bcData.impactPosition(Core::GeoPosition2D(0.17, 0.93));
|
||||
m_bcData.partyId(3);
|
||||
m_bcData.participantId(1235);
|
||||
m_bcData.upperOffset(6.0);
|
||||
m_bcData.lowerOffset(false);
|
||||
m_bcData.name = "chris2";
|
||||
m_bcData.effectStart = m_bcData.effectStart.get() + 2000;
|
||||
m_bcData.effectDuration = 3200; // msec
|
||||
m_bcData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_bcData.impactPosition = Core::GeoPosition2D(0.17, 0.93);
|
||||
m_bcData.partyId = 3;
|
||||
m_bcData.participantId = 1235;
|
||||
m_bcData.upperOffset = 6.0;
|
||||
m_bcData.lowerOffset = false;
|
||||
const AreaEffectSimulation::BCContamination bcData(m_bcData);
|
||||
m_bcData = AreaEffectSimulation::BCContamination();
|
||||
m_bcData.id(bcData.id());
|
||||
m_bcData.id = bcData.id;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->bCContaminationModifyRequest(
|
||||
BCContaminationModifyRequest(
|
||||
bcData.id(),
|
||||
bcData.name(),
|
||||
bcData.effectStart(),
|
||||
bcData.effectDuration(),
|
||||
bcData.chargeStruct().chargeTypeId(),
|
||||
bcData.impactPosition(),
|
||||
bcData.impactRadius(),
|
||||
bcData.id,
|
||||
bcData.name,
|
||||
bcData.effectStart,
|
||||
bcData.effectDuration,
|
||||
bcData.chargeStruct.chargeTypeId,
|
||||
bcData.impactPosition,
|
||||
bcData.impactRadius,
|
||||
AesWeatherSource::AwsStatic,
|
||||
bcData.partyId(),
|
||||
bcData.participantId(),
|
||||
bcData.partyId,
|
||||
bcData.participantId,
|
||||
dds::core::optional<double>(),
|
||||
dds::core::optional<double>(),
|
||||
dds::core::optional<Core::GeoPosition2D>(),
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
bcData.upperOffset(),
|
||||
bcData.lowerOffset(),
|
||||
bcData.upperOffset,
|
||||
bcData.lowerOffset,
|
||||
dds::core::optional<bool>()),
|
||||
this))
|
||||
{
|
||||
@@ -205,7 +205,7 @@ void TestBCContamination::tryModifyBCContamination()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_bcData.chargeStruct().chargeTypeId() == s_ChargeTypeId2;}))
|
||||
if (!waitForData([this]() { return m_bcData.chargeStruct.chargeTypeId == s_ChargeTypeId2;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating bc contamination object";
|
||||
failExit();
|
||||
@@ -225,9 +225,9 @@ void TestBCContamination::waitExpireBCContamination()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until bc contamination expires";
|
||||
|
||||
if (!waitForData([this]() { return m_bcData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_bcData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of bc contamination with id " << m_bcData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of bc contamination with id " << m_bcData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -241,33 +241,33 @@ void TestBCContamination::tryRemoveBCContamination()
|
||||
INFO_LOG(m_logger) << "tryRemoveBCContamination start";
|
||||
|
||||
AreaEffectSimulation::BCContamination bcData(m_bcData);
|
||||
bcData.name("RemoveTest");
|
||||
bcData.effectStart(0); // not set
|
||||
bcData.name = "RemoveTest";
|
||||
bcData.effectStart = 0; // not set
|
||||
m_bcData = AreaEffectSimulation::BCContamination();
|
||||
m_expectedAesId = -1;
|
||||
m_bIsCreatedRequest = true;
|
||||
bcData.upperOffset(6.0);
|
||||
bcData.lowerOffset(false);
|
||||
bcData.upperOffset = 6.0;
|
||||
bcData.lowerOffset = false;
|
||||
|
||||
if (!m_ftc->bCContaminationModifyRequest(
|
||||
BCContaminationModifyRequest(
|
||||
0,
|
||||
bcData.name(),
|
||||
bcData.effectStart(),
|
||||
bcData.effectDuration(),
|
||||
bcData.chargeStruct().chargeTypeId(),
|
||||
bcData.impactPosition(),
|
||||
bcData.impactRadius(),
|
||||
bcData.name,
|
||||
bcData.effectStart,
|
||||
bcData.effectDuration,
|
||||
bcData.chargeStruct.chargeTypeId,
|
||||
bcData.impactPosition,
|
||||
bcData.impactRadius,
|
||||
AesWeatherSource::AwsStatic,
|
||||
bcData.partyId(),
|
||||
bcData.participantId(),
|
||||
bcData.partyId,
|
||||
bcData.participantId,
|
||||
dds::core::optional<double>(),
|
||||
dds::core::optional<double>(),
|
||||
dds::core::optional<Core::GeoPosition2D>(),
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
bcData.upperOffset(),
|
||||
bcData.lowerOffset(),
|
||||
bcData.upperOffset,
|
||||
bcData.lowerOffset,
|
||||
dds::core::optional<bool>()),
|
||||
this))
|
||||
{
|
||||
@@ -276,7 +276,7 @@ void TestBCContamination::tryRemoveBCContamination()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_bcData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_bcData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating bc contamination object";
|
||||
failExit();
|
||||
@@ -284,14 +284,14 @@ void TestBCContamination::tryRemoveBCContamination()
|
||||
}
|
||||
|
||||
m_expectedAesId = -1;
|
||||
if (!m_ftc->bCContaminationRemoveRequest(Core::RemoveElementRequest(m_bcData.id()), this))
|
||||
if (!m_ftc->bCContaminationRemoveRequest(Core::RemoveElementRequest(m_bcData.id), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during BCContaminationRemoveRequest()";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_bcData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_bcData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error removing bc contamination object";
|
||||
failExit();
|
||||
@@ -304,7 +304,7 @@ void TestBCContamination::tryRemoveBCContamination()
|
||||
|
||||
void TestBCContamination::bCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType)
|
||||
{
|
||||
if (m_bcData.id() == -1)
|
||||
if (m_bcData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_bcData);
|
||||
}
|
||||
|
||||
+61
-61
@@ -27,7 +27,7 @@ bool TestBoobyTrap::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataBoobyTrap();
|
||||
m_btData.id(-1);
|
||||
m_btData.id = -1;
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::boobyTrapChanged,
|
||||
this, &TestBoobyTrap::boobyTrapChanged);
|
||||
|
||||
@@ -40,14 +40,14 @@ bool TestBoobyTrap::checkBaseData(const AreaEffectSimulation::BoobyTrap &a,
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.impactPosition() != b.impactPosition())
|
||||
if (a.impactPosition != b.impactPosition)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition() << " - " << b.impactPosition();
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition << " - " << b.impactPosition;
|
||||
return false;
|
||||
}
|
||||
if (a.impactRadius() != b.impactRadius())
|
||||
if (a.impactRadius != b.impactRadius)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactRadius does not match: " << a.impactRadius() << " - " << b.impactRadius();
|
||||
WARNING_LOG(m_logger) << "impactRadius does not match: " << a.impactRadius << " - " << b.impactRadius;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -61,17 +61,17 @@ void TestBoobyTrap::tryCreateBoobyTrap()
|
||||
m_btData = AreaEffectSimulation::BoobyTrap();
|
||||
AreaEffectSimulation::BoobyTrap btData;
|
||||
|
||||
btData.id(0);
|
||||
btData.name("BoobyTrap1");
|
||||
btData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
btData.effectDuration(10234); // msec
|
||||
btData.chargeStruct().chargeTypeId(3456789);
|
||||
btData.impactPosition(Core::GeoPosition2D(0.1547, 0.926));
|
||||
btData.impactRadius(800); // 100m
|
||||
btData.triggerRadius(200);
|
||||
btData.rotationAngle(45);
|
||||
btData.centralAngle(90);
|
||||
btData.partyId(2);
|
||||
btData.id = 0;
|
||||
btData.name = "BoobyTrap1";
|
||||
btData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
btData.effectDuration = 10234; // msec
|
||||
btData.chargeStruct.chargeTypeId = 3456789;
|
||||
btData.impactPosition = Core::GeoPosition2D(0.1547, 0.926);
|
||||
btData.impactRadius = 800; // 100m
|
||||
btData.triggerRadius = 200;
|
||||
btData.rotationAngle = 45;
|
||||
btData.centralAngle = 90;
|
||||
btData.partyId = 2;
|
||||
//btData.participantId(1234);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send BoobyTrapCreateRequest()";
|
||||
@@ -83,12 +83,12 @@ void TestBoobyTrap::tryCreateBoobyTrap()
|
||||
if (!m_ftc->boobyTrapModifyRequest(
|
||||
BoobyTrapModifyRequest(
|
||||
0,
|
||||
btData.name(),
|
||||
btData.effectDuration(),
|
||||
btData.chargeStruct().chargeTypeId(),
|
||||
btData.impactPosition(),
|
||||
btData.impactRadius(),
|
||||
btData.triggerRadius(),
|
||||
btData.name,
|
||||
btData.effectDuration,
|
||||
btData.chargeStruct.chargeTypeId,
|
||||
btData.impactPosition,
|
||||
btData.impactRadius,
|
||||
btData.triggerRadius,
|
||||
btData.rotationAngle.get(),
|
||||
btData.centralAngle.get(),
|
||||
btData.effectStart.get(),
|
||||
@@ -112,16 +112,16 @@ void TestBoobyTrap::tryCreateBoobyTrap()
|
||||
m_bIsCreatedRequest = true;
|
||||
m_expectedAesId = -1;
|
||||
|
||||
btData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
btData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
if (!m_ftc->boobyTrapModifyRequest(
|
||||
BoobyTrapModifyRequest(
|
||||
0,
|
||||
btData.name(),
|
||||
btData.effectDuration(),
|
||||
btData.chargeStruct().chargeTypeId(),
|
||||
btData.impactPosition(),
|
||||
btData.impactRadius(),
|
||||
btData.triggerRadius(),
|
||||
btData.name,
|
||||
btData.effectDuration,
|
||||
btData.chargeStruct.chargeTypeId,
|
||||
btData.impactPosition,
|
||||
btData.impactRadius,
|
||||
btData.triggerRadius,
|
||||
btData.rotationAngle.get(),
|
||||
btData.centralAngle.get(),
|
||||
btData.effectStart.get(),
|
||||
@@ -133,7 +133,7 @@ void TestBoobyTrap::tryCreateBoobyTrap()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_btData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_btData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating booby trap object";
|
||||
failExit();
|
||||
@@ -152,27 +152,27 @@ void TestBoobyTrap::tryCreateBoobyTrap()
|
||||
void TestBoobyTrap::tryModifyBoobyTrap()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_btData.name("Booby Trap 2");
|
||||
m_btData.effectStart(m_btData.effectStart.get() + 2000);
|
||||
m_btData.effectDuration(3200); // msec
|
||||
m_btData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_btData.impactPosition(Core::GeoPosition2D(0.1547, 0.926));
|
||||
m_btData.partyId(3);
|
||||
m_btData.name = "Booby Trap 2";
|
||||
m_btData.effectStart = m_btData.effectStart.get() + 2000;
|
||||
m_btData.effectDuration = 3200; // msec
|
||||
m_btData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_btData.impactPosition = Core::GeoPosition2D(0.1547, 0.926);
|
||||
m_btData.partyId = 3;
|
||||
//m_btData.participantId(1235);
|
||||
const AreaEffectSimulation::BoobyTrap btData(m_btData);
|
||||
m_btData = AreaEffectSimulation::BoobyTrap();
|
||||
m_btData.id(btData.id());
|
||||
m_btData.id = btData.id;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->boobyTrapModifyRequest(
|
||||
BoobyTrapModifyRequest(
|
||||
btData.id(),
|
||||
btData.name(),
|
||||
btData.effectDuration(),
|
||||
btData.chargeStruct().chargeTypeId(),
|
||||
btData.impactPosition(),
|
||||
btData.impactRadius(),
|
||||
btData.triggerRadius(),
|
||||
btData.id,
|
||||
btData.name,
|
||||
btData.effectDuration,
|
||||
btData.chargeStruct.chargeTypeId,
|
||||
btData.impactPosition,
|
||||
btData.impactRadius,
|
||||
btData.triggerRadius,
|
||||
btData.rotationAngle.get(),
|
||||
btData.centralAngle.get(),
|
||||
btData.effectStart.get(),
|
||||
@@ -183,7 +183,7 @@ void TestBoobyTrap::tryModifyBoobyTrap()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_btData.chargeStruct().chargeTypeId() == s_ChargeTypeId2;}))
|
||||
if (!waitForData([this]() { return m_btData.chargeStruct.chargeTypeId == s_ChargeTypeId2;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating booby trap object";
|
||||
failExit();
|
||||
@@ -204,8 +204,8 @@ void TestBoobyTrap::tryTriggerBoobyTrap()
|
||||
INFO_LOG(m_logger) << "trigger booby trap -> expires";
|
||||
|
||||
BoobyTrapTriggerRequest req;
|
||||
req.id(m_btData.id());
|
||||
req.triggered(true);
|
||||
req.id = m_btData.id;
|
||||
req.triggered = true;
|
||||
if (!m_ftc->boobyTrapTriggerRequest(req, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting trigger data";
|
||||
@@ -221,9 +221,9 @@ void TestBoobyTrap::waitExpireBoobyTrap()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until booby trap expires";
|
||||
|
||||
if (!waitForData([this]() { return m_btData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_btData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of booby trap with id " << m_btData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of booby trap with id " << m_btData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -237,8 +237,8 @@ void TestBoobyTrap::tryRemoveBoobyTrap()
|
||||
INFO_LOG(m_logger) << "tryRemoveBoobyTrap start";
|
||||
|
||||
AreaEffectSimulation::BoobyTrap btData(m_btData);
|
||||
btData.name("RemoveTest");
|
||||
btData.effectStart(0); // not set
|
||||
btData.name = "RemoveTest";
|
||||
btData.effectStart = 0; // not set
|
||||
m_btData = AreaEffectSimulation::BoobyTrap();
|
||||
m_expectedAesId = -1;
|
||||
m_bIsCreatedRequest = true;
|
||||
@@ -246,12 +246,12 @@ void TestBoobyTrap::tryRemoveBoobyTrap()
|
||||
if (!m_ftc->boobyTrapModifyRequest(
|
||||
BoobyTrapModifyRequest(
|
||||
0,
|
||||
btData.name(),
|
||||
btData.effectDuration(),
|
||||
btData.chargeStruct().chargeTypeId(),
|
||||
btData.impactPosition(),
|
||||
btData.impactRadius(),
|
||||
btData.triggerRadius(),
|
||||
btData.name,
|
||||
btData.effectDuration,
|
||||
btData.chargeStruct.chargeTypeId,
|
||||
btData.impactPosition,
|
||||
btData.impactRadius,
|
||||
btData.triggerRadius,
|
||||
btData.rotationAngle.get(),
|
||||
btData.centralAngle.get(),
|
||||
btData.effectStart.get(),
|
||||
@@ -263,7 +263,7 @@ void TestBoobyTrap::tryRemoveBoobyTrap()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_btData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_btData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating booby trap object";
|
||||
failExit();
|
||||
@@ -271,14 +271,14 @@ void TestBoobyTrap::tryRemoveBoobyTrap()
|
||||
}
|
||||
|
||||
m_expectedAesId = -1;
|
||||
if (!m_ftc->boobyTrapRemoveRequest(Core::RemoveElementRequest(m_btData.id()), this))
|
||||
if (!m_ftc->boobyTrapRemoveRequest(Core::RemoveElementRequest(m_btData.id), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during BoobyTrapRemoveRequest()";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_btData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_btData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error removing booby trap object";
|
||||
failExit();
|
||||
@@ -291,7 +291,7 @@ void TestBoobyTrap::tryRemoveBoobyTrap()
|
||||
|
||||
void TestBoobyTrap::boobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType)
|
||||
{
|
||||
if (m_btData.id() == -1)
|
||||
if (m_btData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_btData);
|
||||
}
|
||||
|
||||
+43
-43
@@ -25,7 +25,7 @@ bool TestChargeAdministration::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_testId = testId;
|
||||
m_caData.id(-1);
|
||||
m_caData.id = -1;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << m_testId;
|
||||
|
||||
m_dtc->waitForHistoricalDataChargeAdministration();
|
||||
@@ -37,33 +37,33 @@ bool TestChargeAdministration::init(int domainId, int exerciseId, int testId)
|
||||
bool TestChargeAdministration::checkBaseData(const AreaEffectSimulation::ChargeAdministration &a, const AreaEffectSimulation::ChargeAdministration &b) const
|
||||
{
|
||||
|
||||
if (a.amount() != b.amount())
|
||||
if (a.amount != b.amount)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Amount does not match: " << a.amount() << " - " << b.amount();
|
||||
WARNING_LOG(m_logger) << "Amount does not match: " << a.amount << " - " << b.amount;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.planned() != b.planned())
|
||||
if (a.planned != b.planned)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Planned does not match: " << a.planned() << " - " << b.planned();
|
||||
WARNING_LOG(m_logger) << "Planned does not match: " << a.planned << " - " << b.planned;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.chargeTypeId() != b.chargeTypeId())
|
||||
if (a.chargeTypeId != b.chargeTypeId)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "ChargeTypeId does not match: " << a.chargeTypeId() << " - " << b.chargeTypeId();
|
||||
WARNING_LOG(m_logger) << "ChargeTypeId does not match: " << a.chargeTypeId << " - " << b.chargeTypeId;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.partyId() != b.partyId())
|
||||
if (a.partyId != b.partyId)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "PartyId does not match: " << a.partyId() << " - " << b.partyId();
|
||||
WARNING_LOG(m_logger) << "PartyId does not match: " << a.partyId << " - " << b.partyId;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.used() != b.used())
|
||||
if (a.used != b.used)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Used does not match: " << a.used() << " - " << b.used();
|
||||
WARNING_LOG(m_logger) << "Used does not match: " << a.used << " - " << b.used;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ void TestChargeAdministration::tryCreateChargeAdministration()
|
||||
m_expectedAesId = -1;
|
||||
AreaEffectSimulation::ChargeAdministration esData;
|
||||
|
||||
esData.chargeTypeId(471);
|
||||
esData.partyId(2);
|
||||
esData.amount(450);
|
||||
esData.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
|
||||
esData.chargeTypeId = 471;
|
||||
esData.partyId = 2;
|
||||
esData.amount = 450;
|
||||
esData.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send ChargeAdministrationCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -89,10 +89,10 @@ void TestChargeAdministration::tryCreateChargeAdministration()
|
||||
|
||||
// amountChangedByOperator=true
|
||||
if (!m_ftc->chargeAdministrationModifyRequest(ChargeAdministrationModifyRequest(0,
|
||||
esData.chargeTypeId(),
|
||||
esData.partyId(),
|
||||
esData.effectSourceId(),
|
||||
esData.amount(),
|
||||
esData.chargeTypeId,
|
||||
esData.partyId,
|
||||
esData.effectSourceId,
|
||||
esData.amount,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -101,7 +101,7 @@ void TestChargeAdministration::tryCreateChargeAdministration()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_caData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_caData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating charge admin object";
|
||||
failExit();
|
||||
@@ -120,21 +120,21 @@ void TestChargeAdministration::tryCreateChargeAdministration()
|
||||
void TestChargeAdministration::tryModifyChargeAdministration()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_caData.chargeTypeId(471);
|
||||
m_caData.partyId(2);
|
||||
m_caData.amount(600);
|
||||
m_caData.chargeTypeId = 471;
|
||||
m_caData.partyId = 2;
|
||||
m_caData.amount = 600;
|
||||
|
||||
const AreaEffectSimulation::ChargeAdministration esData(m_caData);
|
||||
m_caData = AreaEffectSimulation::ChargeAdministration();
|
||||
m_caData.id(esData.id());
|
||||
m_caData.id = esData.id;
|
||||
m_bIsCreatedRequest = false;
|
||||
|
||||
// amountChangedByOperator=true
|
||||
if (!m_ftc->chargeAdministrationModifyRequest(ChargeAdministrationModifyRequest(esData.id(),
|
||||
esData.chargeTypeId(),
|
||||
esData.partyId(),
|
||||
esData.effectSourceId(),
|
||||
esData.amount(),
|
||||
if (!m_ftc->chargeAdministrationModifyRequest(ChargeAdministrationModifyRequest(esData.id,
|
||||
esData.chargeTypeId,
|
||||
esData.partyId,
|
||||
esData.effectSourceId,
|
||||
esData.amount,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -143,7 +143,7 @@ void TestChargeAdministration::tryModifyChargeAdministration()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_caData.amount() == s_ChargeAmount; }))
|
||||
if (!waitForData([this]() { return m_caData.amount == s_ChargeAmount; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating charge admin object";
|
||||
failExit();
|
||||
@@ -159,11 +159,11 @@ void TestChargeAdministration::tryModifyChargeAdministration()
|
||||
//
|
||||
void TestChargeAdministration::chargeAdministrationChanged(const AreaEffectSimulation::ChargeAdministration &data, DataModification modType)
|
||||
{
|
||||
if (m_caData.id() < 0)
|
||||
if (m_caData.id < 0)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "Got ChargeAdministrationData with mod type " << (int)modType << ", id: " << data.id() << ", name: " << data.chargeTypeId()
|
||||
<< ", amount: " << data.amount();
|
||||
if ((modType == DataModification::eAdded && m_caData.id() == 0) || (modType == DataModification::eModified && m_caData.id() == data.id()))
|
||||
INFO_LOG(m_logger) << "Got ChargeAdministrationData with mod type " << (int)modType << ", id: " << data.id << ", name: " << data.chargeTypeId
|
||||
<< ", amount: " << data.amount;
|
||||
if ((modType == DataModification::eAdded && m_caData.id == 0) || (modType == DataModification::eModified && m_caData.id == data.id))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "** Updating m_caData";
|
||||
m_caData = data;
|
||||
@@ -194,20 +194,20 @@ void TestChargeAdministration::tryCreateChargeAdministration(int chargeTypeId, i
|
||||
m_caData = AreaEffectSimulation::ChargeAdministration();
|
||||
AreaEffectSimulation::ChargeAdministration esData;
|
||||
|
||||
esData.chargeTypeId(chargeTypeId);
|
||||
esData.partyId(partyId);
|
||||
esData.amount(amount);
|
||||
esData.amountChangedByOperator(true);
|
||||
esData.chargeTypeId = chargeTypeId;
|
||||
esData.partyId = partyId;
|
||||
esData.amount = amount;
|
||||
esData.amountChangedByOperator = true;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send ChargeAdministrationCreateRequest(int,int,int)";
|
||||
m_replyError = false;
|
||||
m_bIsCreatedRequest = true;
|
||||
// amountChangedByOperator=true
|
||||
if (!m_ftc->chargeAdministrationModifyRequest(ChargeAdministrationModifyRequest(0,
|
||||
esData.chargeTypeId(),
|
||||
esData.partyId(),
|
||||
esData.effectSourceId(),
|
||||
esData.amount(),
|
||||
esData.chargeTypeId,
|
||||
esData.partyId,
|
||||
esData.effectSourceId,
|
||||
esData.amount,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -216,7 +216,7 @@ void TestChargeAdministration::tryCreateChargeAdministration(int chargeTypeId, i
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_caData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_caData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating charge admin object";
|
||||
failExit();
|
||||
|
||||
+30
-30
@@ -25,7 +25,7 @@ bool TestDangerArea::init(int domainId, int exerciseId, int testId)
|
||||
|
||||
m_dtc->waitForHistoricalDataDangerArea();
|
||||
|
||||
m_daData.id(-1);
|
||||
m_daData.id = -1;
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::dangerAreaChanged,
|
||||
this, &TestDangerArea::dangerAreaChanged);
|
||||
return true;
|
||||
@@ -35,23 +35,23 @@ bool TestDangerArea::checkBaseData(const AreaEffectSimulation::DangerArea &a,
|
||||
const AreaEffectSimulation::DangerArea &b) const
|
||||
{
|
||||
|
||||
if (a.name() != b.name())
|
||||
if (a.name != b.name)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Name does not macht: " << a.name() << " - " << b.name();
|
||||
WARNING_LOG(m_logger) << "Name does not macht: " << a.name << " - " << b.name;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.effectStart() != b.effectStart())
|
||||
if (a.effectStart != b.effectStart)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "StartTime does not match: " << a.effectStart() << " - " << b.effectStart();
|
||||
WARNING_LOG(m_logger) << "StartTime does not match: " << a.effectStart << " - " << b.effectStart;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i<a.segments().size() && i<b.segments().size(); ++i)
|
||||
for (size_t i = 0; i<a.segments.size() && i<b.segments.size(); ++i)
|
||||
{
|
||||
if (a.segments()[i] != b.segments()[i])
|
||||
if (a.segments[i] != b.segments[i])
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.segments()[i] << " - " << b.segments()[i];
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.segments[i] << " - " << b.segments[i];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -64,10 +64,10 @@ void TestDangerArea::tryCreateDangerArea()
|
||||
{
|
||||
m_daData = AreaEffectSimulation::DangerArea();
|
||||
AreaEffectSimulation::DangerArea esData;
|
||||
esData.id(0);
|
||||
esData.name("chris");
|
||||
esData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
esData.sampleTime(time(nullptr) *1000);
|
||||
esData.id = 0;
|
||||
esData.name = "chris";
|
||||
esData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
esData.sampleTime = time(nullptr) *1000;
|
||||
|
||||
std::vector<Core::GeoPosition2D> segments;
|
||||
segments.emplace_back(Core::GeoPosition2D(0.17001, 0.93001));
|
||||
@@ -80,10 +80,10 @@ void TestDangerArea::tryCreateDangerArea()
|
||||
if (!m_ftc->dangerAreaModifyRequest(
|
||||
DangerAreaModifyRequest(
|
||||
0,
|
||||
esData.name(),
|
||||
esData.name,
|
||||
0, // Effect Duration
|
||||
311, // Charge Type Id -> 311 = Danger Area Dummy
|
||||
esData.effectStart(),
|
||||
esData.effectStart,
|
||||
segments,
|
||||
dds::core::optional<int32_t>(), // Party Id
|
||||
dds::core::optional<int32_t>(), // Player Id
|
||||
@@ -96,7 +96,7 @@ void TestDangerArea::tryCreateDangerArea()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_daData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_daData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating danger area object";
|
||||
failExit();
|
||||
@@ -115,12 +115,12 @@ void TestDangerArea::tryCreateDangerArea()
|
||||
void TestDangerArea::tryModifyDangerArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_daData.name(s_name);
|
||||
m_daData.effectStart(time(nullptr)+ 6 * 1000);
|
||||
m_daData.name = s_name;
|
||||
m_daData.effectStart = time(nullptr)+ 6 * 1000;
|
||||
|
||||
const AreaEffectSimulation::DangerArea esData(m_daData);
|
||||
m_daData = AreaEffectSimulation::DangerArea();
|
||||
m_daData.id(esData.id());
|
||||
m_daData.id = esData.id;
|
||||
|
||||
// resize to 2 elements
|
||||
std::vector<Core::GeoPosition2D> segments;
|
||||
@@ -130,11 +130,11 @@ void TestDangerArea::tryModifyDangerArea()
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->dangerAreaModifyRequest(
|
||||
DangerAreaModifyRequest(
|
||||
esData.id(),
|
||||
esData.name(),
|
||||
esData.id,
|
||||
esData.name,
|
||||
0, // Effect Duration
|
||||
311, // Charge Type Id -> 311 = Danger Area Dummy
|
||||
esData.effectStart(),
|
||||
esData.effectStart,
|
||||
segments,
|
||||
dds::core::optional<int32_t>(), // Party Id
|
||||
dds::core::optional<int32_t>(), // Player Id
|
||||
@@ -146,7 +146,7 @@ void TestDangerArea::tryModifyDangerArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_daData.segments().size() == 2;}))
|
||||
if (!waitForData([this]() { return m_daData.segments.size() == 2;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating danger area object";
|
||||
failExit();
|
||||
@@ -162,11 +162,11 @@ void TestDangerArea::tryModifyDangerArea()
|
||||
|
||||
if (!m_ftc->dangerAreaModifyRequest(
|
||||
DangerAreaModifyRequest(
|
||||
esData.id(),
|
||||
esData.name(),
|
||||
esData.id,
|
||||
esData.name,
|
||||
0, // Effect Duration
|
||||
311, // Charge Type Id -> 311 = Danger Area Dummy
|
||||
esData.effectStart(),
|
||||
esData.effectStart,
|
||||
segments,
|
||||
dds::core::optional<int32_t>(), // Party Id
|
||||
dds::core::optional<int32_t>(), // Player Id
|
||||
@@ -178,7 +178,7 @@ void TestDangerArea::tryModifyDangerArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_daData.segments().size() == 4;}))
|
||||
if (!waitForData([this]() { return m_daData.segments.size() == 4;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating danger area object";
|
||||
failExit();
|
||||
@@ -193,16 +193,16 @@ void TestDangerArea::tryRemoveDangerArea()
|
||||
{
|
||||
m_expectedAesId = -1;
|
||||
if (!m_ftc->dangerAreaRemoveRequest(
|
||||
Core::RemoveElementRequest( m_daData.id()),
|
||||
Core::RemoveElementRequest( m_daData.id),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_daData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_daData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error removing bc contamination object " << m_daData.id() << " != " << m_expectedAesId;
|
||||
ERROR_LOG(m_logger) << "Error removing bc contamination object " << m_daData.id << " != " << m_expectedAesId;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void TestDangerArea::tryRemoveDangerArea()
|
||||
//
|
||||
void TestDangerArea::dangerAreaChanged(const AreaEffectSimulation::DangerArea &data, DataModification modType)
|
||||
{
|
||||
if (m_daData.id() == -1)
|
||||
if (m_daData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_daData);
|
||||
}
|
||||
|
||||
+93
-92
@@ -8,6 +8,7 @@
|
||||
#include "aes_test_explosion_area.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include <QTest>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
@@ -27,7 +28,7 @@ bool TestExplosionArea::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataExplosionArea();
|
||||
m_eaData.id(-1);
|
||||
m_eaData.id = -1;
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionAreaChanged,
|
||||
this, &TestExplosionArea::explosionAreaChanged);
|
||||
@@ -43,19 +44,19 @@ bool TestExplosionArea::checkBaseData(const AreaEffectSimulation::ExplosionArea
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.area() != b.area())
|
||||
if (a.area != b.area)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "area does not match: " << a.area() << " - " << b.area();
|
||||
WARNING_LOG(m_logger) << "area does not match: " << a.area << " - " << b.area;
|
||||
return false;
|
||||
}
|
||||
if (a.cannonCount() != b.cannonCount())
|
||||
if (a.cannonCount != b.cannonCount)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount() << " - " << b.cannonCount();
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount << " - " << b.cannonCount;
|
||||
return false;
|
||||
}
|
||||
if (a.cannonRounds() != b.cannonRounds())
|
||||
if (a.cannonRounds != b.cannonRounds)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount() << " - " << b.cannonCount();
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount << " - " << b.cannonCount;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -66,17 +67,17 @@ void TestExplosionArea::tryCreateExplosionArea()
|
||||
INFO_LOG(m_logger) << "tryCreateExplosionArea start";
|
||||
m_eaData = AreaEffectSimulation::ExplosionArea();
|
||||
AreaEffectSimulation::ExplosionArea eaData;
|
||||
eaData.id(0);
|
||||
eaData.name("af1");
|
||||
eaData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
eaData.effectDuration(10000); // 10 seconds
|
||||
eaData.chargeStruct().chargeTypeId(345863487);
|
||||
eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.16, 0.92), 50, 60, 70));
|
||||
eaData.partyId(2);
|
||||
eaData.participantId(1234);
|
||||
eaData.cannonCount(1);
|
||||
eaData.cannonRounds(2);
|
||||
eaData.externalId(2);
|
||||
eaData.id = 0;
|
||||
eaData.name = "af1";
|
||||
eaData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
eaData.effectDuration = 10000; // 10 seconds
|
||||
eaData.chargeStruct.chargeTypeId = 345863487;
|
||||
eaData.area = AreaEffectSimulation::Area(Core::GeoPosition2D(0.16, 0.92), 50, 60, 70);
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 1234;
|
||||
eaData.cannonCount = 1;
|
||||
eaData.cannonRounds = 2;
|
||||
eaData.externalId = 2;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send explosionAreaCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -85,21 +86,21 @@ void TestExplosionArea::tryCreateExplosionArea()
|
||||
if (!m_ftc->explosionAreaModifyRequest(
|
||||
ExplosionAreaModifyRequest(
|
||||
0,
|
||||
eaData.name(),
|
||||
eaData.effectStart(),
|
||||
eaData.effectDuration(),
|
||||
eaData.effectSourceId(),
|
||||
eaData.chargeStruct().chargeTypeId(),
|
||||
eaData.area(),
|
||||
eaData.partyId(),
|
||||
eaData.participantId(),
|
||||
eaData.cannonCount(),
|
||||
eaData.cannonRounds(),
|
||||
eaData.fireRequestTime(),
|
||||
eaData.altitude(),
|
||||
eaData.purpose(),
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.externalId()
|
||||
eaData.name,
|
||||
eaData.effectStart,
|
||||
eaData.effectDuration,
|
||||
eaData.effectSourceId,
|
||||
eaData.chargeStruct.chargeTypeId,
|
||||
eaData.area,
|
||||
eaData.partyId,
|
||||
eaData.participantId,
|
||||
eaData.cannonCount,
|
||||
eaData.cannonRounds,
|
||||
eaData.fireRequestTime,
|
||||
eaData.altitude,
|
||||
eaData.purpose,
|
||||
eaData.effectMarkingInTa,
|
||||
eaData.externalId
|
||||
),
|
||||
this))
|
||||
{
|
||||
@@ -119,26 +120,26 @@ void TestExplosionArea::tryCreateExplosionArea()
|
||||
m_bExpectedFailure = false;
|
||||
m_expectedAesId = -1;
|
||||
|
||||
eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
m_bIsCreatedRequest = true;
|
||||
if (!m_ftc->explosionAreaModifyRequest(
|
||||
ExplosionAreaModifyRequest(
|
||||
0,
|
||||
eaData.name(),
|
||||
eaData.effectStart(),
|
||||
eaData.effectDuration(),
|
||||
eaData.effectSourceId(),
|
||||
eaData.chargeStruct().chargeTypeId(),
|
||||
eaData.area(),
|
||||
eaData.partyId(),
|
||||
eaData.participantId(),
|
||||
eaData.cannonCount(),
|
||||
eaData.cannonRounds(),
|
||||
eaData.fireRequestTime(),
|
||||
eaData.altitude(),
|
||||
eaData.purpose(),
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.externalId()),
|
||||
eaData.name,
|
||||
eaData.effectStart,
|
||||
eaData.effectDuration,
|
||||
eaData.effectSourceId,
|
||||
eaData.chargeStruct.chargeTypeId,
|
||||
eaData.area,
|
||||
eaData.partyId,
|
||||
eaData.participantId,
|
||||
eaData.cannonCount,
|
||||
eaData.cannonRounds,
|
||||
eaData.fireRequestTime,
|
||||
eaData.altitude,
|
||||
eaData.purpose,
|
||||
eaData.effectMarkingInTa,
|
||||
eaData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during explosionAreaCreateRequest()";
|
||||
@@ -146,7 +147,7 @@ void TestExplosionArea::tryCreateExplosionArea()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_eaData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_eaData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating area explosion object";
|
||||
failExit();
|
||||
@@ -166,47 +167,47 @@ void TestExplosionArea::tryCreateExplosionArea()
|
||||
void TestExplosionArea::tryModifyExplosionArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "tryModifyExplosionArea start";
|
||||
m_eaData.name("af2");
|
||||
m_eaData.effectStart(m_eaData.effectStart.get() + 3000);
|
||||
m_eaData.effectDuration(9000); // 9 sec
|
||||
m_eaData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.165, 0.921), 50, 60, 70));
|
||||
m_eaData.partyId(3);
|
||||
m_eaData.participantId(1235);
|
||||
m_eaData.cannonCount(2);
|
||||
m_eaData.cannonRounds(2);
|
||||
m_eaData.effectMarkingInTa(true);
|
||||
m_eaData.name = "af2";
|
||||
m_eaData.effectStart = m_eaData.effectStart.get() + 3000;
|
||||
m_eaData.effectDuration = 9000; // 9 sec
|
||||
m_eaData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_eaData.area = AreaEffectSimulation::Area(Core::GeoPosition2D(0.165, 0.921), 50, 60, 70);
|
||||
m_eaData.partyId = 3;
|
||||
m_eaData.participantId = 1235;
|
||||
m_eaData.cannonCount = 2;
|
||||
m_eaData.cannonRounds = 2;
|
||||
m_eaData.effectMarkingInTa = true;
|
||||
|
||||
const AreaEffectSimulation::ExplosionArea eaData(m_eaData);
|
||||
m_eaData = AreaEffectSimulation::ExplosionArea();
|
||||
m_eaData.id(eaData.id());
|
||||
m_eaData.id = eaData.id;
|
||||
m_bIsCreatedRequest = false;
|
||||
|
||||
if (!m_ftc->explosionAreaModifyRequest(
|
||||
ExplosionAreaModifyRequest(
|
||||
eaData.id(),
|
||||
eaData.name(),
|
||||
eaData.effectStart(),
|
||||
eaData.effectDuration(),
|
||||
eaData.effectSourceId(),
|
||||
eaData.chargeStruct().chargeTypeId(),
|
||||
eaData.area(),
|
||||
eaData.partyId(),
|
||||
eaData.participantId(),
|
||||
eaData.cannonCount(),
|
||||
eaData.cannonRounds(),
|
||||
eaData.fireRequestTime(),
|
||||
eaData.altitude(),
|
||||
eaData.purpose(),
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.externalId()),
|
||||
eaData.id,
|
||||
eaData.name,
|
||||
eaData.effectStart,
|
||||
eaData.effectDuration,
|
||||
eaData.effectSourceId,
|
||||
eaData.chargeStruct.chargeTypeId,
|
||||
eaData.area,
|
||||
eaData.partyId,
|
||||
eaData.participantId,
|
||||
eaData.cannonCount,
|
||||
eaData.cannonRounds,
|
||||
eaData.fireRequestTime,
|
||||
eaData.altitude,
|
||||
eaData.purpose,
|
||||
eaData.effectMarkingInTa,
|
||||
eaData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_eaData.chargeStruct().chargeTypeId() == s_ChargeTypeId2; }))
|
||||
if (!waitForData([this]() { return m_eaData.chargeStruct.chargeTypeId == s_ChargeTypeId2; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating area explosion object";
|
||||
failExit();
|
||||
@@ -227,9 +228,9 @@ void TestExplosionArea::tryWaitForActivationExplosionArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "tryWaitForActivationExplosionArea start";
|
||||
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Effect State = " << m_eaData.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "Effect State = " << m_eaData.effectStateId;
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
return;
|
||||
@@ -246,7 +247,7 @@ void TestExplosionArea::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = true;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
true,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -268,7 +269,7 @@ void TestExplosionArea::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = false;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
false,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -279,7 +280,7 @@ void TestExplosionArea::tryPauseResumeExplosionArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsPaused; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsPaused; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for pause of area explosion";
|
||||
failExit();
|
||||
@@ -291,7 +292,7 @@ void TestExplosionArea::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = true;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
false,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -313,7 +314,7 @@ void TestExplosionArea::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = false;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
true,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -324,7 +325,7 @@ void TestExplosionArea::tryPauseResumeExplosionArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
@@ -339,7 +340,7 @@ void TestExplosionArea::checkTriggeredExplosions()
|
||||
INFO_LOG(m_logger) << "checkTriggeredExplosions start";
|
||||
|
||||
// first we should wait for Activation
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
@@ -353,7 +354,7 @@ void TestExplosionArea::checkTriggeredExplosions()
|
||||
checkTriggeredExplosionsHelper(0x00); // 0b00000000
|
||||
|
||||
// last step: wait for expiry
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for expiring of area explosion";
|
||||
failExit();
|
||||
@@ -369,7 +370,7 @@ void TestExplosionArea::checkTriggeredExplosionsHelper(int bitfield)
|
||||
// since we've 9 seconds duration and the first hit is at 0, every 2.5sec should be a new TriggeredExplosions telegram
|
||||
QElapsedTimer et;
|
||||
et.start();
|
||||
if (!waitForData([this, bitfield]() { return m_tiData.bitfield()[0] == bitfield; }))
|
||||
if (!waitForData([this, bitfield]() { return m_tiData.bitfield[0] == bitfield; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for triggered explosison telegram with bitfield 0x" << QByteArray::number(bitfield, 16);
|
||||
failExit();
|
||||
@@ -386,16 +387,16 @@ void TestExplosionArea::checkTriggeredExplosionsHelper(int bitfield)
|
||||
|
||||
void TestExplosionArea::explosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType)
|
||||
{
|
||||
if (m_eaData.id() == -1)
|
||||
if (m_eaData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_eaData);
|
||||
}
|
||||
|
||||
void TestExplosionArea::triggeredImpactsChanged(const AreaEffectSimulation::TriggeredImpacts &data, DataModification modType)
|
||||
{
|
||||
if (m_eaData.id() != data.aesItemId() || modType == DataModification::eRemoved)
|
||||
if (m_eaData.id != data.aesItemId || modType == DataModification::eRemoved)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "Got TriggeredImpacts data - bitfield[0] = 0x" << QByteArray::number(static_cast<int>(data.bitfield()[0]), 16);
|
||||
INFO_LOG(m_logger) << "Got TriggeredImpacts data - bitfield[0] = 0x" << QByteArray::number(static_cast<int>(data.bitfield[0]), 16);
|
||||
m_tiData = data;
|
||||
}
|
||||
|
||||
|
||||
+77
-76
@@ -9,6 +9,7 @@
|
||||
#include "aes_test_explosion_area_bulk.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include <QTest>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
@@ -28,7 +29,7 @@ bool TestExplosionAreaBulk::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataExplosionArea();
|
||||
m_eaData.id(-1);
|
||||
m_eaData.id = -1;
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionAreaChanged,
|
||||
this, &TestExplosionAreaBulk::explosionAreaChanged);
|
||||
@@ -44,19 +45,19 @@ bool TestExplosionAreaBulk::checkBaseData(const AreaEffectSimulation::ExplosionA
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.area() != b.area())
|
||||
if (a.area != b.area)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "area does not match: " << a.area() << " - " << b.area();
|
||||
WARNING_LOG(m_logger) << "area does not match: " << a.area << " - " << b.area;
|
||||
return false;
|
||||
}
|
||||
if (a.cannonCount() != b.cannonCount())
|
||||
if (a.cannonCount != b.cannonCount)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount() << " - " << b.cannonCount();
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount << " - " << b.cannonCount;
|
||||
return false;
|
||||
}
|
||||
if (a.cannonRounds() != b.cannonRounds())
|
||||
if (a.cannonRounds != b.cannonRounds)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount() << " - " << b.cannonCount();
|
||||
WARNING_LOG(m_logger) << "cannonCount does not match: " << a.cannonCount << " - " << b.cannonCount;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -77,21 +78,21 @@ void TestExplosionAreaBulk::tryCreateExplosionArea()
|
||||
|
||||
m_eaData = AreaEffectSimulation::ExplosionArea();
|
||||
AreaEffectSimulation::ExplosionArea eaData;
|
||||
eaData.id(0);
|
||||
eaData.name(objName.toStdString().c_str());
|
||||
eaData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
eaData.effectDuration(effectDurationMesc); // 10 seconds
|
||||
eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
eaData.id = 0;
|
||||
eaData.name = objName.toStdString().c_str();
|
||||
eaData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
eaData.effectDuration = effectDurationMesc; // 10 seconds
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
|
||||
// Bremen : 0.155 ; 0.926
|
||||
eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.15 + (lonOffset*i), 0.926), 500, 600, 70));
|
||||
eaData.area = AreaEffectSimulation::Area(Core::GeoPosition2D(0.15 + (lonOffset*i), 0.926), 500, 600, 70);
|
||||
|
||||
|
||||
eaData.partyId((i%3) + 2);
|
||||
eaData.participantId(1234);
|
||||
eaData.cannonCount(10);
|
||||
eaData.cannonRounds(10);
|
||||
eaData.externalId(2);
|
||||
eaData.partyId = (i%3) + 2;
|
||||
eaData.participantId = 1234;
|
||||
eaData.cannonCount = 10;
|
||||
eaData.cannonRounds = 10;
|
||||
eaData.externalId = 2;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send explosionAreaCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -100,21 +101,21 @@ void TestExplosionAreaBulk::tryCreateExplosionArea()
|
||||
if (!m_ftc->explosionAreaModifyRequest(
|
||||
ExplosionAreaModifyRequest(
|
||||
0,
|
||||
eaData.name(),
|
||||
eaData.effectStart(),
|
||||
eaData.effectDuration(),
|
||||
eaData.effectSourceId(),
|
||||
eaData.chargeStruct().chargeTypeId(),
|
||||
eaData.area(),
|
||||
eaData.partyId(),
|
||||
eaData.participantId(),
|
||||
eaData.cannonCount(),
|
||||
eaData.cannonRounds(),
|
||||
eaData.fireRequestTime(),
|
||||
eaData.altitude(),
|
||||
eaData.purpose(),
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.externalId()
|
||||
eaData.name,
|
||||
eaData.effectStart,
|
||||
eaData.effectDuration,
|
||||
eaData.effectSourceId,
|
||||
eaData.chargeStruct.chargeTypeId,
|
||||
eaData.area,
|
||||
eaData.partyId,
|
||||
eaData.participantId,
|
||||
eaData.cannonCount,
|
||||
eaData.cannonRounds,
|
||||
eaData.fireRequestTime,
|
||||
eaData.altitude,
|
||||
eaData.purpose,
|
||||
eaData.effectMarkingInTa,
|
||||
eaData.externalId
|
||||
),
|
||||
this))
|
||||
{
|
||||
@@ -147,47 +148,47 @@ void TestExplosionAreaBulk::tryCreateExplosionArea()
|
||||
void TestExplosionAreaBulk::tryModifyExplosionArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "tryModifyExplosionArea start";
|
||||
m_eaData.name("af2");
|
||||
m_eaData.effectStart(m_eaData.effectStart.get() + 3000);
|
||||
m_eaData.effectDuration(9000); // 9 sec
|
||||
m_eaData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.165, 0.921), 50, 60, 70));
|
||||
m_eaData.partyId(3);
|
||||
m_eaData.participantId(1235);
|
||||
m_eaData.cannonCount(2);
|
||||
m_eaData.cannonRounds(2);
|
||||
m_eaData.effectMarkingInTa(true);
|
||||
m_eaData.name = "af2";
|
||||
m_eaData.effectStart = m_eaData.effectStart.get() + 3000;
|
||||
m_eaData.effectDuration = 9000; // 9 sec
|
||||
m_eaData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_eaData.area = AreaEffectSimulation::Area(Core::GeoPosition2D(0.165, 0.921), 50, 60, 70);
|
||||
m_eaData.partyId = 3;
|
||||
m_eaData.participantId = 1235;
|
||||
m_eaData.cannonCount = 2;
|
||||
m_eaData.cannonRounds = 2;
|
||||
m_eaData.effectMarkingInTa = true;
|
||||
|
||||
const AreaEffectSimulation::ExplosionArea eaData(m_eaData);
|
||||
m_eaData = AreaEffectSimulation::ExplosionArea();
|
||||
m_eaData.id(eaData.id());
|
||||
m_eaData.id = eaData.id;
|
||||
m_bIsCreatedRequest = false;
|
||||
|
||||
if (!m_ftc->explosionAreaModifyRequest(
|
||||
ExplosionAreaModifyRequest(
|
||||
eaData.id(),
|
||||
eaData.name(),
|
||||
eaData.effectStart(),
|
||||
eaData.effectDuration(),
|
||||
eaData.effectSourceId(),
|
||||
eaData.chargeStruct().chargeTypeId(),
|
||||
eaData.area(),
|
||||
eaData.partyId(),
|
||||
eaData.participantId(),
|
||||
eaData.cannonCount(),
|
||||
eaData.cannonRounds(),
|
||||
eaData.fireRequestTime(),
|
||||
eaData.altitude(),
|
||||
eaData.purpose(),
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.externalId()),
|
||||
eaData.id,
|
||||
eaData.name,
|
||||
eaData.effectStart,
|
||||
eaData.effectDuration,
|
||||
eaData.effectSourceId,
|
||||
eaData.chargeStruct.chargeTypeId,
|
||||
eaData.area,
|
||||
eaData.partyId,
|
||||
eaData.participantId,
|
||||
eaData.cannonCount,
|
||||
eaData.cannonRounds,
|
||||
eaData.fireRequestTime,
|
||||
eaData.altitude,
|
||||
eaData.purpose,
|
||||
eaData.effectMarkingInTa,
|
||||
eaData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_eaData.chargeStruct().chargeTypeId() == s_ChargeTypeId2; }))
|
||||
if (!waitForData([this]() { return m_eaData.chargeStruct.chargeTypeId == s_ChargeTypeId2; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating area explosion object";
|
||||
failExit();
|
||||
@@ -208,9 +209,9 @@ void TestExplosionAreaBulk::tryWaitForActivationExplosionArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "tryWaitForActivationExplosionArea start";
|
||||
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Effect State = " << m_eaData.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "Effect State = " << m_eaData.effectStateId;
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
return;
|
||||
@@ -227,7 +228,7 @@ void TestExplosionAreaBulk::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = true;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
true,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -249,7 +250,7 @@ void TestExplosionAreaBulk::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = false;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
false,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -260,7 +261,7 @@ void TestExplosionAreaBulk::tryPauseResumeExplosionArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsPaused; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsPaused; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for pause of area explosion";
|
||||
failExit();
|
||||
@@ -272,7 +273,7 @@ void TestExplosionAreaBulk::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = true;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
false,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -294,7 +295,7 @@ void TestExplosionAreaBulk::tryPauseResumeExplosionArea()
|
||||
m_bExpectedFailure = false;
|
||||
if (!m_ftc->explosionAreaPauseResumeRequest(
|
||||
ExplosionAreaPauseResumeRequest(
|
||||
m_eaData.id(),
|
||||
m_eaData.id,
|
||||
true,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -305,7 +306,7 @@ void TestExplosionAreaBulk::tryPauseResumeExplosionArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
@@ -320,7 +321,7 @@ void TestExplosionAreaBulk::checkTriggeredExplosions()
|
||||
INFO_LOG(m_logger) << "checkTriggeredExplosions start";
|
||||
|
||||
// first we should wait for Activation
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
@@ -334,7 +335,7 @@ void TestExplosionAreaBulk::checkTriggeredExplosions()
|
||||
checkTriggeredExplosionsHelper(0x00); // 0b00000000
|
||||
|
||||
// last step: wait for expiry
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
if (!waitForData([this]() { return m_eaData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for expiring of area explosion";
|
||||
failExit();
|
||||
@@ -350,7 +351,7 @@ void TestExplosionAreaBulk::checkTriggeredExplosionsHelper(int bitfield)
|
||||
// since we've 9 seconds duration and the first hit is at 0, every 2.5sec should be a new TriggeredExplosions telegram
|
||||
QElapsedTimer et;
|
||||
et.start();
|
||||
if (!waitForData([this, bitfield]() { return m_tiData.bitfield()[0] == bitfield; }))
|
||||
if (!waitForData([this, bitfield]() { return m_tiData.bitfield[0] == bitfield; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for triggered explosison telegram with bitfield 0x" << QByteArray::number(bitfield, 16);
|
||||
failExit();
|
||||
@@ -367,18 +368,18 @@ void TestExplosionAreaBulk::checkTriggeredExplosionsHelper(int bitfield)
|
||||
|
||||
void TestExplosionAreaBulk::explosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType)
|
||||
{
|
||||
if (m_eaData.id() == -1)
|
||||
if (m_eaData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_eaData);
|
||||
}
|
||||
|
||||
void TestExplosionAreaBulk::triggeredImpactsChanged(const AreaEffectSimulation::TriggeredImpacts &data, DataModification modType)
|
||||
{
|
||||
if (m_eaData.id() != data.aesItemId() || modType == DataModification::eRemoved)
|
||||
if (m_eaData.id != data.aesItemId || modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
if (data.bitfield().size() > 0)
|
||||
INFO_LOG(m_logger) << "Got TriggeredImpacts data - bitfield[0] = 0x" << QByteArray::number(static_cast<int>(data.bitfield()[0]), 16);
|
||||
if (data.bitfield.size() > 0)
|
||||
INFO_LOG(m_logger) << "Got TriggeredImpacts data - bitfield[0] = 0x" << QByteArray::number(static_cast<int>(data.bitfield[0]), 16);
|
||||
m_tiData = data;
|
||||
}
|
||||
|
||||
|
||||
+40
-39
@@ -10,6 +10,7 @@
|
||||
#include <ProjectDataManagement/pdm.hpp>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include <QTest>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
@@ -33,7 +34,7 @@ bool TestExplosionCluster::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataExplosionCluster();
|
||||
m_ecData.id(-1);
|
||||
m_ecData.id = -1;
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionClusterChanged,
|
||||
this, &TestExplosionCluster::explosionClusterChanged);
|
||||
@@ -49,9 +50,9 @@ bool TestExplosionCluster::checkBaseData(const AreaEffectSimulation::ExplosionCl
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.area() != b.area())
|
||||
if (a.area != b.area)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "area does not match: " << a.area() << " - " << b.area();
|
||||
WARNING_LOG(m_logger) << "area does not match: " << a.area << " - " << b.area;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -64,17 +65,17 @@ void TestExplosionCluster::tryCreateExplosionCluster()
|
||||
INFO_LOG(m_logger) << "tryCreateExplosionCluster start";
|
||||
m_ecData = AreaEffectSimulation::ExplosionCluster();
|
||||
AreaEffectSimulation::ExplosionCluster eaData;
|
||||
eaData.id(0);
|
||||
eaData.id = 0;
|
||||
|
||||
eaData.effectStart((time(nullptr) + 30) * 1000); // msec
|
||||
eaData.effectStart = (time(nullptr) + 30) * 1000; // msec
|
||||
|
||||
QString name(QStringLiteral("ec__"));
|
||||
name += QString::number(eaData.effectStart.get());
|
||||
eaData.name(name.toStdString());
|
||||
eaData.name = name.toStdString();
|
||||
|
||||
eaData.effectDuration(10000); // 10 seconds
|
||||
eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact);
|
||||
eaData.effectDuration = 10000; // 10 seconds
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
|
||||
// 32 U MD 93860 79903 -> 0.155484041, 0.92622146
|
||||
// eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.202560, 0.91611), 200, 50, 20)); // width, height, rotation
|
||||
@@ -83,14 +84,14 @@ void TestExplosionCluster::tryCreateExplosionCluster()
|
||||
// eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.202564, 0.916112), 200, 50, 20)); // width, height, rotation
|
||||
// eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.202562, 0.916115), 200, 50, 20)); // width, height, rotation
|
||||
|
||||
eaData.area(AreaEffectSimulation::Area(Core::GeoPosition2D(0.202562, 0.916114), 30, 20, 20)); // width, height, rotation
|
||||
eaData.mhPoints({{0.2025611, 0.9161111}, {0.2025611, 0.9161111}, {0.2025611, 0.9161111}}); // 3
|
||||
eaData.area = AreaEffectSimulation::Area(Core::GeoPosition2D(0.202562, 0.916114), 30, 20, 20); // width, height, rotation
|
||||
eaData.mhPoints = {{0.2025611, 0.9161111}, {0.2025611, 0.9161111}, {0.2025611, 0.9161111}}; // 3
|
||||
|
||||
|
||||
eaData.partyId(3);
|
||||
eaData.participantId(5);
|
||||
eaData.partyId = 3;
|
||||
eaData.participantId = 5;
|
||||
|
||||
eaData.externalId(0);
|
||||
eaData.externalId = 0;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send explosionClusterCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -108,15 +109,15 @@ void TestExplosionCluster::tryCreateExplosionCluster()
|
||||
if (!m_ftc->explosionClusterModifyRequest(
|
||||
ExplosionClusterModifyRequest(
|
||||
0,
|
||||
eaData.name(),
|
||||
eaData.element(),
|
||||
eaData.effectStart(),
|
||||
eaData.effectDuration(),
|
||||
eaData.effectSourceId(),
|
||||
eaData.area(),
|
||||
eaData.name,
|
||||
eaData.element,
|
||||
eaData.effectStart,
|
||||
eaData.effectDuration,
|
||||
eaData.effectSourceId,
|
||||
eaData.area,
|
||||
AreaEffectSimulation::AesExplosionGeometry::EgArea,
|
||||
0, // zog
|
||||
eaData.mhPoints().size(), // mhpCount;
|
||||
eaData.mhPoints.size(), // mhpCount;
|
||||
dds::core::optional<double>(), // mhpRotation for ExplosionClusterOcModify only
|
||||
3, // impactCount
|
||||
{ 12345, // eaData.chargeTypeId(),
|
||||
@@ -127,10 +128,10 @@ void TestExplosionCluster::tryCreateExplosionCluster()
|
||||
// 25, // firing_elevation_angle
|
||||
123, // peakHeight,
|
||||
10 * 1000, // flightDuration [msec],
|
||||
eaData.partyId(),
|
||||
eaData.participantId(),
|
||||
eaData.partyId,
|
||||
eaData.participantId,
|
||||
{}, // esmParticipantIds
|
||||
eaData.externalId(),
|
||||
eaData.externalId,
|
||||
-1, // eaData.launchVelocity(),
|
||||
-1, // eaData.launchAngleDeg(),
|
||||
-1, // eaData.dropAngle(),
|
||||
@@ -138,7 +139,7 @@ void TestExplosionCluster::tryCreateExplosionCluster()
|
||||
-1, // eaData.lcAttack(), // fka lcPrf
|
||||
-1, // eaData.lcTermination(),
|
||||
-1, // eaData.cloudBase(), // Wolkenuntergrenze
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.effectMarkingInTa,
|
||||
properties),
|
||||
this))
|
||||
{
|
||||
@@ -278,9 +279,9 @@ void TestExplosionCluster::tryWaitForActivationExplosionCluster()
|
||||
{
|
||||
INFO_LOG(m_logger) << "tryWaitForActivationExplosionCluster start";
|
||||
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Effect State = " << m_ecData.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "Effect State = " << m_ecData.effectStateId;
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
return;
|
||||
@@ -297,7 +298,7 @@ void TestExplosionCluster::tryPauseResumeExplosionCluster()
|
||||
m_bExpectedFailure = true;
|
||||
if (!m_ftc->explosionClusterPauseResumeRequest(
|
||||
ExplosionClusterPauseResumeRequest(
|
||||
m_ecData.id(),
|
||||
m_ecData.id,
|
||||
true,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -319,7 +320,7 @@ void TestExplosionCluster::tryPauseResumeExplosionCluster()
|
||||
m_bExpectedFailure = false;
|
||||
if (!m_ftc->explosionClusterPauseResumeRequest(
|
||||
ExplosionClusterPauseResumeRequest(
|
||||
m_ecData.id(),
|
||||
m_ecData.id,
|
||||
false,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -330,7 +331,7 @@ void TestExplosionCluster::tryPauseResumeExplosionCluster()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId() == AreaEffectSimulation::AesEffectState::EsPaused; }))
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId == AreaEffectSimulation::AesEffectState::EsPaused; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for pause of area explosion";
|
||||
failExit();
|
||||
@@ -342,7 +343,7 @@ void TestExplosionCluster::tryPauseResumeExplosionCluster()
|
||||
m_bExpectedFailure = true;
|
||||
if (!m_ftc->explosionClusterPauseResumeRequest(
|
||||
ExplosionClusterPauseResumeRequest(
|
||||
m_ecData.id(),
|
||||
m_ecData.id,
|
||||
false,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -364,7 +365,7 @@ void TestExplosionCluster::tryPauseResumeExplosionCluster()
|
||||
m_bExpectedFailure = false;
|
||||
if (!m_ftc->explosionClusterPauseResumeRequest(
|
||||
ExplosionClusterPauseResumeRequest(
|
||||
m_ecData.id(),
|
||||
m_ecData.id,
|
||||
true,
|
||||
dds::core::optional<rti::core::int64>(),
|
||||
dds::core::optional<int32_t>(),
|
||||
@@ -375,7 +376,7 @@ void TestExplosionCluster::tryPauseResumeExplosionCluster()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
@@ -390,7 +391,7 @@ void TestExplosionCluster::checkTriggeredExplosions()
|
||||
INFO_LOG(m_logger) << "checkTriggeredExplosions start";
|
||||
|
||||
// first we should wait for Activation
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for activation of area explosion";
|
||||
failExit();
|
||||
@@ -404,7 +405,7 @@ void TestExplosionCluster::checkTriggeredExplosions()
|
||||
checkTriggeredExplosionsHelper(0x00); // 0b00000000
|
||||
|
||||
// last step: wait for expiry
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
if (!waitForData([this]() { return m_ecData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for expiring of area explosion";
|
||||
failExit();
|
||||
@@ -420,7 +421,7 @@ void TestExplosionCluster::checkTriggeredExplosionsHelper(int bitfield)
|
||||
// since we've 9 seconds duration and the first hit is at 0, every 2.5sec should be a new TriggeredExplosions telegram
|
||||
QElapsedTimer et;
|
||||
et.start();
|
||||
if (!waitForData([this, bitfield]() { return m_tiData.bitfield()[0] == bitfield; }))
|
||||
if (!waitForData([this, bitfield]() { return m_tiData.bitfield[0] == bitfield; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while waiting for triggered explosison telegram with bitfield 0x" << QByteArray::number(bitfield, 16);
|
||||
failExit();
|
||||
@@ -437,16 +438,16 @@ void TestExplosionCluster::checkTriggeredExplosionsHelper(int bitfield)
|
||||
|
||||
void TestExplosionCluster::explosionClusterChanged(const AreaEffectSimulation::ExplosionCluster &data, DataModification modType)
|
||||
{
|
||||
if (m_ecData.id() == -1)
|
||||
if (m_ecData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_ecData);
|
||||
}
|
||||
|
||||
void TestExplosionCluster::triggeredImpactsChanged(const AreaEffectSimulation::TriggeredImpacts &data, DataModification modType)
|
||||
{
|
||||
if (m_ecData.id() != data.aesItemId() || modType == DataModification::eRemoved)
|
||||
if (m_ecData.id != data.aesItemId || modType == DataModification::eRemoved)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "Got TriggeredImpacts data - bitfield[0] = 0x" << QByteArray::number(static_cast<int>(data.bitfield()[0]), 16);
|
||||
INFO_LOG(m_logger) << "Got TriggeredImpacts data - bitfield[0] = 0x" << QByteArray::number(static_cast<int>(data.bitfield[0]), 16);
|
||||
m_tiData = data;
|
||||
}
|
||||
|
||||
|
||||
+87
-87
@@ -28,7 +28,7 @@ bool TestExplosionSingle::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataExplosionSingle();
|
||||
m_esData.id(-1);
|
||||
m_esData.id = -1;
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionSingleChanged,
|
||||
this, &TestExplosionSingle::explosionSingleChanged);
|
||||
@@ -42,9 +42,9 @@ bool TestExplosionSingle::checkBaseData(const AreaEffectSimulation::ExplosionSin
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.impactPosition() != b.impactPosition())
|
||||
if (a.impactPosition != b.impactPosition)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition() << " - " << b.impactPosition();
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition << " - " << b.impactPosition;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -57,15 +57,15 @@ void TestExplosionSingle::tryCreateExplosionSingle()
|
||||
{
|
||||
m_esData = AreaEffectSimulation::ExplosionSingle();
|
||||
AreaEffectSimulation::ExplosionSingle esData;
|
||||
esData.id(0);
|
||||
esData.name("chris");
|
||||
esData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
esData.chargeStruct().chargeTypeId(345863487);
|
||||
esData.impactPosition(Core::GeoPosition2D(0.16, 0.92));
|
||||
esData.partyId(7);
|
||||
esData.participantId(1234);
|
||||
esData.externalId(1);
|
||||
esData.effectMarkingInTa(false);
|
||||
esData.id = 0;
|
||||
esData.name = "chris";
|
||||
esData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
esData.chargeStruct.chargeTypeId = 345863487;
|
||||
esData.impactPosition = Core::GeoPosition2D(0.16, 0.92);
|
||||
esData.partyId = 7;
|
||||
esData.participantId = 1234;
|
||||
esData.externalId = 1;
|
||||
esData.effectMarkingInTa = false;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send explosionSingleCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -74,18 +74,18 @@ void TestExplosionSingle::tryCreateExplosionSingle()
|
||||
if (!m_ftc->explosionSingleModifyRequest(
|
||||
ExplosionSingleModifyRequest(
|
||||
0,
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectSourceId(),
|
||||
esData.chargeStruct().chargeTypeId(),
|
||||
esData.impactPosition(),
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.fireRequestTime(),
|
||||
esData.altitude(),
|
||||
esData.purpose(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.externalId()),
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectSourceId,
|
||||
esData.chargeStruct.chargeTypeId,
|
||||
esData.impactPosition,
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.fireRequestTime,
|
||||
esData.altitude,
|
||||
esData.purpose,
|
||||
esData.effectMarkingInTa,
|
||||
esData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during explosionSingleCreateRequest()";
|
||||
@@ -102,24 +102,24 @@ void TestExplosionSingle::tryCreateExplosionSingle()
|
||||
m_bExpectedFailure = false;
|
||||
m_expectedAesId = -1;
|
||||
|
||||
esData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
esData.partyId(2);
|
||||
esData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
esData.partyId = 2;
|
||||
m_bIsCreatedRequest = true;
|
||||
if (!m_ftc->explosionSingleModifyRequest(
|
||||
ExplosionSingleModifyRequest(
|
||||
0,
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectSourceId(),
|
||||
esData.chargeStruct().chargeTypeId(),
|
||||
esData.impactPosition(),
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.fireRequestTime(),
|
||||
esData.altitude(),
|
||||
esData.purpose(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.externalId()),
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectSourceId,
|
||||
esData.chargeStruct.chargeTypeId,
|
||||
esData.impactPosition,
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.fireRequestTime,
|
||||
esData.altitude,
|
||||
esData.purpose,
|
||||
esData.effectMarkingInTa,
|
||||
esData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during explosionSingleCreateRequest()";
|
||||
@@ -127,7 +127,7 @@ void TestExplosionSingle::tryCreateExplosionSingle()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_esData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_esData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating single explosion object";
|
||||
failExit();
|
||||
@@ -146,39 +146,39 @@ void TestExplosionSingle::tryCreateExplosionSingle()
|
||||
void TestExplosionSingle::tryModifyExplosionSingle()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_esData.name("chris2");
|
||||
m_esData.effectStart(m_esData.effectStart.get() + 2000);
|
||||
m_esData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_esData.impactPosition(Core::GeoPosition2D(0.17, 0.93));
|
||||
m_esData.partyId(3);
|
||||
m_esData.participantId(1235);
|
||||
m_esData.name = "chris2";
|
||||
m_esData.effectStart = m_esData.effectStart.get() + 2000;
|
||||
m_esData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_esData.impactPosition = Core::GeoPosition2D(0.17, 0.93);
|
||||
m_esData.partyId = 3;
|
||||
m_esData.participantId = 1235;
|
||||
const AreaEffectSimulation::ExplosionSingle esData(m_esData);
|
||||
m_esData = AreaEffectSimulation::ExplosionSingle();
|
||||
m_esData.id(esData.id());
|
||||
m_esData.id = esData.id;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->explosionSingleModifyRequest(
|
||||
ExplosionSingleModifyRequest(
|
||||
esData.id(),
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectSourceId(),
|
||||
esData.chargeStruct().chargeTypeId(),
|
||||
esData.impactPosition(),
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.fireRequestTime(),
|
||||
esData.altitude(),
|
||||
esData.purpose(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.externalId()),
|
||||
esData.id,
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectSourceId,
|
||||
esData.chargeStruct.chargeTypeId,
|
||||
esData.impactPosition,
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.fireRequestTime,
|
||||
esData.altitude,
|
||||
esData.purpose,
|
||||
esData.effectMarkingInTa,
|
||||
esData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_esData.chargeStruct().chargeTypeId() == s_ChargeTypeId2;}))
|
||||
if (!waitForData([this]() { return m_esData.chargeStruct.chargeTypeId == s_ChargeTypeId2;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating single explosion object";
|
||||
failExit();
|
||||
@@ -198,9 +198,9 @@ void TestExplosionSingle::waitExpireExplosionSingle()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until explosion single expires";
|
||||
|
||||
if (!waitForData([this]() { return m_esData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_esData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of explosion single with id " << m_esData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of explosion single with id " << m_esData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void TestExplosionSingle::waitExpireExplosionSingle()
|
||||
|
||||
void TestExplosionSingle::explosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType)
|
||||
{
|
||||
if (m_esData.id() == -1)
|
||||
if (m_esData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_esData);
|
||||
}
|
||||
@@ -247,15 +247,15 @@ void TestExplosionSingleTestVWM::tryCreateExplosionSingleVWM(const std::string &
|
||||
<< " position = " << position;
|
||||
m_esData = AreaEffectSimulation::ExplosionSingle();
|
||||
AreaEffectSimulation::ExplosionSingle esData;
|
||||
esData.id(0);
|
||||
esData.name(esName);
|
||||
esData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
esData.chargeStruct().chargeTypeId(ammoId);
|
||||
esData.impactPosition(position);
|
||||
esData.partyId(3); // 3 -> blau
|
||||
esData.participantId(1234);
|
||||
esData.externalId(1);
|
||||
esData.effectMarkingInTa(false);
|
||||
esData.id = 0;
|
||||
esData.name = esName;
|
||||
esData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
esData.chargeStruct.chargeTypeId = ammoId;
|
||||
esData.impactPosition = position;
|
||||
esData.partyId = 3; // 3 -> blau
|
||||
esData.participantId = 1234;
|
||||
esData.externalId = 1;
|
||||
esData.effectMarkingInTa = false;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send explosionSingleCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -267,18 +267,18 @@ void TestExplosionSingleTestVWM::tryCreateExplosionSingleVWM(const std::string &
|
||||
if (!m_ftc->explosionSingleModifyRequest(
|
||||
ExplosionSingleModifyRequest(
|
||||
0,
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectSourceId(),
|
||||
esData.chargeStruct().chargeTypeId(),
|
||||
esData.impactPosition(),
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.fireRequestTime(),
|
||||
esData.altitude(),
|
||||
esData.purpose(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.externalId()),
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectSourceId,
|
||||
esData.chargeStruct.chargeTypeId,
|
||||
esData.impactPosition,
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.fireRequestTime,
|
||||
esData.altitude,
|
||||
esData.purpose,
|
||||
esData.effectMarkingInTa,
|
||||
esData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during explosionSingleCreateRequest()";
|
||||
@@ -287,7 +287,7 @@ void TestExplosionSingleTestVWM::tryCreateExplosionSingleVWM(const std::string &
|
||||
}
|
||||
|
||||
// TestBase::onAesCreateReply should update m_expectedAesId:
|
||||
if (!waitForData([this]() { return m_esData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_esData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating single explosion object (try with error)";
|
||||
}
|
||||
@@ -330,9 +330,9 @@ int main(int argc, char **argv)
|
||||
if (strcmp(argv[i], "ammoId") == 0)
|
||||
ammoId = atoi(argv[i+1]);
|
||||
if (strcmp(argv[i], "x") == 0)
|
||||
position.lon(atof(argv[i+1]));
|
||||
position.lon = atof(argv[i+1]);
|
||||
if (strcmp(argv[i], "y") == 0)
|
||||
position.lat(atof(argv[i+1]));
|
||||
position.lat = atof(argv[i+1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -26,7 +26,7 @@ bool TestGasPipe::init(int domainId, int exerciseId, int testId)
|
||||
tryCreateGasPipe();
|
||||
|
||||
m_dtc->waitForHistoricalDataGasPipe();
|
||||
m_esData.id(-1);
|
||||
m_esData.id = -1;
|
||||
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::gasPipeChanged,
|
||||
this, &TestGasPipe::gasPipeChanged);
|
||||
@@ -60,15 +60,15 @@ void TestGasPipe::tryCreateGasPipe()
|
||||
{
|
||||
AreaEffectSimulation::GasPipeModifyRequest gp;
|
||||
//AreaEffectSimulation::GasPipe gp;
|
||||
gp.id(0);
|
||||
gp.name("GasPipe");
|
||||
gp.partyId(1);
|
||||
gp.id = 0;
|
||||
gp.name = "GasPipe";
|
||||
gp.partyId = 1;
|
||||
|
||||
setPos(gp.segments(), m_refPos.geographic(3, 3));
|
||||
setPos(gp.segments(), m_refPos.geographic(4, 4));
|
||||
setPos(gp.segments(), m_refPos.geographic(5, 3));
|
||||
setPos(gp.segments, m_refPos.geographic(3, 3));
|
||||
setPos(gp.segments, m_refPos.geographic(4, 4));
|
||||
setPos(gp.segments, m_refPos.geographic(5, 3));
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " GasPipe created. id: " << gp.id();
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " GasPipe created. id: " << gp.id;
|
||||
DEBUG_LOG(m_logger) << "request GasPipe";
|
||||
if (!m_ftc->gasPipeModifyRequest( gp, this))
|
||||
{
|
||||
@@ -87,9 +87,9 @@ void TestGasPipe::waitExpireGasPipe()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until explosion single expires";
|
||||
|
||||
if (!waitForData([this]() { return m_esData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_esData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of explosion single with id " << m_esData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of explosion single with id " << m_esData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ void TestGasPipe::waitExpireGasPipe()
|
||||
|
||||
void TestGasPipe::gasPipeChanged(const AreaEffectSimulation::GasPipe &data, DataModification modType)
|
||||
{
|
||||
if (m_esData.id() == -1)
|
||||
if (m_esData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_esData);
|
||||
}
|
||||
|
||||
+140
-140
@@ -34,7 +34,7 @@ bool TestMineArea::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataMineArea();
|
||||
m_maData.id(-1);
|
||||
m_maData.id = -1;
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::mineAreaChanged, this, &TestMineArea::mineAreaChanged);
|
||||
|
||||
return true;
|
||||
@@ -46,7 +46,7 @@ void TestMineArea::startTest()
|
||||
m_referencedAesItemId = 0;
|
||||
for (const auto &ec : effectClusterList)
|
||||
{
|
||||
m_referencedAesItemId = ec.id();
|
||||
m_referencedAesItemId = ec.id;
|
||||
}
|
||||
|
||||
if (m_testId <= 0)
|
||||
@@ -78,11 +78,11 @@ bool TestMineArea::checkBaseData(const AreaEffectSimulation::MineArea &a, const
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < a.segments().size() && i < b.segments().size(); ++i)
|
||||
for (size_t i = 0; i < a.segments.size() && i < b.segments.size(); ++i)
|
||||
{
|
||||
if (a.segments()[i] != b.segments()[i])
|
||||
if (a.segments[i] != b.segments[i])
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.segments()[i] << " - " << b.segments()[i];
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.segments[i] << " - " << b.segments[i];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -97,17 +97,17 @@ void TestMineArea::tryCreateMineArea()
|
||||
ERROR_LOG(m_logger) << " >>>> create Mine Area...";
|
||||
m_maData = AreaEffectSimulation::MineArea();
|
||||
AreaEffectSimulation::MineArea esData;
|
||||
esData.id(0);
|
||||
esData.name("chris");
|
||||
esData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
esData.chargeStruct().chargeTypeId(345863487); // Todo: Is this intended?
|
||||
esData.effectDuration(400 * 1000);
|
||||
esData.density(0.2);
|
||||
esData.width(7.0);
|
||||
esData.partyId(7);
|
||||
esData.participantId(1234);
|
||||
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
|
||||
esData.isLaidHidden(true);
|
||||
esData.id = 0;
|
||||
esData.name = "chris";
|
||||
esData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
esData.chargeStruct.chargeTypeId = 345863487; // Todo: Is this intended?
|
||||
esData.effectDuration = 400 * 1000;
|
||||
esData.density = 0.2;
|
||||
esData.width = 7.0;
|
||||
esData.partyId = 7;
|
||||
esData.participantId = 1234;
|
||||
esData.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery;
|
||||
esData.isLaidHidden = true;
|
||||
|
||||
std::vector<Core::GeoPosition2D> segments;
|
||||
segments.emplace_back(Core::GeoPosition2D(0.17001, 0.93001));
|
||||
@@ -120,22 +120,22 @@ void TestMineArea::tryCreateMineArea()
|
||||
m_bExpectedFailure = true;
|
||||
m_bIsCreatedRequest = true;
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(0,
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectDuration(),
|
||||
esData.effectSourceId(),
|
||||
esData.density(),
|
||||
esData.width(),
|
||||
{esData.chargeStruct().chargeTypeId(), 0, 0},
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectDuration,
|
||||
esData.effectSourceId,
|
||||
esData.density,
|
||||
esData.width,
|
||||
{esData.chargeStruct.chargeTypeId, 0, 0},
|
||||
segments,
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.layingProcedureType(),
|
||||
esData.isLaidHidden(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.layingProcedureType,
|
||||
esData.isLaidHidden,
|
||||
esData.effectMarkingInTa,
|
||||
true,
|
||||
distance,
|
||||
esData.externalId(),
|
||||
esData.externalId,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -155,24 +155,24 @@ void TestMineArea::tryCreateMineArea()
|
||||
m_bExpectedFailure = false;
|
||||
m_expectedAesId = -1;
|
||||
m_bIsCreatedRequest = true;
|
||||
esData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(esData.id(),
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectDuration(),
|
||||
esData.effectSourceId(),
|
||||
esData.density(),
|
||||
esData.width(),
|
||||
{esData.chargeStruct().chargeTypeId(), 0, 0},
|
||||
esData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(esData.id,
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectDuration,
|
||||
esData.effectSourceId,
|
||||
esData.density,
|
||||
esData.width,
|
||||
{esData.chargeStruct.chargeTypeId, 0, 0},
|
||||
segments,
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.layingProcedureType(),
|
||||
esData.isLaidHidden(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.layingProcedureType,
|
||||
esData.isLaidHidden,
|
||||
esData.effectMarkingInTa,
|
||||
true,
|
||||
distance,
|
||||
esData.externalId(),
|
||||
esData.externalId,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -181,7 +181,7 @@ void TestMineArea::tryCreateMineArea()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_maData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_maData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating mine area object";
|
||||
failExit();
|
||||
@@ -232,9 +232,9 @@ void TestMineArea::testMineData_11()
|
||||
{
|
||||
MineData m;
|
||||
// auto dt = QDateTime::fromMSecsSinceEpoch(date.toMSecsSinceEpoch());
|
||||
m.appearenceTime(date.toMSecsSinceEpoch());
|
||||
m.armingTime(date.addDays(count).toMSecsSinceEpoch());
|
||||
m.position() = pos;
|
||||
m.appearenceTime = date.toMSecsSinceEpoch();
|
||||
m.armingTime = date.addDays(count).toMSecsSinceEpoch();
|
||||
m.position = pos;
|
||||
count += 6;
|
||||
mineData.push_back(m);
|
||||
}
|
||||
@@ -291,9 +291,9 @@ void TestMineArea::testAddMineData_11()
|
||||
{
|
||||
MineData m;
|
||||
// auto dt = QDateTime::fromMSecsSinceEpoch(date.toMSecsSinceEpoch());
|
||||
m.appearenceTime(date.toMSecsSinceEpoch());
|
||||
m.armingTime(date.addDays(count).toMSecsSinceEpoch());
|
||||
m.position() = pos;
|
||||
m.appearenceTime = date.toMSecsSinceEpoch();
|
||||
m.armingTime = date.addDays(count).toMSecsSinceEpoch();
|
||||
m.position = pos;
|
||||
count += 6;
|
||||
mineData.push_back(m);
|
||||
}
|
||||
@@ -338,9 +338,9 @@ void TestMineArea::testMineData_21()
|
||||
{
|
||||
MineData m;
|
||||
// auto dt = QDateTime::fromMSecsSinceEpoch(date.toMSecsSinceEpoch());
|
||||
m.appearenceTime(date.toMSecsSinceEpoch());
|
||||
m.armingTime(date.addDays(count).toMSecsSinceEpoch());
|
||||
m.position() = pos;
|
||||
m.appearenceTime = date.toMSecsSinceEpoch();
|
||||
m.armingTime = date.addDays(count).toMSecsSinceEpoch();
|
||||
m.position = pos;
|
||||
count += 6;
|
||||
mineData.push_back(m);
|
||||
}
|
||||
@@ -387,9 +387,9 @@ void TestMineArea::testAddMineData_21()
|
||||
{
|
||||
MineData m;
|
||||
// auto dt = QDateTime::fromMSecsSinceEpoch(date.toMSecsSinceEpoch());
|
||||
m.appearenceTime(date.toMSecsSinceEpoch());
|
||||
m.armingTime(date.addDays(count).toMSecsSinceEpoch());
|
||||
m.position() = pos;
|
||||
m.appearenceTime = date.toMSecsSinceEpoch();
|
||||
m.armingTime = date.addDays(count).toMSecsSinceEpoch();
|
||||
m.position = pos;
|
||||
count += 6;
|
||||
mineData.push_back(m);
|
||||
}
|
||||
@@ -432,20 +432,20 @@ void TestMineArea::setSegmentForTesMineData()
|
||||
void TestMineArea::tryModifyMineArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_maData.name("chris2");
|
||||
m_maData.effectStart(m_maData.effectStart.get() + 2000);
|
||||
m_maData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_maData.effectDuration(4 * 1000);
|
||||
m_maData.density(0.2);
|
||||
m_maData.width(7.0);
|
||||
m_maData.partyId(8);
|
||||
m_maData.participantId(1235);
|
||||
m_maData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
|
||||
m_maData.isLaidHidden(false);
|
||||
m_maData.name = "chris2";
|
||||
m_maData.effectStart = m_maData.effectStart.get() + 2000;
|
||||
m_maData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_maData.effectDuration = 4 * 1000;
|
||||
m_maData.density = 0.2;
|
||||
m_maData.width = 7.0;
|
||||
m_maData.partyId = 8;
|
||||
m_maData.participantId = 1235;
|
||||
m_maData.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery;
|
||||
m_maData.isLaidHidden = false;
|
||||
const AreaEffectSimulation::MineArea esData(m_maData);
|
||||
m_maData = AreaEffectSimulation::MineArea();
|
||||
m_maData.id(esData.id());
|
||||
m_maData.effectMarkingInTa(true);
|
||||
m_maData.id = esData.id;
|
||||
m_maData.effectMarkingInTa = true;
|
||||
|
||||
std::vector<Core::GeoPosition2D> segments;
|
||||
segments.emplace_back(Core::GeoPosition2D(0.17004, 0.93004));
|
||||
@@ -454,23 +454,23 @@ void TestMineArea::tryModifyMineArea()
|
||||
const double distance = 100.0;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(esData.id(),
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectDuration(),
|
||||
esData.effectSourceId(),
|
||||
esData.density(),
|
||||
esData.width(),
|
||||
{esData.chargeStruct().chargeTypeId(), 0, 0},
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(esData.id,
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectDuration,
|
||||
esData.effectSourceId,
|
||||
esData.density,
|
||||
esData.width,
|
||||
{esData.chargeStruct.chargeTypeId, 0, 0},
|
||||
segments,
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.layingProcedureType(),
|
||||
esData.isLaidHidden(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.layingProcedureType,
|
||||
esData.isLaidHidden,
|
||||
esData.effectMarkingInTa,
|
||||
true,
|
||||
distance,
|
||||
esData.externalId(),
|
||||
esData.externalId,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -478,7 +478,7 @@ void TestMineArea::tryModifyMineArea()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_maData.chargeStruct().chargeTypeId() == s_ChargeTypeId2; }))
|
||||
if (!waitForData([this]() { return m_maData.chargeStruct.chargeTypeId == s_ChargeTypeId2; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating mine area object";
|
||||
failExit();
|
||||
@@ -502,17 +502,17 @@ void TestMineArea::tryCreateAnotherMineArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to create another area request";
|
||||
AreaEffectSimulation::MineArea esData;
|
||||
esData.id(0);
|
||||
esData.name("chris");
|
||||
esData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
esData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
esData.effectDuration(4 * 1000);
|
||||
esData.density(0.2);
|
||||
esData.width(7.0);
|
||||
esData.partyId(7);
|
||||
esData.participantId(1234);
|
||||
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
|
||||
esData.isLaidHidden(false);
|
||||
esData.id = 0;
|
||||
esData.name = "chris";
|
||||
esData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
esData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
esData.effectDuration = 4 * 1000;
|
||||
esData.density = 0.2;
|
||||
esData.width = 7.0;
|
||||
esData.partyId = 7;
|
||||
esData.participantId = 1234;
|
||||
esData.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery;
|
||||
esData.isLaidHidden = false;
|
||||
|
||||
std::vector<Core::GeoPosition2D> segments;
|
||||
segments.emplace_back(Core::GeoPosition2D(0.17004, 0.93004));
|
||||
@@ -524,22 +524,22 @@ void TestMineArea::tryCreateAnotherMineArea()
|
||||
m_replyError = true;
|
||||
m_bIsCreatedRequest = true;
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(0,
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectDuration(),
|
||||
esData.effectSourceId(),
|
||||
esData.density(),
|
||||
esData.width(),
|
||||
{esData.chargeStruct().chargeTypeId(), 0, 0},
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectDuration,
|
||||
esData.effectSourceId,
|
||||
esData.density,
|
||||
esData.width,
|
||||
{esData.chargeStruct.chargeTypeId, 0, 0},
|
||||
segments,
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.layingProcedureType(),
|
||||
esData.isLaidHidden(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.layingProcedureType,
|
||||
esData.isLaidHidden,
|
||||
esData.effectMarkingInTa,
|
||||
true,
|
||||
distance,
|
||||
esData.externalId(),
|
||||
esData.externalId,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -562,17 +562,17 @@ void TestMineArea::tryCreateMineArea2(int chargeTypeId, double density)
|
||||
{
|
||||
m_maData = AreaEffectSimulation::MineArea();
|
||||
AreaEffectSimulation::MineArea esData;
|
||||
esData.id(0);
|
||||
esData.name("1337Test");
|
||||
esData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
esData.chargeStruct().chargeTypeId(chargeTypeId);
|
||||
esData.effectDuration(400 * 1000);
|
||||
esData.density(density);
|
||||
esData.width(7.0);
|
||||
esData.partyId(7);
|
||||
esData.participantId(1234);
|
||||
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
|
||||
esData.isLaidHidden(false);
|
||||
esData.id = 0;
|
||||
esData.name = "1337Test";
|
||||
esData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
esData.chargeStruct.chargeTypeId = chargeTypeId;
|
||||
esData.effectDuration = 400 * 1000;
|
||||
esData.density = density;
|
||||
esData.width = 7.0;
|
||||
esData.partyId = 7;
|
||||
esData.participantId = 1234;
|
||||
esData.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery;
|
||||
esData.isLaidHidden = false;
|
||||
|
||||
std::vector<Core::GeoPosition2D> segments;
|
||||
/* Erzeugung der GeoKoordinaten fuer den guez-spezifischen zentralen Bereich (Sueden)
|
||||
@@ -603,22 +603,22 @@ void TestMineArea::tryCreateMineArea2(int chargeTypeId, double density)
|
||||
m_bExpectedFailure = false;
|
||||
m_bIsCreatedRequest = true;
|
||||
if (!m_ftc->mineAreaModifyRequest(MineAreaModifyRequest(0,
|
||||
esData.name(),
|
||||
esData.effectStart(),
|
||||
esData.effectDuration(),
|
||||
esData.effectSourceId(),
|
||||
esData.density(),
|
||||
esData.width(),
|
||||
{esData.chargeStruct().chargeTypeId(), 0, 0},
|
||||
esData.name,
|
||||
esData.effectStart,
|
||||
esData.effectDuration,
|
||||
esData.effectSourceId,
|
||||
esData.density,
|
||||
esData.width,
|
||||
{esData.chargeStruct.chargeTypeId, 0, 0},
|
||||
segments,
|
||||
esData.partyId(),
|
||||
esData.participantId(),
|
||||
esData.layingProcedureType(),
|
||||
esData.isLaidHidden(),
|
||||
esData.effectMarkingInTa(),
|
||||
esData.partyId,
|
||||
esData.participantId,
|
||||
esData.layingProcedureType,
|
||||
esData.isLaidHidden,
|
||||
esData.effectMarkingInTa,
|
||||
true,
|
||||
distance,
|
||||
esData.externalId(),
|
||||
esData.externalId,
|
||||
true),
|
||||
this))
|
||||
{
|
||||
@@ -638,14 +638,14 @@ void TestMineArea::tryCreateMineArea2(int chargeTypeId, double density)
|
||||
void TestMineArea::tryTriggerDusMineInBoth()
|
||||
{
|
||||
AreaEffectSimulation::MineTriggeredRequest mtr;
|
||||
mtr.mineAreaId(0); // DUS does not send mine area ID!
|
||||
mtr.mineId(123);
|
||||
mtr.position(Core::GeoPosition2D(0.170041, 0.930041));
|
||||
mtr.chargeTypeId(48);
|
||||
mtr.mineAreaId = 0; // DUS does not send mine area ID!
|
||||
mtr.mineId = 123;
|
||||
mtr.position = Core::GeoPosition2D(0.170041, 0.930041);
|
||||
mtr.chargeTypeId = 48;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send mineTriggeredRequest()";
|
||||
m_replyError = true;
|
||||
if (!m_ftc->mineTriggeredRequest(MineTriggeredRequest(mtr.mineAreaId(), mtr.mineId(), mtr.position.get(), mtr.chargeTypeId.get()), this))
|
||||
if (!m_ftc->mineTriggeredRequest(MineTriggeredRequest(mtr.mineAreaId, mtr.mineId, mtr.position.get(), mtr.chargeTypeId.get()), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during mineTriggeredRequest()";
|
||||
failExit();
|
||||
@@ -667,9 +667,9 @@ void TestMineArea::waitExpireMineArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until mine area expires";
|
||||
|
||||
if (!waitForData([this]() { return m_maData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
if (!waitForData([this]() { return m_maData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of mine area with id " << m_maData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of mine area with id " << m_maData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -680,7 +680,7 @@ void TestMineArea::waitExpireMineArea()
|
||||
|
||||
void TestMineArea::mineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType)
|
||||
{
|
||||
if (m_maData.id() == -1)
|
||||
if (m_maData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_maData);
|
||||
}
|
||||
|
||||
+103
-103
@@ -26,7 +26,7 @@ bool TestNContamination::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataNContamination();
|
||||
m_ncData.id(-1);
|
||||
m_ncData.id = -1;
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::nContaminationChanged,
|
||||
this, &TestNContamination::nContaminationChanged);
|
||||
|
||||
@@ -39,9 +39,9 @@ bool TestNContamination::checkBaseData(const AreaEffectSimulation::NContaminatio
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.impactPosition() != b.impactPosition())
|
||||
if (a.impactPosition != b.impactPosition)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition() << " - " << b.impactPosition();
|
||||
WARNING_LOG(m_logger) << "impactPosition does not match: " << a.impactPosition << " - " << b.impactPosition;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -54,20 +54,20 @@ void TestNContamination::tryCreateNContamination()
|
||||
{
|
||||
m_ncData = AreaEffectSimulation::NContamination();
|
||||
AreaEffectSimulation::NContamination ncData;
|
||||
ncData.id(0);
|
||||
ncData.name("ncont1");
|
||||
ncData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
ncData.effectDuration(10000); // 10 sec
|
||||
ncData.chargeStruct().chargeTypeId(345863487);
|
||||
ncData.impactPosition(Core::GeoPosition2D(0.16, 0.92));
|
||||
ncData.borderLengthInner(1000); // 1km
|
||||
ncData.borderLengthOuter(2000); // 2km
|
||||
ncData.impactRadius(500); // 500m
|
||||
ncData.spanAngle(31);
|
||||
ncData.rotationAngle(57);
|
||||
ncData.detonationValue(1000); // kt, only cosmetical
|
||||
ncData.partyId(7);
|
||||
ncData.participantId(1234);
|
||||
ncData.id = 0;
|
||||
ncData.name = "ncont1";
|
||||
ncData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
ncData.effectDuration = 10000; // 10 sec
|
||||
ncData.chargeStruct.chargeTypeId = 345863487;
|
||||
ncData.impactPosition = Core::GeoPosition2D(0.16, 0.92);
|
||||
ncData.borderLengthInner = 1000; // 1km
|
||||
ncData.borderLengthOuter = 2000; // 2km
|
||||
ncData.impactRadius = 500; // 500m
|
||||
ncData.spanAngle = 31;
|
||||
ncData.rotationAngle = 57;
|
||||
ncData.detonationValue = 1000; // kt, only cosmetical
|
||||
ncData.partyId = 7;
|
||||
ncData.participantId = 1234;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send NContaminationCreateRequest()";
|
||||
m_replyError = false;
|
||||
@@ -76,21 +76,21 @@ void TestNContamination::tryCreateNContamination()
|
||||
if (!m_ftc->nContaminationModifyRequest(
|
||||
NContaminationModifyRequest(
|
||||
0,
|
||||
ncData.name(),
|
||||
ncData.effectStart(),
|
||||
ncData.effectDuration(),
|
||||
ncData.chargeStruct().chargeTypeId(),
|
||||
ncData.impactPosition(),
|
||||
ncData.borderLengthInner(),
|
||||
ncData.borderLengthOuter(),
|
||||
ncData.impactRadius(),
|
||||
ncData.spanAngle(),
|
||||
ncData.rotationAngle(),
|
||||
ncData.detonationValue(),
|
||||
ncData.weatherSource(),
|
||||
ncData.partyId(),
|
||||
ncData.participantId(),
|
||||
ncData.externalId()),
|
||||
ncData.name,
|
||||
ncData.effectStart,
|
||||
ncData.effectDuration,
|
||||
ncData.chargeStruct.chargeTypeId,
|
||||
ncData.impactPosition,
|
||||
ncData.borderLengthInner,
|
||||
ncData.borderLengthOuter,
|
||||
ncData.impactRadius,
|
||||
ncData.spanAngle,
|
||||
ncData.rotationAngle,
|
||||
ncData.detonationValue,
|
||||
ncData.weatherSource,
|
||||
ncData.partyId,
|
||||
ncData.participantId,
|
||||
ncData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during NContaminationCreateRequest()";
|
||||
@@ -109,25 +109,25 @@ void TestNContamination::tryCreateNContamination()
|
||||
m_expectedAesId = -1;
|
||||
m_bIsCreatedRequest = true;
|
||||
// now with correct charge type
|
||||
ncData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
ncData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
if (!m_ftc->nContaminationModifyRequest(
|
||||
NContaminationModifyRequest(
|
||||
0,
|
||||
ncData.name(),
|
||||
ncData.effectStart(),
|
||||
ncData.effectDuration(),
|
||||
ncData.chargeStruct().chargeTypeId(),
|
||||
ncData.impactPosition(),
|
||||
ncData.borderLengthInner(),
|
||||
ncData.borderLengthOuter(),
|
||||
ncData.impactRadius(),
|
||||
ncData.spanAngle(),
|
||||
ncData.rotationAngle(),
|
||||
ncData.detonationValue(),
|
||||
ncData.weatherSource(),
|
||||
ncData.partyId(),
|
||||
ncData.participantId(),
|
||||
ncData.externalId()),
|
||||
ncData.name,
|
||||
ncData.effectStart,
|
||||
ncData.effectDuration,
|
||||
ncData.chargeStruct.chargeTypeId,
|
||||
ncData.impactPosition,
|
||||
ncData.borderLengthInner,
|
||||
ncData.borderLengthOuter,
|
||||
ncData.impactRadius,
|
||||
ncData.spanAngle,
|
||||
ncData.rotationAngle,
|
||||
ncData.detonationValue,
|
||||
ncData.weatherSource,
|
||||
ncData.partyId,
|
||||
ncData.participantId,
|
||||
ncData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during NContaminationCreateRequest()";
|
||||
@@ -135,7 +135,7 @@ void TestNContamination::tryCreateNContamination()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_ncData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_ncData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating ncontamination object";
|
||||
failExit();
|
||||
@@ -154,49 +154,49 @@ void TestNContamination::tryCreateNContamination()
|
||||
void TestNContamination::tryModifyNContamination()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_ncData.name("ncont2");
|
||||
m_ncData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
m_ncData.effectDuration(3000); // 3 sec
|
||||
m_ncData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
m_ncData.impactPosition(Core::GeoPosition2D(0.162, 0.925));
|
||||
m_ncData.borderLengthInner(1100); // 1.1km
|
||||
m_ncData.borderLengthOuter(1800); // 1.8km
|
||||
m_ncData.impactRadius(600); // 600m
|
||||
m_ncData.spanAngle(14);
|
||||
m_ncData.rotationAngle(187);
|
||||
m_ncData.detonationValue(2000); // kt, only cosmetical
|
||||
m_ncData.partyId(3);
|
||||
m_ncData.participantId(1235);
|
||||
m_ncData.name = "ncont2";
|
||||
m_ncData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
m_ncData.effectDuration = 3000; // 3 sec
|
||||
m_ncData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
m_ncData.impactPosition = Core::GeoPosition2D(0.162, 0.925);
|
||||
m_ncData.borderLengthInner = 1100; // 1.1km
|
||||
m_ncData.borderLengthOuter = 1800; // 1.8km
|
||||
m_ncData.impactRadius = 600; // 600m
|
||||
m_ncData.spanAngle = 14;
|
||||
m_ncData.rotationAngle = 187;
|
||||
m_ncData.detonationValue = 2000; // kt, only cosmetical
|
||||
m_ncData.partyId = 3;
|
||||
m_ncData.participantId = 1235;
|
||||
const AreaEffectSimulation::NContamination ncData(m_ncData);
|
||||
m_ncData = AreaEffectSimulation::NContamination();
|
||||
m_ncData.id(ncData.id());
|
||||
m_ncData.id = ncData.id;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->nContaminationModifyRequest(
|
||||
NContaminationModifyRequest(
|
||||
ncData.id(),
|
||||
ncData.name(),
|
||||
ncData.effectStart(),
|
||||
ncData.effectDuration(),
|
||||
ncData.chargeStruct().chargeTypeId(),
|
||||
ncData.impactPosition(),
|
||||
ncData.borderLengthInner(),
|
||||
ncData.borderLengthOuter(),
|
||||
ncData.impactRadius(),
|
||||
ncData.spanAngle(),
|
||||
ncData.rotationAngle(),
|
||||
ncData.detonationValue(),
|
||||
ncData.weatherSource(),
|
||||
ncData.partyId(),
|
||||
ncData.participantId(),
|
||||
ncData.externalId()),
|
||||
ncData.id,
|
||||
ncData.name,
|
||||
ncData.effectStart,
|
||||
ncData.effectDuration,
|
||||
ncData.chargeStruct.chargeTypeId,
|
||||
ncData.impactPosition,
|
||||
ncData.borderLengthInner,
|
||||
ncData.borderLengthOuter,
|
||||
ncData.impactRadius,
|
||||
ncData.spanAngle,
|
||||
ncData.rotationAngle,
|
||||
ncData.detonationValue,
|
||||
ncData.weatherSource,
|
||||
ncData.partyId,
|
||||
ncData.participantId,
|
||||
ncData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_ncData.partyId() == 3;}))
|
||||
if (!waitForData([this]() { return m_ncData.partyId == 3;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating ncontamination object";
|
||||
failExit();
|
||||
@@ -216,9 +216,9 @@ void TestNContamination::waitExpireNContamination()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until ncontamination expires";
|
||||
|
||||
if (!waitForData([this]() { return m_ncData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_ncData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of ncontamination with id " << m_ncData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of ncontamination with id " << m_ncData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -232,8 +232,8 @@ void TestNContamination::tryRemoveNContamination()
|
||||
INFO_LOG(m_logger) << "tryRemoveNContamination start";
|
||||
|
||||
AreaEffectSimulation::NContamination ncData(m_ncData);
|
||||
ncData.name("RemoveTest");
|
||||
ncData.effectStart(0); // not set
|
||||
ncData.name = "RemoveTest";
|
||||
ncData.effectStart = 0; // not set
|
||||
m_ncData = AreaEffectSimulation::NContamination();
|
||||
m_expectedAesId = -1;
|
||||
m_bIsCreatedRequest = true;
|
||||
@@ -241,21 +241,21 @@ void TestNContamination::tryRemoveNContamination()
|
||||
if (!m_ftc->nContaminationModifyRequest(
|
||||
NContaminationModifyRequest(
|
||||
0,
|
||||
ncData.name(),
|
||||
ncData.effectStart(),
|
||||
ncData.effectDuration(),
|
||||
ncData.chargeStruct().chargeTypeId(),
|
||||
ncData.impactPosition(),
|
||||
ncData.borderLengthInner(),
|
||||
ncData.borderLengthOuter(),
|
||||
ncData.impactRadius(),
|
||||
ncData.spanAngle(),
|
||||
ncData.rotationAngle(),
|
||||
ncData.detonationValue(),
|
||||
ncData.weatherSource(),
|
||||
ncData.partyId(),
|
||||
ncData.participantId(),
|
||||
ncData.externalId()),
|
||||
ncData.name,
|
||||
ncData.effectStart,
|
||||
ncData.effectDuration,
|
||||
ncData.chargeStruct.chargeTypeId,
|
||||
ncData.impactPosition,
|
||||
ncData.borderLengthInner,
|
||||
ncData.borderLengthOuter,
|
||||
ncData.impactRadius,
|
||||
ncData.spanAngle,
|
||||
ncData.rotationAngle,
|
||||
ncData.detonationValue,
|
||||
ncData.weatherSource,
|
||||
ncData.partyId,
|
||||
ncData.participantId,
|
||||
ncData.externalId),
|
||||
this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during NContaminationCreateRequest()";
|
||||
@@ -263,7 +263,7 @@ void TestNContamination::tryRemoveNContamination()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_ncData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_ncData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating ncontamination object";
|
||||
failExit();
|
||||
@@ -271,14 +271,14 @@ void TestNContamination::tryRemoveNContamination()
|
||||
}
|
||||
|
||||
m_expectedAesId = -1;
|
||||
if (!m_ftc->nContaminationRemoveRequest(Core::RemoveElementRequest(m_ncData.id()), this))
|
||||
if (!m_ftc->nContaminationRemoveRequest(Core::RemoveElementRequest(m_ncData.id), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during NContaminationRemoveRequest()";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_ncData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_ncData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error removing ncontamination object";
|
||||
failExit();
|
||||
@@ -292,7 +292,7 @@ void TestNContamination::tryRemoveNContamination()
|
||||
|
||||
void TestNContamination::nContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType)
|
||||
{
|
||||
if (m_ncData.id() == -1)
|
||||
if (m_ncData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_ncData);
|
||||
}
|
||||
|
||||
+56
-56
@@ -27,7 +27,7 @@ bool TestOffRouteMine::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
|
||||
m_dtc->waitForHistoricalDataOffRouteMine();
|
||||
m_ormData.id(-1);
|
||||
m_ormData.id = -1;
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::offRouteMineChanged,
|
||||
this, &TestOffRouteMine::offRouteMineChanged);
|
||||
|
||||
@@ -40,14 +40,14 @@ bool TestOffRouteMine::checkBaseData(const AreaEffectSimulation::OffRouteMine &a
|
||||
if (!checkAesItem(a, b))
|
||||
return false;
|
||||
|
||||
if (a.area().cornerBottomLeft() != b.area().cornerBottomLeft())
|
||||
if (a.area.cornerBottomLeft != b.area.cornerBottomLeft)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "cornerBottomLeft does not match: " << a.area().cornerBottomLeft() << " - " << b.area().cornerBottomLeft();
|
||||
WARNING_LOG(m_logger) << "cornerBottomLeft does not match: " << a.area.cornerBottomLeft << " - " << b.area.cornerBottomLeft;
|
||||
return false;
|
||||
}
|
||||
if (a.impactRadius() != b.impactRadius())
|
||||
if (a.impactRadius != b.impactRadius)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "impactRadius does not match: " << a.impactRadius() << " - " << b.impactRadius();
|
||||
WARNING_LOG(m_logger) << "impactRadius does not match: " << a.impactRadius << " - " << b.impactRadius;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -61,17 +61,17 @@ void TestOffRouteMine::tryCreateOffRouteMine()
|
||||
m_ormData = AreaEffectSimulation::OffRouteMine();
|
||||
AreaEffectSimulation::OffRouteMine ormData;
|
||||
|
||||
ormData.id(0);
|
||||
ormData.name("OffRouteMine1");
|
||||
ormData.effectStart((time(nullptr) + 4) * 1000); // msec
|
||||
ormData.effectDuration(10234); // msec
|
||||
ormData.chargeStruct().chargeTypeId(3456789);
|
||||
ormData.area().cornerBottomLeft(Core::GeoPosition2D(0.154, 0.926));
|
||||
ormData.area().width(1000);//(20);
|
||||
ormData.area().height(200);//(15);
|
||||
ormData.area().rotation(0.0);//(20.5);
|
||||
ormData.impactRadius(100); // 100m
|
||||
ormData.partyId(2);
|
||||
ormData.id = 0;
|
||||
ormData.name = "OffRouteMine1";
|
||||
ormData.effectStart = (time(nullptr) + 4) * 1000; // msec
|
||||
ormData.effectDuration = 10234; // msec
|
||||
ormData.chargeStruct.chargeTypeId = 3456789;
|
||||
ormData.area.cornerBottomLeft = Core::GeoPosition2D(0.154, 0.926);
|
||||
ormData.area.width = 1000;//(20);
|
||||
ormData.area.height = 200;//(15);
|
||||
ormData.area.rotation = 0.0;//(20.5);
|
||||
ormData.impactRadius = 100; // 100m
|
||||
ormData.partyId = 2;
|
||||
//ormData.participantId(1234);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send OffRouteMineCreateRequest()";
|
||||
@@ -83,10 +83,10 @@ void TestOffRouteMine::tryCreateOffRouteMine()
|
||||
if (!m_ftc->offRouteMineModifyRequest(
|
||||
OffRouteMineModifyRequest(
|
||||
0,
|
||||
ormData.name(),
|
||||
ormData.effectDuration(),
|
||||
ormData.chargeStruct().chargeTypeId(),
|
||||
ormData.area(),
|
||||
ormData.name,
|
||||
ormData.effectDuration,
|
||||
ormData.chargeStruct.chargeTypeId,
|
||||
ormData.area,
|
||||
ormData.impactRadius.get(),
|
||||
ormData.effectStart.get(),
|
||||
ormData.partyId.get()),
|
||||
@@ -109,14 +109,14 @@ void TestOffRouteMine::tryCreateOffRouteMine()
|
||||
m_bIsCreatedRequest = true;
|
||||
m_expectedAesId = -1;
|
||||
|
||||
ormData.chargeStruct().chargeTypeId(s_ChargeTypeId1);
|
||||
ormData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
|
||||
if (!m_ftc->offRouteMineModifyRequest(
|
||||
OffRouteMineModifyRequest(
|
||||
0,
|
||||
ormData.name(),
|
||||
ormData.effectDuration(),
|
||||
ormData.chargeStruct().chargeTypeId(),
|
||||
ormData.area(),
|
||||
ormData.name,
|
||||
ormData.effectDuration,
|
||||
ormData.chargeStruct.chargeTypeId,
|
||||
ormData.area,
|
||||
ormData.impactRadius.get(),
|
||||
ormData.effectStart.get(),
|
||||
ormData.partyId.get()),
|
||||
@@ -127,7 +127,7 @@ void TestOffRouteMine::tryCreateOffRouteMine()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_ormData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_ormData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating off route mine object";
|
||||
failExit();
|
||||
@@ -146,28 +146,28 @@ void TestOffRouteMine::tryCreateOffRouteMine()
|
||||
void TestOffRouteMine::tryModifyOffRouteMine()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request";
|
||||
m_ormData.name("OffRouteMine 2");
|
||||
m_ormData.effectStart(m_ormData.effectStart.get() + 2000);
|
||||
m_ormData.effectDuration(3200); // msec
|
||||
m_ormData.chargeStruct().chargeTypeId(s_ChargeTypeId2);
|
||||
m_ormData.area().cornerBottomLeft(Core::GeoPosition2D(0.154, 0.926));
|
||||
m_ormData.area().width(1000);//(50);
|
||||
m_ormData.area().height(200);//(25);
|
||||
m_ormData.area().rotation(90);//(20.5);
|
||||
m_ormData.partyId(3);
|
||||
m_ormData.name = "OffRouteMine 2";
|
||||
m_ormData.effectStart = m_ormData.effectStart.get() + 2000;
|
||||
m_ormData.effectDuration = 3200; // msec
|
||||
m_ormData.chargeStruct.chargeTypeId = s_ChargeTypeId2;
|
||||
m_ormData.area.cornerBottomLeft = Core::GeoPosition2D(0.154, 0.926);
|
||||
m_ormData.area.width = 1000;//(50);
|
||||
m_ormData.area.height = 200;//(25);
|
||||
m_ormData.area.rotation = 90;//(20.5);
|
||||
m_ormData.partyId = 3;
|
||||
//m_ormData.participantId(1235);
|
||||
const AreaEffectSimulation::OffRouteMine ormData(m_ormData);
|
||||
m_ormData = AreaEffectSimulation::OffRouteMine();
|
||||
m_ormData.id(ormData.id());
|
||||
m_ormData.id = ormData.id;
|
||||
|
||||
m_bIsCreatedRequest = false;
|
||||
if (!m_ftc->offRouteMineModifyRequest(
|
||||
OffRouteMineModifyRequest(
|
||||
ormData.id(),
|
||||
ormData.name(),
|
||||
ormData.effectDuration(),
|
||||
ormData.chargeStruct().chargeTypeId(),
|
||||
ormData.area(),
|
||||
ormData.id,
|
||||
ormData.name,
|
||||
ormData.effectDuration,
|
||||
ormData.chargeStruct.chargeTypeId,
|
||||
ormData.area,
|
||||
ormData.impactRadius.get(),
|
||||
ormData.effectStart.get(),
|
||||
ormData.partyId.get()),
|
||||
@@ -177,7 +177,7 @@ void TestOffRouteMine::tryModifyOffRouteMine()
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
if (!waitForData([this]() { return m_ormData.chargeStruct().chargeTypeId() == s_ChargeTypeId2;}))
|
||||
if (!waitForData([this]() { return m_ormData.chargeStruct.chargeTypeId == s_ChargeTypeId2;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating off route mine object";
|
||||
failExit();
|
||||
@@ -198,8 +198,8 @@ void TestOffRouteMine::tryTriggerOffRouteMine()
|
||||
INFO_LOG(m_logger) << "trigger off route mine -> expires";
|
||||
|
||||
OffRouteMineTriggerRequest req;
|
||||
req.id(m_ormData.id());
|
||||
req.triggered(true);
|
||||
req.id = m_ormData.id;
|
||||
req.triggered = true;
|
||||
if (!m_ftc->offRouteMineTriggerRequest(req, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting trigger data";
|
||||
@@ -214,9 +214,9 @@ void TestOffRouteMine::waitExpireOffRouteMine()
|
||||
{
|
||||
INFO_LOG(m_logger) << "waiting until off route mine expires";
|
||||
|
||||
if (!waitForData([this]() { return m_ormData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
if (!waitForData([this]() { return m_ormData.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of off route mine with id " << m_ormData.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for expiry of off route mine with id " << m_ormData.id;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
@@ -230,8 +230,8 @@ void TestOffRouteMine::tryRemoveOffRouteMine()
|
||||
INFO_LOG(m_logger) << "tryRemoveOffRouteMine start";
|
||||
|
||||
AreaEffectSimulation::OffRouteMine ormData(m_ormData);
|
||||
ormData.name("RemoveTest");
|
||||
ormData.effectStart(0); // not set
|
||||
ormData.name = "RemoveTest";
|
||||
ormData.effectStart = 0; // not set
|
||||
m_ormData = AreaEffectSimulation::OffRouteMine();
|
||||
m_expectedAesId = -1;
|
||||
m_bIsCreatedRequest = true;
|
||||
@@ -239,10 +239,10 @@ void TestOffRouteMine::tryRemoveOffRouteMine()
|
||||
if (!m_ftc->offRouteMineModifyRequest(
|
||||
OffRouteMineModifyRequest(
|
||||
0,
|
||||
ormData.name(),
|
||||
ormData.effectDuration(),
|
||||
ormData.chargeStruct().chargeTypeId(),
|
||||
ormData.area(),
|
||||
ormData.name,
|
||||
ormData.effectDuration,
|
||||
ormData.chargeStruct.chargeTypeId,
|
||||
ormData.area,
|
||||
ormData.impactRadius.get(),
|
||||
ormData.effectStart.get(),
|
||||
ormData.partyId.get()),
|
||||
@@ -253,7 +253,7 @@ void TestOffRouteMine::tryRemoveOffRouteMine()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_ormData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_ormData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error creating off route mine object";
|
||||
failExit();
|
||||
@@ -261,14 +261,14 @@ void TestOffRouteMine::tryRemoveOffRouteMine()
|
||||
}
|
||||
|
||||
m_expectedAesId = -1;
|
||||
if (!m_ftc->offRouteMineRemoveRequest(Core::RemoveElementRequest(m_ormData.id()), this))
|
||||
if (!m_ftc->offRouteMineRemoveRequest(Core::RemoveElementRequest(m_ormData.id), this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error during OffRouteMineRemoveRequest()";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!waitForData([this]() { return m_ormData.id() == m_expectedAesId; }))
|
||||
if (!waitForData([this]() { return m_ormData.id == m_expectedAesId; }))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error removing off route mine object";
|
||||
failExit();
|
||||
@@ -281,7 +281,7 @@ void TestOffRouteMine::tryRemoveOffRouteMine()
|
||||
|
||||
void TestOffRouteMine::offRouteMineChanged(const AreaEffectSimulation::OffRouteMine &data, DataModification modType)
|
||||
{
|
||||
if (m_ormData.id() == -1)
|
||||
if (m_ormData.id == -1)
|
||||
return;
|
||||
onAesChanged(data, modType, m_ormData);
|
||||
}
|
||||
|
||||
+1
-1
@@ -375,7 +375,7 @@ void RecordReplayPluginCustom::removeOld(QMultiMap<long long, T> &map, qint64 de
|
||||
continue;
|
||||
}
|
||||
// keep planned
|
||||
if (!inner.effectStart.is_set())
|
||||
if (!inner.effectStart.has_value())
|
||||
continue;
|
||||
// Remove to old ones
|
||||
if (inner.effectStart.get()+inner.effectDuration < desiredTime - 210*1000 )
|
||||
|
||||
+1
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "trajectory_unit_test.h"
|
||||
#include <utility>
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include <Trajectory/trajectory_helper.h>
|
||||
#include <Trajectory/trajectory_generator.h>
|
||||
#include <Trajectory/trajectory_generator_vulcano.h>
|
||||
|
||||
+15
-15
@@ -21,10 +21,10 @@ Database::AesNContamination nContamination(const AreaEffectSimulation::NContamin
|
||||
dst.id = src.id;
|
||||
dst.chargeTypeId = src.chargeStruct.chargeTypeId;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -44,10 +44,10 @@ Database::AesBCContamination bcContamination(const BCContamination &src)
|
||||
Database::AesBCContamination dst;
|
||||
dst.id = src.id;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -71,10 +71,10 @@ Database::AesExplosionArea explosionArea(const ExplosionArea &src)
|
||||
Database::AesExplosionArea dst;
|
||||
dst.id = src.id;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.impactPosition.ry() = src.area.cornerBottomLeft.lat;
|
||||
@@ -100,10 +100,10 @@ Database::AesExplosionSingle explosionSingle(const ExplosionSingle &src)
|
||||
Database::AesExplosionSingle dst;
|
||||
dst.id = src.id;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -119,11 +119,11 @@ Database::AesMineArea mineArea(const MineArea &src)
|
||||
Database::AesMineArea dst;
|
||||
dst.id = src.id;
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeStruct.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.density = src.density;
|
||||
dst.width = src.width;
|
||||
dst.layingProcedureTypeId = src.layingProcedureType;
|
||||
|
||||
+3
-3
@@ -70,16 +70,16 @@ static void fillData(const ExplosionSingleCentralModifyRequest &src, Database::A
|
||||
|
||||
fillGeometryData(src, dst);
|
||||
dst.name = QString::fromStdString(src.name());
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = 1000; // 1sec
|
||||
dst.chargeTypeId = src.chargeTypeId();
|
||||
dst.altitude = src.altitude();
|
||||
dst.firePurpose = QString::fromStdString(src.purpose());
|
||||
dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime());
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa();
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.angle = src.angle();
|
||||
dst.fuseTypeId = src.fuseType().underlying();
|
||||
dst.fuseTypeId = src.fuseType();
|
||||
dst.participantId = src.participantId();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ int DtcImplCustom::partyForDusMine(int dusMineId) const
|
||||
auto it = m_mineAreaCont.find(dms.id);
|
||||
if (it == m_mineAreaCont.end())
|
||||
return 1;
|
||||
return it.value().partyId.is_set() ? it.value().partyId.get() : 1;
|
||||
return it.value().partyId.has_value() ? it.value().partyId.get() : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -74,13 +74,13 @@ static void fillData(const AirSupportImpactModifyRequest &src, Database::AesAirS
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = 1000; // 1sec
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.flightTime = src.flightTime;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
}
|
||||
|
||||
void HandlerAirSupportImpact::onAirSupportImpactModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -97,7 +97,7 @@ void HandlerAirSupportImpact::onAirSupportImpactModifyRequest(const rti::core::S
|
||||
|
||||
Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactCreateRequest(const AirSupportImpactModifyRequest &request)
|
||||
{
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtAirSupportImpact)] && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtAirSupportImpact)] && request.effectStart.has_value())
|
||||
{
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << " Too many active air support impacts, request:" << request;
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air support impacts."));
|
||||
@@ -152,7 +152,7 @@ Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactModifyRequest
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtAirSupportImpact)]
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet()
|
||||
&& !ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
+19
-19
@@ -109,34 +109,34 @@ static void fillData(const BCContaminationModifyRequest &src, Database::AesBCCon
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
dst.impactRadius = src.impactRadius;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.weatherSourceId = src.weatherSource;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.upperOffset = src.upperOffset;
|
||||
dst.lowerOffset = src.lowerOffset;
|
||||
|
||||
// weather parameter are delivered, when adding in OC-laptop
|
||||
if (src.weatherPosition.is_set())
|
||||
if (src.weatherPosition.has_value())
|
||||
{
|
||||
dst.weatherPosition.rx() = src.weatherPosition.get().lon;
|
||||
dst.weatherPosition.ry() = src.weatherPosition.get().lat;
|
||||
}
|
||||
else
|
||||
dst.weatherPosition = dst.impactPosition; // initial, is not used during update therefore it's ok here
|
||||
if(src.windSpeed.is_set())
|
||||
if(src.windSpeed.has_value())
|
||||
dst.windSpeed = src.windSpeed.get();
|
||||
if(src.propagationDirection.is_set())
|
||||
if(src.propagationDirection.has_value())
|
||||
dst.propagationDirection = src.propagationDirection.get();
|
||||
if(src.weatherTimestamp.is_set())
|
||||
if(src.weatherTimestamp.has_value())
|
||||
dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.weatherTimestamp.get());
|
||||
else if(src.effectStart.is_set())
|
||||
else if(src.effectStart.has_value())
|
||||
dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.effectStart.get());
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -180,7 +180,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
@@ -208,7 +208,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c
|
||||
}
|
||||
m_objectMap.insert(ifs->id(), ifs);
|
||||
|
||||
if (request.withDangerArea.is_set() && request.withDangerArea.get())
|
||||
if (request.withDangerArea.has_value() && request.withDangerArea.get())
|
||||
{
|
||||
DangerAreaModifyRequest req;
|
||||
req.id = 0;
|
||||
@@ -238,7 +238,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectBCContamination *ifs = nullptr;
|
||||
if (request.externalId.is_set() && request.externalId.get() > 0)
|
||||
if (request.externalId.has_value() && request.externalId.get() > 0)
|
||||
ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId.get(), ret);
|
||||
|
||||
if (!ifs)
|
||||
@@ -252,7 +252,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
Database::AesBCContamination aea(ifs->data());
|
||||
@@ -277,13 +277,13 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
|
||||
if (isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)])
|
||||
/*&& request.effectStart.is_set()*/)
|
||||
/*&& request.effectStart.has_value()*/)
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central B/C or N contamination areas."));
|
||||
}
|
||||
@@ -291,7 +291,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)])
|
||||
/*&& request.effectStart.is_set()*/)
|
||||
/*&& request.effectStart.has_value()*/)
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active B/C or N contamination areas."));
|
||||
}
|
||||
@@ -299,7 +299,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
@@ -361,7 +361,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
ERROR_LOG(m_logger)<<"[bCContaminationModifyRequest] couldn't update danger area: bccontamination.id: "<<ifs->id()
|
||||
<<" dangerArea.name: "<<dangerRequest.name;
|
||||
}
|
||||
else if (request.withDangerArea.is_set() && request.withDangerArea.get())
|
||||
else if (request.withDangerArea.has_value() && request.withDangerArea.get())
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<"[bCContaminationModifyRequest] add new danger area to bcId: " <<ifs->id();
|
||||
DangerAreaModifyRequest newDangerRequest;
|
||||
|
||||
+9
-9
@@ -78,18 +78,18 @@ static void fillData(const BoobyTrapModifyRequest &src, Database::AesBoobyTrap &
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
dst.impactRadius = src.impactRadius;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
//dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
//dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.triggerRadius = src.triggerRadius;
|
||||
dst.rotationAngle = src.rotationAngle.is_set() ? src.rotationAngle.get() : 0;
|
||||
dst.centralAngle = src.centralAngle.is_set() ? src.centralAngle.get() : 0;
|
||||
dst.rotationAngle = src.rotationAngle.has_value() ? src.rotationAngle.get() : 0;
|
||||
dst.centralAngle = src.centralAngle.has_value() ? src.centralAngle.get() : 0;
|
||||
dst.isCentral = true;
|
||||
dst.triggered = false;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void HandlerBoobyTrap::onBoobyTrapModifyRequest(const rti::core::SampleIdentity
|
||||
|
||||
Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapCreateRequest(const BoobyTrapModifyRequest &request)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBoobyTrap)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBoobyTrap)]) && request.effectStart.has_value())
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active booby traps."));
|
||||
|
||||
Database::AesBoobyTrap newData;
|
||||
@@ -153,13 +153,13 @@ Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapModifyRequest(const BoobyTr
|
||||
if (!ifs)
|
||||
return ret;
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBoobyTrap)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet()
|
||||
/* && !ifs->isObjectModifiable()*/)
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active booby traps."));
|
||||
|
||||
+2
-2
@@ -181,7 +181,7 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf
|
||||
newChargeEffect->init();
|
||||
|
||||
// create trajectory
|
||||
if (request.trajectoryTimeAware.is_set())
|
||||
if (request.trajectoryTimeAware.has_value())
|
||||
{
|
||||
int trajId = m_trajectoryHandler->create(trajectoryData(newChargeEffect->id(), request.trajectoryTimeAware.get()));
|
||||
if (trajId < 0)
|
||||
@@ -252,7 +252,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf
|
||||
reply = chargeEffetObj->update(request);
|
||||
|
||||
// update trajectory
|
||||
if (!reply.error() && request.trajectoryTimeAware.is_set()
|
||||
if (!reply.error() && request.trajectoryTimeAware.has_value()
|
||||
&& m_trajectoryHandler->update(trajectoryData(chargeEffetObj->id(), request.trajectoryTimeAware.get(), m_trajObjIds.value(chargeEffetObj->id(), -1))))
|
||||
{
|
||||
// update failed should the trajectory be created again?
|
||||
|
||||
+8
-8
@@ -91,12 +91,12 @@ Core::FunctionReplyObject HandlerDangerArea::dangerAreaCreateRequest(const Dange
|
||||
if (request.id < 0) // is the id given as negative? set id -> used by OC-Laptop
|
||||
newData.id = request.id;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = request.chargeTypeId;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.is_set() ? request.associatedAesId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.has_value() ? request.associatedAesId.get() : 0;
|
||||
|
||||
|
||||
ObjectDangerArea *ifs(new ObjectDangerArea(m_mainHandler, this));
|
||||
@@ -163,12 +163,12 @@ Core::FunctionReplyObject HandlerDangerArea::dangerAreaModifyRequest(const Dange
|
||||
if (request.id < 0) // is the id given as negative? set id -> used by OC-Laptop
|
||||
newData.id = request.id;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = request.chargeTypeId;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.is_set() ? request.associatedAesId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.has_value() ? request.associatedAesId.get() : 0;
|
||||
|
||||
return ifs->updateObject(newData, request.segments);
|
||||
}
|
||||
|
||||
+19
-19
@@ -256,7 +256,7 @@ static void fillData(const EffectClusterModifyRequest &src,
|
||||
dst.explosionGeometryId = src.explosionGeometry;
|
||||
dst.tla = src.tla;
|
||||
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
// Effect Duration might be set and will be used for the AutoFire
|
||||
// -- Module Duration
|
||||
if (src.effectDuration)
|
||||
@@ -272,13 +272,13 @@ static void fillData(const EffectClusterModifyRequest &src,
|
||||
|
||||
dst.firePurposeId = src.firePurposeId;
|
||||
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
|
||||
dst.altitude = -1;
|
||||
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
|
||||
dst.properties = QString::fromStdString(src.properties);
|
||||
dst.esmParticipantIds = LtsUtils::IntArray(src.esmParticipantIds);
|
||||
@@ -422,7 +422,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
// external (externalId==0) -> partyId required
|
||||
// We keep the old charge behavior
|
||||
// and also ignore it from ADLER?
|
||||
const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
if (request.effectors.size() == 0)
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Invalid Effector Count"));
|
||||
|
||||
@@ -457,7 +457,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
|
||||
QString chargeName = QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(it.key()).name);
|
||||
QString fireUnitName;
|
||||
if (request.participantId.is_set())
|
||||
if (request.participantId.has_value())
|
||||
fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId.get()).designator);
|
||||
|
||||
if (chargeNeeded > chargeLeft)
|
||||
@@ -477,7 +477,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
|
||||
fillData(request, newData, newEffectorDataVec, m_mainHandler);
|
||||
DEBUG_LOG(m_logger) << "AUTO newData " << newData.impactCount;
|
||||
if (!request.properties.empty() && (!request.effectStart.is_set() || request.effectStart.get() == 0))
|
||||
if (!request.properties.empty() && (!request.effectStart.has_value() || request.effectStart.get() == 0))
|
||||
{
|
||||
newData.isUsingEffectStateReceived = propertiesObject.value(QStringLiteral("useReceived")).toBool();
|
||||
}
|
||||
@@ -512,7 +512,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air supports."));
|
||||
}
|
||||
}
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)]) + (s_currentAirSupportCount) && request.effectStart.is_set())
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)]) + (s_currentAirSupportCount) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -542,8 +542,8 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
// // externalId maybe set be HLA interface:
|
||||
// // from external (externalIdValue>0) -> no partyId required
|
||||
// // from internal (externalIdValue==0) -> partyId required
|
||||
// const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.is_set())
|
||||
// const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.has_value())
|
||||
// return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id."));
|
||||
|
||||
DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart << ", effectDuration :"
|
||||
@@ -573,7 +573,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
const bool bChargeIsAirSupport = (gc == ProjectDataManagement::GearClass::GearClass_AirSupport);
|
||||
ifs->setAirSupportSource(bChargeIsAirSupport);
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable()) // ToDo: check
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable()) // ToDo: check
|
||||
{
|
||||
// Calculate new polygon here. Not nice, though
|
||||
auto poly = Polygons::effectClusterArea(aea);
|
||||
@@ -589,7 +589,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)] + (s_currentAirSupportCount)) && request.effectStart.is_set()
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)] + (s_currentAirSupportCount)) && request.effectStart.has_value()
|
||||
&& ((wasCentral && !ifs->isActivationTimeSet()) || !wasCentral))
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central effect clusters."));
|
||||
}
|
||||
@@ -719,9 +719,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
// the fire hold with the corresponding target coordinate and circular area.
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const int radius = request.radius.is_set() ? request.radius.get() : 0;
|
||||
const double lonRad = request.longitude.has_value() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const double latRad = request.latitude.has_value() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const int radius = request.radius.has_value() ? request.radius.get() : 0;
|
||||
|
||||
DEBUG_LOG(m_logger) << "[Feuer Halt Referenziert] " << "lonRad : " << lonRad << " " << "latRad : " << latRad << " " << "radius : " << radius;
|
||||
|
||||
@@ -749,7 +749,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[Feuer Einstellen ----- markAsExpired] " << "effectClusterId: " << ifs->data().id;
|
||||
|
||||
ifs->markAsExpired(request.entladenSchuss.is_set() ? request.entladenSchuss.get() : false);
|
||||
ifs->markAsExpired(request.entladenSchuss.has_value() ? request.entladenSchuss.get() : false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -769,9 +769,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
{
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional<lonRad>
|
||||
const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional <latRad>
|
||||
const int radius = request.radius.is_set() ? request.radius.get() : 0;
|
||||
const double lonRad = request.longitude.has_value() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional<lonRad>
|
||||
const double latRad = request.latitude.has_value() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional <latRad>
|
||||
const int radius = request.radius.has_value() ? request.radius.get() : 0;
|
||||
|
||||
DEBUG_LOG(m_logger) << "[Aufheben Feuer Halt Referenziert] " << "lonRad : " << lonRad << " " << "latRad : " << latRad << " " << "radius : " << radius;
|
||||
|
||||
|
||||
+10
-10
@@ -101,21 +101,21 @@ static void fillData(const ExplosionAreaModifyRequest &src, Database::AesExplosi
|
||||
dst.impactPosition.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.rotationAngle = src.area.rotation;
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
dst.impactLength = src.area.height;
|
||||
dst.impactWidth = src.area.width;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.cannonCount = src.cannonCount;
|
||||
dst.cannonRounds = src.cannonRounds;
|
||||
dst.altitude = src.altitude;
|
||||
dst.firePurpose = QString::fromStdString(src.purpose);
|
||||
dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime);
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
}
|
||||
|
||||
void HandlerExplosionArea::onExplosionAreaModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -130,7 +130,7 @@ void HandlerExplosionArea::onExplosionAreaModifyRequest(const rti::core::SampleI
|
||||
|
||||
Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const ExplosionAreaModifyRequest &request)
|
||||
{
|
||||
if (!request.partyId.is_set())
|
||||
if (!request.partyId.has_value())
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id."));
|
||||
|
||||
int chargeNeeded = request.cannonCount * request.cannonRounds;
|
||||
@@ -164,7 +164,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -174,7 +174,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -230,7 +230,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const
|
||||
/*!
|
||||
* Check if the max amount is reached if the effect start added after creation.
|
||||
!*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
@@ -249,7 +249,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
// Calculate new polygon here. Not nice, though
|
||||
@@ -304,7 +304,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyGeometryReque
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet() // if time was not set before change and now check count
|
||||
&& !ifs->isObjectModifiable())
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active explosion areas and explosion singles"));
|
||||
|
||||
+18
-18
@@ -161,7 +161,7 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl
|
||||
dst.explosionGeometryId = src.explosionGeometry;
|
||||
dst.zog = src.tla;
|
||||
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
|
||||
@@ -170,13 +170,13 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl
|
||||
dst.igniterFunctionId = src.chargeStruct.igniterFunctionId;
|
||||
dst.firePurposeId = src.firePurposeId;
|
||||
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
// dst.firingGeoPosition // not provided, has to be retrieved from dds
|
||||
|
||||
dst.impactCount = src.impactCount;
|
||||
dst.mhpCountRequest = src.mhpCount;
|
||||
if (src.mhpRotation.is_set())
|
||||
if (src.mhpRotation.has_value())
|
||||
dst.mhpRotationRequest = src.mhpRotation.get();
|
||||
else
|
||||
dst.mhpRotationRequest = ObjectExplosionCluster::s_invalid_rotation_angle;
|
||||
@@ -189,7 +189,7 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl
|
||||
// dst.firePurpose = QString::fromStdString(src.purpose());
|
||||
// dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime());
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
|
||||
dst.launchVelocity = src.launchVelocity;
|
||||
dst.launchAngleDeg = src.launchAngleDeg;
|
||||
@@ -321,7 +321,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
// HLA Interface is using externalId...
|
||||
// external (externalId>0) -> no partyId required
|
||||
// external (externalId==0) -> partyId required
|
||||
const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
const ProjectDataManagement::GearClass gearClass = m_mainHandler->gearClassOfChargeTypeId(request.chargeStruct.chargeTypeId);
|
||||
|
||||
const bool bDoClaimPlannedCharge = (request.id == 0) &&
|
||||
@@ -339,7 +339,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
|
||||
QString chargeName= QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(request.chargeStruct.chargeTypeId).name);
|
||||
QString fireUnitName;
|
||||
if (request.participantId.is_set())
|
||||
if (request.participantId.has_value())
|
||||
fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId.get()).designator);
|
||||
|
||||
if (chargeNeeded > chargeLeft)
|
||||
@@ -355,7 +355,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
fillData(request, newData, m_mainHandler);
|
||||
|
||||
if (!request.properties.empty() &&
|
||||
(!request.effectStart.is_set() ||
|
||||
(!request.effectStart.has_value() ||
|
||||
request.effectStart.get() == 0))
|
||||
{
|
||||
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(request.properties)).object();
|
||||
@@ -396,7 +396,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air supports."));
|
||||
}
|
||||
}
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)]) + (s_currentAirSupportCount) && request.effectStart.is_set())
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)]) + (s_currentAirSupportCount) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -406,9 +406,9 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New dec ExplosionCluster: " << totalAreas() << " Max: " << s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)] << " Is Set: " << request.effectStart.is_set();
|
||||
DEBUG_LOG(m_logger) << "New dec ExplosionCluster: " << totalAreas() << " Max: " << s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)] << " Is Set: " << request.effectStart.has_value();
|
||||
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -447,8 +447,8 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
// // externalId maybe set be HLA interface:
|
||||
// // from external (externalIdValue>0) -> no partyId required
|
||||
// // from internal (externalIdValue==0) -> partyId required
|
||||
// const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.is_set())
|
||||
// const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.has_value())
|
||||
// return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id."));
|
||||
|
||||
DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart
|
||||
@@ -476,7 +476,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
ifs->setAirSupportSource(bChargeIsAirSupport);
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable()) // ToDo: check
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable()) // ToDo: check
|
||||
{
|
||||
// Calculate new polygon here. Not nice, though
|
||||
auto poly = Polygons::explosionClusterArea(aea);
|
||||
@@ -503,7 +503,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
{
|
||||
// case 1: war zentral && effectStart war nicht gesetzt
|
||||
// case 2: war dezentral && effectStart ist gesetzt.
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)] + (s_currentAirSupportCount)) && request.effectStart.is_set()
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)] + (s_currentAirSupportCount)) && request.effectStart.has_value()
|
||||
&& ((wasCentral && !ifs->isActivationTimeSet()) || !wasCentral))
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central explosion clusters."));
|
||||
@@ -514,7 +514,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
{
|
||||
// case 1: war dezentral && effectStart war nicht gesetzt
|
||||
// case 2: war zentral && effectStart ist gesetzt.
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.is_set()
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.has_value()
|
||||
&& (( !wasCentral && !ifs->isActivationTimeSet()) || wasCentral))
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active explosion clusters."));
|
||||
@@ -523,7 +523,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
@@ -580,7 +580,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyGeometr
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.is_set() && !ifs->isObjectModifiable())
|
||||
if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.has_value() && !ifs->isObjectModifiable())
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active explosion areas."));
|
||||
|
||||
// Todo: IsObjectModifiable() ?!?
|
||||
|
||||
+10
-10
@@ -102,17 +102,17 @@ static void fillData(const ExplosionSingleModifyRequest &src, Database::AesExplo
|
||||
|
||||
fillGeometryData(src, dst);
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = 1000; // 1sec
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.altitude = src.altitude;
|
||||
dst.firePurpose = QString::fromStdString(src.purpose);
|
||||
dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime);
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
}
|
||||
|
||||
void HandlerExplosionSingle::onExplosionSingleModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -145,7 +145,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -155,7 +155,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -192,7 +192,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.is_set())
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.has_value())
|
||||
// return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active single explosions."));
|
||||
|
||||
Database::AesExplosionSingle aes(ifs->data());
|
||||
@@ -207,7 +207,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c
|
||||
bool wasCentral = ifs->data().isCentral;
|
||||
|
||||
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
@@ -225,7 +225,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c
|
||||
}
|
||||
}
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
@@ -278,7 +278,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyGeometryR
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet()
|
||||
&& !ifs->isObjectModifiable())
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active single explosions."));
|
||||
|
||||
+11
-11
@@ -164,16 +164,16 @@ static void fillData(const T &src, Database::AesFunctionalArea &dst)
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.position.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.position.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.length = src.area.height;
|
||||
dst.width = src.area.width;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.pointSymbol = src.pointSymbol.is_set() ? QString::fromStdString(src.pointSymbol.get()) : QString();
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.pointSymbol = src.pointSymbol.has_value() ? QString::fromStdString(src.pointSymbol.get()) : QString();
|
||||
dst.functionalAreaTypeId = src.functionalAreaTypeId;
|
||||
dst.deconMode = src.deconMode;
|
||||
dst.deconTime = src.deconTime;
|
||||
@@ -197,9 +197,9 @@ void HandlerFunctionalArea::onFunctionalAreaModifyRequest(const rti::core::Sampl
|
||||
|
||||
Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(const FunctionalAreaModifyRequest &request)
|
||||
{
|
||||
if (!request.partyId.is_set() && (request.supplyMode != AesOperatingMode::OmWaitingTime))
|
||||
if (!request.partyId.has_value() && (request.supplyMode != AesOperatingMode::OmWaitingTime))
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Functional areas need a party id."));
|
||||
if ((!request.participantId.is_set()) && (request.supplyMode == AesOperatingMode::OmWaitingTime))
|
||||
if ((!request.participantId.has_value()) && (request.supplyMode == AesOperatingMode::OmWaitingTime))
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Functional areas Supply need a participant id."));
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.has_value())
|
||||
{
|
||||
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
@@ -232,7 +232,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -268,7 +268,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
// if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea] && request.effectStart.is_set() && !ifs->isObjectModifiable())
|
||||
// if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea] && request.effectStart.has_value() && !ifs->isObjectModifiable())
|
||||
// return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active functional areas."));
|
||||
|
||||
// Todo: IsObjectModifiable() ?!?
|
||||
@@ -287,7 +287,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
!*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
@@ -307,7 +307,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
|
||||
|
||||
+8
-8
@@ -97,8 +97,8 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi
|
||||
Database::AesGasPipe newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
|
||||
@@ -115,7 +115,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject();
|
||||
delete ifs;
|
||||
@@ -124,7 +124,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject();
|
||||
delete ifs;
|
||||
@@ -159,8 +159,8 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
|
||||
Database::AesGasPipe newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
if (request.id < 0 && checkStateForSfm(ifs))
|
||||
@@ -172,7 +172,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
!*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
|
||||
}
|
||||
//TODO: Implement switch from decentral to central in gasp pipes
|
||||
// // For counting, only Elements being at least prepared are important:
|
||||
// if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
// if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
// {
|
||||
|
||||
// // Calculate new polygon here. Not nice, though
|
||||
|
||||
+24
-24
@@ -203,7 +203,7 @@ int HandlerMineArea::totalAreasCentral() const { return s_areaCountCentral[stati
|
||||
|
||||
template <typename T> T getValueHelper(T in) { return in; }
|
||||
|
||||
template <typename T> T getValueHelper(const dds::core::optional<T> &in) { return in.is_set() ? in.get() : T(); }
|
||||
template <typename T> T getValueHelper(const dds::core::optional<T> &in) { return in.has_value() ? in.get() : T(); }
|
||||
|
||||
template <typename T> static void fillData(const T &src, Database::AesMineArea &dst)
|
||||
{
|
||||
@@ -211,12 +211,12 @@ template <typename T> static void fillData(const T &src, Database::AesMineArea &
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeStruct.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.density = src.density;
|
||||
dst.width = src.width;
|
||||
dst.layingProcedureTypeId = src.layingProcedureType;
|
||||
@@ -254,7 +254,7 @@ void HandlerMineArea::onMineAreaModifyRequest(const rti::core::SampleIdentity &c
|
||||
template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateRequest(const T &request)
|
||||
{
|
||||
// if ( !isDusMineArea(request.chargeTypeId())
|
||||
// && (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] && request.effectStart.is_set()))
|
||||
// && (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] && request.effectStart.has_value()))
|
||||
// return Core::FunctionReplyObject(1, tr_lts("dds", "Too many peripheral mine areas."));
|
||||
|
||||
Database::AesMineArea newData;
|
||||
@@ -302,7 +302,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR
|
||||
bool isCentral = ifs->checkIsCentral(_form);
|
||||
if (isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -330,14 +330,14 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
--pzAbwWMiSafe;
|
||||
}
|
||||
|
||||
if (pzAbwWMiSafe < 0)
|
||||
pzAbwWMiSafe = 0;
|
||||
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -347,7 +347,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
++m_totalPzAbwWMis;
|
||||
}
|
||||
}
|
||||
@@ -399,7 +399,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
Database::AesMineArea newData(ifs->data());
|
||||
@@ -423,12 +423,12 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
*/
|
||||
if (!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if (!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] /*&& request.effectStart.is_set()*/)
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] /*&& request.effectStart.has_value()*/)
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many central mine areas."));
|
||||
|
||||
ret = ifs->checkDensity(newData.density, totalLength, s_maxCentralSingleMinesCount);
|
||||
@@ -454,7 +454,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
if (pzAbwWMiSafe < 0)
|
||||
pzAbwWMiSafe = 0;
|
||||
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe /*&& request.effectStart.is_set()*/)
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe /*&& request.effectStart.has_value()*/)
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many peripheral mine areas."));
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
@@ -465,7 +465,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
// Calculate new polygon here. Not nice, though
|
||||
|
||||
@@ -482,7 +482,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
--pzAbwWMiSafe;
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque
|
||||
if (request.mineAreaId == 0)
|
||||
{
|
||||
// If single mine...
|
||||
if (request.mineId.is_set())
|
||||
if (request.mineId.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Checking in DUS-Mine-Areas";
|
||||
bool found = false;
|
||||
@@ -638,7 +638,7 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque
|
||||
return Core::FunctionReplyObject(request.mineAreaId, tr_lts("dds", "Mine area with id %1 not found.")).arg(request.mineAreaId);
|
||||
|
||||
bool bOk;
|
||||
if (request.mineId.is_set())
|
||||
if (request.mineId.has_value())
|
||||
bOk = ifs->resetMine(request.mineId.get());
|
||||
else
|
||||
bOk = ifs->resetMines();
|
||||
@@ -658,9 +658,9 @@ void HandlerMineArea::onMineTriggered(const TrainingAreaBase::MineTriggered &dat
|
||||
mtr.mineAreaId = data.mineAreaId;
|
||||
// from tab - mine area mine index starts at 1 ...
|
||||
mtr.mineId = data.mineAreaId == 0 ? data.mineIndex : data.mineIndex - 1;
|
||||
if (data.position.is_set())
|
||||
if (data.position.has_value())
|
||||
mtr.position = data.position.get();
|
||||
if (data.chargeTypeId.is_set())
|
||||
if (data.chargeTypeId.has_value())
|
||||
mtr.chargeTypeId = data.chargeTypeId.get();
|
||||
|
||||
auto ret = mineTriggeredRequest(mtr);
|
||||
@@ -680,14 +680,14 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "mineTriggeredRequest: " << request;
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as MineTriggeredRequest does not contain values
|
||||
if (request.mineAreaId == 0 || (request.chargeTypeId.is_set() && isConcreteMine(request.chargeTypeId.get(), 0, 0)))
|
||||
if (request.mineAreaId == 0 || (request.chargeTypeId.has_value() && isConcreteMine(request.chargeTypeId.get(), 0, 0)))
|
||||
{
|
||||
int chargeTypeId = request.chargeTypeId.is_set() ? request.chargeTypeId.get() : 0;
|
||||
int chargeTypeId = request.chargeTypeId.has_value() ? request.chargeTypeId.get() : 0;
|
||||
|
||||
// DUS Mines:
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as MineTriggeredRequest does not contain values
|
||||
QPointF position;
|
||||
if (request.position.is_set() && !isFromMineLayer(chargeTypeId, 0, 0))
|
||||
if (request.position.has_value() && !isFromMineLayer(chargeTypeId, 0, 0))
|
||||
{
|
||||
position.setX(request.position.get().lon);
|
||||
position.setY(request.position.get().lat);
|
||||
@@ -748,7 +748,7 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge
|
||||
|
||||
if (mine.id != 0) // mine did exist already
|
||||
{
|
||||
if (request.position.is_set()) // update position
|
||||
if (request.position.has_value()) // update position
|
||||
mine.position = position;
|
||||
}
|
||||
|
||||
@@ -1444,7 +1444,7 @@ QPolygonF HandlerMineArea::msGetBoundingBoxPolygon(const QPolygonF &minen, doubl
|
||||
|
||||
bool HandlerMineArea::triggerUnpairedMine(const MineTriggeredRequest &request)
|
||||
{
|
||||
if (!request.position.is_set())
|
||||
if (!request.position.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " failed, because there is no position.";
|
||||
|
||||
|
||||
+11
-11
@@ -94,7 +94,7 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe
|
||||
if (data.operationalState == MRF_RAEUMEN)
|
||||
{
|
||||
auto it = m_corridorCreators.constFind(data.equipmentNumber);
|
||||
if (data.position.is_set())
|
||||
if (data.position.has_value())
|
||||
{
|
||||
MineCorridorCreator *mcc = nullptr;
|
||||
if (it == m_corridorCreators.constEnd())
|
||||
@@ -170,14 +170,14 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorCreateRequest(const M
|
||||
Database::AesMineCorridor newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = 315;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.effectSourceId = request.effectSourceId;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.externalId = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
newData.externalId = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
|
||||
ObjectMineCorridor *ifs(new ObjectMineCorridor(m_mainHandler, this));
|
||||
|
||||
@@ -201,7 +201,7 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorModifyRequest(const M
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectMineCorridor *ifs = nullptr;
|
||||
if (request.externalId.is_set() && request.externalId.get() > 0)
|
||||
if (request.externalId.has_value() && request.externalId.get() > 0)
|
||||
ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId.get(), ret);
|
||||
|
||||
if (!ifs)
|
||||
@@ -215,19 +215,19 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorModifyRequest(const M
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
Database::AesMineCorridor newData(ifs->data());
|
||||
newData.id = request.id;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = 315;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.externalId = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
newData.externalId = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
if (request.id < 0 && checkStateForSfm(ifs))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Overwrite mine corridor Effect State for OC";
|
||||
|
||||
+11
-11
@@ -115,7 +115,7 @@ static void fillData(const NContaminationModifyRequest &src, Database::AesNConta
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -125,10 +125,10 @@ static void fillData(const NContaminationModifyRequest &src, Database::AesNConta
|
||||
dst.spanAngle = src.spanAngle;
|
||||
dst.rotationAngle = src.rotationAngle;
|
||||
dst.detonationValue = src.detonationValue;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.weatherSourceId = src.weatherSource;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -173,7 +173,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -212,7 +212,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination]) && request.effectStart.is_set() && !ifs->isObjectModifiable())
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination]) && request.effectStart.has_value() && !ifs->isObjectModifiable())
|
||||
// return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active N contamination areas."));
|
||||
|
||||
Database::AesNContamination aea(ifs->data());
|
||||
@@ -229,25 +229,25 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.is_set()*/)
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.has_value()*/)
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central N or B/C contamination areas."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.is_set()*/) // upper if-condition handle start-time
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.has_value()*/) // upper if-condition handle start-time
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active N or B/C contamination areas."));
|
||||
}
|
||||
}
|
||||
}
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
|
||||
+8
-8
@@ -76,20 +76,20 @@ static void fillData(const OffRouteMineModifyRequest &src, Database::AesOffRoute
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.impactPosition.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.width = src.area.width;
|
||||
dst.length = src.area.height;
|
||||
dst.rotationAngle = src.area.rotation;
|
||||
dst.impactRadius = src.impactRadius.is_set() ? src.impactRadius.get() : 0;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.impactRadius = src.impactRadius.has_value() ? src.impactRadius.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.isCentral = true;
|
||||
dst.triggered = false;
|
||||
//dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
//dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void HandlerOffRouteMine::onOffRouteMineModifyRequest(const rti::core::SampleIde
|
||||
|
||||
Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineCreateRequest(const OffRouteMineModifyRequest &request)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtOffRouteMine)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtOffRouteMine)]) && request.effectStart.has_value())
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active off route mines."));
|
||||
|
||||
Database::AesOffRouteMine newData;
|
||||
@@ -143,7 +143,7 @@ Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineModifyRequest(const O
|
||||
if (!ifs)
|
||||
return ret;
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
@@ -152,7 +152,7 @@ Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineModifyRequest(const O
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
!*/
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtOffRouteMine)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet() // check if time before change was not setted.
|
||||
/*&& !ifs->isObjectModifiable()*/)
|
||||
{
|
||||
|
||||
+2
-2
@@ -65,9 +65,9 @@ static void fillData(const ReconAreaModifyRequest &src, Database::AesReconArea &
|
||||
dst.height = src.area.height;
|
||||
dst.width = src.area.width;
|
||||
dst.effectMarkingInTa = false;
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.participantId = src.participantId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.purpose = QString::fromStdString(src.purpose);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -178,12 +178,12 @@ Core::FunctionReplyObject ObjectExplosionArea::resumePause(const ExplosionAreaPa
|
||||
{
|
||||
if (req.resumeExecution)
|
||||
{
|
||||
if (req.timeToResume.is_set())
|
||||
if (req.timeToResume.has_value())
|
||||
m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume.get());
|
||||
else
|
||||
m_data.effectStart = partitionTime();
|
||||
|
||||
if (req.remainingDuration.is_set())
|
||||
if (req.remainingDuration.has_value())
|
||||
m_data.effectDuration = req.remainingDuration.get();
|
||||
|
||||
// req.resumeSeed() currently not used, as it is calculated internaly. maybe in the future
|
||||
|
||||
+3
-3
@@ -744,12 +744,12 @@ Core::FunctionReplyObject ObjectExplosionCluster::resumePause(const ExplosionClu
|
||||
// if (req.resumeExecution())
|
||||
// {
|
||||
// // resume
|
||||
// if (req.timeToResume.is_set())
|
||||
// if (req.timeToResume.has_value())
|
||||
// m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume.get());
|
||||
// else
|
||||
// m_data.effectStart = partitionTime();
|
||||
|
||||
// if (req.remainingDuration.is_set())
|
||||
// if (req.remainingDuration.has_value())
|
||||
// m_data.effectDuration = req.remainingDuration.get();
|
||||
|
||||
// // req.resumeSeed() currently not used, as it is calculated internaly. maybe in the future
|
||||
@@ -1887,7 +1887,7 @@ void ObjectExplosionCluster::checkNextFire()
|
||||
// continue;
|
||||
|
||||
// SingleEffect &ref = singleEffectsRef[idx];
|
||||
// if (ref.singleEffectState().underlying() != AesSingleEffectState::SesTriggered)
|
||||
// if (ref.singleEffectState() != AesSingleEffectState::SesTriggered)
|
||||
// {
|
||||
// ref.singleEffectState(AesSingleEffectState::SesTriggered);
|
||||
// ref.singleEffectTime(curPartTime);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
// Registers Qt metatypes for AVM DDS types used as QVariant values in GUI code.
|
||||
//
|
||||
// Declared in a single, guarded location so the QMetaTypeId<T> specialization is
|
||||
// defined before any Q_OBJECT slot/signal QtMocHelpers::SlotData instantiates the
|
||||
// primary QMetaTypeId<T> template. Qt6 rejects a class-template specialization that
|
||||
// follows the primary template's implicit instantiation ("specialization of
|
||||
// QMetaTypeId<T> after instantiation"), which Qt5 tolerated, so the declaration must
|
||||
// precede the first such SlotData in a translation unit.
|
||||
#include <AudioVideoManagement/avm_dtc.h>
|
||||
#include <QMetaType>
|
||||
|
||||
#ifndef Q_DECLARE_METATYPE_AVM_FREQUENCYPLANNING
|
||||
#define Q_DECLARE_METATYPE_AVM_FREQUENCYPLANNING
|
||||
Q_DECLARE_METATYPE(AudioVideoManagement::FrequencyPlanning)
|
||||
#endif
|
||||
@@ -263,7 +263,7 @@ void AvsMenus::Menu::replaceMvsEntries(MenuStruct &menu) const
|
||||
newMenu.reserve(menu.menuEntries.size());
|
||||
for (auto menuEntry : menu.menuEntries)
|
||||
{
|
||||
if (menuEntry.mountingPointId.is_set() && menuEntry.mountingPointId.get() < 0)
|
||||
if (menuEntry.mountingPointId.has_value() && menuEntry.mountingPointId.get() < 0)
|
||||
menuEntry.name = m_dtc->videoTeam(menuEntry.mountingPointId.get()*-1).streamName;
|
||||
newMenu.push_back(std::move(menuEntry));
|
||||
}
|
||||
@@ -360,12 +360,12 @@ void AvsMenus::Menu::setMenu(const MenuStruct &menu, const boost::optional<int>
|
||||
std::vector<AudioVideoManagement::AvMenuEntry> menuEntriesToUse;
|
||||
for (const auto &entry : realMenu.menuEntries())
|
||||
{
|
||||
if (!entry.isGroup() && !entry.mountingPointId.is_set() )
|
||||
if (!entry.isGroup() && !entry.mountingPointId.has_value() )
|
||||
continue;
|
||||
|
||||
bool isMounted = false;
|
||||
|
||||
if(!entry.isGroup() && entry.mountingPointId.is_set())
|
||||
if(!entry.isGroup() && entry.mountingPointId.has_value())
|
||||
{
|
||||
|
||||
for (const auto &mountedAsset : mountedAssets)
|
||||
|
||||
@@ -92,10 +92,10 @@ Database::AvmCnrConfig toDb(const ModifyCnrConfigRequest &config)
|
||||
result.radioCircuit = QString::fromStdString(config.radioCircuit);
|
||||
result.callSign = QString::fromStdString(config.callSign);
|
||||
result.partyId = config.partyId;
|
||||
if (config.unitId.is_set())
|
||||
if (config.unitId.has_value())
|
||||
result.unitId = config.unitId.get();
|
||||
result.recording = config.recording;
|
||||
if (config.exerciseId.is_set())
|
||||
if (config.exerciseId.has_value())
|
||||
result.exerciseId = config.exerciseId.get();
|
||||
|
||||
return result;
|
||||
@@ -491,7 +491,7 @@ bool CnrHandler::checkConstraint(const std::function<bool (const CnrConfig &)> &
|
||||
// or when both exercises are currently active.
|
||||
// If one is global and one local the constraint must always hold if the local exercise is active
|
||||
// Otherwise the constraint must always hold
|
||||
bool bothLocal = config.exerciseId.is_set() && exerciseId.is_initialized();
|
||||
bool bothLocal = config.exerciseId.has_value() && exerciseId.is_initialized();
|
||||
if (bothLocal)
|
||||
{
|
||||
bool sameExercise = config.exerciseId.get() == *exerciseId;
|
||||
@@ -500,12 +500,12 @@ bool CnrHandler::checkConstraint(const std::function<bool (const CnrConfig &)> &
|
||||
if (!sameExercise && !bothActive)
|
||||
continue;
|
||||
}
|
||||
else if(config.exerciseId.is_set() && !exerciseId.is_initialized())
|
||||
else if(config.exerciseId.has_value() && !exerciseId.is_initialized())
|
||||
{
|
||||
if(!isActiveExercise(config.exerciseId.get()))
|
||||
continue;
|
||||
}
|
||||
else if(exerciseId.is_initialized() && !config.exerciseId.is_set())
|
||||
else if(exerciseId.is_initialized() && !config.exerciseId.has_value())
|
||||
{
|
||||
if(!isActiveExercise(*exerciseId))
|
||||
continue;
|
||||
@@ -663,7 +663,7 @@ bool CnrHandler::isActiveExercise(int exerciseId) const
|
||||
bool CnrHandler::needDeviceConfig(const CnrConfig &config) const
|
||||
{
|
||||
// For global, we always need the config
|
||||
if (!config.exerciseId.is_set())
|
||||
if (!config.exerciseId.has_value())
|
||||
return true;
|
||||
|
||||
int32_t exerciseId = config.exerciseId.get();
|
||||
@@ -703,7 +703,7 @@ bool CnrHandler::haveActiveFrequencyPlanning() const
|
||||
QString CnrHandler::exerciseList(const CnrConfig &config) const
|
||||
{
|
||||
// Local
|
||||
if (config.exerciseId.is_set())
|
||||
if (config.exerciseId.has_value())
|
||||
return ExerciseContext(config.exerciseId.get()).toString();
|
||||
|
||||
// Global - all active exercises, no matter if they have active plannings or not
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ Core::FunctionReplyObject isValid(int configId, int64_t exerciseId, Handler *han
|
||||
return reply.setStr(tr_lts("dds", "%1 config %2 does not exist")).arg(configTypeAsString).arg(configId);
|
||||
|
||||
const auto &config = handler->config(configId);
|
||||
if (config.exerciseId.is_set() && config.exerciseId.get() != exerciseId)
|
||||
if (config.exerciseId.has_value() && config.exerciseId.get() != exerciseId)
|
||||
return reply.setStr(tr_lts("dds", "%1 config %2 cannot be used in exercise %3")).arg(configTypeAsString).arg(configId).arg(exerciseId);
|
||||
|
||||
return reply;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace AudioVideoManagement
|
||||
template<class T>
|
||||
boost::optional<T> toBoost(const dds::core::optional<T> &optionalValue)
|
||||
{
|
||||
if (!optionalValue.is_set())
|
||||
if (!optionalValue.has_value())
|
||||
return boost::none;
|
||||
return optionalValue.get();
|
||||
}
|
||||
|
||||
+7
-7
@@ -87,7 +87,7 @@ Database::AvmFrequencyPlanning toDb(const FrequencyPlanning &ddsPlan)
|
||||
{
|
||||
Database::AvmFrequencyPlanning dbPlan;
|
||||
dbPlan.id = ddsPlan.id;
|
||||
if (ddsPlan.exerciseId.is_set())
|
||||
if (ddsPlan.exerciseId.has_value())
|
||||
dbPlan.exerciseId = ddsPlan.exerciseId.get();
|
||||
dbPlan.dateOfCreation = ddsPlan.date;
|
||||
dbPlan.frequencySetId = ddsPlan.frequencySetId;
|
||||
@@ -385,8 +385,8 @@ Core::FunctionReplyObject FrequencyPlanningHandler::validateModifyRequest(const
|
||||
|
||||
const FrequencyPlanning &oldPlan = *found;
|
||||
|
||||
if ((oldPlan.exerciseId.is_set() && oldPlan.exerciseId.get() != request.exerciseId)
|
||||
|| (!oldPlan.exerciseId.is_set() && request.exerciseId != 0))
|
||||
if ((oldPlan.exerciseId.has_value() && oldPlan.exerciseId.get() != request.exerciseId)
|
||||
|| (!oldPlan.exerciseId.has_value() && request.exerciseId != 0))
|
||||
return reply.setStr(tr_lts("dds", "Exercise may not be changed"));
|
||||
|
||||
if (request.frequencySetId != oldPlan.frequencySetId)
|
||||
@@ -418,7 +418,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const Core::
|
||||
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 does not exist")).arg(request.id);
|
||||
|
||||
const FrequencyPlanning &plan = *foundPlan;
|
||||
int exerciseId = plan.exerciseId.is_set() ? plan.exerciseId.get() : 0;
|
||||
int exerciseId = plan.exerciseId.has_value() ? plan.exerciseId.get() : 0;
|
||||
auto foundActivePlan = m_activePlannings.constFind(exerciseId);
|
||||
bool isActive = foundActivePlan != m_activePlannings.constEnd() && foundActivePlan->frequencyPlanningId == plan.id;
|
||||
if (isActive)
|
||||
@@ -543,7 +543,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::testActivation(const std::ve
|
||||
for (const FrequencyPlanningData &entry : entries)
|
||||
{
|
||||
const CnrConfig &cnrConfig = m_cnrHandler->config(entry.cnrConfigId);
|
||||
bool isGlobal = !cnrConfig.exerciseId.is_set();
|
||||
bool isGlobal = !cnrConfig.exerciseId.has_value();
|
||||
if (!isGlobal)
|
||||
continue;
|
||||
|
||||
@@ -620,7 +620,7 @@ std::vector<int> FrequencyPlanningHandler::takenGlobalCnrConfigs(const std::vect
|
||||
for (const FrequencyPlanningData &entry : plan.data)
|
||||
{
|
||||
const CnrConfig &cnrConfig = m_cnrHandler->config(entry.cnrConfigId);
|
||||
bool isGlobal = !cnrConfig.exerciseId.is_set();
|
||||
bool isGlobal = !cnrConfig.exerciseId.has_value();
|
||||
if (isGlobal)
|
||||
result.push_back(cnrConfig.id);
|
||||
}
|
||||
@@ -775,7 +775,7 @@ void FrequencyPlanningHandler::onCnrConfigRemoved(int cnrConfigId)
|
||||
req.data.erase(found);
|
||||
|
||||
req.date = fp.date;
|
||||
req.exerciseId = fp.exerciseId.is_set() ? fp.exerciseId.get() : 0;
|
||||
req.exerciseId = fp.exerciseId.has_value() ? fp.exerciseId.get() : 0;
|
||||
req.frequencySetId = fp.frequencySetId;
|
||||
req.id = fp.id;
|
||||
req.name = fp.name;
|
||||
|
||||
+3
-3
@@ -29,14 +29,14 @@ static FrequencyPlanningStatus convert(const ModifyFrequencyPlanningStatusReques
|
||||
}
|
||||
newData.uuid = request.uuid.empty() ? oldData.uuid : request.uuid;
|
||||
newData.id = oldData.id;
|
||||
if (request.sent.is_set())
|
||||
if (request.sent.has_value())
|
||||
{
|
||||
newData.sent = request.sent.get();
|
||||
newData.requester = request.requester; // ! Requester is only sent, when data gets sent.
|
||||
}
|
||||
if (request.received.is_set())
|
||||
if (request.received.has_value())
|
||||
newData.received = request.received.get();
|
||||
if (request.activated.is_set())
|
||||
if (request.activated.has_value())
|
||||
{
|
||||
newData.activated = request.activated.get();
|
||||
newData.requester = request.requester; // ! Requester is only sent, when data gets activated.
|
||||
|
||||
+3
-3
@@ -124,11 +124,11 @@ Database::AvmFrequencyPlanningStatus ObjectFrequencyPlanningStatus::toDbData(con
|
||||
dbData.content = QString::fromStdString(ddsData.content);
|
||||
dbData.reason = static_cast<int>(ddsData.reason);
|
||||
|
||||
if (ddsData.sent.is_set())
|
||||
if (ddsData.sent.has_value())
|
||||
dbData.sent = static_cast<qint64>(ddsData.sent.get());
|
||||
if (ddsData.received.is_set())
|
||||
if (ddsData.received.has_value())
|
||||
dbData.received = static_cast<qint64>(ddsData.received.get());
|
||||
if (ddsData.activated.is_set())
|
||||
if (ddsData.activated.has_value())
|
||||
dbData.activated = static_cast<qint64>(ddsData.activated.get());
|
||||
|
||||
return dbData;
|
||||
|
||||
@@ -67,7 +67,7 @@ Database::AvmTvcConfig toDb(const ModifyTvcConfigRequest &request)
|
||||
result.info = QString::fromStdString(request.info);
|
||||
result.recording = request.recording;
|
||||
result.tetraChannelId = request.tetraChannelId;
|
||||
if (request.exerciseId.is_set())
|
||||
if (request.exerciseId.has_value())
|
||||
result.exerciseId = request.exerciseId.get();
|
||||
|
||||
return result;
|
||||
@@ -427,7 +427,7 @@ void TvcHandler::onContextActivated(const ExerciseContext &context)
|
||||
|
||||
for (const TvcConfig &tvcConfig : std::as_const(m_cache))
|
||||
{
|
||||
bool isLocal = tvcConfig.exerciseId.is_set();
|
||||
bool isLocal = tvcConfig.exerciseId.has_value();
|
||||
if (isLocal)
|
||||
{
|
||||
if (tvcConfig.exerciseId == context.id())
|
||||
@@ -449,7 +449,7 @@ void TvcHandler::onContextDeactivated(const ExerciseContext &context)
|
||||
|
||||
for (const TvcConfig &tvcConfig : std::as_const(m_cache))
|
||||
{
|
||||
bool isLocal = tvcConfig.exerciseId.is_set();
|
||||
bool isLocal = tvcConfig.exerciseId.has_value();
|
||||
|
||||
if (isLocal)
|
||||
{
|
||||
@@ -535,7 +535,7 @@ bool TvcHandler::checkConstraint(const std::function<bool (const TvcConfig &)> &
|
||||
// If both configs are local the constraint must hold if they are in the same exercise
|
||||
// or when both exercises are currently active.
|
||||
// Otherwise (one or both are global) the constraint must always hold
|
||||
bool bothLocal = config.exerciseId.is_set() && exerciseId.is_initialized();
|
||||
bool bothLocal = config.exerciseId.has_value() && exerciseId.is_initialized();
|
||||
if (bothLocal)
|
||||
{
|
||||
bool sameExercise = config.exerciseId.get() == *exerciseId;
|
||||
@@ -557,7 +557,7 @@ bool TvcHandler::checkConstraint(const std::function<bool (const TvcConfig &)> &
|
||||
*/
|
||||
QString TvcHandler::exerciseList(const TvcConfig &config) const
|
||||
{
|
||||
bool isLocal = config.exerciseId.is_set();
|
||||
bool isLocal = config.exerciseId.has_value();
|
||||
if (isLocal)
|
||||
return ExerciseContext(config.exerciseId.get()).toString();
|
||||
|
||||
@@ -575,7 +575,7 @@ QString TvcHandler::exerciseList(const TvcConfig &config) const
|
||||
|
||||
bool TvcHandler::needDeviceConfig(const TvcConfig &config) const
|
||||
{
|
||||
bool isGlobal = !config.exerciseId.is_set();
|
||||
bool isGlobal = !config.exerciseId.has_value();
|
||||
bool hasActiveExericse = m_activeExercises->count() > 0;
|
||||
return (isGlobal && hasActiveExericse) || (!isGlobal && isActiveExercise(config.exerciseId.get()));
|
||||
}
|
||||
|
||||
+19
-19
@@ -62,29 +62,29 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
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 State=" << data.effectStateId()
|
||||
<< " id=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionSingle State=" << data.effectStateId
|
||||
<< " id=" << data.id;
|
||||
if (handleExplosion)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated) HandlerArtillerieSound";
|
||||
@@ -107,7 +107,7 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
<< "/" << i.value().positionUtm.y()
|
||||
<< " zone=" << i.value().zone;
|
||||
// Calculate the distance between the speaker and the explosion
|
||||
const QPointF posExplosionUtm = CentralEffectSimulation::geographic2Utm(data.impactPosition(), i.value().zone);
|
||||
const QPointF posExplosionUtm = CentralEffectSimulation::geographic2Utm(data.impactPosition, i.value().zone);
|
||||
const qreal distance = qSqrt(qPow(posExplosionUtm.x() - i.value().positionUtm.x(), 2) + qPow(posExplosionUtm.y() - i.value().positionUtm.y(), 2));
|
||||
int sound = Settings::cesSoundId();
|
||||
const qreal distanceThreshold = Settings::cesDistanceThreshold(); // [m]
|
||||
@@ -193,24 +193,24 @@ void HandlerArtillerieSound::onTechnicalAreaChanged(const AreaEffectSimulation::
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
{
|
||||
m_technicalAreas.remove(data.id());
|
||||
m_technicalAreas.remove(data.id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Remove TechnicalArea";
|
||||
m_technicalAreas.remove(data.id());
|
||||
m_technicalAreas.remove(data.id);
|
||||
return;
|
||||
}
|
||||
if (data.type() == AreaEffectSimulation::AesTechnicalAreaType::TatSoundZone)
|
||||
if (data.type == AreaEffectSimulation::AesTechnicalAreaType::TatSoundZone)
|
||||
{
|
||||
int zone = -1;
|
||||
m_technicalAreas.insert(data.id(), data);
|
||||
DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound id=" << data.id();
|
||||
QPointF cornerButtomLeft = CentralEffectSimulation::geographic2Utm(data.area().cornerBottomLeft(), &zone);
|
||||
qreal x = cornerButtomLeft.x() + data.area().width() / 2;
|
||||
qreal y = cornerButtomLeft.y() + data.area().height() / 2;
|
||||
m_technicalAreas.insert(data.id, data);
|
||||
DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound id=" << data.id;
|
||||
QPointF cornerButtomLeft = CentralEffectSimulation::geographic2Utm(data.area.cornerBottomLeft, &zone);
|
||||
qreal x = cornerButtomLeft.x() + data.area.width / 2;
|
||||
qreal y = cornerButtomLeft.y() + data.area.height / 2;
|
||||
QPointF center(x, y);
|
||||
DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound cornerButtomLeft = " << cornerButtomLeft.x() << "/" << cornerButtomLeft.y()
|
||||
<< " zone=" << zone;
|
||||
|
||||
+32
-32
@@ -69,14 +69,14 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
DEBUG_LOG(m_logger) << " remove Borderline- data.id()=" << data.id();
|
||||
m_borderlines.remove(data.id());
|
||||
DEBUG_LOG(m_logger) << " remove Borderline- data.id()=" << data.id;
|
||||
m_borderlines.remove(data.id);
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
{
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
switch (effectState.underlying())
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived:
|
||||
case AreaEffectSimulation::AesEffectState::EsFired:
|
||||
@@ -85,14 +85,14 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
BorderlineUtm borderline(data);
|
||||
DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id();
|
||||
m_borderlines.insert(data.id(), borderline);
|
||||
DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id;
|
||||
m_borderlines.insert(data.id, borderline);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesEffectState::EsRemoved:
|
||||
case AreaEffectSimulation::AesEffectState::EsExpired:
|
||||
case AreaEffectSimulation::AesEffectState::EsPaused:
|
||||
m_borderlines.remove(data.id());
|
||||
m_borderlines.remove(data.id);
|
||||
break;
|
||||
case AreaEffectSimulation::AesEffectState::EsUnknown:
|
||||
case AreaEffectSimulation::AesEffectState::EsError:
|
||||
@@ -111,7 +111,7 @@ bool HandlerParticipantBorderline::intersect(const QPolygonF &polygonf, const QL
|
||||
{
|
||||
const QLineF segment(a, b);
|
||||
DEBUG_LOG(m_logger) << "segment:" << CentralEffectSimulation::debug(a) << " - " << CentralEffectSimulation::debug(b);
|
||||
if (QLineF::BoundedIntersection == linef.intersect(segment, nullptr))
|
||||
if (QLineF::BoundedIntersection == linef.intersects(segment, nullptr))
|
||||
return true;
|
||||
a = b;
|
||||
}
|
||||
@@ -123,8 +123,8 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
|
||||
{
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG(m_logger) << "ParicipantStep "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " participantId=" << partPos.participantId
|
||||
<< " participantTypeId=" << partPos.participantTypeId
|
||||
<< " Anzahl Borderlines=" << m_borderlines.size();
|
||||
|
||||
for (const BorderlineUtm &borderline : std::as_const(m_borderlines))
|
||||
@@ -132,7 +132,7 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
|
||||
DEBUG_LOG(m_logger) << "borderline id = " << borderline.id
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(borderline.boundingBox.bottomLeft())
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(borderline.boundingBox.topRight());
|
||||
const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId(), borderline.zone);
|
||||
const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId, borderline.zone);
|
||||
if (utmStepPoly.size() < 2)
|
||||
continue;
|
||||
|
||||
@@ -162,7 +162,7 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition,
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId);
|
||||
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -170,40 +170,40 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
return;
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
return;
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId
|
||||
<< " lat= " << participantPosition.pos.lat
|
||||
<< " lon= " << participantPosition.pos.lon
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
<< " eventType=" << eventType;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.eventTypeId(eventType);
|
||||
pe.participantId(participantPosition.participantId());
|
||||
pe.eventTime(participantPosition.sampleTime());
|
||||
pe.aesItemId(borderline.id);
|
||||
pe.partyId(participantPosition.partyId());
|
||||
pe.aesName(borderline.name.toStdString());
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.position(participantPosition.pos());
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantPosition.participantId;
|
||||
pe.eventTime = participantPosition.sampleTime;
|
||||
pe.aesItemId = borderline.id;
|
||||
pe.partyId = participantPosition.partyId;
|
||||
pe.aesName = borderline.name.toStdString();
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.position = participantPosition.pos;
|
||||
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
qint64 id = pe.id();
|
||||
qint64 id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
|
||||
HandlerParticipantBorderline::BorderlineUtm::BorderlineUtm(const AreaEffectSimulation::Borderline &bl)
|
||||
: id(bl.id())
|
||||
, operatorId(bl.operatorId())
|
||||
, partyId(bl.partyId.is_set() ? bl.partyId.get() : -1)
|
||||
, name(QString::fromStdString(bl.name()))
|
||||
: id(bl.id)
|
||||
, operatorId(bl.operatorId)
|
||||
, partyId(bl.partyId.has_value() ? bl.partyId.get() : -1)
|
||||
, name(QString::fromStdString(bl.name))
|
||||
{
|
||||
points.reserve(bl.segments().size());
|
||||
for (const Core::GeoPosition2D &pointGeo : bl.segments())
|
||||
points.reserve(bl.segments.size());
|
||||
for (const Core::GeoPosition2D &pointGeo : bl.segments)
|
||||
points.push_back(CentralEffectSimulation::geographic2Utm(pointGeo, &zone));
|
||||
|
||||
boundingBox = points.boundingRect();
|
||||
|
||||
+34
-34
@@ -69,12 +69,12 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovement &data : std::as_const(simMoveVec))
|
||||
{
|
||||
CentralEffectSimulation::SimulatedMovement request;
|
||||
request.id(data.id);
|
||||
request.name(data.name.toStdString());
|
||||
request.startTime(data.startTime);
|
||||
request.participantId(data.participantId);
|
||||
request.repeat(data.repeat);
|
||||
request.nextPoint(data.nextpoint);
|
||||
request.id = data.id;
|
||||
request.name = data.name.toStdString();
|
||||
request.startTime = data.startTime;
|
||||
request.participantId = data.participantId;
|
||||
request.repeat = data.repeat;
|
||||
request.nextPoint = data.nextpoint;
|
||||
DEBUG_LOG(m_logger) << "Loading SimulatedMovement: " << request;
|
||||
|
||||
QMap <int, CentralEffectSimulation::Database::CesSimulatedMovementSegment> segDbMap; // QMap to get it sorted
|
||||
@@ -83,16 +83,16 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
if (segData.simulatedMovementId == data.id)
|
||||
segDbMap.insert(segData.positionIndex, segData);
|
||||
}
|
||||
request.segments().reserve(segDbMap.size());
|
||||
request.segments.reserve(segDbMap.size());
|
||||
CentralEffectSimulation::SimulatedMovementSegment seg;
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segDb : std::as_const(segDbMap))
|
||||
{
|
||||
seg.delay(segDb.delay);
|
||||
seg.name(segDb.name.toStdString());
|
||||
seg.speed(segDb.speed);
|
||||
seg.position(Core::GeoPosition2D(segDb.position.x(),
|
||||
segDb.position.y()));
|
||||
request.segments().push_back(seg);
|
||||
seg.delay = segDb.delay;
|
||||
seg.name = segDb.name.toStdString();
|
||||
seg.speed = segDb.speed;
|
||||
seg.position = Core::GeoPosition2D(segDb.position.x(),
|
||||
segDb.position.y());
|
||||
request.segments.push_back(seg);
|
||||
}
|
||||
SimulationMovement *sm = new SimulationMovement(m_ddsHandler, m_db, m_handlerParticipant, request);
|
||||
m_simulationMovements.insert(sm->id(), sm);
|
||||
@@ -108,8 +108,8 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
if (m_simulationMovements.contains(request.id()))
|
||||
newSimulatedMovement.nextpoint = m_simulationMovements.value(request.id())->getNextPoint();
|
||||
if (m_simulationMovements.contains(request.id))
|
||||
newSimulatedMovement.nextpoint = m_simulationMovements.value(request.id)->getNextPoint();
|
||||
else // new Simulation
|
||||
newSimulatedMovement.nextpoint = 1;
|
||||
|
||||
@@ -119,13 +119,13 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
CentralEffectSimulation::Database::CesSimulatedMovementSegment newSegment;
|
||||
newSegment.simulatedMovementId = newSimulatedMovement.id;
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments())
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments)
|
||||
{
|
||||
newSegment.id = 0; // insert
|
||||
newSegment.delay = seg.delay();
|
||||
newSegment.speed = seg.speed();
|
||||
newSegment.name = QString::fromStdString(seg.name());
|
||||
newSegment.position = QPointF(seg.position().lon(), seg.position().lat());
|
||||
newSegment.delay = seg.delay;
|
||||
newSegment.speed = seg.speed;
|
||||
newSegment.name = QString::fromStdString(seg.name);
|
||||
newSegment.position = QPointF(seg.position.lon, seg.position.lat);
|
||||
if (!m_db->insert(newSegment))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error adding 'CesSimulatedMovementSegment' to database"));
|
||||
|
||||
@@ -134,7 +134,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
trans.commit();
|
||||
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id;
|
||||
return Core::FunctionReplyObject(newSimulatedMovement.id);
|
||||
} // end of insertInDb
|
||||
|
||||
@@ -152,19 +152,19 @@ Core::FunctionReplyObject HandlerSimulatedMovement::updateDb(const CentralEffect
|
||||
// Insert new segments:
|
||||
CentralEffectSimulation::Database::CesSimulatedMovementSegment newSegment;
|
||||
newSegment.simulatedMovementId = newSimulatedMovement.id;
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments())
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments)
|
||||
{
|
||||
newSegment.id = 0; // insert
|
||||
newSegment.delay = seg.delay();
|
||||
newSegment.speed = seg.speed();
|
||||
newSegment.name = QString::fromStdString(seg.name());
|
||||
newSegment.position = QPointF(seg.position().lon(), seg.position().lat());
|
||||
newSegment.delay = seg.delay;
|
||||
newSegment.speed = seg.speed;
|
||||
newSegment.name = QString::fromStdString(seg.name);
|
||||
newSegment.position = QPointF(seg.position.lon, seg.position.lat);
|
||||
if (!m_db->insert(newSegment))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error adding 'CesSimulatedMovementSegment' to database"));
|
||||
++newSegment.positionIndex;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id;
|
||||
return Core::FunctionReplyObject(newSimulatedMovement.id);
|
||||
} // end of updateDb
|
||||
|
||||
@@ -208,23 +208,23 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core:
|
||||
const CentralEffectSimulation::SimulatedMovement &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSimulatedMovementModifyRequest: " << request;
|
||||
m_jumpToStart = request.jumpToStart();
|
||||
m_jumpToStart = request.jumpToStart;
|
||||
|
||||
// we allow a modify with requestId = 0 and participantId != 0
|
||||
SimulationMovement *sm = findSimulationMovement(request.id(), request.participantId());
|
||||
SimulationMovement *sm = findSimulationMovement(request.id, request.participantId);
|
||||
if (sm)
|
||||
sm->setSimulatedMovementRequest(request);
|
||||
else
|
||||
sm = new SimulationMovement(m_ddsHandler, m_db, m_handlerParticipant, request);
|
||||
|
||||
// New Route
|
||||
if (request.jumpToStart())
|
||||
if (request.jumpToStart)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sm->setJump(true)";
|
||||
sm->setJump(true);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject reply = request.id() > 0
|
||||
Core::FunctionReplyObject reply = request.id > 0
|
||||
? updateDb(sm->simMovementData())
|
||||
: insertInDb(sm->simMovementData());
|
||||
|
||||
@@ -232,7 +232,7 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core:
|
||||
m_simulationMovements[sm->id()] = sm;
|
||||
publishSimulatedMovement(request);
|
||||
|
||||
setParticipantAsSimulated(request.participantId(), true);
|
||||
setParticipantAsSimulated(request.participantId, true);
|
||||
|
||||
DEBUG_LOG(m_logger) << "simulatedMovementModifyReply id=" << reply.id();
|
||||
|
||||
@@ -268,7 +268,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::removeSimulatedMovement(int3
|
||||
void HandlerSimulatedMovement::onSimulatedMovementRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject reply = removeSimulatedMovement(request.id());
|
||||
Core::FunctionReplyObject reply = removeSimulatedMovement(request.id);
|
||||
if (reply.error())
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
m_ddsHandler->ftsCes()->simulatedMovementRemoveReply(cookie, reply);
|
||||
@@ -283,7 +283,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(c
|
||||
int id = 0;
|
||||
for (const SimulationMovement *simMovement : std::as_const(m_simulationMovements))
|
||||
{
|
||||
if (simMovement->participantId() == request.participantId())
|
||||
if (simMovement->participantId() == request.participantId)
|
||||
{
|
||||
id = simMovement->id();
|
||||
break;
|
||||
|
||||
+75
-75
@@ -44,18 +44,18 @@ SimulationMovement::SimulationMovement(const std::shared_ptr<CentralEffectSimula
|
||||
SimulationMovement::~SimulationMovement()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete SimulatedMovement "
|
||||
<< " id=" << m_simMovement.id()
|
||||
<< " participantId= " << m_simMovement.participantId();
|
||||
m_ddsHandler->dtsCes()->removeSimulatedMovementByKey(m_simMovement.id());
|
||||
<< " id=" << m_simMovement.id
|
||||
<< " participantId= " << m_simMovement.participantId;
|
||||
m_ddsHandler->dtsCes()->removeSimulatedMovementByKey(m_simMovement.id);
|
||||
m_segTimer->stop();
|
||||
m_moveTimer->stop();
|
||||
}
|
||||
|
||||
void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulation::SimulatedMovement &sml)
|
||||
{
|
||||
int nextPoint = m_simMovement.nextPoint();
|
||||
int nextPoint = m_simMovement.nextPoint;
|
||||
m_simMovement = sml;
|
||||
m_simMovement.nextPoint(nextPoint);
|
||||
m_simMovement.nextPoint = nextPoint;
|
||||
|
||||
m_moveTime = 1;
|
||||
m_segTimer->stop();
|
||||
@@ -64,32 +64,32 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
m_points.clear();
|
||||
m_segSpeed.clear();
|
||||
m_segDelay.clear();
|
||||
m_points.reserve(sml.segments().size());
|
||||
m_segSpeed.reserve(sml.segments().size());
|
||||
m_segDelay.reserve(sml.segments().size());
|
||||
m_points.reserve(sml.segments.size());
|
||||
m_segSpeed.reserve(sml.segments.size());
|
||||
m_segDelay.reserve(sml.segments.size());
|
||||
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &point : sml.segments())
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &point : sml.segments)
|
||||
{
|
||||
const Core::GeoPosition2D &pointGeo = point.position();
|
||||
const Core::GeoPosition2D &pointGeo = point.position;
|
||||
m_points.push_back(m_zone == -1 ? CentralEffectSimulation::geographic2Utm(pointGeo, &m_zone) : CentralEffectSimulation::geographic2Utm(pointGeo, m_zone));
|
||||
DEBUG_LOG(m_logger) << "pointGeo lat=" << pointGeo.lat() << " lon=" << pointGeo.lon()
|
||||
<< " point lat=" << point.position().lat() << " lon=" << point.position().lon()
|
||||
DEBUG_LOG(m_logger) << "pointGeo lat=" << pointGeo.lat << " lon=" << pointGeo.lon
|
||||
<< " point lat=" << point.position.lat << " lon=" << point.position.lon
|
||||
<< " utmPoint=" << CentralEffectSimulation::debug(m_points.last());
|
||||
m_segSpeed.append(point.speed());
|
||||
m_segDelay.append(point.delay());
|
||||
m_segSpeed.append(point.speed);
|
||||
m_segDelay.append(point.delay);
|
||||
}
|
||||
|
||||
// Only start simulation in future
|
||||
DEBUG_LOG(m_logger) << "m_startTime - QDateTime::currentMSecsSinceEpoch()=" << m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_startTime=" << m_simMovement.startTime()
|
||||
DEBUG_LOG(m_logger) << "m_startTime - QDateTime::currentMSecsSinceEpoch()=" << m_simMovement.startTime - QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_startTime=" << m_simMovement.startTime
|
||||
<< " currentTime=" << QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_nextPoint=" << m_simMovement.nextPoint();
|
||||
<< " m_nextPoint=" << m_simMovement.nextPoint;
|
||||
|
||||
if (m_simMovement.nextPoint() > 0 && m_points.size() > m_simMovement.nextPoint())
|
||||
m_newPos = m_points[m_simMovement.nextPoint()].toPoint();
|
||||
if (m_simMovement.nextPoint > 0 && m_points.size() > m_simMovement.nextPoint)
|
||||
m_newPos = m_points[m_simMovement.nextPoint].toPoint();
|
||||
|
||||
if (m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch() > 0)
|
||||
m_moveTimer->start(m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch());
|
||||
if (m_simMovement.startTime - QDateTime::currentMSecsSinceEpoch() > 0)
|
||||
m_moveTimer->start(m_simMovement.startTime - QDateTime::currentMSecsSinceEpoch());
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Service-Start";
|
||||
@@ -99,7 +99,7 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
|
||||
void SimulationMovement::updateNextPointInDb()
|
||||
{
|
||||
if (m_simMovement.id() <= 0)
|
||||
if (m_simMovement.id <= 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Internal error - id not set!";
|
||||
return;
|
||||
@@ -111,55 +111,55 @@ void SimulationMovement::updateNextPointInDb()
|
||||
|
||||
void SimulationMovement::startNewSegment()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "simulate participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint = " << m_simMovement.nextPoint();
|
||||
DEBUG_LOG(m_logger) << "simulate participantId = " << m_simMovement.participantId
|
||||
<< " m_nextPoint = " << m_simMovement.nextPoint;
|
||||
|
||||
m_moveTime = 1;
|
||||
if (m_simMovement.nextPoint() < m_points.size())
|
||||
if (m_simMovement.nextPoint < m_points.size())
|
||||
{
|
||||
QPointF p1;
|
||||
// Next segment
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData pos = m_handlerParticipant->position(m_simMovement.participantId());
|
||||
if (pos.participantId() == m_simMovement.participantId())
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData pos = m_handlerParticipant->position(m_simMovement.participantId);
|
||||
if (pos.participantId == m_simMovement.participantId)
|
||||
{
|
||||
p1 = CentralEffectSimulation::geographic2Utm(pos.pos(), m_zone);
|
||||
p1 = CentralEffectSimulation::geographic2Utm(pos.pos, m_zone);
|
||||
DEBUG_LOG(m_logger) << "Next segment ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_simStart) // Wait for participantPosition
|
||||
{
|
||||
INFO_LOG(m_logger) << "Wait for participant position participantId =" << m_simMovement.participantId();
|
||||
INFO_LOG(m_logger) << "Wait for participant position participantId =" << m_simMovement.participantId;
|
||||
m_segTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
if (m_simMovement.nextPoint() > 0)
|
||||
if (m_simMovement.nextPoint > 0)
|
||||
{
|
||||
p1 = m_points.at(m_simMovement.participantId() - 1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint>0 (" << m_simMovement.nextPoint() << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
p1 = m_points.at(m_simMovement.participantId - 1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint>0 (" << m_simMovement.nextPoint << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
p1 = m_points.at(m_points.size() - 1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint=" << m_simMovement.nextPoint() << " ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint=" << m_simMovement.nextPoint << " ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
}
|
||||
const QPointF &p2 = m_points.at(m_simMovement.nextPoint());
|
||||
const QPointF &p2 = m_points.at(m_simMovement.nextPoint);
|
||||
m_actSegment.setPoints(p1, p2);
|
||||
int curDelay = m_segDelay.at(m_simMovement.nextPoint());
|
||||
int curDelay = m_segDelay.at(m_simMovement.nextPoint);
|
||||
DEBUG_LOG(m_logger) << "New Segment: p1 = " << CentralEffectSimulation::debug(p1) << " p2=" << CentralEffectSimulation::debug(p2)
|
||||
<< " delay =" << curDelay;
|
||||
m_moveTimer->start(curDelay);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_simMovement.repeat())
|
||||
if (m_simMovement.repeat)
|
||||
{
|
||||
m_simMovement.nextPoint(0);
|
||||
m_moveTimer->start(m_segDelay.at(m_simMovement.nextPoint()));
|
||||
m_simMovement.nextPoint = 0;
|
||||
m_moveTimer->start(m_segDelay.at(m_simMovement.nextPoint));
|
||||
}
|
||||
else
|
||||
m_simMovement.nextPoint(-1); // Invalid value
|
||||
m_simMovement.nextPoint = -1; // Invalid value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,10 +168,10 @@ void SimulationMovement::setJump(bool jump)
|
||||
DEBUG_LOG(m_logger) << "Jump";
|
||||
if (jump)
|
||||
{
|
||||
m_simMovement.nextPoint(1);
|
||||
m_simMovement.nextPoint = 1;
|
||||
m_newPos = m_points.at(0);
|
||||
m_actSegment.setPoints(m_newPos,
|
||||
m_points.at(m_simMovement.nextPoint()));
|
||||
m_points.at(m_simMovement.nextPoint));
|
||||
m_moveTime = 1;
|
||||
m_simStart = false;
|
||||
publishNewPos();
|
||||
@@ -181,7 +181,7 @@ void SimulationMovement::setJump(bool jump)
|
||||
|
||||
void SimulationMovement::publishSimulatedMovement()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " m_nextPoint= " << m_simMovement.nextPoint();
|
||||
DEBUG_LOG(m_logger) << " m_nextPoint= " << m_simMovement.nextPoint;
|
||||
m_ddsHandler->dtsCes()->publish(m_simMovement);
|
||||
}
|
||||
|
||||
@@ -202,10 +202,10 @@ void SimulationMovement::publishNewPos()
|
||||
|
||||
const Core::GeoPosition pos(Core::GeoPosition(posGeo.x(), posGeo.y(), 0));
|
||||
|
||||
participantPos.equipmentNumber(-m_simMovement.participantId()); // negative - treat as participantId
|
||||
participantPos.sampleTime(m_ddsHandler->currentPartitionTime());
|
||||
participantPos.position().position(pos);
|
||||
participantPos.position().reportingSource(Core::PositionReportingSource::MovementSimulation);
|
||||
participantPos.equipmentNumber = -m_simMovement.participantId; // negative - treat as participantId
|
||||
participantPos.sampleTime = m_ddsHandler->currentPartitionTime();
|
||||
participantPos.position.position = pos;
|
||||
participantPos.position.reportingSource = Core::PositionReportingSource::MovementSimulation;
|
||||
|
||||
m_ddsHandler->dtsTab()->publish(participantPos);
|
||||
|
||||
@@ -214,23 +214,23 @@ void SimulationMovement::publishNewPos()
|
||||
void SimulationMovement::move()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move";
|
||||
if (m_simMovement.nextPoint() < 0)
|
||||
if (m_simMovement.nextPoint < 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move next point < 0";
|
||||
return;
|
||||
}
|
||||
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(m_simMovement.participantId());
|
||||
const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(partPos.pos(), m_zone);
|
||||
if (partPos.participantId() != m_simMovement.participantId())
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(m_simMovement.participantId);
|
||||
const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(partPos.pos, m_zone);
|
||||
if (partPos.participantId != m_simMovement.participantId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId;
|
||||
m_moveTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
if (!partPos.positionValid)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId;
|
||||
m_moveTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void SimulationMovement::move()
|
||||
if (m_simStart)
|
||||
{
|
||||
m_actSegment.setPoints(participantPosUtm,
|
||||
m_points.at(m_simMovement.nextPoint()));
|
||||
m_points.at(m_simMovement.nextPoint));
|
||||
step = m_actSegment;
|
||||
DEBUG_LOG(m_logger) << "m_simStart set m_actSegment"
|
||||
<< " p1: " << CentralEffectSimulation::debug(m_actSegment.p1())
|
||||
@@ -248,14 +248,14 @@ void SimulationMovement::move()
|
||||
m_simStart = false;
|
||||
}
|
||||
|
||||
if (m_segSpeed[m_simMovement.nextPoint()] <= 0.0)
|
||||
if (m_segSpeed[m_simMovement.nextPoint] <= 0.0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move next point < 0";
|
||||
return;
|
||||
}
|
||||
|
||||
m_newPos = m_points[m_simMovement.nextPoint()];
|
||||
step.setLength(m_segSpeed[m_simMovement.nextPoint()] * m_moveTime);
|
||||
m_newPos = m_points[m_simMovement.nextPoint];
|
||||
step.setLength(m_segSpeed[m_simMovement.nextPoint] * m_moveTime);
|
||||
m_moveTime++;
|
||||
// ready criterion
|
||||
if (step.length() >= m_actSegment.length() + 0.1 ||
|
||||
@@ -263,25 +263,25 @@ void SimulationMovement::move()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move ready step.length()=" << step.length()
|
||||
<< " m_actSegment.length()=" << m_actSegment.length();
|
||||
m_simMovement.nextPoint(m_simMovement.nextPoint() + 1);
|
||||
if (m_simMovement.nextPoint() >= m_points.size())
|
||||
m_simMovement.nextPoint = m_simMovement.nextPoint + 1;
|
||||
if (m_simMovement.nextPoint >= m_points.size())
|
||||
{
|
||||
if (m_simMovement.repeat())
|
||||
m_simMovement.nextPoint(0);
|
||||
if (m_simMovement.repeat)
|
||||
m_simMovement.nextPoint = 0;
|
||||
else
|
||||
{
|
||||
m_simMovement.nextPoint(-1); // Invalid value
|
||||
m_simMovement.nextPoint = -1; // Invalid value
|
||||
return;
|
||||
}
|
||||
}
|
||||
updateNextPointInDb();
|
||||
DEBUG_LOG(m_logger) << "ready move participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint()
|
||||
DEBUG_LOG(m_logger) << "ready move participantId = " << m_simMovement.participantId
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint
|
||||
<< " newPos =" << m_newPos.x() << "/" << m_newPos.y()
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint()] * m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint] * m_moveTime
|
||||
<< " step.length=" << step.length()
|
||||
<< " m_segSpeed[m_nextPoint]=" << m_segSpeed[m_simMovement.nextPoint()]
|
||||
<< " m_segSpeed[m_nextPoint]=" << m_segSpeed[m_simMovement.nextPoint]
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " m_actSegment.length=" << m_actSegment.length()
|
||||
<< " m_zone=" << m_zone;
|
||||
@@ -291,13 +291,13 @@ void SimulationMovement::move()
|
||||
return;
|
||||
}
|
||||
m_newPos = step.p2();
|
||||
DEBUG_LOG(m_logger) << "move participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint()
|
||||
DEBUG_LOG(m_logger) << "move participantId = " << m_simMovement.participantId
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint
|
||||
<< " newPos =" << m_newPos.x() << "/" << m_newPos.y()
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint()] * m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint] * m_moveTime
|
||||
<< " step.length=" << step.length()
|
||||
<< " m_speed=" << m_segSpeed[m_simMovement.nextPoint()]
|
||||
<< " m_speed=" << m_segSpeed[m_simMovement.nextPoint]
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " m_actSegment.length=" << m_actSegment.length()
|
||||
<< " m_zone=" << m_zone;
|
||||
@@ -308,12 +308,12 @@ void SimulationMovement::move()
|
||||
CentralEffectSimulation::Database::CesSimulatedMovement SimulationMovement::toDb(const CentralEffectSimulation::SimulatedMovement &ddsSimMovement)
|
||||
{
|
||||
CentralEffectSimulation::Database::CesSimulatedMovement ret;
|
||||
ret.id = ddsSimMovement.id();
|
||||
ret.name = QString::fromStdString(ddsSimMovement.name());
|
||||
ret.startTime = ddsSimMovement.startTime();
|
||||
ret.participantId = ddsSimMovement.participantId();
|
||||
ret.repeat = ddsSimMovement.repeat();
|
||||
ret.nextpoint = ddsSimMovement.nextPoint();
|
||||
ret.id = ddsSimMovement.id;
|
||||
ret.name = QString::fromStdString(ddsSimMovement.name);
|
||||
ret.startTime = ddsSimMovement.startTime;
|
||||
ret.participantId = ddsSimMovement.participantId;
|
||||
ret.repeat = ddsSimMovement.repeat;
|
||||
ret.nextpoint = ddsSimMovement.nextPoint;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -32,13 +32,13 @@ public:
|
||||
|
||||
~SimulationMovement();
|
||||
void setSimulatedMovementRequest(const CentralEffectSimulation::SimulatedMovement &sml);
|
||||
int id() const { return m_simMovement.id(); }
|
||||
void setId(int id) { m_simMovement.id(id); }
|
||||
int participantId() const { return m_simMovement.participantId(); }
|
||||
int id() const { return m_simMovement.id; }
|
||||
void setId(int id) { m_simMovement.id = id; }
|
||||
int participantId() const { return m_simMovement.participantId; }
|
||||
|
||||
void setJump(bool jump);
|
||||
void setnextPoint(int nextPoint) { m_simMovement.nextPoint(nextPoint); }
|
||||
int getNextPoint() const { return m_simMovement.nextPoint(); }
|
||||
void setnextPoint(int nextPoint) { m_simMovement.nextPoint = nextPoint; }
|
||||
int getNextPoint() const { return m_simMovement.nextPoint; }
|
||||
void publishSimulatedMovement();
|
||||
const CentralEffectSimulation::SimulatedMovement &simMovementData() const { return m_simMovement; }
|
||||
|
||||
|
||||
+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;
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsUnknown:
|
||||
case AreaEffectSimulation::AesEffectState::EsError:
|
||||
@@ -381,7 +381,7 @@ void HandlerAesData::onSendCesHitInformationReply(const Core::FunctionReplyObjec
|
||||
void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data, const Footprint &footprint)
|
||||
{
|
||||
// check for correct AES type artillery only
|
||||
switch (data.aesTypeId().underlying())
|
||||
switch (data.aesTypeId())
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
|
||||
+20
-20
@@ -26,7 +26,7 @@ namespace core
|
||||
{
|
||||
inline uint qHash(ProjectDataManagement::PdmEventType et)
|
||||
{
|
||||
return ::qHash(et.underlying());
|
||||
return ::qHash(et);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId());
|
||||
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
|
||||
switch (effectState.underlying())
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsPrepared:
|
||||
{
|
||||
@@ -291,7 +291,7 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
{
|
||||
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
|
||||
|
||||
switch (data.aesTypeId().underlying())
|
||||
switch (data.aesTypeId())
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
@@ -353,7 +353,7 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
@@ -361,7 +361,7 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
|
||||
CentralEffectSimulation::AesItemViewUtm itemView;
|
||||
itemView.aesItemId = data.id();
|
||||
itemView.chargeTypeId = data.chargeTypeId();
|
||||
itemView.partyId = data.partyId.is_set() ? data.partyId.get() : -1;
|
||||
itemView.partyId = data.partyId.has_value() ? data.partyId.get() : -1;
|
||||
itemView.aesTypeId = AreaEffectSimulation::AesType::AtDusSingleMine;
|
||||
itemView.effectStart = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
|
||||
itemView.formMines.push_back(CentralEffectSimulation::geographic2Utm(data.position(), &itemView.zone));
|
||||
@@ -394,7 +394,7 @@ void HandlerParticipantArea::onBCContaminationChanged(const AreaEffectSimulation
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived:
|
||||
case AreaEffectSimulation::AesEffectState::EsCreated:
|
||||
@@ -426,7 +426,7 @@ void HandlerParticipantArea::onNContaminationChanged(const AreaEffectSimulation:
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived:
|
||||
case AreaEffectSimulation::AesEffectState::EsCreated:
|
||||
@@ -502,7 +502,7 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
switch (itemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtMineArea:
|
||||
if (inFormCheck(itemView, participantPos))
|
||||
@@ -625,7 +625,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantPosition.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
switch (itemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
sendEffectTypeEvent(itemView, participantPosition, effectTypeForBCContaminationArea(itemView, participantPosUtmPoint), -1, -1);
|
||||
@@ -654,7 +654,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
} // if inside
|
||||
|
||||
// outside
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
switch (itemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
sendEffectTypeEvent(itemView, participantPosition, EffectType::BCContaminationLeave, -1, -1);
|
||||
@@ -698,7 +698,7 @@ void HandlerParticipantArea::onTriggeredImpactsChanged(const AreaEffectSimulatio
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: " << data;
|
||||
switch (data.aesTypeId().underlying())
|
||||
switch (data.aesTypeId())
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
@@ -725,7 +725,7 @@ void HandlerParticipantArea::onExplosionAreaChanged(const AreaEffectSimulation::
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionArea, m_aesItemId2partIdMap.insert " << data.id() << " / " << data.participantId();
|
||||
if (data.participantId.is_set())
|
||||
if (data.participantId.has_value())
|
||||
m_aesItemId2partIdMap.insert(data.id(), data.participantId.get());
|
||||
else
|
||||
m_aesItemId2partIdMap.remove(data.id());
|
||||
@@ -916,7 +916,7 @@ void HandlerParticipantArea::calculateImpacts(const AreaEffectSimulation::Trigge
|
||||
const auto participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : participantPositions)
|
||||
{
|
||||
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
continue;
|
||||
if (pPos.insideBuilding())
|
||||
continue;
|
||||
@@ -992,7 +992,7 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
return;
|
||||
}
|
||||
if (participantPosition.participantId() != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
@@ -1059,7 +1059,7 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
|
||||
} // if
|
||||
|
||||
if (participantPosition.participantId() != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
@@ -1158,14 +1158,14 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
|
||||
pe.eventTypeId(eventType.underlying());
|
||||
pe.eventTypeId(eventType);
|
||||
pe.participantId(participantPosition.participantId());
|
||||
pe.eventTime(participantPosition.sampleTime());
|
||||
pe.aesItemId(itemView.aesItemId);
|
||||
pe.partyId(participantPosition.partyId());
|
||||
//pe.aesName(m_handlerAesData->aesName(itemView.aesItemId));
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.vulnerability(participantPosition.vulnerabilityState.underlying());
|
||||
pe.vulnerability(participantPosition.vulnerabilityState);
|
||||
pe.position(participantPosition.pos());
|
||||
|
||||
// Criterion for friendly Fire:
|
||||
@@ -1267,7 +1267,7 @@ bool HandlerParticipantArea::eventMustBeSend(int aesItemId,
|
||||
activeEvents.insert(eventType);
|
||||
|
||||
// - remove opposite events (e.g remove Enter event when we leave the area)
|
||||
switch (eventType.underlying())
|
||||
switch (eventType)
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea:
|
||||
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
|
||||
@@ -1423,7 +1423,7 @@ bool HandlerParticipantArea::inCircle(const QPointF ¢erUtm, const double rad
|
||||
|
||||
ProjectDataManagement::PdmEventType HandlerParticipantArea::leaveEventTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
|
||||
{
|
||||
switch (aesTypeId.underlying())
|
||||
switch (aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtDangerArea:
|
||||
return ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea;
|
||||
@@ -1441,7 +1441,7 @@ ProjectDataManagement::PdmEventType HandlerParticipantArea::leaveEventTypeForAes
|
||||
|
||||
EffectType HandlerParticipantArea::leaveEffectTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
|
||||
{
|
||||
switch (aesTypeId.underlying())
|
||||
switch (aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
return EffectType::BCContaminationLeave;
|
||||
|
||||
+6
@@ -13,6 +13,12 @@
|
||||
|
||||
#include <PolygonBuilder.h>
|
||||
#include <GeometryEngine.h>
|
||||
#include <Point.h>
|
||||
#include <Geometry.h>
|
||||
#include <Polygon.h>
|
||||
#include <SpatialReference.h>
|
||||
#include <ImmutablePartCollection.h>
|
||||
#include <ImmutablePart.h>
|
||||
|
||||
namespace CesExplosions
|
||||
{
|
||||
|
||||
+228
-227
File diff suppressed because it is too large.
Load diff
+69
-69
@@ -91,62 +91,62 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
{
|
||||
// order checks by effort:
|
||||
if ((modType == DataModification::eRemoved)
|
||||
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
|| (data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
|| (data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
return;
|
||||
|
||||
if (!data.effectStart.is_set())
|
||||
if (!data.effectStart.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "No effectStart";
|
||||
return;
|
||||
}
|
||||
|
||||
// Kriterium fuer NASAT/MIDAS
|
||||
if (m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(data.chargeStruct().chargeTypeId()) == ProjectDataManagement::GearClass::AirSupport)
|
||||
if (m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(data.chargeStruct.chargeTypeId) == ProjectDataManagement::GearClass::GearClass_AirSupport)
|
||||
return;
|
||||
|
||||
if (!m_ddsHandler->isLaserGuidable(data.chargeStruct()))
|
||||
if (!m_ddsHandler->isLaserGuidable(data.chargeStruct))
|
||||
return;
|
||||
|
||||
if (!data.flightCurve.is_set() || !data.laserGuiding.is_set())
|
||||
if (!data.flightCurve.has_value() || !data.laserGuiding.has_value())
|
||||
return;
|
||||
const AreaEffectSimulation::FlightCurve &fcData = data.flightCurve.get();
|
||||
const AreaEffectSimulation::LaserGuiding &lgData = data.laserGuiding.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << "\n onExplosionClusterChanged id=" << data.id()
|
||||
<< " AesEffectState=" << data.effectStateId()
|
||||
<< " lcPrf=" << lgData.lcAttack()
|
||||
<< " originalEffectDuration=" << data.originalEffectDuration()
|
||||
<< " effectStart=" << data.effectStart();
|
||||
DEBUG_LOG(m_logger) << "\n onExplosionClusterChanged id=" << data.id
|
||||
<< " AesEffectState=" << data.effectStateId
|
||||
<< " lcPrf=" << lgData.lcAttack
|
||||
<< " originalEffectDuration=" << data.originalEffectDuration
|
||||
<< " effectStart=" << data.effectStart;
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")"
|
||||
<< " tapTimepoint=" << lgData.tapTime()
|
||||
DEBUG_LOG(m_logger) << "m_prfToAesId.insert(" << lgData.lcAttack << ", " << data.id << ")"
|
||||
<< " tapTimepoint=" << lgData.tapTime
|
||||
<< " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " Timer interval =" << lgData.tapTime() - m_ddsHandler->currentPartitionTime();
|
||||
<< " Timer interval =" << lgData.tapTime - m_ddsHandler->currentPartitionTime();
|
||||
|
||||
int aesId = data.id();
|
||||
int aesId = data.id;
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->setSingleShot(true);
|
||||
QObject::connect(timer, &QTimer::timeout,
|
||||
this, &HandlerVulcano::onFiringTimeTimeout);
|
||||
if (m_aesTimers.contains(data.id()))
|
||||
if (m_aesTimers.contains(data.id))
|
||||
{
|
||||
m_aesTimers.value(data.id())->stop();
|
||||
delete m_aesTimers.value(data.id());
|
||||
m_aesTimers.remove(data.id());
|
||||
m_aesTimers.value(data.id)->stop();
|
||||
delete m_aesTimers.value(data.id);
|
||||
m_aesTimers.remove(data.id);
|
||||
}
|
||||
m_aesTimers.insert(data.id(), timer);
|
||||
m_aesTimers.insert(data.id, timer);
|
||||
timer->setProperty("aesId", aesId);
|
||||
{
|
||||
long long effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
|
||||
long long calculatedFlightDurationMSec = fcData.calculatedFlightDuration();
|
||||
long long effectStart = data.effectStart.has_value() ? data.effectStart.get() : 0;
|
||||
long long calculatedFlightDurationMSec = fcData.calculatedFlightDuration;
|
||||
long long currentPartitionTime = m_ddsHandler->currentPartitionTime();
|
||||
const int timerTimeout = effectStart - calculatedFlightDurationMSec - currentPartitionTime;
|
||||
DEBUG_LOG(m_logger) << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout;
|
||||
if (timerTimeout >= 0)
|
||||
timer->start(timerTimeout);
|
||||
}
|
||||
m_explosionCluster.insert(data.id(), data);
|
||||
m_explosionCluster.insert(data.id, data);
|
||||
}
|
||||
|
||||
void HandlerVulcano::onFiringTimeTimeout()
|
||||
@@ -159,9 +159,9 @@ void HandlerVulcano::onFiringTimeTimeout()
|
||||
|
||||
DEBUG_LOG(m_logger) << "onTimerTimeout aesId=" << aesId;
|
||||
const auto &myEC = m_explosionCluster.value(aesId);
|
||||
if (myEC.id() != aesId)
|
||||
if (myEC.id != aesId)
|
||||
return;
|
||||
if (!myEC.flightCurve.is_set())
|
||||
if (!myEC.flightCurve.has_value())
|
||||
return;
|
||||
const AreaEffectSimulation::FlightCurve &fcData = myEC.flightCurve.get();
|
||||
|
||||
@@ -184,7 +184,7 @@ void HandlerVulcano::onFiringTimeTimeout()
|
||||
timer->setProperty("aesId", aesId);
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId);
|
||||
if (trajectoryTimeAware.geometry().size() < 2)
|
||||
if (trajectoryTimeAware.geometry.size() < 2)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "return";
|
||||
return;
|
||||
@@ -203,12 +203,12 @@ void HandlerVulcano::onFiringTimeTimeout()
|
||||
// ----------------| Surface
|
||||
*/
|
||||
|
||||
const std::vector<Core::GeoPositionRelativeTime> &geometryRef = trajectoryTimeAware.geometry();
|
||||
int calculatedFlightDurationMSec = fcData.calculatedFlightDuration();
|
||||
const std::vector<Core::GeoPositionRelativeTime> &geometryRef = trajectoryTimeAware.geometry;
|
||||
int calculatedFlightDurationMSec = fcData.calculatedFlightDuration;
|
||||
// TAP' kann auch TAP sein -> Es ist immer der vorletzte Wert. = size() - 2.
|
||||
int relTimeTap = geometryRef[geometryRef.size() - 2].relativeTime();
|
||||
int relTimeTap = geometryRef[geometryRef.size() - 2].relativeTime;
|
||||
// Der letzte Wert ist immer der Einschlag = size() - 1.
|
||||
int relTimeExplosion = geometryRef[geometryRef.size() - 1].relativeTime();
|
||||
int relTimeExplosion = geometryRef[geometryRef.size() - 1].relativeTime;
|
||||
// Flugzeit zwischen TAP(') und Einschlag
|
||||
int timeDiffTapToExplosion = relTimeExplosion - relTimeTap;
|
||||
// Somit ist die absolute Zeit am TAP(') die Startzeit abzüglich der Flugzeit
|
||||
@@ -230,33 +230,33 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
m_aesTimers.remove(aesId);
|
||||
DEBUG_LOG(m_logger) << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId;
|
||||
const auto &myEC = m_explosionCluster.value(aesId);
|
||||
if (myEC.id() != aesId)
|
||||
if (myEC.id != aesId)
|
||||
return;
|
||||
if (!myEC.laserGuiding.is_set())
|
||||
if (!myEC.laserGuiding.has_value())
|
||||
return;
|
||||
const AreaEffectSimulation::LaserGuiding &lgData = myEC.laserGuiding.get();
|
||||
|
||||
const int prf = lgData.lcAttack();
|
||||
const int prf = lgData.lcAttack;
|
||||
|
||||
const auto &dtcPpm = m_ddsHandler->dtcPpm();
|
||||
const auto &dtcAes = m_ddsHandler->dtcAes();
|
||||
auto participantId = dtcPpm->getParticipantFromPrf(prf);
|
||||
auto dpd = dtcPpm->dynamicParticipantData(participantId);
|
||||
const auto &designationsVec = dpd.designations();
|
||||
const auto &designationsVec = dpd.designations;
|
||||
DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId;
|
||||
|
||||
for (const auto &designation : std::as_const(designationsVec))
|
||||
{
|
||||
if (designation.code() == prf && designation.outputPower() > 0)
|
||||
if (designation.code == prf && designation.outputPower > 0)
|
||||
{
|
||||
const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId);
|
||||
const std::vector<Core::GeoPositionRelativeTime> &trajGeometry = trajectoryTimeAware.geometry();
|
||||
const std::vector<Core::GeoPositionRelativeTime> &trajGeometry = trajectoryTimeAware.geometry;
|
||||
|
||||
DEBUG_LOG(m_logger) << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size();
|
||||
DEBUG_LOG(m_logger) << "Designation code=" << designation.code()
|
||||
DEBUG_LOG(m_logger) << "Designation code=" << designation.code
|
||||
<< " prf=" << prf
|
||||
<< " outputPower=" << designation.outputPower()
|
||||
<< " designation.spotlocation=" << designation.spotLocation().lon() << "/" << designation.spotLocation().lat();
|
||||
<< " outputPower=" << designation.outputPower
|
||||
<< " designation.spotlocation=" << designation.spotLocation.lon << "/" << designation.spotLocation.lat;
|
||||
|
||||
if (trajGeometry.size() < 2)
|
||||
{
|
||||
@@ -266,20 +266,20 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
|
||||
const Core::GeoPosition topGeo = trajGeometry.at(trajGeometry.size() - 2);
|
||||
const Core::GeoPosition bottomGeo = trajGeometry.at(trajGeometry.size() - 1);
|
||||
const Core::GeoPosition2D pointToTestGeo = designation.spotLocation();
|
||||
const Core::GeoPosition2D pointToTestGeo = designation.spotLocation;
|
||||
|
||||
int zone = -1;
|
||||
const QPointF &topPt = CentralEffectSimulation::geographic2Utm(topGeo, &zone);
|
||||
const QPointF &bottomPt = CentralEffectSimulation::geographic2Utm(bottomGeo, &zone);
|
||||
const QPointF &pointToTestPt = CentralEffectSimulation::geographic2Utm(pointToTestGeo, &zone);
|
||||
|
||||
const QVector3D top(topPt.x(), topPt.y(), topGeo.z());
|
||||
const QVector3D top(topPt.x(), topPt.y(), topGeo.z);
|
||||
DEBUG_LOG(m_logger) << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone;
|
||||
|
||||
const QVector3D bottom(bottomPt.x(), bottomPt.y(), bottomGeo.z());
|
||||
const QVector3D bottom(bottomPt.x(), bottomPt.y(), bottomGeo.z);
|
||||
DEBUG_LOG(m_logger) << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone;
|
||||
|
||||
const QVector3D pointToTest(pointToTestPt.x(), pointToTestPt.y(), designation.spotLocation().z());
|
||||
const QVector3D pointToTest(pointToTestPt.x(), pointToTestPt.y(), designation.spotLocation.z);
|
||||
DEBUG_LOG(m_logger) << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone;
|
||||
|
||||
float vulcanoViewAngleDeg = CesExplosions::Settings::vulcanoViewAngleDeg();
|
||||
@@ -294,7 +294,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto observerPos = dtcPpm->participantPosition(participantId).pos();
|
||||
const auto observerPos = dtcPpm->participantPosition(participantId).pos;
|
||||
QPointF fePt = CentralEffectSimulation::geographic2Utm(trajGeometry.at(0), &zone);
|
||||
QVector3D fe(fePt.x(), fePt.y(), 0);
|
||||
|
||||
@@ -320,11 +320,11 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
|
||||
|
||||
AreaEffectSimulation::TargetPositionsModifyRequest posModify;
|
||||
posModify.aesItemId(aesId);
|
||||
posModify.positions().push_back(designation.spotLocation());
|
||||
DEBUG_LOG(m_logger) << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z()
|
||||
<< " designation.z=" << designation.spotLocation().z()
|
||||
<< " PosVulcano=" << posVulcano.lon() << "/" << posVulcano.lat();
|
||||
posModify.aesItemId = aesId;
|
||||
posModify.positions.push_back(designation.spotLocation);
|
||||
DEBUG_LOG(m_logger) << "targetPositionsModifyRequest z=" << posModify.positions.at(0).z
|
||||
<< " designation.z=" << designation.spotLocation.z
|
||||
<< " PosVulcano=" << posVulcano.lon << "/" << posVulcano.lat;
|
||||
m_ddsHandler->ftcAes()->targetPositionsModifyRequest(posModify, this);
|
||||
return;
|
||||
}
|
||||
@@ -336,7 +336,7 @@ AreaEffectSimulation::TrajectoryTimeAware HandlerVulcano::firstTrajectoryTimeAwa
|
||||
// be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId)
|
||||
const auto &dtcAes = m_ddsHandler->dtcAes();
|
||||
const auto &trajectories = dtcAes->trajectoriesTimeAwareFromOriginatorIdAndType(aesId,
|
||||
ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation);
|
||||
ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation);
|
||||
if (trajectories.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "no trajectories found for originatorId/aesItemId " << aesId;
|
||||
@@ -353,15 +353,15 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
// be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId)
|
||||
const auto &trajectoryTimeAwareValue = firstTrajectoryTimeAwareFromAesId(aesId);
|
||||
|
||||
const qint64 relTime = timeParam - trajectoryTimeAwareValue.trajectoryStartTime();
|
||||
const qint64 relTime = timeParam - trajectoryTimeAwareValue.trajectoryStartTime;
|
||||
|
||||
//trajectoryTimeAwareValue = trajectoryTimeAware(aesId);
|
||||
DEBUG_LOG(m_logger) << " getTrajectoryPosFromTime aesId=" << aesId
|
||||
<< " trajectoryTimeAwareValue.id=" << trajectoryTimeAwareValue.id()
|
||||
<< " trajectoryTimeAwareValue.id=" << trajectoryTimeAwareValue.id
|
||||
<< " time=" << timeParam
|
||||
<< " trajectoryStartTime=" << trajectoryTimeAwareValue.trajectoryStartTime()
|
||||
<< " trajectoryStartTime=" << trajectoryTimeAwareValue.trajectoryStartTime
|
||||
<< " relTime=" << relTime;
|
||||
if (trajectoryTimeAwareValue.geometry().empty())
|
||||
if (trajectoryTimeAwareValue.geometry.empty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "getTrajectoryPosFromTime no pos available";
|
||||
return {};
|
||||
@@ -369,13 +369,13 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
|
||||
Core::GeoPosition result;
|
||||
int i = 0;
|
||||
for (const auto &point : std::as_const(trajectoryTimeAwareValue.geometry()))
|
||||
for (const auto &point : std::as_const(trajectoryTimeAwareValue.geometry))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "time=" << point.relativeTime();
|
||||
if ( (point.relativeTime() > relTime) && (i > 0))
|
||||
DEBUG_LOG(m_logger) << "time=" << point.relativeTime;
|
||||
if ( (point.relativeTime > relTime) && (i > 0))
|
||||
{
|
||||
// Beachte: Geschwindigkeit wird _NICHT_ beruecksichtigt
|
||||
const Core::GeoPositionRelativeTime &geoPosRelTime = trajectoryTimeAwareValue.geometry()[i-1];
|
||||
const Core::GeoPositionRelativeTime &geoPosRelTime = trajectoryTimeAwareValue.geometry[i-1];
|
||||
// avoid expensive operations like following
|
||||
// result.lat() = trajectoryTimeAwareValue.geometry()[i -1].lat();
|
||||
// result.lon() = trajectoryTimeAwareValue.geometry()[i -1].lon();
|
||||
@@ -383,14 +383,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
// and take benefits from downcasting
|
||||
result = geoPosRelTime; // implicit downcast :-)
|
||||
DEBUG_LOG(m_logger) << "found i=" << i
|
||||
<< " result=" << result.lat() << "/" << result.lon() << "/" << result.z();
|
||||
<< " result=" << result.lat << "/" << result.lon << "/" << result.z;
|
||||
return result;
|
||||
}
|
||||
++i;
|
||||
} // for
|
||||
result = trajectoryTimeAwareValue.geometry().back();
|
||||
result = trajectoryTimeAwareValue.geometry.back();
|
||||
DEBUG_LOG(m_logger) << " return last point result="
|
||||
<< " result=" << result.lat() << "/" << result.lon() << "/" << result.z();
|
||||
<< " result=" << result.lat << "/" << result.lon << "/" << result.z;
|
||||
return result;
|
||||
|
||||
}
|
||||
@@ -401,16 +401,16 @@ void HandlerVulcano::onDynamicParticipantChanged(const ParticipantManagement::Dy
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "onDynamicParticipantChanged"
|
||||
<< data.participantId()
|
||||
<< data.designations().size();
|
||||
if (data.designations().size() > 0)
|
||||
<< data.participantId
|
||||
<< data.designations.size();
|
||||
if (data.designations.size() > 0)
|
||||
{
|
||||
for (const ParticipantManagement::LaserDesignation &designation : std::as_const(data.designations()))
|
||||
for (const ParticipantManagement::LaserDesignation &designation : std::as_const(data.designations))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "gearId=" << designation.gearId()
|
||||
<< " code=" << designation.code()
|
||||
<< " z=" << designation.spotLocation().z()
|
||||
<< " outputPower=" << designation.outputPower();
|
||||
DEBUG_LOG(m_logger) << "gearId=" << designation.gearId
|
||||
<< " code=" << designation.code
|
||||
<< " z=" << designation.spotLocation.z
|
||||
<< " outputPower=" << designation.outputPower;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+94
-94
@@ -22,7 +22,7 @@ namespace core
|
||||
{
|
||||
inline uint qHash(ProjectDataManagement::PdmEventType et)
|
||||
{
|
||||
return ::qHash(et.underlying());
|
||||
return ::qHash(et);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,19 +165,19 @@ void HandlerFunctionalAreas::onDemandInitReply(const Core::FunctionReplyObject &
|
||||
// ///////////////////////////////////
|
||||
void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
const int aesItemId = data.aesItemId();
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
if (data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtFunctionalArea)
|
||||
const int aesItemId = data.aesItemId;
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtFunctionalArea)
|
||||
return;
|
||||
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(data.aesItemId());
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(data.aesItemId);
|
||||
|
||||
if (!fa.isCentral())
|
||||
if (!fa.isCentral)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " !isCentral"
|
||||
" Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", type: " << data.aesTypeId
|
||||
<< ", effectState: " << data.effectStateId
|
||||
<< ", modType: " << modType;
|
||||
if (m_aesItemViews.contains(aesItemId))
|
||||
m_aesItemViews.remove(aesItemId);
|
||||
@@ -186,50 +186,50 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", type: " << data.aesTypeId
|
||||
<< ", effectState: " << data.effectStateId
|
||||
<< ", modType: " << modType;
|
||||
|
||||
|
||||
switch (effectState.underlying())
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsPrepared:
|
||||
break;
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
bool isSupplyTruck = false;
|
||||
if (fa.supplyMode() == AreaEffectSimulation::AesOperatingMode::OmWaitingTime)
|
||||
if (fa.supplyMode == AreaEffectSimulation::AesOperatingMode::OmWaitingTime)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isSupplyTruck = true";
|
||||
isSupplyTruck = true;
|
||||
}
|
||||
auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], 0, isSupplyTruck));
|
||||
if (fa.participantId.is_set())
|
||||
auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId], 0, isSupplyTruck));
|
||||
if (fa.participantId.has_value())
|
||||
aesItemViewUtm.participantId = fa.participantId.get();
|
||||
|
||||
if (!m_aesPolygonEncloseBuilding.contains(data.aesItemId()))
|
||||
if (!m_aesPolygonEncloseBuilding.contains(data.aesItemId))
|
||||
{
|
||||
QVector<int> enclosedBuildings;
|
||||
QPolygonF polygon;
|
||||
polygon.reserve(data.form().size());
|
||||
for (size_t i = 0; i < data.form().size(); i++)
|
||||
polygon.reserve(data.form.size());
|
||||
for (size_t i = 0; i < data.form.size(); i++)
|
||||
{
|
||||
//QPointF point(itemView.form[i].x(), itemView.form[i].y());
|
||||
QPointF point(data.form().at(i).lon(), data.form().at(i).lat());
|
||||
QPointF point(data.form.at(i).lon, data.form.at(i).lat);
|
||||
polygon.append(point);
|
||||
}
|
||||
enclosedBuildings = m_handlerBuildingData->polygonEncloseBuildings(polygon);
|
||||
DEBUG_LOG(m_logger) << "enclosedBuildings.size=" << enclosedBuildings.size();
|
||||
// local memory for the results, so that the polygonEncloseBuildings method is only run once for each effective field
|
||||
// and not for each position report
|
||||
m_aesPolygonEncloseBuilding.insert(data.aesItemId(), enclosedBuildings);
|
||||
m_aesPolygonEncloseBuilding.insert(data.aesItemId, enclosedBuildings);
|
||||
DEBUG_LOG(m_logger) << "insert enclosedBuildings.size=" << enclosedBuildings.size();
|
||||
}
|
||||
|
||||
calculateFunctionalArea(aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId, aesItemViewUtm);
|
||||
DEBUG_LOG(m_logger) << "insert Functiona Area AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId();
|
||||
<< ", type: " << data.aesTypeId;
|
||||
break;
|
||||
} // case EsActivated
|
||||
case AreaEffectSimulation::AesEffectState::EsRemoved:
|
||||
@@ -255,34 +255,34 @@ void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulati
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "participant id= " << participantPos.participantId()
|
||||
<< " buildingId=" << participantPos.buildingId();
|
||||
DEBUG_LOG(m_logger) << "participant id= " << participantPos.participantId
|
||||
<< " buildingId=" << participantPos.buildingId;
|
||||
|
||||
if ( participantPos.buildingId() ==0 )
|
||||
if ( participantPos.buildingId ==0 )
|
||||
inForm = inFormCheck(itemView, participantPos);
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < m_aesPolygonEncloseBuilding.value(itemView.aesItemId).size(); i++)
|
||||
{
|
||||
inForm = false;
|
||||
if (m_aesPolygonEncloseBuilding.value(itemView.aesItemId).at(i) == participantPos.buildingId())
|
||||
if (m_aesPolygonEncloseBuilding.value(itemView.aesItemId).at(i) == participantPos.buildingId)
|
||||
{
|
||||
inForm = true;
|
||||
m_handlerParticipant->setNotfightMode(participantPos.participantId(), true);
|
||||
DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId()
|
||||
m_handlerParticipant->setNotfightMode(participantPos.participantId, true);
|
||||
DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId
|
||||
<< " aesId=" << itemView.aesItemId
|
||||
<< " in Form = true";
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId()
|
||||
DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId
|
||||
<< " aesId=" << itemView.aesItemId
|
||||
<< " in Form = false";
|
||||
}
|
||||
}
|
||||
}
|
||||
sendEnterLeave(itemView, participantPos.participantId(), inForm);
|
||||
sendEnterLeave(itemView, participantPos.participantId, inForm);
|
||||
}
|
||||
// for
|
||||
} // calculateFunctionalArea
|
||||
@@ -290,23 +290,23 @@ void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulati
|
||||
|
||||
void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewParticipantPosition participantId=" << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewParticipantPosition participantId=" << participantData.participantId;
|
||||
|
||||
if (m_handlerParticipant->isOutdated(participantData))
|
||||
return;
|
||||
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "equipmentNumber <=0";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId;
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
switch (itemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtFunctionalArea:
|
||||
{
|
||||
@@ -315,13 +315,13 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
|
||||
/// Die Teilnehmer der Partei des Wirkfeldes werden nicht berücksichtig.
|
||||
///
|
||||
AreaEffectSimulation::FunctionalArea functionalArea = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId()
|
||||
DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId
|
||||
<< " itemView.partyId=" << itemView.partyId
|
||||
<< " participantData.partyId=" << participantData.partyId()
|
||||
<< " participantData.partyId=" << participantData.partyId
|
||||
<< " insideBuilding=" << participantData.insideBuilding();
|
||||
///////////////////
|
||||
bool inForm = inFormCheck(itemView, participantData);
|
||||
sendEnterLeave(itemView, participantData.participantId(), inForm);
|
||||
sendEnterLeave(itemView, participantData.participantId, inForm);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -333,23 +333,23 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
|
||||
|
||||
void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New Indoor Position paticipantId=" << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "New Indoor Position paticipantId=" << participantData.participantId;
|
||||
|
||||
if (m_handlerParticipant->isOutdated(participantData))
|
||||
return;
|
||||
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "equipmentNumber <=0";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId;
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
switch (itemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtFunctionalArea:
|
||||
{
|
||||
@@ -358,13 +358,13 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
/// Die Teilnehmer der Partei des Wirkfeldes werden nicht berücksichtig.
|
||||
///
|
||||
AreaEffectSimulation::FunctionalArea functionalArea = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId()
|
||||
DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId
|
||||
<< " itemView.partyId=" << itemView.partyId
|
||||
<< " participantData.partyId=" << participantData.partyId()
|
||||
<< " participantData.partyId=" << participantData.partyId
|
||||
<< " insideBuilding=" << participantData.insideBuilding();
|
||||
{
|
||||
if ( (itemView.partyId == participantData.partyId())
|
||||
&& (functionalArea.functionalAreaTypeId() == 8)) // Funktionsraum Nicht Kampffaehig [GUEZE-2256]
|
||||
if ( (itemView.partyId == participantData.partyId)
|
||||
&& (functionalArea.functionalAreaTypeId == 8)) // Funktionsraum Nicht Kampffaehig [GUEZE-2256]
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Position mit Funktionsraum Nicht Kampffähig hat die Partei des Wirkfeldes => nicht beruecksichtigen";
|
||||
continue;
|
||||
@@ -374,16 +374,16 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
bool inForm = false;
|
||||
for (int i = 0; i < m_aesPolygonEncloseBuilding.value(itemView.aesItemId).size(); i++)
|
||||
{
|
||||
if (m_aesPolygonEncloseBuilding.value(itemView.aesItemId).at(i) == participantData.buildingId())
|
||||
if (m_aesPolygonEncloseBuilding.value(itemView.aesItemId).at(i) == participantData.buildingId)
|
||||
{
|
||||
inForm = true;
|
||||
m_handlerParticipant->setNotfightMode(participantData.participantId(), true);
|
||||
m_handlerParticipant->setNotfightMode(participantData.participantId, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////
|
||||
sendEnterLeave(itemView, participantData.participantId(), inForm);
|
||||
sendEnterLeave(itemView, participantData.participantId, inForm);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -414,14 +414,14 @@ bool HandlerFunctionalAreas::inBoundingBoxCheck(const CentralEffectSimulation::A
|
||||
const QRectF boundingBoxImpact(itemView.boundingBoxBottomLeft,
|
||||
itemView.boundingBoxTopRight);
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos, itemView.zone);
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId
|
||||
<< " inside AesItemView:" << itemView.aesItemId;
|
||||
return true;
|
||||
}
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId
|
||||
<< " outside AesItemView:" << itemView.aesItemId;
|
||||
return false;
|
||||
}
|
||||
@@ -435,9 +435,9 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
|
||||
const QRectF boundingBox(itemView.boundingBoxBottomLeft,
|
||||
itemView.boundingBoxTopRight);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos(), itemView.zone);
|
||||
DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId()
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos, itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos, itemView.zone);
|
||||
DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size()
|
||||
@@ -446,7 +446,7 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
if (boundingBox.contains(participantPosUtmPoint) &&
|
||||
itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantData.participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId;
|
||||
return true;
|
||||
} // if inside
|
||||
@@ -475,7 +475,7 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
// qint64 mineFieldBitIndex = 0;
|
||||
int remaining = 0;
|
||||
|
||||
switch (eventType.underlying())
|
||||
switch (eventType)
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea:
|
||||
DEBUG_LOG(m_logger) << "-------------- EnterFunctionalArea itemView =" << itemView.aesItemId;
|
||||
@@ -495,21 +495,21 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeStruct)
|
||||
<< " participantId=" << participantData.participantId();
|
||||
<< " participantId=" << participantData.participantId;
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId
|
||||
<< " equipNo = " << equipNo
|
||||
<< " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantData.participantId() != 0 && equipNo <= 0)
|
||||
if (participantData.participantId != 0 && equipNo <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0";
|
||||
return;
|
||||
}
|
||||
if (participantData.participantId() != 0 &&
|
||||
participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (participantData.participantId != 0 &&
|
||||
participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
@@ -517,17 +517,17 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
|
||||
const TrainingAreaBase::TabPosition pos(participantData.pos(),
|
||||
const TrainingAreaBase::TabPosition pos(participantData.pos,
|
||||
Core::PositionReportingSource::Gps, // irrelevant
|
||||
participantData.buildingId(),
|
||||
participantData.roomId());
|
||||
const int medicTime = fa.medicTime() / 600000; //reserve 2 = medical treatment
|
||||
const int maintanceTime = fa.maintTime() / 600000; //reserve 1 = maintance time
|
||||
const int decontaminatonTime = fa.deconTime() / 600000; //reserve Munitionsart = decontaminaton time
|
||||
participantData.buildingId,
|
||||
participantData.roomId);
|
||||
const int medicTime = fa.medicTime / 600000; //reserve 2 = medical treatment
|
||||
const int maintanceTime = fa.maintTime / 600000; //reserve 1 = maintance time
|
||||
const int decontaminatonTime = fa.deconTime / 600000; //reserve Munitionsart = decontaminaton time
|
||||
|
||||
const int operationModeDecontamination = fa.deconMode().underlying();
|
||||
const int operationModeMaintenance = fa.maintMode().underlying();
|
||||
const int operationModeMedical = fa.medicMode().underlying();
|
||||
const int operationModeDecontamination = static_cast<int>(fa.deconMode);
|
||||
const int operationModeMaintenance = static_cast<int>(fa.maintMode);
|
||||
const int operationModeMedical = static_cast<int>(fa.medicMode);
|
||||
|
||||
//const int originatorEquipNo = fa.medicTime()/60000; //reserve 2 = medical treatment
|
||||
//const int mineId = fa.maintTime()/60000; //reserve 1 = maintance time
|
||||
@@ -539,7 +539,7 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipNo, // equipmentNumber
|
||||
participantData.participantId(), // participantId
|
||||
participantData.participantId, // participantId
|
||||
chargeType, // chargeTypeId
|
||||
itemView.aesItemId, // aesId
|
||||
originatorEquipNo, // originatorEquipmentNumber
|
||||
@@ -550,8 +550,8 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
itemView.partyId, // originPartyId
|
||||
mineId
|
||||
);
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId()
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId();
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId;
|
||||
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
@@ -567,7 +567,7 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData,
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantData.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantData.participantTypeId);
|
||||
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -576,46 +576,46 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
|
||||
typeClass == ParticipantManagement::TypeClass::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId
|
||||
<< " has invalid typeClass: " << typeClass
|
||||
<< " eventType: " << eventType;
|
||||
return;
|
||||
}
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId
|
||||
<< " - participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " participantId=" << participantData.participantId
|
||||
<< " AesItemId=" << itemView.aesItemId;
|
||||
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
|
||||
pe.eventTypeId(eventType.underlying());
|
||||
pe.participantId(participantData.participantId());
|
||||
pe.eventTime(participantData.sampleTime());
|
||||
pe.aesItemId(itemView.aesItemId);
|
||||
pe.partyId(participantData.partyId());
|
||||
pe.aesName(fa.name());
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.vulnerability(participantData.vulnerabilityState.underlying());
|
||||
pe.position(participantData.pos());
|
||||
pe.friendlyFire(false);
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantData.participantId;
|
||||
pe.eventTime = participantData.sampleTime;
|
||||
pe.aesItemId = itemView.aesItemId;
|
||||
pe.partyId = participantData.partyId;
|
||||
pe.aesName = fa.name;
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.vulnerability = static_cast<int>(participantData.vulnerabilityState);
|
||||
pe.position = participantData.pos;
|
||||
pe.friendlyFire = false;
|
||||
|
||||
INFO_LOG(m_logger) << "sendParticipantEvent: " << pe
|
||||
<< ", currentMSecsSinceEpoch = " << QDateTime::currentMSecsSinceEpoch()
|
||||
<< ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime();
|
||||
<< ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime;
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
|
||||
const auto id = pe.id();
|
||||
const auto id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
<< " aesItemId=" << key.first
|
||||
<< " participantId=" << key.second
|
||||
<< " enterLeaveType=" << enterLeaveType.eventType;
|
||||
startSupplyTimer(participantId, itemView.aesItemId, fa.supplyTime());
|
||||
startSupplyTimer(participantId, itemView.aesItemId, fa.supplyTime);
|
||||
m_cesEnterLeaveFunctionalArea.insert(key, enterLeaveType);
|
||||
}
|
||||
}
|
||||
@@ -718,11 +718,11 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
sendParticipantEvent(itemView, cesParticipantData, enterLeaveType.eventType);
|
||||
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
DEBUG_LOG(m_logger) << "fa.isCentral()=" << fa.isCentral()
|
||||
DEBUG_LOG(m_logger) << "fa.isCentral()=" << fa.isCentral
|
||||
<< " isSupplyTruck=" << itemView.isSupplyTruck
|
||||
<< " eventType=" << m_cesEnterLeaveFunctionalArea.value(key).eventType
|
||||
<< " isAlreadySupplied=" << enterLeaveType.isAlreadySupplied;
|
||||
if (fa.isCentral() && !itemView.isSupplyTruck)
|
||||
if (fa.isCentral && !itemView.isSupplyTruck)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest";
|
||||
sendCesHitRequest(itemView, cesParticipantData, enterLeaveType.eventType);
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsUnknown:
|
||||
case AreaEffectSimulation::AesEffectState::EsError:
|
||||
@@ -335,7 +335,7 @@ void HandlerAesData::onSendCesHitInformationReply(const Core::FunctionReplyObjec
|
||||
void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data, const Footprint &footprint)
|
||||
{
|
||||
// check for correct AES type artillery only
|
||||
switch (data.aesTypeId().underlying())
|
||||
switch (data.aesTypeId())
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation:
|
||||
{
|
||||
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
switch (effectState.underlying())
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
SInt32 vulnerabilityState = i.value().vulnerabilityState.underlying();
|
||||
SInt32 vulnerabilityState = i.value().vulnerabilityState;
|
||||
Float64 lat = i.value().pos().lat() * 180 / M_PI;
|
||||
Float64 lon = i.value().pos().lon() * 180 / M_PI;
|
||||
DEBUG_LOG(m_logger) << "GeoPairing::calculateAirFire"
|
||||
|
||||
+41
-41
@@ -195,11 +195,11 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
m_meteoData = data;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got onMeteoDataChanged "
|
||||
<< " id=" << m_meteoData.id()
|
||||
<< " windSpeed=" << m_meteoData.windSpeed()
|
||||
<< " windDirection=" << m_meteoData.windDirection()
|
||||
<< " pressure=" << m_meteoData.pressure()
|
||||
<< " temperature=" << m_meteoData.temperature();
|
||||
<< " id=" << m_meteoData.id
|
||||
<< " windSpeed=" << m_meteoData.windSpeed
|
||||
<< " windDirection=" << m_meteoData.windDirection
|
||||
<< " pressure=" << m_meteoData.pressure
|
||||
<< " temperature=" << m_meteoData.temperature;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////
|
||||
@@ -370,18 +370,18 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
}
|
||||
unsigned char msgType = 0xE3;
|
||||
|
||||
if (static_cast<unsigned char>(data.payload().at(0)) != msgType)
|
||||
if (static_cast<unsigned char>(data.payload.at(0)) != msgType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "data.payload().at(0) != msgType";
|
||||
return;
|
||||
}
|
||||
|
||||
double y = static_cast<double>(data.position().lat() * 180.0 / M_PI);
|
||||
double x = static_cast<double>(data.position().lon() * 180.0 / M_PI);
|
||||
double y = static_cast<double>(data.position.lat * 180.0 / M_PI);
|
||||
double x = static_cast<double>(data.position.lon * 180.0 / M_PI);
|
||||
|
||||
int zone = -1;
|
||||
|
||||
const QPointF posUtm = CentralEffectSimulation::geographic2Utm(data.position(), &zone);
|
||||
const QPointF posUtm = CentralEffectSimulation::geographic2Utm(data.position, &zone);
|
||||
|
||||
|
||||
double impactPositionLat = 0.0;
|
||||
@@ -391,37 +391,37 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
//QByteArray time = payloadAr.mid(2, 3); // Byte 2 ..3
|
||||
int time = 0;
|
||||
int startIndex = 2;
|
||||
time += (static_cast<unsigned char>(data.payload().at(startIndex)));
|
||||
time += (static_cast<unsigned char>(data.payload().at(startIndex + 1)) << 8);
|
||||
time += (static_cast<unsigned char>(data.payload.at(startIndex)));
|
||||
time += (static_cast<unsigned char>(data.payload.at(startIndex + 1)) << 8);
|
||||
|
||||
// QByteArray elevationBa = payloadAr.mid(5, 8); // Byte 5 .. 8
|
||||
int elevation = 0;
|
||||
startIndex = 5;
|
||||
elevation += (static_cast<unsigned char>(data.payload().at(startIndex)));
|
||||
elevation += (static_cast<unsigned char>(data.payload().at(startIndex + 1)) << 8);
|
||||
elevation += (static_cast<unsigned char>(data.payload().at(startIndex + 2)) << 16);
|
||||
elevation += (static_cast<unsigned char>(data.payload().at(startIndex + 3)) << 24);
|
||||
elevation += (static_cast<unsigned char>(data.payload.at(startIndex)));
|
||||
elevation += (static_cast<unsigned char>(data.payload.at(startIndex + 1)) << 8);
|
||||
elevation += (static_cast<unsigned char>(data.payload.at(startIndex + 2)) << 16);
|
||||
elevation += (static_cast<unsigned char>(data.payload.at(startIndex + 3)) << 24);
|
||||
|
||||
|
||||
// QByteArray azimutBa = payloadAr.mid(9, 12); // Byte 9.. 12
|
||||
int azimut = 0;
|
||||
startIndex = 9;
|
||||
azimut += (static_cast<unsigned char>(data.payload().at(startIndex)));
|
||||
azimut += (static_cast<unsigned char>(data.payload().at(startIndex + 1)) << 8);
|
||||
azimut += (static_cast<unsigned char>(data.payload().at(startIndex + 2)) << 16);
|
||||
azimut += (static_cast<unsigned char>(data.payload().at(startIndex + 3)) << 24);
|
||||
azimut += (static_cast<unsigned char>(data.payload.at(startIndex)));
|
||||
azimut += (static_cast<unsigned char>(data.payload.at(startIndex + 1)) << 8);
|
||||
azimut += (static_cast<unsigned char>(data.payload.at(startIndex + 2)) << 16);
|
||||
azimut += (static_cast<unsigned char>(data.payload.at(startIndex + 3)) << 24);
|
||||
|
||||
int temperature = (static_cast<unsigned char>(data.payload().at(13)));
|
||||
int temperature = (static_cast<unsigned char>(data.payload.at(13)));
|
||||
|
||||
// QByteArray timeToDetonationBa = payloadAr.mid(14, 15); // Byte 14-15;
|
||||
int timeToDetonation = 0;
|
||||
startIndex = 14;
|
||||
timeToDetonation += (static_cast<unsigned char>(data.payload().at(startIndex)));
|
||||
timeToDetonation += (static_cast<unsigned char>(data.payload().at(startIndex + 1)) << 8);
|
||||
timeToDetonation += (static_cast<unsigned char>(data.payload.at(startIndex)));
|
||||
timeToDetonation += (static_cast<unsigned char>(data.payload.at(startIndex + 1)) << 8);
|
||||
|
||||
|
||||
N_Ballistic::ammunitionTypeIndirectFire ammunitionType = N_Ballistic::MOERSER;
|
||||
int ammunition = (data.payload().at(4) >> 1) & 0x03;
|
||||
int ammunition = (data.payload.at(4) >> 1) & 0x03;
|
||||
QString ammunitionStr;
|
||||
switch (ammunition)
|
||||
{
|
||||
@@ -442,11 +442,11 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
|
||||
}
|
||||
|
||||
int treibmittel = (data.payload().at(4) >> 3) & 0x07;
|
||||
int treibmittel = (data.payload.at(4) >> 3) & 0x07;
|
||||
|
||||
//int participantId = m_handlerParticipant->getParticipantId(data.equipmentNumber());
|
||||
int participantId = m_ddsHandlerAes->dtcPpm()->participantIdByEquipmentNumber(data.equipmentNumber());
|
||||
int partyId = m_ddsHandlerAes->dtcPpm()->participant(participantId).partyId();
|
||||
int participantId = m_ddsHandlerAes->dtcPpm()->participantIdByEquipmentNumber(data.equipmentNumber);
|
||||
int partyId = m_ddsHandlerAes->dtcPpm()->participant(participantId).partyId;
|
||||
|
||||
float v0 = 200.0;
|
||||
if ( treibmittel == 0)
|
||||
@@ -466,12 +466,12 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged "
|
||||
<< "\nequipmentNumber=" << data.equipmentNumber()
|
||||
<< "\nposition lat=" << data.position().lat()
|
||||
<< "/" << data.position().lon()
|
||||
<< "\nequipmentNumber=" << data.equipmentNumber
|
||||
<< "\nposition lat=" << data.position.lat
|
||||
<< "/" << data.position.lon
|
||||
<< "\nposition xy=" << x << "/" << y
|
||||
<< "\nposition UTM=" << posUtm.x() << "/" << posUtm.y() << " zone=" << zone
|
||||
<< "\nsampleTime=" << data.sampleTime()
|
||||
<< "\nsampleTime=" << data.sampleTime
|
||||
<< "\nammunitionType=" << ammunitionType
|
||||
<< "\ntemperature=" << temperature
|
||||
<< "\nelevation=" << elevation
|
||||
@@ -484,7 +484,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
|
||||
float rw = calculateDistance(v0, elevation / 10.0);
|
||||
float t1 = calculateFlightTime(rw, v0, elevation / 10.0);
|
||||
impactTime = data.sampleTime() + static_cast<int64_t> (t1) * 1000;
|
||||
impactTime = data.sampleTime + static_cast<int64_t> (t1) * 1000;
|
||||
//QPointF distVector = calculateDistVector ( rw, azimut/10.0);
|
||||
QPointF explosionPosUtm = calculateExplosionPosUtm(rw, azimut / 10.0, posUtm);
|
||||
|
||||
@@ -499,20 +499,20 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
impactPositionLat = explosionPosGeoCoordinate.y();
|
||||
|
||||
AreaEffectSimulation::ExplosionSingleModifyRequest explosionSingleModifyRequest;
|
||||
explosionSingleModifyRequest.id(0);
|
||||
explosionSingleModifyRequest.impactPosition().lat(impactPositionLat);
|
||||
explosionSingleModifyRequest.impactPosition().lon(impactPositionLon);
|
||||
explosionSingleModifyRequest.id = 0;
|
||||
explosionSingleModifyRequest.impactPosition.lat = impactPositionLat;
|
||||
explosionSingleModifyRequest.impactPosition.lon = impactPositionLon;
|
||||
// Statement by the 5000: impactTime must be in the future
|
||||
explosionSingleModifyRequest.effectStart(impactTime);
|
||||
explosionSingleModifyRequest.chargeTypeId(ammunitionType);
|
||||
explosionSingleModifyRequest.participantId(participantId);
|
||||
QString name = QStringLiteral("Geopairing:") + QString::number(data.equipmentNumber());
|
||||
explosionSingleModifyRequest.name(name.toStdString());
|
||||
explosionSingleModifyRequest.effectStart = impactTime;
|
||||
explosionSingleModifyRequest.chargeTypeId = ammunitionType;
|
||||
explosionSingleModifyRequest.participantId = participantId;
|
||||
QString name = QStringLiteral("Geopairing:") + QString::number(data.equipmentNumber);
|
||||
explosionSingleModifyRequest.name = name.toStdString();
|
||||
//const CentralEffectSimulation::HandlerParticipant::CesParticipantData pos = m_handlerParticipant->position(participantId);
|
||||
explosionSingleModifyRequest.partyId(partyId);
|
||||
explosionSingleModifyRequest.partyId = partyId;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "impactTime=" << data.sampleTime()
|
||||
DEBUG_LOG(m_logger) << "impactTime=" << data.sampleTime
|
||||
<< " name=" << name
|
||||
<< " m_ddsHandler->currentPartitionTime=" << m_ddsHandlerAes->currentPartitionTime()
|
||||
<< " participantId=" << participantId << " " << participantId
|
||||
|
||||
+21
-21
@@ -24,7 +24,7 @@ namespace core
|
||||
{
|
||||
inline uint qHash(ProjectDataManagement::PdmEventType et)
|
||||
{
|
||||
return ::qHash(et.underlying());
|
||||
return ::qHash(et);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,19 +79,19 @@ bool HandlerJamming::init()
|
||||
void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent &data, DataModification modType)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "onParticipantGearEventChanged << modType=" << modType
|
||||
<< " originatorId=" << data.participantId()
|
||||
<< " chargeTypeId=" << data.charge().chargeTypeId()
|
||||
<< " gearTypeId=" << data.charge().gearTypeId()
|
||||
<< " isJamming=" << m_ddsHandler->isJamming({data.charge().chargeTypeId(),0,0});
|
||||
<< " originatorId=" << data.participantId
|
||||
<< " chargeTypeId=" << data.charge.chargeTypeId
|
||||
<< " gearTypeId=" << data.charge.gearTypeId
|
||||
<< " isJamming=" << m_ddsHandler->isJamming({data.charge.chargeTypeId,0,0});
|
||||
// Check, if Munition isJamming
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as ParticipantGearEvent does not contain values
|
||||
if (!m_ddsHandler->isJamming({data.charge().chargeTypeId(),0,0}))
|
||||
if (!m_ddsHandler->isJamming({data.charge.chargeTypeId,0,0}))
|
||||
return;
|
||||
QVector<int> uasIds = m_ddsHandler->dtcPpm()->getUasIds();
|
||||
QVector<int> jammedUasIds;
|
||||
int jammedUasId = 0;
|
||||
|
||||
double radius = m_ddsHandler->dtcPdm()->getMaxRange(data.charge().chargeTypeId(), data.charge().gearTypeId());
|
||||
double radius = m_ddsHandler->dtcPdm()->getMaxRange(data.charge.chargeTypeId, data.charge.gearTypeId);
|
||||
|
||||
// int radius = 15;
|
||||
DEBUG_LOG(m_logger) << "Radius=" << radius;
|
||||
@@ -105,19 +105,19 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
continue;
|
||||
}
|
||||
|
||||
if (LtsUtils::isPositionTimeOutdated(QDateTime::currentMSecsSinceEpoch(), cesParticipantData.sampleTime()))
|
||||
if (LtsUtils::isPositionTimeOutdated(QDateTime::currentMSecsSinceEpoch(), cesParticipantData.sampleTime))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "continue positionTime outdated participantId=" << uasId;
|
||||
continue;
|
||||
}
|
||||
|
||||
long distance = m_handlerParticipant->getDistance(data.participantId(), uasId);
|
||||
long distance = m_handlerParticipant->getDistance(data.participantId, uasId);
|
||||
DEBUG_LOG(m_logger) << "distance = " << distance;
|
||||
if ( distance < radius)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " Send Jamming to TAB and destroy uasId";
|
||||
//sendCesHitRequest(data.charge().chargeTypeId(), data.participantId(),cesParticipantData);
|
||||
if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
jammedUasIds.append(uasId);
|
||||
}
|
||||
else
|
||||
@@ -138,7 +138,7 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
}
|
||||
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData cesParticipantData = m_handlerParticipant->position(jammedUasId);
|
||||
sendCesHitRequest(data.charge().chargeTypeId(), data.participantId(),cesParticipantData);
|
||||
sendCesHitRequest(data.charge.chargeTypeId, data.participantId,cesParticipantData);
|
||||
|
||||
}
|
||||
|
||||
@@ -184,32 +184,32 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " participantId=" << participantData.participantId();
|
||||
<< " participantId=" << participantData.participantId;
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
const int originatorEquimentNumber = m_ddsHandler->participantId2EquipNo(originatorId);
|
||||
const int originatorPartyId = m_handlerParticipant->getParticipantPosition(originatorId).partyId();
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
const int originatorPartyId = m_handlerParticipant->getParticipantPosition(originatorId).partyId;
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId
|
||||
<< " equipNo = " << equipNo
|
||||
<< " chargeTypeId =" << chargeTypeId;
|
||||
|
||||
if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId == 0 CatastrophicKill)";
|
||||
return;
|
||||
}
|
||||
|
||||
const TrainingAreaBase::TabPosition pos(participantData.pos(),
|
||||
const TrainingAreaBase::TabPosition pos(participantData.pos,
|
||||
Core::PositionReportingSource::Gps, // irrelevant
|
||||
participantData.buildingId(),
|
||||
participantData.roomId());
|
||||
participantData.buildingId,
|
||||
participantData.roomId);
|
||||
|
||||
const int aesId = 0; // not used
|
||||
const int mineId = 0; // not used
|
||||
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipNo, // equipmentNumber
|
||||
participantData.participantId(), // participantId
|
||||
participantData.participantId, // participantId
|
||||
chargeTypeId, // chargeTypeId
|
||||
aesId, // aesId
|
||||
originatorEquimentNumber, // originatorEquipmentNumber
|
||||
@@ -220,7 +220,7 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
|
||||
originatorPartyId, // originPartyId
|
||||
mineId
|
||||
);
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId
|
||||
<< " chargeTypeId=" << chargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
|
||||
+152
-152
@@ -25,7 +25,7 @@ namespace core
|
||||
{
|
||||
inline uint qHash(ProjectDataManagement::PdmEventType et)
|
||||
{
|
||||
return ::qHash(et.underlying());
|
||||
return ::qHash(et);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,43 +166,43 @@ void HandlerMineAreas::onMineTriggeredReply(const Core::FunctionReplyObject &rep
|
||||
// ///////////////////////////////////
|
||||
void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtMineAreaSingleMines
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtMineArea
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtMineCorridor)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtMineAreaSingleMines
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtMineArea
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtMineCorridor)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AesItemView return";
|
||||
return;
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::MineArea &ma = m_ddsHandler->dtcAes()->mineArea(data.aesItemId());
|
||||
DEBUG_LOG(m_logger) << "aesItemId=" << data.aesItemId()
|
||||
<< " chargeTypeId=" << data.chargeStruct().chargeTypeId()
|
||||
<< " isCentral=" << ma.isCentral();
|
||||
const AreaEffectSimulation::MineArea &ma = m_ddsHandler->dtcAes()->mineArea(data.aesItemId);
|
||||
DEBUG_LOG(m_logger) << "aesItemId=" << data.aesItemId
|
||||
<< " chargeTypeId=" << data.chargeStruct.chargeTypeId
|
||||
<< " isCentral=" << ma.isCentral;
|
||||
|
||||
// 240 = Verlegemine muss immer berechnet werden.
|
||||
if (!ma.isCentral() && (data.chargeStruct().chargeTypeId() != 240))
|
||||
if (!ma.isCentral && (data.chargeStruct.chargeTypeId != 240))
|
||||
return;
|
||||
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "AesItemView expired return id=" << data.aesItemId();
|
||||
aesItemViewRemoved(data.aesItemId());
|
||||
DEBUG_LOG(m_logger) << "AesItemView expired return id=" << data.aesItemId;
|
||||
aesItemViewRemoved(data.aesItemId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_ddsHandler->isDus(data.chargeStruct()))
|
||||
if (m_ddsHandler->isDus(data.chargeStruct))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "isDus aesItemId=" << data.aesItemId()
|
||||
<< " chargeTypeId=" << data.chargeStruct().chargeTypeId() << " do not consider";
|
||||
DEBUG_LOG(m_logger) << "isDus aesItemId=" << data.aesItemId
|
||||
<< " chargeTypeId=" << data.chargeStruct.chargeTypeId << " do not consider";
|
||||
return;
|
||||
}
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
const int aesItemId = data.aesItemId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", type: " << data.aesTypeId
|
||||
<< ", effectState: " << data.effectStateId
|
||||
<< ", modType: " << modType;
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
@@ -213,7 +213,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
|
||||
{
|
||||
if (!m_aesItemViews.contains(aesItemId))
|
||||
{
|
||||
@@ -222,21 +222,21 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
}
|
||||
// build Polygon Mines:
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
auto &formMines = m_aesItemViews[data.aesItemId()].formMines;
|
||||
auto &formMines = m_aesItemViews[data.aesItemId].formMines;
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
int &zone = m_aesItemViews[data.aesItemId()].zone;
|
||||
int &zone = m_aesItemViews[data.aesItemId].zone;
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
formMines.clear();
|
||||
formMines.reserve(data.form().size());
|
||||
for (const Core::GeoPosition2D &pointGeo : data.form())
|
||||
formMines.reserve(data.form.size());
|
||||
for (const Core::GeoPosition2D &pointGeo : data.form)
|
||||
formMines.push_back(CentralEffectSimulation::geographic2Utm(pointGeo, &zone));
|
||||
return;
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct());
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct);
|
||||
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
|
||||
switch (effectState.underlying())
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsPrepared:
|
||||
{
|
||||
@@ -244,11 +244,11 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
}
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
|
||||
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId], impactRadius));
|
||||
|
||||
DEBUG_LOG(m_logger) << "EsActivated m_aesItemViews.insert data.aesItemId()= " << data.aesItemId()
|
||||
DEBUG_LOG(m_logger) << "EsActivated m_aesItemViews.insert data.aesItemId()= " << data.aesItemId
|
||||
<< " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId, aesItemViewUtm);
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
printAesItemViews();
|
||||
@@ -277,13 +277,13 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
if (m_handlerParticipant->isOutdated(participantPosition))
|
||||
return;
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(participantPosition.participantId()) == 0)
|
||||
if (m_handlerParticipant->getEquipmentNumber(participantPosition.participantId) == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId);
|
||||
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -292,51 +292,51 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
typeClass == ParticipantManagement::TypeClass::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "return New Position Participant with id " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "return New Position Participant with id " << participantPosition.participantId
|
||||
<< " has invalid typeClass: " << typeClass;
|
||||
return;
|
||||
}
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
TRACE_LOG(m_logger) << "return New Position - participant has no equipment number"
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " participantId=" << participantPosition.participantId
|
||||
<< " typeClass=" << typeClass;
|
||||
return;
|
||||
}
|
||||
|
||||
if (participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New Position CatastrophicKill return";
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mineLists.contains(participantPosition.participantId()))
|
||||
if (m_mineLists.contains(participantPosition.participantId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Naechste Mine schicken ohne Bounding-Box-Check... return"
|
||||
<< " Anzahl Minen in Liste:" << m_mineLists[participantPosition.participantId()].size()
|
||||
<< " Anzahl Minen in Liste:" << m_mineLists[participantPosition.participantId].size()
|
||||
<< " cesMaxPeriodForCashedMines=" << Settings::cesPeriodStoredMinesOutdated();
|
||||
//DEBUG_LOG(m_logger) << "Settings::cesMaxPeriodForCashedMines() =" << Settings::cesMaxPeriodForCashedMines();
|
||||
|
||||
if ((m_mineLists[participantPosition.participantId()].size() > 0)
|
||||
&& (QDateTime::currentMSecsSinceEpoch() - m_mineLists[participantPosition.participantId()][0].time < Settings::cesPeriodStoredMinesOutdated()))
|
||||
if ((m_mineLists[participantPosition.participantId].size() > 0)
|
||||
&& (QDateTime::currentMSecsSinceEpoch() - m_mineLists[participantPosition.participantId][0].time < Settings::cesPeriodStoredMinesOutdated()))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Send Stored mines";
|
||||
// Search mine with the next no distance
|
||||
int distance = m_mineLists[participantPosition.participantId()][0].distance;
|
||||
int distance = m_mineLists[participantPosition.participantId][0].distance;
|
||||
int index = 0;
|
||||
for (int i = 0; i < m_mineLists[participantPosition.participantId()].size(); i++)
|
||||
for (int i = 0; i < m_mineLists[participantPosition.participantId].size(); i++)
|
||||
{
|
||||
if (m_mineLists[participantPosition.participantId()][i].distance < distance)
|
||||
if (m_mineLists[participantPosition.participantId][i].distance < distance)
|
||||
{
|
||||
distance = m_mineLists[participantPosition.participantId()][i].distance;
|
||||
distance = m_mineLists[participantPosition.participantId][i].distance;
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
//m_mineLists[participantPos.participantId()].value()
|
||||
int mineIndex = m_mineLists[participantPosition.participantId()][index].mineIndex;
|
||||
int aesItemId = m_mineLists[participantPosition.participantId()][index].aesItemId;
|
||||
int mineIndex = m_mineLists[participantPosition.participantId][index].mineIndex;
|
||||
int aesItemId = m_mineLists[participantPosition.participantId][index].aesItemId;
|
||||
if (!m_aesItemViews.contains(aesItemId))
|
||||
return;
|
||||
|
||||
@@ -349,12 +349,12 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
// << " z=" << minePosGeo.z();
|
||||
sendParticipantEvent(m_aesItemViews[aesItemId], minePosition, ProjectDataManagement::PdmEventType::EventType_HitMine);
|
||||
|
||||
m_mineLists[participantPosition.participantId()].remove(index);
|
||||
m_mineLists[participantPosition.participantId].remove(index);
|
||||
|
||||
if (m_mineLists[participantPosition.participantId()].size() == 0)
|
||||
if (m_mineLists[participantPosition.participantId].size() == 0)
|
||||
{
|
||||
m_mineLists[participantPosition.participantId()].clear();
|
||||
m_mineLists.remove(participantPosition.participantId());
|
||||
m_mineLists[participantPosition.participantId].clear();
|
||||
m_mineLists.remove(participantPosition.participantId);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -363,13 +363,13 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
DEBUG_LOG(m_logger) << "Stored mines are outdated!"
|
||||
<< " actTime=" << QDateTime::currentMSecsSinceEpoch()
|
||||
<< " Settings::cesPeriodStoredMinesOutdated()=" << Settings::cesPeriodStoredMinesOutdated();
|
||||
m_mineLists[participantPosition.participantId()].clear();
|
||||
m_mineLists.remove(participantPosition.participantId());
|
||||
m_mineLists[participantPosition.participantId].clear();
|
||||
m_mineLists.remove(participantPosition.participantId);
|
||||
}// end if time-check
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPosition.participantId
|
||||
<< " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
// const QVector<QPointF> utmStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), m_zone);
|
||||
@@ -392,29 +392,29 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
if (typeClass == ParticipantManagement::TypeClass::Human && m_ddsHandler->isAtMine(itemView.chargeStruct))
|
||||
continue;
|
||||
|
||||
if (itemView.aesTypeId.underlying() == AreaEffectSimulation::AesType::AtMineArea)
|
||||
if (itemView.aesTypeId == AreaEffectSimulation::AesType::AtMineArea)
|
||||
{
|
||||
|
||||
// checks whether the participant has been positioned in the minefield or across it.
|
||||
bool inBoundingBox = inBoundingBoxCheck(itemView, participantPosition);
|
||||
if (!inBoundingBox)
|
||||
{
|
||||
bool intersectsBoundingBox = intersectsBoundingBoxCheck(itemView, participantPosition.participantId());
|
||||
bool intersectsBoundingBox = intersectsBoundingBoxCheck(itemView, participantPosition.participantId);
|
||||
if (!intersectsBoundingBox)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Continue nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", "
|
||||
<< " paricipantId=" << participantPosition.participantId();
|
||||
<< " paricipantId=" << participantPosition.participantId;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Weiter nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", "
|
||||
<< " paricipantId=" << participantPosition.participantId();
|
||||
<< " paricipantId=" << participantPosition.participantId;
|
||||
|
||||
bool inFormCheckResult = inFormCheck(itemView, participantPosition);
|
||||
if (!inFormCheckResult)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!inForm";
|
||||
if (!intersectFormCheck(itemView, participantPosition.participantId()))
|
||||
if (!intersectFormCheck(itemView, participantPosition.participantId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!intersectForm continue";
|
||||
continue;
|
||||
@@ -436,14 +436,14 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
void HandlerMineAreas::onNewParticipantState(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onNewParticipantState ";
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId());
|
||||
if (m_mineLists.contains(participantPos.participantId()))
|
||||
DEBUG_LOG(m_logger) << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId);
|
||||
if (m_mineLists.contains(participantPos.participantId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onNewParticipantState CombatReady, loesche Minenliste Eintrag";
|
||||
m_mineLists[participantPos.participantId()].clear();
|
||||
m_mineLists.remove(participantPos.participantId());
|
||||
m_mineLists[participantPos.participantId].clear();
|
||||
m_mineLists.remove(participantPos.participantId);
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "onNewParticipantState CombatReady, loesche Minenliste";
|
||||
}
|
||||
@@ -465,11 +465,11 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
int32_t bitFieldIdx = 0;
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(itemView.chargeStruct);
|
||||
|
||||
const QPolygonF utmStep = m_handlerParticipant->getParticipantStep(participantPosition.participantId(), itemView.zone);
|
||||
const QPolygonF utmStep = m_handlerParticipant->getParticipantStep(participantPosition.participantId, itemView.zone);
|
||||
for (const auto &itPos : itemView.formMines)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " itemId=" << itemView.aesItemId
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId()
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId
|
||||
<< ", MinePosUtm: " << CentralEffectSimulation::debug(itPos)
|
||||
<< " utmStep:" << utmStep[0].x() << utmStep[0].y()
|
||||
<< ", " << utmStep[1].x() << utmStep[1].y();
|
||||
@@ -478,7 +478,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
if (m_triggeredImpacts.contains(itemView.aesItemId))
|
||||
{
|
||||
const AreaEffectSimulation::TriggeredImpacts &triggeredImpact = m_triggeredImpacts[itemView.aesItemId];
|
||||
if (!LtsUtils::BitArray::testBit(triggeredImpact.bitfield(), bitFieldIdx))
|
||||
if (!LtsUtils::BitArray::testBit(triggeredImpact.bitfield, bitFieldIdx))
|
||||
{
|
||||
++bitFieldIdx;
|
||||
DEBUG_LOG(m_logger) << "Mine is active continue bitFieldIdx=" << bitFieldIdx;
|
||||
@@ -490,7 +490,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
? itemView.dusMineId : bitFieldIdx + 1; // mineIdx in minefield starts at 1
|
||||
|
||||
// Check, if participant is inside danger-radius of the mine
|
||||
distance = crossCircle(itPos, impactRadius, participantPosition.participantId(), itemView.zone);
|
||||
distance = crossCircle(itPos, impactRadius, participantPosition.participantId, itemView.zone);
|
||||
DEBUG_LOG(m_logger) << "distance=" << distance;
|
||||
if (distance < 0.0)
|
||||
{
|
||||
@@ -507,17 +507,17 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
mineListItem.mineIndex = mineIdx;
|
||||
mineListItem.minePos = minePos;
|
||||
mineListItem.time = QDateTime::currentMSecsSinceEpoch();
|
||||
m_mineLists[participantPosition.participantId()].append(mineListItem);
|
||||
m_mineLists[participantPosition.participantId].append(mineListItem);
|
||||
mineListIndex++;
|
||||
DEBUG_LOG(m_logger) << " m_mineLists[" << participantPosition.participantId()
|
||||
<< "].length=" << m_mineLists[participantPosition.participantId()].length();
|
||||
DEBUG_LOG(m_logger) << " m_mineLists[" << participantPosition.participantId
|
||||
<< "].length=" << m_mineLists[participantPosition.participantId].length();
|
||||
|
||||
if (distance < lastDistance)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " distance < lastDistance crossCircle for aesItemId: " << itemView.aesItemId
|
||||
<< ", mineIdx: " << mineIdx
|
||||
<< ", impactRadius:" << impactRadius
|
||||
<< ", participantId: " << participantPosition.participantId()
|
||||
<< ", participantId: " << participantPosition.participantId
|
||||
<< ", lastDistance:" << lastDistance
|
||||
<< ", distance:" << distance;
|
||||
minePos = itPos;
|
||||
@@ -528,12 +528,12 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
bitFieldIdx++;
|
||||
} // for each mine
|
||||
|
||||
DEBUG_LOG(m_logger) << "End of for-loop participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "End of for-loop participantId=" << participantPosition.participantId
|
||||
<< " mineIndex=" << mineIndex
|
||||
<< " lastDistance=" << lastDistance;
|
||||
if (lastDistance > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendEffectTypeEvent participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendEffectTypeEvent participantId=" << participantPosition.participantId
|
||||
<< " mineIndex=" << mineIndex;
|
||||
// TODO Minenposition fuer den Event nehmen und nicht die Participant-Position
|
||||
sendFtcMineTrigger(itemView.aesItemId, mineIndex - 1);
|
||||
@@ -545,7 +545,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
// << " z=" << minePosGeo.z();
|
||||
sendParticipantEvent(itemView, minePosition, ProjectDataManagement::PdmEventType::EventType_HitMine);
|
||||
// aktuell verarbeitete Mine aus der Liste entfernen.
|
||||
m_mineLists[participantPosition.participantId()].remove(mineListItemIndex);
|
||||
m_mineLists[participantPosition.participantId].remove(mineListItemIndex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -605,14 +605,14 @@ bool HandlerMineAreas::inBoundingBoxCheck(const CentralEffectSimulation::AesItem
|
||||
boundingBoxTopRight);
|
||||
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos, itemView.zone);
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId
|
||||
<< " inside AesItemView:" << itemView.aesItemId << " return true";
|
||||
return true;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId
|
||||
<< " outside AesItemView:" << itemView.aesItemId << " return false";
|
||||
return false;
|
||||
}
|
||||
@@ -622,15 +622,15 @@ bool HandlerMineAreas::inFormCheck(const CentralEffectSimulation::AesItemViewUtm
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition)
|
||||
{
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone);
|
||||
DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantPosition.participantId()
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos, itemView.zone);
|
||||
DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantPosition.participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size();
|
||||
|
||||
if (itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantPosition.participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId;
|
||||
return true;
|
||||
} // if inside
|
||||
@@ -670,7 +670,7 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: ";
|
||||
switch (data.aesTypeId().underlying())
|
||||
switch (data.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType::AtExplosionSingle:
|
||||
@@ -682,7 +682,7 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri
|
||||
case AreaEffectSimulation::AesType::AtMineArea:
|
||||
// participant run on mine
|
||||
// => store Mine-State and take into account when a participant runs to one of this mines
|
||||
m_triggeredImpacts.insert(data.aesItemId(), data);
|
||||
m_triggeredImpacts.insert(data.aesItemId, data);
|
||||
break;
|
||||
default:
|
||||
//nothigng
|
||||
@@ -694,36 +694,36 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri
|
||||
void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data)
|
||||
{
|
||||
|
||||
if ((data.aesTypeId() == AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions)
|
||||
|| (data.aesTypeId() == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions))
|
||||
if ((data.aesTypeId == AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions)
|
||||
|| (data.aesTypeId == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions))
|
||||
return;
|
||||
|
||||
|
||||
auto it = m_aesItemViews.find(data.aesItemId());
|
||||
auto it = m_aesItemViews.find(data.aesItemId);
|
||||
if (it == m_aesItemViews.end())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId();
|
||||
WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId;
|
||||
return;
|
||||
}
|
||||
CentralEffectSimulation::AesItemViewUtm &aesItemView = *it;
|
||||
|
||||
// older then 10sec? ignore
|
||||
if (data.sampleTime() < m_ddsHandler->currentPartitionTime() - 10 * 1000)
|
||||
if (data.sampleTime < m_ddsHandler->currentPartitionTime() - 10 * 1000)
|
||||
{
|
||||
if (aesItemView.sampleTimeHandledImpacts < data.sampleTime())
|
||||
if (aesItemView.sampleTimeHandledImpacts < data.sampleTime)
|
||||
{
|
||||
aesItemView.sampleTimeHandledImpacts = data.sampleTime();
|
||||
aesItemView.handledImpacts = data.bitfield();
|
||||
aesItemView.sampleTimeHandledImpacts = data.sampleTime;
|
||||
aesItemView.handledImpacts = data.bitfield;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
QVector<int> bitsToCheck;
|
||||
aesItemView.handledImpacts.resize(data.bitfield().size(), 0xFF);
|
||||
for (int bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx)
|
||||
aesItemView.handledImpacts.resize(data.bitfield.size(), 0xFF);
|
||||
for (int bitFieldIdx = 0; bitFieldIdx < data.impactCount; ++bitFieldIdx)
|
||||
{
|
||||
// not yet triggered (bit is still 1)
|
||||
if (LtsUtils::BitArray::testBit(data.bitfield(), bitFieldIdx))
|
||||
if (LtsUtils::BitArray::testBit(data.bitfield, bitFieldIdx))
|
||||
continue;
|
||||
|
||||
// already checked (bit is already 0)
|
||||
@@ -734,17 +734,17 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp
|
||||
}
|
||||
|
||||
// remember handled impacts
|
||||
aesItemView.sampleTimeHandledImpacts = data.sampleTime();
|
||||
aesItemView.handledImpacts = data.bitfield();
|
||||
aesItemView.sampleTimeHandledImpacts = data.sampleTime;
|
||||
aesItemView.handledImpacts = data.bitfield;
|
||||
|
||||
const auto participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : participantPositions)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "pos participantId=" << pPos.participantId()
|
||||
<< " buildingId=" << pPos.buildingId()
|
||||
DEBUG_LOG(m_logger) << "pos participantId=" << pPos.participantId
|
||||
<< " buildingId=" << pPos.buildingId
|
||||
<< " insideBuilding=" << pPos.insideBuilding()
|
||||
<< " positionValid=" << pPos.positionValid;
|
||||
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
continue;
|
||||
if (pPos.insideBuilding())
|
||||
continue;
|
||||
@@ -763,7 +763,7 @@ void HandlerMineAreas::calculateImpacts(const CentralEffectSimulation::AesItemVi
|
||||
|
||||
// get radius of munition
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(itemView.chargeStruct);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos, itemView.zone);
|
||||
|
||||
for (int bitFieldIdx : impactsToCheck)
|
||||
{
|
||||
@@ -789,20 +789,20 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest "
|
||||
<< " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea()
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId()
|
||||
<< " participantId=" << participantPosition.participantId;
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId
|
||||
<< " equipNo = " << equipNo
|
||||
<< " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantPosition.participantId() != 0 && equipNo <= 0)
|
||||
if (participantPosition.participantId != 0 && equipNo <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
}
|
||||
if (participantPosition.participantId() != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (participantPosition.participantId != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
@@ -810,18 +810,18 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
|
||||
|
||||
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
|
||||
|
||||
const TrainingAreaBase::TabPosition pos(participantPosition.pos(),
|
||||
const TrainingAreaBase::TabPosition pos(participantPosition.pos,
|
||||
Core::PositionReportingSource::Gps, // irrelevant
|
||||
participantPosition.buildingId(),
|
||||
participantPosition.roomId());
|
||||
participantPosition.buildingId,
|
||||
participantPosition.roomId);
|
||||
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
|
||||
|
||||
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
|
||||
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipNo, // equipmentNumber
|
||||
participantPosition.participantId(), // participantId
|
||||
itemView.chargeStruct.chargeTypeId(), // chargeTypeId
|
||||
participantPosition.participantId, // participantId
|
||||
itemView.chargeStruct.chargeTypeId, // chargeTypeId
|
||||
itemView.aesItemId, // aesId
|
||||
originatorEquipNo, // originatorEquipmentNumber
|
||||
remaining, // remainEffectPercent ( no protection outside Building )
|
||||
@@ -831,8 +831,8 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
|
||||
itemView.partyId, // originPartyId
|
||||
mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId()
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId();
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
if (m_sendCesHitRequestQueue.size() == 1)
|
||||
@@ -847,45 +847,45 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView
|
||||
qint64 effectTime,
|
||||
int mineFieldBitIndex)
|
||||
{
|
||||
int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct());
|
||||
int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct);
|
||||
|
||||
int32_t legacyChargeTypeId = 0;
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(itemView.chargeStruct());
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(itemView.chargeStruct);
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest"
|
||||
<< " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea()
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
<< " participantId=" << participantPosition.participantId;
|
||||
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId()
|
||||
<< " equipNo = " << equipmentNumber << " aesItemId =" << itemView.aesItemId();
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId
|
||||
<< " equipNo = " << equipmentNumber << " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantPosition.participantId() != 0 && equipmentNumber <= 0)
|
||||
if (participantPosition.participantId != 0 && equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
} // if
|
||||
|
||||
if (participantPosition.participantId() != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (participantPosition.participantId != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
} // if
|
||||
|
||||
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId(), 0);
|
||||
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
|
||||
const int originatorEquipmentNumber = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
|
||||
const TrainingAreaBase::TabPosition pos(
|
||||
participantPosition.pos(), Core::PositionReportingSource::Gps, participantPosition.buildingId(),
|
||||
participantPosition.roomId()
|
||||
participantPosition.pos, Core::PositionReportingSource::Gps, participantPosition.buildingId,
|
||||
participantPosition.roomId
|
||||
);
|
||||
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
|
||||
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber,
|
||||
equipmentNumber, participantPosition.participantId, legacyChargeTypeId, itemView.aesItemId, originatorEquipmentNumber,
|
||||
remaining, pos, effectTime, eventType, itemView.partyId.get(), mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct().chargeTypeId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId << " chargeTypeId=" << itemView.chargeStruct.chargeTypeId
|
||||
<< " legacyChargeTypeId=" << legacyChargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
@@ -901,7 +901,7 @@ void HandlerMineAreas::sendParticipantEventEnterLeave(const CentralEffectSimulat
|
||||
const bool inFormCheckResult)
|
||||
{
|
||||
|
||||
const ProjectDataManagement::PdmEventType &lastEvent = m_eventStates[itemView.aesItemId][participantPosition.participantId()];
|
||||
const ProjectDataManagement::PdmEventType &lastEvent = m_eventStates[itemView.aesItemId][participantPosition.participantId];
|
||||
|
||||
|
||||
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
|
||||
@@ -914,7 +914,7 @@ void HandlerMineAreas::sendParticipantEventEnterLeave(const CentralEffectSimulat
|
||||
else
|
||||
{
|
||||
eventType = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
|
||||
m_eventStates[itemView.aesItemId][participantPosition.participantId()] = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
|
||||
m_eventStates[itemView.aesItemId][participantPosition.participantId] = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -924,7 +924,7 @@ void HandlerMineAreas::sendParticipantEventEnterLeave(const CentralEffectSimulat
|
||||
else
|
||||
{
|
||||
eventType = ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
|
||||
m_eventStates[itemView.aesItemId][participantPosition.participantId()] = ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
|
||||
m_eventStates[itemView.aesItemId][participantPosition.participantId] = ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,31 +939,31 @@ void HandlerMineAreas::sendParticipantEvent(const CentralEffectSimulation::AesIt
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent " << itemView.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " participantId=" << participantPosition.participantId
|
||||
<< " eventType=" << eventType
|
||||
<< " pos=" << participantPosition.pos().lat()
|
||||
<< "/" << participantPosition.pos().lon()
|
||||
<< "/" << participantPosition.pos().z();
|
||||
<< " pos=" << participantPosition.pos.lat
|
||||
<< "/" << participantPosition.pos.lon
|
||||
<< "/" << participantPosition.pos.z;
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
const AreaEffectSimulation::MineArea &ma = m_ddsHandler->dtcAes()->mineArea(itemView.aesItemId);
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
|
||||
pe.eventTypeId(eventType.underlying());
|
||||
pe.participantId(participantPosition.participantId());
|
||||
pe.eventTime(participantPosition.sampleTime());
|
||||
pe.aesItemId(itemView.aesItemId);
|
||||
pe.partyId(participantPosition.partyId());
|
||||
pe.aesName(ma.name());
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.vulnerability(participantPosition.vulnerabilityState.underlying());
|
||||
pe.position(participantPosition.pos());
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantPosition.participantId;
|
||||
pe.eventTime = participantPosition.sampleTime;
|
||||
pe.aesItemId = itemView.aesItemId;
|
||||
pe.partyId = participantPosition.partyId;
|
||||
pe.aesName = ma.name;
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.vulnerability = static_cast<int>(participantPosition.vulnerabilityState);
|
||||
pe.position = participantPosition.pos;
|
||||
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
|
||||
const auto id = pe.id();
|
||||
const auto id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
@@ -974,11 +974,11 @@ void HandlerMineAreas::sendFtcMineTrigger(int aesItemId, int mineIndex)
|
||||
|
||||
auto ftcAes = m_ddsHandler->ftcAes();
|
||||
AreaEffectSimulation::MineTriggeredRequest tr;
|
||||
tr.mineAreaId(aesItemId);
|
||||
tr.mineId(mineIndex);
|
||||
tr.chargeTypeId(ma.chargeStruct().chargeTypeId());
|
||||
DEBUG_LOG(m_logger) << "send sendFtcMineTrigger: aesItemId=" << tr.mineAreaId()
|
||||
<< " MineIndex=" << tr.mineId();
|
||||
tr.mineAreaId = aesItemId;
|
||||
tr.mineId = mineIndex;
|
||||
tr.chargeTypeId = ma.chargeStruct.chargeTypeId;
|
||||
DEBUG_LOG(m_logger) << "send sendFtcMineTrigger: aesItemId=" << tr.mineAreaId
|
||||
<< " MineIndex=" << tr.mineId;
|
||||
ftcAes->mineTriggeredRequest(tr, this);
|
||||
}
|
||||
|
||||
@@ -989,7 +989,7 @@ void HandlerMineAreas::sendEffectTypeEvent(const CentralEffectSimulation::AesIte
|
||||
qint64 effectTime)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendEffectTypeEvent aesItemId=" << itemView.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " participantId=" << participantPosition.participantId
|
||||
<< " effectType=" << effectTime
|
||||
<< " mineFieldBitIndex=" << mineFieldBitIndex;
|
||||
Q_UNUSED(effectTime);
|
||||
@@ -1001,7 +1001,7 @@ void HandlerMineAreas::sendEffectTypeEvent(const CentralEffectSimulation::AesIte
|
||||
mfb = ", mineFieldBitIndex: " + QByteArray::number(mineFieldBitIndex);
|
||||
const int ctasEffectType = static_cast<int>(effectType) & 0xffff;
|
||||
DEBUG_LOG(m_logger) << "Sending EffectType event " << toString(effectType)
|
||||
<< ", participant: " << participantPosition.participantId()
|
||||
<< ", participant: " << participantPosition.participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< mfb
|
||||
<< ", ctasEffectType: " << ctasEffectType;
|
||||
@@ -1082,7 +1082,7 @@ bool HandlerMineAreas::inExtededFormCheck(const CentralEffectSimulation::AesItem
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition) const
|
||||
{
|
||||
const double distance = m_ddsHandler->chargeTypeRadius(itemView.chargeStruct);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos, itemView.zone);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
+47
-47
@@ -56,14 +56,14 @@ bool HandlerMineLayingArtillery::init()
|
||||
|
||||
double HandlerMineLayingArtillery::calculateAngle(const AreaEffectSimulation::TrajectoryTimeAware &trajectory)
|
||||
{
|
||||
Core::GeoPositionRelativeTime trajectoryGeometryFirst = trajectory.geometry().front();
|
||||
Core::GeoPositionRelativeTime trajectoryGeometryLast = trajectory.geometry().back();
|
||||
Core::GeoPositionRelativeTime trajectoryGeometryFirst = trajectory.geometry.front();
|
||||
Core::GeoPositionRelativeTime trajectoryGeometryLast = trajectory.geometry.back();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &trajectoryGeometryFirstUtm
|
||||
= LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(trajectoryGeometryFirst.lon(), trajectoryGeometryFirst.lat()));
|
||||
= LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(trajectoryGeometryFirst.lon, trajectoryGeometryFirst.lat));
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &trajectoryGeometryLastUtm
|
||||
= LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(trajectoryGeometryLast.lon(), trajectoryGeometryLast.lat()), trajectoryGeometryFirstUtm.zone);
|
||||
= LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(trajectoryGeometryLast.lon, trajectoryGeometryLast.lat), trajectoryGeometryFirstUtm.zone);
|
||||
|
||||
QLineF lineFromStartToImpact
|
||||
= QLineF(QPointF(trajectoryGeometryFirstUtm.x, trajectoryGeometryFirstUtm.y), QPointF(trajectoryGeometryLastUtm.x, trajectoryGeometryLastUtm.y));
|
||||
@@ -89,7 +89,7 @@ std::vector<AreaEffectSimulation::MineData> HandlerMineLayingArtillery::calculat
|
||||
|
||||
DEBUG_LOG(m_logger) << "[calculateImpacts] ## \n\tappearanceTimeOffset: " << appearanceTimeOffset << "\n\tappearanceJitter: " << appearanceJitter << "\n\tarmingTimeOffset: " << armingTimeOffset<<"\n\ttime: "<<time;
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate impactPostionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(impactPositon.lon(), impactPositon.lat()));
|
||||
const LtsCoordTrans::UtmCoordinate impactPostionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(impactPositon.lon, impactPositon.lat));
|
||||
|
||||
QJsonObject patternObj = patternsArray[patternCounter].toObject();
|
||||
QJsonArray positionsArray = patternObj[QStringLiteral("positions")].toArray();
|
||||
@@ -114,14 +114,14 @@ std::vector<AreaEffectSimulation::MineData> HandlerMineLayingArtillery::calculat
|
||||
QPointF transformedImpactPosition = impactPostionUtm.geographic(positionRot.x(), positionRot.y());
|
||||
|
||||
|
||||
const double appearenceTime = time + appearanceTimeOffset + QRandomGenerator::global()->bounded(0, appearanceJitter * 2) - appearanceJitter;
|
||||
const double armingTime = time + armingTimeOffset + QRandomGenerator::global()->bounded(0, armingJitter * 2) - armingJitter;
|
||||
const double appearenceTime = time + appearanceTimeOffset + QRandomGenerator::global()->bounded(0, static_cast<int>(appearanceJitter * 2)) - appearanceJitter;
|
||||
const double armingTime = time + armingTimeOffset + QRandomGenerator::global()->bounded(0, static_cast<int>(armingJitter * 2)) - armingJitter;
|
||||
|
||||
DEBUG_LOG(m_logger) <<"[calculateImpacts] patternCount: "<<patternCounter<< " appearenceTime: " << appearenceTime << " armingTime: " << armingTime;
|
||||
|
||||
mineData.position(Core::GeoPosition2D(transformedImpactPosition.x(), transformedImpactPosition.y()));
|
||||
mineData.appearenceTime(appearenceTime);
|
||||
mineData.armingTime(armingTime);
|
||||
mineData.position = Core::GeoPosition2D(transformedImpactPosition.x(), transformedImpactPosition.y());
|
||||
mineData.appearenceTime = appearenceTime;
|
||||
mineData.armingTime = armingTime;
|
||||
|
||||
transformedImpacts.push_back(mineData);
|
||||
}
|
||||
@@ -138,16 +138,16 @@ void HandlerMineLayingArtillery::onChargeTypeChanged(const ProjectDataManagement
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
{
|
||||
if (!m_dtcPdm->isMineLaying(data.id(), 0, 0))
|
||||
if (!m_dtcPdm->isMineLaying(data.id, 0, 0))
|
||||
return;
|
||||
|
||||
QJsonObject mineLayingPattern = m_dtcPdm->mineLayingPattern(data.id(), 0, 0);
|
||||
m_mineLayingChargeTypes.insert(data.id(), mineLayingPattern);
|
||||
QJsonObject mineLayingPattern = m_dtcPdm->mineLayingPattern(data.id, 0, 0);
|
||||
m_mineLayingChargeTypes.insert(data.id, mineLayingPattern);
|
||||
|
||||
return;
|
||||
}
|
||||
case DataModification::eRemoved:
|
||||
m_mineLayingChargeTypes.remove(data.id());
|
||||
m_mineLayingChargeTypes.remove(data.id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -164,9 +164,9 @@ void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
return;
|
||||
|
||||
const AreaEffectSimulation::ChargeEffect chargeEffect = m_effectClusterQue.dequeue();
|
||||
const int chargeTypeId = chargeEffect.chargeTypeId();
|
||||
const int chargeTypeId = chargeEffect.chargeTypeId;
|
||||
|
||||
QByteArray jsonData = QByteArray::fromStdString(chargeEffect.properties());
|
||||
QByteArray jsonData = QByteArray::fromStdString(chargeEffect.properties);
|
||||
QJsonDocument doc = QJsonDocument::fromJson(jsonData);
|
||||
|
||||
bool alreadyUsed = false;
|
||||
@@ -180,12 +180,12 @@ void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
if (!m_mineLayingChargeTypes.contains(chargeTypeId) || alreadyUsed)
|
||||
return;
|
||||
|
||||
const int chargeEffectId = chargeEffect.id();
|
||||
const int chargeEffectId = chargeEffect.id;
|
||||
|
||||
const QJsonObject &mineLayingProperties = m_mineLayingChargeTypes[chargeTypeId];
|
||||
const int mineChargeTypeId = mineLayingProperties[QStringLiteral("mineChargeTypeId")].toInt();
|
||||
AreaEffectSimulation::EffectCluster ec = m_dtcAes->effectCluster(chargeEffect.originatorId());
|
||||
DEBUG_LOG(m_logger)<<" [onChargeEffectChanged] effectClusterId: "<<ec.id()<<" mineChargeTypeId: "<<mineChargeTypeId;
|
||||
AreaEffectSimulation::EffectCluster ec = m_dtcAes->effectCluster(chargeEffect.originatorId);
|
||||
DEBUG_LOG(m_logger)<<" [onChargeEffectChanged] effectClusterId: "<<ec.id<<" mineChargeTypeId: "<<mineChargeTypeId;
|
||||
|
||||
if (mineChargeTypeId <= 0)
|
||||
{
|
||||
@@ -195,54 +195,54 @@ void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
|
||||
for (const auto &trajectory : m_dtcAes->trajectoryTimeAwares())
|
||||
{
|
||||
if (trajectory.originatorId() != chargeEffectId && trajectory.originatorTypeId().underlying() != ProjectDataManagement::StateChangeOriginator::ChargeEffect)
|
||||
if (trajectory.originatorId != chargeEffectId && trajectory.originatorTypeId != ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ChargeEffect)
|
||||
continue;
|
||||
|
||||
if (!m_impactCounters.contains(chargeEffect.originatorId()))
|
||||
m_impactCounters[chargeEffect.originatorId()] = 0;
|
||||
if (!m_impactCounters.contains(chargeEffect.originatorId))
|
||||
m_impactCounters[chargeEffect.originatorId] = 0;
|
||||
|
||||
const int impactCounter = m_impactCounters.value(chargeEffect.originatorId());
|
||||
const int impactCounter = m_impactCounters.value(chargeEffect.originatorId);
|
||||
const double angle = calculateAngle(trajectory);
|
||||
const qint64 timeFromLastTrajectoryPointAbsolute = chargeEffect.effectStart() + trajectory.geometry().back().relativeTime();
|
||||
const qint64 timeFromLastTrajectoryPointAbsolute = chargeEffect.effectStart + trajectory.geometry.back().relativeTime;
|
||||
const int patternCount = mineLayingProperties.value(QStringLiteral("pattern")).toArray().size();
|
||||
const int patternCounter = patternCounterByImpactCount(ec, patternCount, impactCounter);
|
||||
const int effectorIndex = effectorIndexByImpactCount(ec, impactCounter);
|
||||
const Core::GeoPosition mhpPositionGeo = ec.effectors().at(effectorIndex).mhpPosition();
|
||||
const Core::GeoPosition2D mhpPositionGeo2D(mhpPositionGeo.lon(), mhpPositionGeo.lat());
|
||||
const Core::GeoPosition mhpPositionGeo = ec.effectors.at(effectorIndex).mhpPosition;
|
||||
const Core::GeoPosition2D mhpPositionGeo2D(mhpPositionGeo.lon, mhpPositionGeo.lat);
|
||||
const std::vector<AreaEffectSimulation::MineData> mineImpacts
|
||||
= calculateImpacts(mineLayingProperties, mhpPositionGeo2D, angle, timeFromLastTrajectoryPointAbsolute, patternCounter);
|
||||
|
||||
AreaEffectSimulation::MineAreaReferenceModifyRequest request;
|
||||
request.chargeTypeId(mineChargeTypeId);
|
||||
request.referenceAesItemId(chargeEffect.originatorId());
|
||||
request.mineData(mineImpacts);
|
||||
request.chargeTypeId = mineChargeTypeId;
|
||||
request.referenceAesItemId = chargeEffect.originatorId;
|
||||
request.mineData = mineImpacts;
|
||||
|
||||
QJsonObject chargeEffectPropsObj = QJsonDocument::fromJson(QByteArray::fromStdString(chargeEffect.properties())).object();
|
||||
request.effectDurationMsec(chargeEffectPropsObj[QStringLiteral("effectDurationMsec")].toInt(3 * 60 * 60 * 1000));
|
||||
QJsonObject chargeEffectPropsObj = QJsonDocument::fromJson(QByteArray::fromStdString(chargeEffect.properties)).object();
|
||||
request.effectDurationMsec = chargeEffectPropsObj[QStringLiteral("effectDurationMsec")].toInt(3 * 60 * 60 * 1000);
|
||||
|
||||
const int ret = m_ftcAes->mineAreaReferenceModifyRequest(request);
|
||||
DEBUG_LOG(m_logger)<<"[onChargeEffectChanged] ****** mineAreaReferenceModifyRequest \n\tret id: "<< ret
|
||||
<< "\n\tchargeTypeId: " << chargeTypeId
|
||||
<< "\n\tchargeEffectId: " << chargeEffectId << "\n\ttrajectoryId: " << trajectory.id()
|
||||
<< "\n\tchargeEffectId: " << chargeEffectId << "\n\ttrajectoryId: " << trajectory.id
|
||||
<< "\n\tangle: " << angle << "\n\ttimeFromLastTrajectoryPointAbsolute: " << timeFromLastTrajectoryPointAbsolute;
|
||||
|
||||
AreaEffectSimulation::ChargeEffectModifyRequest chargeEffectRequest;
|
||||
chargeEffectRequest.chargeTypeId(chargeEffect.chargeTypeId());
|
||||
chargeEffectRequest.effectDuration(chargeEffect.effectDuration());
|
||||
chargeEffectRequest.effectStart(chargeEffect.effectStart());
|
||||
chargeEffectRequest.gearTypeId(chargeEffect.gearTypeId());
|
||||
chargeEffectRequest.id(chargeEffect.id());
|
||||
chargeEffectRequest.igniterTypeId(chargeEffect.igniterTypeId());
|
||||
chargeEffectRequest.originatorId(chargeEffect.originatorId());
|
||||
chargeEffectRequest.originatorTypeId(chargeEffect.originatorTypeId());
|
||||
chargeEffectRequest.position(chargeEffect.position());
|
||||
chargeEffectRequest.chargeTypeId = chargeEffect.chargeTypeId;
|
||||
chargeEffectRequest.effectDuration = chargeEffect.effectDuration;
|
||||
chargeEffectRequest.effectStart = chargeEffect.effectStart;
|
||||
chargeEffectRequest.gearTypeId = chargeEffect.gearTypeId;
|
||||
chargeEffectRequest.id = chargeEffect.id;
|
||||
chargeEffectRequest.igniterTypeId = chargeEffect.igniterTypeId;
|
||||
chargeEffectRequest.originatorId = chargeEffect.originatorId;
|
||||
chargeEffectRequest.originatorTypeId = chargeEffect.originatorTypeId;
|
||||
chargeEffectRequest.position = chargeEffect.position;
|
||||
|
||||
chargeEffectPropsObj.insert(QStringLiteral("used"), QJsonValue::fromVariant(true));
|
||||
chargeEffectRequest.properties(QJsonDocument(chargeEffectPropsObj).toJson().toStdString());
|
||||
chargeEffectRequest.properties = QJsonDocument(chargeEffectPropsObj).toJson().toStdString();
|
||||
|
||||
m_ftcAes->chargeEffectModifyRequest(chargeEffectRequest);
|
||||
|
||||
++m_impactCounters[chargeEffect.originatorId()];
|
||||
++m_impactCounters[chargeEffect.originatorId];
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -253,22 +253,22 @@ void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
|
||||
int HandlerMineLayingArtillery::patternCounterByImpactCount(const AreaEffectSimulation::EffectCluster &effectCluster, int patternCount, int impactCounter) const
|
||||
{
|
||||
return impactCounter / effectCluster.effectors().size() % patternCount;
|
||||
return impactCounter / effectCluster.effectors.size() % patternCount;
|
||||
}
|
||||
|
||||
int HandlerMineLayingArtillery::effectorIndexByImpactCount(const AreaEffectSimulation::EffectCluster &effectCluster, int impactCounter) const
|
||||
{
|
||||
return impactCounter % effectCluster.effectors().size();
|
||||
return impactCounter % effectCluster.effectors.size();
|
||||
}
|
||||
|
||||
void HandlerMineLayingArtillery::onChargeEffectChanged(const AreaEffectSimulation::ChargeEffect &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
|
||||
if (data.state() != AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
if (data.state != AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
return;
|
||||
|
||||
if (data.originatorTypeId() != ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
||||
if (data.originatorTypeId != ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation)
|
||||
return;
|
||||
|
||||
// since there are some mines missing when adding them too fast, they are queued
|
||||
|
||||
+35
-35
@@ -22,7 +22,7 @@ namespace core
|
||||
{
|
||||
inline uint qHash(ProjectDataManagement::PdmEventType et)
|
||||
{
|
||||
return ::qHash(et.underlying());
|
||||
return ::qHash(et);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,21 +71,21 @@ bool CesMissionPlanHandler::init()
|
||||
|
||||
void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::MissionPlan &data)
|
||||
{
|
||||
CesMissionPlanObject *obj = m_missionPlanObjects.value(data.id(), nullptr);
|
||||
CesMissionPlanObject *obj = m_missionPlanObjects.value(data.id, nullptr);
|
||||
|
||||
if (obj)
|
||||
{
|
||||
m_missionPlanObjects[data.id()]->setMissionPlan(data);
|
||||
m_missionPlanObjects[data.id]->setMissionPlan(data);
|
||||
return;
|
||||
}
|
||||
|
||||
// check if mission start is in the future before proceeding..
|
||||
DEBUG_LOG(m_logger)<<" -- [updateMissionPlanList] new missionPlan : "<<data.name()<< " planId: "<<data.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [updateMissionPlanList] new missionPlan : "<<data.name<< " planId: "<<data.id;
|
||||
|
||||
if (data.missionStart() < m_ddsHandler->currentPartitionTime())
|
||||
if (data.missionStart < m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
WARNING_LOG(m_logger) << " -- updateMissionPlanList mission startTime ("<<data.missionStart()<<") in the past ignore mission plan id: "<<data.id()
|
||||
<< " name: " << data.name() << " - now: " << m_ddsHandler->currentPartitionTime();
|
||||
WARNING_LOG(m_logger) << " -- updateMissionPlanList mission startTime ("<<data.missionStart<<") in the past ignore mission plan id: "<<data.id
|
||||
<< " name: " << data.name << " - now: " << m_ddsHandler->currentPartitionTime();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,25 +101,25 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
};
|
||||
connect(obj, &CesMissionPlanObject::destroyed, this, onDeleteObj);
|
||||
|
||||
m_missionPlanObjects.insert(data.id(), obj);
|
||||
m_missionPlanObjects.insert(data.id, obj);
|
||||
}
|
||||
|
||||
void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
DEBUG_LOG(m_logger)<<" -- onUasChanged : uas.id = "<<data.id() <<" participantId = "<<data.participantId();
|
||||
DEBUG_LOG(m_logger)<<" -- onUasChanged : uas.id = "<<data.id <<" participantId = "<<data.participantId;
|
||||
// get mission object of corresponding uas participant
|
||||
// if drone status is manual mode then cancel mission.
|
||||
if (data.uasState() != ProjectDataManagement::UasState::Manual && modType != DataModification::eRemoved)
|
||||
if (data.uasState != ProjectDataManagement::UasState::UasState_Manual && modType != DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
for (auto planObj : m_missionPlanObjects)
|
||||
{
|
||||
if (planObj->participantId() != data.participantId())
|
||||
if (planObj->participantId() != data.participantId)
|
||||
continue;
|
||||
|
||||
// if waypoint started and state switched to manual abord mission
|
||||
if (planObj->missionPlan().missionStart() < m_ddsHandler->currentPartitionTime())
|
||||
if (planObj->missionPlan().missionStart < m_ddsHandler->currentPartitionTime())
|
||||
planObj->abortMission();
|
||||
break;
|
||||
}
|
||||
@@ -127,8 +127,8 @@ void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data,
|
||||
|
||||
void CesMissionPlanHandler::onMissionPlanChanged(const ParticipantManagement::MissionPlan &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<" -- onMissionPlanChanged : missionPlanName: "<<data.name() << ", modType: " << (int)modType;
|
||||
if (data.id() <= 0)
|
||||
DEBUG_LOG(m_logger)<<" -- onMissionPlanChanged : missionPlanName: "<<data.name << ", modType: " << (int)modType;
|
||||
if (data.id <= 0)
|
||||
return;
|
||||
switch (modType)
|
||||
{
|
||||
@@ -138,12 +138,12 @@ void CesMissionPlanHandler::onMissionPlanChanged(const ParticipantManagement::Mi
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
{
|
||||
auto obj = m_missionPlanObjects.value(data.id(), nullptr);
|
||||
auto obj = m_missionPlanObjects.value(data.id, nullptr);
|
||||
if (!obj)
|
||||
return;
|
||||
delete obj;
|
||||
|
||||
m_missionPlanObjects.remove(data.id());
|
||||
m_missionPlanObjects.remove(data.id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -157,15 +157,15 @@ bool CesMissionPlanHandler::isUasInAutoMode(int participantId)
|
||||
m_ddsHandler->dtcPpm()->waitForHistoricalDataUAS(3000);
|
||||
const auto uas = m_ddsHandler->dtcPpm()->getUasByParticipantId(participantId, m_ddsHandler->getExerciseId());
|
||||
|
||||
if (uas.id() < 1)
|
||||
if (uas.id < 1)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "no uas for pid " << participantId;
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "uas with pid " << participantId << " is in mode: " << (int)uas.uasState().underlying();
|
||||
DEBUG_LOG(m_logger) << "uas with pid " << participantId << " is in mode: " << (int)uas.uasState;
|
||||
|
||||
return (uas.uasState() == ProjectDataManagement::UasState::UasState_Auto);
|
||||
return (uas.uasState == ProjectDataManagement::UasState::UasState_Auto);
|
||||
}
|
||||
|
||||
// stolen from Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_dialog.cpp
|
||||
@@ -175,53 +175,53 @@ bool CesMissionPlanHandler::isUasCombatReady(int participantId)
|
||||
m_ddsHandler->dtcPpm()->waitForHistoricalDataDynamicParticipantData(3000);
|
||||
const auto data = m_ddsHandler->dtcPpm()->dynamicParticipantData(participantId);
|
||||
|
||||
if (data.participantId() == 0)
|
||||
if (data.participantId == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//Current State
|
||||
DEBUG_LOG(m_logger) << "stateHistory count" << data.stateHistory().size();
|
||||
if (data.stateHistory().empty())
|
||||
DEBUG_LOG(m_logger) << "stateHistory count" << data.stateHistory.size();
|
||||
if (data.stateHistory.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto &history = data.stateHistory();
|
||||
const auto &history = data.stateHistory;
|
||||
|
||||
//LasState is the last "real" state, that has a VBG <=8 (Castastrophic)
|
||||
//It's not the last state received, as there can be other state changes like Sanitation, or NearMiss
|
||||
auto lastState = m_ddsHandler->dtcPpm()->youngestStateInformation(history/*, true*/ /* debug */);
|
||||
decltype(lastState) youngestState;
|
||||
youngestState.stateTime(0);
|
||||
youngestState.stateTime = 0;
|
||||
for (const auto &si : history)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "StateInformation "
|
||||
<< " time=" << si.stateTime()
|
||||
<< " vulnerabilityBits=" << si.vulnerabilityBits()
|
||||
<< " vulnerabilityKindId=" << si.vulnerabilityKindId();
|
||||
if (youngestState.stateTime() < si.stateTime())
|
||||
<< " time=" << si.stateTime
|
||||
<< " vulnerabilityBits=" << si.vulnerabilityBits
|
||||
<< " vulnerabilityKindId=" << si.vulnerabilityKindId;
|
||||
if (youngestState.stateTime < si.stateTime)
|
||||
youngestState = si;
|
||||
}
|
||||
|
||||
return (youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
|
||||
return (youngestState.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
|
||||
}
|
||||
|
||||
void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement::MissionAction &msa)
|
||||
{
|
||||
auto missionPlan = m_missionPlanObjects.value(msa.planId(), nullptr);
|
||||
auto missionPlan = m_missionPlanObjects.value(msa.planId, nullptr);
|
||||
if (!missionPlan)
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<" -- [SEND NEXT MISSION] Object not found. PlanId: "<<msa.planId();
|
||||
DEBUG_LOG(m_logger)<<" -- [SEND NEXT MISSION] Object not found. PlanId: "<<msa.planId;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// send to TAB
|
||||
const auto participantId = missionPlan->m_missionPlan.participantId();
|
||||
const auto participantId = missionPlan->m_missionPlan.participantId;
|
||||
const auto participant = m_handlerParticipant->participant(participantId);
|
||||
|
||||
if (!participant.equipmentNumber())
|
||||
if (!participant.equipmentNumber)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav without equipment number";
|
||||
return;
|
||||
@@ -245,12 +245,12 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
return;
|
||||
}
|
||||
|
||||
const auto eqId = participant.equipmentNumber().value();
|
||||
const auto eqId = participant.equipmentNumber.value();
|
||||
|
||||
try
|
||||
{
|
||||
// send action to uav via tab - if this doesn't throw, waypoint is now executing
|
||||
m_ddsHandler->ftcTab()->sendUasWaypointRequest(TrainingAreaBase::SendUasWaypointRequest(eqId, participantId, msa.actionNumber(), msa.itemNumber(), msa.planId(), msa.name(), msa.properties()));
|
||||
m_ddsHandler->ftcTab()->sendUasWaypointRequest(TrainingAreaBase::SendUasWaypointRequest(eqId, participantId, msa.actionNumber, msa.itemNumber, msa.planId, msa.name, msa.properties));
|
||||
// PPM will send a change request to the current active action, which in return tell us (updateMissionPlanList) and finally we will start the next action - so we are done here for now
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
|
||||
+60
-60
@@ -29,9 +29,9 @@ CesMissionPlanObject::CesMissionPlanObject(const ParticipantManagement::MissionP
|
||||
|
||||
m_missionStartimer->setSingleShot(true);
|
||||
connect(m_missionStartimer, &QTimer::timeout, this, &CesMissionPlanObject::sendNextMissionAction);
|
||||
if (missionPlan.missionStart() > m_ddsHandler->currentPartitionTime())
|
||||
if (missionPlan.missionStart > m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
const int time = m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime();
|
||||
const int time = m_missionPlan.missionStart - m_ddsHandler->currentPartitionTime();
|
||||
// DEBUG_LOG(m_logger)<<" -- [CesMissionPlanObject] start mission after << "<<time/1000<<" sec.";
|
||||
m_missionStartimer->start(time);
|
||||
}
|
||||
@@ -53,74 +53,74 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionActionFullfiled] -> msa.number: "<<msa.actionNumber()<<" planId: "<<msa.planId();
|
||||
// actionNumb=-1 && itemNumb=-1 |-> mission will be aborted
|
||||
if (msa.itemNumber() < 0 && msa.actionNumber() < 0)
|
||||
if (msa.itemNumber < 0 && msa.actionNumber < 0)
|
||||
{
|
||||
ParticipantManagement::SetMissionActionFulfilledRequest abortReq(m_missionPlan.id(),
|
||||
ParticipantManagement::SetMissionActionFulfilledRequest abortReq(m_missionPlan.id,
|
||||
m_ddsHandler->currentPartitionTime(),
|
||||
-1,
|
||||
-1);
|
||||
if ( !m_ddsHandler->ftcPpm()->setMissionActionFulfilledRequest(abortReq))
|
||||
WARNING_LOG(m_logger) << " -- unable to abort mission with planId:"<<abortReq.missionId();
|
||||
WARNING_LOG(m_logger) << " -- unable to abort mission with planId:"<<abortReq.missionId;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (msa.itemNumber() >= static_cast<int>(m_missionPlan.items().size()) )
|
||||
if (msa.itemNumber >= static_cast<int>(m_missionPlan.items.size()) )
|
||||
{
|
||||
//WARNING_LOG(m_logger)<<" -- [setMissionActionFulfilled] item size invalid !!";
|
||||
return;
|
||||
}
|
||||
|
||||
const int actionCount = m_missionPlan.items()[msa.itemNumber()].actions().size();
|
||||
if (msa.actionNumber() >= actionCount)
|
||||
const int actionCount = m_missionPlan.items[msa.itemNumber].actions.size();
|
||||
if (msa.actionNumber >= actionCount)
|
||||
{
|
||||
//WARNING_LOG(m_logger)<<" -- [setMissionActionFulfilled] actions size invalid !!";
|
||||
return;
|
||||
}
|
||||
|
||||
auto &action = m_missionPlan.items()[msa.itemNumber()].actions()[msa.actionNumber()];
|
||||
action.fulfilled(m_ddsHandler->currentPartitionTime());
|
||||
auto &action = m_missionPlan.items[msa.itemNumber].actions[msa.actionNumber];
|
||||
action.fulfilled = m_ddsHandler->currentPartitionTime();
|
||||
ParticipantManagement::SetMissionActionFulfilledRequest req;
|
||||
req.actionNumber(action.actionNumber());
|
||||
req.fulfilled(action.fulfilled());
|
||||
req.itemNumber(action.itemNumber());
|
||||
req.missionId(m_missionPlan.id());
|
||||
req.actionNumber = action.actionNumber;
|
||||
req.fulfilled = action.fulfilled;
|
||||
req.itemNumber = action.itemNumber;
|
||||
req.missionId = m_missionPlan.id;
|
||||
|
||||
if (!m_ddsHandler->ftcPpm()->setMissionActionFulfilledRequest(req))
|
||||
WARNING_LOG(m_logger) << " -- unable to setMissionActionFulfilledRequest: planId:"<<req.missionId();
|
||||
WARNING_LOG(m_logger) << " -- unable to setMissionActionFulfilledRequest: planId:"<<req.missionId;
|
||||
|
||||
}
|
||||
|
||||
int CesMissionPlanObject::planId() const
|
||||
{
|
||||
return m_missionPlan.id();
|
||||
return m_missionPlan.id;
|
||||
}
|
||||
|
||||
int CesMissionPlanObject::participantId() const
|
||||
{
|
||||
return m_missionPlan.participantId();
|
||||
return m_missionPlan.participantId;
|
||||
}
|
||||
|
||||
bool CesMissionPlanObject::isMissionFulfilled(const ParticipantManagement::MissionPlan &mission)
|
||||
{
|
||||
int itemCount = 0;
|
||||
int actionCount = 0;
|
||||
for (const auto &item : mission.items())
|
||||
for (const auto &item : mission.items)
|
||||
{
|
||||
actionCount = 0;
|
||||
for (const auto &a : item.actions())
|
||||
for (const auto &a : item.actions)
|
||||
{
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionPlan] action.Num : "<<a.actionNumber()<<" itemNum: "<<a.itemNumber()<<" fulfilled: "<<a.fulfilled();
|
||||
if (a.fulfilled() > 0)
|
||||
if (a.fulfilled > 0)
|
||||
actionCount++;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
if (actionCount == (int) item.actions().size())
|
||||
if (actionCount == (int) item.actions.size())
|
||||
itemCount++;
|
||||
}
|
||||
|
||||
return (itemCount == (int)mission.items().size());
|
||||
return (itemCount == (int)mission.items.size());
|
||||
}
|
||||
|
||||
void CesMissionPlanObject::sendActionAttact()
|
||||
@@ -130,7 +130,7 @@ void CesMissionPlanObject::sendActionAttact()
|
||||
//3- setActionFulfilled
|
||||
int ret = m_ddsHandler->ftcAes()->explosionClusterSingleEffectOnlyModifyRequest(getExplosionCluster());
|
||||
if (!ret)
|
||||
WARNING_LOG(m_logger)<<" -- sendActionAttact ret error for planId: "<<m_missionPlan.id();
|
||||
WARNING_LOG(m_logger)<<" -- sendActionAttact ret error for planId: "<<m_missionPlan.id;
|
||||
|
||||
setMissionActionFulfilled(getNextAction());
|
||||
}
|
||||
@@ -139,28 +139,28 @@ AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest CesMissionPlanObje
|
||||
{
|
||||
auto msa = getNextAction();
|
||||
|
||||
QJsonObject jsobj = QJsonDocument::fromJson(QByteArray::fromStdString(msa.properties())).object();
|
||||
QJsonObject jsobj = QJsonDocument::fromJson(QByteArray::fromStdString(msa.properties)).object();
|
||||
const int chargeTypeId = jsobj.value(QStringLiteral("chargeTypeId")).toInt();
|
||||
|
||||
|
||||
const ParticipantManagement::Participant participant = m_ddsHandler->dtcPpm()->participant(m_missionPlan.participantId());
|
||||
const ParticipantManagement::UAS uas = m_ddsHandler->dtcPpm()->getUasByParticipantId(m_missionPlan.participantId(),
|
||||
const ParticipantManagement::Participant participant = m_ddsHandler->dtcPpm()->participant(m_missionPlan.participantId);
|
||||
const ParticipantManagement::UAS uas = m_ddsHandler->dtcPpm()->getUasByParticipantId(m_missionPlan.participantId,
|
||||
m_ddsHandler->dds()->getPartitionId());
|
||||
|
||||
QDateTime timeStamp = QDateTime::fromMSecsSinceEpoch(m_ddsHandler->currentPartitionTime());
|
||||
timeStamp = timeStamp.addSecs(10);
|
||||
const QString exploName = QStringLiteral("%1_%2").arg(QString::fromStdString(uas.deviceIdentifier())).arg(DTG::toStringMSec(timeStamp.toMSecsSinceEpoch(), DTG::DisplayFormat::Short));
|
||||
const QString exploName = QStringLiteral("%1_%2").arg(QString::fromStdString(uas.deviceIdentifier)).arg(DTG::toStringMSec(timeStamp.toMSecsSinceEpoch(), DTG::DisplayFormat::Short));
|
||||
Core::GeoPosition geoPos(jsobj.value(QStringLiteral("location_x")).toDouble(),
|
||||
jsobj.value(QStringLiteral("location_y")).toDouble(), 0.0);
|
||||
|
||||
AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest ecReq;
|
||||
ecReq.id(0);
|
||||
ecReq.effectStart(timeStamp.toMSecsSinceEpoch());
|
||||
ecReq.name(exploName.toStdString());
|
||||
ecReq.element(ecReq.name());
|
||||
ecReq.impactPosition(geoPos);
|
||||
ecReq.chargeTypeId(chargeTypeId);
|
||||
ecReq.partyId(participant.partyId());
|
||||
ecReq.id = 0;
|
||||
ecReq.effectStart = timeStamp.toMSecsSinceEpoch();
|
||||
ecReq.name = exploName.toStdString();
|
||||
ecReq.element = ecReq.name;
|
||||
ecReq.impactPosition = geoPos;
|
||||
ecReq.chargeTypeId = chargeTypeId;
|
||||
ecReq.partyId = participant.partyId;
|
||||
// ecReq.externalId(0); // not used!!
|
||||
|
||||
return ecReq;
|
||||
@@ -180,14 +180,14 @@ void CesMissionPlanObject::sendNextMissionAction()
|
||||
//DEBUG_LOG(m_logger)<<" -- ########## ###### SEND NEXT ACTION ###### #############";
|
||||
|
||||
// set mission plan completed! or aborted
|
||||
if (isMissionFulfilled(m_missionPlan) || m_missionPlan.aborted())
|
||||
if (isMissionFulfilled(m_missionPlan) || m_missionPlan.aborted)
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<" -- [sendNextMissionAction] No action mission Completed for plan id: "<<m_missionPlan.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [sendNextMissionAction] No action mission Completed for plan id: "<<m_missionPlan.id;
|
||||
deleteMissionPlanObject();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (action.actionType().underlying()) {
|
||||
switch (action.actionType) {
|
||||
case ParticipantManagement::MissionActionType::MoveTo:
|
||||
{
|
||||
emit ready2SendNextAction(action);
|
||||
@@ -195,7 +195,7 @@ void CesMissionPlanObject::sendNextMissionAction()
|
||||
}
|
||||
case ParticipantManagement::MissionActionType::Loiter:
|
||||
{
|
||||
m_loiterTimer->start(action.duration() * 1000); // duration is in sec -> in msec: x * 1000
|
||||
m_loiterTimer->start(action.duration * 1000); // duration is in sec -> in msec: x * 1000
|
||||
return;
|
||||
}
|
||||
case ParticipantManagement::MissionActionType::Attack:
|
||||
@@ -215,14 +215,14 @@ void CesMissionPlanObject::setMissionPlan(const ParticipantManagement::MissionPl
|
||||
///3- send Next Mission Action
|
||||
|
||||
m_missionPlan = plan;
|
||||
if (plan.missionStart() > m_ddsHandler->currentPartitionTime())
|
||||
if (plan.missionStart > m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionPlan] restart Timer for plan.id: "<<plan.id();
|
||||
m_missionStartimer->start(m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime());
|
||||
m_missionStartimer->start(m_missionPlan.missionStart - m_ddsHandler->currentPartitionTime());
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMissionFulfilled(plan) || plan.aborted())
|
||||
if (isMissionFulfilled(plan) || plan.aborted)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "setMissionPlan deleteMissionPlanObject";
|
||||
deleteMissionPlanObject();
|
||||
@@ -240,21 +240,21 @@ ParticipantManagement::MissionPlan &CesMissionPlanObject::missionPlan()
|
||||
const ParticipantManagement::MissionAction CesMissionPlanObject::getNextAction()
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextAction]: planId: "<<m_missionPlan.id()<<" itemSize: "<<m_missionPlan.items().size();
|
||||
std::vector<ParticipantManagement::MissionItem> items = m_missionPlan.items();
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextAction]: planId: "<<m_missionPlan.id<<" itemSize: "<<m_missionPlan.items.size();
|
||||
std::vector<ParticipantManagement::MissionItem> items = m_missionPlan.items;
|
||||
|
||||
// std::sort(items.begin(), items.end(), [](const ParticipantManagement::MissionItem &itemA, const ParticipantManagement::MissionItem &itemB){ return (itemA.itemNumber() < itemB.itemNumber()); });
|
||||
|
||||
for (auto &item : m_missionPlan.items())
|
||||
for (auto &item : m_missionPlan.items)
|
||||
{
|
||||
for (auto &msa : item.actions())
|
||||
for (auto &msa : item.actions)
|
||||
{
|
||||
if (msa.fulfilled() > 0)
|
||||
if (msa.fulfilled > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextActopm]mission with planId: " << m_missionPlan.id() << " // action_number " << msa.actionNumber()
|
||||
<< " // action_type " << msa.actionType();
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextActopm]mission with planId: " << m_missionPlan.id << " // action_number " << msa.actionNumber
|
||||
<< " // action_type " << msa.actionType;
|
||||
|
||||
return msa;
|
||||
}
|
||||
@@ -267,14 +267,14 @@ void CesMissionPlanObject::setMissionCompleted()
|
||||
{
|
||||
const ParticipantManagement::MissionPlan &msp = m_missionPlan;
|
||||
ParticipantManagement::ModifyMissionPlanRequest req;
|
||||
req.missionStart(msp.missionStart());
|
||||
req.jumpToStart(msp.jumpToStart());
|
||||
req.id(msp.id());
|
||||
req.items(msp.items());
|
||||
req.name(msp.name());
|
||||
req.participantId(msp.participantId());
|
||||
req.properties(msp.properties());
|
||||
req.repeat(msp.repeat());
|
||||
req.missionStart = msp.missionStart;
|
||||
req.jumpToStart = msp.jumpToStart;
|
||||
req.id = msp.id;
|
||||
req.items = msp.items;
|
||||
req.name = msp.name;
|
||||
req.participantId = msp.participantId;
|
||||
req.properties = msp.properties;
|
||||
req.repeat = msp.repeat;
|
||||
|
||||
if (!m_ddsHandler->ftcPpm()->modifyMissionPlanRequest(req))
|
||||
ERROR_LOG(m_logger)<<" -- couldn't modify mission plan ";
|
||||
@@ -292,16 +292,16 @@ void CesMissionPlanObject::setMissionCompleted()
|
||||
*/
|
||||
void CesMissionPlanObject::abortMission()
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<" -- [abortMission] abord mission with planId: "<<m_missionPlan.id()<<" // uas id: "<<m_missionPlan.participantId();
|
||||
DEBUG_LOG(m_logger)<<" -- [abortMission] abord mission with planId: "<<m_missionPlan.id<<" // uas id: "<<m_missionPlan.participantId;
|
||||
ParticipantManagement::MissionAction msa = getNextAction();
|
||||
msa.actionNumber(-1);
|
||||
msa.itemNumber(-1);
|
||||
msa.actionNumber = -1;
|
||||
msa.itemNumber = -1;
|
||||
setMissionActionFulfilled(msa);
|
||||
}
|
||||
|
||||
void CesMissionPlanObject::deleteMissionPlanObject()
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<" -- [DELETE OBJECT] plan fullfiled: delete Object planId: "<<m_missionPlan.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [DELETE OBJECT] plan fullfiled: delete Object planId: "<<m_missionPlan.id;
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
+201
-201
@@ -23,7 +23,7 @@ namespace core
|
||||
{
|
||||
inline uint qHash(ProjectDataManagement::PdmEventType et)
|
||||
{
|
||||
return ::qHash(et.underlying());
|
||||
return ::qHash(et);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,45 +171,45 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
double lowerOffset = 0;
|
||||
bool offsetIsSet = false;
|
||||
TRACE_LOG(m_logger) << "onAesItemViewChanged"
|
||||
<< " aesItemId=" << data.aesItemId();
|
||||
<< " aesItemId=" << data.aesItemId;
|
||||
|
||||
|
||||
AreaEffectSimulation::BCContamination bCContamination = m_ddsHandler->dtcAes()->bCContamination(data.aesItemId());
|
||||
AreaEffectSimulation::BCContamination bCContamination = m_ddsHandler->dtcAes()->bCContamination(data.aesItemId);
|
||||
|
||||
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
if ((data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtDangerArea)
|
||||
&& (data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtBCContamination)
|
||||
&& (data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtNContamination))
|
||||
const int aesItemId = data.aesItemId;
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
if ((data.aesTypeId != AreaEffectSimulation::AesType::AtDangerArea)
|
||||
&& (data.aesTypeId != AreaEffectSimulation::AesType::AtBCContamination)
|
||||
&& (data.aesTypeId != AreaEffectSimulation::AesType::AtNContamination))
|
||||
return;
|
||||
|
||||
if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtBCContamination)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBCContamination)
|
||||
{
|
||||
const AreaEffectSimulation::BCContamination &bc = m_ddsHandler->dtcAes()->bCContamination(data.aesItemId());
|
||||
if (!bc.isCentral())
|
||||
const AreaEffectSimulation::BCContamination &bc = m_ddsHandler->dtcAes()->bCContamination(data.aesItemId);
|
||||
if (!bc.isCentral)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!Central BCContamination id: " << aesItemId;
|
||||
return;
|
||||
}
|
||||
offsetIsSet = true;
|
||||
upperOffset = bCContamination.upperOffset();
|
||||
lowerOffset = bCContamination.lowerOffset();
|
||||
upperOffset = bCContamination.upperOffset;
|
||||
lowerOffset = bCContamination.lowerOffset;
|
||||
}
|
||||
else if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtDangerArea)
|
||||
else if (data.aesTypeId == AreaEffectSimulation::AesType::AtDangerArea)
|
||||
{
|
||||
const AreaEffectSimulation::DangerArea &da = m_ddsHandler->dtcAes()->dangerArea(data.aesItemId());
|
||||
if (!da.isCentral())
|
||||
const AreaEffectSimulation::DangerArea &da = m_ddsHandler->dtcAes()->dangerArea(data.aesItemId);
|
||||
if (!da.isCentral)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!Central DangerArea id: " << aesItemId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtNContamination)
|
||||
else if (data.aesTypeId == AreaEffectSimulation::AesType::AtNContamination)
|
||||
{
|
||||
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(data.aesItemId());
|
||||
if (!nc.isCentral())
|
||||
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(data.aesItemId);
|
||||
if (!nc.isCentral)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!Central NContamination id: " << aesItemId;
|
||||
return;
|
||||
@@ -218,26 +218,26 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
|
||||
|
||||
TRACE_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", type: " << data.aesTypeId
|
||||
<< ", effectState: " << data.effectStateId
|
||||
<< ", modType: " << modType;
|
||||
|
||||
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct());
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct);
|
||||
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
|
||||
switch (effectState.underlying())
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsPrepared:
|
||||
{
|
||||
const auto &aesItemViewUtm = CentralEffectSimulation::AesItemViewUtm::create(data,
|
||||
m_aesItemViews[data.aesItemId()],
|
||||
m_aesItemViews[data.aesItemId],
|
||||
impactRadius,
|
||||
isSupplyTruck,
|
||||
hazardDistance,
|
||||
offsetIsSet,
|
||||
upperOffset,
|
||||
lowerOffset);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId, aesItemViewUtm);
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
@@ -245,23 +245,23 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
|
||||
CentralEffectSimulation::AesItemViewUtm aesItemViewUtm =
|
||||
CentralEffectSimulation::AesItemViewUtm::create(data,
|
||||
m_aesItemViews[data.aesItemId()],
|
||||
m_aesItemViews[data.aesItemId],
|
||||
impactRadius,
|
||||
isSupplyTruck,
|
||||
hazardDistance,
|
||||
offsetIsSet,
|
||||
upperOffset,
|
||||
lowerOffset);
|
||||
const Core::GeoPosition2D &pointGeo = bCContamination.impactPosition();
|
||||
const Core::GeoPosition2D &pointGeo = bCContamination.impactPosition;
|
||||
int zone = aesItemViewUtm.zone;
|
||||
|
||||
//aesItemViewUtm.center = CentralEffectSimulation::geographic2Utm(pointGeo, &zone);
|
||||
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pointGeo.lon(), pointGeo.lat(), zone);
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pointGeo.lon, pointGeo.lat, zone);
|
||||
QPointF impactPositionUtm = QPointF(utm.x, utm.y);
|
||||
aesItemViewUtm.center = impactPositionUtm;
|
||||
|
||||
switch (data.aesTypeId().underlying())
|
||||
switch (data.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
case AreaEffectSimulation::AesType::AtNContamination:
|
||||
@@ -270,15 +270,15 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
// form-Check
|
||||
// if new field for this participant send sendCesHitRequest
|
||||
calculateBcContamination(aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId, aesItemViewUtm);
|
||||
// DEBUG_LOG(m_logger) << "insert AtBCContamination oder AtNContamination AesItemView id: " << aesItemId
|
||||
// << ", type: " << data.aesTypeId();
|
||||
break;
|
||||
case AreaEffectSimulation::AesType::AtDangerArea:
|
||||
calculateDangerArea(aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId, aesItemViewUtm);
|
||||
DEBUG_LOG(m_logger) << "insert AtDangerArea AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId();
|
||||
<< ", type: " << data.aesTypeId;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -301,9 +301,9 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
|
||||
void HandlerNBC::onBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType)
|
||||
{
|
||||
if (!data.isCentral())
|
||||
if (!data.isCentral)
|
||||
{
|
||||
aesItemViewRemoved(data.id());
|
||||
aesItemViewRemoved(data.id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -313,15 +313,15 @@ void HandlerNBC::onBCContaminationChanged(const AreaEffectSimulation::BCContamin
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
|
||||
if (m_ddsHandler->volatilityTypeId(data.chargeStruct()) == ProjectDataManagement::VolatilityType::Resident)
|
||||
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id];
|
||||
if (m_ddsHandler->volatilityTypeId(data.chargeStruct) == ProjectDataManagement::VolatilityType::Resident)
|
||||
{
|
||||
ref.radials = {data.impactRadius()};
|
||||
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition(), &ref.zone);
|
||||
ref.radials = {data.impactRadius};
|
||||
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition, &ref.zone);
|
||||
}
|
||||
else
|
||||
ref.radials.clear();
|
||||
@@ -337,60 +337,60 @@ void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContaminat
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged"
|
||||
<< " id=" << data.id();
|
||||
<< " id=" << data.id;
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
switch (data.effectStateId().underlying())
|
||||
switch (data.effectStateId)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
|
||||
ref.radials = {data.impactRadius(),
|
||||
data.borderLengthInner(),
|
||||
data.borderLengthInner() + data.borderLengthOuter()
|
||||
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id];
|
||||
ref.radials = {data.impactRadius,
|
||||
data.borderLengthInner,
|
||||
data.borderLengthInner + data.borderLengthOuter
|
||||
};
|
||||
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition(), &ref.zone);
|
||||
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition, &ref.zone);
|
||||
const QHash<int, CentralEffectSimulation::HandlerParticipant::CesParticipantData> participantsMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap)
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged participantId=" << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged participantId=" << participantPos.participantId
|
||||
<< " insideBuilding=" << participantPos.insideBuilding()
|
||||
<< " buildingId=" << participantPos.buildingId();
|
||||
<< " buildingId=" << participantPos.buildingId;
|
||||
|
||||
const QPointF posUtm = CentralEffectSimulation::geographic2Utm(participantPos.pos(), &ref.zone);
|
||||
const bool isInCircle = inCircle(ref.center, data.impactRadius(), posUtm);
|
||||
const QPointF posUtm = CentralEffectSimulation::geographic2Utm(participantPos.pos, &ref.zone);
|
||||
const bool isInCircle = inCircle(ref.center, data.impactRadius, posUtm);
|
||||
|
||||
const EffectType effectType = CES_NBC::EffectType::NContaminationDetonation;
|
||||
const int ctasEffectType = static_cast<int>(effectType) & 0xffff;
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged isInCircle=" << isInCircle
|
||||
<< " aesItemId=" << data.id();
|
||||
<< " aesItemId=" << data.id;
|
||||
if ( isInCircle)
|
||||
{
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantPos.participantId());
|
||||
aesIds.insert(data.id(), true);
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantPos.participantId);
|
||||
aesIds.insert(data.id, true);
|
||||
|
||||
m_participantAes.insert( participantPos.participantId(), aesIds);
|
||||
m_participantAes.insert( participantPos.participantId, aesIds);
|
||||
|
||||
QHash<int, QSet<EffectType>> effectTypeStatesFromAesItem = m_effectTypeStates.value(data.id());
|
||||
QHash<int, QSet<EffectType>> effectTypeStatesFromAesItem = m_effectTypeStates.value(data.id);
|
||||
|
||||
|
||||
QSet<EffectType> effectSet = effectTypeStatesFromAesItem.value(participantPos.participantId());
|
||||
QSet<EffectType> effectSet = effectTypeStatesFromAesItem.value(participantPos.participantId);
|
||||
|
||||
effectSet.insert(EffectType::NContaminationDetonation);
|
||||
|
||||
effectTypeStatesFromAesItem.insert(participantPos.participantId(), effectSet);
|
||||
effectTypeStatesFromAesItem.insert(participantPos.participantId, effectSet);
|
||||
|
||||
m_effectTypeStates.insert(data.id(), effectTypeStatesFromAesItem);
|
||||
m_effectTypeStates.insert(data.id, effectTypeStatesFromAesItem);
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_participantAes.insert participantId=" << participantPos.participantId()
|
||||
<< " aesId=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "m_participantAes.insert participantId=" << participantPos.participantId
|
||||
<< " aesId=" << data.id;
|
||||
sendCesHitRequest(ref,
|
||||
participantPos,
|
||||
//effectTime >= 0 ? effectTime : participantPosition.sampleTime(),
|
||||
@@ -416,10 +416,10 @@ void HandlerNBC::calculateBcContamination(const CentralEffectSimulation::AesItem
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
DEBUG_LOG(m_logger) << "participantId=" << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "participantId=" << participantPos.participantId
|
||||
<< " insideBuilding=" << participantPos.insideBuilding()
|
||||
<< " buildingId=" << participantPos.buildingId()
|
||||
<< " roomId=" << participantPos.roomId();
|
||||
<< " buildingId=" << participantPos.buildingId
|
||||
<< " roomId=" << participantPos.roomId;
|
||||
inFormCheck(itemView, participantPos);
|
||||
}
|
||||
// for
|
||||
@@ -442,61 +442,61 @@ void HandlerNBC::deleteDangerArea(const int aesItemId)
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
{
|
||||
sendParticipantEvent(aesItemId, participantPos, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
|
||||
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId;
|
||||
}// for all Participants
|
||||
} // deleteDangerArea
|
||||
|
||||
void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
bool leave = false;
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewOutdoorParticipantPosition participantId=" << participantData.participantId()
|
||||
<< " buildingId=" << participantData.buildingId()
|
||||
<< " roomId=" << participantData.roomId()
|
||||
<< " reportingSource=" << participantData.reportingSource()
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewOutdoorParticipantPosition participantId=" << participantData.participantId
|
||||
<< " buildingId=" << participantData.buildingId
|
||||
<< " roomId=" << participantData.roomId
|
||||
<< " reportingSource=" << participantData.reportingSource
|
||||
<< " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
if (m_handlerParticipant->isOutdated(participantData))
|
||||
return;
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(participantData.participantId()) == 0)
|
||||
if (m_handlerParticipant->getEquipmentNumber(participantData.participantId) == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_lastRoomId.value(participantData.participantId()) > 0)
|
||||
if (m_lastRoomId.value(participantData.participantId) > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Leave Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Leave Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId
|
||||
<< " m_isInContaminatedRoom.\nremove!!!";
|
||||
|
||||
|
||||
AreaEffectSimulation::AesItemView aesItemView;
|
||||
bool aesIsAvailable = m_ddsHandler->dtcAes()->aesItemViewFromEntityId(m_isInContaminatedRoom.value(participantData.participantId()),AreaEffectSimulation::AesType::AtUnknown, aesItemView );
|
||||
bool aesIsAvailable = m_ddsHandler->dtcAes()->aesItemViewFromEntityId(m_isInContaminatedRoom.value(participantData.participantId),AreaEffectSimulation::AesType::AtUnknown, aesItemView );
|
||||
|
||||
if (aesIsAvailable
|
||||
&& (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
&& (aesItemView.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
|
||||
m_isInContaminatedRoom.remove(participantData.participantId());
|
||||
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId;
|
||||
m_isInContaminatedRoom.remove(participantData.participantId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
|
||||
sendLeaveEvent(aesItemView.aesItemId(),participantData );
|
||||
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId;
|
||||
sendLeaveEvent(aesItemView.aesItemId,participantData );
|
||||
}
|
||||
leave = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId())
|
||||
<< " roomId=" << m_lastRoomId.value(participantData.participantId());
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId)
|
||||
<< " roomId=" << m_lastRoomId.value(participantData.participantId);
|
||||
}
|
||||
|
||||
m_lastRoomId.insert(participantData.participantId(), 0);
|
||||
m_lastRoomId.insert(participantData.participantId, 0);
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId
|
||||
<< " m_aesItemViews.size()=" << m_aesItemViews.size();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
@@ -505,13 +505,13 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
|
||||
if (leave)
|
||||
{
|
||||
QHash<int, QSet<EffectType>> effectTypeHash = m_effectTypeStates.value(itemView.aesItemId);
|
||||
if ( effectTypeHash.contains(participantData.participantId()))
|
||||
if ( effectTypeHash.contains(participantData.participantId))
|
||||
{
|
||||
effectTypeHash.remove(participantData.participantId());
|
||||
effectTypeHash.remove(participantData.participantId);
|
||||
}
|
||||
m_effectTypeStates.insert(itemView.aesItemId, effectTypeHash);
|
||||
}
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
switch (itemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
case AreaEffectSimulation::AesType::AtNContamination:
|
||||
@@ -578,14 +578,14 @@ bool HandlerNBC::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUt
|
||||
const QRectF boundingBoxImpact(itemView.boundingBoxBottomLeft,
|
||||
itemView.boundingBoxTopRight);
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos, itemView.zone);
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId
|
||||
<< " inside AesItemView:" << itemView.aesItemId;
|
||||
return true;
|
||||
}
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId
|
||||
<< " outside AesItemView:" << itemView.aesItemId;
|
||||
return false;
|
||||
}
|
||||
@@ -597,14 +597,14 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
|
||||
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(aesItemId,AreaEffectSimulation::AesType::AtUnknown, aesItemView );
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendEnterEvent, paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendEnterEvent, paricipantId: " << participantData.participantId
|
||||
<< ", aesItemId: " << aesItemId
|
||||
<< ", aesType=" << aesTypeId
|
||||
<< ", isIndoor=" << isIndoor;
|
||||
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantData.participantId());
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantData.participantId);
|
||||
aesIds.insert(aesItemId, true);
|
||||
m_participantAes.insert(participantData.participantId(), aesIds);
|
||||
m_participantAes.insert(participantData.participantId, aesIds);
|
||||
int zone = -1;
|
||||
|
||||
if ( m_aesItemViews.contains(aesItemId))
|
||||
@@ -614,8 +614,8 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
|
||||
ERROR_LOG(m_logger) << "No m_aesItemViews.contains aesItemId=" << aesItemId;
|
||||
}
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), zone);
|
||||
switch (aesTypeId.underlying())
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos, zone);
|
||||
switch (aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
{
|
||||
@@ -632,7 +632,7 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
|
||||
break;
|
||||
case AreaEffectSimulation::AesType::AtNContamination:
|
||||
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
|
||||
sendEffectTypeEvent(aesItemId, participantData, effectTypeForNContaminationArea(m_aesItemViews.value(aesItemId), participantPosUtmPoint, participantData.sampleTime(), participantData.insideBuilding()));
|
||||
sendEffectTypeEvent(aesItemId, participantData, effectTypeForNContaminationArea(m_aesItemViews.value(aesItemId), participantPosUtmPoint, participantData.sampleTime, participantData.insideBuilding()));
|
||||
break;
|
||||
case AreaEffectSimulation::AesType::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType::AtFunctionalArea:
|
||||
@@ -651,11 +651,11 @@ void HandlerNBC::sendLeaveEvent(const int aesItemId, const CentralEffectSimulati
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendLeaveEvent"
|
||||
<< " aesId=" << aesItemId
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " aesTypeId=" << aesItemView.aesTypeId();
|
||||
<< " participantId=" << participantData.participantId
|
||||
<< " aesTypeId=" << aesItemView.aesTypeId;
|
||||
|
||||
|
||||
switch (aesItemView.aesTypeId().underlying())
|
||||
switch (aesItemView.aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
sendEffectTypeEvent(aesItemId, participantData, EffectType::BCContaminationLeave);
|
||||
@@ -687,9 +687,9 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
|
||||
const QRectF boundingBoxImpact(itemView.boundingBoxBottomLeft,
|
||||
itemView.boundingBoxTopRight);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos(), itemView.zone);
|
||||
TRACE_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId()
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos, itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos, itemView.zone);
|
||||
TRACE_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size()
|
||||
@@ -699,30 +699,30 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint) &&
|
||||
itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Participant id=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant id=" << participantData.participantId
|
||||
<< " inside Area"
|
||||
<< " inside Building:" << participantData.insideBuilding()
|
||||
<< " roomId=" << participantData.roomId();
|
||||
if ( participantData.roomId() > 0 )
|
||||
<< " roomId=" << participantData.roomId;
|
||||
if ( participantData.roomId > 0 )
|
||||
{
|
||||
|
||||
InfrastructureManagement::StructureElement structureElement;
|
||||
bool roomFound = m_ddsHandler->dtcIsm()->getStructureElementById(participantData.roomId(), structureElement);
|
||||
bool roomFound = m_ddsHandler->dtcIsm()->getStructureElementById(participantData.roomId, structureElement);
|
||||
|
||||
DEBUG_LOG (m_logger) << "Participant id=" << participantData.participantId()
|
||||
<< " pos.z=" << participantData.pos().z()
|
||||
DEBUG_LOG (m_logger) << "Participant id=" << participantData.participantId
|
||||
<< " pos.z=" << participantData.pos.z
|
||||
<< " upperOffset =" << itemView.upperOffset
|
||||
<< " lowerOffset=" << itemView.lowerOffset
|
||||
<< " roomFound=" << roomFound
|
||||
<< " offsetZ=" << structureElement.relPosition().offsetZ();
|
||||
<< " offsetZ=" << structureElement.relPosition.offsetZ;
|
||||
|
||||
if ( (itemView.aesTypeId.underlying() != AreaEffectSimulation::AesType::AtNContamination)
|
||||
if ( (itemView.aesTypeId != AreaEffectSimulation::AesType::AtNContamination)
|
||||
&& itemView.offsetIsSet
|
||||
&& ( ( structureElement.relPosition().offsetZ() + 1.5 > itemView.upperOffset )
|
||||
|| ( structureElement.relPosition().offsetZ() + 1.5 < itemView.lowerOffset)))
|
||||
&& ( ( structureElement.relPosition.offsetZ + 1.5 > itemView.upperOffset )
|
||||
|| ( structureElement.relPosition.offsetZ + 1.5 < itemView.lowerOffset)))
|
||||
{
|
||||
DEBUG_LOG (m_logger) << "Participant id=" << participantData.participantId()
|
||||
<< " pos.z=" << participantData.pos().z()
|
||||
DEBUG_LOG (m_logger) << "Participant id=" << participantData.participantId
|
||||
<< " pos.z=" << participantData.pos.z
|
||||
<< " not between upperOffset =" << itemView.upperOffset
|
||||
<< " and lowerOffset=" << itemView.lowerOffset
|
||||
<< "\nreturn false";
|
||||
@@ -763,15 +763,15 @@ void HandlerNBC::sendCesHitRequest(const CentralEffectSimulation::AesItemViewUtm
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeStruct)
|
||||
<< " participantId=" << participantData.participantId();
|
||||
<< " participantId=" << participantData.participantId;
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId
|
||||
<< " equipNo = " << equipNo
|
||||
<< " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantData.participantId() != 0 && equipNo <= 0)
|
||||
if (participantData.participantId != 0 && equipNo <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
@@ -779,17 +779,17 @@ void HandlerNBC::sendCesHitRequest(const CentralEffectSimulation::AesItemViewUtm
|
||||
|
||||
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
|
||||
|
||||
const TrainingAreaBase::TabPosition pos(participantData.pos(),
|
||||
const TrainingAreaBase::TabPosition pos(participantData.pos,
|
||||
Core::PositionReportingSource::Gps, // irrelevant
|
||||
participantData.buildingId(),
|
||||
participantData.roomId());
|
||||
participantData.buildingId,
|
||||
participantData.roomId);
|
||||
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
|
||||
|
||||
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipNo, // equipmentNumber
|
||||
participantData.participantId(), // participantId
|
||||
itemView.chargeStruct.chargeTypeId(), // chargeTypeId
|
||||
participantData.participantId, // participantId
|
||||
itemView.chargeStruct.chargeTypeId, // chargeTypeId
|
||||
itemView.aesItemId, // aesId
|
||||
originatorEquipNo, // originatorEquipmentNumber
|
||||
remaining, // remainEffectPercent ( no protection outside Building )
|
||||
@@ -799,8 +799,8 @@ void HandlerNBC::sendCesHitRequest(const CentralEffectSimulation::AesItemViewUtm
|
||||
itemView.partyId, // originPartyId
|
||||
mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId()
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId();
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId;
|
||||
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
@@ -826,23 +826,23 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
|
||||
int32_t legacyChargeTypeId = 0;
|
||||
int32_t partyId = 0;
|
||||
if ( aesItem.partyId.is_set())
|
||||
if ( aesItem.partyId.has_value())
|
||||
partyId = aesItem.partyId.get();
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(aesItem.chargeStruct());
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(aesItem.chargeStruct);
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(aesItem.chargeStruct())
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(aesItem.chargeStruct)
|
||||
<< " participantId=" << participantData.participantId
|
||||
<< " partyId=" << partyId
|
||||
<< " effectType=" << static_cast<int>(effectType)
|
||||
<< " remaining=" << remaining;
|
||||
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId
|
||||
<< " equipNo = " << equipmentNumber << " aesItemId =" << aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantData.participantId() != 0 && equipmentNumber <= 0)
|
||||
if (participantData.participantId != 0 && equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
@@ -852,7 +852,7 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
else if (effectType == CES_NBC::EffectType::NContaminationEnterArea1)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1";
|
||||
if (participantData.buildingId() > 0)
|
||||
if (participantData.buildingId > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1 Protection by buildings"
|
||||
<< " remaining vorher=" << remaining
|
||||
@@ -879,15 +879,15 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(aesItemId, 0);
|
||||
const int originatorEquipmentNumber = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
|
||||
const TrainingAreaBase::TabPosition pos(
|
||||
participantData.pos(), Core::PositionReportingSource::Gps, participantData.buildingId(),
|
||||
participantData.roomId()
|
||||
participantData.pos, Core::PositionReportingSource::Gps, participantData.buildingId,
|
||||
participantData.roomId
|
||||
);
|
||||
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipmentNumber, participantData.participantId(), legacyChargeTypeId, aesItemId, originatorEquipmentNumber,
|
||||
equipmentNumber, participantData.participantId, legacyChargeTypeId, aesItemId, originatorEquipmentNumber,
|
||||
remaining, pos, effectTime, eventType, partyId, mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId() << " chargeTypeId=" << aesItem.chargeStruct().chargeTypeId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId << " chargeTypeId=" << aesItem.chargeStruct.chargeTypeId
|
||||
<< " legacyChargeTypeId=" << legacyChargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
@@ -902,7 +902,7 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData,
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantData.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantData.participantTypeId);
|
||||
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -911,21 +911,21 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
typeClass == ParticipantManagement::TypeClass::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId
|
||||
<< " has invalid typeClass: " << typeClass
|
||||
<< " eventType: " << eventType;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!eventMustBeSend(aesItemId, participantData.participantId(), eventType))
|
||||
if (!eventMustBeSend(aesItemId, participantData.participantId, eventType))
|
||||
{
|
||||
if ( m_isInContaminatedRoom.contains(participantData.participantId()) && participantData.roomId() == 0) // Tln leaves Building
|
||||
if ( m_isInContaminatedRoom.contains(participantData.participantId) && participantData.roomId == 0) // Tln leaves Building
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Sending Event because Participant leaves Building";
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId
|
||||
<< " and aes " << aesItemId << " - already sent";
|
||||
return;
|
||||
}
|
||||
@@ -939,56 +939,56 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantData.participantId;
|
||||
return;
|
||||
}
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId
|
||||
<< " - participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " participantId=" << participantData.participantId
|
||||
<< " AesItemId=" << aesItemId;
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
|
||||
pe.eventTypeId(eventType.underlying());
|
||||
pe.participantId(participantData.participantId());
|
||||
pe.eventTime(participantData.sampleTime());
|
||||
pe.aesItemId(aesItemId);
|
||||
pe.partyId(participantData.partyId());
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantData.participantId;
|
||||
pe.eventTime = participantData.sampleTime;
|
||||
pe.aesItemId = aesItemId;
|
||||
pe.partyId = participantData.partyId;
|
||||
|
||||
if (eventType == ProjectDataManagement::PdmEventType::EventType_BCContamination)
|
||||
{
|
||||
const AreaEffectSimulation::BCContamination &bc = m_ddsHandler->dtcAes()->bCContamination(aesItemId);
|
||||
pe.aesName(bc.name());
|
||||
pe.aesName = bc.name;
|
||||
}
|
||||
else if (eventType == ProjectDataManagement::PdmEventType::EventType_DangerArea)
|
||||
{
|
||||
const AreaEffectSimulation::DangerArea &da = m_ddsHandler->dtcAes()->dangerArea(aesItemId);
|
||||
pe.aesName(da.name());
|
||||
pe.aesName = da.name;
|
||||
}
|
||||
else if (eventType == ProjectDataManagement::PdmEventType::EventType_NContamination)
|
||||
{
|
||||
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(aesItemId);
|
||||
pe.aesName(nc.name());
|
||||
pe.aesName = nc.name;
|
||||
}
|
||||
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.vulnerability(participantData.vulnerabilityState.underlying());
|
||||
pe.position(participantData.pos());
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.vulnerability = static_cast<int>(participantData.vulnerabilityState);
|
||||
pe.position = participantData.pos;
|
||||
|
||||
AreaEffectSimulation::AesItem aesItem;
|
||||
m_ddsHandler->dtcAes()->aesItemFromId(aesItemId, aesItem);
|
||||
|
||||
// Criterion for friendly Fire:
|
||||
if (aesItem.partyId() != -1
|
||||
if (aesItem.partyId != -1
|
||||
&& ((eventType == ProjectDataManagement::PdmEventType::EventType_EnterMineArea
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_EnterNuclear
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|
||||
@@ -997,17 +997,17 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|
||||
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN)
|
||||
&& aesItem.partyId() == participantData.partyId()))
|
||||
pe.friendlyFire(true);
|
||||
&& aesItem.partyId == participantData.partyId))
|
||||
pe.friendlyFire = true;
|
||||
else
|
||||
pe.friendlyFire(false);
|
||||
pe.friendlyFire = false;
|
||||
|
||||
INFO_LOG(m_logger) << "sendParticipantEvent: " << pe
|
||||
<< ", currentMSecsSinceEpoch = " << QDateTime::currentMSecsSinceEpoch()
|
||||
<< ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime();
|
||||
<< ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime;
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
|
||||
const auto id = pe.id();
|
||||
const auto id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
@@ -1019,18 +1019,18 @@ void HandlerNBC::sendEffectTypeEvent(const int aesItemId,
|
||||
int mineFieldBitIndex = 0;
|
||||
|
||||
if (!effectTypeMustBeSend(aesItemId,
|
||||
participantData.participantId(),
|
||||
participantData.participantId,
|
||||
effectType))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not sending EffectType event " << toString(effectType)
|
||||
<< ", participant: " << participantData.participantId()
|
||||
<< ", participant: " << participantData.participantId
|
||||
<< ", aesItemId: " << aesItemId
|
||||
<< " - already sent";
|
||||
return;
|
||||
}
|
||||
const int ctasEffectType = static_cast<int>(effectType) & 0xffff;
|
||||
DEBUG_LOG(m_logger) << "Sending EffectType event " << toString(effectType)
|
||||
<< ", participant: " << participantData.participantId()
|
||||
<< ", participant: " << participantData.participantId
|
||||
<< ", aesItemId: " << aesItemId
|
||||
<< ", ctasEffectType: " << ctasEffectType;
|
||||
sendCesHitRequest(aesItemId,
|
||||
@@ -1059,7 +1059,7 @@ bool HandlerNBC::eventMustBeSend(int aesItemId,
|
||||
activeEvents.insert(eventType);
|
||||
|
||||
// - remove opposite events (e.g remove Enter event when we leave the area)
|
||||
switch (eventType.underlying())
|
||||
switch (eventType)
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea:
|
||||
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
|
||||
@@ -1199,7 +1199,7 @@ bool HandlerNBC::inCircle(const QPointF ¢erUtm, const double radius, const Q
|
||||
|
||||
ProjectDataManagement::PdmEventType HandlerNBC::leaveEventTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
|
||||
{
|
||||
switch (aesTypeId.underlying())
|
||||
switch (aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtDangerArea:
|
||||
return ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea;
|
||||
@@ -1215,7 +1215,7 @@ ProjectDataManagement::PdmEventType HandlerNBC::leaveEventTypeForAesType(AreaEff
|
||||
|
||||
EffectType HandlerNBC::leaveEffectTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
|
||||
{
|
||||
switch (aesTypeId.underlying())
|
||||
switch (aesTypeId)
|
||||
{
|
||||
case AreaEffectSimulation::AesType::AtBCContamination:
|
||||
return EffectType::BCContaminationLeave;
|
||||
@@ -1233,7 +1233,7 @@ EffectType HandlerNBC::effectTypeForNContaminationArea(const CentralEffectSimula
|
||||
const bool isIndoor)
|
||||
{
|
||||
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(itemView.aesItemId);
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(nc.impactPosition().lon(), nc.impactPosition().lat(), itemView.zone);
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(nc.impactPosition.lon, nc.impactPosition.lat, itemView.zone);
|
||||
QPointF impactPositionUtm = QPointF(utm.x, utm.y);
|
||||
DEBUG_LOG(m_logger) << "HandlerNBC::effectTypeForNContaminationArea itemView.radials.size()=" << itemView.radials.size();
|
||||
if (itemView.radials.size() != 3)
|
||||
@@ -1298,7 +1298,7 @@ EffectType HandlerNBC::effectTypeForBCContaminationArea(const CentralEffectSimul
|
||||
return EffectType::BCContaminationEnterFloating;
|
||||
// use real start point for non floating!
|
||||
const auto &bcItem = m_ddsHandler->dtcAes()->bCContamination(itemView.aesItemId);
|
||||
const auto utmImpcat = CentralEffectSimulation::geographic2Utm(bcItem.impactPosition(), itemView.zone);
|
||||
const auto utmImpcat = CentralEffectSimulation::geographic2Utm(bcItem.impactPosition, itemView.zone);
|
||||
const double squareDist = CentralEffectSimulation::getSquareDistance(utmImpcat, participantPosUtmPoint);
|
||||
if (squareDist <= pow(itemView.radials.at(0), 2))
|
||||
{
|
||||
@@ -1361,19 +1361,19 @@ int HandlerNBC::getContaminationFromBuildingRoom(const int buildingId, const int
|
||||
<< " roomId=" << roomId;
|
||||
|
||||
Buildings::BuildingState buildingState = m_ddsHandler->dtcBld()->buildingState(buildingId);
|
||||
if (buildingState.contaminationStates().size() == 0 )
|
||||
if (buildingState.contaminationStates.size() == 0 )
|
||||
return 0;
|
||||
|
||||
|
||||
if (buildingState.contaminationStates().size() == 0)
|
||||
if (buildingState.contaminationStates.size() == 0)
|
||||
return 0;
|
||||
|
||||
for (unsigned int i = 0; i < buildingState.contaminationStates().size(); i++)
|
||||
for (unsigned int i = 0; i < buildingState.contaminationStates.size(); i++)
|
||||
{
|
||||
for (unsigned int j = 0; j < buildingState.contaminationStates()[i].rooms().size(); j++)
|
||||
for (unsigned int j = 0; j < buildingState.contaminationStates[i].rooms.size(); j++)
|
||||
{
|
||||
if (buildingState.contaminationStates()[i].rooms()[j] == roomId)
|
||||
return buildingState.contaminationStates()[i].aesId();
|
||||
if (buildingState.contaminationStates[i].rooms[j] == roomId)
|
||||
return buildingState.contaminationStates[i].aesId;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -1386,9 +1386,9 @@ void HandlerNBC::onBuildingStateChanged(const Buildings::BuildingState &data, Da
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId()
|
||||
<< ", aesId = " << data.aesId()
|
||||
<< ", data.contaminationStates().size()=" << data.contaminationStates().size();
|
||||
DEBUG_LOG(m_logger) << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId
|
||||
<< ", aesId = " << data.aesId
|
||||
<< ", data.contaminationStates().size()=" << data.contaminationStates.size();
|
||||
// Check each participant
|
||||
const QHash<int, CentralEffectSimulation::HandlerParticipant::CesParticipantData> participantsMap = m_handlerParticipant->positions();
|
||||
|
||||
@@ -1397,14 +1397,14 @@ void HandlerNBC::onBuildingStateChanged(const Buildings::BuildingState &data, Da
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
|
||||
if (participantPos.buildingId() == 0)
|
||||
if (participantPos.buildingId == 0)
|
||||
continue;
|
||||
|
||||
int aesId = getContaminationFromBuildingRoom(participantPos.buildingId(), participantPos.roomId());
|
||||
int aesId = getContaminationFromBuildingRoom(participantPos.buildingId, participantPos.roomId);
|
||||
const CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(aesId);
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantPos.participantId());
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantPos.participantId);
|
||||
aesIds.insert(aesId, true);
|
||||
m_participantAes.insert(participantPos.participantId(), aesIds);
|
||||
m_participantAes.insert(participantPos.participantId, aesIds);
|
||||
onNewIndoorParticipantPosition(participantPos);
|
||||
}
|
||||
|
||||
@@ -1413,26 +1413,26 @@ void HandlerNBC::onBuildingStateChanged(const Buildings::BuildingState &data, Da
|
||||
void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
bool enterBuilding = false;
|
||||
if ( m_lastRoomId.value(participantData.participantId()) == 0)
|
||||
if ( m_lastRoomId.value(participantData.participantId) == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId Enter Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId()
|
||||
<< " roomId=" << participantData.roomId()
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId Enter Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId
|
||||
<< " roomId=" << participantData.roomId
|
||||
<< " m_isInContaminatedRoom. \nremove!!!!";
|
||||
m_isInContaminatedRoom.remove(participantData.participantId());
|
||||
m_lastRoomId.insert(participantData.participantId(), participantData.roomId());
|
||||
m_isInContaminatedRoom.remove(participantData.participantId);
|
||||
m_lastRoomId.insert(participantData.participantId, participantData.roomId);
|
||||
enterBuilding = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId())
|
||||
<< " roomId=" << m_lastRoomId.value(participantData.participantId());
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId)
|
||||
<< " roomId=" << m_lastRoomId.value(participantData.participantId);
|
||||
}
|
||||
|
||||
int aesId = getContaminationFromBuildingRoom(participantData.buildingId(), participantData.roomId());
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewIndoorParticipantPosition participantId=" << participantData.participantId()
|
||||
<< " buildingId=" << participantData.buildingId()
|
||||
<< " roomId=" << participantData.roomId()
|
||||
<< " reportingSource=" << participantData.reportingSource()
|
||||
int aesId = getContaminationFromBuildingRoom(participantData.buildingId, participantData.roomId);
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewIndoorParticipantPosition participantId=" << participantData.participantId
|
||||
<< " buildingId=" << participantData.buildingId
|
||||
<< " roomId=" << participantData.roomId
|
||||
<< " reportingSource=" << participantData.reportingSource
|
||||
<< " Raum ist Kontaminiert: aesId=" << aesId;
|
||||
if ( aesId == 0)
|
||||
{
|
||||
@@ -1444,9 +1444,9 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
if (enterBuilding)
|
||||
{
|
||||
QHash<int, QSet<EffectType>> effectTypeHash = m_effectTypeStates.value(aesId);
|
||||
if ( effectTypeHash.contains(participantData.participantId()))
|
||||
if ( effectTypeHash.contains(participantData.participantId))
|
||||
{
|
||||
effectTypeHash.remove(participantData.participantId());
|
||||
effectTypeHash.remove(participantData.participantId);
|
||||
}
|
||||
m_effectTypeStates.insert(aesId, effectTypeHash);
|
||||
}
|
||||
@@ -1456,9 +1456,9 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
|
||||
if (aesId > 0 && !m_aesItemViews.contains(aesId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_isInContaminatedRoom insert participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "m_isInContaminatedRoom insert participantId=" << participantData.participantId
|
||||
<< " aesId=" << aesId;
|
||||
m_isInContaminatedRoom.insert(participantData.participantId(), aesId);
|
||||
m_isInContaminatedRoom.insert(participantData.participantId, aesId);
|
||||
}
|
||||
|
||||
if (aesId > 0)
|
||||
@@ -1466,16 +1466,16 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
AreaEffectSimulation::AesItemView aesItemView;
|
||||
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(aesId,AreaEffectSimulation::AesType::AtUnknown, aesItemView );
|
||||
|
||||
AreaEffectSimulation::AesType aesTypeId = aesItemView.aesTypeId();
|
||||
AreaEffectSimulation::AesType aesTypeId = aesItemView.aesTypeId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "onNewIndoorParticipantPosition sendEnterEvent aesTypeId=" << aesTypeId;
|
||||
sendEnterEvent(aesId,aesTypeId, participantData, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_participantAes.contains(participantData.participantId()))
|
||||
if (m_participantAes.contains(participantData.participantId))
|
||||
{
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantData.participantId());
|
||||
QHash<int, bool> aesIds = m_participantAes.value(participantData.participantId);
|
||||
// leave aesArea
|
||||
QHashIterator<int, bool> i(aesIds);
|
||||
while (i.hasNext())
|
||||
|
||||
+20
-20
@@ -55,14 +55,14 @@ void HandlerBlockedAreas::onSendParticipantBlockedAreaReply(const Core::Function
|
||||
|
||||
void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos)
|
||||
{
|
||||
const int participantId = partPos.participantId();
|
||||
const int participantId = partPos.participantId;
|
||||
int damagePercentBlockedAreas = 90; // From the percentage damage, blocked area applies Todo Config Value
|
||||
DEBUG_LOG(m_logger) << "HandlerBlockedAreas onParticipantPositionChanged participantId=" << participantId;
|
||||
|
||||
TrainingAreaBase::SendParticipantBlockedAreaRequest pba;
|
||||
pba.equipmentNumber(m_ddsHandler->participantId2EquipNo(partPos.participantId()));
|
||||
pba.participantId(partPos.participantId());
|
||||
// if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
|
||||
pba.equipmentNumber = m_ddsHandler->participantId2EquipNo(partPos.participantId);
|
||||
pba.participantId = partPos.participantId;
|
||||
// if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady)
|
||||
// m_blockedAreas.remove(participantId);
|
||||
|
||||
if (!partPos.insideBuilding())
|
||||
@@ -70,8 +70,8 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
auto it = m_blockedAreas.find(participantId);
|
||||
if (it != m_blockedAreas.end())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Leave);
|
||||
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber;
|
||||
pba.blockedAreaMode = TrainingAreaBase::BlockedAreaMode::Leave;
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.erase(it);
|
||||
}
|
||||
@@ -81,10 +81,10 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
{
|
||||
// check leave
|
||||
if (m_blockedAreas.contains(participantId) &&
|
||||
(m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId()) < damagePercentBlockedAreas))
|
||||
(m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId) < damagePercentBlockedAreas))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Leave);
|
||||
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber;
|
||||
pba.blockedAreaMode = TrainingAreaBase::BlockedAreaMode::Leave;
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.remove(participantId);
|
||||
return;
|
||||
@@ -92,23 +92,23 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Room =" << partPos.roomId()
|
||||
<< " DamagePercentRoom=" << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId());
|
||||
DEBUG_LOG(m_logger) << "1: " << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId())
|
||||
DEBUG_LOG(m_logger) << "Room =" << partPos.roomId
|
||||
<< " DamagePercentRoom=" << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId);
|
||||
DEBUG_LOG(m_logger) << "1: " << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId)
|
||||
<< " damagePercentBlockedAreas= " << damagePercentBlockedAreas << "\n"
|
||||
<< " getDamagePercentFromBuilding=" << m_handlerParticipantBuilding->getDamagePercentFromBuilding(partPos.buildingId()) << "\n"
|
||||
<< " getDamagePercentFromBuilding=" << m_handlerParticipantBuilding->getDamagePercentFromBuilding(partPos.buildingId) << "\n"
|
||||
<< "m_blockedAreas.contains(participantId) = " << m_blockedAreas.contains(participantId) ;
|
||||
|
||||
|
||||
|
||||
if ((m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId()) >= damagePercentBlockedAreas
|
||||
|| m_handlerParticipantBuilding->getDamagePercentFromBuilding(partPos.buildingId()) == 100)
|
||||
if ((m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId) >= damagePercentBlockedAreas
|
||||
|| m_handlerParticipantBuilding->getDamagePercentFromBuilding(partPos.buildingId) == 100)
|
||||
&& !m_blockedAreas.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Send Enter Blocked Area to Participant:" << participantId;
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Enter);
|
||||
pba.blockedAreaMode = TrainingAreaBase::BlockedAreaMode::Enter;
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.insert(participantId, partPos.roomId());
|
||||
m_blockedAreas.insert(participantId, partPos.roomId);
|
||||
}
|
||||
|
||||
} // end of onParticipantPositionChanged()
|
||||
@@ -126,9 +126,9 @@ void HandlerBlockedAreas::onBuildingStateChanged(const int32_t buildingId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "remove participantId: " << participantId;
|
||||
TrainingAreaBase::SendParticipantBlockedAreaRequest pba;
|
||||
pba.equipmentNumber(m_ddsHandler->participantId2EquipNo(participantId));
|
||||
pba.participantId(participantId);
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Leave);
|
||||
pba.equipmentNumber = m_ddsHandler->participantId2EquipNo(participantId);
|
||||
pba.participantId = participantId;
|
||||
pba.blockedAreaMode = TrainingAreaBase::BlockedAreaMode::Leave;
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.remove(participantId);
|
||||
}
|
||||
|
||||
+66
-66
@@ -65,7 +65,7 @@ int HandlerParticipantBuilding::getDamagePercentFromBuilding(const int buildingI
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "getDamagePercentFromBuilding buildingId=" << buildingId;
|
||||
auto it = m_buildingStates.find(buildingId);
|
||||
return it != m_buildingStates.end() ? it.value().damagePercent() : 0;
|
||||
return it != m_buildingStates.end() ? it.value().damagePercent : 0;
|
||||
}
|
||||
|
||||
int HandlerParticipantBuilding::getDamagePercentFromRoom(const int roomId) const
|
||||
@@ -110,21 +110,21 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
m_buildingStates.remove(data.id());
|
||||
m_buildingStates.remove(data.id);
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId()
|
||||
<< ", aesId = " << data.aesId()
|
||||
<< ", chargeTypeId = " << data.chargeTypeId()
|
||||
<< ", sampleTime = " << data.sampleTime()
|
||||
<< ", CountRooms =" << data.roomStates().size()
|
||||
<< ", structureElementId=" << data.structureElementId()
|
||||
<< ", assetId=" << data.assetId()
|
||||
<< ", roomStates.size=" << data.roomStates().size()
|
||||
<< ", damagePercent" << data.damagePercent();
|
||||
DEBUG_LOG(m_logger) << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId
|
||||
<< ", aesId = " << data.aesId
|
||||
<< ", chargeTypeId = " << data.chargeTypeId
|
||||
<< ", sampleTime = " << data.sampleTime
|
||||
<< ", CountRooms =" << data.roomStates.size()
|
||||
<< ", structureElementId=" << data.structureElementId
|
||||
<< ", assetId=" << data.assetId
|
||||
<< ", roomStates.size=" << data.roomStates.size()
|
||||
<< ", damagePercent" << data.damagePercent;
|
||||
|
||||
if ( (data.originatorParticipantId() == 0) && (data.aesId() == 0) && (data.chargeTypeId()==0))
|
||||
if ( (data.originatorParticipantId == 0) && (data.aesId == 0) && (data.chargeTypeId==0))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not valid return ";
|
||||
return;
|
||||
@@ -132,28 +132,28 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
|
||||
// fill m_roomIdDamageState
|
||||
RoomState rs;
|
||||
rs.buildingId = data.id();
|
||||
m_buildingStates.insert(data.id(), data);
|
||||
DEBUG_LOG(m_logger) << "m_buildingStates.insert id=" << data.id()
|
||||
<< " aesId=" << data.aesId()
|
||||
<< " name=" << data.name();
|
||||
rs.buildingId = data.id;
|
||||
m_buildingStates.insert(data.id, data);
|
||||
DEBUG_LOG(m_logger) << "m_buildingStates.insert id=" << data.id
|
||||
<< " aesId=" << data.aesId
|
||||
<< " name=" << data.name;
|
||||
|
||||
for (const Buildings::RoomState &roomState : data.roomStates())
|
||||
for (const Buildings::RoomState &roomState : data.roomStates)
|
||||
{
|
||||
rs.damagePercent = roomState.damagePercent();
|
||||
m_roomIdDamageState.insert(roomState.id(), rs);
|
||||
rs.damagePercent = roomState.damagePercent;
|
||||
m_roomIdDamageState.insert(roomState.id, rs);
|
||||
DEBUG_LOG(m_logger) << "m_roomIdDamageState.insert"
|
||||
<< " RoomId = " << roomState.id()
|
||||
<< ", BuildingId = " << data.id()
|
||||
<< ", destruction = " << roomState.damagePercent();
|
||||
<< " RoomId = " << roomState.id
|
||||
<< ", BuildingId = " << data.id
|
||||
<< ", destruction = " << roomState.damagePercent;
|
||||
}
|
||||
// init: remove all rooms from Map
|
||||
if (data.damagePercent() == 0)
|
||||
if (data.damagePercent == 0)
|
||||
{
|
||||
auto it = m_roomIdDamageState.begin();
|
||||
while (it != m_roomIdDamageState.end())
|
||||
{
|
||||
if (it.value().buildingId == data.id())
|
||||
if (it.value().buildingId == data.id)
|
||||
it = m_roomIdDamageState.erase(it);
|
||||
else
|
||||
++it;
|
||||
@@ -162,27 +162,27 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
}
|
||||
|
||||
const auto participantsMap = m_handlerParticipant->positions();
|
||||
for (const Buildings::RoomState &roomState : data.roomStates())
|
||||
for (const Buildings::RoomState &roomState : data.roomStates)
|
||||
{
|
||||
if (roomState.damagePercent() <= 0)
|
||||
if (roomState.damagePercent <= 0)
|
||||
continue;
|
||||
// no effect should not burden the radio
|
||||
if (roomState.remainingEffectPercent() == 0)
|
||||
if (roomState.remainingEffectPercent == 0)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << " RoomId[" << roomState.id() << "]:"
|
||||
<< " remainingEffectPercent = " << roomState.remainingEffectPercent()
|
||||
<< " roomState.damagePercent()=" << roomState.damagePercent()
|
||||
<< " roomState.remainingEffectPercent()=" << roomState.remainingEffectPercent();
|
||||
DEBUG_LOG(m_logger) << " RoomId[" << roomState.id << "]:"
|
||||
<< " remainingEffectPercent = " << roomState.remainingEffectPercent
|
||||
<< " roomState.damagePercent()=" << roomState.damagePercent
|
||||
<< " roomState.remainingEffectPercent()=" << roomState.remainingEffectPercent;
|
||||
// search for participants in each room:
|
||||
// if participant in room sendCESHit to TAB
|
||||
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap)
|
||||
{
|
||||
const int participantId = participantPos.participantId();
|
||||
if (participantPos.roomId() != roomState.id())
|
||||
const int participantId = participantPos.participantId;
|
||||
if (participantPos.roomId != roomState.id)
|
||||
continue;
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
continue;
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantId);
|
||||
if (equipNo <= 0)
|
||||
@@ -191,22 +191,22 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << " participantId = " << participantId
|
||||
<< " roomId = " << participantPos.roomId()
|
||||
<< " roomState.id=" << roomState.id()
|
||||
<< " roomId = " << participantPos.roomId
|
||||
<< " roomState.id=" << roomState.id
|
||||
<< " participantPos.vulnerabilityState=" << participantPos.vulnerabilityState
|
||||
<< " equipNo=" << m_ddsHandler->participantId2EquipNo(participantId)
|
||||
<< " isOutdated=" << m_handlerParticipant->isOutdated(participantPos);
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendCesHitToParticipant";
|
||||
sendCesHitToParticipant(data, participantId, roomState.remainingEffectPercent());
|
||||
sendCesHitToParticipant(data, participantId, roomState.remainingEffectPercent);
|
||||
}
|
||||
}
|
||||
|
||||
m_buildingStates.insert(data.id(), data);
|
||||
m_buildingStates.insert(data.id, data);
|
||||
if (!m_timer->isActive() && !m_requestMap.isEmpty())
|
||||
m_timer->start(1000);
|
||||
|
||||
emit newBuildingState(data.id());
|
||||
emit newBuildingState(data.id);
|
||||
}
|
||||
|
||||
void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::BuildingState &data,
|
||||
@@ -215,7 +215,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
{
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantId);
|
||||
const QHash<int, CentralEffectSimulation::HandlerParticipant::CesParticipantData> participantsMap = m_handlerParticipant->positions();
|
||||
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(data.originatorParticipantId());
|
||||
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(data.originatorParticipantId);
|
||||
|
||||
|
||||
|
||||
@@ -226,36 +226,36 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
|
||||
|
||||
|
||||
bool itemAvailable = m_ddsHandler->dtcAes()->aesItemFromId(data.aesId(), aesItem);
|
||||
bool itemAvailable = m_ddsHandler->dtcAes()->aesItemFromId(data.aesId, aesItem);
|
||||
if (itemAvailable)
|
||||
DEBUG_LOG(m_logger) << "partyId=" << aesItem.partyId()
|
||||
<< " chargeTypeId=" << aesItem.chargeStruct().chargeTypeId()
|
||||
<< " duration=" << aesItem.effectDuration();
|
||||
DEBUG_LOG(m_logger) << "partyId=" << aesItem.partyId
|
||||
<< " chargeTypeId=" << aesItem.chargeStruct.chargeTypeId
|
||||
<< " duration=" << aesItem.effectDuration;
|
||||
|
||||
// mineFieldBitIndex wird als reserve1 uegertragen und hier wird die Wirkdauer uebertragen.
|
||||
const int duration = aesItem.effectDuration() / 1000;
|
||||
const int duration = aesItem.effectDuration / 1000;
|
||||
|
||||
//int32_t legacyChargeTypeId = 0;
|
||||
//const ProjectDataManagement::FuseType fuseType = m_ddsHandler->dtcAes()->explosionCluster(aesItem.id()).fuseType();
|
||||
const int chargeTypeId = itemAvailable ? aesItem.chargeStruct().chargeTypeId() : data.chargeTypeId();
|
||||
const int chargeTypeId = itemAvailable ? aesItem.chargeStruct.chargeTypeId : data.chargeTypeId;
|
||||
|
||||
// legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(chargeTypeId, fuseType);
|
||||
// NOTE: igniterTypeId/IgniterFunction = 0 as long as BuildingState does not contain values
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct = { data.chargeTypeId(),0,0};
|
||||
if (itemAvailable) chargeStruct = aesItem.chargeStruct();
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct = { data.chargeTypeId,0,0};
|
||||
if (itemAvailable) chargeStruct = aesItem.chargeStruct;
|
||||
int remainTasCodeIndirect = m_ddsHandler->remainingTasCode(chargeStruct);
|
||||
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant equipNo = " << equipNo
|
||||
<< " participantId=" << participantId
|
||||
<< " chargeTypeId=" << data.chargeTypeId()
|
||||
<< " chargeTypeId=" << data.chargeTypeId
|
||||
<< " originatorEquipNo=" << originatorEquipNo
|
||||
<< " remainingEffectPercent=" << remainingEffectPercent
|
||||
<< " remainTasCodeIndirect=" << remainTasCodeIndirect
|
||||
<< " eventType=" << eventType;
|
||||
const TrainingAreaBase::TabPosition pos(participantPos.pos(),
|
||||
participantPos.reportingSource(),
|
||||
participantPos.buildingId(),
|
||||
participantPos.roomId());
|
||||
const TrainingAreaBase::TabPosition pos(participantPos.pos,
|
||||
participantPos.reportingSource,
|
||||
participantPos.buildingId,
|
||||
participantPos.roomId);
|
||||
|
||||
|
||||
// Bei Nebel soll die Weste nur einmal piepen und nicht regelmaessig. Das wird mit Wirkung = 3 uebertragen
|
||||
@@ -270,20 +270,20 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
|
||||
TrainingAreaBase::SendCesHitRequest requestTab;
|
||||
|
||||
requestTab.aesId(data.aesId());
|
||||
requestTab.aesId = data.aesId;
|
||||
//requestTab.chargeTypeId(legacyChargeTypeId > 0 ? legacyChargeTypeId : chargeTypeId);
|
||||
requestTab.chargeTypeId(chargeTypeId);
|
||||
requestTab.effectTime(data.sampleTime());
|
||||
requestTab.equipmentNumber(equipNo);
|
||||
requestTab.eventType(eventType);
|
||||
requestTab.mineId(duration);
|
||||
requestTab.originatorEquipmentNumber(originatorEquipNo);
|
||||
requestTab.participantId(participantId);
|
||||
requestTab.chargeTypeId = chargeTypeId;
|
||||
requestTab.effectTime = data.sampleTime;
|
||||
requestTab.equipmentNumber = equipNo;
|
||||
requestTab.pdmEventType = eventType;
|
||||
requestTab.mineId = duration;
|
||||
requestTab.originatorEquipmentNumber = originatorEquipNo;
|
||||
requestTab.participantId = participantId;
|
||||
int32_t partyId = 0;
|
||||
if ( aesItem.partyId.is_set())
|
||||
if ( aesItem.partyId.has_value())
|
||||
partyId = aesItem.partyId.get();
|
||||
requestTab.partyId(partyId);
|
||||
requestTab.position(pos);
|
||||
requestTab.partyId = partyId;
|
||||
requestTab.position = pos;
|
||||
|
||||
// Same like direct Hit
|
||||
// if (aesItem.id() > 0)
|
||||
@@ -294,7 +294,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
// else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "direkter Beschuss remainEffectPercent=" << remainingEffectPercent;
|
||||
requestTab.remainEffectPercent(remainingEffectPercent);
|
||||
requestTab.remainEffectPercent = remainingEffectPercent;
|
||||
}
|
||||
|
||||
m_requestMap.insert(participantId, requestTab);
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ void DdsHandlerTargetAreas::onParticipantChanged(const ParticipantManagement::Pa
|
||||
if (modType == DataModification::eRemoved)
|
||||
m_partId2EquipNoMap.remove(data.id());
|
||||
else
|
||||
m_partId2EquipNoMap[data.id()] = data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0;
|
||||
m_partId2EquipNoMap[data.id()] = data.equipmentNumber.has_value() ? data.equipmentNumber.get() : 0;
|
||||
|
||||
if (m_logger.isTraceEnabled())
|
||||
{
|
||||
|
||||
+8
-8
@@ -469,21 +469,21 @@ void HandlerTargetAreas::on_preWarningIntervalFinished(int participantId, int ta
|
||||
uint8_t countBlink = 1;
|
||||
int32_t effectPercent = 0;
|
||||
|
||||
switch (shootbackTarget.targetInformation.prewarningEffect().underlying())
|
||||
switch (shootbackTarget.targetInformation.prewarningEffect())
|
||||
{
|
||||
case ProjectDataManagement::VulnerabilityState::NoChange:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange:
|
||||
countBlink = 1;
|
||||
effectPercent = 0;
|
||||
break;
|
||||
case ProjectDataManagement::VulnerabilityState::MobilityKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill:
|
||||
effectPercent = 30;
|
||||
countBlink = 2;
|
||||
break;
|
||||
case ProjectDataManagement::VulnerabilityState::NearMiss:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NearMiss:
|
||||
countBlink = 3;
|
||||
effectPercent = 60;
|
||||
break;
|
||||
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
|
||||
countBlink = 4;
|
||||
effectPercent = 100;
|
||||
break;
|
||||
@@ -518,13 +518,13 @@ void HandlerTargetAreas::on_TimeToEffectFinished(int participantId, int targetPa
|
||||
<< " takedownEffect=" << shootbackTarget.targetInformation.takedownEffect();
|
||||
|
||||
|
||||
switch (shootbackTarget.targetInformation.takedownEffect().underlying())
|
||||
switch (shootbackTarget.targetInformation.takedownEffect())
|
||||
{
|
||||
case ProjectDataManagement::VulnerabilityState::MobilityKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill:
|
||||
effectPercent = 50;
|
||||
countBlink = 5;
|
||||
break;
|
||||
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
|
||||
countBlink = 6;
|
||||
effectPercent = 100;
|
||||
break;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
struct ParticipantPosition : public ParticipantManagement::ParticipantPosition
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::CombatReady;
|
||||
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
|
||||
Core::GeoPosition lastGeoPosition;
|
||||
bool positionValid = false;
|
||||
|
||||
|
||||
+102
-102
@@ -84,30 +84,30 @@ bool HandlerParticipantBoobyTrap::init()
|
||||
|
||||
void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType)
|
||||
{
|
||||
if (data.isDeleted()
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired && !data.triggered())
|
||||
|| !data.isCentral()
|
||||
if (data.isDeleted
|
||||
|| data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| (data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired && !data.triggered)
|
||||
|| !data.isCentral
|
||||
|| modType == DataModification::eRemoved)
|
||||
{
|
||||
m_boobyTraps.remove(data.id());
|
||||
m_boobyTrapItems.remove(data.id());
|
||||
m_boobyTrapItemsSecondary.remove(data.id());
|
||||
m_boobyTraps.remove(data.id);
|
||||
m_boobyTrapItems.remove(data.id);
|
||||
m_boobyTrapItemsSecondary.remove(data.id);
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onBoobyTrapChanged"
|
||||
<< " data.sampleTime=" << data.sampleTime()
|
||||
<< " data.sampleTime=" << data.sampleTime
|
||||
<< " m_ddsHandler->currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " diff=" << m_ddsHandler->currentPartitionTime() - data.sampleTime();
|
||||
if ((m_ddsHandler->currentPartitionTime() - data.sampleTime()) > 2000)
|
||||
<< " diff=" << m_ddsHandler->currentPartitionTime() - data.sampleTime;
|
||||
if ((m_ddsHandler->currentPartitionTime() - data.sampleTime) > 2000)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onBoobyTrap outdated";
|
||||
return;
|
||||
}
|
||||
m_boobyTraps.insert(data.id(), data);
|
||||
m_boobyTraps.insert(data.id, data);
|
||||
|
||||
|
||||
if (!data.triggered())
|
||||
if (!data.triggered)
|
||||
return;
|
||||
|
||||
|
||||
@@ -129,73 +129,73 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
{
|
||||
TRACE_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
TRACE_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId << " continue";
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Check each actuell participant participantId=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Check each actuell participant participantId=" << participantPos.participantId;
|
||||
if (participantPos.insideBuilding())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId << " continue";
|
||||
continue;
|
||||
}
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId << " continue";
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "pos participantId=" << participantPos.participantId()
|
||||
<< " buildingId=" << participantPos.buildingId()
|
||||
DEBUG_LOG(m_logger) << "pos participantId=" << participantPos.participantId
|
||||
<< " buildingId=" << participantPos.buildingId
|
||||
<< " insideBuilding=" << participantPos.insideBuilding()
|
||||
<< " positionValid=" << participantPos.positionValid;
|
||||
const CentralEffectSimulation::AesItemViewUtm aesItemView = m_boobyTrapItemsSecondary.value(data.id());
|
||||
const CentralEffectSimulation::AesItemViewUtm aesItemView = m_boobyTrapItemsSecondary.value(data.id);
|
||||
calculateBoobyTrapParticipant(aesItemView, participantPos);
|
||||
}
|
||||
m_boobyTraps.remove(data.id());
|
||||
m_boobyTrapItems.remove(data.id());
|
||||
m_boobyTrapItemsSecondary.remove(data.id());
|
||||
m_boobyTraps.remove(data.id);
|
||||
m_boobyTrapItems.remove(data.id);
|
||||
m_boobyTrapItemsSecondary.remove(data.id);
|
||||
}
|
||||
|
||||
void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "---------------------------------------------------------------------------";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onAesItemViewChanged"
|
||||
<< " aesTypeId=" << data.aesTypeId()
|
||||
<< " data.effectStateId()=" << data.effectStateId();
|
||||
<< " aesTypeId=" << data.aesTypeId
|
||||
<< " data.effectStateId()=" << data.effectStateId;
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| modType == DataModification::eRemoved)
|
||||
{
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
{
|
||||
m_boobyTraps.remove(data.id());
|
||||
m_boobyTrapItems.remove(data.id());
|
||||
m_boobyTrapItemsSecondary.remove(data.id());
|
||||
m_triggeredMineParticipant.remove(data.id());
|
||||
m_boobyTraps.remove(data.id);
|
||||
m_boobyTrapItems.remove(data.id);
|
||||
m_boobyTrapItemsSecondary.remove(data.id);
|
||||
m_triggeredMineParticipant.remove(data.id);
|
||||
|
||||
DEBUG_LOG(m_logger) << "onBoobyTrapChanged remove aesId=" << data.id()
|
||||
<< " m_triggeredMineParticipant.remove(" << data.id() ;
|
||||
DEBUG_LOG(m_logger) << "onBoobyTrapChanged remove aesId=" << data.id
|
||||
<< " m_triggeredMineParticipant.remove(" << data.id ;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtBoobyTrap
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtBoobyTrap
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
return;
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
const int aesItemId = data.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", type: " << data.aesTypeId
|
||||
<< ", effectState: " << data.effectStateId
|
||||
<< ", modType: " << modType;
|
||||
|
||||
if (modType == DataModification::eAdded
|
||||
|| modType == DataModification::eModified)
|
||||
{
|
||||
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
switch (effectState.underlying())
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
@@ -204,12 +204,12 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
prevData.aesItemId = 0;
|
||||
|
||||
const CentralEffectSimulation::AesItemViewUtm boobyTrapUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius);
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrap)
|
||||
m_boobyTrapItems.insert(data.aesItemId(), boobyTrapUtm);
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
m_boobyTrapItemsSecondary.insert(data.aesItemId(), boobyTrapUtm);
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBoobyTrap)
|
||||
m_boobyTrapItems.insert(data.aesItemId, boobyTrapUtm);
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
|
||||
m_boobyTrapItemsSecondary.insert(data.aesItemId, boobyTrapUtm);
|
||||
DEBUG_LOG(m_logger) << "Check each participant"
|
||||
<< " aesTypeId=" << data.aesTypeId();
|
||||
<< " aesTypeId=" << data.aesTypeId;
|
||||
// Check each participant
|
||||
// const auto partPosMap = m_handlerParticipant->positions();
|
||||
// for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
@@ -268,7 +268,7 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantsSecondary(int ae
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
{
|
||||
if (participantPos.participantId() == participantId)
|
||||
if (participantPos.participantId == participantId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "is already handled participantId=" << participantId;
|
||||
continue;
|
||||
@@ -280,12 +280,12 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantsSecondary(int ae
|
||||
}
|
||||
if (participantPos.insideBuilding())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId << " continue";
|
||||
continue;
|
||||
}
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId << " continue";
|
||||
continue;
|
||||
}
|
||||
const CentralEffectSimulation::AesItemViewUtm aesItemView = m_boobyTrapItemsSecondary.value(aesItemId);
|
||||
@@ -331,12 +331,12 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantSecondary(const C
|
||||
{
|
||||
bool result;
|
||||
const AreaEffectSimulation::BoobyTrap boobyTrap = m_ddsHandler->dtcAes()->boobyTrap(aesItemView.aesItemId);
|
||||
const QPointF partPosGeo = QPointF(participantPos.pos().lon(), participantPos.pos().lat());
|
||||
const QPointF impactPosGeo = QPointF(boobyTrap.impactPosition().lon(), boobyTrap.impactPosition().lat());
|
||||
const QPointF partPosGeo = QPointF(participantPos.pos.lon, participantPos.pos.lat);
|
||||
const QPointF impactPosGeo = QPointF(boobyTrap.impactPosition.lon, boobyTrap.impactPosition.lat);
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "calculateBoobyTrapParticipantSecondary itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
<< " participantId=" << participantPos.participantId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "BoobyTrap id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
@@ -352,21 +352,21 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantSecondary(const C
|
||||
//dtcIsm.get()->getBuildingByPolygon(exerciseId, polygonGeo, completeEnclosed, isGroundLevel);
|
||||
if ( buildingIds.size() > 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Gebaeude verdeckt den Minentreffer participantId=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Gebaeude verdeckt den Minentreffer participantId=" << participantPos.participantId;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!aesItemView.boundingBox.containsPoint(partPosGeo, Qt::OddEvenFill))
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox " << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox " << participantPos.participantId;
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "in boundingBox" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "in boundingBox" << participantPos.participantId;
|
||||
// const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), aesItemView.zone);
|
||||
|
||||
|
||||
result = insideSecondaryArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG(m_logger) << "insideSecondaryArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " participantId=" << participantPos.participantId
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
@@ -414,14 +414,14 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "calculateBoobyTrapParticipant itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
<< " participantId=" << participantPos.participantId;
|
||||
|
||||
// Check coverage by a building
|
||||
const AreaEffectSimulation::BoobyTrap boobyTrap = m_ddsHandler->dtcAes()->boobyTrap(aesItemView.aesItemId);
|
||||
//const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(participantPos.pos(), aesItemView.zone);
|
||||
//const QPointF impactPosGeo = CentralEffectSimulation::geographic2Utm(boobyTrap.impactPosition(), aesItemView.zone);
|
||||
const QPointF partPosGeo = QPointF(participantPos.pos().lon(), participantPos.pos().lat());
|
||||
const QPointF impactPosGeo = QPointF(boobyTrap.impactPosition().lon(), boobyTrap.impactPosition().lat());
|
||||
const QPointF partPosGeo = QPointF(participantPos.pos.lon, participantPos.pos.lat);
|
||||
const QPointF impactPosGeo = QPointF(boobyTrap.impactPosition.lon, boobyTrap.impactPosition.lat);
|
||||
bool completeEnclosed = false;
|
||||
bool isGroundLevel = true;
|
||||
int exerciseId = m_ddsHandler->getExerciseId();
|
||||
@@ -437,25 +437,25 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
return false;
|
||||
}
|
||||
|
||||
const QPointF partPosUtm = CentralEffectSimulation::geographic2Utm(participantPos.pos(), -1);
|
||||
const QPointF partPosUtm = CentralEffectSimulation::geographic2Utm(participantPos.pos, -1);
|
||||
DEBUG_LOG(m_logger) << "BoobyTrap id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(aesItemView.boundingBoxTopRight)
|
||||
<< " participantPos=" << partPosUtm.x() << "/" << partPosUtm.y();
|
||||
if (!aesItemView.boundingBox.containsPoint(partPosUtm, Qt::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox " << participantPos.participantId();
|
||||
bool intersectsBoundingBox = intersectsBoundingBoxCheck(aesItemView, participantPos.participantId());
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox " << participantPos.participantId;
|
||||
bool intersectsBoundingBox = intersectsBoundingBoxCheck(aesItemView, participantPos.participantId);
|
||||
if (!intersectsBoundingBox)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Continue nach Bounding BoxCheck itemView: " << aesItemView.aesItemId << ", "
|
||||
<< " paricipantId=" << participantPos.participantId();
|
||||
<< " paricipantId=" << participantPos.participantId;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "in boundingBox participantId=" << participantPos.participantId();
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), aesItemView.zone);
|
||||
DEBUG_LOG(m_logger) << "in boundingBox participantId=" << participantPos.participantId;
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId, aesItemView.zone);
|
||||
|
||||
|
||||
if (posStepPoly.size() < 2)
|
||||
@@ -463,7 +463,7 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
|
||||
const bool result = enteredOrCrossedArea(aesItemView.form, posStepPoly);
|
||||
DEBUG_LOG(m_logger) << "enteredOrCrossedArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " participantId=" << participantPos.participantId
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
@@ -485,10 +485,10 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
{
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG(m_logger) << "ParicipantPos "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " participantPos: lat=" << partPos.pos().lat()
|
||||
<< " lon=" << partPos.pos().lon()
|
||||
<< " participantId=" << partPos.participantId
|
||||
<< " participantTypeId=" << partPos.participantTypeId
|
||||
<< " participantPos: lat=" << partPos.pos.lat
|
||||
<< " lon=" << partPos.pos.lon
|
||||
<< " Anzahl BoobyTraps=" << m_boobyTrapItems.size();
|
||||
|
||||
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
@@ -497,7 +497,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(partPos.participantId()) == 0)
|
||||
if (m_handlerParticipant->getEquipmentNumber(partPos.participantId) == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has no equipment number";
|
||||
return;
|
||||
@@ -512,7 +512,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(boobyTrap.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(boobyTrap.boundingBoxTopRight);
|
||||
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId(), boobyTrap.zone);
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId, boobyTrap.zone);
|
||||
|
||||
if (posStepPoly.size() < 2)
|
||||
return;
|
||||
@@ -537,18 +537,18 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent aesItemId=" << boobyTrapItem.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
<< " participantId=" << participantPosition.participantId;
|
||||
|
||||
if ((m_triggeredMineParticipant.contains(boobyTrapItem.aesItemId))
|
||||
&& (m_triggeredMineParticipant.value(boobyTrapItem.aesItemId) == participantPosition.participantId()))
|
||||
&& (m_triggeredMineParticipant.value(boobyTrapItem.aesItemId) == participantPosition.participantId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_triggeredMineParticipant already sent "
|
||||
<< " aesItemId=" << boobyTrapItem.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
<< " participantId=" << participantPosition.participantId;
|
||||
return;
|
||||
}
|
||||
m_triggeredMineParticipant.insert(boobyTrapItem.aesItemId, participantPosition.participantId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
|
||||
m_triggeredMineParticipant.insert(boobyTrapItem.aesItemId, participantPosition.participantId);
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId);
|
||||
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -556,7 +556,7 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
return;
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
return;
|
||||
|
||||
@@ -566,35 +566,35 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
|
||||
INFO_LOG(m_logger) << "BoobyTrap Position found";
|
||||
AreaEffectSimulation::BoobyTrap boobyTrap = m_boobyTraps.value(boobyTrapItem.aesItemId);
|
||||
|
||||
pe.position().lat(boobyTrap.impactPosition().lat());
|
||||
pe.position().lon(boobyTrap.impactPosition().lon());
|
||||
pe.position.lat = boobyTrap.impactPosition.lat;
|
||||
pe.position.lon = boobyTrap.impactPosition.lon;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "No BoobyTrap Position found";
|
||||
pe.position(participantPosition.pos());
|
||||
pe.position = participantPosition.pos;
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::BoobyTrap &bt = m_ddsHandler->dtcAes()->boobyTrap(boobyTrapItem.aesItemId);
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId
|
||||
<< " lat= " << participantPosition.pos.lat
|
||||
<< " lon= " << participantPosition.pos.lon
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
<< " eventType=" << eventType;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.eventTypeId(eventType);
|
||||
pe.participantId(participantPosition.participantId());
|
||||
pe.eventTime(participantPosition.sampleTime());
|
||||
pe.aesItemId(boobyTrapItem.aesItemId);
|
||||
pe.partyId(participantPosition.partyId());
|
||||
pe.aesName(bt.name());
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.friendlyFire(boobyTrapItem.partyId == participantPosition.partyId());
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantPosition.participantId;
|
||||
pe.eventTime = participantPosition.sampleTime;
|
||||
pe.aesItemId = boobyTrapItem.aesItemId;
|
||||
pe.partyId = participantPosition.partyId;
|
||||
pe.aesName = bt.name;
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.friendlyFire = boobyTrapItem.partyId == participantPosition.partyId;
|
||||
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
qint64 id = pe.id();
|
||||
qint64 id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
@@ -604,8 +604,8 @@ void HandlerParticipantBoobyTrap::sendParticipantHit(const CentralEffectSimulati
|
||||
{
|
||||
// Q_UNUSED(eventType); // not used - no alarm for this
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
const int participantId = participantPosition.participantId();
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
const int participantId = participantPosition.participantId;
|
||||
const int originatorEquipNo = 0;
|
||||
|
||||
if ( equipNo == 0)
|
||||
@@ -614,24 +614,24 @@ void HandlerParticipantBoobyTrap::sendParticipantHit(const CentralEffectSimulati
|
||||
Core::GeoPosition position;
|
||||
// TODO: Hier wird die Mitte der Bounding-Box genommen und nicht die Position vom Participant
|
||||
|
||||
position.lat(participantPosition.pos().lat());
|
||||
position.lon(participantPosition.pos().lon());
|
||||
position.lat = participantPosition.pos.lat;
|
||||
position.lon = participantPosition.pos.lon;
|
||||
|
||||
const TrainingAreaBase::TabPosition pos(position, participantPosition.reportingSource(), 0, 0);
|
||||
const TrainingAreaBase::TabPosition pos(position, participantPosition.reportingSource, 0, 0);
|
||||
int remainTasCodeIndirect = m_ddsHandler->remainingTasCode(boobyTrap.chargeStruct);
|
||||
//pos.position(position);
|
||||
//pos.reportingSource(participantPosition.reportingSource());
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit participantId=" << participantId
|
||||
<< " equipmentNumber=" << equipNo
|
||||
<< " chargeTypeId=" << boobyTrap.chargeStruct.chargeTypeId()
|
||||
<< " chargeTypeId=" << boobyTrap.chargeStruct.chargeTypeId
|
||||
<< " eventType=" << eventType
|
||||
<< " remainTasCodeIndirect=" << remainTasCodeIndirect;
|
||||
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipNo, // equipmentNumber
|
||||
participantId, // participantId
|
||||
boobyTrap.chargeStruct.chargeTypeId(), // chargeTypeId
|
||||
boobyTrap.chargeStruct.chargeTypeId, // chargeTypeId
|
||||
boobyTrap.aesItemId, // aesId
|
||||
originatorEquipNo, // originatorEquipmentNumber
|
||||
remainTasCodeIndirect, // IED heavy
|
||||
@@ -667,8 +667,8 @@ void HandlerParticipantBoobyTrap::sendFtcBoobyTrapTrigger(int aesItemId)
|
||||
{
|
||||
auto ftcAes = m_ddsHandler->ftcAes();
|
||||
AreaEffectSimulation::BoobyTrapTriggerRequest hr;
|
||||
hr.id(aesItemId);
|
||||
hr.triggered(true);
|
||||
hr.id = aesItemId;
|
||||
hr.triggered = true;
|
||||
DEBUG_LOG(m_logger) << "sendFtcAesRemoveBoobyTrap: id=" << hr;
|
||||
ftcAes->boobyTrapTriggerRequest(hr, this);
|
||||
}
|
||||
|
||||
+60
-60
@@ -84,47 +84,47 @@ bool HandlerParticipantOffRouteMine::init()
|
||||
|
||||
void HandlerParticipantOffRouteMine::onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine &data, DataModification modType)
|
||||
{
|
||||
if (data.isDeleted()
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
if (data.isDeleted
|
||||
|| data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| modType == DataModification::eRemoved)
|
||||
{
|
||||
m_offRouteMines.remove(data.id());
|
||||
m_offRouteMineItems.remove(data.id());
|
||||
m_offRouteMineItemsSecondary.remove(data.id());
|
||||
m_offRouteMines.remove(data.id);
|
||||
m_offRouteMineItems.remove(data.id);
|
||||
m_offRouteMineItemsSecondary.remove(data.id);
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::onOffRouteMineChanged";
|
||||
m_offRouteMines.insert(data.id(), data);
|
||||
m_offRouteMines.insert(data.id, data);
|
||||
}
|
||||
|
||||
void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::onAesItemViewChanged";
|
||||
if ( data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
if ( data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| modType == DataModification::eRemoved)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtOffRouteMine
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
if (data.aesTypeId != AreaEffectSimulation::AesType::AtOffRouteMine
|
||||
&& data.aesTypeId != AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
return;
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
const int aesItemId = data.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", type: " << data.aesTypeId
|
||||
<< ", effectState: " << data.effectStateId
|
||||
<< ", modType: " << modType;
|
||||
|
||||
if (modType == DataModification::eAdded
|
||||
|| modType == DataModification::eModified)
|
||||
{
|
||||
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
switch (effectState.underlying())
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
@@ -133,10 +133,10 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
|
||||
prevData.aesItemId = 0;
|
||||
|
||||
const CentralEffectSimulation::AesItemViewUtm aesItemViewUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius);
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMine)
|
||||
m_offRouteMineItems.insert(data.aesItemId(), aesItemViewUtm);
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
m_offRouteMineItemsSecondary.insert(data.aesItemId(), aesItemViewUtm);
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtOffRouteMine)
|
||||
m_offRouteMineItems.insert(data.aesItemId, aesItemViewUtm);
|
||||
if (data.aesTypeId == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|
||||
m_offRouteMineItemsSecondary.insert(data.aesItemId, aesItemViewUtm);
|
||||
// DEBUG_LOG(m_logger) << "Check each participant";
|
||||
// // Check each participant
|
||||
// const auto partPosMap = m_handlerParticipant->positions();
|
||||
@@ -237,10 +237,10 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantSecondary(c
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos)
|
||||
{
|
||||
bool result;
|
||||
const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(participantPos.pos(), aesItemView.zone);
|
||||
const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(participantPos.pos, aesItemView.zone);
|
||||
|
||||
DEBUG_LOG(m_logger) << "calculateOffRouteMineParticipantSecondary itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
<< " participantId=" << participantPos.participantId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "OffRouteMine id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
@@ -264,7 +264,7 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantSecondary(c
|
||||
|
||||
result = insideSecondaryArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG(m_logger) << "insideSecondaryArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " participantId=" << participantPos.participantId
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
@@ -284,20 +284,20 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipant(const Cent
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "calculateOffRouteMineParticipant itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
<< " participantId=" << participantPos.participantId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "OffRouteMine id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(aesItemView.boundingBoxTopRight);
|
||||
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), m_zone);
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId, m_zone);
|
||||
|
||||
if (posStepPoly.size() < 2)
|
||||
return;
|
||||
|
||||
const bool result = enteredOrCrossedArea(aesItemView.form, posStepPoly);
|
||||
DEBUG_LOG(m_logger) << "enteredOrCrossedArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " participantId=" << participantPos.participantId
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
@@ -316,15 +316,15 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipant(const Cent
|
||||
|
||||
void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos)
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(partPos.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(partPos.participantTypeId);
|
||||
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG(m_logger) << "ParicipantPos "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " participantId=" << partPos.participantId
|
||||
<< " participantTypeId=" << partPos.participantTypeId
|
||||
<< " typeClass=" << typeClass
|
||||
<< " participantPos: lat=" << partPos.pos().lat()
|
||||
<< " lon=" << partPos.pos().lon()
|
||||
<< " participantPos: lat=" << partPos.pos.lat
|
||||
<< " lon=" << partPos.pos.lon
|
||||
<< " Anzahl OffRouteMines=" << m_offRouteMineItems.size();
|
||||
|
||||
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
@@ -341,7 +341,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(partPos.participantId()) == 0)
|
||||
if (m_handlerParticipant->getEquipmentNumber(partPos.participantId) == 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has no equipment number";
|
||||
return;
|
||||
@@ -366,7 +366,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
});
|
||||
// if (!boundingBoxOffRouteMine.containsPoint(partPosGeo, Qt::OddEvenFill))
|
||||
// continue;
|
||||
const QVector<QPointF> utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId(), m_zone);
|
||||
const QVector<QPointF> utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId, m_zone);
|
||||
|
||||
|
||||
QPolygonF posStepPoly;
|
||||
@@ -394,7 +394,7 @@ void HandlerParticipantOffRouteMine::sendParticipantEvent(const CentralEffectSim
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition,
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId);
|
||||
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -402,7 +402,7 @@ void HandlerParticipantOffRouteMine::sendParticipantEvent(const CentralEffectSim
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
return;
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
return;
|
||||
|
||||
@@ -412,35 +412,35 @@ void HandlerParticipantOffRouteMine::sendParticipantEvent(const CentralEffectSim
|
||||
INFO_LOG(m_logger) << "OffRouteMine Position found";
|
||||
AreaEffectSimulation::OffRouteMine offRouteMine = m_offRouteMines.value(offRouteItem.aesItemId);
|
||||
|
||||
pe.position().lat(offRouteMine.area().cornerBottomLeft().lat());
|
||||
pe.position().lon(offRouteMine.area().cornerBottomLeft().lon());
|
||||
pe.position.lat = offRouteMine.area.cornerBottomLeft.lat;
|
||||
pe.position.lon = offRouteMine.area.cornerBottomLeft.lon;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "No OffRouteMine Position found";
|
||||
pe.position(participantPosition.pos());
|
||||
pe.position = participantPosition.pos;
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::OffRouteMine &of = m_ddsHandler->dtcAes()->offRouteMine(offRouteItem.aesItemId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId
|
||||
<< " lat= " << participantPosition.pos.lat
|
||||
<< " lon= " << participantPosition.pos.lon
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
<< " eventType=" << eventType
|
||||
<< " Name=" << of.name();
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.eventTypeId(eventType);
|
||||
pe.participantId(participantPosition.participantId());
|
||||
pe.eventTime(participantPosition.sampleTime());
|
||||
pe.aesItemId(offRouteItem.aesItemId);
|
||||
pe.partyId(participantPosition.partyId());
|
||||
pe.aesName(of.name());
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.friendlyFire(offRouteItem.partyId == participantPosition.partyId());
|
||||
<< " Name=" << of.name;
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantPosition.participantId;
|
||||
pe.eventTime = participantPosition.sampleTime;
|
||||
pe.aesItemId = offRouteItem.aesItemId;
|
||||
pe.partyId = participantPosition.partyId;
|
||||
pe.aesName = of.name;
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.friendlyFire = offRouteItem.partyId == participantPosition.partyId;
|
||||
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
qint64 id = pe.id();
|
||||
qint64 id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
@@ -449,8 +449,8 @@ void HandlerParticipantOffRouteMine::sendParticipantHit(const CentralEffectSimul
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
const int participantId = participantPosition.participantId();
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
const int participantId = participantPosition.participantId;
|
||||
const int originatorEquipNo = 0;
|
||||
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit participantId=" << participantId
|
||||
@@ -459,10 +459,10 @@ void HandlerParticipantOffRouteMine::sendParticipantHit(const CentralEffectSimul
|
||||
Core::GeoPosition position;
|
||||
// TODO: Hier wird die Mitte der Bounding-Box genommen und nicht die Position vom Participant
|
||||
|
||||
position.lat(participantPosition.pos().lat());
|
||||
position.lon(participantPosition.pos().lon());
|
||||
position.lat = participantPosition.pos.lat;
|
||||
position.lon = participantPosition.pos.lon;
|
||||
|
||||
const TrainingAreaBase::TabPosition pos(position, participantPosition.reportingSource(), 0, 0);
|
||||
const TrainingAreaBase::TabPosition pos(position, participantPosition.reportingSource, 0, 0);
|
||||
//pos.position(position);
|
||||
//pos.reportingSource(participantPosition.reportingSource());
|
||||
|
||||
@@ -474,7 +474,7 @@ void HandlerParticipantOffRouteMine::sendParticipantHit(const CentralEffectSimul
|
||||
TrainingAreaBase::SendCesHitRequest requestTab(
|
||||
equipNo, // equipmentNumber
|
||||
participantId, // participantId
|
||||
offRouteMine.chargeStruct.chargeTypeId(), // chargeTypeId
|
||||
offRouteMine.chargeStruct.chargeTypeId, // chargeTypeId
|
||||
offRouteMine.aesItemId, // aesId
|
||||
originatorEquipNo, // originatorEquipmentNumber
|
||||
remainTasCodeIndirect, // IED heavy
|
||||
@@ -510,8 +510,8 @@ void HandlerParticipantOffRouteMine::sendFtcOffRouteMineTrigger(int aesItemId)
|
||||
{
|
||||
auto ftcAes = m_ddsHandler->ftcAes();
|
||||
AreaEffectSimulation::OffRouteMineTriggerRequest hr;
|
||||
hr.id(aesItemId);
|
||||
hr.triggered(true);
|
||||
hr.id = aesItemId;
|
||||
hr.triggered = true;
|
||||
DEBUG_LOG(m_logger) << "send OffRouteMineTriggerRequest: id=" << hr;
|
||||
ftcAes->offRouteMineTriggerRequest(hr, this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ AesItemViewUtm AesItemViewUtm::create(const AreaEffectSimulation::AesItemView &a
|
||||
//ret.zone;
|
||||
ret.aesItemId = aiv.aesItemId;
|
||||
ret.chargeStruct = aiv.chargeStruct;
|
||||
ret.partyId = aiv.partyId.is_set() ? aiv.partyId.get() : -1;
|
||||
ret.partyId = aiv.partyId.has_value() ? aiv.partyId.get() : -1;
|
||||
ret.dusMineId = -1;
|
||||
ret.isSupplyTruck = isSupplyTruck;
|
||||
ret.aesTypeId = aiv.aesTypeId;
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
|
||||
return;
|
||||
|
||||
// [GUEZE-3102] Aufgesessene Teilnehmer bekommen den Schaden vom Fahrzeug, auf dem sie aufgesessen sind.
|
||||
if (data.mountedOn.is_set())
|
||||
if (data.mountedOn.has_value())
|
||||
return;
|
||||
int floorId = m_handlerBuildingData->getFloorIdFromRoomId(data.roomId);
|
||||
int lastFloorId;
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ bool HandlerFiringExplosion::init()
|
||||
//=============================================================================
|
||||
void HandlerFiringExplosion::setFiringClearanceDuration()
|
||||
{
|
||||
if (m_firingExplosionEntity.firingClearanceTime.is_set())
|
||||
if (m_firingExplosionEntity.firingClearanceTime.has_value())
|
||||
{
|
||||
qint64 pre = m_firingExplosionEntity.firingClearanceTime.get();
|
||||
qint64 post = pre;
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ bool HandlerFiringSmoke::init()
|
||||
//=============================================================================
|
||||
void HandlerFiringSmoke::setFiringClearanceDuration()
|
||||
{
|
||||
if (m_firingSmokeEntity.firingClearanceTime.is_set())
|
||||
if (m_firingSmokeEntity.firingClearanceTime.has_value())
|
||||
{
|
||||
qint64 pre = m_firingSmokeEntity.firingClearanceTime.get();
|
||||
qint64 post = pre;
|
||||
|
||||
+3
-3
@@ -67,7 +67,7 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_effectCluster.effectStart.is_set() ? m_effectCluster.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_effectCluster.effectStart.has_value() ? m_effectCluster.effectStart.get() : 0;
|
||||
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_effectCluster.id;
|
||||
@@ -142,7 +142,7 @@ Database::EsmEffectShow EffectShowEffectCluster::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_effectCluster.effectStart.is_set() ? m_effectCluster.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_effectCluster.effectStart.has_value() ? m_effectCluster.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_effectCluster.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_effectCluster.id;
|
||||
@@ -170,7 +170,7 @@ void EffectShowEffectCluster::updateEffectShow(Database::EsmEffectShow &data)
|
||||
|
||||
DEBUG_LOG(m_logger) << "update EffectSHow for (" << data.id << ")";
|
||||
data.nameAreaEfffectSimulation = QString::fromStdString(m_effectCluster.name);
|
||||
data.startTime = m_effectCluster.effectStart.is_set() ? m_effectCluster.effectStart.get() : 0;
|
||||
data.startTime = m_effectCluster.effectStart.has_value() ? m_effectCluster.effectStart.get() : 0;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Recalc effectDuration ";
|
||||
|
||||
+3
-3
@@ -62,7 +62,7 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_explosionArea.effectStart.is_set() ? m_explosionArea.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_explosionArea.effectStart.has_value() ? m_explosionArea.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_explosionArea.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionArea.id;
|
||||
@@ -106,7 +106,7 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_explosionArea.effectStart.is_set() ? m_explosionArea.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_explosionArea.effectStart.has_value() ? m_explosionArea.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_explosionArea.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionArea.id;
|
||||
@@ -132,7 +132,7 @@ Database::EsmEffectShow EffectShowExplosionArea::getEffectShow(int idx)
|
||||
void EffectShowExplosionArea::updateEffectShow(Database::EsmEffectShow &data)
|
||||
{
|
||||
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionArea.name);
|
||||
data.startTime = m_explosionArea.effectStart.is_set() ? m_explosionArea.effectStart.get() : 0;
|
||||
data.startTime = m_explosionArea.effectStart.has_value() ? m_explosionArea.effectStart.get() : 0;
|
||||
data.duration = m_explosionArea.effectDuration;
|
||||
|
||||
if (data.shotsPerVolley > 48)
|
||||
|
||||
+3
-3
@@ -62,7 +62,7 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart.has_value() ? m_explosionCluster.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_explosionCluster.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id;
|
||||
@@ -106,7 +106,7 @@ Database::EsmEffectShow EffectShowExplosionCluster::getEffectShow(int idx)
|
||||
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QStringLiteral("EXP");
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_explosionCluster.effectStart.has_value() ? m_explosionCluster.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_explosionCluster.effectDuration;
|
||||
esmEffectShow.centerPosition = centerPosRotated.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_explosionCluster.id;
|
||||
@@ -134,7 +134,7 @@ void EffectShowExplosionCluster::updateEffectShow(Database::EsmEffectShow &data)
|
||||
|
||||
DEBUG_LOG(m_logger) << "update EffectSHow for (" << data.id << ")";
|
||||
data.nameAreaEfffectSimulation = QString::fromStdString(m_explosionCluster.name);
|
||||
data.startTime = m_explosionCluster.effectStart.is_set() ? m_explosionCluster.effectStart.get() : 0;
|
||||
data.startTime = m_explosionCluster.effectStart.has_value() ? m_explosionCluster.effectStart.get() : 0;
|
||||
data.duration = m_explosionCluster.effectDuration;
|
||||
|
||||
if (data.shotsPerVolley > 48)
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ Database::EsmEffectShow EffectShowMineArea::getEffectShow()
|
||||
Database::EsmEffectShow esmEffectShow;
|
||||
esmEffectShow.id = 0;
|
||||
esmEffectShow.name = QLatin1String("MIN");
|
||||
esmEffectShow.startTime = m_mineArea.effectStart.is_set() ? m_mineArea.effectStart.get() : 0;
|
||||
esmEffectShow.startTime = m_mineArea.effectStart.has_value() ? m_mineArea.effectStart.get() : 0;
|
||||
esmEffectShow.duration = m_mineArea.effectDuration;
|
||||
esmEffectShow.centerPosition = m_centerPos.geographic();
|
||||
esmEffectShow.idAreaEffectSimulation = m_mineArea.id;
|
||||
@@ -59,7 +59,7 @@ void EffectShowMineArea::updateEffectShow(Database::EsmEffectShow &data)
|
||||
data.duration = m_mineArea.effectDuration / 10;
|
||||
if (data.duration > (3600 * 1000))
|
||||
data.duration = 3600 * 1000;
|
||||
if (m_mineArea.effectStart.is_set())
|
||||
if (m_mineArea.effectStart.has_value())
|
||||
data.startTime = m_mineArea.effectStart.get() + m_mineArea.effectDuration - data.duration;
|
||||
else
|
||||
data.startTime = 0;
|
||||
|
||||
+2
-2
@@ -80,7 +80,7 @@ void HandlerPpmData::onParticipantChanged(const ParticipantManagement::Participa
|
||||
auto m_ppmDtc = m_mainHandler->dds()->dtcPpm();
|
||||
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(data.typeId).typeClass;
|
||||
DEBUG_LOG(m_logger) << "support entity / equipment number set " << (typeClass == ParticipantManagement::TypeClass::SupportEntity)
|
||||
<< " / " << data.equipmentNumber.is_set() << ", typeId: " << data.typeId
|
||||
<< " / " << data.equipmentNumber.has_value() << ", typeId: " << data.typeId
|
||||
<< ", cnt: " << m_ppmDtc->types().size();
|
||||
|
||||
if (typeClass != ParticipantManagement::TypeClass::SupportEntity)
|
||||
@@ -91,7 +91,7 @@ void HandlerPpmData::onParticipantChanged(const ParticipantManagement::Participa
|
||||
else
|
||||
{
|
||||
// does not exists or has no longer an equipment number -> remove
|
||||
if (!data.equipmentNumber.is_set())
|
||||
if (!data.equipmentNumber.has_value())
|
||||
modType = DataModification::eRemoved;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
Participant_t() = default;
|
||||
explicit Participant_t(const ParticipantManagement::Participant &data)
|
||||
: id(data.id)
|
||||
, equipmentNumber(data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0)
|
||||
, equipmentNumber(data.equipmentNumber.has_value() ? data.equipmentNumber.get() : 0)
|
||||
, name(QString::fromStdString(data.name))
|
||||
{}
|
||||
|
||||
|
||||
+4
-4
@@ -107,7 +107,7 @@ Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::Exp
|
||||
res.rotationAngle = data.area.rotation;
|
||||
res.depth = data.area.height;
|
||||
res.width = data.area.width;
|
||||
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
|
||||
res.effectStart = data.effectStart.has_value() ? data.effectStart.get() : 0;
|
||||
res.effectDuration = data.effectDuration;
|
||||
res.chargeTypeId = data.chargeStruct.chargeTypeId;
|
||||
res.volley = data.cannonCount * data.cannonRounds;
|
||||
@@ -123,7 +123,7 @@ Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::Exp
|
||||
res.rotationAngle = data.area.rotation;
|
||||
res.depth = data.area.height;
|
||||
res.width = data.area.width;
|
||||
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
|
||||
res.effectStart = data.effectStart.has_value() ? data.effectStart.get() : 0;
|
||||
res.effectDuration = data.effectDuration;
|
||||
res.chargeTypeId = data.chargeStruct.chargeTypeId;
|
||||
res.volley = data.impactCount; //cannonCount() * data.cannonRounds();
|
||||
@@ -140,7 +140,7 @@ Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::Eff
|
||||
res.rotationAngle = data.area.rotation;
|
||||
res.depth = data.area.height;
|
||||
res.width = data.area.width;
|
||||
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
|
||||
res.effectStart = data.effectStart.has_value() ? data.effectStart.get() : 0;
|
||||
res.effectDuration = data.effectDuration;
|
||||
res.chargeTypeId = data.chargeStruct.chargeTypeId;
|
||||
res.volley = 0;
|
||||
@@ -167,7 +167,7 @@ Database::EsmAesData ObjectAesData::asEsmAesData(const AreaEffectSimulation::Min
|
||||
res.effectStateId = static_cast<qint32>(data.effectStateId);
|
||||
res.position = QPointF(segment.positionStart.lon, segment.positionStart.lat);
|
||||
res.depth = data.width;
|
||||
res.effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
|
||||
res.effectStart = data.effectStart.has_value() ? data.effectStart.get() : 0;
|
||||
res.effectDuration = data.effectDuration;
|
||||
res.chargeTypeId = data.chargeStruct.chargeTypeId;
|
||||
res.volley = 18;
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ Core::FunctionReplyObject ObjectEffectShow::updateObject(const EffectShowManagem
|
||||
|
||||
m_data.id = data.id;
|
||||
m_data.name = QString::fromStdString(data.name);
|
||||
m_data.startTime = data.startTime.is_set() ? data.startTime.get() : 0;
|
||||
m_data.startTime = data.startTime.has_value() ? data.startTime.get() : 0;
|
||||
m_data.duration = data.duration;
|
||||
m_data.idAreaEffectSimulation = data.idAreaEffectSimulation;
|
||||
m_data.nameAreaEfffectSimulation = QString::fromStdString(data.nameAreaEffectSimulation);
|
||||
|
||||
@@ -98,7 +98,7 @@ void HandlerComment::onEvlCommentModifyRequest(const rti::core::SampleIdentity &
|
||||
data.ts = QDateTime::fromMSecsSinceEpoch(request.ts);
|
||||
data.senderOperatorId = request.senderOperatorId;
|
||||
|
||||
if (request.receiverOperatorId.is_set())
|
||||
if (request.receiverOperatorId.has_value())
|
||||
data.receiverOperatorId = request.receiverOperatorId.get();
|
||||
|
||||
data.text = QString::fromStdString(request.text);
|
||||
|
||||
@@ -153,11 +153,11 @@ void HandlerCriterium::onEvlElementModifyRequest(const rti::core::SampleIdentity
|
||||
data.phaseId = request.phaseId;
|
||||
data.rating = request.rating;
|
||||
data.time = request.timestamp;
|
||||
if (request.audioContent.is_set())
|
||||
if (request.audioContent.has_value())
|
||||
data.audioContent = QString::fromStdString(request.audioContent.get());
|
||||
if (request.videoContent.is_set())
|
||||
if (request.videoContent.has_value())
|
||||
data.videoContent = QString::fromStdString(request.videoContent.get());
|
||||
if (request.situationContent.is_set())
|
||||
if (request.situationContent.has_value())
|
||||
data.situationContent = QString::fromStdString(request.situationContent.get());
|
||||
|
||||
if (data.id <= 0)
|
||||
|
||||
Loaded 100 of 1718 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user