Migrates CentralEffectSimulation to generated rtiddsgen API

Converts accessor calls to plain member access across ces service.
This commit is contained in:
berrux-dev committed 2026-09-21 02:45:54 +02:00
1 parent 40f767fc4d
commit 2df80f90a7
24 files changed
+752 -752

No files matched your search

@@ -198,7 +198,7 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
HandlerParticipantBorderline::BorderlineUtm::BorderlineUtm(const AreaEffectSimulation::Borderline &bl)
: id(bl.id())
, operatorId(bl.operatorId())
, partyId(bl.partyId().is_set() ? bl.partyId().get() : -1)
, partyId(bl.partyId.is_set() ? bl.partyId.get() : -1)
, name(QString::fromStdString(bl.name()))
{
points.reserve(bl.segments().size());
@@ -108,10 +108,10 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d
<< " data.id=" << data.id()
<< " effectStateId=" << data.effectStateId();
if (!data.effectStart().is_set())
if (!data.effectStart.is_set())
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;
@@ -154,17 +154,17 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
{
DEBUG_LOG(m_logger) << "AtOffRouteMineSecondary id=" << data.id() / 1000;
auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int)(data.id() / 1000));
if (!offRouteMine.effectStart().is_set())
if (!offRouteMine.effectStart.is_set())
{
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart().is_set()";
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart.is_set()";
return;
}
DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
<< " effectStart=" << offRouteMine.effectStart()
<< " effectDuration=" << offRouteMine.effectDuration()
<< " diff = " << m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart().get() + 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);
@@ -181,17 +181,17 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
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())
if (!boobyTrap.effectStart.is_set())
{
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart().is_set()";
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart.is_set()";
return;
}
DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
<< " effectStart=" << boobyTrap.effectStart()
<< " effectDuration=" << boobyTrap.effectDuration()
<< " diff = " << m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart().get() + 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);
@@ -360,7 +360,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.is_set() ? data.partyId.get() : -1;
itemView.aesTypeId = AreaEffectSimulation::AesType_def::AtDusSingleMine;
itemView.effectStart = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
itemView.formMines.push_back(CentralEffectSimulation::geographic2Utm(data.position(), &itemView.zone));
@@ -724,8 +724,8 @@ void HandlerParticipantArea::onExplosionAreaChanged(const AreaEffectSimulation::
return;
DEBUG_LOG(m_logger) << "Got ExplosionArea, m_aesItemId2partIdMap.insert " << data.id() << " / " << data.participantId();
if (data.participantId().is_set())
m_aesItemId2partIdMap.insert(data.id(), data.participantId().get());
if (data.participantId.is_set())
m_aesItemId2partIdMap.insert(data.id(), data.participantId.get());
else
m_aesItemId2partIdMap.remove(data.id());
} // onExplosionAreaChanged
@@ -1072,7 +1072,7 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
);
TrainingAreaBase::SendCesHitRequest requestTab(
equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber,
remaining, pos, effectTime, itemView.partyId().get(), mineFieldBitIndex
remaining, pos, effectTime, itemView.partyId.get(), mineFieldBitIndex
);
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeTypeId()
<< " legacyChargeTypeId=" << legacyChargeTypeId;
@@ -399,8 +399,8 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect
// if we get the equipmentNumber from the participant we will send this (needed by tab)
// if not fall back to participantId, not negated yet as it's not tested and probalbly handled by the TNE
const ParticipantManagement::Participant &part = m_ddsHandler->dtcPpm()->participant(data.originatorId());
if (part.equipmentNumber().is_set())
requestTab.originatorEquipmentNumber(part.equipmentNumber().get());
if (part.equipmentNumber.is_set())
requestTab.originatorEquipmentNumber(part.equipmentNumber.get());
else
{
WARNING_LOG(m_logger) << "Sending CesHitRequest without EquipNo, using negative ParticipantID : " << data.originatorId();
@@ -912,7 +912,7 @@ void HandlerExplosions::calculateSmartEffect(const AreaEffectSimulation::Effects
<< ", aesItem= " << aesItem;
calculateSmartExplosion(effects.aesItemId(),
aesItem.chargeStruct(),
aesItem.partyId().is_set() ? aesItem.partyId().get() : 0,
aesItem.partyId.is_set() ? aesItem.partyId.get() : 0,
Core::GeoPosition(se.position().lon(), se.position().lat(), 0),
effects.sampleTime());
} // for
@@ -1591,8 +1591,8 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem
if (eventType == ProjectDataManagement::EventType::EnterHazardDistance)
{
const auto &ec = m_ddsHandler->dtcAes().get()->explosionCluster(itemView.aesItemId);
if (ec.effectStart().is_set())
effectTime2 = ec.effectStart().get() / 1000; // msec to sec
if (ec.effectStart.is_set())
effectTime2 = ec.effectStart.get() / 1000; // msec to sec
}
@@ -94,7 +94,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated))
return;
if (!data.effectStart().is_set())
if (!data.effectStart.is_set())
{
DEBUG_LOG(m_logger) << "No effectStart";
return;
@@ -107,10 +107,10 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
if (!m_ddsHandler->isLaserGuidable(data.chargeStruct()))
return;
if (!data.flightCurve().is_set() || !data.laserGuiding().is_set())
if (!data.flightCurve.is_set() || !data.laserGuiding.is_set())
return;
const AreaEffectSimulation::FlightCurve &fcData = data.flightCurve().get();
const AreaEffectSimulation::LaserGuiding &lgData = data.laserGuiding().get();
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()
@@ -137,7 +137,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
m_aesTimers.insert(data.id(), timer);
timer->setProperty("aesId", aesId);
{
long long effectStart = data.effectStart().is_set() ? data.effectStart().get() : 0;
long long effectStart = data.effectStart.is_set() ? data.effectStart.get() : 0;
long long calculatedFlightDurationMSec = fcData.calculatedFlightDuration();
long long currentPartitionTime = m_ddsHandler->currentPartitionTime();
const int timerTimeout = effectStart - calculatedFlightDurationMSec - currentPartitionTime;
@@ -160,9 +160,9 @@ void HandlerVulcano::onFiringTimeTimeout()
const auto &myEC = m_explosionCluster.value(aesId);
if (myEC.id() != aesId)
return;
if (!myEC.flightCurve().is_set())
if (!myEC.flightCurve.is_set())
return;
const AreaEffectSimulation::FlightCurve &fcData = myEC.flightCurve().get();
const AreaEffectSimulation::FlightCurve &fcData = myEC.flightCurve.get();
//auto dtcPpm = m_ddsHandler->dtcPpm();
//auto participantId = dtcPpm.get()->getParticipantFromPrf(prf);
@@ -211,7 +211,7 @@ void HandlerVulcano::onFiringTimeTimeout()
// Flugzeit zwischen TAP(') und Einschlag
int timeDiffTapToExplosion = relTimeExplosion - relTimeTap;
// Somit ist die absolute Zeit am TAP(') die Startzeit abzüglich der Flugzeit
int absTimeAtTap = myEC.effectStart().get() - timeDiffTapToExplosion;
int absTimeAtTap = myEC.effectStart.get() - timeDiffTapToExplosion;
// Und die ist in wieviel Sekunden?
int relTimeToTap = absTimeAtTap - m_ddsHandler->currentPartitionTime();
DEBUG_LOG(m_logger) << "timer->start timeout= " << relTimeToTap
@@ -231,9 +231,9 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
const auto &myEC = m_explosionCluster.value(aesId);
if (myEC.id() != aesId)
return;
if (!myEC.laserGuiding().is_set())
if (!myEC.laserGuiding.is_set())
return;
const AreaEffectSimulation::LaserGuiding &lgData = myEC.laserGuiding().get();
const AreaEffectSimulation::LaserGuiding &lgData = myEC.laserGuiding.get();
const int prf = lgData.lcAttack();
@@ -203,8 +203,8 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
isSupplyTruck = true;
}
auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], 0, isSupplyTruck));
if (fa.participantId().is_set())
aesItemViewUtm.participantId = fa.participantId().get();
if (fa.participantId.is_set())
aesItemViewUtm.participantId = fa.participantId.get();
if (!m_aesPolygonEncloseBuilding.contains(data.aesItemId()))
{
@@ -882,7 +882,7 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView
TrainingAreaBase::SendCesHitRequest requestTab(
equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber,
remaining, pos, effectTime, eventType, itemView.partyId().get(), mineFieldBitIndex
remaining, pos, effectTime, eventType, itemView.partyId.get(), mineFieldBitIndex
);
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct().chargeTypeId()
<< " legacyChargeTypeId=" << legacyChargeTypeId;
@@ -825,8 +825,8 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
int32_t legacyChargeTypeId = 0;
int32_t partyId = 0;
if ( aesItem.partyId().is_set())
partyId = aesItem.partyId().get();
if ( aesItem.partyId.is_set())
partyId = aesItem.partyId.get();
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(aesItem.chargeStruct());
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
@@ -279,8 +279,8 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
requestTab.originatorEquipmentNumber(originatorEquipNo);
requestTab.participantId(participantId);
int32_t partyId = 0;
if ( aesItem.partyId().is_set())
partyId = aesItem.partyId().get();
if ( aesItem.partyId.is_set())
partyId = aesItem.partyId.get();
requestTab.partyId(partyId);
requestTab.position(pos);
@@ -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.is_set() ? data.equipmentNumber.get() : 0;
if (m_logger.isTraceEnabled())
{