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:
1718 files changed
+126739
-18495
No files matched your search
+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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user