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
+5
-5
@@ -162,7 +162,7 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId);
|
||||
if (aesType != AreaEffectSimulation::AesType::AtEffectCluster)
|
||||
return;
|
||||
|
||||
@@ -199,7 +199,7 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType;
|
||||
++m_counterDds.cntEffectClusterEffects;
|
||||
|
||||
@@ -387,13 +387,13 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
QString dateTimeString = QDateTime::currentDateTime().toString(QStringLiteral("dd.MM.yyyy hh:mm"));
|
||||
m_reference = dateTimeString;
|
||||
|
||||
if (eaData.effectStart.is_set())
|
||||
if (eaData.effectStart.has_value())
|
||||
INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart.get()).toString();
|
||||
else
|
||||
INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
FlightCurve fc;
|
||||
// if (eaData.flightCurve.is_set())
|
||||
// if (eaData.flightCurve.has_value())
|
||||
// fc = eaData.flightCurve.get();
|
||||
|
||||
QJsonObject obj;
|
||||
@@ -407,7 +407,7 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
obj[QStringLiteral("subTyp")] = 0;
|
||||
obj[QStringLiteral("typ")] = 0;
|
||||
obj[QStringLiteral("useReceived")] = true;
|
||||
obj[QStringLiteral("effectSource")] = ProjectDataManagement::EffectSource::ES_ADLER;
|
||||
obj[QStringLiteral("effectSource")] = static_cast<int>(ProjectDataManagement::EffectSource::ES_ADLER);
|
||||
|
||||
QString propertiesStr = QString::fromStdString(QJsonDocument(obj).toJson(QJsonDocument::Compact).toStdString());
|
||||
|
||||
|
||||
+23
-23
@@ -185,7 +185,7 @@ void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluste
|
||||
|
||||
m_data = data;
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_data.effectStart.is_set())
|
||||
if (m_data.effectStart.has_value())
|
||||
startTimeMsec = m_data.effectStart.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id << ", state=" << m_data.effectStateId
|
||||
@@ -210,7 +210,7 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id << ", aesType=" << aesType;
|
||||
|
||||
switch (aesType) {
|
||||
@@ -233,7 +233,7 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType;
|
||||
++m_counterDds.cntExplosionClusterEffects;
|
||||
|
||||
@@ -442,10 +442,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1104(const QString &eaName)
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 5;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -492,10 +492,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1106(const QString &eaName)
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 6;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -547,10 +547,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForUBAHN(const QString &eaName
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 5;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -600,10 +600,10 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName)
|
||||
eaData.partyId = 2;
|
||||
eaData.participantId = 89;
|
||||
|
||||
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0),
|
||||
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0),
|
||||
Core::GeoPosition2D(0.0, 0.0)});
|
||||
Core::GeoPosition2D(0.0, 0.0)};
|
||||
eaData.impactCount = 4;
|
||||
|
||||
// SubStruct FlightCurve
|
||||
@@ -636,13 +636,13 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName)
|
||||
|
||||
int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionCluster &eaData)
|
||||
{
|
||||
if (eaData.effectStart.is_set())
|
||||
if (eaData.effectStart.has_value())
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart.get()).toString();
|
||||
else
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
FlightCurve fc;
|
||||
if (eaData.flightCurve.is_set())
|
||||
if (eaData.flightCurve.has_value())
|
||||
fc = eaData.flightCurve.get();
|
||||
|
||||
const std::string properties = "{}";
|
||||
@@ -686,7 +686,7 @@ int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionC
|
||||
|
||||
int ModuleTestExplosionCluster::doExplosionClusterSingleEffectOnlyModifyRequest(const ExplosionClusterSingleEffectOnlyRequest &request)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart.get()).toString();
|
||||
else
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
@@ -2071,7 +2071,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = 371; // radius == 25, diameter == 50m
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 500;
|
||||
|
||||
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
@@ -2127,10 +2127,10 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = 374; // 374: isSMArt=true ; radius == 25, diameter == 50m
|
||||
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Vor eaData.flightCurve.is_set()";
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Vor eaData.flightCurve.has_value()";
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve.is_set()";
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve.has_value()";
|
||||
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 500;
|
||||
|
||||
@@ -2407,7 +2407,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 11100; // == 53deg bei 500 m/s -> apo: x: 12211 y/z= 8190
|
||||
eaData.flightCurve.get().launchVelocity = 500;
|
||||
eaData.flightCurve.get().launchAngle = 0; // calculated ; parameter is prepared for ADLER
|
||||
@@ -2464,7 +2464,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 11100; // == 53deg bei 500 m/s -> apo: x: 12211 y/z= 8190
|
||||
eaData.flightCurve.get().launchVelocity = 500;
|
||||
eaData.flightCurve.get().launchAngle = 0; // calculated ; parameter is prepared for ADLER
|
||||
@@ -2489,7 +2489,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
|
||||
|
||||
QTimer::singleShot(2000, this, [this] () { // local static is captured implicit by gcc and for MSVS
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_data.effectStart.is_set())
|
||||
if (m_data.effectStart.has_value())
|
||||
startTimeMsec = m_data.effectStart.get();
|
||||
|
||||
const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch();
|
||||
@@ -2568,7 +2568,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
|
||||
eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact;
|
||||
eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376
|
||||
|
||||
QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!");
|
||||
QVERIFY2(eaData.flightCurve.has_value(), "ERROR, flightCurve() not set !!");
|
||||
eaData.flightCurve.get().requestedRelativePeakHeight = 11100; // == 53deg bei 500 m/s -> apo: x: 12211 y/z= 8190
|
||||
eaData.flightCurve.get().launchVelocity = 500;
|
||||
eaData.flightCurve.get().launchAngle = 0; // calculated ; parameter is prepared for ADLER
|
||||
@@ -2596,7 +2596,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
|
||||
QTimer::singleShot(2000, this, [this] () { // local static is captured implicit by gcc and for MSVS
|
||||
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_data.effectStart.is_set())
|
||||
if (m_data.effectStart.has_value())
|
||||
startTimeMsec = m_data.effectStart.get();
|
||||
|
||||
const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
+3
-3
@@ -126,7 +126,7 @@ void ModuleTestAesOthers::boobyTrapChanged(const BoobyTrap &data, DataModificati
|
||||
|
||||
m_dataBoobyTrap = data;
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_dataBoobyTrap.effectStart.is_set())
|
||||
if (m_dataBoobyTrap.effectStart.has_value())
|
||||
startTimeMsec = m_dataBoobyTrap.effectStart.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id << ", state=" << m_dataBoobyTrap.effectStateId
|
||||
@@ -145,7 +145,7 @@ void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModi
|
||||
|
||||
m_dataOffRouteMine = data;
|
||||
qint64 startTimeMsec = -1;
|
||||
if (m_dataOffRouteMine.effectStart.is_set())
|
||||
if (m_dataOffRouteMine.effectStart.has_value())
|
||||
startTimeMsec = m_dataOffRouteMine.effectStart.get();
|
||||
|
||||
DEBUG_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id << ", state=" << m_dataOffRouteMine.effectStateId
|
||||
@@ -160,7 +160,7 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
|
||||
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId);
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged, aesType=" << aesType;
|
||||
|
||||
switch (aesType)
|
||||
|
||||
+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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -375,7 +375,7 @@ void RecordReplayPluginCustom::removeOld(QMultiMap<long long, T> &map, qint64 de
|
||||
continue;
|
||||
}
|
||||
// keep planned
|
||||
if (!inner.effectStart.is_set())
|
||||
if (!inner.effectStart.has_value())
|
||||
continue;
|
||||
// Remove to old ones
|
||||
if (inner.effectStart.get()+inner.effectDuration < desiredTime - 210*1000 )
|
||||
|
||||
+1
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "trajectory_unit_test.h"
|
||||
#include <utility>
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include <Trajectory/trajectory_helper.h>
|
||||
#include <Trajectory/trajectory_generator.h>
|
||||
#include <Trajectory/trajectory_generator_vulcano.h>
|
||||
|
||||
+15
-15
@@ -21,10 +21,10 @@ Database::AesNContamination nContamination(const AreaEffectSimulation::NContamin
|
||||
dst.id = src.id;
|
||||
dst.chargeTypeId = src.chargeStruct.chargeTypeId;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -44,10 +44,10 @@ Database::AesBCContamination bcContamination(const BCContamination &src)
|
||||
Database::AesBCContamination dst;
|
||||
dst.id = src.id;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -71,10 +71,10 @@ Database::AesExplosionArea explosionArea(const ExplosionArea &src)
|
||||
Database::AesExplosionArea dst;
|
||||
dst.id = src.id;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.impactPosition.ry() = src.area.cornerBottomLeft.lat;
|
||||
@@ -100,10 +100,10 @@ Database::AesExplosionSingle explosionSingle(const ExplosionSingle &src)
|
||||
Database::AesExplosionSingle dst;
|
||||
dst.id = src.id;
|
||||
dst.effectStateId = src.effectStateId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -119,11 +119,11 @@ Database::AesMineArea mineArea(const MineArea &src)
|
||||
Database::AesMineArea dst;
|
||||
dst.id = src.id;
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeStruct.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.density = src.density;
|
||||
dst.width = src.width;
|
||||
dst.layingProcedureTypeId = src.layingProcedureType;
|
||||
|
||||
+3
-3
@@ -70,16 +70,16 @@ static void fillData(const ExplosionSingleCentralModifyRequest &src, Database::A
|
||||
|
||||
fillGeometryData(src, dst);
|
||||
dst.name = QString::fromStdString(src.name());
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = 1000; // 1sec
|
||||
dst.chargeTypeId = src.chargeTypeId();
|
||||
dst.altitude = src.altitude();
|
||||
dst.firePurpose = QString::fromStdString(src.purpose());
|
||||
dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime());
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa();
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.angle = src.angle();
|
||||
dst.fuseTypeId = src.fuseType().underlying();
|
||||
dst.fuseTypeId = src.fuseType();
|
||||
dst.participantId = src.participantId();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ int DtcImplCustom::partyForDusMine(int dusMineId) const
|
||||
auto it = m_mineAreaCont.find(dms.id);
|
||||
if (it == m_mineAreaCont.end())
|
||||
return 1;
|
||||
return it.value().partyId.is_set() ? it.value().partyId.get() : 1;
|
||||
return it.value().partyId.has_value() ? it.value().partyId.get() : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -74,13 +74,13 @@ static void fillData(const AirSupportImpactModifyRequest &src, Database::AesAirS
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = 1000; // 1sec
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.flightTime = src.flightTime;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
}
|
||||
|
||||
void HandlerAirSupportImpact::onAirSupportImpactModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -97,7 +97,7 @@ void HandlerAirSupportImpact::onAirSupportImpactModifyRequest(const rti::core::S
|
||||
|
||||
Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactCreateRequest(const AirSupportImpactModifyRequest &request)
|
||||
{
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtAirSupportImpact)] && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtAirSupportImpact)] && request.effectStart.has_value())
|
||||
{
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << " Too many active air support impacts, request:" << request;
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air support impacts."));
|
||||
@@ -152,7 +152,7 @@ Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactModifyRequest
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtAirSupportImpact)]
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet()
|
||||
&& !ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
+19
-19
@@ -109,34 +109,34 @@ static void fillData(const BCContaminationModifyRequest &src, Database::AesBCCon
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
dst.impactRadius = src.impactRadius;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.weatherSourceId = src.weatherSource;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.upperOffset = src.upperOffset;
|
||||
dst.lowerOffset = src.lowerOffset;
|
||||
|
||||
// weather parameter are delivered, when adding in OC-laptop
|
||||
if (src.weatherPosition.is_set())
|
||||
if (src.weatherPosition.has_value())
|
||||
{
|
||||
dst.weatherPosition.rx() = src.weatherPosition.get().lon;
|
||||
dst.weatherPosition.ry() = src.weatherPosition.get().lat;
|
||||
}
|
||||
else
|
||||
dst.weatherPosition = dst.impactPosition; // initial, is not used during update therefore it's ok here
|
||||
if(src.windSpeed.is_set())
|
||||
if(src.windSpeed.has_value())
|
||||
dst.windSpeed = src.windSpeed.get();
|
||||
if(src.propagationDirection.is_set())
|
||||
if(src.propagationDirection.has_value())
|
||||
dst.propagationDirection = src.propagationDirection.get();
|
||||
if(src.weatherTimestamp.is_set())
|
||||
if(src.weatherTimestamp.has_value())
|
||||
dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.weatherTimestamp.get());
|
||||
else if(src.effectStart.is_set())
|
||||
else if(src.effectStart.has_value())
|
||||
dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.effectStart.get());
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -180,7 +180,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
@@ -208,7 +208,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c
|
||||
}
|
||||
m_objectMap.insert(ifs->id(), ifs);
|
||||
|
||||
if (request.withDangerArea.is_set() && request.withDangerArea.get())
|
||||
if (request.withDangerArea.has_value() && request.withDangerArea.get())
|
||||
{
|
||||
DangerAreaModifyRequest req;
|
||||
req.id = 0;
|
||||
@@ -238,7 +238,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectBCContamination *ifs = nullptr;
|
||||
if (request.externalId.is_set() && request.externalId.get() > 0)
|
||||
if (request.externalId.has_value() && request.externalId.get() > 0)
|
||||
ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId.get(), ret);
|
||||
|
||||
if (!ifs)
|
||||
@@ -252,7 +252,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
Database::AesBCContamination aea(ifs->data());
|
||||
@@ -277,13 +277,13 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
|
||||
if (isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)])
|
||||
/*&& request.effectStart.is_set()*/)
|
||||
/*&& request.effectStart.has_value()*/)
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central B/C or N contamination areas."));
|
||||
}
|
||||
@@ -291,7 +291,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)])
|
||||
/*&& request.effectStart.is_set()*/)
|
||||
/*&& request.effectStart.has_value()*/)
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active B/C or N contamination areas."));
|
||||
}
|
||||
@@ -299,7 +299,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
@@ -361,7 +361,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c
|
||||
ERROR_LOG(m_logger)<<"[bCContaminationModifyRequest] couldn't update danger area: bccontamination.id: "<<ifs->id()
|
||||
<<" dangerArea.name: "<<dangerRequest.name;
|
||||
}
|
||||
else if (request.withDangerArea.is_set() && request.withDangerArea.get())
|
||||
else if (request.withDangerArea.has_value() && request.withDangerArea.get())
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<"[bCContaminationModifyRequest] add new danger area to bcId: " <<ifs->id();
|
||||
DangerAreaModifyRequest newDangerRequest;
|
||||
|
||||
+9
-9
@@ -78,18 +78,18 @@ static void fillData(const BoobyTrapModifyRequest &src, Database::AesBoobyTrap &
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
dst.impactRadius = src.impactRadius;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
//dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
//dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.triggerRadius = src.triggerRadius;
|
||||
dst.rotationAngle = src.rotationAngle.is_set() ? src.rotationAngle.get() : 0;
|
||||
dst.centralAngle = src.centralAngle.is_set() ? src.centralAngle.get() : 0;
|
||||
dst.rotationAngle = src.rotationAngle.has_value() ? src.rotationAngle.get() : 0;
|
||||
dst.centralAngle = src.centralAngle.has_value() ? src.centralAngle.get() : 0;
|
||||
dst.isCentral = true;
|
||||
dst.triggered = false;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void HandlerBoobyTrap::onBoobyTrapModifyRequest(const rti::core::SampleIdentity
|
||||
|
||||
Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapCreateRequest(const BoobyTrapModifyRequest &request)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBoobyTrap)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBoobyTrap)]) && request.effectStart.has_value())
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active booby traps."));
|
||||
|
||||
Database::AesBoobyTrap newData;
|
||||
@@ -153,13 +153,13 @@ Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapModifyRequest(const BoobyTr
|
||||
if (!ifs)
|
||||
return ret;
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtBoobyTrap)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet()
|
||||
/* && !ifs->isObjectModifiable()*/)
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active booby traps."));
|
||||
|
||||
+2
-2
@@ -181,7 +181,7 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf
|
||||
newChargeEffect->init();
|
||||
|
||||
// create trajectory
|
||||
if (request.trajectoryTimeAware.is_set())
|
||||
if (request.trajectoryTimeAware.has_value())
|
||||
{
|
||||
int trajId = m_trajectoryHandler->create(trajectoryData(newChargeEffect->id(), request.trajectoryTimeAware.get()));
|
||||
if (trajId < 0)
|
||||
@@ -252,7 +252,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf
|
||||
reply = chargeEffetObj->update(request);
|
||||
|
||||
// update trajectory
|
||||
if (!reply.error() && request.trajectoryTimeAware.is_set()
|
||||
if (!reply.error() && request.trajectoryTimeAware.has_value()
|
||||
&& m_trajectoryHandler->update(trajectoryData(chargeEffetObj->id(), request.trajectoryTimeAware.get(), m_trajObjIds.value(chargeEffetObj->id(), -1))))
|
||||
{
|
||||
// update failed should the trajectory be created again?
|
||||
|
||||
+8
-8
@@ -91,12 +91,12 @@ Core::FunctionReplyObject HandlerDangerArea::dangerAreaCreateRequest(const Dange
|
||||
if (request.id < 0) // is the id given as negative? set id -> used by OC-Laptop
|
||||
newData.id = request.id;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = request.chargeTypeId;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.is_set() ? request.associatedAesId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.has_value() ? request.associatedAesId.get() : 0;
|
||||
|
||||
|
||||
ObjectDangerArea *ifs(new ObjectDangerArea(m_mainHandler, this));
|
||||
@@ -163,12 +163,12 @@ Core::FunctionReplyObject HandlerDangerArea::dangerAreaModifyRequest(const Dange
|
||||
if (request.id < 0) // is the id given as negative? set id -> used by OC-Laptop
|
||||
newData.id = request.id;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = request.chargeTypeId;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.is_set() ? request.associatedAesId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.associatedAesId = request.associatedAesId.has_value() ? request.associatedAesId.get() : 0;
|
||||
|
||||
return ifs->updateObject(newData, request.segments);
|
||||
}
|
||||
|
||||
+19
-19
@@ -256,7 +256,7 @@ static void fillData(const EffectClusterModifyRequest &src,
|
||||
dst.explosionGeometryId = src.explosionGeometry;
|
||||
dst.tla = src.tla;
|
||||
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
// Effect Duration might be set and will be used for the AutoFire
|
||||
// -- Module Duration
|
||||
if (src.effectDuration)
|
||||
@@ -272,13 +272,13 @@ static void fillData(const EffectClusterModifyRequest &src,
|
||||
|
||||
dst.firePurposeId = src.firePurposeId;
|
||||
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
|
||||
dst.altitude = -1;
|
||||
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
|
||||
dst.properties = QString::fromStdString(src.properties);
|
||||
dst.esmParticipantIds = LtsUtils::IntArray(src.esmParticipantIds);
|
||||
@@ -422,7 +422,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
// external (externalId==0) -> partyId required
|
||||
// We keep the old charge behavior
|
||||
// and also ignore it from ADLER?
|
||||
const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
if (request.effectors.size() == 0)
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Invalid Effector Count"));
|
||||
|
||||
@@ -457,7 +457,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
|
||||
QString chargeName = QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(it.key()).name);
|
||||
QString fireUnitName;
|
||||
if (request.participantId.is_set())
|
||||
if (request.participantId.has_value())
|
||||
fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId.get()).designator);
|
||||
|
||||
if (chargeNeeded > chargeLeft)
|
||||
@@ -477,7 +477,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
|
||||
fillData(request, newData, newEffectorDataVec, m_mainHandler);
|
||||
DEBUG_LOG(m_logger) << "AUTO newData " << newData.impactCount;
|
||||
if (!request.properties.empty() && (!request.effectStart.is_set() || request.effectStart.get() == 0))
|
||||
if (!request.properties.empty() && (!request.effectStart.has_value() || request.effectStart.get() == 0))
|
||||
{
|
||||
newData.isUsingEffectStateReceived = propertiesObject.value(QStringLiteral("useReceived")).toBool();
|
||||
}
|
||||
@@ -512,7 +512,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air supports."));
|
||||
}
|
||||
}
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)]) + (s_currentAirSupportCount) && request.effectStart.is_set())
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)]) + (s_currentAirSupportCount) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -542,8 +542,8 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
// // externalId maybe set be HLA interface:
|
||||
// // from external (externalIdValue>0) -> no partyId required
|
||||
// // from internal (externalIdValue==0) -> partyId required
|
||||
// const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.is_set())
|
||||
// const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.has_value())
|
||||
// return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id."));
|
||||
|
||||
DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart << ", effectDuration :"
|
||||
@@ -573,7 +573,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
const bool bChargeIsAirSupport = (gc == ProjectDataManagement::GearClass::GearClass_AirSupport);
|
||||
ifs->setAirSupportSource(bChargeIsAirSupport);
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable()) // ToDo: check
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable()) // ToDo: check
|
||||
{
|
||||
// Calculate new polygon here. Not nice, though
|
||||
auto poly = Polygons::effectClusterArea(aea);
|
||||
@@ -589,7 +589,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)] + (s_currentAirSupportCount)) && request.effectStart.is_set()
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtEffectCluster)] + (s_currentAirSupportCount)) && request.effectStart.has_value()
|
||||
&& ((wasCentral && !ifs->isActivationTimeSet()) || !wasCentral))
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central effect clusters."));
|
||||
}
|
||||
@@ -719,9 +719,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
// the fire hold with the corresponding target coordinate and circular area.
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const int radius = request.radius.is_set() ? request.radius.get() : 0;
|
||||
const double lonRad = request.longitude.has_value() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const double latRad = request.latitude.has_value() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0;
|
||||
const int radius = request.radius.has_value() ? request.radius.get() : 0;
|
||||
|
||||
DEBUG_LOG(m_logger) << "[Feuer Halt Referenziert] " << "lonRad : " << lonRad << " " << "latRad : " << latRad << " " << "radius : " << radius;
|
||||
|
||||
@@ -749,7 +749,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "[Feuer Einstellen ----- markAsExpired] " << "effectClusterId: " << ifs->data().id;
|
||||
|
||||
ifs->markAsExpired(request.entladenSchuss.is_set() ? request.entladenSchuss.get() : false);
|
||||
ifs->markAsExpired(request.entladenSchuss.has_value() ? request.entladenSchuss.get() : false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -769,9 +769,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl
|
||||
{
|
||||
for (auto *ifs : std::as_const(effectClusterPartyMap))
|
||||
{
|
||||
const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional<lonRad>
|
||||
const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional <latRad>
|
||||
const int radius = request.radius.is_set() ? request.radius.get() : 0;
|
||||
const double lonRad = request.longitude.has_value() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional<lonRad>
|
||||
const double latRad = request.latitude.has_value() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional <latRad>
|
||||
const int radius = request.radius.has_value() ? request.radius.get() : 0;
|
||||
|
||||
DEBUG_LOG(m_logger) << "[Aufheben Feuer Halt Referenziert] " << "lonRad : " << lonRad << " " << "latRad : " << latRad << " " << "radius : " << radius;
|
||||
|
||||
|
||||
+10
-10
@@ -101,21 +101,21 @@ static void fillData(const ExplosionAreaModifyRequest &src, Database::AesExplosi
|
||||
dst.impactPosition.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.rotationAngle = src.area.rotation;
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
dst.impactLength = src.area.height;
|
||||
dst.impactWidth = src.area.width;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.cannonCount = src.cannonCount;
|
||||
dst.cannonRounds = src.cannonRounds;
|
||||
dst.altitude = src.altitude;
|
||||
dst.firePurpose = QString::fromStdString(src.purpose);
|
||||
dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime);
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
}
|
||||
|
||||
void HandlerExplosionArea::onExplosionAreaModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -130,7 +130,7 @@ void HandlerExplosionArea::onExplosionAreaModifyRequest(const rti::core::SampleI
|
||||
|
||||
Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const ExplosionAreaModifyRequest &request)
|
||||
{
|
||||
if (!request.partyId.is_set())
|
||||
if (!request.partyId.has_value())
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id."));
|
||||
|
||||
int chargeNeeded = request.cannonCount * request.cannonRounds;
|
||||
@@ -164,7 +164,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -174,7 +174,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -230,7 +230,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const
|
||||
/*!
|
||||
* Check if the max amount is reached if the effect start added after creation.
|
||||
!*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
@@ -249,7 +249,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
// Calculate new polygon here. Not nice, though
|
||||
@@ -304,7 +304,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyGeometryReque
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet() // if time was not set before change and now check count
|
||||
&& !ifs->isObjectModifiable())
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active explosion areas and explosion singles"));
|
||||
|
||||
+18
-18
@@ -161,7 +161,7 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl
|
||||
dst.explosionGeometryId = src.explosionGeometry;
|
||||
dst.zog = src.tla;
|
||||
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
|
||||
@@ -170,13 +170,13 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl
|
||||
dst.igniterFunctionId = src.chargeStruct.igniterFunctionId;
|
||||
dst.firePurposeId = src.firePurposeId;
|
||||
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : -1; // -1 -> avoid trajectory
|
||||
// dst.firingGeoPosition // not provided, has to be retrieved from dds
|
||||
|
||||
dst.impactCount = src.impactCount;
|
||||
dst.mhpCountRequest = src.mhpCount;
|
||||
if (src.mhpRotation.is_set())
|
||||
if (src.mhpRotation.has_value())
|
||||
dst.mhpRotationRequest = src.mhpRotation.get();
|
||||
else
|
||||
dst.mhpRotationRequest = ObjectExplosionCluster::s_invalid_rotation_angle;
|
||||
@@ -189,7 +189,7 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl
|
||||
// dst.firePurpose = QString::fromStdString(src.purpose());
|
||||
// dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime());
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
|
||||
dst.launchVelocity = src.launchVelocity;
|
||||
dst.launchAngleDeg = src.launchAngleDeg;
|
||||
@@ -321,7 +321,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
// HLA Interface is using externalId...
|
||||
// external (externalId>0) -> no partyId required
|
||||
// external (externalId==0) -> partyId required
|
||||
const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
const ProjectDataManagement::GearClass gearClass = m_mainHandler->gearClassOfChargeTypeId(request.chargeStruct.chargeTypeId);
|
||||
|
||||
const bool bDoClaimPlannedCharge = (request.id == 0) &&
|
||||
@@ -339,7 +339,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
|
||||
QString chargeName= QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(request.chargeStruct.chargeTypeId).name);
|
||||
QString fireUnitName;
|
||||
if (request.participantId.is_set())
|
||||
if (request.participantId.has_value())
|
||||
fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId.get()).designator);
|
||||
|
||||
if (chargeNeeded > chargeLeft)
|
||||
@@ -355,7 +355,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
fillData(request, newData, m_mainHandler);
|
||||
|
||||
if (!request.properties.empty() &&
|
||||
(!request.effectStart.is_set() ||
|
||||
(!request.effectStart.has_value() ||
|
||||
request.effectStart.get() == 0))
|
||||
{
|
||||
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(request.properties)).object();
|
||||
@@ -396,7 +396,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air supports."));
|
||||
}
|
||||
}
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)]) + (s_currentAirSupportCount) && request.effectStart.is_set())
|
||||
else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)]) + (s_currentAirSupportCount) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -406,9 +406,9 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New dec ExplosionCluster: " << totalAreas() << " Max: " << s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)] << " Is Set: " << request.effectStart.is_set();
|
||||
DEBUG_LOG(m_logger) << "New dec ExplosionCluster: " << totalAreas() << " Max: " << s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)] << " Is Set: " << request.effectStart.has_value();
|
||||
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -447,8 +447,8 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
// // externalId maybe set be HLA interface:
|
||||
// // from external (externalIdValue>0) -> no partyId required
|
||||
// // from internal (externalIdValue==0) -> partyId required
|
||||
// const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.is_set())
|
||||
// const int externalIdValue = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
// if (externalIdValue == 0 && !request.partyId.has_value())
|
||||
// return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id."));
|
||||
|
||||
DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart
|
||||
@@ -476,7 +476,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
ifs->setAirSupportSource(bChargeIsAirSupport);
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable()) // ToDo: check
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable()) // ToDo: check
|
||||
{
|
||||
// Calculate new polygon here. Not nice, though
|
||||
auto poly = Polygons::explosionClusterArea(aea);
|
||||
@@ -503,7 +503,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
{
|
||||
// case 1: war zentral && effectStart war nicht gesetzt
|
||||
// case 2: war dezentral && effectStart ist gesetzt.
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)] + (s_currentAirSupportCount)) && request.effectStart.is_set()
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionCluster)] + (s_currentAirSupportCount)) && request.effectStart.has_value()
|
||||
&& ((wasCentral && !ifs->isActivationTimeSet()) || !wasCentral))
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central explosion clusters."));
|
||||
@@ -514,7 +514,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
{
|
||||
// case 1: war dezentral && effectStart war nicht gesetzt
|
||||
// case 2: war zentral && effectStart ist gesetzt.
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.is_set()
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionCluster)]) && request.effectStart.has_value()
|
||||
&& (( !wasCentral && !ifs->isActivationTimeSet()) || wasCentral))
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active explosion clusters."));
|
||||
@@ -523,7 +523,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest
|
||||
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
@@ -580,7 +580,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyGeometr
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.is_set() && !ifs->isObjectModifiable())
|
||||
if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.has_value() && !ifs->isObjectModifiable())
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active explosion areas."));
|
||||
|
||||
// Todo: IsObjectModifiable() ?!?
|
||||
|
||||
+10
-10
@@ -102,17 +102,17 @@ static void fillData(const ExplosionSingleModifyRequest &src, Database::AesExplo
|
||||
|
||||
fillGeometryData(src, dst);
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = 1000; // 1sec
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.altitude = src.altitude;
|
||||
dst.firePurpose = QString::fromStdString(src.purpose);
|
||||
dst.fireRequestTime = QDateTime::fromMSecsSinceEpoch(src.fireRequestTime);
|
||||
dst.effectMarkingInTa = src.effectMarkingInTa;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
}
|
||||
|
||||
void HandlerExplosionSingle::onExplosionSingleModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -145,7 +145,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -155,7 +155,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -192,7 +192,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.is_set())
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart.has_value())
|
||||
// return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active single explosions."));
|
||||
|
||||
Database::AesExplosionSingle aes(ifs->data());
|
||||
@@ -207,7 +207,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c
|
||||
bool wasCentral = ifs->data().isCentral;
|
||||
|
||||
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
@@ -225,7 +225,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c
|
||||
}
|
||||
}
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
@@ -278,7 +278,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyGeometryR
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast<int>(AesType::AtExplosionSingle)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet()
|
||||
&& !ifs->isObjectModifiable())
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active single explosions."));
|
||||
|
||||
+11
-11
@@ -164,16 +164,16 @@ static void fillData(const T &src, Database::AesFunctionalArea &dst)
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.position.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.position.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.length = src.area.height;
|
||||
dst.width = src.area.width;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.pointSymbol = src.pointSymbol.is_set() ? QString::fromStdString(src.pointSymbol.get()) : QString();
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.pointSymbol = src.pointSymbol.has_value() ? QString::fromStdString(src.pointSymbol.get()) : QString();
|
||||
dst.functionalAreaTypeId = src.functionalAreaTypeId;
|
||||
dst.deconMode = src.deconMode;
|
||||
dst.deconTime = src.deconTime;
|
||||
@@ -197,9 +197,9 @@ void HandlerFunctionalArea::onFunctionalAreaModifyRequest(const rti::core::Sampl
|
||||
|
||||
Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(const FunctionalAreaModifyRequest &request)
|
||||
{
|
||||
if (!request.partyId.is_set() && (request.supplyMode != AesOperatingMode::OmWaitingTime))
|
||||
if (!request.partyId.has_value() && (request.supplyMode != AesOperatingMode::OmWaitingTime))
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Functional areas need a party id."));
|
||||
if ((!request.participantId.is_set()) && (request.supplyMode == AesOperatingMode::OmWaitingTime))
|
||||
if ((!request.participantId.has_value()) && (request.supplyMode == AesOperatingMode::OmWaitingTime))
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Functional areas Supply need a participant id."));
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.has_value())
|
||||
{
|
||||
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
@@ -232,7 +232,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtFunctionalArea)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -268,7 +268,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
// if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea] && request.effectStart.is_set() && !ifs->isObjectModifiable())
|
||||
// if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea] && request.effectStart.has_value() && !ifs->isObjectModifiable())
|
||||
// return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active functional areas."));
|
||||
|
||||
// Todo: IsObjectModifiable() ?!?
|
||||
@@ -287,7 +287,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
!*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
@@ -307,7 +307,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
|
||||
|
||||
+8
-8
@@ -97,8 +97,8 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi
|
||||
Database::AesGasPipe newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
|
||||
@@ -115,7 +115,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject();
|
||||
delete ifs;
|
||||
@@ -124,7 +124,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtGasPipe)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject();
|
||||
delete ifs;
|
||||
@@ -159,8 +159,8 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
|
||||
Database::AesGasPipe newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
if (request.id < 0 && checkStateForSfm(ifs))
|
||||
@@ -172,7 +172,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
!*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
|
||||
}
|
||||
//TODO: Implement switch from decentral to central in gasp pipes
|
||||
// // For counting, only Elements being at least prepared are important:
|
||||
// if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
// if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
// {
|
||||
|
||||
// // Calculate new polygon here. Not nice, though
|
||||
|
||||
+24
-24
@@ -203,7 +203,7 @@ int HandlerMineArea::totalAreasCentral() const { return s_areaCountCentral[stati
|
||||
|
||||
template <typename T> T getValueHelper(T in) { return in; }
|
||||
|
||||
template <typename T> T getValueHelper(const dds::core::optional<T> &in) { return in.is_set() ? in.get() : T(); }
|
||||
template <typename T> T getValueHelper(const dds::core::optional<T> &in) { return in.has_value() ? in.get() : T(); }
|
||||
|
||||
template <typename T> static void fillData(const T &src, Database::AesMineArea &dst)
|
||||
{
|
||||
@@ -211,12 +211,12 @@ template <typename T> static void fillData(const T &src, Database::AesMineArea &
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.effectSourceId = src.effectSourceId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeStruct.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.density = src.density;
|
||||
dst.width = src.width;
|
||||
dst.layingProcedureTypeId = src.layingProcedureType;
|
||||
@@ -254,7 +254,7 @@ void HandlerMineArea::onMineAreaModifyRequest(const rti::core::SampleIdentity &c
|
||||
template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateRequest(const T &request)
|
||||
{
|
||||
// if ( !isDusMineArea(request.chargeTypeId())
|
||||
// && (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] && request.effectStart.is_set()))
|
||||
// && (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] && request.effectStart.has_value()))
|
||||
// return Core::FunctionReplyObject(1, tr_lts("dds", "Too many peripheral mine areas."));
|
||||
|
||||
Database::AesMineArea newData;
|
||||
@@ -302,7 +302,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR
|
||||
bool isCentral = ifs->checkIsCentral(_form);
|
||||
if (isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -330,14 +330,14 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
--pzAbwWMiSafe;
|
||||
}
|
||||
|
||||
if (pzAbwWMiSafe < 0)
|
||||
pzAbwWMiSafe = 0;
|
||||
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe && request.effectStart.is_set())
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -347,7 +347,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
++m_totalPzAbwWMis;
|
||||
}
|
||||
}
|
||||
@@ -399,7 +399,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
Database::AesMineArea newData(ifs->data());
|
||||
@@ -423,12 +423,12 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
*/
|
||||
if (!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if (!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] /*&& request.effectStart.is_set()*/)
|
||||
if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast<int>(AesType::AtMineArea)] /*&& request.effectStart.has_value()*/)
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many central mine areas."));
|
||||
|
||||
ret = ifs->checkDensity(newData.density, totalLength, s_maxCentralSingleMinesCount);
|
||||
@@ -454,7 +454,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
if (pzAbwWMiSafe < 0)
|
||||
pzAbwWMiSafe = 0;
|
||||
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe /*&& request.effectStart.is_set()*/)
|
||||
if (totalAreas() >= s_maxActiveAreas[static_cast<int>(AesType::AtMineArea)] - pzAbwWMiSafe /*&& request.effectStart.has_value()*/)
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many peripheral mine areas."));
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
@@ -465,7 +465,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
}
|
||||
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
// Calculate new polygon here. Not nice, though
|
||||
|
||||
@@ -482,7 +482,7 @@ template <typename T> Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR
|
||||
|
||||
if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */)
|
||||
{
|
||||
if (request.effectStart.is_set())
|
||||
if (request.effectStart.has_value())
|
||||
--pzAbwWMiSafe;
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque
|
||||
if (request.mineAreaId == 0)
|
||||
{
|
||||
// If single mine...
|
||||
if (request.mineId.is_set())
|
||||
if (request.mineId.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Checking in DUS-Mine-Areas";
|
||||
bool found = false;
|
||||
@@ -638,7 +638,7 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque
|
||||
return Core::FunctionReplyObject(request.mineAreaId, tr_lts("dds", "Mine area with id %1 not found.")).arg(request.mineAreaId);
|
||||
|
||||
bool bOk;
|
||||
if (request.mineId.is_set())
|
||||
if (request.mineId.has_value())
|
||||
bOk = ifs->resetMine(request.mineId.get());
|
||||
else
|
||||
bOk = ifs->resetMines();
|
||||
@@ -658,9 +658,9 @@ void HandlerMineArea::onMineTriggered(const TrainingAreaBase::MineTriggered &dat
|
||||
mtr.mineAreaId = data.mineAreaId;
|
||||
// from tab - mine area mine index starts at 1 ...
|
||||
mtr.mineId = data.mineAreaId == 0 ? data.mineIndex : data.mineIndex - 1;
|
||||
if (data.position.is_set())
|
||||
if (data.position.has_value())
|
||||
mtr.position = data.position.get();
|
||||
if (data.chargeTypeId.is_set())
|
||||
if (data.chargeTypeId.has_value())
|
||||
mtr.chargeTypeId = data.chargeTypeId.get();
|
||||
|
||||
auto ret = mineTriggeredRequest(mtr);
|
||||
@@ -680,14 +680,14 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "mineTriggeredRequest: " << request;
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as MineTriggeredRequest does not contain values
|
||||
if (request.mineAreaId == 0 || (request.chargeTypeId.is_set() && isConcreteMine(request.chargeTypeId.get(), 0, 0)))
|
||||
if (request.mineAreaId == 0 || (request.chargeTypeId.has_value() && isConcreteMine(request.chargeTypeId.get(), 0, 0)))
|
||||
{
|
||||
int chargeTypeId = request.chargeTypeId.is_set() ? request.chargeTypeId.get() : 0;
|
||||
int chargeTypeId = request.chargeTypeId.has_value() ? request.chargeTypeId.get() : 0;
|
||||
|
||||
// DUS Mines:
|
||||
// NOTE: igniterType/IgniterFunciton = 0 as long as MineTriggeredRequest does not contain values
|
||||
QPointF position;
|
||||
if (request.position.is_set() && !isFromMineLayer(chargeTypeId, 0, 0))
|
||||
if (request.position.has_value() && !isFromMineLayer(chargeTypeId, 0, 0))
|
||||
{
|
||||
position.setX(request.position.get().lon);
|
||||
position.setY(request.position.get().lat);
|
||||
@@ -748,7 +748,7 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge
|
||||
|
||||
if (mine.id != 0) // mine did exist already
|
||||
{
|
||||
if (request.position.is_set()) // update position
|
||||
if (request.position.has_value()) // update position
|
||||
mine.position = position;
|
||||
}
|
||||
|
||||
@@ -1444,7 +1444,7 @@ QPolygonF HandlerMineArea::msGetBoundingBoxPolygon(const QPolygonF &minen, doubl
|
||||
|
||||
bool HandlerMineArea::triggerUnpairedMine(const MineTriggeredRequest &request)
|
||||
{
|
||||
if (!request.position.is_set())
|
||||
if (!request.position.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " failed, because there is no position.";
|
||||
|
||||
|
||||
+11
-11
@@ -94,7 +94,7 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe
|
||||
if (data.operationalState == MRF_RAEUMEN)
|
||||
{
|
||||
auto it = m_corridorCreators.constFind(data.equipmentNumber);
|
||||
if (data.position.is_set())
|
||||
if (data.position.has_value())
|
||||
{
|
||||
MineCorridorCreator *mcc = nullptr;
|
||||
if (it == m_corridorCreators.constEnd())
|
||||
@@ -170,14 +170,14 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorCreateRequest(const M
|
||||
Database::AesMineCorridor newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = 315;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.effectSourceId = request.effectSourceId;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.externalId = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
newData.externalId = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
|
||||
ObjectMineCorridor *ifs(new ObjectMineCorridor(m_mainHandler, this));
|
||||
|
||||
@@ -201,7 +201,7 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorModifyRequest(const M
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectMineCorridor *ifs = nullptr;
|
||||
if (request.externalId.is_set() && request.externalId.get() > 0)
|
||||
if (request.externalId.has_value() && request.externalId.get() > 0)
|
||||
ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId.get(), ret);
|
||||
|
||||
if (!ifs)
|
||||
@@ -215,19 +215,19 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorModifyRequest(const M
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
Database::AesMineCorridor newData(ifs->data());
|
||||
newData.id = request.id;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.effectStart = request.effectStart.is_set() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.effectStart = request.effectStart.has_value() && request.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(request.effectStart.get()) : QDateTime();
|
||||
newData.chargeTypeId = 315;
|
||||
newData.effectDuration = request.effectDuration;
|
||||
newData.partyId = request.partyId.is_set() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.is_set() ? request.participantId.get() : 0;
|
||||
newData.partyId = request.partyId.has_value() ? request.partyId.get() : 0;
|
||||
newData.participantId = request.participantId.has_value() ? request.participantId.get() : 0;
|
||||
newData.width = request.width;
|
||||
newData.externalId = request.externalId.is_set() ? request.externalId.get() : 0;
|
||||
newData.externalId = request.externalId.has_value() ? request.externalId.get() : 0;
|
||||
if (request.id < 0 && checkStateForSfm(ifs))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Overwrite mine corridor Effect State for OC";
|
||||
|
||||
+11
-11
@@ -115,7 +115,7 @@ static void fillData(const NContaminationModifyRequest &src, Database::AesNConta
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.impactPosition.lon;
|
||||
dst.impactPosition.ry() = src.impactPosition.lat;
|
||||
@@ -125,10 +125,10 @@ static void fillData(const NContaminationModifyRequest &src, Database::AesNConta
|
||||
dst.spanAngle = src.spanAngle;
|
||||
dst.rotationAngle = src.rotationAngle;
|
||||
dst.detonationValue = src.detonationValue;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
dst.weatherSourceId = src.weatherSource;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con
|
||||
|
||||
if (ifs->data().isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -173,7 +173,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.is_set())
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) && request.effectStart.has_value())
|
||||
{
|
||||
ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct
|
||||
ifs->removeObjectFromDb();
|
||||
@@ -212,7 +212,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
// vorher noch ohne Wirkbeginn
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination]) && request.effectStart.is_set() && !ifs->isObjectModifiable())
|
||||
// if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination]) && request.effectStart.has_value() && !ifs->isObjectModifiable())
|
||||
// return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active N contamination areas."));
|
||||
|
||||
Database::AesNContamination aea(ifs->data());
|
||||
@@ -229,25 +229,25 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con
|
||||
/*!
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
*/
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.is_set())
|
||||
if(!ifs->isActivationTimeSet() && request.effectStart.has_value())
|
||||
{
|
||||
if (isCentral)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.is_set()*/)
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.has_value()*/)
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central N or B/C contamination areas."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.is_set()*/) // upper if-condition handle start-time
|
||||
if (totalAreas() >= (s_maxActiveAreas[static_cast<int>(AesType::AtNContamination)] + s_maxActiveAreas[static_cast<int>(AesType::AtBCContamination)]) /*&& request.effectStart.has_value()*/) // upper if-condition handle start-time
|
||||
{
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active N or B/C contamination areas."));
|
||||
}
|
||||
}
|
||||
}
|
||||
// For counting, only Elements being at least prepared are important:
|
||||
if (request.effectStart.is_set() && ifs->isObjectModifiable())
|
||||
if (request.effectStart.has_value() && ifs->isObjectModifiable())
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "isCentral: " << isCentral;
|
||||
|
||||
+8
-8
@@ -76,20 +76,20 @@ static void fillData(const OffRouteMineModifyRequest &src, Database::AesOffRoute
|
||||
dst.id = src.id;
|
||||
|
||||
dst.name = QString::fromStdString(src.name);
|
||||
dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectDuration = src.effectDuration;
|
||||
dst.impactPosition.rx() = src.area.cornerBottomLeft.lon;
|
||||
dst.impactPosition.ry() = src.area.cornerBottomLeft.lat;
|
||||
dst.width = src.area.width;
|
||||
dst.length = src.area.height;
|
||||
dst.rotationAngle = src.area.rotation;
|
||||
dst.impactRadius = src.impactRadius.is_set() ? src.impactRadius.get() : 0;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.impactRadius = src.impactRadius.has_value() ? src.impactRadius.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.chargeTypeId = src.chargeTypeId;
|
||||
dst.isCentral = true;
|
||||
dst.triggered = false;
|
||||
//dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0;
|
||||
//dst.participantId = src.participantId.has_value() ? src.participantId.get() : 0;
|
||||
//dst.externalId = src.externalId.has_value() ? src.externalId.get() : 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void HandlerOffRouteMine::onOffRouteMineModifyRequest(const rti::core::SampleIde
|
||||
|
||||
Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineCreateRequest(const OffRouteMineModifyRequest &request)
|
||||
{
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtOffRouteMine)]) && request.effectStart.is_set())
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtOffRouteMine)]) && request.effectStart.has_value())
|
||||
return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active off route mines."));
|
||||
|
||||
Database::AesOffRouteMine newData;
|
||||
@@ -143,7 +143,7 @@ Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineModifyRequest(const O
|
||||
if (!ifs)
|
||||
return ret;
|
||||
|
||||
if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
if (request.effectStart.has_value() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch()))
|
||||
return removeObject(ifs);
|
||||
|
||||
// Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war
|
||||
@@ -152,7 +152,7 @@ Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineModifyRequest(const O
|
||||
* If the effect start added after creation, the max amount need to be checked
|
||||
!*/
|
||||
if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast<int>(AesType::AtOffRouteMine)])
|
||||
&& request.effectStart.is_set()
|
||||
&& request.effectStart.has_value()
|
||||
&& !ifs->isActivationTimeSet() // check if time before change was not setted.
|
||||
/*&& !ifs->isObjectModifiable()*/)
|
||||
{
|
||||
|
||||
+2
-2
@@ -65,9 +65,9 @@ static void fillData(const ReconAreaModifyRequest &src, Database::AesReconArea &
|
||||
dst.height = src.area.height;
|
||||
dst.width = src.area.width;
|
||||
dst.effectMarkingInTa = false;
|
||||
dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.effectStart = src.effectStart.has_value() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime();
|
||||
dst.participantId = src.participantId;
|
||||
dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0;
|
||||
dst.partyId = src.partyId.has_value() ? src.partyId.get() : 0;
|
||||
dst.purpose = QString::fromStdString(src.purpose);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -178,12 +178,12 @@ Core::FunctionReplyObject ObjectExplosionArea::resumePause(const ExplosionAreaPa
|
||||
{
|
||||
if (req.resumeExecution)
|
||||
{
|
||||
if (req.timeToResume.is_set())
|
||||
if (req.timeToResume.has_value())
|
||||
m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume.get());
|
||||
else
|
||||
m_data.effectStart = partitionTime();
|
||||
|
||||
if (req.remainingDuration.is_set())
|
||||
if (req.remainingDuration.has_value())
|
||||
m_data.effectDuration = req.remainingDuration.get();
|
||||
|
||||
// req.resumeSeed() currently not used, as it is calculated internaly. maybe in the future
|
||||
|
||||
+3
-3
@@ -744,12 +744,12 @@ Core::FunctionReplyObject ObjectExplosionCluster::resumePause(const ExplosionClu
|
||||
// if (req.resumeExecution())
|
||||
// {
|
||||
// // resume
|
||||
// if (req.timeToResume.is_set())
|
||||
// if (req.timeToResume.has_value())
|
||||
// m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume.get());
|
||||
// else
|
||||
// m_data.effectStart = partitionTime();
|
||||
|
||||
// if (req.remainingDuration.is_set())
|
||||
// if (req.remainingDuration.has_value())
|
||||
// m_data.effectDuration = req.remainingDuration.get();
|
||||
|
||||
// // req.resumeSeed() currently not used, as it is calculated internaly. maybe in the future
|
||||
@@ -1887,7 +1887,7 @@ void ObjectExplosionCluster::checkNextFire()
|
||||
// continue;
|
||||
|
||||
// SingleEffect &ref = singleEffectsRef[idx];
|
||||
// if (ref.singleEffectState().underlying() != AesSingleEffectState::SesTriggered)
|
||||
// if (ref.singleEffectState() != AesSingleEffectState::SesTriggered)
|
||||
// {
|
||||
// ref.singleEffectState(AesSingleEffectState::SesTriggered);
|
||||
// ref.singleEffectTime(curPartTime);
|
||||
|
||||
Reference in new issue
Block a user