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

@@ -146,7 +146,7 @@ void CesTests::startTest()
if (m_testId <= 1) // AES-Hit On Buildings area explosions
{
m_countHitOnBuildingReply = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtExplosionArea;
m_aesType = AreaEffectSimulation::AesType::AtExplosionArea;
QTimer::singleShot(0, this, &CesTests::tryCreateMainStructureElement);
QTimer::singleShot(0, this, &CesTests::tryCreateMainFootprint);
QTimer::singleShot(0, this, &CesTests::tryCreateChargeType);
@@ -158,7 +158,7 @@ void CesTests::startTest()
{
m_countHitOnBuildingReply = 0;
m_explosionSingle = m_housePos.geographic(5, 5);
m_aesType = AreaEffectSimulation::AesType_def::AtExplosionSingle;
m_aesType = AreaEffectSimulation::AesType::AtExplosionSingle;
QTimer::singleShot(0, this, &CesTests::tryCreateMainStructureElement);
QTimer::singleShot(0, this, &CesTests::tryCreateMainFootprint);
QTimer::singleShot(0, this, &CesTests::tryCreateChargeType);
@@ -186,7 +186,7 @@ void CesTests::startTest()
// 2) AreaEffectSimulation::ExplosionArea
QTimer::singleShot(300, this, &CesTests::tryCreateExplosionArea);
// 3) AreaEffectSimulation::AesItemView AtExplosionArea
m_aesType = AreaEffectSimulation::AesType_def::AtExplosionArea;
m_aesType = AreaEffectSimulation::AesType::AtExplosionArea;
// is not used for AtExplosionAreaSingleExplosions on participant
// 4) AreaEffectSimulation::AesItemView AtExplosionAreaSingleExplosions
m_aesItemId = 5;
@@ -201,7 +201,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_explosionSingle = m_housePos.geographic(-2, -2);
m_aesType = AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions;
m_aesType = AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions;
QTimer::singleShot(0, this, &CesTests::tryCreateParticipant);
QTimer::singleShot(50, this, &CesTests::tryCreateDynamicParticipantData);
QTimer::singleShot(100, this, &CesTests::tryCreateParticipantPosition);
@@ -233,7 +233,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtBCContamination;
m_aesType = AreaEffectSimulation::AesType::AtBCContamination;
m_chargeTypeId = 341;
QTimer::singleShot(0, this, [this]() { tryCreateAesItemViewBC(); });
QTimer::singleShot(50, this, &CesTests::tryCreateDynamicParticipantData);
@@ -252,7 +252,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_aesType = AreaEffectSimulation::AesType_def::AtBCContamination;
m_aesType = AreaEffectSimulation::AesType::AtBCContamination;
m_chargeTypeId = 341;
QTimer::singleShot(00, this, &CesTests::tryCreateDynamicParticipantData);
QTimer::singleShot(100, this, &CesTests::tryCreateParticipant);
@@ -279,7 +279,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtMineAreaSingleMines;
m_aesType = AreaEffectSimulation::AesType::AtMineAreaSingleMines;
m_chargeTypeId = 40;
QTimer::singleShot(0, this, &CesTests::tryCreateChargeType);
QTimer::singleShot(0, this, &CesTests::tryCreateAesItemViewSM); // SingleMines
@@ -312,7 +312,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtNContamination;
m_aesType = AreaEffectSimulation::AesType::AtNContamination;
m_chargeTypeId = 341;
QTimer::singleShot(0, this, [this]() { tryCreateAesItemViewBC(); });
QTimer::singleShot(50, this, &CesTests::tryCreateDynamicParticipantData);
@@ -332,7 +332,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtFunctionalArea;
m_aesType = AreaEffectSimulation::AesType::AtFunctionalArea;
m_chargeTypeId = 411;
QTimer::singleShot(0, this, [this]() { tryCreateAesItemViewBC(); });
QTimer::singleShot(100, this, &CesTests::tryCreateDynamicParticipantData);
@@ -359,7 +359,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtFunctionalArea;
m_aesType = AreaEffectSimulation::AesType::AtFunctionalArea;
m_chargeTypeId = 411;
QTimer::singleShot(0, this, [this]() { tryCreateAesItemViewBC(); });
QTimer::singleShot(100, this, &CesTests::tryCreateDynamicParticipantData);
@@ -367,7 +367,7 @@ void CesTests::startTest()
QTimer::singleShot(300, this, &CesTests::tryCreateParticipantPosition);
QTimer::singleShot(400, this, &CesTests::tryCreateParticipantPosition);
QTimer::singleShot(500, this, &CesTests::tryCreateParticipantPosition);
QTimer::singleShot(600, this, [this]() { tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState_def::EsExpired); });
QTimer::singleShot(600, this, [this]() { tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState::EsExpired); });
QTimer::singleShot(700, this, &CesTests::checkParticipantEvent);
}
else if (m_testId == 12) // AesType::AtFunctionalArea Participant leave FunctionalArea
@@ -387,7 +387,7 @@ void CesTests::startTest()
m_participantIndex = 0; // Only last 2 Positions
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtFunctionalArea;
m_aesType = AreaEffectSimulation::AesType::AtFunctionalArea;
m_chargeTypeId = 411;
QTimer::singleShot(0, this, [this]() { tryCreateAesItemViewBC(); });
QTimer::singleShot(100, this, &CesTests::tryCreateDynamicParticipantData);
@@ -435,7 +435,7 @@ void CesTests::startTest()
m_participantIndex = 0;
m_buildingId = 0; // Criterium outside Buildings: buildingId = 0
m_roomId = 0;
m_aesType = AreaEffectSimulation::AesType_def::AtDangerArea;
m_aesType = AreaEffectSimulation::AesType::AtDangerArea;
m_chargeTypeId = 411;
QTimer::singleShot(0, this, &CesTests::tryCreateAesItemView);
//QTimer::singleShot(100, this, &CesTests::tryCreateDynamicParticipantData);
@@ -457,13 +457,13 @@ void CesTests::tryCreateTriggeredExplosion()
AreaEffectSimulation::TriggeredImpacts ti;
// publish new triggered explosions data here
ti.id(m_aesItemId);
ti.aesItemId(m_aesItemId);
ti.aesTypeId(AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions);
ti.sampleTime(QDateTime::currentMSecsSinceEpoch());
ti.impactCount(3);
ti.bitfield().resize(1);
ti.bitfield()[0] = 0; // 0 = Mine active
ti.id = m_aesItemId;
ti.aesItemId = m_aesItemId;
ti.aesTypeId = AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions;
ti.sampleTime = QDateTime::currentMSecsSinceEpoch();
ti.impactCount = 3;
ti.bitfield.resize(1);
ti.bitfield[0] = 0; // 0 = Mine active
DEBUG_LOG(m_logger) << "Publishing TriggeredExplosions: " << ti;
if (!m_aesDts->publish(ti))
@@ -473,9 +473,9 @@ void CesTests::tryCreateTriggeredExplosion()
void CesTests::tryCreateExplosionArea()
{
AreaEffectSimulation::ExplosionArea ea;
ea.id(m_aesItemId);
ea.participantId(m_originatorParticipantId); // In ddsview <not set>
ea.effectStateId(AreaEffectSimulation::AesEffectState::inner_enum::EsPrepared);
ea.id = m_aesItemId;
ea.participantId = m_originatorParticipantId; // In ddsview <not set>
ea.effectStateId = AreaEffectSimulation::AesEffectState::EsPrepared;
DEBUG_LOG(m_logger) << "Publishing ExplosionArea: " << ea;
if (!m_aesDts->publish(ea))
@@ -485,26 +485,26 @@ void CesTests::tryCreateExplosionArea()
void CesTests::tryCreateExplosionSinglePrepared()
{
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
m_aiv.id(m_aesItemId);
m_aiv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsPrepared);
m_aiv.aesTypeId(m_aesType);
m_aiv.partyId(5);
m_aiv.boundingBoxBottomLeft(Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y()));
m_aiv.boundingBoxTopRight(Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y()));
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.chargeStruct().chargeTypeId(m_chargeTypeId);
setPos(m_aiv.form(), m_explosionSingle);
m_aiv.aesItemId = m_aesItemId;
m_aiv.id = m_aesItemId;
m_aiv.effectStateId = AreaEffectSimulation::AesEffectState::EsPrepared;
m_aiv.aesTypeId = m_aesType;
m_aiv.partyId = 5;
m_aiv.boundingBoxBottomLeft = Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y());
m_aiv.boundingBoxTopRight = Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y());
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
m_aiv.chargeStruct.chargeTypeId = m_chargeTypeId;
setPos(m_aiv.form, m_explosionSingle);
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
m_es = AreaEffectSimulation::ExplosionSingle();
m_es.id(m_aesItemId);
m_es.participantId(m_originatorParticipantId); // In ddsview <not set>
m_es.effectStateId(AreaEffectSimulation::AesEffectState_def::EsPrepared);
m_es.impactPosition(Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y()));
m_es.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_es.chargeStruct().chargeTypeId(m_chargeTypeId);
m_es.id = m_aesItemId;
m_es.participantId = m_originatorParticipantId; // In ddsview <not set>
m_es.effectStateId = AreaEffectSimulation::AesEffectState::EsPrepared;
m_es.impactPosition = Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y());
m_es.sampleTime = QDateTime::currentMSecsSinceEpoch();
m_es.chargeStruct.chargeTypeId = m_chargeTypeId;
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle: " << m_es;
if (!m_aesDts->publish(m_es))
@@ -514,13 +514,13 @@ void CesTests::tryCreateExplosionSinglePrepared()
void CesTests::tryCreateExplosionSingle()
{
// tryCreateExplosionSinglePrepared() must be called before!
m_aiv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
m_es.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_es.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_es.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
m_es.sampleTime = QDateTime::currentMSecsSinceEpoch();
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle: " << m_es;
if (!m_aesDts->publish(m_es))
@@ -532,21 +532,21 @@ void CesTests::tryCreateAesItemView()
INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionArea";
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
m_aiv.id(m_aesItemId);
m_aiv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_aiv.aesTypeId(m_aesType);
m_aiv.partyId(5);
m_aiv.aesItemId = m_aesItemId;
m_aiv.id = m_aesItemId;
m_aiv.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
m_aiv.aesTypeId = m_aesType;
m_aiv.partyId = 5;
QPointF bl = m_housePos.geographic(-10, -10);
QPointF tr = m_housePos.geographic(30, 30);
m_aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bl.x(), bl.y()));
m_aiv.boundingBoxTopRight(Core::GeoPosition2D(tr.x(), tr.y()));
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.chargeStruct().chargeTypeId(m_chargeTypeId);
setPos(m_aiv.form(), m_housePos.geographic(-10, -10));
setPos(m_aiv.form(), m_housePos.geographic(-10, 30));
setPos(m_aiv.form(), m_housePos.geographic(30, 30));
setPos(m_aiv.form(), m_housePos.geographic(30, -10));
m_aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bl.x(), bl.y());
m_aiv.boundingBoxTopRight = Core::GeoPosition2D(tr.x(), tr.y());
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
m_aiv.chargeStruct.chargeTypeId = m_chargeTypeId;
setPos(m_aiv.form, m_housePos.geographic(-10, -10));
setPos(m_aiv.form, m_housePos.geographic(-10, 30));
setPos(m_aiv.form, m_housePos.geographic(30, 30));
setPos(m_aiv.form, m_housePos.geographic(30, -10));
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
@@ -556,14 +556,14 @@ void CesTests::tryCreateAesItemView()
void CesTests::tryCreateChargeType()
{
ProjectDataManagement::ChargeType ct;
ct.id(m_chargeTypeId);
ct.properties("{\"impactRadius\":5}");
ct.id = m_chargeTypeId;
ct.properties = "{\"impactRadius\":5}";
DEBUG_LOG(m_logger) << "Publishing ChargeType: " << ct;
if (!m_pdmDts->publish(ct))
failExit("Error publishing ChargeType");
ct.id(40); // old charge type 10040 -> 40, hard-codded?!
ct.properties("{\"impactRadius\":6}");
ct.id = 40; // old charge type 10040 -> 40, hard-codded?!
ct.properties = "{\"impactRadius\":6}";
DEBUG_LOG(m_logger) << "Publishing ChargeType: " << ct;
if (!m_pdmDts->publish(ct))
failExit("Error publishing ChargeType");
@@ -572,25 +572,25 @@ void CesTests::tryCreateChargeType()
void CesTests::tryCreateAesItemViewSingleExplosions()
{
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_aiv.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
m_aiv.aesItemId(m_aesItemId);
m_aiv.id(m_aesItemId);
m_aiv.aesTypeId(AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions);
m_aiv.partyId(5);
m_aiv.aesItemId = m_aesItemId;
m_aiv.id = m_aesItemId;
m_aiv.aesTypeId = AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions;
m_aiv.partyId = 5;
QPointF bl = m_housePos.geographic(-10, -10);
QPointF tr = m_housePos.geographic(30, 30);
m_aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bl.x(), bl.y()));
m_aiv.boundingBoxTopRight(Core::GeoPosition2D(tr.x(), tr.y()));
m_aiv.chargeStruct().chargeTypeId(m_chargeTypeId);
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bl.x(), bl.y());
m_aiv.boundingBoxTopRight = Core::GeoPosition2D(tr.x(), tr.y());
m_aiv.chargeStruct.chargeTypeId = m_chargeTypeId;
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
setPos(m_aiv.form(), m_housePos.geographic(-10, -10));
setPos(m_aiv.form(), m_housePos.geographic(0, 0));
setPos(m_aiv.form(), m_housePos.geographic(5, 5));
setPos(m_aiv.form(), m_housePos.geographic(-10, 10));
setPos(m_aiv.form(), m_housePos.geographic(-10, 20));
setPos(m_aiv.form(), m_housePos.geographic(-10, 30));
setPos(m_aiv.form, m_housePos.geographic(-10, -10));
setPos(m_aiv.form, m_housePos.geographic(0, 0));
setPos(m_aiv.form, m_housePos.geographic(5, 5));
setPos(m_aiv.form, m_housePos.geographic(-10, 10));
setPos(m_aiv.form, m_housePos.geographic(-10, 20));
setPos(m_aiv.form, m_housePos.geographic(-10, 30));
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
@@ -600,21 +600,21 @@ void CesTests::tryCreateAesItemViewSingleExplosions()
void CesTests::tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState desiredState)
{
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
m_aiv.id(m_aesItemId);
m_aiv.aesTypeId(m_aesType);
m_aiv.effectStateId(desiredState);
m_aiv.aesItemId = m_aesItemId;
m_aiv.id = m_aesItemId;
m_aiv.aesTypeId = m_aesType;
m_aiv.effectStateId = desiredState;
QPointF bl = m_housePos.geographic(-10, -10);
QPointF tr = m_housePos.geographic(30, 30);
m_aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bl.x(), bl.y()));
m_aiv.boundingBoxTopRight(Core::GeoPosition2D(tr.x(), tr.y()));
m_aiv.chargeStruct().chargeTypeId(m_chargeTypeId);
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bl.x(), bl.y());
m_aiv.boundingBoxTopRight = Core::GeoPosition2D(tr.x(), tr.y());
m_aiv.chargeStruct.chargeTypeId = m_chargeTypeId;
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
setPos(m_aiv.form(), m_housePos.geographic(3, 3));
setPos(m_aiv.form(), m_housePos.geographic(3, 35));
setPos(m_aiv.form(), m_housePos.geographic(35, 35));
setPos(m_aiv.form(), m_housePos.geographic(35, 3));
setPos(m_aiv.form, m_housePos.geographic(3, 3));
setPos(m_aiv.form, m_housePos.geographic(3, 35));
setPos(m_aiv.form, m_housePos.geographic(35, 35));
setPos(m_aiv.form, m_housePos.geographic(35, 3));
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
@@ -624,22 +624,22 @@ void CesTests::tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState desir
void CesTests::tryCreateAesItemViewSM()
{
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
m_aiv.id(m_aesItemId);
m_aiv.aesTypeId( AreaEffectSimulation::AesType_def::AtMineArea);
m_aiv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_aiv.aesItemId = m_aesItemId;
m_aiv.id = m_aesItemId;
m_aiv.aesTypeId = AreaEffectSimulation::AesType::AtMineArea;
m_aiv.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
QPointF bl = m_housePos.geographic(-10, -10);
QPointF tr = m_housePos.geographic(30, 30);
m_aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bl.x(), bl.y()));
m_aiv.boundingBoxTopRight(Core::GeoPosition2D(tr.x(), tr.y()));
m_aiv.chargeStruct().chargeTypeId(m_chargeTypeId);
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bl.x(), bl.y());
m_aiv.boundingBoxTopRight = Core::GeoPosition2D(tr.x(), tr.y());
m_aiv.chargeStruct.chargeTypeId = m_chargeTypeId;
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
// Position of each mine
setPos(m_aiv.form(), m_housePos.geographic(3, 3));
setPos(m_aiv.form(), m_housePos.geographic(3, 35));
setPos(m_aiv.form(), m_housePos.geographic(35, 35));
setPos(m_aiv.form(), m_housePos.geographic(35, 3));
setPos(m_aiv.form, m_housePos.geographic(3, 3));
setPos(m_aiv.form, m_housePos.geographic(3, 35));
setPos(m_aiv.form, m_housePos.geographic(35, 35));
setPos(m_aiv.form, m_housePos.geographic(35, 3));
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
@@ -651,22 +651,22 @@ void CesTests::tryCreateAesItemViewMA()
INFO_LOG(m_logger) << "trying to send AesItemView AtMineArea";
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
m_aiv.id(m_aesItemId);
m_aiv.aesTypeId(m_aesType);
m_aiv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_aiv.aesItemId = m_aesItemId;
m_aiv.id = m_aesItemId;
m_aiv.aesTypeId = m_aesType;
m_aiv.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
QPointF bl = m_housePos.geographic(-10, -10);
QPointF tr = m_housePos.geographic(30, 30);
m_aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bl.x(), bl.y()));
m_aiv.boundingBoxTopRight(Core::GeoPosition2D(tr.x(), tr.y()));
m_aiv.chargeStruct().chargeTypeId(m_chargeTypeId);
m_aiv.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bl.x(), bl.y());
m_aiv.boundingBoxTopRight = Core::GeoPosition2D(tr.x(), tr.y());
m_aiv.chargeStruct.chargeTypeId = m_chargeTypeId;
m_aiv.sampleTime = QDateTime::currentMSecsSinceEpoch();
// Form of mine Area
setPos(m_aiv.form(), m_housePos.geographic(1, 1));
setPos(m_aiv.form(), m_housePos.geographic(1, 37));
setPos(m_aiv.form(), m_housePos.geographic(37, 37));
setPos(m_aiv.form(), m_housePos.geographic(37, 1));
setPos(m_aiv.form, m_housePos.geographic(1, 1));
setPos(m_aiv.form, m_housePos.geographic(1, 37));
setPos(m_aiv.form, m_housePos.geographic(37, 37));
setPos(m_aiv.form, m_housePos.geographic(37, 1));
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
@@ -679,17 +679,17 @@ void CesTests::tryCreateAesItemViewMA()
void CesTests::tryCreateBorderline()
{
AreaEffectSimulation::Borderline bl;
bl.id(m_aesItemId);
bl.name("Borderline");
bl.operatorId(20);
bl.partyId(1);
bl.effectStateId(AreaEffectSimulation::AesEffectState_def::EsCreated);
bl.id = m_aesItemId;
bl.name = "Borderline";
bl.operatorId = 20;
bl.partyId = 1;
bl.effectStateId = AreaEffectSimulation::AesEffectState::EsCreated;
setPos(bl.segments(), m_housePos.geographic(3, 3));
setPos(bl.segments(), m_housePos.geographic(4, 4));
setPos(bl.segments(), m_housePos.geographic(5, 3));
setPos(bl.segments, m_housePos.geographic(3, 3));
setPos(bl.segments, m_housePos.geographic(4, 4));
setPos(bl.segments, m_housePos.geographic(5, 3));
bl.isDeleted(false);
bl.isDeleted = false;
DEBUG_LOG(m_logger) << "Publishing BorderLine: " << bl;
if (!m_aesDts->publish(bl))
failExit("Error publishing Borderline");
@@ -697,18 +697,18 @@ void CesTests::tryCreateBorderline()
void CesTests::tryCreateMainStructureElement()
{
m_mse.id(555);
m_mse.name("Building 56");
m_mse.isDeleted(false);
m_mse.isUsed(false);
m_mse.description("\"street\":\"Brueggeweg\":\"56\"");
m_mse.structureElementId(1);
m_mse.geoPosition().lat(m_housePos.geographic().y());
m_mse.geoPosition().lon(m_housePos.geographic().x());
m_mse.geoPosition().z(0);
m_mse.angle(318.83);
m_mse.modelId(1337);
m_mse.externalWlsId(0);
m_mse.id = 555;
m_mse.name = "Building 56";
m_mse.isDeleted = false;
m_mse.isUsed = false;
m_mse.description = "\"street\":\"Brueggeweg\":\"56\"";
m_mse.structureElementId = 1;
m_mse.geoPosition.lat = m_housePos.geographic().y();
m_mse.geoPosition.lon = m_housePos.geographic().x();
m_mse.geoPosition.z = 0;
m_mse.angle = 318.83;
m_mse.modelId = 1337;
m_mse.externalWlsId = 0;
DEBUG_LOG(m_logger) << "Publishing MainStructureElement: " << m_mse;
if (!m_ismDts->publish(m_mse))
failExit("Error publishing MainStructureElement");
@@ -717,28 +717,28 @@ void CesTests::tryCreateMainStructureElement()
void CesTests::tryCreateMainFootprint()
{
InfrastructureManagement::MainFootprint mf;
mf.id(555);
mf.isDeleted(false);
mf.isUsed(false);
mf.structureElementId(1);
mf.elements().resize(4);
mf.id = 555;
mf.isDeleted = false;
mf.isUsed = false;
mf.structureElementId = 1;
mf.elements.resize(4);
InfrastructureManagement::FootprintElement elem;
elem.id(1);
elem.relPosition(Core::RelativePosition(0.0, 0.0, 0.0));
mf.elements().push_back(elem);
elem.id = 1;
elem.relPosition = Core::RelativePosition(0.0, 0.0, 0.0);
mf.elements.push_back(elem);
elem.id(2);
elem.relPosition(Core::RelativePosition(10.0, 0.0, 0.0));
mf.elements().push_back(elem);
elem.id = 2;
elem.relPosition = Core::RelativePosition(10.0, 0.0, 0.0);
mf.elements.push_back(elem);
elem.id(3);
elem.relPosition(Core::RelativePosition(10.0, 10.0, 0.0));
mf.elements().push_back(elem);
elem.id = 3;
elem.relPosition = Core::RelativePosition(10.0, 10.0, 0.0);
mf.elements.push_back(elem);
elem.id(4);
elem.relPosition(Core::RelativePosition(0.0, 10.0, 0.0));
mf.elements().push_back(elem);
elem.id = 4;
elem.relPosition = Core::RelativePosition(0.0, 10.0, 0.0);
mf.elements.push_back(elem);
DEBUG_LOG(m_logger) << "Publishing MainFootprint: " << mf;
if (!m_ismDts->publish(mf))
@@ -752,12 +752,12 @@ void CesTests::tryCreateDynamicParticipantData()
ParticipantManagement::DynamicParticipantData dp;
ParticipantManagement::StateInformation si;
si.stateTime(QDateTime::currentMSecsSinceEpoch());
si.vulnerabilityState(ProjectDataManagement::VulnerabilityState_def::CombatReady);
dp.participantId(m_participants[m_participantIndex].participantId);
dp.stateHistory().push_back(si);
si.stateTime = QDateTime::currentMSecsSinceEpoch();
si.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
dp.participantId = m_participants[m_participantIndex].participantId;
dp.stateHistory.push_back(si);
dp.sampleTime(si.stateTime());
dp.sampleTime = si.stateTime;
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData: " << dp;
if (!m_ppmDts->publish(dp))
@@ -773,15 +773,15 @@ void CesTests::tryCreateParticipantPosition()
QPointF posF = m_housePos.geographic(m_participants[m_participantIndex].relX,
m_participants[m_participantIndex].relY);
const Core::GeoPosition pos(Core::GeoPosition(posF.x(), posF.y(), 0));
pp.buildingId(m_buildingId);
pp.participantId(m_participants[m_participantIndex].participantId);
pp.participantTypeId(78);
pp.partyId(5);
pp.buildingId = m_buildingId;
pp.participantId = m_participants[m_participantIndex].participantId;
pp.participantTypeId = 78;
pp.partyId = 5;
m_participantIndex++;
pp.roomId(m_roomId);
pp.sampleTime(QDateTime::currentMSecsSinceEpoch());
pp.pos(pos);
m_expectedPosition[pp.participantId()] = Core::GeoPosition2D(posF.x(), posF.y());
pp.roomId = m_roomId;
pp.sampleTime = QDateTime::currentMSecsSinceEpoch();
pp.pos = pos;
m_expectedPosition[pp.participantId] = Core::GeoPosition2D(posF.x(), posF.y());
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition: " << pp;
if (!m_ppmDts->publish(pp))
@@ -795,23 +795,23 @@ void CesTests::tryCreateBuildingState()
Buildings::BuildingState bs;
Buildings::RoomState rs;
bs.id(m_moutObjectId);
bs.aesId(m_moutObjectId);
bs.originatorParticipantId(2000);
bs.chargeTypeId(m_chargeTypeId);
bs.damagePercent(100);
bs.damagePercentOld(0);
bs.vulnerabilityState(ProjectDataManagement::VulnerabilityState::CatastrophicKill);
bs.id = m_moutObjectId;
bs.aesId = m_moutObjectId;
bs.originatorParticipantId = 2000;
bs.chargeTypeId = m_chargeTypeId;
bs.damagePercent = 100;
bs.damagePercentOld = 0;
bs.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill;
rs.id(m_roomId);
rs.damagePercent(80);
rs.remainingEffectPercent(90);
bs.roomStates().push_back(rs);
rs.id = m_roomId;
rs.damagePercent = 80;
rs.remainingEffectPercent = 90;
bs.roomStates.push_back(rs);
rs.id(m_roomId+1);
rs.damagePercent(80);
rs.remainingEffectPercent(60);
bs.roomStates().push_back(rs);
rs.id = m_roomId+1;
rs.damagePercent = 80;
rs.remainingEffectPercent = 60;
bs.roomStates.push_back(rs);
DEBUG_LOG(m_logger) << "Publishing BuildingState: " << bs;
if (!m_bldDts->publish(bs))
@@ -821,8 +821,8 @@ void CesTests::tryCreateBuildingState()
static inline bool isSamePosition(const Core::GeoPosition2D &p1,
const Core::GeoPosition2D &p2)
{
return (qFuzzyCompare(p1.lat(), p2.lat()) &&
qFuzzyCompare(p1.lon(), p2.lon()));
return (qFuzzyCompare(p1.lat, p2.lat) &&
qFuzzyCompare(p1.lon, p2.lon));
}
// /////////////////////////////////////////////////////
@@ -830,7 +830,7 @@ static inline bool isSamePosition(const Core::GeoPosition2D &p1,
void CesTests::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &cookie,
const Buildings::SendCesHitOnBuildingRequest &request)
{
const QDateTime dateTime(QDateTime::fromMSecsSinceEpoch(request.effectTime()));
const QDateTime dateTime(QDateTime::fromMSecsSinceEpoch(request.effectTime));
// debug und co
m_countHitOnBuildingReply++;
@@ -838,19 +838,19 @@ void CesTests::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &co
<< " request: " << request << ", "
<< dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n";
if (request.buildingId() != m_mse.id())
if (request.buildingId != m_mse.id)
{
failExit(QStringLiteral("Invalid building id %1 - %2").arg(request.buildingId()).arg(m_mse.id()));
failExit(QStringLiteral("Invalid building id %1 - %2").arg(request.buildingId).arg(m_mse.id));
return;
}
if (request.chargeTypeId() != m_chargeTypeId)
if (request.chargeTypeId != m_chargeTypeId)
{
failExit(QStringLiteral("Invalid chargeType id %1 - %2").arg(request.chargeTypeId()).arg(m_chargeTypeId));
failExit(QStringLiteral("Invalid chargeType id %1 - %2").arg(request.chargeTypeId).arg(m_chargeTypeId));
return;
}
if (request.aesId() != m_aesItemId)
if (request.aesId != m_aesItemId)
{
failExit(QStringLiteral("Invalid aes id %1 - %2").arg(request.aesId()).arg(m_aesItemId));
failExit(QStringLiteral("Invalid aes id %1 - %2").arg(request.aesId).arg(m_aesItemId));
return;
}
@@ -859,9 +859,9 @@ void CesTests::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &co
{
case 1:
{
for (const auto &impact : m_aiv.form())
for (const auto &impact : m_aiv.form)
{
if (isSamePosition(impact, request.impactPosition()))
if (isSamePosition(impact, request.impactPosition))
{
if (m_countHitOnBuildingReply == 2)
ExitSuccess();
@@ -872,7 +872,7 @@ void CesTests::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &co
break;
}
case 2:
if (isSamePosition(m_es.impactPosition(), request.impactPosition()))
if (isSamePosition(m_es.impactPosition, request.impactPosition))
ExitSuccess();
else
failExit("Got building hit on unknown position");
@@ -897,11 +897,11 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
}
*/
// debug und co
const QDateTime dateTime(QDateTime::fromMSecsSinceEpoch(request.effectTime()));
const QDateTime dateTime(QDateTime::fromMSecsSinceEpoch(request.effectTime));
DEBUG_LOG(m_logger) << "onSendCesHitRequest" << "\n"
<< " request: " << request << ", "
<< dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n";
if (request.remainEffectPercent())
if (request.remainEffectPercent)
switch (m_testId)
{
@@ -910,11 +910,11 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
case 7:
case 9:
{
if (request.chargeTypeId() != m_chargeTypeId)
failExit(QStringLiteral("Invalid chargeType id %1 - %2").arg(request.chargeTypeId()).arg(m_chargeTypeId));
else if (request.aesId() != m_aesItemId)
failExit(QStringLiteral("Invalid aes id %1 - %2").arg(request.chargeTypeId()).arg(m_chargeTypeId));
else if (isSamePosition(m_expectedPosition.value(request.participantId()), request.position().position()))
if (request.chargeTypeId != m_chargeTypeId)
failExit(QStringLiteral("Invalid chargeType id %1 - %2").arg(request.chargeTypeId).arg(m_chargeTypeId));
else if (request.aesId != m_aesItemId)
failExit(QStringLiteral("Invalid aes id %1 - %2").arg(request.chargeTypeId).arg(m_chargeTypeId));
else if (isSamePosition(m_expectedPosition.value(request.participantId), request.position.position))
ExitSuccess();
else
failExit("Got wrong impact position");
@@ -923,7 +923,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
case 10:
{
// 3 x Enter
if (request.remainEffectPercent() == 1)
if (request.remainEffectPercent == 1)
m_replyEnterFunctionalArea ++;
DEBUG_LOG(m_logger)<< "m_replyEnterFunctionalArea=" << m_replyEnterFunctionalArea;
if (m_replyEnterFunctionalArea == 3)
@@ -948,20 +948,20 @@ void CesTests::checkParticipantEvent()
switch (m_testId)
{
case 8:
expectedType = ProjectDataManagement::PdmEventType::EnterMineArea;
expectedType = ProjectDataManagement::PdmEventType::EventType_MineArea;
break;
case 10:
expectedType = ProjectDataManagement::PdmEventType::EnterFunctionalArea;
expectedType = ProjectDataManagement::PdmEventType::EventType_FunctionalArea;
break;
case 11:
case 12:
expectedType = ProjectDataManagement::PdmEventType::LeaveFunctionalArea;
expectedType = ProjectDataManagement::PdmEventType::EventType_FunctionalArea;
break;
case 13:
expectedType = ProjectDataManagement::PdmEventType::CrossLocalBorderline;
expectedType = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
break;
case 14:
expectedType = ProjectDataManagement::PdmEventType::EnterDangerArea;
expectedType = ProjectDataManagement::PdmEventType::EventType_DangerArea;
break;
default:
// nothing
@@ -977,7 +977,7 @@ void CesTests::checkParticipantEvent()
std::function<bool(const CentralEffectSimulation::ParticipantEvent &data)> cb =
[&bRet, expectedType](const CentralEffectSimulation::ParticipantEvent &pe) -> bool
{
if (pe.eventTypeId() == expectedType)
if (pe.eventTypeId == expectedType)
{
bRet = true;
return true;
@@ -1000,18 +1000,18 @@ void CesTests::checkParticipantEvent()
void CesTests::tryCreateParticipant()
{
ParticipantManagement::Type ty;
ty.id(78);
ty.typeClass(ParticipantManagement::TypeClass_def::WeaponSystem);
ty.id = 78;
ty.typeClass = ParticipantManagement::TypeClass::WeaponSystem;
m_ppmDts->publish(ty);
ParticipantManagement::Participant pt;
pt.id(m_participants[m_participantIndex].participantId);
pt.equipmentNumber(m_participants[m_participantIndex].equipmentNumber);
pt.partyId(4);
pt.typeId(ty.id()); // Leo
pt.isDeleted(false);
pt.isSimulated(false);
pt.equipmentNumber(4711);
pt.id = m_participants[m_participantIndex].participantId;
pt.equipmentNumber = m_participants[m_participantIndex].equipmentNumber;
pt.partyId = 4;
pt.typeId = ty.id; // Leo
pt.isDeleted = false;
pt.isSimulated = false;
pt.equipmentNumber = 4711;
DEBUG_LOG(m_logger) << "Publishing Participant:" << pt;
if (!m_ppmDts->publish(pt))