Migrates residual Lts sources to generated rtiddsgen API

Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
berrux-dev committed 2026-09-23 12:05:37 +02:00
1 parent 5485a90385
commit 881d44f4dd
512 files changed
+6887 -6426

No files matched your search

@@ -118,28 +118,28 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsUnknown:
case AreaEffectSimulation::AesEffectState_def::EsError:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsUnknown:
case AreaEffectSimulation::AesEffectState::EsError:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
removeStates(data);
m_aesItemViews.remove(data.aesItemId());
break;
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsPaused:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState_def::EsFired:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPaused:
case AreaEffectSimulation::AesEffectState::EsActivated:
case AreaEffectSimulation::AesEffectState::EsFired:
m_aesItemViews.insert(data.aesItemId(), data);
break;
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsReceived:
break;
}
}
void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data)
{
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtExplosionArea)
return;
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId();
// remove State for each building
@@ -157,15 +157,15 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleState.remove(data.id());
return;
}
// Only handle transitions from prepared to activated
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared
&& data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared
&& data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -382,9 +382,9 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
// check for correct AES type artillery only
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
DEBUG_LOG(m_logger) << "Calculate";
break;
default:
@@ -225,25 +225,25 @@ void HandlerParticipantArea::onSendCesHitReply(const Core::FunctionReplyObject &
void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
{
// not needed, handled through HandlerParticipantGasPipe
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtGasPipe)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtGasPipe)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtUnknown)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtUnknown)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrap)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrap)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMine)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMine)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineArea)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineArea)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineCorridor)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineCorridor)
return;
if (m_ddsHandler->isSmartChargeType(data.chargeTypeId()))
@@ -264,7 +264,7 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
return;
}
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{
// build Polygon Mines:
auto &formMines = m_aesItemViews[data.aesItemId()].formMines;
@@ -281,26 +281,26 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPrepared:
{
m_aesItemViews.insert(data.aesItemId(), CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
break;
}
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineArea:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
break;
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
case AreaEffectSimulation::AesType::AtNContamination:
// for each participant:
// Bounding-Box Check,
// form-Check
@@ -308,31 +308,31 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
calculateBcContamination(aesItemViewUtm);
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
break;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtDangerArea:
calculateFunctionArea(aesItemViewUtm);
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtMineCorridor:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
break;
} // switch aesTypeId
break;
} // case EsActivated
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsExpired:
{
aesItemViewRemoved(aesItemId);
break;
@@ -354,14 +354,14 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
//DEBUG_LOG(m_logger) << "Got onDusSingleMineChanged data.id()=" << data.id();
CentralEffectSimulation::AesItemViewUtm itemView;
itemView.aesItemId = data.id();
itemView.chargeTypeId = data.chargeTypeId();
itemView.partyId = data.partyId.is_set() ? data.partyId.get() : -1;
itemView.aesTypeId = AreaEffectSimulation::AesType_def::AtDusSingleMine;
itemView.aesTypeId = AreaEffectSimulation::AesType::AtDusSingleMine;
itemView.effectStart = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
itemView.formMines.push_back(CentralEffectSimulation::geographic2Utm(data.position(), &itemView.zone));
itemView.dusMineId = data.mineId();
@@ -372,9 +372,9 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
m_triggeredImpacts[itemView.aesItemId] = ti;
break;
}
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
m_aesItemViews.remove(data.id());
break;
default:
@@ -395,14 +395,14 @@ void HandlerParticipantArea::onBCContaminationChanged(const AreaEffectSimulation
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
const auto dtcPdm = m_ddsHandler->dtcPdm();
if (dtcPdm->volatilityTypeId(data.chargeTypeId()) == ProjectDataManagement::VolatilityType_def::Resident)
if (dtcPdm->volatilityTypeId(data.chargeTypeId()) == ProjectDataManagement::VolatilityType::Resident)
{
ref.radials = {data.impactRadius()};
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition(), &ref.zone);
@@ -427,10 +427,10 @@ void HandlerParticipantArea::onNContaminationChanged(const AreaEffectSimulation:
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
ref.radials = {data.impactRadius(),
@@ -481,13 +481,13 @@ void HandlerParticipantArea::deleteFunctionalArea(const int aesItemId)
if (m_handlerParticipant->isOutdated(participantPos))
continue;
// Same as leave FunctionArea
if (itemView.aesTypeId == AreaEffectSimulation::AesType_def::AtFunctionalArea)
if (itemView.aesTypeId == AreaEffectSimulation::AesType::AtFunctionalArea)
{
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea);
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea);
sendEffectTypeEvent(itemView, participantPos, EffectType::FunctionalAreaLeave, -1, -1);
}
else
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId();
} // for all Participants
} // deleteFunctionalArea
@@ -503,7 +503,7 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
if (inFormCheck(itemView, participantPos))
// Check, if Participant is in a circle of mine
inMineRadiusCheck(itemView, participantPos);
@@ -511,15 +511,15 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
// no longer in mine area - reset all EffectiveMineRangeEnter mineIndexes
m_effectTypeBitFieldIndexes[itemView.aesItemId][participantPos.participantId()].clear();
break;
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
break;
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtDusSingleMine:
inMineRadiusCheck(itemView, participantPos);
break;
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType::AtBCContamination:
case AreaEffectSimulation::AesType::AtNContamination:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtDangerArea:
inFormCheck(itemView, participantPos);
break;
default:
@@ -552,7 +552,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae
continue;
}
const int mineIdx = (itemView.aesTypeId == AreaEffectSimulation::AesType_def::AtDusSingleMine)
const int mineIdx = (itemView.aesTypeId == AreaEffectSimulation::AesType::AtDusSingleMine)
? itemView.dusMineId : bitFieldIdx + 1; // mineIdx in minefield starts at 1
// Check, if participant is inside danger-radius of the mine
@@ -576,7 +576,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae
bool HandlerParticipantArea::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
if (m_handlerParticipant->isOutdated(participantPosition)) // Participant Position is not valid Todo Magic Number
@@ -603,7 +603,7 @@ bool HandlerParticipantArea::inBoundingBoxCheck(const CentralEffectSimulation::A
bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
if (m_handlerParticipant->isOutdated(participantPosition)) // Participant Position is not valid
@@ -626,23 +626,23 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
<< ", aesItemId: " << itemView.aesItemId;
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
sendEffectTypeEvent(itemView, participantPosition, effectTypeForBCContaminationArea(itemView, participantPosUtmPoint), -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterDangerArea);
case AreaEffectSimulation::AesType::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterDangerArea);
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterFunctionalArea);
case AreaEffectSimulation::AesType::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea);
sendEffectTypeEvent(itemView, participantPosition, EffectType::FunctionalAreaEnter, -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterMineArea);
case AreaEffectSimulation::AesType::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterMineArea);
break;
case AreaEffectSimulation::AesType_def::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterNuclear);
case AreaEffectSimulation::AesType::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
sendEffectTypeEvent(itemView, participantPosition, effectTypeForNContaminationArea(itemView, participantPosUtmPoint, participantPosition.sampleTime()), -1, -1);
break;
default:
@@ -655,23 +655,23 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
// outside
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
sendEffectTypeEvent(itemView, participantPosition, EffectType::BCContaminationLeave, -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
case AreaEffectSimulation::AesType::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea);
case AreaEffectSimulation::AesType::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea);
sendEffectTypeEvent(itemView, participantPosition, EffectType::FunctionalAreaLeave, -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveMineArea);
case AreaEffectSimulation::AesType::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveMineArea);
break;
case AreaEffectSimulation::AesType_def::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveNuclear);
case AreaEffectSimulation::AesType::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveNuclear);
sendEffectTypeEvent(itemView, participantPosition, EffectType::NContaminationLeave, -1, -1);
break;
default:
@@ -699,14 +699,14 @@ void HandlerParticipantArea::onTriggeredImpactsChanged(const AreaEffectSimulatio
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: " << data;
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
// explosion at the position of participant
calculateImpacts(data);
break;
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
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);
@@ -746,16 +746,16 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
modType != DataModification::eModified)
return;
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleStates.remove(data.id());
return;
}
// Only handle transitions from prepared or fired to activated
if ((m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared ||
m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if ((m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared ||
m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -806,16 +806,16 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
if (modType != DataModification::eAdded && modType != DataModification::eModified)
return;
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) // EsExpired? EsError? EsUnknown?
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved) // EsExpired? EsError? EsUnknown?
{
DEBUG_LOG(m_logger) << "Remove ExplosionSingleCentral with aesId = " << data.id();
m_explosionSingleCentralStates.remove(data.id());
return;
} // if
if ((m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState_def::EsFired) ||
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated)
if ((m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState::EsPrepared &&
m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState::EsFired) ||
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated)
{
m_explosionSingleCentralStates.insert(data.id(), data.effectStateId());
return;
@@ -915,7 +915,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_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
if (pPos.insideBuilding())
continue;
@@ -991,7 +991,7 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
return;
}
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -1000,7 +1000,7 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
const TrainingAreaBase::TabPosition pos(participantPosition.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantPosition.buildingId(),
participantPosition.roomId());
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
@@ -1058,7 +1058,7 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
} // if
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -1067,7 +1067,7 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId(), 0);
const int originatorEquipmentNumber = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
const TrainingAreaBase::TabPosition pos(
participantPosition.pos(), Core::PositionReportingSource_def::Gps, participantPosition.buildingId(),
participantPosition.pos(), Core::PositionReportingSource::Gps, participantPosition.buildingId(),
participantPosition.roomId()
);
TrainingAreaBase::SendCesHitRequest requestTab(
@@ -1092,12 +1092,12 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
bool calculateAes = false;
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_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Aircraft ||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Aircraft ||
typeClass == ParticipantManagement::TypeClass::Vessel ||
typeClass == ParticipantManagement::TypeClass::Unknown)
{
DEBUG_LOG(m_logger) << "Participant with id " << participantPosition.participantId()
<< " has invalid typeClass: " << typeClass
@@ -1131,12 +1131,12 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
}
// send hit events only with central AES Simulation
if (calculateAes
&& (eventType == ProjectDataManagement::PdmEventType_def::HitB
|| eventType == ProjectDataManagement::PdmEventType_def::HitC
|| eventType == ProjectDataManagement::PdmEventType_def::Hit
|| eventType == ProjectDataManagement::PdmEventType_def::HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType_def::HitMine
|| eventType == ProjectDataManagement::PdmEventType_def::HitN))
&& (eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitC
|| eventType == ProjectDataManagement::PdmEventType::EventType_Hit
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN))
{
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantPosition.participantId();
return;
@@ -1169,14 +1169,14 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
// Criterion for friendly Fire:
if (itemView.partyId != -1
&& ((eventType == ProjectDataManagement::PdmEventType_def::EnterMineArea
|| eventType == ProjectDataManagement::PdmEventType_def::EnterNuclear
|| eventType == ProjectDataManagement::PdmEventType_def::HitB
|| eventType == ProjectDataManagement::PdmEventType_def::HitC
|| eventType == ProjectDataManagement::PdmEventType_def::Hit
|| eventType == ProjectDataManagement::PdmEventType_def::HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType_def::HitMine
|| eventType == ProjectDataManagement::PdmEventType_def::HitN)
&& ((eventType == ProjectDataManagement::PdmEventType::EventType_EnterMineArea
|| eventType == ProjectDataManagement::PdmEventType::EventType_EnterNuclear
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitC
|| eventType == ProjectDataManagement::PdmEventType::EventType_Hit
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN)
&& itemView.partyId == participantPosition.partyId()))
pe.friendlyFire(true);
else
@@ -1268,29 +1268,29 @@ bool HandlerParticipantArea::eventMustBeSend(int aesItemId,
// - remove opposite events (e.g remove Enter event when we leave the area)
switch (eventType.underlying())
{
case ProjectDataManagement::PdmEventType_def::EnterDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterDangerArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterDangerArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveMineArea);
case ProjectDataManagement::PdmEventType::EventType_EnterMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveMineArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterMineArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterMineArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea);
case ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterFunctionalArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveNuclear);
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveNuclear);
break;
case ProjectDataManagement::PdmEventType_def::LeaveNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterNuclear);
case ProjectDataManagement::PdmEventType::EventType_LeaveNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
break;
default:
break;
@@ -1424,29 +1424,29 @@ ProjectDataManagement::PdmEventType HandlerParticipantArea::leaveEventTypeForAes
{
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtDangerArea:
return ProjectDataManagement::PdmEventType::LeaveDangerArea;
case AreaEffectSimulation::AesType_def::AtMineArea:
return ProjectDataManagement::PdmEventType::LeaveMineArea;
case AreaEffectSimulation::AesType_def::AtNContamination:
return ProjectDataManagement::PdmEventType::LeaveNuclear;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
return ProjectDataManagement::PdmEventType::LeaveFunctionalArea;
case AreaEffectSimulation::AesType::AtDangerArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea;
case AreaEffectSimulation::AesType::AtMineArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
case AreaEffectSimulation::AesType::AtNContamination:
return ProjectDataManagement::PdmEventType::EventType_LeaveNuclear;
case AreaEffectSimulation::AesType::AtFunctionalArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea;
default:
break;
}
return ProjectDataManagement::PdmEventType::Unknown;
return ProjectDataManagement::PdmEventType::EventType_Unknown;
}
EffectType HandlerParticipantArea::leaveEffectTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
{
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
return EffectType::BCContaminationLeave;
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
return EffectType::NContaminationLeave;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
return EffectType::FunctionalAreaLeave;
default:
break;
@@ -1511,7 +1511,7 @@ void HandlerParticipantArea::aesItemViewRemoved(int aesItemId)
}
}
const auto eventTypeLeave = leaveEventTypeForAesType(aiv.aesTypeId);
if (eventTypeLeave != ProjectDataManagement::PdmEventType::Unknown)
if (eventTypeLeave != ProjectDataManagement::PdmEventType::EventType_Unknown)
{
DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave;
auto it = m_eventStates.find(aesItemId);