Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
This commit is contained in:
102 files changed
+3307
-3313
No files matched your search
+56
-56
@@ -28,8 +28,8 @@ bool DtcImplCustom::aesItemViewFromEntityId(int entityId, AesType aesType, AesIt
|
||||
}
|
||||
for (const auto &sample : m_dtcAesItemView->readAlive())
|
||||
{
|
||||
if ( (sample.data().aesItemId() == entityId) &&
|
||||
( (sample.data().aesTypeId() == aesType) || (aesType==AesType_def::AtUnknown) )
|
||||
if ( (sample.data().aesItemId == entityId) &&
|
||||
( (sample.data().aesTypeId == aesType) || (aesType==AesType::AtUnknown) )
|
||||
)
|
||||
{
|
||||
aesItemView = sample.data();
|
||||
@@ -42,71 +42,71 @@ bool DtcImplCustom::aesItemViewFromEntityId(int entityId, AesType aesType, AesIt
|
||||
bool DtcImplCustom::aesItemFromId(int aesId, AesItem &aesItem)
|
||||
{
|
||||
aesItem = nContamination(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = bCContamination(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = explosionArea(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = explosionCluster(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = explosionSingle(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = mineArea(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = dangerArea(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = functionalArea(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = mineCorridor(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = borderline(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = technicalArea(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = airSupportImpact(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = gasPipe(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = boobyTrap(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = dusSingleMine(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = offRouteMine(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
aesItem = effectCluster(aesId);
|
||||
if (aesItem.id() > 0)
|
||||
if (aesItem.id > 0)
|
||||
return true;
|
||||
|
||||
DEBUG_LOG(m_logger) << "No aesItem for aesId=" << aesId << " found";
|
||||
@@ -122,76 +122,76 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e
|
||||
aesItemId = 0;
|
||||
for (const AreaEffectSimulation::BCContamination &bcCont : qAsConst(bcConts))
|
||||
{
|
||||
if (bcCont.externalId() == externalId)
|
||||
if (bcCont.externalId == externalId)
|
||||
{
|
||||
if (bcCont.id() > aesItemId)
|
||||
aesItemId = bcCont.id();
|
||||
if (bcCont.id > aesItemId)
|
||||
aesItemId = bcCont.id;
|
||||
}
|
||||
}
|
||||
if (aesItemId > 0)
|
||||
return AreaEffectSimulation::AesType_def::AtBCContamination;
|
||||
return AreaEffectSimulation::AesType::AtBCContamination;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::NContamination> nConts = nContaminations();
|
||||
for (const AreaEffectSimulation::NContamination &nCont: qAsConst(nConts))
|
||||
{
|
||||
if (nCont.externalId() == externalId)
|
||||
if (nCont.externalId == externalId)
|
||||
{
|
||||
if (nCont.id() > aesItemId)
|
||||
aesItemId = nCont.id();
|
||||
if (nCont.id > aesItemId)
|
||||
aesItemId = nCont.id;
|
||||
}
|
||||
}
|
||||
if (aesItemId > 0)
|
||||
return AreaEffectSimulation::AesType_def::AtNContamination;
|
||||
return AreaEffectSimulation::AesType::AtNContamination;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::ExplosionArea> explAreas = explosionAreas();
|
||||
for (const AreaEffectSimulation::ExplosionArea &explArea : qAsConst(explAreas))
|
||||
{
|
||||
if (explArea.externalId() == externalId)
|
||||
if (explArea.externalId == externalId)
|
||||
{
|
||||
if (explArea.id() > aesItemId)
|
||||
aesItemId = explArea.id();
|
||||
if (explArea.id > aesItemId)
|
||||
aesItemId = explArea.id;
|
||||
}
|
||||
}
|
||||
if (aesItemId > 0)
|
||||
return AreaEffectSimulation::AesType_def::AtExplosionArea;
|
||||
return AreaEffectSimulation::AesType::AtExplosionArea;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::ExplosionSingle> explSingles = explosionSingles();
|
||||
for (const AreaEffectSimulation::ExplosionSingle &explSingle : qAsConst(explSingles))
|
||||
{
|
||||
if (explSingle.externalId() == externalId)
|
||||
if (explSingle.externalId == externalId)
|
||||
{
|
||||
if (explSingle.id() > aesItemId)
|
||||
aesItemId = explSingle.id();
|
||||
if (explSingle.id > aesItemId)
|
||||
aesItemId = explSingle.id;
|
||||
}
|
||||
}
|
||||
if (aesItemId > 0)
|
||||
return AreaEffectSimulation::AesType_def::AtExplosionSingle;
|
||||
return AreaEffectSimulation::AesType::AtExplosionSingle;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::MineArea> mAreas = mineAreas();
|
||||
for(const AreaEffectSimulation::MineArea &mArea : qAsConst(mAreas))
|
||||
{
|
||||
if (mArea.externalId() == externalId)
|
||||
if (mArea.externalId == externalId)
|
||||
{
|
||||
if (mArea.id() > aesItemId)
|
||||
aesItemId = mArea.id();
|
||||
if (mArea.id > aesItemId)
|
||||
aesItemId = mArea.id;
|
||||
}
|
||||
}
|
||||
if (aesItemId > 0)
|
||||
return AreaEffectSimulation::AesType_def::AtMineArea;
|
||||
return AreaEffectSimulation::AesType::AtMineArea;
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::MineCorridor> mCorridors = mineCorridors();
|
||||
for (const AreaEffectSimulation::MineCorridor &mCorridor : qAsConst(mCorridors))
|
||||
{
|
||||
if (mCorridor.externalId() == externalId)
|
||||
if (mCorridor.externalId == externalId)
|
||||
{
|
||||
if (mCorridor.id() > aesItemId)
|
||||
aesItemId = mCorridor.id();
|
||||
if (mCorridor.id > aesItemId)
|
||||
aesItemId = mCorridor.id;
|
||||
}
|
||||
}
|
||||
if (aesItemId > 0)
|
||||
return AreaEffectSimulation::AesType_def::AtMineCorridor;
|
||||
return AreaEffectSimulation::AesType::AtMineCorridor;
|
||||
|
||||
return AreaEffectSimulation::AesType_def::AtUnknown;
|
||||
return AreaEffectSimulation::AesType::AtUnknown;
|
||||
}
|
||||
|
||||
bool DtcImplCustom::triggeredImpactsFromEntityId(int entityId, AesType aesType, TriggeredImpacts &triggeredImpacts)
|
||||
@@ -206,8 +206,8 @@ bool DtcImplCustom::triggeredImpactsFromEntityId(int entityId, AesType aesType,
|
||||
}
|
||||
for (const auto &sample : m_dtcTriggeredImpacts->readAlive())
|
||||
{
|
||||
if ( (sample.data().aesItemId() == entityId) &&
|
||||
( (sample.data().aesTypeId() == aesType) || (aesType==AesType_def::AtUnknown) )
|
||||
if ( (sample.data().aesItemId == entityId) &&
|
||||
( (sample.data().aesTypeId == aesType) || (aesType==AesType::AtUnknown) )
|
||||
)
|
||||
{
|
||||
triggeredImpacts = sample.data();
|
||||
@@ -229,8 +229,8 @@ bool DtcImplCustom::effectsFromEntityId(int entityId, AesType aesType, Effects &
|
||||
}
|
||||
for (const auto &sample : m_dtcEffects->readAlive())
|
||||
{
|
||||
if ( (sample.data().aesItemId() == entityId) &&
|
||||
( (sample.data().aesTypeId() == aesType) || (aesType==AesType_def::AtUnknown) )
|
||||
if ( (sample.data().aesItemId == entityId) &&
|
||||
( (sample.data().aesTypeId == aesType) || (aesType==AesType::AtUnknown) )
|
||||
)
|
||||
{
|
||||
effects = sample.data();
|
||||
@@ -244,14 +244,14 @@ int DtcImplCustom::partyForDusMine(int dusMineId) const
|
||||
{
|
||||
for (const auto &dms : m_dusMineStateCont)
|
||||
{
|
||||
for (const DusMine &dm : dms.mines())
|
||||
for (const DusMine &dm : dms.mines)
|
||||
{
|
||||
if (dm.eqId() == dusMineId)
|
||||
if (dm.eqId == dusMineId)
|
||||
{
|
||||
auto it = m_mineAreaCont.find(dms.id());
|
||||
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.is_set() ? it.value().partyId.get() : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,8 +263,8 @@ QString DtcImplCustom::aesItemNameFromEntityId(int entityId)
|
||||
{
|
||||
AreaEffectSimulation::AesItem aesItem;
|
||||
aesItemFromId(entityId, aesItem);
|
||||
if (!aesItem.name().empty())
|
||||
return QString::fromStdString(aesItem.name());
|
||||
if (!aesItem.name.empty())
|
||||
return QString::fromStdString(aesItem.name);
|
||||
//else use DAO
|
||||
|
||||
if (!m_dao)
|
||||
@@ -355,8 +355,8 @@ QVector<TrajectoryTimeAware> DtcImplCustom::trajectoriesTimeAwareFromOriginatorI
|
||||
for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : qAsConst(trajectoryTimeAwareMap))
|
||||
{
|
||||
// be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId)
|
||||
if ((trajectoryTimeAware.originatorId() == originatorId) &&
|
||||
(trajectoryTimeAware.originatorTypeId() == originatorTypeId))
|
||||
if ((trajectoryTimeAware.originatorId == originatorId) &&
|
||||
(trajectoryTimeAware.originatorTypeId == originatorTypeId))
|
||||
foundTrajectories.append(trajectoryTimeAware);
|
||||
}
|
||||
return foundTrajectories;
|
||||
|
||||
Reference in new issue
Block a user