diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h index 21a52f91f..6f05ffb72 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h @@ -36,7 +36,6 @@ class AesInfoDialog : public LtsWidgets::LtsDialog, } private: - NGL::INGLLogger& m_logger; void retranslate() override; void handleNContamination(const AesItemView& aesItemView); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp index ab50de781..41b74b42e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp @@ -57,9 +57,9 @@ bool AbstractFiringStrategy::calculateDispersionTrajectory() LtsUtils::QPoint3D newTarget = intendendTrajectory.last().position; - const int scatterLength = qRound(m_effector->effectorData().mhpScatterLenght()); + const int scatterLength = qRound(m_effector->effectorData().mhpScatterLenght); const int randomValueX = QRandomGenerator::global()->bounded(-scatterLength, scatterLength + 1); - const int scatterWidth = qRound(m_effector->effectorData().mhpScatterWidth()); + const int scatterWidth = qRound(m_effector->effectorData().mhpScatterWidth); const int randomValueY = QRandomGenerator::global()->bounded(-scatterWidth, scatterWidth + 1); newTarget.setX(newTarget.x() + randomValueX); newTarget.setY(newTarget.y() + randomValueY); @@ -90,7 +90,7 @@ std::vector AbstractFiringStrategy::buildTrajecto // setup some vars of effector, which is used as launch position: Core::GeoPosition effectorPositionGeo = participantPosition(m_effector->participantId()); - const LtsCoordTrans::UtmCoordinate &launchUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(effectorPositionGeo.lon(), effectorPositionGeo.lat()); + const LtsCoordTrans::UtmCoordinate &launchUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(effectorPositionGeo.lon, effectorPositionGeo.lat); std::vector geometry; @@ -112,7 +112,7 @@ std::vector AbstractFiringStrategy::buildTrajecto const QPointF &trajPntAbsGeo = trajPntAbsUtm.geographic(); // Position des Participants mit der m_participantId - const double zValue = effectorPositionGeo.z() + trajPntRelPos.position.z(); // trajPntRelPos.position.z() ist die Hoehe + const double zValue = effectorPositionGeo.z + trajPntRelPos.position.z(); // trajPntRelPos.position.z() ist die Hoehe DEBUG_LOG(m_logger) << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo; geometry.emplace_back(Core::GeoPositionRelativeTime(trajPntAbsGeo.x(), trajPntAbsGeo.y(), zValue, trajPntRelPos.time)); @@ -131,13 +131,13 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std:: } TrajectoryTimeAware trajectory; - trajectory.trajectoryStartTime(trajectoryStartTime); + trajectory.trajectoryStartTime = trajectoryStartTime; - trajectory.index(index); // see SituationMap : charge_effect_to_map ::updateSingleTrajectory() + trajectory.index = index; // see SituationMap : charge_effect_to_map ::updateSingleTrajectory() // [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) - trajectory.originatorId(m_effector->aesItemId()); - trajectory.originatorTypeId(ProjectDataManagement::StateChangeOriginator::ChargeEffect); - trajectory.geometry(trajectoryGeometry); + trajectory.originatorId = m_effector->aesItemId(); + trajectory.originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ChargeEffect; + trajectory.geometry = trajectoryGeometry; return trajectory; } @@ -145,7 +145,7 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto { DEBUG_LOG(m_logger) << "sendChargeEffect"; - const auto trajGeometry = trajectoryTimeAware.geometry(); + const auto trajGeometry = trajectoryTimeAware.geometry; // sanity check: if (trajGeometry.size() < 2) @@ -155,24 +155,24 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto return -1; } - const qint64 trajectoryStartTime = trajectoryTimeAware.trajectoryStartTime(); + const qint64 trajectoryStartTime = trajectoryTimeAware.trajectoryStartTime; ChargeEffectModifyRequest chargeEffect; - chargeEffect.id(0); - chargeEffect.effectDuration(3000); - chargeEffect.name("Schuss"); - chargeEffect.chargeTypeId(m_effector->effectorData().chargeStruct().chargeTypeId()); - chargeEffect.effectStart(trajectoryStartTime + trajectoryTimeAware.geometry().back().relativeTime()); // Einschlag Zeit - chargeEffect.igniterTypeId(m_effector->effectorData().chargeStruct().igniterTypeId()); - chargeEffect.gearTypeId(gearTypeId(m_effector->effectorData().chargeStruct().chargeTypeId(), m_effector->participantId())); - chargeEffect.originatorId(m_effector->aesItemId()); - chargeEffect.originatorTypeId(ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation); - chargeEffect.properties(QJsonDocument(properties).toJson().toStdString()); + chargeEffect.id = 0; + chargeEffect.effectDuration = 3000; + chargeEffect.name = "Schuss"; + chargeEffect.chargeTypeId = m_effector->effectorData().chargeStruct.chargeTypeId; + chargeEffect.effectStart = trajectoryStartTime + trajectoryTimeAware.geometry.back().relativeTime; // Einschlag Zeit + chargeEffect.igniterTypeId = m_effector->effectorData().chargeStruct.igniterTypeId; + chargeEffect.gearTypeId(gearTypeId(m_effector->effectorData().chargeStruct.chargeTypeId, m_effector->participantId())); + chargeEffect.originatorId = m_effector->aesItemId(); + chargeEffect.originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation; + chargeEffect.properties = QJsonDocument(properties).toJson().toStdString(); const Core::GeoPosition &impactPosition = trajGeometry.back(); - chargeEffect.position(impactPosition); // Impact Position + chargeEffect.position = impactPosition; // Impact Position - chargeEffect.trajectoryTimeAware(trajectoryTimeAware); + chargeEffect.trajectoryTimeAware = trajectoryTimeAware; const auto &reply = m_effector->mainHandler()->chargeEffectHandler()->createChargeEffect(chargeEffect); DEBUG_LOG(m_logger) << LOGFUNCTION << " reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId(); @@ -183,7 +183,7 @@ Core::GeoPosition AbstractFiringStrategy::participantPosition(int participantId) { m_effector->mainHandler()->dds()->ppmDtc()->enableParticipantPosition(true); const ParticipantManagement::ParticipantPosition &pos = m_effector->mainHandler()->dds()->ppmDtc()->participantPosition(participantId); - return pos.pos(); + return pos.pos; } int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId) @@ -194,17 +194,17 @@ int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId) m_effector->mainHandler()->dds()->ppmDtc()->enableDynamicParticipantData(true); m_effector->mainHandler()->dds()->ppmDtc()->waitForHistoricalDataDynamicParticipantData(1000); const ParticipantManagement::DynamicParticipantData &dynamicParticipantData = m_effector->mainHandler()->dds()->ppmDtc()->dynamicParticipantData(participantId); - DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear().size(); + DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear.size(); - const auto& participantData_gear = dynamicParticipantData.gear(); + const auto& participantData_gear = dynamicParticipantData.gear; for (const auto &gear : qAsConst(participantData_gear)) { - DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId; - if (gear.chargeTypeId() == chargeTypeId) + DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId << ", chargeTypeId:" << chargeTypeId; + if (gear.chargeTypeId == chargeTypeId) { - DEBUG_LOG(m_logger) << "getGearTypeId return: " << gear.gearTypeId(); - if (gear.gearTypeId() != 0) - return gear.gearTypeId(); + DEBUG_LOG(m_logger) << "getGearTypeId return: " << gear.gearTypeId; + if (gear.gearTypeId != 0) + return gear.gearTypeId; else return 701; // MALTE XKCD } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/default_firing_strategy.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/default_firing_strategy.cpp index 399709028..090146f97 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/default_firing_strategy.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/default_firing_strategy.cpp @@ -54,7 +54,7 @@ bool DefaultFiringStrategy::doFiring() // 3b: buildTrajectoryTimeAware const auto trajTimeAware = buildTrajectoryTimeAware(geometry, trajectoryStartTime); // to be bullet-proof: - if (trajTimeAware.geometry().size() < 2) + if (trajTimeAware.geometry.size() < 2) { ERROR_LOG(m_logger) << LOGFUNCTION << " trajTimeAware is empty"; return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/dm72_firing_strategy.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/dm72_firing_strategy.cpp index 0ed801a78..b874ba338 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/dm72_firing_strategy.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/dm72_firing_strategy.cpp @@ -79,12 +79,12 @@ void Dm72FiringStrategy::init() bool bOk = false; WirkmittelFeuerkommandoRakete wirkmittel; - const std::string propertiesStdStr = m_effector->effectorData().properties(); + const std::string propertiesStdStr = m_effector->effectorData().properties; DEBUG_LOG(m_logger) << LOGFUNCTION << " START" << ", propertiesStdStr= '" << propertiesStdStr << "'"; const QJsonObject properties = QJsonDocument::fromJson(QByteArray::fromStdString(propertiesStdStr)).object(); const Core::GeoPosition geoStartPos = participantPosition(m_effector->participantId()); - const UtmCoordinate utmStartPos = UtmCoordinate::fromGeographic(geoStartPos.lon(), geoStartPos.lat()); + const UtmCoordinate utmStartPos = UtmCoordinate::fromGeographic(geoStartPos.lon, geoStartPos.lat); wirkmittelFeuerkommandoRaketeFromJson(properties, wirkmittel, bOk); @@ -129,9 +129,9 @@ QVector Dm72FiringStrategy::mineLayingCentroids() const { using namespace LtsCoordTrans; - const int chargeTypeId = m_effector->effectorData().chargeStruct().chargeTypeId(); + const int chargeTypeId = m_effector->effectorData().chargeStruct.chargeTypeId; const ProjectDataManagement::ChargeType &chargeType = m_effector->mainHandler()->dds()->pdmDtc()->chargeType(chargeTypeId); - const QJsonObject chargeTypeProperties = QJsonDocument::fromJson(QByteArray::fromStdString(chargeType.properties())).object(); + const QJsonObject chargeTypeProperties = QJsonDocument::fromJson(QByteArray::fromStdString(chargeType.properties)).object(); const QJsonObject mineLaying = chargeTypeProperties.value(QStringLiteral("mineLaying")).toObject(); const QJsonArray mineLayingPattern = mineLaying.value(QStringLiteral("pattern")).toArray(); /* QMap is used here because it sort its entries by key. @@ -139,8 +139,8 @@ QVector Dm72FiringStrategy::mineLayingCentroids() const * automatically sorts the pattern. */ QMap centroidsMap; - const UtmCoordinate mhpUtm = UtmCoordinate::fromGeographic(m_effector->effectorData().mhpPosition().lon(), - m_effector->effectorData().mhpPosition().lat()); + const UtmCoordinate mhpUtm = UtmCoordinate::fromGeographic(m_effector->effectorData().mhpPosition.lon, + m_effector->effectorData().mhpPosition.lat); const double rotationAngle = angleToMhpUtm(mhpUtm.toPoint()); QTransform rotation; @@ -193,7 +193,7 @@ QVector Dm72FiringStrategy::mineLayingCentroids() const double Dm72FiringStrategy::angleToMhpUtm(const QPointF &mhpUtm) const { const ParticipantManagement::ParticipantPosition &ownPosition = m_effector->mainHandler()->dds()->ppmDtc()->participantPosition(m_effector->participantId()); - const LtsCoordTrans::UtmCoordinate ownPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(ownPosition.pos().lon(), ownPosition.pos().lat()); + const LtsCoordTrans::UtmCoordinate ownPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(ownPosition.pos.lon, ownPosition.pos.lat); const double angle = QLineF(mhpUtm, ownPositionUtm.toPoint()).angle(); double northAngle = 90 - angle; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/firing_strategy_factory.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/firing_strategy_factory.cpp index e40a9211e..58a7232a0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/firing_strategy_factory.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/firing_strategy_factory.cpp @@ -30,19 +30,19 @@ AbstractFiringStrategy *createFiringStrategy(ObjectEffector *parent) if (!parent) return nullptr; - const ChargeStruct &cs = parent->effectorData().chargeStruct(); + const ChargeStruct &cs = parent->effectorData().chargeStruct; DEBUG_LOG(logger) << LOGFUNCTION << " ChargeStruct = " << cs; // GMLRS - if (parent->mainHandler()->dds()->pdmDtc()->isGmlrs(cs.chargeTypeId())) + if (parent->mainHandler()->dds()->pdmDtc()->isGmlrs(cs.chargeTypeId)) { TRACE_LOG(logger) << LOGFUNCTION << " END"; return new GmlrsFiringStrategy(parent); } // SMArt - const bool bIsSmart = parent->mainHandler()->dds()->pdmDtc()->isSmart(cs.chargeTypeId(), cs.igniterTypeId(), cs.igniterFunctionId()); + const bool bIsSmart = parent->mainHandler()->dds()->pdmDtc()->isSmart(cs.chargeTypeId, cs.igniterTypeId, cs.igniterFunctionId); if (bIsSmart) { TRACE_LOG(logger) << LOGFUNCTION << " END"; @@ -50,7 +50,7 @@ AbstractFiringStrategy *createFiringStrategy(ObjectEffector *parent) } // DM72 - if (parent->mainHandler()->dds()->pdmDtc()->isDm72(cs.chargeTypeId())) + if (parent->mainHandler()->dds()->pdmDtc()->isDm72(cs.chargeTypeId)) { TRACE_LOG(logger) << LOGFUNCTION << " END"; return new Dm72FiringStrategy(parent); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/gmlrs_firing_strategy.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/gmlrs_firing_strategy.cpp index 05a6dd0a4..44de830de 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/gmlrs_firing_strategy.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/gmlrs_firing_strategy.cpp @@ -66,9 +66,9 @@ void GmlrsFiringStrategy::init() m_impactPointIndex = 0; m_impactPoints.clear(); - const QJsonObject &properties = QJsonDocument::fromJson(QByteArray::fromStdString(m_effector->effectorData().properties())).object(); + const QJsonObject &properties = QJsonDocument::fromJson(QByteArray::fromStdString(m_effector->effectorData().properties)).object(); const Core::GeoPosition &geoStartPos = participantPosition(m_effector->participantId()); - const LtsCoordTrans::UtmCoordinate &utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoStartPos.lon(), geoStartPos.lat()); + const LtsCoordTrans::UtmCoordinate &utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoStartPos.lon, geoStartPos.lat); bool bOk = false; WirkmittelFeuerkommandoRakete wirkmittel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp index ef2fc6756..398f31f94 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp @@ -61,13 +61,13 @@ double distanceMeter(const LtsCoordTrans::UtmCoordinate &utmCoord1, const LtsCoo double distanceMeter(const Core::GeoPosition &geoPos, const LtsCoordTrans::UtmCoordinate &utmCoord) { - const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat()); + const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat); return distanceMeter(utmPos, utmCoord); } double distanceMeter(const Core::GeoPosition2D &geoPos2D, const LtsCoordTrans::UtmCoordinate &utmCoord) { - const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos2D.lon(), geoPos2D.lat()); + const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos2D.lon, geoPos2D.lat); return distanceMeter(utmPos, utmCoord); } @@ -136,10 +136,10 @@ void ModuleTestEffectCluster::onModifyParticipantDataReply(const Core::FunctionR int participantId = it->toInt(); DEBUG_LOG(m_logger) << "participantId=" << participantId; ParticipantManagement::Participant participant = m_ppmDtc->participant(participantId); - if (m_ppmDtc->type(participant.typeId()).typeClass().underlying() != ParticipantManagement::TypeClass::Unit) + if (m_ppmDtc->type(participant.typeId).typeClass != ParticipantManagement::TypeClass::Unit) { DEBUG_LOG(m_logger) << "m_participant1.id=" << participantId; - m_participant1.id(participantId); // wichtig zum loeschen + m_participant1.id = participantId; // wichtig zum loeschen DEBUG_LOG(m_logger) << "m_participantId keine Unit=" << participantId; setParticipantPos(participantId); setEquipmentGearCharge(participantId); @@ -151,7 +151,7 @@ void ModuleTestEffectCluster::onModifyParticipantDataReply(const Core::FunctionR else { DEBUG_LOG(m_logger) << "m_participant0.id=" << participantId; - m_participant0.id(participantId); // wichtig zum loeschen + m_participant0.id = participantId; // wichtig zum loeschen } } } @@ -161,23 +161,23 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie if (modType == DataModification::eRemoved) return; - AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying(); - if (aesType != AreaEffectSimulation::AesType_def::AtEffectCluster) + AreaEffectSimulation::AesType::type aesType = aesItemView.aesTypeId().underlying(); + if (aesType != AreaEffectSimulation::AesType::AtEffectCluster) return; - if (aesItemView.aesItemId() != m_aesItemId) + if (aesItemView.aesItemId != m_aesItemId) return; DEBUG_LOG(m_logger) << " got onAesItemViewChanged: " - << ", aesItemId=" << aesItemView.aesItemId() << ", aesType=" << aesType << ", effectStateId=" << aesItemView.effectStateId(); + << ", aesItemId=" << aesItemView.aesItemId << ", aesType=" << aesType << ", effectStateId=" << aesItemView.effectStateId; - QCOMPARE(aesItemView.effectStateId(), m_effectStates[m_effectStateCounter]); + QCOMPARE(aesItemView.effectStateId, m_effectStates[m_effectStateCounter]); m_effectStateCounter++; - if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsReceived) + if (aesItemView.effectStateId == AreaEffectSimulation::AesEffectState::EsReceived) { - DEBUG_LOG(m_logger) << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemView.aesItemId(); - sendAcknowledgeExternalAesItemRequest(aesItemView.aesItemId()); + DEBUG_LOG(m_logger) << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemView.aesItemId; + sendAcknowledgeExternalAesItemRequest(aesItemView.aesItemId); } } @@ -185,11 +185,11 @@ void ModuleTestEffectCluster::sendTabExFire() { DEBUG_LOG(m_logger) << "sendTabExFire"; TrainingAreaBase::EX_Fire exFire; - exFire.effectorId(m_effectorId); // Kenner z.B B1 - exFire.identifier(m_identifier.toStdString()); // Verein z.B 451100 - exFire.reference(m_reference.toStdString()); // UUID Feuerkampf - exFire.equipmentNumber(m_participant1.id() * -1); - exFire.sampleTime(QDateTime::currentMSecsSinceEpoch() + 500); + exFire.effectorId = m_effectorId; // Kenner z.B B1 + exFire.identifier = m_identifier.toStdString(); // Verein z.B 451100 + exFire.reference = m_reference.toStdString(); // UUID Feuerkampf + exFire.equipmentNumber = m_participant1.id * -1; + exFire.sampleTime = QDateTime::currentMSecsSinceEpoch() + 500; m_tabDts->publish(exFire); } @@ -198,8 +198,8 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif { if (modType == DataModification::eRemoved) return; - AreaEffectSimulation::AesType_def::type aesType = effects.aesTypeId().underlying(); - DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType; + AreaEffectSimulation::AesType::type aesType = effects.aesTypeId().underlying(); + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType; ++m_counterDds.cntEffectClusterEffects; m_effects = effects; @@ -208,22 +208,22 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif void ModuleTestEffectCluster::onChargeEffectChanged(const ChargeEffect &chargeEffect, DataModification modType) { - DEBUG_LOG(m_logger) << "onChargeEffectChanged state=" << chargeEffect.state(); + DEBUG_LOG(m_logger) << "onChargeEffectChanged state=" << chargeEffect.state; if (modType == DataModification::eRemoved) return; - if (chargeEffect.state() == AreaEffectSimulation::AesEffectState::EsActivated) + if (chargeEffect.state == AreaEffectSimulation::AesEffectState::EsActivated) { // Compare Position // mhpPosition.lon(0.201958); // mhpPosition.lat(0.915263); // mhpPosition.z(88.0); - double lon = qRound64(chargeEffect.position().lon() * 100000) / 100000.0; // Nur die ersten 5 Nachkommastellen beruecksichtigen - double lat = qRound64(chargeEffect.position().lat() * 100000) / 100000.0; + double lon = qRound64(chargeEffect.position.lon * 100000) / 100000.0; // Nur die ersten 5 Nachkommastellen beruecksichtigen + double lat = qRound64(chargeEffect.position.lat * 100000) / 100000.0; QCOMPARE(lon, 0.20196); QCOMPARE(lat, 0.91526); - QCOMPARE(chargeEffect.position().z(), 88.0); + QCOMPARE(chargeEffect.position.z, 88.0); } - else if (chargeEffect.state() == AreaEffectSimulation::AesEffectState::EsExpired) + else if (chargeEffect.state == AreaEffectSimulation::AesEffectState::EsExpired) participantDeleteRequest(); DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects; } @@ -231,12 +231,12 @@ void ModuleTestEffectCluster::onChargeEffectChanged(const ChargeEffect &chargeEf void ModuleTestEffectCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeAware &data, DataModification modType) { Q_UNUSED(modType); - if (data.id() == -1) + if (data.id == -1) return; ++m_counterDds.cntTrajectory; - DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory; + DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id << ", cntTrajectory=" << m_counterDds.cntTrajectory; } void ModuleTestEffectCluster::dumpCnt() @@ -269,24 +269,24 @@ bool ModuleTestEffectCluster::waitForData(const std::function &func, int EffectCluster ModuleTestEffectCluster::getEcForTneVerification(const QString &eaName, double rotation) { AreaEffectSimulation::EffectCluster eaData; - eaData.id(0); + eaData.id = 0; - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(eaName); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.effectDuration(10000); // 10 seconds + eaData.effectDuration = 10000; // 10 seconds // eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); // eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); - eaData.partyId(2); - eaData.participantId(7); + eaData.partyId = 2; + eaData.participantId = 7; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(100); + fc.requestedRelativePeakHeight = 100; // siehe auch: GUEZE-2311 Verifikation des Algorithmus bzgl. MTPs zw. TNE und EXCON. const double height = 100; // Y @@ -301,15 +301,15 @@ EffectCluster ModuleTestEffectCluster::getEcForTneVerification(const QString &ea DEBUG_LOG(m_logger) << " bottomLeft" << bottomLeft; - eaData.area().cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0)); - eaData.area().height(height); - eaData.area().width(width); - eaData.area().rotation(rot); + eaData.area.cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0)); + eaData.area.height = height; + eaData.area.width = width; + eaData.area.rotation = rot; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaData.tla(0); // aka zop + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaData.tla = 0; // aka zop - eaData.externalId(0); + eaData.externalId = 0; return eaData; } @@ -349,17 +349,17 @@ std::vector ModuleTestEffectCluster::parseTr QString val = xml.readElementText(); if (name == QStringLiteral("lon")) - p.offsetX(val.toDouble()); + p.offsetX = val.toDouble(); else if (name == QStringLiteral("lat")) - p.offsetY(val.toDouble()); + p.offsetY = val.toDouble(); else if (name == QStringLiteral("z")) - p.offsetZ(val.toDouble()); + p.offsetZ = val.toDouble(); else if (name == QStringLiteral("relativeTime")) - p.relativeTime(val.toDouble()); + p.relativeTime = val.toDouble(); } } points.push_back(p); - DEBUG_LOG(m_logger) << "Punkt gelesen: offsetY" << p.offsetX() << ", offsetY" << p.offsetY() << ", offsetZ" << p.offsetZ() << ", time=" << p.relativeTime(); + DEBUG_LOG(m_logger) << "Punkt gelesen: offsetY" << p.offsetX << ", offsetY" << p.offsetY << ", offsetZ" << p.offsetZ << ", time=" << p.relativeTime; } } @@ -386,14 +386,14 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() QString dateTimeString = QDateTime::currentDateTime().toString(QStringLiteral("dd.MM.yyyy hh:mm")); m_reference = dateTimeString; - if (eaData.effectStart().is_set()) - INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString(); + if (eaData.effectStart.is_set()) + 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()) - // fc = eaData.flightCurve().get(); + // if (eaData.flightCurve.is_set()) + // fc = eaData.flightCurve.get(); QJsonObject obj; obj[QStringLiteral("effectSource")] = 1; @@ -410,49 +410,49 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() QString propertiesStr = QString::fromStdString(QJsonDocument(obj).toJson(QJsonDocument::Compact).toStdString()); - eaData.properties(propertiesStr.toStdString()); + eaData.properties = propertiesStr.toStdString(); AreaEffectSimulation::ChargeStruct chargeStruct; - chargeStruct.chargeTypeId(367); - chargeStruct.igniterTypeId(1); - chargeStruct.igniterFunctionId(2); + chargeStruct.chargeTypeId = 367; + chargeStruct.igniterTypeId = 1; + chargeStruct.igniterFunctionId = 2; Core::GeoPosition mhpPosition; - mhpPosition.lon(0.201958); - mhpPosition.lat(0.915263); - mhpPosition.z(88.0); + mhpPosition.lon = 0.201958; + mhpPosition.lat = 0.915263; + mhpPosition.z = 88.0; Core::GeoPosition2D cornerBottomLeft; - cornerBottomLeft.lon(0.201951); - cornerBottomLeft.lat(0.915259); + cornerBottomLeft.lon = 0.201951; + cornerBottomLeft.lat = 0.915259; AreaEffectSimulation::Area area; - area.cornerBottomLeft(cornerBottomLeft); - area.width(50); - area.height(50); - area.rotation(0); - eaData.area(area); + area.cornerBottomLeft = cornerBottomLeft; + area.width = 50; + area.height = 50; + area.rotation = 0; + eaData.area = area; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgPoint); + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; std::vector trajectory = parseTrajectory(s_REQUEST_SPL_FILE); AreaEffectSimulation::EffectorData effector; - effector.angleOfFall(0); - effector.participantId(m_participant1.id()); // Participant - DEBUG_LOG(m_logger) << "effector.participantId(m_participant1.id()=" << m_participant1.id(); + effector.angleOfFall = 0; + effector.participantId = m_participant1.id; // Participant + DEBUG_LOG(m_logger) << "effector.participantId(m_participant1.id()=" << m_participant1.id; - effector.flightTime(39526.3); - effector.peakHeight(2002.0); - effector.interval(0); - effector.chargeStruct(chargeStruct); - effector.chargeAmount(1); - effector.mhpScatterLenght(3.08314e-316); - effector.mhpScatterWidth(8.76302e-315); - effector.mhpScatterLengthDetonationHeight(9.69057e-316); - effector.mhpScatterWidthDetonationHeight(8.76638e-315); - effector.mhpRotation(-45.4373); - effector.mhpPosition(mhpPosition); - effector.trajectoryRelative(trajectory); + effector.flightTime = 39526.3; + effector.peakHeight = 2002.0; + effector.interval = 0; + effector.chargeStruct = chargeStruct; + effector.chargeAmount = 1; + effector.mhpScatterLenght = 3.08314e-316; + effector.mhpScatterWidth = 8.76302e-315; + effector.mhpScatterLengthDetonationHeight = 9.69057e-316; + effector.mhpScatterWidthDetonationHeight = 8.76638e-315; + effector.mhpRotation = -45.4373; + effector.mhpPosition = mhpPosition; + effector.trajectoryRelative = trajectory; DEBUG_LOG(m_logger) << "effector"; @@ -461,37 +461,37 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() DEBUG_LOG(m_logger) << "Nach effector"; - eaData.id(0); - eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_ADLER); - eaData.firePurposeId(2); - eaData.partyId(4); - eaData.participantId(m_participant0.id()); // Unit - DEBUG_LOG(m_logger) << "eaData.participantId(m_participant0.id()=" << m_participant0.id(); - eaData.externalId(7); - eaData.effectMarkingInTa(1); + eaData.id = 0; + eaData.effectSourceId = ProjectDataManagement::EffectSource::ES_ADLER; + eaData.firePurposeId = 2; + eaData.partyId = 4; + eaData.participantId = m_participant0.id; // Unit + DEBUG_LOG(m_logger) << "eaData.participantId(m_participant0.id()=" << m_participant0.id; + eaData.externalId = 7; + eaData.effectMarkingInTa = 1; - eaData.name(dateTimeString.toStdString()); - eaData.element(dateTimeString.toStdString()); + eaData.name = dateTimeString.toStdString(); + eaData.element = dateTimeString.toStdString(); DEBUG_LOG(m_logger) << "Vor send effectClusterModifyRequest"; - int ret = m_aesFtc->effectClusterModifyRequest(EffectClusterModifyRequest(eaData.id(), - eaData.name(), - eaData.element(), - eaData.effectStart(), - eaData.effectDuration(), - eaData.effectSourceId(), - eaData.area(), - eaData.explosionGeometry(), // AimPoint, Radial, Area, Line, Point - eaData.tla(), // ZielOrtungsGenauigkeit + int ret = m_aesFtc->effectClusterModifyRequest(EffectClusterModifyRequest(eaData.id, + eaData.name, + eaData.element, + eaData.effectStart, + eaData.effectDuration, + eaData.effectSourceId, + eaData.area, + eaData.explosionGeometry, // AimPoint, Radial, Area, Line, Point + eaData.tla, // ZielOrtungsGenauigkeit effectors, - eaData.firePurposeId(), // FirePurpose: blenden, niederhalten, vernichten - eaData.partyId(), - eaData.participantId(), + eaData.firePurposeId, // FirePurpose: blenden, niederhalten, vernichten + eaData.partyId, + eaData.participantId, {}, // esmParticipantIds - eaData.externalId(), - eaData.effectMarkingInTa(), - eaData.properties()), + eaData.externalId, + eaData.effectMarkingInTa, + eaData.properties), this); DEBUG_LOG(m_logger) << "send effectClusterModifyRequest ret=" << ret; return ret; @@ -508,25 +508,25 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared; }, durPrep)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared; }, durPrep)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated; }, durAct)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated; }, durAct)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, durExp)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }, durExp)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } @@ -538,24 +538,24 @@ void ModuleTestEffectCluster::disconnectFromParty() ParticipantManagement::Party party; - party.name("GREEN"); - party.role(ParticipantManagement::Role::Neutral); - party.color(-16711936); - party.fadingColor(-6553701); + party.name = "GREEN"; + party.role = ParticipantManagement::Role::Neutral; + party.color = -16711936; + party.fadingColor = -6553701; ModifyPartyDataRequest req; - req.id(m_partyId); - req.name(party.name()); - req.color(party.color()); - req.fadingColor(party.fadingColor()); - req.role(party.role()); - req.isUsedBy(true); - req.sampleTime(QDateTime::currentMSecsSinceEpoch()); + req.id = m_partyId; + req.name = party.name; + req.color = party.color; + req.fadingColor = party.fadingColor; + req.role = party.role; + req.isUsedBy = true; + req.sampleTime = QDateTime::currentMSecsSinceEpoch(); const HlaForceIdentifierEnum hlaId = HlaForceIdentifierEnum::Neutral_1; - req.hlaForceIdentifier(hlaId); + req.hlaForceIdentifier = hlaId; QString properties = QStringLiteral("{\"Adler\": {\"wsId\": 3, \"SaaName\": \"UI Test\", \"assetId\": -1, \"saaName\": \"SAA1@GUEZ.DE\", \"szenarName\": \"UI Test\", " "\"isSaaConnected\": 1, \"saaConnectedState\": 2}}"); - req.properties(properties.toStdString()); + req.properties = properties.toStdString(); if (!m_ppmFtc->modifyPartyDataRequest(req, this)) { @@ -570,25 +570,25 @@ void ModuleTestEffectCluster::connectToParty() ParticipantManagement::Party party; - party.name("GREEN"); - party.role(ParticipantManagement::Role::Neutral); - party.color(-16711936); - party.fadingColor(-6553701); + party.name = "GREEN"; + party.role = ParticipantManagement::Role::Neutral; + party.color = -16711936; + party.fadingColor = -6553701; ModifyPartyDataRequest req; - req.id(m_partyId); - req.name(party.name()); - req.color(party.color()); - req.fadingColor(party.fadingColor()); - req.role(party.role()); - req.isUsedBy(true); - req.sampleTime(QDateTime::currentMSecsSinceEpoch()); + req.id = m_partyId; + req.name = party.name; + req.color = party.color; + req.fadingColor = party.fadingColor; + req.role = party.role; + req.isUsedBy = true; + req.sampleTime = QDateTime::currentMSecsSinceEpoch(); const HlaForceIdentifierEnum hlaId = HlaForceIdentifierEnum::Neutral_1; - req.hlaForceIdentifier(hlaId); + req.hlaForceIdentifier = hlaId; QString properties = QStringLiteral("{\"Adler\": {\"wsId\": 3, \"SaaName\": \"UI Test\", \"assetId\": -1, \"saaName\": \"SAA1@GUEZ.DE\", \"szenarName\": \"UI Test\", " "\"isSaaConnected\": 2, \"isVerbund\": true, \"saaConnectedState\": 4}}"); - req.properties(properties.toStdString()); + req.properties = properties.toStdString(); if (!m_ppmFtc->modifyPartyDataRequest(req, this)) { @@ -601,46 +601,46 @@ void ModuleTestEffectCluster::participantChangeRequest() { DEBUG_LOG(m_logger) << "PPM::participantChangerequest"; - m_participant0.id(0); - m_participant0.partyId(4); - m_participant0.hierarchyNumber(1); - m_participant0.typeId(182); - m_participant0.externalId(0); - m_participant0.symbol(QStringLiteral("AP6D|CMPL|10011000001308000000").toStdString()); - m_participant0.name(QStringLiteral("451200").toStdString()); - m_participant0.identification(QStringLiteral("").toStdString()); - m_participant0.designator(QStringLiteral("451200").toStdString()), m_participant0.tacticalIdentifier(QStringLiteral("451200").toStdString()); - m_participant0.info(QStringLiteral("").toStdString()); - m_participant0.assignState(ParticipantManagement::ParticipantAssignState::NotAssigned); - m_participant0.isSimulated(false); - m_participant0.isDeleted(false); - m_participant0.properties(QStringLiteral("").toStdString()); - m_participant0.modId(1138783559); - m_participant0.superiorModId(0); + m_participant0.id = 0; + m_participant0.partyId = 4; + m_participant0.hierarchyNumber = 1; + m_participant0.typeId = 182; + m_participant0.externalId = 0; + m_participant0.symbol = QStringLiteral("AP6D|CMPL|10011000001308000000").toStdString(); + m_participant0.name = QStringLiteral("451200").toStdString(); + m_participant0.identification = QStringLiteral("").toStdString(); + m_participant0.designator = QStringLiteral("451200").toStdString(), m_participant0.tacticalIdentifier = QStringLiteral("451200").toStdString(); + m_participant0.info = QStringLiteral("").toStdString(); + m_participant0.assignState = ParticipantManagement::ParticipantAssignState::NotAssigned; + m_participant0.isSimulated = false; + m_participant0.isDeleted = false; + m_participant0.properties = QStringLiteral("").toStdString(); + m_participant0.modId = 1138783559; + m_participant0.superiorModId = 0; - m_participant1.id(0); - m_participant1.partyId(4); - m_participant1.hierarchyNumber(1); - m_participant1.typeId(188); - m_participant1.externalId(0); - m_participant1.symbol(QStringLiteral("AP6D|CMPL|10011500001114020000").toStdString()); - m_participant1.name(QStringLiteral("C3").toStdString()); - m_participant1.identification(QStringLiteral("").toStdString()); - m_participant1.designator(QStringLiteral("C3").toStdString()), m_participant1.tacticalIdentifier(QStringLiteral("451200").toStdString()); - m_participant1.info(QStringLiteral("").toStdString()); - m_participant1.assignState(ParticipantManagement::ParticipantAssignState::NotAssigned); - m_participant1.isSimulated(false); - m_participant1.isDeleted(false); - m_participant1.properties(QStringLiteral("").toStdString()); - m_participant1.modId(1390608527); - m_participant1.superiorModId(1138783559); + m_participant1.id = 0; + m_participant1.partyId = 4; + m_participant1.hierarchyNumber = 1; + m_participant1.typeId = 188; + m_participant1.externalId = 0; + m_participant1.symbol = QStringLiteral("AP6D|CMPL|10011500001114020000").toStdString(); + m_participant1.name = QStringLiteral("C3").toStdString(); + m_participant1.identification = QStringLiteral("").toStdString(); + m_participant1.designator = QStringLiteral("C3").toStdString(), m_participant1.tacticalIdentifier = QStringLiteral("451200").toStdString(); + m_participant1.info = QStringLiteral("").toStdString(); + m_participant1.assignState = ParticipantManagement::ParticipantAssignState::NotAssigned; + m_participant1.isSimulated = false; + m_participant1.isDeleted = false; + m_participant1.properties = QStringLiteral("").toStdString(); + m_participant1.modId = 1390608527; + m_participant1.superiorModId = 1138783559; ModifyParticipantDataRequest req; std::vector data; data.push_back(m_participant0); data.push_back(m_participant1); - req.requestId(548288706); - req.data(data); + req.requestId = 548288706; + req.data = data; if (!m_ppmFtc->modifyParticipantDataRequest(req, this)) { ERROR_LOG(m_logger) << "Error creating party data"; @@ -652,16 +652,16 @@ void ModuleTestEffectCluster::participantDeleteRequest() { DEBUG_LOG(m_logger) << "PPM::participantDeleteRequest"; - m_participant0.isDeleted(true); + m_participant0.isDeleted = true; - m_participant1.isDeleted(true); + m_participant1.isDeleted = true; ModifyParticipantDataRequest req; std::vector data; data.push_back(m_participant0); data.push_back(m_participant1); - req.requestId(548288707); - req.data(data); + req.requestId = 548288707; + req.data = data; if (!m_ppmFtc->modifyParticipantDataRequest(req, this)) { ERROR_LOG(m_logger) << "Error creating party data"; @@ -676,16 +676,16 @@ void ModuleTestEffectCluster::setParticipantPos(int participantId) Core::GeoPosition geoPos; TrainingAreaBase::EquipmentPosition pos; - geoPos.lon(0.20110363); - geoPos.lat(0.91579597); - geoPos.z(0.0); + geoPos.lon = 0.20110363; + geoPos.lat = 0.91579597; + geoPos.z = 0.0; DEBUG_LOG(m_logger) << " initTestCase_data1 ..."; - pos.equipmentNumber(participantId * -1); // ParticipantId - pos.sampleTime(QDateTime::currentMSecsSinceEpoch()); - position.reportingSource(Core::PositionReportingSource::SetByOperator); - position.position(geoPos); - pos.position(position); + pos.equipmentNumber = participantId * -1; // ParticipantId + pos.sampleTime = QDateTime::currentMSecsSinceEpoch(); + position.reportingSource = Core::PositionReportingSource::SetByOperator; + position.position = geoPos; + pos.position = position; m_tabDts->publish(pos); } @@ -696,34 +696,34 @@ void ModuleTestEffectCluster::setEquipmentGearCharge(int participantId) TrainingAreaBase::GearCharge charge; std::vector charges; - egs.equipmentNumber(participantId * -1); // ParticipantId - egs.sampleTime(QDateTime::currentMSecsSinceEpoch()); + egs.equipmentNumber = participantId * -1; // ParticipantId + egs.sampleTime = QDateTime::currentMSecsSinceEpoch(); charges.resize(7); - charge.gearId(138); - charge.gearTypeId(801); - charge.chargeTypeId(367); - charge.remain(50); + charge.gearId = 138; + charge.gearTypeId = 801; + charge.chargeTypeId = 367; + charge.remain = 50; charges.push_back(charge); // 0 - charge.chargeTypeId(366); + charge.chargeTypeId = 366; charges.push_back(charge); // 1 - charge.chargeTypeId(361); + charge.chargeTypeId = 361; charges.push_back(charge); // 2 - charge.chargeTypeId(362); + charge.chargeTypeId = 362; charges.push_back(charge); // 3 - charge.chargeTypeId(363); + charge.chargeTypeId = 363; charges.push_back(charge); // 4 - charge.chargeTypeId(364); + charge.chargeTypeId = 364; charges.push_back(charge); // 5 - charge.chargeTypeId(365); + charge.chargeTypeId = 365; charges.push_back(charge); // 6 - egs.charge(charges); + egs.charge = charges; m_tabDts->publish(egs); } @@ -736,17 +736,17 @@ void ModuleTestEffectCluster::onPartyChanged(const ParticipantManagement::Party return; } - if (data.id() != m_partyId) + if (data.id != m_partyId) { return; } - DEBUG_LOG(m_logger) << "onPartyChanged id= " << data.id(); - if (m_ppmDtc->saaConnectedState(data.id()) == ParticipantManagement::ConnectState::Connected) + DEBUG_LOG(m_logger) << "onPartyChanged id= " << data.id; + if (m_ppmDtc->saaConnectedState(data.id) == ParticipantManagement::ConnectState::Connected) { DEBUG_LOG(m_logger) << "onPartyChanged saaConnectedState == connected"; } - else if (m_ppmDtc->saaConnectedState(data.id()) == ParticipantManagement::ConnectState::Disconnected) + else if (m_ppmDtc->saaConnectedState(data.id) == ParticipantManagement::ConnectState::Disconnected) { DEBUG_LOG(m_logger) << "onPartyChanged saaConnectedState == disconnected => connectToParty"; connectToParty(); @@ -835,8 +835,8 @@ void ModuleTestEffectCluster::initTestCase() DEBUG_LOG(m_logger) << " waitForHistoricalDataExercise... Done"; const ExerciseManagement::Exercise &exercise = m_exmDtc->exercise(m_exerciseId); - QVERIFY2(exercise.id() == m_exerciseId, "ERROR, exercise failed!!"); - m_traingAreaId = exercise.trainingAreaId(); + QVERIFY2(exercise.id == m_exerciseId, "ERROR, exercise failed!!"); + m_traingAreaId = exercise.trainingAreaId; DEBUG_LOG(m_logger) << " ExerciseManagement" << ", m_traingAreaId = " << m_traingAreaId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp index 61fbe194c..97fbc69d2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp @@ -81,13 +81,13 @@ double distanceMeter(const LtsCoordTrans::UtmCoordinate &utmCoord1, const LtsCoo double distanceMeter(const Core::GeoPosition &geoPos , const LtsCoordTrans::UtmCoordinate &utmCoord) { - const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat()); + const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat); return distanceMeter(utmPos, utmCoord); } double distanceMeter(const Core::GeoPosition2D &geoPos2D , const LtsCoordTrans::UtmCoordinate &utmCoord) { - const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos2D.lon(), geoPos2D.lat()); + const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos2D.lon, geoPos2D.lat); return distanceMeter(utmPos, utmCoord); } @@ -166,28 +166,28 @@ void ModuleTestExplosionCluster::onSetBuildingStatesReply(const Core::FunctionRe void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluster &data, DataModification modType) { Q_UNUSED(modType); - if (data.id() == -1) + if (data.id == -1) return; ++m_counterDds.cntExplosionCluster; // handle remove? - if ((m_data.isObjectModifiable() == true) && (data.isObjectModifiable() == false)) + if ((m_data.isObjectModifiable == true) && (data.isObjectModifiable == false)) { long now = time(nullptr) * 1000; long diff = now - m_objectRequestedTimePointMsec; - DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id << ", state=" << m_data.effectStateId << ", OBJECT IS NOT Modifiable ANYMORE" << " ((diff = " << diff << ")"; } m_data = data; qint64 startTimeMsec = -1; - if (m_data.effectStart().is_set()) - startTimeMsec = m_data.effectStart().get(); + if (m_data.effectStart.is_set()) + startTimeMsec = m_data.effectStart.get(); - DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id << ", state=" << m_data.effectStateId << ", startTimeMsec=" << startTimeMsec << ", cntExplosionCluster=" << m_counterDds.cntExplosionCluster; TRACE_LOG(m_logger) << " got changed - m_data: " << m_data; @@ -200,7 +200,7 @@ void ModuleTestExplosionCluster::onBuildingStateChanged(const Buildings::Buildin // DEBUG_LOG(m_logger) << " got changed - BuildingState.id: " << bldgState.id() << ", data.damagePerc " << bldgState.damagePercent() << "m_bldgIdToFilter " << m_bldgIdToFilter; - if (m_bldgIdToFilter == bldgState.id()) + if (m_bldgIdToFilter == bldgState.id) m_buildingStateVec.push_back(bldgState); } @@ -209,14 +209,14 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem if (modType == DataModification::eRemoved) return; - AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying(); - DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id() << ", aesType=" << aesType; + AreaEffectSimulation::AesType::type aesType = aesItemView.aesTypeId().underlying(); + DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id << ", aesType=" << aesType; switch (aesType) { - case AreaEffectSimulation::AesType_def::AtExplosionCluster: + case AreaEffectSimulation::AesType::AtExplosionCluster: ++m_counterDds.cntAtExplosionCluster; break; - case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine: + case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine: ++m_counterDds.cntAtExplosionClusterGunToTargetLine; break; // case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions: @@ -232,8 +232,8 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo { if (modType == DataModification::eRemoved) return; - AreaEffectSimulation::AesType_def::type aesType = effects.aesTypeId().underlying(); - DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType; + AreaEffectSimulation::AesType::type aesType = effects.aesTypeId().underlying(); + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType; ++m_counterDds.cntExplosionClusterEffects; m_effects = effects; @@ -243,12 +243,12 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo void ModuleTestExplosionCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeAware &data, DataModification modType) { Q_UNUSED(modType); - if (data.id() == -1) + if (data.id == -1) return; ++m_counterDds.cntTrajectory; - DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory; + DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id << ", cntTrajectory=" << m_counterDds.cntTrajectory; } void ModuleTestExplosionCluster::dumpCnt() @@ -267,9 +267,9 @@ void ModuleTestExplosionCluster::dumpBldgStates() NOTICE_LOG(m_logger) << " m_buildingStateVec.size() = " << m_buildingStateVec.size(); for (const Buildings::BuildingState &bldgState : qAsConst(m_buildingStateVec)) NOTICE_LOG(m_logger) << " bldgState: " - << ", id = " << bldgState.id() - << ", damagePercent = " << bldgState.damagePercent() - << ", vulnerabilityState = " << bldgState.vulnerabilityState(); + << ", id = " << bldgState.id + << ", damagePercent = " << bldgState.damagePercent + << ", vulnerabilityState = " << bldgState.vulnerabilityState; } bool ModuleTestExplosionCluster::setFilterForBldgState(const QString &bldgName) @@ -298,26 +298,26 @@ bool ModuleTestExplosionCluster::checkSingleEffects(uint idx, const LtsCoordTran // [singleEffectState: AesSingleEffectState::SesTriggered position: [[lon: 0.20261744391547, lat: 0.916075873952916]z: 93.7899755716979], zPlacement: AesZPlacement::ZpDraped , singleEffectTime: 1731589251949], // [singleEffectState: AesSingleEffectState::SesScheduled , position: [[lon: 0.202616961210441, lat: 0.916075147176726]z: 93.86], zPlacement: AesZPlacement::ZpDraped , singleEffectTime: 0]}] - std::vector& singleEffects = m_effects.singleEffects(); + std::vector& singleEffects = m_effects.singleEffects; if (singleEffects.size() <= idx) return false; const SingleEffect &se = singleEffects[idx]; - if (se.singleEffectTime() < 1000) + if (se.singleEffectTime < 1000) { ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": singleEffectTime failed, SingleEffect = " << se; return false; } - if (se.zPlacement() != zPlace) + if (se.zPlacement != zPlace) { ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": zPlacement failed, SingleEffect = " << se; return false; } - LtsCoordinate ltsPos(se.position()); + LtsCoordinate ltsPos(se.position); const double dist3D = ltsPos.distanceUtm3D(coord); if (dist3D > maxDist3D) @@ -337,7 +337,7 @@ bool ModuleTestExplosionCluster::checkBldgStates(const QVector &damagePerce damagePercentIst.reserve(m_buildingStateVec.size()); for (const Buildings::BuildingState &bldgState : qAsConst(m_buildingStateVec)) - damagePercentIst.append(bldgState.damagePercent()); + damagePercentIst.append(bldgState.damagePercent); bool same = damagePercentIst == damagePercent; @@ -372,29 +372,29 @@ bool ModuleTestExplosionCluster::waitForData(const std::function &func, ExplosionCluster ModuleTestExplosionCluster::getEcForTneVerification(const QString &eaName, double rotation) { AreaEffectSimulation::ExplosionCluster eaData; - eaData.id(0); - eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal); + eaData.id = 0; + eaData.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal; - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(eaName); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.effectDuration(10000); // 10 seconds - eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectDuration = 10000; // 10 seconds + eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1; + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; - eaData.partyId(2); - eaData.participantId(7); + eaData.partyId = 2; + eaData.participantId = 7; eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0)}); - eaData.impactCount(10); + eaData.impactCount = 10; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(100); - eaData.flightCurve(toOptional(fc)); + fc.requestedRelativePeakHeight = 100; + eaData.flightCurve = toOptional(fc); // siehe auch: GUEZE-2311 Verifikation des Algorithmus bzgl. MTPs zw. TNE und EXCON. const double height = 100; // Y @@ -409,15 +409,15 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForTneVerification(const QStri qCritical() << " bottomLeft" << bottomLeft; - eaData.area().cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0)); - eaData.area().height(height); - eaData.area().width(width); - eaData.area().rotation(rot); + eaData.area.cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0)); + eaData.area.height = height; + eaData.area.width = width; + eaData.area.rotation = rot; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaData.tla(0); // aka zop + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaData.tla = 0; // aka zop - eaData.externalId(0); + eaData.externalId = 0; return eaData; } @@ -425,49 +425,49 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForTneVerification(const QStri ExplosionCluster ModuleTestExplosionCluster::getEcFor1104(const QString &eaName) { AreaEffectSimulation::ExplosionCluster eaData; - eaData.id(0); - eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal); + eaData.id = 0; + eaData.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal; - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(eaName); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.effectDuration(10000); // 10 seconds - eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectDuration = 10000; // 10 seconds + eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1; + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; - eaData.partyId(2); - eaData.participantId(5); + eaData.partyId = 2; + eaData.participantId = 5; 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)}); - eaData.impactCount(4); + eaData.impactCount = 4; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(100); - eaData.flightCurve(toOptional(fc)); + fc.requestedRelativePeakHeight = 100; + eaData.flightCurve = toOptional(fc); - eaData.firePurposeId(1); // 1=Blenden, 2=Blenden mit IR, + eaData.firePurposeId = 1; // 1=Blenden, 2=Blenden mit IR, const double height = 11; const double width = 25; const double rot = 0; // 0.202561460978929 0.916110427477059 == 32U PD 76937 18655 - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.202561460978929, 0.916110427477059)); - eaData.area().height(height); - eaData.area().width(width); - eaData.area().rotation(rot); + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.202561460978929, 0.916110427477059)); + eaData.area.height = height; + eaData.area.width = width; + eaData.area.rotation = rot; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaData.tla(0); // aka zog + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaData.tla = 0; // aka zog - eaData.externalId(0); + eaData.externalId = 0; return eaData; } @@ -475,34 +475,34 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1104(const QString &eaName) ExplosionCluster ModuleTestExplosionCluster::getEcFor1106(const QString &eaName) { AreaEffectSimulation::ExplosionCluster eaData; - eaData.id(0); - eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal); + eaData.id = 0; + eaData.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal; - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(eaName); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.effectDuration(10000); // 10 seconds - eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectDuration = 10000; // 10 seconds + eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1; + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; - eaData.partyId(2); - eaData.participantId(6); + eaData.partyId = 2; + eaData.participantId = 6; 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)}); - eaData.impactCount(4); + eaData.impactCount = 4; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(500); - eaData.flightCurve(toOptional(fc)); + fc.requestedRelativePeakHeight = 500; + eaData.flightCurve = toOptional(fc); - eaData.firePurposeId(1); // 1=Blenden, 2=Blenden mit IR, + eaData.firePurposeId = 1; // 1=Blenden, 2=Blenden mit IR, const double height = 10; const double width = 20; @@ -514,15 +514,15 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1106(const QString &eaName) LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7696018588")); // QPointF pos = utmPos.geographic(); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(pos.x(), pos.y())); - eaData.area().height(height); - eaData.area().width(width); - eaData.area().rotation(rot); + eaData.area.cornerBottomLeft(Core::GeoPosition2D(pos.x(), pos.y())); + eaData.area.height = height; + eaData.area.width = width; + eaData.area.rotation = rot; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaData.tla(0); // aka zog + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaData.tla = 0; // aka zog - eaData.externalId(0); + eaData.externalId = 0; return eaData; } @@ -530,34 +530,34 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1106(const QString &eaName) ExplosionCluster ModuleTestExplosionCluster::getEcForUBAHN(const QString &eaName) { AreaEffectSimulation::ExplosionCluster eaData; - eaData.id(0); - eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal); + eaData.id = 0; + eaData.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal; - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(eaName); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.effectDuration(10000); // 10 seconds - eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectDuration = 10000; // 10 seconds + eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1; + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; - eaData.partyId(2); - eaData.participantId(5); + eaData.partyId = 2; + eaData.participantId = 5; 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)}); - eaData.impactCount(4); + eaData.impactCount = 4; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(500); - eaData.flightCurve(toOptional(fc)); + fc.requestedRelativePeakHeight = 500; + eaData.flightCurve = toOptional(fc); - eaData.firePurposeId(1); // 1=Blenden, 2=Blenden mit IR, + eaData.firePurposeId = 1; // 1=Blenden, 2=Blenden mit IR, const double height = 10; const double width = 20; @@ -567,15 +567,15 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForUBAHN(const QString &eaName LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U PD 77154 18454")); // 32 U PD 77154 18454 QPointF pos = utmPos.geographic(); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(pos.x(), pos.y())); - eaData.area().height(height); - eaData.area().width(width); - eaData.area().rotation(rot); + eaData.area.cornerBottomLeft(Core::GeoPosition2D(pos.x(), pos.y())); + eaData.area.height = height; + eaData.area.width = width; + eaData.area.rotation = rot; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaData.tla(0); // aka zog + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaData.tla = 0; // aka zog - eaData.externalId(0); + eaData.externalId = 0; return eaData; } @@ -583,34 +583,34 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForUBAHN(const QString &eaName ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName) { AreaEffectSimulation::ExplosionCluster eaData; - eaData.id(0); - eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal); + eaData.id = 0; + eaData.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal; - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(eaName); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.effectDuration(10000); // 10 seconds - eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectDuration = 10000; // 10 seconds + eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1; + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; - eaData.partyId(2); - eaData.participantId(89); + eaData.partyId = 2; + eaData.participantId = 89; 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)}); - eaData.impactCount(4); + eaData.impactCount = 4; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(1000); - eaData.flightCurve(toOptional(fc)); + fc.requestedRelativePeakHeight = 1000; + eaData.flightCurve = toOptional(fc); - eaData.firePurposeId(1); // 1=Blenden, 2=Blenden mit IR, + eaData.firePurposeId = 1; // 1=Blenden, 2=Blenden mit IR, const double height = 20; const double width = 20; @@ -620,56 +620,56 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName) LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7722018559")); // 32 U PD 77220 18559 QPointF pos = utmPos.geographic(); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(pos.x(), pos.y())); - eaData.area().height(height); - eaData.area().width(width); - eaData.area().rotation(rot); + eaData.area.cornerBottomLeft(Core::GeoPosition2D(pos.x(), pos.y())); + eaData.area.height = height; + eaData.area.width = width; + eaData.area.rotation = rot; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaData.tla(0); // aka zog + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaData.tla = 0; // aka zog - eaData.externalId(0); + eaData.externalId = 0; return eaData; } int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionCluster &eaData) { - if (eaData.effectStart().is_set()) - INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString(); + if (eaData.effectStart.is_set()) + 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()) - fc = eaData.flightCurve().get(); + if (eaData.flightCurve.is_set()) + fc = eaData.flightCurve.get(); const std::string properties = "{}"; int ret = m_aesFtc->explosionClusterModifyRequest( ExplosionClusterModifyRequest( - eaData.id(), - eaData.name(), - eaData.element(), - eaData.effectStart(), - eaData.effectDuration(), - eaData.effectSourceId(), - eaData.area(), - eaData.explosionGeometry(), // AimPoint, Radial, Area, Line, Point - eaData.tla(), // ZielOrtungsGenauigkeit - eaData.mhPoints().size(), // mhpCount; + eaData.id, + eaData.name, + eaData.element, + eaData.effectStart, + eaData.effectDuration, + eaData.effectSourceId, + eaData.area, + eaData.explosionGeometry, // AimPoint, Radial, Area, Line, Point + eaData.tla, // ZielOrtungsGenauigkeit + eaData.mhPoints.size(), // mhpCount; optional(), // mhpRotation for ExplosionClusterOcModify only - eaData.impactCount(), // impactCount - { eaData.chargeStruct().chargeTypeId(), - eaData.chargeStruct().igniterTypeId(), - eaData.chargeStruct().igniterFunctionId()}, - eaData.firePurposeId(), // FirePurpose: blenden, niederhalten, vernichten - fc.requestedRelativePeakHeight(), // peakHeight, - fc.requestedFlightDuration(), // flightDuration [msec], - eaData.partyId(), - eaData.participantId(), + eaData.impactCount, // impactCount + { eaData.chargeStruct.chargeTypeId, + eaData.chargeStruct.igniterTypeId, + eaData.chargeStruct.igniterFunctionId}, + eaData.firePurposeId, // FirePurpose: blenden, niederhalten, vernichten + fc.requestedRelativePeakHeight, // peakHeight, + fc.requestedFlightDuration, // flightDuration [msec], + eaData.partyId, + eaData.participantId, {}, // esmParticipantIds - eaData.externalId(), + eaData.externalId, -1, // eaData.launchVelocity(), -1, // eaData.launchAngleDeg(), 45, // eaData.dropAngle(), @@ -677,7 +677,7 @@ int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionC -1, // eaData.lcAttack(), // fka lcPrf -1, // eaData.lcTermination(), std::numeric_limits::min(), // eaData.cloudBase(), // Wolkenuntergrenze - eaData.effectMarkingInTa(), + eaData.effectMarkingInTa, properties), this); return ret; @@ -685,8 +685,8 @@ int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionC int ModuleTestExplosionCluster::doExplosionClusterSingleEffectOnlyModifyRequest(const ExplosionClusterSingleEffectOnlyRequest &request) { - if (request.effectStart().is_set()) - INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart().get()).toString(); + if (request.effectStart.is_set()) + INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart.get()).toString(); else INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set "; @@ -716,27 +716,27 @@ void ModuleTestExplosionCluster::waitForEffectStates(int lineNumber, int durPrep } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared;}, durPrep)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated;}, durAct)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}, durExp)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -754,8 +754,8 @@ void ModuleTestExplosionCluster::setupParticipants() ParticipantManagement::SetSimulatedPosition req; { - req.participantId(5); // according testDB - req.onlyOutdatedParticipants(false); + req.participantId = 5; // according testDB + req.onlyOutdatedParticipants = false; const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7690018000")); // 32U PD 76900 18000 @@ -774,8 +774,8 @@ void ModuleTestExplosionCluster::setupParticipants() } { - req.participantId(6); // according testDB - req.onlyOutdatedParticipants(false); + req.participantId = 6; // according testDB + req.onlyOutdatedParticipants = false; const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7600019000")); // 32U PD 76000 19000 @@ -797,7 +797,7 @@ void ModuleTestExplosionCluster::setupParticipants() { ParticipantManagement::SetSimulatedParticipantFormation req_SSPF; - req_SSPF.participantId(89); + req_SSPF.participantId = 89; const LtsCoordTrans::UtmCoordinate &utmPos = // LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7500018000")); // 32U PD 75000 18000 @@ -806,7 +806,7 @@ void ModuleTestExplosionCluster::setupParticipants() req_SSPF.position(Core::GeoPosition(pos.x(), pos.y(), 0.0)); QString prop = QString(QStringLiteral("{\"angle\":0,\"distance\":25,\"distanceSets\":{\"Aufgelockert\":50,\"Geschlossen\":25},\"geometry\":\"line\"}")); - req_SSPF.formation( prop.toStdString() ); + req_SSPF.formation = prop.toStdString() ; INFO_LOG(m_logger) << " SetSimulatedParticipantFormation ... req = " << req_SSPF ; m_replyError = true; @@ -821,7 +821,7 @@ void ModuleTestExplosionCluster::setupParticipants() { ParticipantManagement::SetSimulatedParticipantFormation req_SSPF; - req_SSPF.participantId(99); + req_SSPF.participantId = 99; const LtsCoordTrans::UtmCoordinate &utmPos = // LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7500018000")); // 32U PD 75000 18000 @@ -830,7 +830,7 @@ void ModuleTestExplosionCluster::setupParticipants() req_SSPF.position(Core::GeoPosition(pos.x(), pos.y(), 0.0)); QString prop = QString(QStringLiteral("{\"angle\":0,\"distance\":25,\"distanceSets\":{\"Aufgelockert\":50,\"Geschlossen\":25},\"geometry\":\"line\"}")); - req_SSPF.formation( prop.toStdString() ); + req_SSPF.formation = prop.toStdString() ; INFO_LOG(m_logger) << " SetSimulatedParticipantFormation ... req = " << req_SSPF ; m_replyError = true; @@ -851,7 +851,7 @@ bool ModuleTestExplosionCluster::checkParticipant_5() // soll: QStringLiteral("32UPD7690018000")); // 32U PD 76900 18000 const int partId = 5; const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId); - QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat()); + QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos.lon, pos.pos.lat); INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 76900 18000"); @@ -862,7 +862,7 @@ bool ModuleTestExplosionCluster::checkParticipant_6() // soll: QStringLiteral("32UPD7600019000")); // 32 U PD 76000 19000 const int partId = 6; const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId); - QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat()); + QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos.lon, pos.pos.lat); INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 76000 19000"); @@ -921,14 +921,14 @@ void ModuleTestExplosionCluster::resetBldgs() m_ismDtc->mainStructureElements([this, bldgNames](const InfrastructureManagement::MainStructureElement &mse) { - if (mse.structureElementTypeId().underlying() != InfrastructureManagement::StructureElementType_def::Building) + if (mse.structureElementTypeId != InfrastructureManagement::StructureElementType::Building) return; - if (!bldgNames.contains(QString::fromStdString(mse.name()), Qt::CaseInsensitive)) + if (!bldgNames.contains(QString::fromStdString(mse.name), Qt::CaseInsensitive)) return; if (!m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId)) return; - m_bldgIdToName.insert(mse.id(), QString::fromStdString(mse.name())); + m_bldgIdToName.insert(mse.id, QString::fromStdString(mse.name)); }); qCritical() << " m_bldgIdToName" << m_bldgIdToName; @@ -939,9 +939,9 @@ void ModuleTestExplosionCluster::resetBldgs() buildingsVec.push_back( Buildings::Building(bldgId, {}) ); Buildings::SetBuildingStatesRequest requestData; - requestData.buildings(buildingsVec); - requestData.vulnerabilityState(ProjectDataManagement::VulnerabilityState_def::CombatReady); - requestData.resetContamination(true); + requestData.buildings = buildingsVec; + requestData.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady; + requestData.resetContamination = true; m_bldFtc->setBuildingStatesRequest(requestData, this); @@ -953,11 +953,11 @@ void ModuleTestExplosionCluster::resetBldgs() // check states: for (int bldgId : qAsConst(bldgIds)) { - const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState(); + const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState; INFO_LOG(m_logger) << "resetBldgs: bldgId " << bldgId << ", state= " << bldgState << ", bldgName= " << m_bldgIdToName[bldgId]; - QVERIFY2(bldgState.underlying()==ProjectDataManagement::VulnerabilityState_def::CombatReady, "ERROR, bldgState failed!!"); + QVERIFY2(bldgState==ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady, "ERROR, bldgState failed!!"); } m_buildingStateVec.clear(); } @@ -972,9 +972,9 @@ bool ModuleTestExplosionCluster::isKanaeleAssigned() m_ismDtc->mainStructureElements([this, bldgName, &bIsAssigned](const InfrastructureManagement::MainStructureElement &mse) { - if (mse.structureElementTypeId().underlying() != InfrastructureManagement::StructureElementType_def::Building) + if (mse.structureElementTypeId != InfrastructureManagement::StructureElementType::Building) return; - if (!bldgName.contains(QString::fromStdString(mse.name()), Qt::CaseInsensitive)) + if (!bldgName.contains(QString::fromStdString(mse.name), Qt::CaseInsensitive)) return; if (!m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId)) return; @@ -1069,7 +1069,7 @@ void ModuleTestExplosionCluster::initTestCase() const auto cb = [&bceInOut](const ProjectDataManagement::BuildingChargeEffect& data) -> bool #endif { - if (data.chargeTypeId() == usedChargeTypeId) + if (data.chargeTypeId == usedChargeTypeId) { bceInOut = data; return true; // break loop @@ -1083,9 +1083,9 @@ void ModuleTestExplosionCluster::initTestCase() std::cout << " BuildingChargeEffect for usedChargeTypeId = " << usedChargeTypeId << ", BuildingChargeEffect = " << bceInOut << std::endl; - QVERIFY2(bceInOut.chargeTypeId() == usedChargeTypeId, "ERROR, buildingChargeEffects failed!!"); - QVERIFY2(bceInOut.destructiveFactor() == 100, "ERROR, buildingChargeEffects.destructiveFactor failed!!"); - QVERIFY2(bceInOut.penetrationFactor() == 150, "ERROR, buildingChargeEffects.penetrationFactor failed!!"); + QVERIFY2(bceInOut.chargeTypeId == usedChargeTypeId, "ERROR, buildingChargeEffects failed!!"); + QVERIFY2(bceInOut.destructiveFactor == 100, "ERROR, buildingChargeEffects.destructiveFactor failed!!"); + QVERIFY2(bceInOut.penetrationFactor == 150, "ERROR, buildingChargeEffects.penetrationFactor failed!!"); // // BLD @@ -1125,8 +1125,8 @@ void ModuleTestExplosionCluster::initTestCase() std::cout << " waitForHistoricalDataExercise... Done" << std::endl; const ExerciseManagement::Exercise &exercise = m_exmDtc->exercise(m_exerciseId); - QVERIFY2(exercise.id() == m_exerciseId, "ERROR, exercise failed!!"); - m_traingAreaId = exercise.trainingAreaId(); + QVERIFY2(exercise.id == m_exerciseId, "ERROR, exercise failed!!"); + m_traingAreaId = exercise.trainingAreaId; std::cout << " ExerciseManagement" << ", m_traingAreaId = " << m_traingAreaId << std::endl; @@ -1243,7 +1243,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() const int ausrichtung = 0; // Entsprechend dem Dateinamen von Mötje const int rotation = ausrichtung; AreaEffectSimulation::ExplosionCluster eaData = getEcForTneVerification(QStringLiteral("ModuleTest_TneVerificationBremen_01__"), rotation); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1252,13 +1252,13 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); // Check MHP: - const std::vector& mhPointsRef = m_data.mhPoints(); + const std::vector& mhPointsRef = m_data.mhPoints; QVERIFY2(mhPointsRef.size() == 1, "ERROR, mhPoints().size() failed!!"); - const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon(), mhPointsRef.front().lat()); + const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon, mhPointsRef.front().lat); DEBUG_LOG(m_logger) << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs(); QVERIFY2(distanceMeter(mhPointsRef.front(), LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97000 78000"))) < 1, "ERROR, mhPointsRef failed!!"); @@ -1266,7 +1266,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() // get AesItemView: // // m_data should contain the id bc onExplosionClusterChanged: - const int simId = m_data.id(); + const int simId = m_data.id; AreaEffectSimulation::AesItemView itemView; DEBUG_LOG(m_logger) << " TNE VERIFICATION: simId = " << simId; @@ -1274,27 +1274,27 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() const bool bFound = m_aesDtc->aesItemViewFromEntityId(simId, AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions, itemView); QVERIFY2(bFound, "ERROR,aesItemViewFromEntityId failed!!"); - QVERIFY2(itemView.aesItemId() == simId, "ERROR,aesItemViewFromEntityId failed!!"); + QVERIFY2(itemView.aesItemId == simId, "ERROR,aesItemViewFromEntityId failed!!"); INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; - const double rot = m_data.area().rotation(); + const double rot = m_data.area.rotation; const double rotSfmOrg = compassToMathAngleForSfm(rot); const double rotSfmPlus90 = compassToMathAngleForSfm(rot+90); INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " randomNumber = ????????" - << ", width=" << m_data.area().width() - << ", height=" << m_data.area().height() + << ", width=" << m_data.area.width + << ", height=" << m_data.area.height << ", ausrichtung=" << ausrichtung << ", rot=" << rot << ", rotSfmOrg=" << rotSfmOrg << ", rotSfmPlus90=" << rotSfmPlus90 - << ", m_data.mhPoints().size()=" << m_data.mhPoints().size(); + << ", m_data.mhPoints().size()=" << m_data.mhPoints.size(); - const std::vector &formRef = itemView.form(); + const std::vector &formRef = itemView.form; for (const Core::GeoPosition &geoCoord : qAsConst(formRef)) { - const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat()); + const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat); INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; } @@ -1342,7 +1342,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() const int rotation = ausrichtung; AreaEffectSimulation::ExplosionCluster eaData = getEcForTneVerification(QStringLiteral("ModuleTest_TneVerificationBremen_02__"), rotation); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1351,13 +1351,13 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); // Check MHP: - const std::vector& mhPointsRef = m_data.mhPoints(); + const std::vector& mhPointsRef = m_data.mhPoints; QVERIFY2(mhPointsRef.size() == 1, "ERROR, mhPoints().size() failed!!"); - const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon(), mhPointsRef.front().lat()); + const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon, mhPointsRef.front().lat); DEBUG_LOG(m_logger) << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs(); QVERIFY2(distanceMeter(mhPointsRef.front(), LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97000 78000"))) < 1, "ERROR, mhPointsRef failed!!"); @@ -1365,7 +1365,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() // get AesItemView: // // m_data should contain the id bc onExplosionClusterChanged: - const int simId = m_data.id(); + const int simId = m_data.id; AreaEffectSimulation::AesItemView itemView; DEBUG_LOG(m_logger) << " TNE VERIFICATION: simId = " << simId; @@ -1373,27 +1373,27 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() const bool bFound = m_aesDtc->aesItemViewFromEntityId(simId, AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions, itemView); QVERIFY2(bFound, "ERROR,aesItemViewFromEntityId failed!!"); - QVERIFY2(itemView.aesItemId() == simId, "ERROR,aesItemViewFromEntityId failed!!"); + QVERIFY2(itemView.aesItemId == simId, "ERROR,aesItemViewFromEntityId failed!!"); INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; - const double rot = m_data.area().rotation(); + const double rot = m_data.area.rotation; const double rotSfmOrg = compassToMathAngleForSfm(rot); const double rotSfmPlus90 = compassToMathAngleForSfm(rot+90); INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " randomNumber = ????????" - << ", width=" << m_data.area().width() - << ", height=" << m_data.area().height() + << ", width=" << m_data.area.width + << ", height=" << m_data.area.height << ", ausrichtung=" << ausrichtung << ", rot=" << rot << ", rotSfmOrg=" << rotSfmOrg << ", rotSfmPlus90=" << rotSfmPlus90 - << ", m_data.mhPoints().size()=" << m_data.mhPoints().size(); + << ", m_data.mhPoints().size()=" << m_data.mhPoints.size(); - const std::vector &formRef = itemView.form(); + const std::vector &formRef = itemView.form; for (const Core::GeoPosition &geoCoord : qAsConst(formRef)) { - const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat()); + const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat); INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; } @@ -1446,7 +1446,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_Proximity() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_1104_Proximity_ec__")); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec // // eaData.impactCount(120); m_replyError = true; @@ -1456,7 +1456,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_Proximity() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntExplosionCluster == 4, "ERROR, cnt failed!!"); // EsPrepared, EsActivated, isObjectModifiable==false, EsExpired @@ -1471,16 +1471,16 @@ void ModuleTestExplosionCluster::test_bldg_1104_Proximity() QVERIFY2(m_counterDds.cntTrajectory == 4, "ERROR, cnt failed!!"); // 4 impacts -> 4 trajectory // 25.11.2024 - QVERIFY2(checkSingleEffects(0, LtsCoordinate(0.202561540523851, 0.916109327069519, 97.36), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(1, LtsCoordinate(0.202563069434816, 0.916108822522219, 99.37), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(2, LtsCoordinate(0.202564591566166, 0.916108475073837, 100.66), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(3, LtsCoordinate(0.202566139016178, 0.916108284016931, 101.21), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(0, LtsCoordinate(0.202561540523851, 0.916109327069519, 97.36), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(1, LtsCoordinate(0.202563069434816, 0.916108822522219, 99.37), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(2, LtsCoordinate(0.202564591566166, 0.916108475073837, 100.66), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(3, LtsCoordinate(0.202566139016178, 0.916108284016931, 101.21), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); // UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche: // mal Raum 2209 -> {9, 18, 27, 36} // mal Raum 2308 -> {9, 18, 27, 40} - bool bOk = checkBldgStates({9, 18, 27, 36}, QString::fromStdString(eaData.name())) || - checkBldgStates({9, 18, 27, 40}, QString::fromStdString(eaData.name())); + bool bOk = checkBldgStates({9, 18, 27, 36}, QString::fromStdString(eaData.name)) || + checkBldgStates({9, 18, 27, 40}, QString::fromStdString(eaData.name)); QVERIFY2(bOk, "ERROR, checkBldgStates failed!!"); @@ -1499,8 +1499,8 @@ void ModuleTestExplosionCluster::test_bldg_1104_Impact() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_1104_Impact_ec__")); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1509,18 +1509,18 @@ void ModuleTestExplosionCluster::test_bldg_1104_Impact() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); // 25.11.2024 - QVERIFY2(checkSingleEffects(0, LtsCoordinate(0.202561627985573, 0.916110065124748, 94.75), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(1, LtsCoordinate(0.202563154670975, 0.916109519058226, 96.80), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(2, LtsCoordinate(0.202564693697330, 0.916109157164788, 98.10), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(3, LtsCoordinate(0.202566253464458, 0.916108977469463, 98.68), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(0, LtsCoordinate(0.202561627985573, 0.916110065124748, 94.75), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(1, LtsCoordinate(0.202563154670975, 0.916109519058226, 96.80), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(2, LtsCoordinate(0.202564693697330, 0.916109157164788, 98.10), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(3, LtsCoordinate(0.202566253464458, 0.916108977469463, 98.68), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); // UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche: - QVERIFY2(checkBldgStates({14, 32, 49, 63}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({14, 32, 49, 63}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -1537,8 +1537,8 @@ void ModuleTestExplosionCluster::test_bldg_1104_Delay() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_1104_Delay_ec__")); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1547,20 +1547,20 @@ void ModuleTestExplosionCluster::test_bldg_1104_Delay() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); // 25.11.2024 - QVERIFY2(checkSingleEffects(0, LtsCoordinate(0.202561720250798, 0.916110735664395, 92.15), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(1, LtsCoordinate(0.202563249164409, 0.916110231116934, 94.22), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(2, LtsCoordinate(0.202564803395849, 0.916109882960961, 95.55), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); - QVERIFY2(checkSingleEffects(3, LtsCoordinate(0.202566382946022, 0.916109691196411, 96.15), AesZPlacement_def::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(0, LtsCoordinate(0.202561720250798, 0.916110735664395, 92.15), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(1, LtsCoordinate(0.202563249164409, 0.916110231116934, 94.22), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(2, LtsCoordinate(0.202564803395849, 0.916109882960961, 95.55), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); + QVERIFY2(checkSingleEffects(3, LtsCoordinate(0.202566382946022, 0.916109691196411, 96.15), AesZPlacement::ZpAbsolute, bldgName), "ERROR, checkSingleEffects failed!!"); // Vor Anpassung der MTP-Flächenausdehung: 30, 47, 68, 87 // Nach Anpassung der MTP-Flächenausdehung: 30, 56, 74, 90 // UNABHÄNGIG von [GUEZE-2766] Zünderarten Freifläche: - QVERIFY2(checkBldgStates({30, 56, 74, 90}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({30, 56, 74, 90}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -1583,7 +1583,7 @@ void ModuleTestExplosionCluster::test_bldg_1106_Proximity() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1106(QStringLiteral("ModuleTest_1106_Proximity_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1592,7 +1592,7 @@ void ModuleTestExplosionCluster::test_bldg_1106_Proximity() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); @@ -1603,9 +1603,9 @@ void ModuleTestExplosionCluster::test_bldg_1106_Proximity() if (bIsKanaeleAssigned) // QVERIFY2(checkBldgStates({14, 22, 29, 37}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); // since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche: - QVERIFY2(checkBldgStates({15, 23, 30, 38}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({15, 23, 30, 38}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); else - QVERIFY2(checkBldgStates({14, 30, 45, 61}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({14, 30, 45, 61}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -1623,8 +1623,8 @@ void ModuleTestExplosionCluster::test_bldg_1106_Impact() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1106(QStringLiteral("ModuleTest_1106_Impact_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1633,7 +1633,7 @@ void ModuleTestExplosionCluster::test_bldg_1106_Impact() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); @@ -1642,9 +1642,9 @@ void ModuleTestExplosionCluster::test_bldg_1106_Impact() const bool bIsKanaeleAssigned = isKanaeleAssigned(); NOTICE_LOG(m_logger) << LOGFUNCTION << " bIsKanaeleAssigned = " << bIsKanaeleAssigned; if (bIsKanaeleAssigned) - QVERIFY2(checkBldgStates({14, 28, 41, 56}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({14, 28, 41, 56}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); else - QVERIFY2(checkBldgStates({14, 41, 68, 88}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({14, 41, 68, 88}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -1661,8 +1661,8 @@ void ModuleTestExplosionCluster::test_bldg_1106_Delay() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1106(QStringLiteral("ModuleTest_1106_Delay_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeDelay); + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeDelay; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1671,7 +1671,7 @@ void ModuleTestExplosionCluster::test_bldg_1106_Delay() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); @@ -1680,9 +1680,9 @@ void ModuleTestExplosionCluster::test_bldg_1106_Delay() const bool bIsKanaeleAssigned = isKanaeleAssigned(); NOTICE_LOG(m_logger) << LOGFUNCTION << " bIsKanaeleAssigned = " << bIsKanaeleAssigned; if (bIsKanaeleAssigned) - QVERIFY2(checkBldgStates({14, 43, 72, 86 }, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({14, 43, 72, 86 }, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); else - QVERIFY2(checkBldgStates({14, 71, 90, 99}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({14, 71, 90, 99}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -1700,7 +1700,7 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Proximity() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcForUBAHN(QStringLiteral("ModuleTest_UBAHN_Proximity_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1709,13 +1709,13 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Proximity() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); // QVERIFY2(checkBldgStates({2, 4, 6, 6}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); // since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche: - QVERIFY2(checkBldgStates({2, 4, 7, 7}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({2, 4, 7, 7}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -1740,8 +1740,8 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Impact() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcForUBAHN(QStringLiteral("ModuleTest_UBAHN_Impact_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1750,14 +1750,14 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Impact() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); // NT, Nov 2024: Durch irgendwelche Anpassungen scheint es sich verändert zu haben: {4, 8, 9, 10} -> {4, 5, 9, 8} // NT, Feb 2025: Nun doch wieder das alte? damagePercent IST: QVector(4, 8, 9, 10) - bool bCheckBldgOk = checkBldgStates({4, 8, 9, 10}, QString::fromStdString(eaData.name())) || - checkBldgStates({4, 5, 7, 8}, QString::fromStdString(eaData.name())); + bool bCheckBldgOk = checkBldgStates({4, 8, 9, 10}, QString::fromStdString(eaData.name)) || + checkBldgStates({4, 5, 7, 8}, QString::fromStdString(eaData.name)); QVERIFY2(bCheckBldgOk, "ERROR, checkBldgStates failed!!"); @@ -1784,8 +1784,8 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Delay() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcForUBAHN(QStringLiteral("ModuleTest_UBAHN_Delay_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeDelay); + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeDelay; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1794,11 +1794,11 @@ void ModuleTestExplosionCluster::test_bldg_UBAHN_Delay() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); - QVERIFY2(checkBldgStates({8, 11, 13, 13}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({8, 11, 13, 13}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -1823,8 +1823,8 @@ void ModuleTestExplosionCluster::test_bldg_3101_Proximity() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor3101(QStringLiteral("ModuleTest_3101_Proximity_ec__")); - eaData.effectStart((time(nullptr) + 50) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectStart = (time(nullptr) + 50) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1833,13 +1833,13 @@ void ModuleTestExplosionCluster::test_bldg_3101_Proximity() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); // QVERIFY2(checkBldgStates({7, 13, 20, 27}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); // since 13.11.2024 ; [GUEZE-2766] Zünderarten Freifläche: - QVERIFY2(checkBldgStates({7, 14, 21, 28}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({7, 14, 21, 28}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -1865,8 +1865,8 @@ void ModuleTestExplosionCluster::test_bldg_3101_Impact() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor3101(QStringLiteral("ModuleTest_3101_Impact_ec__")); - eaData.effectStart((time(nullptr) + 50) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); + eaData.effectStart = (time(nullptr) + 50) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1875,11 +1875,11 @@ void ModuleTestExplosionCluster::test_bldg_3101_Impact() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); - QVERIFY2(checkBldgStates({7, 13, 25, 36}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({7, 13, 25, 36}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -1904,8 +1904,8 @@ void ModuleTestExplosionCluster::test_bldg_3101_Delay() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor3101(QStringLiteral("ModuleTest_3101_Delay_ec__")); - eaData.effectStart((time(nullptr) + 50) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeDelay); + eaData.effectStart = (time(nullptr) + 50) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeDelay; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1914,11 +1914,11 @@ void ModuleTestExplosionCluster::test_bldg_3101_Delay() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); - QVERIFY2(checkBldgStates({7, 13, 37, 58}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({7, 13, 37, 58}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -1941,14 +1941,14 @@ void ModuleTestExplosionCluster::test_remove_effect_start() QVERIFY2(checkParticipant_5(), "ERROR, checkParticipant_5 failed!!"); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_RemoveEffectStart_ec__")); - eaData.effectStart((time(nullptr) + 40) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectStart = (time(nullptr) + 40) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; // SubStruct FlightCurve FlightCurve fc; - fc.requestedRelativePeakHeight(-1); - fc.requestedFlightDuration(10 * 1000); - eaData.flightCurve(toOptional(fc)); + fc.requestedRelativePeakHeight = -1; + fc.requestedFlightDuration = 10 * 1000; + eaData.flightCurve = toOptional(fc); m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -1965,9 +1965,9 @@ void ModuleTestExplosionCluster::test_remove_effect_start() } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared..."; - if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, 2)) + if (!waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared;}, 2)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id(); + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id; return; } @@ -1981,8 +1981,8 @@ void ModuleTestExplosionCluster::test_remove_effect_start() { NOTICE_LOG(m_logger) << LOGFUNCTION << " ACTION: prepared back to created ... "; AreaEffectSimulation::ExplosionCluster copy = eaData; - copy.id(m_data.id()); - copy.effectStart().reset(); // 'remove' -> prepared back to created + copy.id = m_data.id; + copy.effectStart.reset(); // 'remove' -> prepared back to created int ret = doExplosionClusterModifyRequest(copy); QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); @@ -1992,15 +1992,15 @@ void ModuleTestExplosionCluster::test_remove_effect_start() } INFO_LOG(m_logger) << LOGFUNCTION << " waiting to make sure, that next step is never reached:"; - if (waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, 60)) + if (waitForData([this]() { return m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated;}, 60)) { - ERROR_LOG(m_logger) << "Next step is accidentically reached of explosion cluster with id " << m_data.id(); + ERROR_LOG(m_logger) << "Next step is accidentically reached of explosion cluster with id " << m_data.id; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG(m_logger) << LOGFUNCTION << " object effectState: " << m_data.effectStateId(); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsCreated, "ERROR, ExplosionCluster in wrong state"); + INFO_LOG(m_logger) << LOGFUNCTION << " object effectState: " << m_data.effectStateId; + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsCreated, "ERROR, ExplosionCluster in wrong state"); dumpCnt(); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -2030,12 +2030,12 @@ void ModuleTestExplosionCluster::test_create_bulk() { QString name = QString(QStringLiteral("ModTst_Proximity_ec_%1")).arg(i); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(name); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec - eaData.effectDuration(60 * 1000); // 60 seconds - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec + eaData.effectDuration = 60 * 1000; // 60 seconds + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; - eaData.impactCount(60); - eaData.area().cornerBottomLeft().lon() = 0.20128 + (i*0.00001); + eaData.impactCount = 60; + eaData.area.cornerBottomLeft.lon = 0.20128 + (i*0.00001); int ret = doExplosionClusterModifyRequest(eaData); QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); @@ -2045,7 +2045,7 @@ void ModuleTestExplosionCluster::test_create_bulk() } // for waitForEffectStates(__LINE__, 5, 60, 60); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; @@ -2065,26 +2065,26 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_Point_1104_Impact_ec__")); - eaData.effectStart((time(nullptr) + 45) * 1000); // msec + eaData.effectStart = (time(nullptr) + 45) * 1000; // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); - eaData.chargeStruct().chargeTypeId(371); // radius == 25, diameter == 50m + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; + eaData.chargeStruct.chargeTypeId = 371; // radius == 25, diameter == 50m - QVERIFY2(eaData.flightCurve().is_set(), "ERROR, flightCurve() not set !!"); - eaData.flightCurve().get().requestedRelativePeakHeight(500); + QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!"); + eaData.flightCurve.get().requestedRelativePeakHeight = 500; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! should be interpreted at center of impact + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! should be interpreted at center of impact // LtsCoordTrans::UtmCoordinate newTargetPosUtm_Hill = LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U PD 77457 17613")); // 32U PD 77438 17632 // auto newPnt = newTargetPosUtm_Hill.geographic(); // eaData.area().cornerBottomLeft(Core::GeoPosition2D(newPnt.x(), newPnt.y())); // !!bottomLeft!! should be interpreted at center of impact - eaData.area().width(0); - eaData.area().height(0); - eaData.area().rotation(0); - eaData.mhPoints().resize(1); - eaData.impactCount(1); + eaData.area.width = 0; + eaData.area.height = 0; + eaData.area.rotation = 0; + eaData.mhPoints.resize(1); + eaData.impactCount = 1; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -2093,11 +2093,11 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); - QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -2121,30 +2121,30 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_Point_1104_SMArt_Impact_ec__")); - eaData.effectStart((time(nullptr) + 45) * 1000); // msec + eaData.effectStart = (time(nullptr) + 45) * 1000; // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); - eaData.chargeStruct().chargeTypeId(374); // 374: isSMArt=true ; radius == 25, diameter == 50m + 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.is_set()"; - QVERIFY2(eaData.flightCurve().is_set(), "ERROR, flightCurve() not set !!"); - NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve().is_set()"; + QVERIFY2(eaData.flightCurve.is_set(), "ERROR, flightCurve() not set !!"); + NOTICE_LOG(m_logger) << LOGFUNCTION << "Nach eaData.flightCurve.is_set()"; - eaData.flightCurve().get().requestedRelativePeakHeight(500); + eaData.flightCurve.get().requestedRelativePeakHeight = 500; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! should be interpreted at center of impact + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! should be interpreted at center of impact // LtsCoordTrans::UtmCoordinate newTargetPosUtm_Hill = LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U PD 77457 17613")); // 32U PD 77438 17632 // auto newPnt = newTargetPosUtm_Hill.geographic(); // eaData.area().cornerBottomLeft(Core::GeoPosition2D(newPnt.x(), newPnt.y())); // !!bottomLeft!! should be interpreted at center of impact - eaData.area().width(0); - eaData.area().height(0); - eaData.area().rotation(0); - eaData.mhPoints().resize(1); - eaData.impactCount(1); + eaData.area.width = 0; + eaData.area.height = 0; + eaData.area.rotation = 0; + eaData.mhPoints.resize(1); + eaData.impactCount = 1; m_replyError = true; @@ -2157,11 +2157,11 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); - QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({29}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -2184,30 +2184,30 @@ void ModuleTestExplosionCluster::test_bldg_1104_OC() m_data = AreaEffectSimulation::ExplosionCluster(); AreaEffectSimulation::ExplosionClusterOcModifyRequest requestOC; - requestOC.id(0); - requestOC.effectStart((time(nullptr) + 30) * 1000); // msec - requestOC.effectDuration(5000); // msec + requestOC.id = 0; + requestOC.effectStart = (time(nullptr) + 30) * 1000; // msec + requestOC.effectDuration = 5000; // msec QString name(QStringLiteral("ModuleTest_test_bldg_1104_OC")); - name += QString::number(requestOC.effectStart()); - requestOC.name(name.toStdString()); + name += QString::number(requestOC.effectStart); + requestOC.name = name.toStdString(); - requestOC.area().cornerBottomLeft(Core::GeoPosition2D(0.2025, 0.91611)); // !!bottomLeft!! - requestOC.area().width(20); - requestOC.area().height(30); - requestOC.area().rotation(17); + requestOC.area.cornerBottomLeft(Core::GeoPosition2D(0.2025, 0.91611)); // !!bottomLeft!! + requestOC.area.width = 20; + requestOC.area.height = 30; + requestOC.area.rotation = 17; - requestOC.mhpCount(2); - requestOC.mhpRotation(17); - requestOC.impactCount(3); - requestOC.chargeStruct().chargeTypeId(371); - requestOC.partyId(2); + requestOC.mhpCount = 2; + requestOC.mhpRotation = 17; + requestOC.impactCount = 3; + requestOC.chargeStruct.chargeTypeId = 371; + requestOC.partyId = 2; int ret = doExplosionClusterOcModifyRequest(requestOC); QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -2228,31 +2228,31 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_light() AreaEffectSimulation::ExplosionCluster eaData; - eaData.effectStart((time(nullptr) + 45) * 1000); // msec - eaData.effectDuration(5000); // 5 seconds + eaData.effectStart = (time(nullptr) + 45) * 1000; // msec + eaData.effectDuration = 5000; // 5 seconds QString name(QStringLiteral("ModuleTest_Point_1104_Light__")); - name += QString::number(eaData.effectStart().get()); - eaData.name(name.toStdString()); + name += QString::number(eaData.effectStart.get()); + eaData.name = name.toStdString(); - eaData.id(0); - eaData.externalId(815); + eaData.id = 0; + eaData.externalId = 815; - eaData.partyId(4); - eaData.participantId(-1); // <--------------- no participantId provided -> no curve/trajectory!?!! + eaData.partyId = 4; + eaData.participantId = -1; // <--------------- no participantId provided -> no curve/trajectory!?!! - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); - eaData.chargeStruct().chargeTypeId(s_ChargeTypeId1); + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; + eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! - eaData.area().width(10); - eaData.area().height(10); - eaData.area().rotation(0); + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! + eaData.area.width = 10; + eaData.area.height = 10; + eaData.area.rotation = 0; - eaData.mhPoints().resize(1); - eaData.impactCount(1); + eaData.mhPoints.resize(1); + eaData.impactCount = 1; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -2261,7 +2261,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_light() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); @@ -2287,31 +2287,31 @@ void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_on m_data = AreaEffectSimulation::ExplosionCluster(); AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest request; - request.id(0); + request.id = 0; - request.effectStart((time(nullptr) + 45) * 1000); // msec + request.effectStart = (time(nullptr) + 45) * 1000; // msec QString name(QStringLiteral("ModuleTest_PointGeometery_bldg_1104_effect_only")); - name += QString::number(request.effectStart().get()); - request.name(name.toStdString()); - request.element(request.name()); + name += QString::number(request.effectStart.get()); + request.name = name.toStdString(); + request.element = request.name; const QPointF impactPointF(0.20256382834808495, 0.9161105453111705); request.impactPosition(Core::GeoPosition2D(impactPointF.x(), impactPointF.y())); INFO_LOG(m_logger) << LOGFUNCTION << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs(); - request.chargeTypeId(371); - request.externalId(815); + request.chargeTypeId = 371; + request.externalId = 815; int ret = doExplosionClusterSingleEffectOnlyModifyRequest(request); QVERIFY2(ret != 0, "ERROR, doExplosionClusterSingleEffectOnlyModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 60, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); - QVERIFY2(checkBldgStates({29}, QString::fromStdString(request.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({29}, QString::fromStdString(request.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -2330,14 +2330,14 @@ void ModuleTestExplosionCluster::test_bldg_1104_effects_only() setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_1104_effects_only__")); - eaData.effectStart((time(nullptr) + 30) * 1000); // msec - eaData.chargeStruct().igniterTypeId(s_IgniterTypeProximity); + eaData.effectStart = (time(nullptr) + 30) * 1000; // msec + eaData.chargeStruct.igniterTypeId = s_IgniterTypeProximity; // // avoid trajectory : // // // eaData.partyId().reset(); ?? - eaData.participantId().reset(); + eaData.participantId.reset(); // // : avoid trajectory // @@ -2349,7 +2349,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_effects_only() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 150, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntExplosionCluster == 3, "ERROR, cnt failed!!"); // EsPrepared, isObjectModifiable==false, EsActivated, EsExpired @@ -2363,18 +2363,18 @@ void ModuleTestExplosionCluster::test_bldg_1104_effects_only() QVERIFY2(m_counterDds.cntTrajectory == 0, "ERROR, cnt failed!!"); // 4 impacts -> 4 trajectory - std::vector&singleEffects = m_effects.singleEffects(); + std::vector&singleEffects = m_effects.singleEffects; for (const AreaEffectSimulation::SingleEffect &se : qAsConst(singleEffects)) { // Since there is no trajectory, no intersection is calculated. // Therefore the impacts are on the ground. - QVERIFY2(se.singleEffectState() == AreaEffectSimulation::AesSingleEffectState_def::SesTriggered, "ERROR, wrong singleEffectState"); - QVERIFY2(se.zPlacement() == AreaEffectSimulation::AesZPlacement_def::ZpDraped, "ERROR, wrong zPlacement"); - QVERIFY2(se.position().z() > 90, "ERROR, wrong z-Value 1"); - QVERIFY2(se.position().z() < 95, "ERROR, wrong z-Value 2"); + QVERIFY2(se.singleEffectState == AreaEffectSimulation::AesSingleEffectState::SesTriggered, "ERROR, wrong singleEffectState"); + QVERIFY2(se.zPlacement == AreaEffectSimulation::AesZPlacement::ZpDraped, "ERROR, wrong zPlacement"); + QVERIFY2(se.position.z > 90, "ERROR, wrong z-Value 1"); + QVERIFY2(se.position.z < 95, "ERROR, wrong z-Value 2"); } - QVERIFY2(checkBldgStates({29, 59, 82, 94}, QString::fromStdString(eaData.name())), "ERROR, checkBldgStates failed!!"); + QVERIFY2(checkBldgStates({29, 59, 82, 94}, QString::fromStdString(eaData.name)), "ERROR, checkBldgStates failed!!"); NOTICE_LOG(m_logger) << LOGFUNCTION << " END"; } @@ -2397,28 +2397,28 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104() // setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_Point_1104_Impact_VULCANO__")); - eaData.effectStart((time(nullptr) + 130) * 1000); // msec + eaData.effectStart = (time(nullptr) + 130) * 1000; // msec - eaData.participantId(99); - eaData.partyId(3); + eaData.participantId = 99; + eaData.partyId = 3; - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); - eaData.chargeStruct().chargeTypeId(s_ChargeTypeIdVulcano); // s_ChargeTypeIdVulcano == 376 + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; + eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376 - QVERIFY2(eaData.flightCurve().is_set(), "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 - eaData.flightCurve().get().dropAngle(45); + QVERIFY2(eaData.flightCurve.is_set(), "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 + eaData.flightCurve.get().dropAngle = 45; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! - eaData.area().width(25); - eaData.area().height(25); - eaData.area().rotation(0); - eaData.mhPoints().resize(1); - eaData.impactCount(1); + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! + eaData.area.width = 25; + eaData.area.height = 25; + eaData.area.rotation = 0; + eaData.mhPoints.resize(1); + eaData.impactCount = 1; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -2427,7 +2427,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104() QVERIFY2(ret != 0, "ERROR, explosionClusterModifyRequest failed!!"); waitForEffectStates(__LINE__, 5, 150, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntExplosionCluster == 4, "ERROR, cnt failed!!"); // EsPrepared, EsActivated, isObjectModifiable==false, EsExpired @@ -2454,28 +2454,28 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify() // setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_Point_1104_Impact_VULCANO__")); - eaData.effectStart((time(nullptr) + 130) * 1000); // msec + eaData.effectStart = (time(nullptr) + 130) * 1000; // msec - eaData.participantId(99); - eaData.partyId(3); + eaData.participantId = 99; + eaData.partyId = 3; - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); - eaData.chargeStruct().chargeTypeId(s_ChargeTypeIdVulcano); // s_ChargeTypeIdVulcano == 376 + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; + eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376 - QVERIFY2(eaData.flightCurve().is_set(), "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 - eaData.flightCurve().get().dropAngle(45); + QVERIFY2(eaData.flightCurve.is_set(), "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 + eaData.flightCurve.get().dropAngle = 45; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! - eaData.area().width(25); - eaData.area().height(25); - eaData.area().rotation(0); - eaData.mhPoints().resize(1); - eaData.impactCount(1); + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! + eaData.area.width = 25; + eaData.area.height = 25; + eaData.area.rotation = 0; + eaData.mhPoints.resize(1); + eaData.impactCount = 1; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -2488,8 +2488,8 @@ 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()) - startTimeMsec = m_data.effectStart().get(); + if (m_data.effectStart.is_set()) + startTimeMsec = m_data.effectStart.get(); const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch(); const qint64 distMsec = startTimeMsec - nowMsec; @@ -2508,8 +2508,8 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify() QPointF newTargetPosGeo = s_newTargetPosUtm_1.geographic(); TargetPositionsModifyRequest request; - request.aesItemId(m_data.id()); - request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123)); + request.aesItemId = m_data.id; + request.positions.emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123)); NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2, doExplosionClusterTargetPositionsModify ..."; doExplosionClusterTargetPositionsModify(request); @@ -2519,7 +2519,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify() }); waitForEffectStates(__LINE__, 5, 150, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntExplosionCluster == 4, "ERROR, cnt failed!!"); // EsPrepared, EsActivated, isObjectModifiable==false, EsExpired @@ -2527,13 +2527,13 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify() QVERIFY2(m_counterDds.cntAtExplosionClusterGunToTargetLine == 1, "ERROR, cnt failed!!"); QVERIFY2(m_counterDds.cntExplosionClusterEffects == 1, "ERROR, cnt failed!!"); - QVERIFY2(m_effects.aesItemId() == m_data.id(), "ERROR, id mismatch"); - if (!m_effects.singleEffects().empty()) + QVERIFY2(m_effects.aesItemId == m_data.id, "ERROR, id mismatch"); + if (!m_effects.singleEffects.empty()) { - const AreaEffectSimulation::SingleEffect &se = m_effects.singleEffects().front(); - const Core::GeoPosition &seGeoPos = se.position(); + const AreaEffectSimulation::SingleEffect &se = m_effects.singleEffects.front(); + const Core::GeoPosition &seGeoPos = se.position; - const LtsCoordTrans::UtmCoordinate &seUtmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(seGeoPos.lon(), seGeoPos.lat()); + const LtsCoordTrans::UtmCoordinate &seUtmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(seGeoPos.lon, seGeoPos.lat); int dist = LtsCoordTrans::distance(s_newTargetPosUtm_1, seUtmPos); NOTICE_LOG(m_logger) << LOGFUNCTION << " dist = " << dist; @@ -2558,28 +2558,28 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() // setFilterForBldgState(bldgName); AreaEffectSimulation::ExplosionCluster eaData = getEcFor1104(QStringLiteral("ModuleTest_Point_1104_Impact_VULCANO__")); - eaData.effectStart((time(nullptr) + 130) * 1000); // msec + eaData.effectStart = (time(nullptr) + 130) * 1000; // msec - eaData.participantId(99); - eaData.partyId(3); + eaData.participantId = 99; + eaData.partyId = 3; - eaData.chargeStruct().igniterTypeId(s_IgniterTypeImpact); - eaData.chargeStruct().chargeTypeId(s_ChargeTypeIdVulcano); // s_ChargeTypeIdVulcano == 376 + eaData.chargeStruct.igniterTypeId = s_IgniterTypeImpact; + eaData.chargeStruct.chargeTypeId = s_ChargeTypeIdVulcano; // s_ChargeTypeIdVulcano == 376 - QVERIFY2(eaData.flightCurve().is_set(), "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 - eaData.flightCurve().get().dropAngle(45); + QVERIFY2(eaData.flightCurve.is_set(), "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 + eaData.flightCurve.get().dropAngle = 45; - eaData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); - eaData.area().cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! - eaData.area().width(25); - eaData.area().height(25); - eaData.area().rotation(0); - eaData.mhPoints().resize(1); - eaData.impactCount(1); + eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; + eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! + eaData.area.width = 25; + eaData.area.height = 25; + eaData.area.rotation = 0; + eaData.mhPoints.resize(1); + eaData.impactCount = 1; m_replyError = true; m_data = AreaEffectSimulation::ExplosionCluster(); @@ -2595,8 +2595,8 @@ 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()) - startTimeMsec = m_data.effectStart().get(); + if (m_data.effectStart.is_set()) + startTimeMsec = m_data.effectStart.get(); const qint64 nowMsec = QDateTime::currentMSecsSinceEpoch(); const qint64 distMsec = startTimeMsec - nowMsec; @@ -2618,8 +2618,8 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() // ^ TargetPositionsModifyRequest request; - request.aesItemId(m_data.id()); - request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123)); + request.aesItemId = m_data.id; + request.positions.emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 123)); NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 2, doExplosionClusterTargetPositionsModify ..."; doExplosionClusterTargetPositionsModify(request); @@ -2635,8 +2635,8 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() // ^ TargetPositionsModifyRequest request; - request.aesItemId(m_data.id()); - request.positions().emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 124)); + request.aesItemId = m_data.id; + request.positions.emplace_back(Core::GeoPosition(newTargetPosGeo.x(), newTargetPosGeo.y(), 124)); NOTICE_LOG(m_logger) << LOGFUNCTION << " TIMER 3, doExplosionClusterTargetPositionsModify ..."; doExplosionClusterTargetPositionsModify(request); @@ -2646,7 +2646,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() }); waitForEffectStates(__LINE__, 5, 150, 30); - QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); QTest::qWait(500); QTest::qWait(500); @@ -2659,14 +2659,14 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() QVERIFY2(m_counterDds.cntAtExplosionClusterGunToTargetLine == 1, "ERROR, cnt failed!!"); QVERIFY2(m_counterDds.cntExplosionClusterEffects == 1, "ERROR, cnt failed!!"); - QVERIFY2(m_effects.aesItemId() == m_data.id(), "ERROR, id mismatch"); - QVERIFY2(m_effects.singleEffects().size() == 1, "ERROR, m_effects.singleEffects().size() failed"); - if (!m_effects.singleEffects().empty()) + QVERIFY2(m_effects.aesItemId == m_data.id, "ERROR, id mismatch"); + QVERIFY2(m_effects.singleEffects.size() == 1, "ERROR, m_effects.singleEffects().size() failed"); + if (!m_effects.singleEffects.empty()) { - const AreaEffectSimulation::SingleEffect &se = m_effects.singleEffects().front(); - const Core::GeoPosition &seGeoPos = se.position(); + const AreaEffectSimulation::SingleEffect &se = m_effects.singleEffects.front(); + const Core::GeoPosition &seGeoPos = se.position; - const LtsCoordTrans::UtmCoordinate &seUtmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(seGeoPos.lon(), seGeoPos.lat()); + const LtsCoordTrans::UtmCoordinate &seUtmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(seGeoPos.lon, seGeoPos.lat); // compare with s_newTargetPosUtm_1, not s_newTargetPosUtm_2: int dist = LtsCoordTrans::distance(s_newTargetPosUtm_1, seUtmPos); @@ -2680,11 +2680,11 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2() // 1st AesItemView for boundary: AreaEffectSimulation::AesItemView itemViewBoundary; - const bool found = m_aesDtc->aesItemViewFromEntityId(m_data.id(), AreaEffectSimulation::AesType::AtExplosionCluster, itemViewBoundary); + const bool found = m_aesDtc->aesItemViewFromEntityId(m_data.id, AreaEffectSimulation::AesType::AtExplosionCluster, itemViewBoundary); QVERIFY2(found, "ERROR, aesItemViewFromEntityId failed!!"); - const Core::GeoPosition2D &bottomLeftGeo = itemViewBoundary.boundingBoxBottomLeft(); - const LtsCoordTrans::UtmCoordinate &bottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(bottomLeftGeo.lon(), bottomLeftGeo.lat()); + const Core::GeoPosition2D &bottomLeftGeo = itemViewBoundary.boundingBoxBottomLeft; + const LtsCoordTrans::UtmCoordinate &bottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(bottomLeftGeo.lon, bottomLeftGeo.lat); const int distBL = LtsCoordTrans::distance(s_newTargetPosUtm_1, bottomLeftUtm); NOTICE_LOG(m_logger) << LOGFUNCTION << " itemViewBoundary.dist = " << distBL; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp index f6e957516..2ad75026f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp @@ -59,7 +59,7 @@ void ModuleTestLimits::testExplosionClusterCentral() for (int i = 0; i < m_maxExplosionsCentral + s_offset; ++i) { QString name = QStringLiteral("TEST_EC") + QStringLiteral("_CEN_") + QString::number(i); - explosionCluster.name(name.toStdString()); + explosionCluster.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->explosionClusterModifyRequest(explosionCluster, this); if (i < m_maxExplosionsCentral) @@ -73,7 +73,7 @@ void ModuleTestLimits::testExplosionClusterCentral() const auto &items = m_aesDtc->explosionClusters(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true) ++counter; } @@ -93,7 +93,7 @@ void ModuleTestLimits::testExplosionClusterDecentral() for (int i = 0; i < m_maxExplosionsDecentral + s_offset; ++i) { QString name = QStringLiteral("TEST_EC") + QStringLiteral("_DEC_") + QString::number(i); - explosionCluster.name(name.toStdString()); + explosionCluster.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->explosionClusterModifyRequest(explosionCluster, this); if (i < m_maxExplosionsDecentral) @@ -106,7 +106,7 @@ void ModuleTestLimits::testExplosionClusterDecentral() const auto &items = m_aesDtc->explosionClusters(); for (const auto &item : qAsConst(items)) { - if ((item.effectStateId() == AesEffectState::EsPrepared) && (item.isCentral() == false)) + if ((item.effectStateId == AesEffectState::EsPrepared) && (item.isCentral == false)) ++counter; } @@ -127,7 +127,7 @@ void ModuleTestLimits::testAirSupports() for (int i = 0; i < m_maxAirSupports + s_offset; ++i) { QString name = QStringLiteral("TEST_AS") + QStringLiteral("_CEN_") + QString::number(i); - airSupport.name(name.toStdString()); + airSupport.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->explosionClusterModifyRequest(airSupport, this); if (i < m_maxAirSupports) @@ -142,7 +142,7 @@ void ModuleTestLimits::testAirSupports() const auto &items = m_aesDtc->explosionClusters(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() && m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId()) == ProjectDataManagement::GearClass::AirSupport) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral && m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct.chargeTypeId) == ProjectDataManagement::GearClass::GearClass_AirSupport) ++counter; } @@ -158,11 +158,11 @@ void ModuleTestLimits::testMineAreaCentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto mineArea = getMa(); - mineArea.segments(m_segmentsCentral); + mineArea.segments = m_segmentsCentral; for (int i = 0; i < m_maxMineAreasCentral + s_offset; ++i) { QString name = QStringLiteral("TEST_MA") + QStringLiteral("_CEN_") + QString::number(i); - mineArea.name(name.toStdString()); + mineArea.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->mineAreaModifyRequest(mineArea, this); if (i < m_maxMineAreasCentral) @@ -175,7 +175,7 @@ void ModuleTestLimits::testMineAreaCentral() const auto &items = m_aesDtc->mineAreas(); for (const auto &item : qAsConst(items)) { - if ((item.effectStateId() == AesEffectState::EsPrepared) && (item.isCentral() == true)) + if ((item.effectStateId == AesEffectState::EsPrepared) && (item.isCentral == true)) ++counter; } @@ -191,11 +191,11 @@ void ModuleTestLimits::testMineAreaDecentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto mineArea = getMa(); - mineArea.segments(m_segmentsDecentral); + mineArea.segments = m_segmentsDecentral; for (int i = 0; i < m_maxMineAreasDecentral - m_maxSafePzAbwSafe + s_offset; ++i) { QString name = QStringLiteral("TEST_MA") + QStringLiteral("_DEC_") + QString::number(i); - mineArea.name(name.toStdString()); + mineArea.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->mineAreaModifyRequest(mineArea, this); if (i < (m_maxMineAreasDecentral - m_maxSafePzAbwSafe)) @@ -209,7 +209,7 @@ void ModuleTestLimits::testMineAreaDecentral() const auto &items = m_aesDtc->mineAreas(); for (const auto &curMineArea : qAsConst(items)) { - if ((curMineArea.effectStateId() == AesEffectState::EsPrepared) && (curMineArea.isCentral() == false)) + if ((curMineArea.effectStateId == AesEffectState::EsPrepared) && (curMineArea.isCentral == false)) ++counter; } @@ -218,11 +218,11 @@ void ModuleTestLimits::testMineAreaDecentral() // QVERIFY2(counter == m_maxMineAreasDecentral, "Too few mine areas"); - mineArea.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType_def::LptArtillery); + mineArea.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery; for (int i = 0; i < m_maxSafePzAbwSafe + s_offset; ++i) { QString name = QStringLiteral("TEST_MA_ART") + QStringLiteral("_DEC_") + QString::number(i); - mineArea.name(name.toStdString()); + mineArea.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->mineAreaModifyRequest(mineArea, this); if (i < m_maxSafePzAbwSafe) @@ -236,9 +236,9 @@ void ModuleTestLimits::testMineAreaDecentral() const auto &mineAreas = m_aesDtc->mineAreas(); for (const auto &item : qAsConst(mineAreas)) { - if ((item.effectStateId() == AesEffectState::EsPrepared) && - !item.isCentral() && - (item.layingProcedureType() == AreaEffectSimulation::AesMaLayingProcedureType_def::LptArtillery)) + if ((item.effectStateId == AesEffectState::EsPrepared) && + !item.isCentral && + (item.layingProcedureType == AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery)) ++counter2; } @@ -252,12 +252,12 @@ void ModuleTestLimits::testNBCCentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto nbContamination = getNBC(); - nbContamination.impactPosition(m_centralPoint); + nbContamination.impactPosition = m_centralPoint; for (int i = 0; i < m_maxNBCCentral + s_offset; ++i) { QString name = QStringLiteral("TEST_NBC") + QStringLiteral("_CEN_") + QString::number(i); - nbContamination.name(name.toStdString()); + nbContamination.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->nContaminationModifyRequest(nbContamination, this); if (i < m_maxNBCCentral) @@ -272,7 +272,7 @@ void ModuleTestLimits::testNBCCentral() const auto &items = m_aesDtc->nContaminations(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true) ++counter; } @@ -288,12 +288,12 @@ void ModuleTestLimits::testNBCDecentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto nbContamination = getNBC(); - nbContamination.impactPosition(m_decentralPoint); + nbContamination.impactPosition = m_decentralPoint; for (int i = 0; i < m_maxNBCDecentral + s_offset; ++i) { QString name = QStringLiteral("TEST_NBC") + QStringLiteral("_DEC_") + QString::number(i); - nbContamination.name(name.toStdString()); + nbContamination.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->nContaminationModifyRequest(nbContamination, this); if (i < m_maxNBCDecentral) @@ -307,7 +307,7 @@ void ModuleTestLimits::testNBCDecentral() const auto &items = m_aesDtc->nContaminations(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == false) ++counter; } @@ -325,7 +325,7 @@ void ModuleTestLimits::testOffRouteMines() for (int i = 0; i < m_maxOffRouteMines + s_offset; ++i) { QString name = QStringLiteral("TEST_ORM") + QStringLiteral("_") + QString::number(i); - offRouteMine.name(name.toStdString()); + offRouteMine.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->offRouteMineModifyRequest(offRouteMine, this); if (i < m_maxOffRouteMines) @@ -339,7 +339,7 @@ void ModuleTestLimits::testOffRouteMines() const auto &items = m_aesDtc->offRouteMines(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true) ++counter; } @@ -358,7 +358,7 @@ void ModuleTestLimits::testBoobyTraps() for (int i = 0; i < m_maxBoobyTraps + s_offset; ++i) { QString name = QStringLiteral("TEST_BT") + QStringLiteral("_") + QString::number(i); - boobyTrap.name(name.toStdString()); + boobyTrap.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->boobyTrapModifyRequest(boobyTrap, this); if (i < m_maxBoobyTraps) @@ -371,7 +371,7 @@ void ModuleTestLimits::testBoobyTraps() const auto &items = m_aesDtc->boobyTraps(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true) ++counter; } @@ -386,12 +386,12 @@ void ModuleTestLimits::testBCCCentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto bcContamination = getBCC(); - bcContamination.impactPosition(m_centralPoint); + bcContamination.impactPosition = m_centralPoint; for (int i = 0; i < m_maxNBCCentral + s_offset; ++i) { QString name = QStringLiteral("TEST_BCC") + QStringLiteral("_CEN_") + QString::number(i); - bcContamination.name(name.toStdString()); + bcContamination.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->bCContaminationModifyRequest(bcContamination, this); if (i < m_maxNBCCentral) @@ -406,7 +406,7 @@ void ModuleTestLimits::testBCCCentral() const auto &items = m_aesDtc->bCContaminations(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true) ++counter; } @@ -421,12 +421,12 @@ void ModuleTestLimits::testBCCDecentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto bcContamination = getBCC(); - bcContamination.impactPosition(m_decentralPoint); + bcContamination.impactPosition = m_decentralPoint; for (int i = 0; i < m_maxNBCDecentral + s_offset; ++i) { QString name = QStringLiteral("TEST_BCC") + QStringLiteral("_DEC_") + QString::number(i); - bcContamination.name(name.toStdString()); + bcContamination.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->bCContaminationModifyRequest(bcContamination, this); if (i < m_maxNBCDecentral) @@ -441,7 +441,7 @@ void ModuleTestLimits::testBCCDecentral() const auto &items = m_aesDtc->bCContaminations(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == false) ++counter; } @@ -456,12 +456,12 @@ void ModuleTestLimits::testFADecentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto functionArea = getFA(); - functionArea.area().cornerBottomLeft(m_decentralPoint); + functionArea.area.cornerBottomLeft = m_decentralPoint; for (int i = 0; i < m_maxFunctionalAreaDec + s_offset; ++i) { QString name = QStringLiteral("TEST_FA") + QStringLiteral("_DEC_") + QString::number(i); - functionArea.name(name.toStdString()); + functionArea.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->functionalAreaModifyRequest(functionArea, this); if (i < m_maxFunctionalAreaDec) @@ -476,7 +476,7 @@ void ModuleTestLimits::testFADecentral() const auto &items = m_aesDtc->functionalAreas(); for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == false) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == false) ++counter; } @@ -492,12 +492,12 @@ void ModuleTestLimits::testFACentral() QVERIFY2(m_aesFtc, "ERROR, No Aes Ftc available!!"); auto functionArea = getFA(); - functionArea.area().cornerBottomLeft(m_centralPoint); + functionArea.area.cornerBottomLeft = m_centralPoint; for (int i = 0; i < m_maxFunctionalAreaCentral + s_offset; ++i) { QString name = QStringLiteral("TEST_FA") + QStringLiteral("_CEN_") + QString::number(i); - functionArea.name(name.toStdString()); + functionArea.name = name.toStdString(); QTest::qWait(50); int ret = m_aesFtc->functionalAreaModifyRequest(functionArea, this); if (i < m_maxFunctionalAreaCentral) @@ -513,7 +513,7 @@ void ModuleTestLimits::testFACentral() for (const auto &item : qAsConst(items)) { - if (item.effectStateId() == AesEffectState::EsPrepared && item.isCentral() == true) + if (item.effectStateId == AesEffectState::EsPrepared && item.isCentral == true) ++counter; } @@ -608,26 +608,26 @@ ExplosionClusterModifyRequest ModuleTestLimits::getEc(const Core::GeoPosition2D { AreaEffectSimulation::ExplosionClusterModifyRequest eaReq; - eaReq.id(0); + eaReq.id = 0; - eaReq.effectStart((time(nullptr) + 30) * 1000); // msec + eaReq.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(QStringLiteral("Test_EC")); - eaReq.name(name.toStdString()); - eaReq.effectDuration(100000); // 10 seconds - eaReq.effectStart(QDateTime::currentMSecsSinceEpoch() + 3000000000); - eaReq.chargeStruct().chargeTypeId(s_ChargeTypeId1); - eaReq.chargeStruct().igniterTypeId(s_IgniterTypeId); + eaReq.name = name.toStdString(); + eaReq.effectDuration = 100000; // 10 seconds + eaReq.effectStart = QDateTime::currentMSecsSinceEpoch() + 3000000000; + eaReq.chargeStruct.chargeTypeId = s_ChargeTypeId1; + eaReq.chargeStruct.igniterTypeId = s_IgniterTypeId; - eaReq.partyId(2); - eaReq.participantId(6); + eaReq.partyId = 2; + eaReq.participantId = 6; - eaReq.mhpCount(4); - eaReq.impactCount(4); + eaReq.mhpCount = 4; + eaReq.impactCount = 4; - eaReq.peakHeight(500); + eaReq.peakHeight = 500; - eaReq.firePurposeId(1); // 1=Blenden, 2=Blenden mit IR, + eaReq.firePurposeId = 1; // 1=Blenden, 2=Blenden mit IR, const double height = 10; const double width = 20; @@ -635,15 +635,15 @@ ExplosionClusterModifyRequest ModuleTestLimits::getEc(const Core::GeoPosition2D // NOTICE_LOG(m_logger) << "getEc: default SpecicalArea Bottom Left" << m_specialArea.boundingBoxBottomLeft(); // eaReq.area().cornerBottomLeft(m_specialArea.boundingBoxBottomLeft()); - eaReq.area().cornerBottomLeft(cornerBottomLeft); - eaReq.area().height(height); - eaReq.area().width(width); - eaReq.area().rotation(rot); + eaReq.area.cornerBottomLeft = cornerBottomLeft; + eaReq.area.height = height; + eaReq.area.width = width; + eaReq.area.rotation = rot; - eaReq.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); - eaReq.tla(0); // aka zog / ZielOrtungsGenauigkeit + eaReq.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; + eaReq.tla = 0; // aka zog / ZielOrtungsGenauigkeit - eaReq.externalId(0); + eaReq.externalId = 0; return eaReq; } @@ -651,26 +651,26 @@ ExplosionClusterModifyRequest ModuleTestLimits::getEc(const Core::GeoPosition2D ExplosionClusterModifyRequest ModuleTestLimits::getAs() { AreaEffectSimulation::ExplosionClusterModifyRequest eaReq; - eaReq.id(0); + eaReq.id = 0; - eaReq.effectStart((time(nullptr) + 30) * 1000); // msec + eaReq.effectStart = (time(nullptr) + 30) * 1000; // msec QString name(QStringLiteral("Test_EC")); - eaReq.name(name.toStdString()); - eaReq.effectDuration(100000); // 10 seconds - eaReq.effectStart(QDateTime::currentMSecsSinceEpoch() + 3000000000); - eaReq.chargeStruct().chargeTypeId(450); //PGM GBU 31 - eaReq.chargeStruct().igniterTypeId(s_IgniterTypeId); + eaReq.name = name.toStdString(); + eaReq.effectDuration = 100000; // 10 seconds + eaReq.effectStart = QDateTime::currentMSecsSinceEpoch() + 3000000000; + eaReq.chargeStruct.chargeTypeId = 450; //PGM GBU 31 + eaReq.chargeStruct.igniterTypeId = s_IgniterTypeId; - eaReq.partyId(2); - eaReq.participantId(6); + eaReq.partyId = 2; + eaReq.participantId = 6; - eaReq.mhpCount(1); - eaReq.impactCount(1); + eaReq.mhpCount = 1; + eaReq.impactCount = 1; - eaReq.peakHeight(500); + eaReq.peakHeight = 500; - eaReq.firePurposeId(1); // 1=Blenden, 2=Blenden mit IR, + eaReq.firePurposeId = 1; // 1=Blenden, 2=Blenden mit IR, const double height = 10; const double width = 20; @@ -678,15 +678,15 @@ ExplosionClusterModifyRequest ModuleTestLimits::getAs() // NOTICE_LOG(m_logger) << "getAs: Default is SpecialArea Bottom Left" << m_specialArea.boundingBoxBottomLeft(); // eaReq.area().cornerBottomLeft(m_specialArea.boundingBoxBottomLeft()); - eaReq.area().cornerBottomLeft(m_centralPoint); - eaReq.area().height(height); - eaReq.area().width(width); - eaReq.area().rotation(rot); + eaReq.area.cornerBottomLeft = m_centralPoint; + eaReq.area.height = height; + eaReq.area.width = width; + eaReq.area.rotation = rot; - eaReq.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); // AirSupport -> EgPoint - eaReq.tla(0); // aka zog / ZielOrtungsGenauigkeit + eaReq.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; // AirSupport -> EgPoint + eaReq.tla = 0; // aka zog / ZielOrtungsGenauigkeit - eaReq.externalId(0); + eaReq.externalId = 0; return eaReq; } @@ -696,15 +696,15 @@ ExplosionAreaModifyRequest ModuleTestLimits::getEa() auto ea = ExplosionAreaModifyRequest(); ea.area(AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70)); - ea.name(QStringLiteral("Test_AE__").toStdString()); - ea.id(0); - ea.cannonCount(10); - ea.cannonRounds(10); - ea.chargeTypeId(s_ChargeTypeId1); - ea.effectDuration(400000); - ea.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); - ea.partyId(2); - ea.externalId(2); + ea.name = QStringLiteral("Test_AE__").toStdString(); + ea.id = 0; + ea.cannonCount = 10; + ea.cannonRounds = 10; + ea.chargeTypeId = s_ChargeTypeId1; + ea.effectDuration = 400000; + ea.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; + ea.partyId = 2; + ea.externalId = 2; return ea; } @@ -712,13 +712,13 @@ ExplosionAreaModifyRequest ModuleTestLimits::getEa() ExplosionSingleModifyRequest ModuleTestLimits::getEs() { auto es = ExplosionSingleModifyRequest(); - es.impactPosition(m_decentralPoint); - es.name(QStringLiteral("Test_AE__").toStdString()); - es.id(0); - es.chargeTypeId(s_ChargeTypeId1); - es.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); - es.partyId(2); - es.externalId(2); + es.impactPosition = m_decentralPoint; + es.name = QStringLiteral("Test_AE__").toStdString(); + es.id = 0; + es.chargeTypeId = s_ChargeTypeId1; + es.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; + es.partyId = 2; + es.externalId = 2; return es; } @@ -727,18 +727,18 @@ MineAreaModifyRequest ModuleTestLimits::getMa() { auto ma = MineAreaModifyRequest(); - ma.id(0); - ma.name(QStringLiteral("Test_MA_").toStdString()); - ma.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); - ma.effectDuration(400000); - ma.density(0.5); - ma.width(169.58); - ma.partyId(2); - ma.chargeStruct().chargeTypeId(216); - ma.isCenterLine(false); - ma.isLaidHidden(false); - ma.distance(500.0); - ma.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType_def::LptPioneer); + ma.id = 0; + ma.name = QStringLiteral("Test_MA_").toStdString(); + ma.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; + ma.effectDuration = 400000; + ma.density = 0.5; + ma.width = 169.58; + ma.partyId = 2; + ma.chargeStruct.chargeTypeId = 216; + ma.isCenterLine = false; + ma.isLaidHidden = false; + ma.distance = 500.0; + ma.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptPioneer; return ma; @@ -747,20 +747,20 @@ MineAreaModifyRequest ModuleTestLimits::getMa() NContaminationModifyRequest ModuleTestLimits::getNBC() { auto nbc = NContaminationModifyRequest(); - nbc.id(0); - nbc.name("Test_NBC_"); - nbc.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); // msec - nbc.effectDuration(10000); // 10 sec - nbc.chargeTypeId(321); - nbc.impactPosition(m_decentralPoint); - nbc.borderLengthInner(1000); // 1km - nbc.borderLengthOuter(2000); // 2km - nbc.impactRadius(500); // 500m - nbc.spanAngle(31); - nbc.rotationAngle(57); - nbc.detonationValue(1000); // kt, only cosmetical - nbc.partyId(2); - nbc.externalId(0); + nbc.id = 0; + nbc.name = "Test_NBC_"; + nbc.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; // msec + nbc.effectDuration = 10000; // 10 sec + nbc.chargeTypeId = 321; + nbc.impactPosition = m_decentralPoint; + nbc.borderLengthInner = 1000; // 1km + nbc.borderLengthOuter = 2000; // 2km + nbc.impactRadius = 500; // 500m + nbc.spanAngle = 31; + nbc.rotationAngle = 57; + nbc.detonationValue = 1000; // kt, only cosmetical + nbc.partyId = 2; + nbc.externalId = 0; return nbc; } @@ -768,68 +768,68 @@ NContaminationModifyRequest ModuleTestLimits::getNBC() OffRouteMineModifyRequest ModuleTestLimits::getORM() { auto orm = OffRouteMineModifyRequest(); - orm.id(0); - orm.effectStart(QDateTime::currentMSecsSinceEpoch() + 300000000); // msec - orm.effectDuration(100000); // 10 sec - orm.chargeTypeId(253); - orm.name("Test_ORM_"); - orm.area().cornerBottomLeft(m_decentralPoint); - orm.area().width(1000);//(20); - orm.area().height(200);//(15); - orm.area().rotation(0.0);//(20.5); - orm.impactRadius(100); // 100m - orm.partyId(2); + orm.id = 0; + orm.effectStart = QDateTime::currentMSecsSinceEpoch() + 300000000; // msec + orm.effectDuration = 100000; // 10 sec + orm.chargeTypeId = 253; + orm.name = "Test_ORM_"; + orm.area.cornerBottomLeft = m_decentralPoint; + orm.area.width = 1000;//(20); + orm.area.height = 200;//(15); + orm.area.rotation = 0.0;//(20.5); + orm.impactRadius = 100; // 100m + orm.partyId = 2; return orm; } BoobyTrapModifyRequest ModuleTestLimits::getBT() { auto bt = BoobyTrapModifyRequest(); - bt.id(0); - bt.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); // msec - bt.effectDuration(100000); // 10 sec - bt.chargeTypeId(251); - bt.name("Test_BT_"); - bt.impactPosition(m_decentralPoint); - bt.centralAngle(90); - bt.rotationAngle(120); - bt.impactRadius(100); // 100m - bt.triggerRadius(200); - bt.partyId(2); + bt.id = 0; + bt.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; // msec + bt.effectDuration = 100000; // 10 sec + bt.chargeTypeId = 251; + bt.name = "Test_BT_"; + bt.impactPosition = m_decentralPoint; + bt.centralAngle = 90; + bt.rotationAngle = 120; + bt.impactRadius = 100; // 100m + bt.triggerRadius = 200; + bt.partyId = 2; return bt; } BCContaminationModifyRequest ModuleTestLimits::getBCC() { auto bcc = BCContaminationModifyRequest(); - bcc.id(0); - bcc.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); // msec - bcc.effectDuration(100000); // 10 sec - bcc.impactRadius(100); // 100m - bcc.partyId(2); - bcc.upperOffset(6.0); - bcc.lowerOffset(-1000.0); - bcc.impactPosition(m_decentralPoint); - bcc.chargeTypeId(341); - bcc.weatherSource(AesWeatherSource::AwsStatic); + bcc.id = 0; + bcc.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; // msec + bcc.effectDuration = 100000; // 10 sec + bcc.impactRadius = 100; // 100m + bcc.partyId = 2; + bcc.upperOffset = 6.0; + bcc.lowerOffset = -1000.0; + bcc.impactPosition = m_decentralPoint; + bcc.chargeTypeId = 341; + bcc.weatherSource = AesWeatherSource::AwsStatic; return bcc; } FunctionalAreaModifyRequest ModuleTestLimits::getFA() { auto fa = FunctionalAreaModifyRequest(); - fa.id(0); - fa.effectStart(QDateTime::currentMSecsSinceEpoch() + 30000000); - fa.effectDuration(100000); + fa.id = 0; + fa.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000; + fa.effectDuration = 100000; fa.area(AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70)); - fa.chargeTypeId(311); - fa.partyId(2); - fa.deconMode(AreaEffectSimulation::AesOperatingMode::OmWaitingTime); - fa.deconTime(200000); - fa.maintMode(AreaEffectSimulation::AesOperatingMode::OmWaitingTime); - fa.maintTime(200000); - fa.medicMode(AreaEffectSimulation::AesOperatingMode::OmWaitingTime); - fa.medicTime(200000); + fa.chargeTypeId = 311; + fa.partyId = 2; + fa.deconMode = AreaEffectSimulation::AesOperatingMode::OmWaitingTime; + fa.deconTime = 200000; + fa.maintMode = AreaEffectSimulation::AesOperatingMode::OmWaitingTime; + fa.maintTime = 200000; + fa.medicMode = AreaEffectSimulation::AesOperatingMode::OmWaitingTime; + fa.medicTime = 200000; return fa; } @@ -837,9 +837,9 @@ FunctionalAreaModifyRequest ModuleTestLimits::getFA() TechnicalAreaModifyRequest ModuleTestLimits::getTA() { auto ta = TechnicalAreaModifyRequest(); - ta.id(0); + ta.id = 0; ta.area(AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70)); - ta.type(AreaEffectSimulation::AesTechnicalAreaType::TatRestingAreaVehicle); + ta.type = AreaEffectSimulation::AesTechnicalAreaType::TatRestingAreaVehicle; return ta; } @@ -896,8 +896,8 @@ void ModuleTestLimits::initTestCase() std::cout << " waitForHistoricalDataExercise... Done" << std::endl; const ExerciseManagement::Exercise &exercise = m_exmDtc->exercise(m_exerciseId); - QVERIFY2(exercise.id() == m_exerciseId, "ERROR, exercise failed!!: "); - m_traingAreaId = exercise.trainingAreaId(); + QVERIFY2(exercise.id == m_exerciseId, "ERROR, exercise failed!!: "); + m_traingAreaId = exercise.trainingAreaId; std::cout << " ExerciseManagement" << ", m_traingAreaId = " << m_traingAreaId << std::endl; @@ -937,7 +937,7 @@ void ModuleTestLimits::initTestCase() m_ismDtc->waitForHistoricalDataSpecialArea(1000); - if (m_exmDtc->exercise(m_exerciseId).trainingAreaId() == s_TraingAreaId_Altmark) + if (m_exmDtc->exercise(m_exerciseId).trainingAreaId == s_TraingAreaId_Altmark) { m_centralPoint = m_centralAltmark; m_decentralPoint = m_decentralAltmark; @@ -1143,9 +1143,9 @@ void ModuleTestLimits::setupParticipant() ParticipantManagement::SetSimulatedPosition req; - req.participantId(6); // according testDB - req.onlyOutdatedParticipants(false); - req.position(Core::GeoPosition(m_partPos.lon(), m_partPos.lat(), 0.0)); + req.participantId = 6; // according testDB + req.onlyOutdatedParticipants = false; + req.position(Core::GeoPosition(m_partPos.lon, m_partPos.lat, 0.0)); INFO_LOG(m_logger) << " setSimulatedPositionRequest ..."; m_replyError = true; @@ -1169,10 +1169,10 @@ void ModuleTestLimits::setupCharges() { QVERIFY2(m_aesFtc, "ERROR, no m_aesFtc"); ChargeAdministrationModifyRequest req; - req.id(0); - req.chargeTypeId(371); - req.partyId(2); - req.amount(9999999); + req.id = 0; + req.chargeTypeId = 371; + req.partyId = 2; + req.amount = 9999999; m_aesFtc->chargeAdministrationModifyRequest(req, this); } @@ -1194,80 +1194,80 @@ void ModuleTestLimits::deleteAesAreas() auto clusters = m_aesDtc->explosionClusters(); for (auto cluster : qAsConst(clusters)) { - if (!sts.contains(cluster.effectStateId().underlying())) + if (!sts.contains(cluster.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(cluster.id()); + removeReq.id = cluster.id; m_aesFtc->explosionClusterRemoveRequest(removeReq, this); } } auto nbcs = m_aesDtc->nContaminations(); for (auto nbc : qAsConst(nbcs)) { - if (!sts.contains(nbc.effectStateId().underlying())) + if (!sts.contains(nbc.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(nbc.id()); + removeReq.id = nbc.id; m_aesFtc->nContaminationRemoveRequest(removeReq, this); } } auto orms = m_aesDtc->offRouteMines(); for (auto orm : qAsConst(orms)) { - if (!sts.contains(orm.effectStateId().underlying())) + if (!sts.contains(orm.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(orm.id()); + removeReq.id = orm.id; m_aesFtc->offRouteMineRemoveRequest(removeReq, this); } } auto bts = m_aesDtc->boobyTraps(); for (auto bt : qAsConst(bts)) { - if (!sts.contains(bt.effectStateId().underlying())) + if (!sts.contains(bt.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(bt.id()); + removeReq.id = bt.id; m_aesFtc->boobyTrapRemoveRequest(removeReq, this); } } auto mas = m_aesDtc->mineAreas(); for (auto ma : qAsConst(mas)) { - if (!sts.contains(ma.effectStateId().underlying())) + if (!sts.contains(ma.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(ma.id()); + removeReq.id = ma.id; m_aesFtc->mineAreaRemoveRequest(removeReq, this); } } auto bccs = m_aesDtc->bCContaminations(); for (auto bcc : qAsConst(bccs)) { - if (!sts.contains(bcc.effectStateId().underlying())) + if (!sts.contains(bcc.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(bcc.id()); + removeReq.id = bcc.id; m_aesFtc->bCContaminationRemoveRequest(removeReq, this); } } auto fas = m_aesDtc->functionalAreas(); for (auto fa : qAsConst(fas)) { - if (!sts.contains(fa.effectStateId().underlying())) + if (!sts.contains(fa.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(fa.id()); + removeReq.id = fa.id; m_aesFtc->functionalAreaRemoveRequest(removeReq, this); } } auto tas = m_aesDtc->technicalAreas(); for (auto ta : qAsConst(tas)) { - if (!sts.contains(ta.effectStateId().underlying())) + if (!sts.contains(ta.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(ta.id()); + removeReq.id = ta.id; m_aesFtc->technicalAreaRemoveRequest(removeReq, this); } } @@ -1275,10 +1275,10 @@ void ModuleTestLimits::deleteAesAreas() auto eas = m_aesDtc->explosionAreas(); for (auto ea : qAsConst(eas)) { - if (!sts.contains(ea.effectStateId().underlying())) + if (!sts.contains(ea.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(ea.id()); + removeReq.id = ea.id; m_aesFtc->explosionAreaRemoveRequest(removeReq, this); } } @@ -1286,10 +1286,10 @@ void ModuleTestLimits::deleteAesAreas() auto ess = m_aesDtc->explosionSingles(); for (auto es : qAsConst(ess)) { - if (!sts.contains(es.effectStateId().underlying())) + if (!sts.contains(es.effectStateId)) { auto removeReq = Core::RemoveElementRequest(); - removeReq.id(es.id()); + removeReq.id = es.id; m_aesFtc->explosionSingleRemoveRequest(removeReq, this); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp index dddf4fb5b..d0f194a69 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp @@ -59,13 +59,13 @@ double distanceMeter(const LtsCoordTrans::UtmCoordinate &utmCoord1, const LtsCoo double distanceMeter(const Core::GeoPosition &geoPos, const LtsCoordTrans::UtmCoordinate &utmCoord) { - const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat()); + const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat); return distanceMeter(utmPos, utmCoord); } double distanceMeter(const Core::GeoPosition2D &geoPos2D, const LtsCoordTrans::UtmCoordinate &utmCoord) { - const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos2D.lon(), geoPos2D.lat()); + const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos2D.lon, geoPos2D.lat); return distanceMeter(utmPos, utmCoord); } @@ -118,17 +118,17 @@ void ModuleTestAesOthers::onOffRouteMineRemoveReply(const Core::FunctionReplyObj void ModuleTestAesOthers::boobyTrapChanged(const BoobyTrap &data, DataModification modType) { Q_UNUSED(modType); - if (data.id() == -1) + if (data.id == -1) return; ++m_counterDds.cntBoobyTrap; m_dataBoobyTrap = data; qint64 startTimeMsec = -1; - if (m_dataBoobyTrap.effectStart().is_set()) - startTimeMsec = m_dataBoobyTrap.effectStart().get(); + if (m_dataBoobyTrap.effectStart.is_set()) + startTimeMsec = m_dataBoobyTrap.effectStart.get(); - DEBUG_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id() << ", state=" << m_dataBoobyTrap.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id << ", state=" << m_dataBoobyTrap.effectStateId << ", startTimeMsec=" << startTimeMsec << ", cntBoobyTrap=" << m_counterDds.cntBoobyTrap; TRACE_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap; @@ -137,17 +137,17 @@ void ModuleTestAesOthers::boobyTrapChanged(const BoobyTrap &data, DataModificati void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModification modType) { Q_UNUSED(modType); - if (data.id() == -1) + if (data.id == -1) return; ++m_counterDds.cntOffRouteMine; m_dataOffRouteMine = data; qint64 startTimeMsec = -1; - if (m_dataOffRouteMine.effectStart().is_set()) - startTimeMsec = m_dataOffRouteMine.effectStart().get(); + if (m_dataOffRouteMine.effectStart.is_set()) + startTimeMsec = m_dataOffRouteMine.effectStart.get(); - DEBUG_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id() << ", state=" << m_dataOffRouteMine.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id << ", state=" << m_dataOffRouteMine.effectStateId << ", startTimeMsec=" << startTimeMsec << ", cntOffRouteMine=" << m_counterDds.cntOffRouteMine; TRACE_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine; @@ -159,15 +159,15 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D if (modType == DataModification::eRemoved) return; - AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying(); + AreaEffectSimulation::AesType::type aesType = aesItemView.aesTypeId().underlying(); DEBUG_LOG(m_logger) << " got onAesItemViewChanged, aesType=" << aesType; switch (aesType) { - case AreaEffectSimulation::AesType_def::AtBoobyTrap: - case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary: - case AreaEffectSimulation::AesType_def::AtOffRouteMine: - case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary: + case AreaEffectSimulation::AesType::AtBoobyTrap: + case AreaEffectSimulation::AesType::AtBoobyTrapSecondary: + case AreaEffectSimulation::AesType::AtOffRouteMine: + case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: ++m_counterDds.cntItemView; break; default: @@ -215,18 +215,18 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared..."; - if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) + if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared;}, durPrep)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated..."; - if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) + if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated;}, durAct)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -235,9 +235,9 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int if (durExp > 0) { INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired..."; - if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) + if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}, durExp)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -255,18 +255,18 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsPrepared..."; - if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) + if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared;}, durPrep)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsActivated..."; - if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) + if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated;}, durAct)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -275,9 +275,9 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in if (durExp > 0) { INFO_LOG(m_logger) << LOGFUNCTION << " waiting for EsExpired..."; - if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) + if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired;}, durExp)) { - ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -296,8 +296,8 @@ void ModuleTestAesOthers::setupParticipants() ParticipantManagement::SetSimulatedPosition req; { - req.participantId(18); // according testDB - req.onlyOutdatedParticipants(false); + req.participantId = 18; // according testDB + req.onlyOutdatedParticipants = false; const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7690018100")); // 32U PD 76900 18100 @@ -323,7 +323,7 @@ bool ModuleTestAesOthers::checkParticipant_18() // soll: QStringLiteral("32UPD7690018000")); // 32U PD 76900 18000 const int partId = 18; const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId); - QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat()); + QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos.lon, pos.pos.lat); INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 76900 18100"); @@ -337,8 +337,8 @@ bool ModuleTestAesOthers::tryRemoveOldBoobyTraps() for (const auto &bt : btMap) { - qCritical() << " bt.name" << bt.name().c_str(); - int ret = m_aesFtc->boobyTrapRemoveRequest(Core::RemoveElementRequest(bt.id())); + qCritical() << " bt.name" << bt.name.c_str(); + int ret = m_aesFtc->boobyTrapRemoveRequest(Core::RemoveElementRequest(bt.id)); qCritical() << " bt.name -> " << ret; } return true; @@ -347,17 +347,17 @@ bool ModuleTestAesOthers::tryRemoveOldBoobyTraps() int ModuleTestAesOthers::doBoobyTrapModifyRequest(const BoobyTrap &btData) { - BoobyTrapModifyRequest req(btData.id(), - btData.name(), - btData.effectDuration(), - btData.chargeStruct().chargeTypeId(), - btData.impactPosition(), - btData.impactRadius(), - btData.triggerRadius(), - btData.rotationAngle(), - btData.centralAngle(), - btData.effectStart(), - btData.partyId() + BoobyTrapModifyRequest req(btData.id, + btData.name, + btData.effectDuration, + btData.chargeStruct.chargeTypeId, + btData.impactPosition, + btData.impactRadius, + btData.triggerRadius, + btData.rotationAngle, + btData.centralAngle, + btData.effectStart, + btData.partyId ); int ret = m_aesFtc->boobyTrapModifyRequest(req, this); @@ -366,14 +366,14 @@ int ModuleTestAesOthers::doBoobyTrapModifyRequest(const BoobyTrap &btData) int ModuleTestAesOthers::doOffRouteMineModifyRequest(const OffRouteMine &offRouteMine) { - OffRouteMineModifyRequest req(offRouteMine.id(), - offRouteMine.name(), - offRouteMine.effectDuration(), - offRouteMine.chargeStruct().chargeTypeId(), - offRouteMine.area(), - offRouteMine.impactRadius(), - offRouteMine.effectStart(), - offRouteMine.partyId() + OffRouteMineModifyRequest req(offRouteMine.id, + offRouteMine.name, + offRouteMine.effectDuration, + offRouteMine.chargeStruct.chargeTypeId, + offRouteMine.area, + offRouteMine.impactRadius, + offRouteMine.effectStart, + offRouteMine.partyId ); int ret = m_aesFtc->offRouteMineModifyRequest(req, this); @@ -384,8 +384,8 @@ int ModuleTestAesOthers::doMoveParticipant(int participantId, const QString &new { ParticipantManagement::SetSimulatedPosition req; { - req.participantId(participantId); // according testDB - req.onlyOutdatedParticipants(false); + req.participantId = participantId; // according testDB + req.onlyOutdatedParticipants = false; const LtsCoordTrans::UtmCoordinate &utmPos = LtsCoordTrans::UtmCoordinate::fromMgrs(newPositionMGRS); // 32U PD 76900 18100 @@ -481,8 +481,8 @@ void ModuleTestAesOthers::initTestCase() std::cout << " waitForHistoricalDataExercise... Done" << std::endl; const ExerciseManagement::Exercise &exercise = m_exmDtc->exercise(m_exerciseId); - QVERIFY2(exercise.id() == m_exerciseId, "ERROR, exercise failed!!"); - m_traingAreaId = exercise.trainingAreaId(); + QVERIFY2(exercise.id == m_exerciseId, "ERROR, exercise failed!!"); + m_traingAreaId = exercise.trainingAreaId; std::cout << " ExerciseManagement" << ", m_traingAreaId = " << m_traingAreaId << std::endl; @@ -549,22 +549,22 @@ void ModuleTestAesOthers::test_boobyTrap_01() QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!"); AreaEffectSimulation::BoobyTrap bt; - bt.id(0); - bt.name(QString(QStringLiteral("ModuleTest_BoobyTrap01")).toStdString()); - bt.chargeStruct().chargeTypeId(252); - bt.effectDuration(60000); - bt.partyId(2); - bt.impactRadius(10); - bt.triggerRadius(5); + bt.id = 0; + bt.name = QString(QStringLiteral("ModuleTest_BoobyTrap01")).toStdString(); + bt.chargeStruct.chargeTypeId = 252; + bt.effectDuration = 60000; + bt.partyId = 2; + bt.impactRadius = 10; + bt.triggerRadius = 5; // Type1 == SchAbwMi ohne rotationAngle, centralAngle // Type2 == SchAbwRiMi mit rotationAngle, centralAngle LtsCoordinate lts = LtsCoordinate::fromUtmCoordinate(UtmCoordinate::fromMgrs(QStringLiteral("32U PD 77000 18100")), 0.0); - bt.impactPosition(lts.geoPosition2D()); + bt.impactPosition = lts.geoPosition2D(); - bt.effectStart((time(nullptr) + 10) * 1000); // msec + bt.effectStart = (time(nullptr) + 10) * 1000; // msec m_replyError = true; m_dataBoobyTrap = AreaEffectSimulation::BoobyTrap(); @@ -573,7 +573,7 @@ void ModuleTestAesOthers::test_boobyTrap_01() QVERIFY2(ret != 0, "ERROR, doBoobyTrapModifyRequest failed!!"); waitForEffectStatesBT(__LINE__, 5, 15, 0); // do _not_ wait for expired! - QVERIFY2(m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated, "ERROR, effectStateId failed!!"); + QVERIFY2(m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated, "ERROR, effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntBoobyTrap == 2, "ERROR, cnt failed!!"); // EsPrepared, EsActivated, QVERIFY2(m_counterDds.cntItemView == 4, "ERROR, cnt failed!!"); // @@ -588,9 +588,9 @@ void ModuleTestAesOthers::test_boobyTrap_01() doMoveParticipant(18, QStringLiteral("32U PD 77002 18103")); // wait until expired: - waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, 60); + waitForData([this]() { return m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }, 60); - QVERIFY2(m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); // wait to let it disappear: waitForData([]() { return false; }, 15); @@ -619,22 +619,22 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name, QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!"); AreaEffectSimulation::BoobyTrap bt; - bt.id(0); - bt.name(name.toStdString()); - bt.chargeStruct().chargeTypeId(252); - bt.effectDuration(600000); - bt.partyId(2); - bt.impactRadius(10); - bt.triggerRadius(5); + bt.id = 0; + bt.name = name.toStdString(); + bt.chargeStruct.chargeTypeId = 252; + bt.effectDuration = 600000; + bt.partyId = 2; + bt.impactRadius = 10; + bt.triggerRadius = 5; - bt.impactPosition(impactCoord.geoPosition()); + bt.impactPosition = impactCoord.geoPosition(); // Type1 == SchAbwMi ohne rotationAngle, centralAngle // Type2 == SchAbwRiMi mit rotationAngle, centralAngle - bt.rotationAngle(toOptional(rotationAngle)); // Q1: 30 - bt.centralAngle(toOptional(90.0)); + bt.rotationAngle = toOptional(rotationAngle); // Q1: 30 + bt.centralAngle = toOptional(90.0); - bt.effectStart((time(nullptr) + 10) * 1000); // msec + bt.effectStart = (time(nullptr) + 10) * 1000; // msec m_replyError = true; m_dataBoobyTrap = AreaEffectSimulation::BoobyTrap(); @@ -643,7 +643,7 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name, QVERIFY2(ret != 0, "ERROR, doBoobyTrapModifyRequest failed!!"); waitForEffectStatesBT(__LINE__, 5, 15, 0); // do _not_ wait for expired! - QVERIFY2(m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated, "ERROR, m_dataBoobyTrap effectStateId failed!!"); + QVERIFY2(m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated, "ERROR, m_dataBoobyTrap effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntBoobyTrap == 2, "ERROR, cnt failed!!"); // EsPrepared, EsActivated, QVERIFY2(m_counterDds.cntItemView == 4, "ERROR, cnt failed!!"); // @@ -660,9 +660,9 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name, doMoveParticipant(18, particpantCoord.mgrs()); // wait until expired: - waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, 60); + waitForData([this]() { return m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }, 60); - QVERIFY2(m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, effectStateId failed!!"); + QVERIFY2(m_dataBoobyTrap.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, effectStateId failed!!"); // wait to let it disappear: waitForData([]() { return false; }, 15); @@ -721,21 +721,21 @@ void ModuleTestAesOthers::test_offRouteMine_02() // offRouteMine2 = 254; // MIT impactRadius AreaEffectSimulation::OffRouteMine orm; - orm.id(0); - orm.name(QString(QStringLiteral("test_offRouteMine_02")).toStdString()); - orm.chargeStruct().chargeTypeId(254); - orm.effectDuration(600000); - orm.partyId(2); - orm.impactRadius(10); // 254 -> MIT impactRadius -> mit 3DSphere/Kugel + orm.id = 0; + orm.name = QString(QStringLiteral("test_offRouteMine_02")).toStdString(); + orm.chargeStruct.chargeTypeId = 254; + orm.effectDuration = 600000; + orm.partyId = 2; + orm.impactRadius = 10; // 254 -> MIT impactRadius -> mit 3DSphere/Kugel const LtsCoordinate &coord = LtsCoordinate::fromUtmCoordinate(UtmCoordinate::fromMgrs(QStringLiteral("32U PD 77000 18100")), 0.0); - orm.area().cornerBottomLeft(coord.geoPosition()); - orm.area().height(50); - orm.area().width(1); - orm.area().rotation(85); + orm.area.cornerBottomLeft = coord.geoPosition(); + orm.area.height = 50; + orm.area.width = 1; + orm.area.rotation = 85; - orm.effectStart((time(nullptr) + 10) * 1000); // msec + orm.effectStart = (time(nullptr) + 10) * 1000; // msec m_replyError = true; m_dataOffRouteMine = AreaEffectSimulation::OffRouteMine(); @@ -744,7 +744,7 @@ void ModuleTestAesOthers::test_offRouteMine_02() QVERIFY2(ret != 0, "ERROR, doOffRouteMineModifyRequest failed!!"); waitForEffectStatesORM(__LINE__, 5, 15, 0); // do _not_ wait for expired! - QVERIFY2(m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated, "ERROR, effectStateId failed!!"); + QVERIFY2(m_dataOffRouteMine.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated, "ERROR, effectStateId failed!!"); dumpCnt(); QVERIFY2(m_counterDds.cntOffRouteMine == 2, "ERROR, cnt failed!!"); // EsPrepared, EsActivated, QVERIFY2(m_counterDds.cntItemView == 4, "ERROR, cnt failed!!"); // @@ -761,13 +761,13 @@ void ModuleTestAesOthers::test_offRouteMine_02() doMoveParticipant(18, QStringLiteral("32U PD 77020 18095")); // wait until expired: - waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, 60); + waitForData([this]() { return m_dataOffRouteMine.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired; }, 60); - QVERIFY2(m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired, "ERROR, m_dataOffRouteMine effectStateId failed!!"); + QVERIFY2(m_dataOffRouteMine.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired, "ERROR, m_dataOffRouteMine effectStateId failed!!"); // wait to let it disappear: waitForData([]() { return false; }, 15); - INFO_LOG(m_logger) << LOGFUNCTION << " END" << ", name =" << orm.name() << "'"; + INFO_LOG(m_logger) << LOGFUNCTION << " END" << ", name =" << orm.name << "'"; } void ModuleTestAesOthers::cleanupTestCase() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_air_support_impact.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_air_support_impact.cpp index 357fdcda5..03796563c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_air_support_impact.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_air_support_impact.cpp @@ -138,7 +138,7 @@ 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.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); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp index 48e1904ef..d74a1b04b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp @@ -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).splitRef(QLatin1Char('.')).last().toString()) + , m_aesTypeName(QString::fromLatin1(loggerName).split(QLatin1Char('.')).last().toString()) , m_logger(getLogger(loggerName)) {} @@ -65,29 +65,29 @@ bool TestBase::waitForData(const std::function &func) bool TestBase::checkAesItem(const AreaEffectSimulation::AesItem &a, const AreaEffectSimulation::AesItem &b) const { - if (a.name() != b.name()) + if (a.name != b.name) { - WARNING_LOG(m_logger) << "name does not match: " << a.name() << " - " << b.name(); + WARNING_LOG(m_logger) << "name does not match: " << a.name << " - " << b.name; return false; } - if (a.effectStart() != b.effectStart()) + if (a.effectStart != b.effectStart) { - WARNING_LOG(m_logger) << "effectStart does not match: " << a.effectStart() << " - " << b.effectStart(); + WARNING_LOG(m_logger) << "effectStart does not match: " << a.effectStart << " - " << b.effectStart; return false; } - if (a.chargeStruct().chargeTypeId() != b.chargeStruct().chargeTypeId()) + if (a.chargeStruct.chargeTypeId != b.chargeStruct.chargeTypeId) { - WARNING_LOG(m_logger) << "chargeTypeId does not match: " << a.chargeStruct().chargeTypeId() << " - " << b.chargeStruct().chargeTypeId(); + WARNING_LOG(m_logger) << "chargeTypeId does not match: " << a.chargeStruct.chargeTypeId << " - " << b.chargeStruct.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.participantId() != b.participantId()) + if (a.participantId != b.participantId) { - WARNING_LOG(m_logger) << "participantId does not match: " << a.participantId() << " - " << b.participantId(); + WARNING_LOG(m_logger) << "participantId does not match: " << a.participantId << " - " << b.participantId; return false; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_bccontamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_bccontamination.cpp index 277568f64..5c21ad835 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_bccontamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_bccontamination.cpp @@ -166,7 +166,7 @@ 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.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)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_booby_trap.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_booby_trap.cpp index 48db42047..ef440ef28 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_booby_trap.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_booby_trap.cpp @@ -89,10 +89,10 @@ void TestBoobyTrap::tryCreateBoobyTrap() btData.impactPosition(), btData.impactRadius(), btData.triggerRadius(), - btData.rotationAngle().get(), - btData.centralAngle().get(), - btData.effectStart().get(), - btData.partyId().get()), + btData.rotationAngle.get(), + btData.centralAngle.get(), + btData.effectStart.get(), + btData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error during BoobyTrapCreateRequest()"; @@ -122,10 +122,10 @@ void TestBoobyTrap::tryCreateBoobyTrap() btData.impactPosition(), btData.impactRadius(), btData.triggerRadius(), - btData.rotationAngle().get(), - btData.centralAngle().get(), - btData.effectStart().get(), - btData.partyId().get()), + btData.rotationAngle.get(), + btData.centralAngle.get(), + btData.effectStart.get(), + btData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error during BoobyTrapCreateRequest()"; @@ -153,7 +153,7 @@ 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.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)); @@ -173,10 +173,10 @@ void TestBoobyTrap::tryModifyBoobyTrap() btData.impactPosition(), btData.impactRadius(), btData.triggerRadius(), - btData.rotationAngle().get(), - btData.centralAngle().get(), - btData.effectStart().get(), - btData.partyId().get()), + btData.rotationAngle.get(), + btData.centralAngle.get(), + btData.effectStart.get(), + btData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error requesting modify data"; @@ -252,10 +252,10 @@ void TestBoobyTrap::tryRemoveBoobyTrap() btData.impactPosition(), btData.impactRadius(), btData.triggerRadius(), - btData.rotationAngle().get(), - btData.centralAngle().get(), - btData.effectStart().get(), - btData.partyId().get()), + btData.rotationAngle.get(), + btData.centralAngle.get(), + btData.effectStart.get(), + btData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error during BoobyTrapModifyRequest()"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area.cpp index e8a43aa9c..d27918d52 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area.cpp @@ -167,7 +167,7 @@ void TestExplosionArea::tryModifyExplosionArea() { INFO_LOG(m_logger) << "tryModifyExplosionArea start"; m_eaData.name("af2"); - m_eaData.effectStart(m_eaData.effectStart().get() + 3000); + 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)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area_bulk.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area_bulk.cpp index aa86c510c..5d650ea9d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area_bulk.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_area_bulk.cpp @@ -148,7 +148,7 @@ void TestExplosionAreaBulk::tryModifyExplosionArea() { INFO_LOG(m_logger) << "tryModifyExplosionArea start"; m_eaData.name("af2"); - m_eaData.effectStart(m_eaData.effectStart().get() + 3000); + 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)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_cluster.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_cluster.cpp index d937bd135..5c06f894b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_cluster.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_cluster.cpp @@ -69,7 +69,7 @@ void TestExplosionCluster::tryCreateExplosionCluster() eaData.effectStart((time(nullptr) + 30) * 1000); // msec QString name(QStringLiteral("ec__")); - name += QString::number(eaData.effectStart().get()); + name += QString::number(eaData.effectStart.get()); eaData.name(name.toStdString()); eaData.effectDuration(10000); // 10 seconds @@ -214,7 +214,7 @@ void TestExplosionCluster::tryModifyExplosionCluster() { INFO_LOG(m_logger) << "tryModifyExplosionCluster start"; m_ecData.name("af2"); - m_ecData.effectStart(m_ecData.effectStart().get() + 3000); + m_ecData.effectStart(m_ecData.effectStart.get() + 3000); m_ecData.effectDuration(9000); // 9 sec m_ecData.chargeTypeId(s_ChargeTypeId2); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_single.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_single.cpp index 090ef15c2..9d5a7c309 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_single.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_explosion_single.cpp @@ -147,7 +147,7 @@ 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.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); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_mine_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_mine_area.cpp index 5f2afb13c..b3d9335f9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_mine_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_mine_area.cpp @@ -433,7 +433,7 @@ 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.effectStart(m_maData.effectStart.get() + 2000); m_maData.chargeStruct().chargeTypeId(s_ChargeTypeId2); m_maData.effectDuration(4 * 1000); m_maData.density(0.2); @@ -645,7 +645,7 @@ void TestMineArea::tryTriggerDusMineInBoth() 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(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_off_route_mine.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_off_route_mine.cpp index 3496f49d0..fb8e3f888 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_off_route_mine.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_off_route_mine.cpp @@ -87,9 +87,9 @@ void TestOffRouteMine::tryCreateOffRouteMine() ormData.effectDuration(), ormData.chargeStruct().chargeTypeId(), ormData.area(), - ormData.impactRadius().get(), - ormData.effectStart().get(), - ormData.partyId().get()), + ormData.impactRadius.get(), + ormData.effectStart.get(), + ormData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error during OffRouteMineCreateRequest()"; @@ -117,9 +117,9 @@ void TestOffRouteMine::tryCreateOffRouteMine() ormData.effectDuration(), ormData.chargeStruct().chargeTypeId(), ormData.area(), - ormData.impactRadius().get(), - ormData.effectStart().get(), - ormData.partyId().get()), + ormData.impactRadius.get(), + ormData.effectStart.get(), + ormData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error during OffRouteMineCreateRequest()"; @@ -147,7 +147,7 @@ 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.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)); @@ -168,9 +168,9 @@ void TestOffRouteMine::tryModifyOffRouteMine() ormData.effectDuration(), ormData.chargeStruct().chargeTypeId(), ormData.area(), - ormData.impactRadius().get(), - ormData.effectStart().get(), - ormData.partyId().get()), + ormData.impactRadius.get(), + ormData.effectStart.get(), + ormData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error requesting modify data"; @@ -243,9 +243,9 @@ void TestOffRouteMine::tryRemoveOffRouteMine() ormData.effectDuration(), ormData.chargeStruct().chargeTypeId(), ormData.area(), - ormData.impactRadius().get(), - ormData.effectStart().get(), - ormData.partyId().get()), + ormData.impactRadius.get(), + ormData.effectStart.get(), + ormData.partyId.get()), this)) { ERROR_LOG(m_logger) << "Error during OffRouteMineModifyRequest()"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.cpp index 5f3c0126f..b18813108 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.cpp @@ -59,7 +59,7 @@ bool RecordReplayPluginCustom::setReplayStartTime(NSqlQuery &q, qint64 startTime { for (const auto &valie : copyTW.values(key)) { - if (valie.trajectoryStartTime() < startTime - 210*1000) + if (valie.trajectoryStartTime < startTime - 210*1000) { m_trajectoryTimeAwareMap.remove(key, valie); } @@ -264,7 +264,7 @@ bool RecordReplayPluginCustom::setReplayStartTime(NSqlQuery &q, qint64 startTime { for (const auto &valie : copyTI.values(key)) { - if (valie.sampleTime() < startTime - 210*1000) + if (valie.sampleTime < startTime - 210*1000) m_triggeredImpactsMap.remove(key, valie); } } @@ -295,7 +295,7 @@ bool RecordReplayPluginCustom::setReplayStartTime(NSqlQuery &q, qint64 startTime { for (const auto &valie : copy.values(key)) { - if( m_explosionClusterKeys.find(valie.aesItemId()) != m_explosionClusterKeys.end()) + if( m_explosionClusterKeys.find(valie.aesItemId) != m_explosionClusterKeys.end()) { m_effectsMap.remove(key, valie); continue; @@ -316,34 +316,34 @@ bool RecordReplayPluginCustom::setReplayStartTime(NSqlQuery &q, qint64 startTime { for (const auto &value : copy.values(key)) { - if (value.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsCreated - || value.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsFired - || value.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsReceived - || value.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared - || value.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated + if (value.effectStateId == AreaEffectSimulation::AesEffectState::EsCreated + || value.effectStateId == AreaEffectSimulation::AesEffectState::EsFired + || value.effectStateId == AreaEffectSimulation::AesEffectState::EsReceived + || value.effectStateId == AreaEffectSimulation::AesEffectState::EsPrepared + || value.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated ) continue; // check regarding _Explosion_Cluster { - static QVector relavantAesTypeIds = {AesType_def::AtExplosionClusterGunToTargetLine, AesType_def::AtExplosionClusterSingleTrajectory}; - if (relavantAesTypeIds.contains(value.aesTypeId().underlying())) + static QVector relavantAesTypeIds = {AesType::AtExplosionClusterGunToTargetLine, AesType::AtExplosionClusterSingleTrajectory}; + if (relavantAesTypeIds.contains(value.aesTypeId)) { - if (m_explosionClusterKeys.find(value.aesItemId()) != m_explosionClusterKeys.end() ) //contains not available until cpp 20 + if (m_explosionClusterKeys.find(value.aesItemId) != m_explosionClusterKeys.end() ) //contains not available until cpp 20 continue; } } // E01562-E343 EffectCluster: GunToTargetLines fehlen im Replay&Snapshot { - static QVector relavantAesTypeIds = {AesType_def::AtEffectClusterGunToTargetLine, AesType_def::AtEffectClusterGunToTargetLine}; - if (relavantAesTypeIds.contains(value.aesTypeId().underlying())) + static QVector relavantAesTypeIds = {AesType::AtEffectClusterGunToTargetLine, AesType::AtEffectClusterGunToTargetLine}; + if (relavantAesTypeIds.contains(value.aesTypeId)) { - if (m_effectClusterKeys.find(value.aesItemId()) != m_effectClusterKeys.end() ) //contains not available until cpp 20 + if (m_effectClusterKeys.find(value.aesItemId) != m_effectClusterKeys.end() ) //contains not available until cpp 20 continue; } } - if (value.effectStateId() == AesEffectState_def::EsRemoved || value.effectStart() < startTime - 210*1000) + if (value.effectStateId == AesEffectState::EsRemoved || value.effectStart < startTime - 210*1000) { m_aesItemViewMap.remove(key, value); } @@ -369,16 +369,16 @@ void RecordReplayPluginCustom::removeOld(QMultiMap &map, qint64 de for (const auto &inner : map.values(item)) { // Remove delted ones - if (inner.isDeleted()) + if (inner.isDeleted) { map.remove(item, inner); continue; } // keep planned - if (!inner.effectStart().is_set()) + if (!inner.effectStart.is_set()) continue; // Remove to old ones - if (inner.effectStart().get()+inner.effectDuration() < desiredTime - 210*1000 ) + if (inner.effectStart.get()+inner.effectDuration < desiredTime - 210*1000 ) map.remove(item, inner); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.h index de2b3fc55..053bb7244 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/RecordReplay/aes_record_replay_plugin_custom.h @@ -9,7 +9,7 @@ #include #include // fixup include path on 42.3 -> missing interface -#include <../../Common/PluginInterfaces/record_replay_plugin.h> +#include namespace AreaEffectSimulation diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp index 0d1dec52a..f83968ee0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp @@ -525,16 +525,16 @@ void UnitTestTrajectory::test_realStartPoint() bool myFuzzyCompare2D(const Core::GeoPosition& v1, const QPoint3D& v2) { return - qFuzzyCompare(v1.lon(), v2.x()) && - qFuzzyCompare(v1.lat(), v2.y()); + qFuzzyCompare(v1.lon, v2.x()) && + qFuzzyCompare(v1.lat, v2.y()); } bool myFuzzyCompare3D(const Core::GeoPosition& v1, const QPoint3D& v2) { return - qFuzzyCompare(v1.lon(), v2.x()) && - qFuzzyCompare(v1.lat(), v2.y()) && - qFuzzyCompare(v1.z(), v2.z()); + qFuzzyCompare(v1.lon, v2.x()) && + qFuzzyCompare(v1.lat, v2.y()) && + qFuzzyCompare(v1.z, v2.z()); } void UnitTestTrajectory::test_generateTrajectoryBiedziak() @@ -581,18 +581,18 @@ void UnitTestTrajectory::test_generateTrajectoryBiedziak() { const auto &item35 = trajectoryOut[35]; INFO_LOG(m_logger) << "iqtem35 = " << item35; - QVERIFY2(qFuzzyCompare(item35.z(), 148.044675655973), "TrajectoryGenerator::trajectoryOut failed"); + QVERIFY2(qFuzzyCompare(item35.z, 148.044675655973), "TrajectoryGenerator::trajectoryOut failed"); } { // Hier ist der Scheitelpunkt: const auto &item36 = trajectoryOut[36]; INFO_LOG(m_logger) << "item36 = " << item36; - QVERIFY2(qFuzzyCompare(item36.z(), 148.087567297406), "TrajectoryGenerator::trajectoryOut failed"); + QVERIFY2(qFuzzyCompare(item36.z, 148.087567297406), "TrajectoryGenerator::trajectoryOut failed"); } { const auto &item37 = trajectoryOut[37]; INFO_LOG(m_logger) << "item37 = " << item37; - QVERIFY2(qFuzzyCompare(item37.z(), 147.905786767084), "TrajectoryGenerator::trajectoryOut failed"); + QVERIFY2(qFuzzyCompare(item37.z, 147.905786767084), "TrajectoryGenerator::trajectoryOut failed"); } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator_vulcano.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator_vulcano.h index ed8be74e4..76bdcdf49 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator_vulcano.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator_vulcano.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include // std::setprecision diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/TrajectorySplitter/trajectory_splitter.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/TrajectorySplitter/trajectory_splitter.h index 5399e2e14..0bb8699ed 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/TrajectorySplitter/trajectory_splitter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/TrajectorySplitter/trajectory_splitter.h @@ -125,7 +125,7 @@ protected: for (const auto &posTimeAware : trajectory) { - relativeTimes.append(posTimeAware.relativeTime()); + relativeTimes.append(posTimeAware.relativeTime); } std::sort(relativeTimes.begin(), relativeTimes.end()); @@ -154,7 +154,7 @@ protected: { for (const auto &posTimeAware : trajectory) { - const qint64 currentTime = posTimeAware.relativeTime(); + const qint64 currentTime = posTimeAware.relativeTime; if (duplicateRelativeTime == currentTime) { @@ -172,11 +172,11 @@ protected: qint64 currentTime = std::numeric_limits::min(); for (const auto &posTimeAware : trajectory) { - if (posTimeAware.relativeTime() < currentTime) + if (posTimeAware.relativeTime < currentTime) { break; } - currentTime = posTimeAware.relativeTime(); + currentTime = posTimeAware.relativeTime; ++idx; } // for } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/UnitTest_Basics/basics_unit_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/UnitTest_Basics/basics_unit_test.cpp index 404ef5d17..69afe6c8a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/UnitTest_Basics/basics_unit_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/UnitTest_Basics/basics_unit_test.cpp @@ -61,8 +61,8 @@ void UnitTestBasics::test_operator_equal_1() AesItemView aesItem1, aesItem2; QVERIFY2(aesItem1 == aesItem2, "AesItemView::operator== failed"); - aesItem1.id(1); - aesItem2.id(1); + aesItem1.id = 1; + aesItem2.id = 1; QVERIFY2(aesItem1 == aesItem2, "AesItemView::operator== failed"); @@ -71,18 +71,18 @@ void UnitTestBasics::test_operator_equal_1() for (int i=1; i< 100; ++i) formVec.emplace_back(Core::GeoPosition(i*0.001, 100/i, 100/i)); - aesItem1.aesItemId(12); - aesItem1.sampleTime(12345567); - aesItem1.chargeStruct().chargeTypeId(123); - aesItem1.effectStart(123456789); - aesItem1.form(formVec); - aesItem1.boundingBoxBottomLeft(Core::GeoPosition2D(0.1, 0.2)); - aesItem1.boundingBoxTopRight(Core::GeoPosition2D(1.1, 1.2)); - aesItem1.aesTypeId(AreaEffectSimulation::AesType_def::AtBoobyTrap); - aesItem1.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); - aesItem1.partyId(2); + aesItem1.aesItemId = 12; + aesItem1.sampleTime = 12345567; + aesItem1.chargeStruct.chargeTypeId = 123; + aesItem1.effectStart = 123456789; + aesItem1.form = formVec; + aesItem1.boundingBoxBottomLeft = Core::GeoPosition2D(0.1, 0.2); + aesItem1.boundingBoxTopRight = Core::GeoPosition2D(1.1, 1.2); + aesItem1.aesTypeId = AreaEffectSimulation::AesType::AtBoobyTrap; + aesItem1.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated; + aesItem1.partyId = 2; - aesItem1.setId(2334); + aesItem1.setId = 2334; aesItem2 = aesItem1; QVERIFY2(aesItem1 == aesItem2, "AesItemView::operator== failed"); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/aes_statemachine_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/aes_statemachine_test.cpp index d37126bd1..df4c5a139 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/aes_statemachine_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/UnitTests/aes_statemachine_test.cpp @@ -54,19 +54,19 @@ void StateMachineTest::staticTests() const time_t tNow = time(nullptr); // newly created, nothing set -> checkEnterNewState() should switch to created - QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsCreated); + QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsCreated); // now we set a activation time -> Prepared m_dummyAesObject->setActivationTime(tNow + 5); - QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsPrepared); + QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsPrepared); // now back to created m_dummyAesObject->setActivationTime(0); - QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsCreated); + QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsCreated); // directly to activated m_dummyAesObject->setActivationTime(tNow); - QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsActivated); + QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsActivated); // pause not possible m_dummyAesObject->setSupportsPausing(false); @@ -89,7 +89,7 @@ void StateMachineTest::staticTests() { QTest::qWait(15); } - QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsExpired); + QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsExpired); // try to delete it QCOMPARE(m_dummyAesObject->trySwitchToRemoved(), false); @@ -102,7 +102,7 @@ void StateMachineTest::staticTests() m_dummyAesObject->setAesEffectState(AesEffectState::EsPaused); QCOMPARE(m_dummyAesObject->trySwitchToRemoved(), true); // an active/paused object must not set to deleted but to expired - QCOMPARE(m_dummyAesObject->effectState().underlying(), AesEffectState::EsExpired); + QCOMPARE(m_dummyAesObject->effectState(), AesEffectState::EsExpired); QCOMPARE(m_dummyAesObject->trySwitchToCreated(), false); } @@ -121,7 +121,7 @@ void StateMachineTest::dynamicTests() m_dummyAesObject->setDurationSec(2); QCOMPARE(m_dummyAesObject->isEndTimeSet(), true); - QCOMPARE(m_dummyAesObject->checkEnterNewState().underlying(), AesEffectState::EsPrepared); + QCOMPARE(m_dummyAesObject->checkEnterNewState(), AesEffectState::EsPrepared); QCOMPARE(spy.count(), 2); // Created, Prepared spy.clear(); @@ -132,7 +132,7 @@ void StateMachineTest::dynamicTests() if (m_dummyAesObject->effectState() == AesEffectState::EsActivated) break; } - QCOMPARE(m_dummyAesObject->effectState().underlying(), AesEffectState::EsActivated); + QCOMPARE(m_dummyAesObject->effectState(), AesEffectState::EsActivated); qDebug() << "Waiting for end time"; for (int i = 0; i < 200; ++i) @@ -142,7 +142,7 @@ void StateMachineTest::dynamicTests() break; } AreaEffectSimulation::AesEffectState state = m_dummyAesObject->effectState(); - QCOMPARE(state.underlying(), AesEffectState::EsExpired); + QCOMPARE(state, AesEffectState::EsExpired); QCOMPARE(spy.count(), 2); // Activated, Done spy.clear(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/aes_helper.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/aes_helper.h index 770325c82..e1c941ade 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/aes_helper.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/aes_helper.h @@ -48,10 +48,10 @@ inline std::string toString(const std::vector(coordinate.relativeTime); arr.append(coordObj); } obj[TRAJECTORY_RELATIVE_KEYWORD] = arr; @@ -83,10 +83,10 @@ inline std::vector fromString(const QString return {}; Core::RelativePositionRelativeTime coord; - coord.offsetX() = coordinate[QStringLiteral("offsetX")].toDouble(); - coord.offsetY() = coordinate[QStringLiteral("offsetY")].toDouble(); - coord.offsetZ() = coordinate[QStringLiteral("offsetZ")].toDouble(); - coord.relativeTime() = coordinate[QStringLiteral("relativeTime")].toInt(); + coord.offsetX = coordinate[QStringLiteral("offsetX")].toDouble(); + coord.offsetY = coordinate[QStringLiteral("offsetY")].toDouble(); + coord.offsetZ = coordinate[QStringLiteral("offsetZ")].toDouble(); + coord.relativeTime = coordinate[QStringLiteral("relativeTime")].toInt(); ret.push_back(coord); } @@ -119,8 +119,8 @@ inline double getAngleDegreeNorth(const QPointF &p1, const QPointF &p2) inline bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry) { - return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint) || - (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + return (geometry == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint) || + (geometry == AreaEffectSimulation::AesExplosionGeometry::EgPoint); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/ddsdbconvert.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/ddsdbconvert.cpp index 9144be02a..da736d6c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/ddsdbconvert.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/ddsdbconvert.cpp @@ -18,22 +18,22 @@ namespace DdsDbConvert Database::AesNContamination nContamination(const AreaEffectSimulation::NContamination &src) { Database::AesNContamination dst; - 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.effectDuration = src.effectDuration(); - dst.effectStart = src.effectStart().is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart().get()) : QDateTime(); - dst.name = QString::fromStdString(src.name()); - dst.impactPosition.rx() = src.impactPosition().lon(); - dst.impactPosition.ry() = src.impactPosition().lat(); - dst.borderLengthInner = src.borderLengthInner(); - dst.borderLengthOuter = src.borderLengthOuter(); - dst.impactRadius = src.impactRadius(); - dst.spanAngle = src.spanAngle(); - dst.rotationAngle = src.rotationAngle(); - dst.detonationValue = src.detonationValue(); + 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.effectDuration = src.effectDuration; + dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime(); + dst.name = QString::fromStdString(src.name); + dst.impactPosition.rx() = src.impactPosition.lon; + dst.impactPosition.ry() = src.impactPosition.lat; + dst.borderLengthInner = src.borderLengthInner; + dst.borderLengthOuter = src.borderLengthOuter; + dst.impactRadius = src.impactRadius; + dst.spanAngle = src.spanAngle; + dst.rotationAngle = src.rotationAngle; + dst.detonationValue = src.detonationValue; // dst.priv_entityId; // dst.privNContaminationId; return dst; @@ -42,23 +42,23 @@ Database::AesNContamination nContamination(const AreaEffectSimulation::NContamin 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.effectDuration = src.effectDuration(); - dst.effectStart = src.effectStart().is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart().get()) : QDateTime(); - dst.name = QString::fromStdString(src.name()); - dst.impactPosition.rx() = src.impactPosition().lon(); - dst.impactPosition.ry() = src.impactPosition().lat(); - dst.impactRadius = src.impactRadius(); - dst.chargeTypeId = src.chargeStruct().chargeTypeId(); - dst.windSpeed = src.windSpeed(); - dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.weatherTimestamp()); - dst.propagationDirection = src.propagationDirection(); + 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.effectDuration = src.effectDuration; + dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime(); + dst.name = QString::fromStdString(src.name); + dst.impactPosition.rx() = src.impactPosition.lon; + dst.impactPosition.ry() = src.impactPosition.lat; + dst.impactRadius = src.impactRadius; + dst.chargeTypeId = src.chargeStruct.chargeTypeId; + dst.windSpeed = src.windSpeed; + dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.weatherTimestamp); + dst.propagationDirection = src.propagationDirection; dst.weatherPosition = dst.impactPosition; // initial, is not used during update therefore it's ok here - dst.upperOffset = src.upperOffset(); - dst.lowerOffset = src.lowerOffset(); + dst.upperOffset = src.upperOffset; + dst.lowerOffset = src.lowerOffset; // dst.expansionFactor; // dst.isDynamicWeather; // dst.priv_entityId; @@ -69,24 +69,24 @@ Database::AesBCContamination bcContamination(const BCContamination &src) 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.effectDuration = src.effectDuration(); - dst.effectStart = src.effectStart().is_set() && 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(); - dst.impactLength = src.area().height(); - dst.impactWidth = src.area().width(); - dst.rotationAngle = src.area().rotation(); - dst.chargeTypeId = src.chargeStruct().chargeTypeId(); - dst.cannonCount = src.cannonCount(); - dst.cannonRounds = src.cannonRounds(); - dst.originalEffectStart = src.originalEffectStart() > 0 ? QDateTime::fromMSecsSinceEpoch(src.originalEffectStart()) : QDateTime(); - dst.originalEffectDuration = src.originalEffectDuration(); - dst.remainExplosionNumber = src.remainExplosionNumber(); + 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.effectDuration = src.effectDuration; + dst.effectStart = src.effectStart.is_set() && 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; + dst.impactLength = src.area.height; + dst.impactWidth = src.area.width; + dst.rotationAngle = src.area.rotation; + dst.chargeTypeId = src.chargeStruct.chargeTypeId; + dst.cannonCount = src.cannonCount; + dst.cannonRounds = src.cannonRounds; + dst.originalEffectStart = src.originalEffectStart > 0 ? QDateTime::fromMSecsSinceEpoch(src.originalEffectStart) : QDateTime(); + dst.originalEffectDuration = src.originalEffectDuration; + dst.remainExplosionNumber = src.remainExplosionNumber; // dst.firePurpose; // dst.fireRequestTime; // dst.priv_entityId; @@ -98,16 +98,16 @@ Database::AesExplosionArea explosionArea(const ExplosionArea &src) 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.effectDuration = src.effectDuration(); - dst.effectStart = src.effectStart().is_set() && 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(); - dst.chargeTypeId = src.chargeStruct().chargeTypeId(); + 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.effectDuration = src.effectDuration; + dst.effectStart = src.effectStart.is_set() && 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; + dst.chargeTypeId = src.chargeStruct.chargeTypeId; // dst.priv_entityId; // dst.priv_explosionId; // dst.privExplosionSingleId; @@ -117,19 +117,19 @@ Database::AesExplosionSingle explosionSingle(const ExplosionSingle &src) 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.effectDuration = src.effectDuration(); - dst.partyId = src.partyId().is_set() ? src.partyId().get() : 0; - dst.chargeTypeId = src.chargeStruct().chargeTypeId(); - dst.participantId = src.participantId().is_set() ? src.participantId().get() : 0; - dst.density = src.density(); - dst.width = src.width(); - dst.layingProcedureTypeId = src.layingProcedureType(); - dst.isLaidHidden = src.isLaidHidden(); - dst.effectStateId = src.effectStateId(); - dst.isCenterLine = src.isCenterLine(); + 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.effectDuration = src.effectDuration; + dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0; + dst.chargeTypeId = src.chargeStruct.chargeTypeId; + dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0; + dst.density = src.density; + dst.width = src.width; + dst.layingProcedureTypeId = src.layingProcedureType; + dst.isLaidHidden = src.isLaidHidden; + dst.effectStateId = src.effectStateId; + dst.isCenterLine = src.isCenterLine; // qint32 priv_entityId; // qint32 priv_mineId; // qint32 privMineAreaId; @@ -138,17 +138,17 @@ Database::AesMineArea mineArea(const MineArea &src) QVector mineAreaSegments(const MineArea &src) { - const std::vector &segments = src.segments(); + const std::vector &segments = src.segments; QVector dbSegments; dbSegments.reserve(segments.size()); for (size_t i = 0; i < segments.size(); ++i) { Database::AesMineAreaSegment newSegment; newSegment.elementNumber = i; - newSegment.mineAreaId = src.id(); // Todo: korrekt? + newSegment.mineAreaId = src.id; // Todo: korrekt? newSegment.id = 0; - newSegment.startPosition = QPointF(segments[i].positionStart().lon(), segments[i].positionStart().lat()); - newSegment.endPosition = QPointF(segments[i].positionEnd().lon(), segments[i].positionEnd().lat()); + newSegment.startPosition = QPointF(segments[i].positionStart.lon, segments[i].positionStart.lat); + newSegment.endPosition = QPointF(segments[i].positionEnd.lon, segments[i].positionEnd.lat); dbSegments << newSegment; } return dbSegments; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/polygons.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/polygons.cpp index 6029ef915..5e313d6c9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/polygons.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/polygons.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -36,13 +35,9 @@ // Note: All polygones are open! -std::ostream &operator<<(std::ostream &stream, const QVector &value) -{ - stream << "QVector(" << value.size() << "): "; - for (const QPointF &item : value) - stream << item << ";"; - return stream; -} +// operator<< for QVector removed: in Qt6 QVector is an alias of +// QList, so the inline operator<<(std::ostream&, const QList&) in +// INGLLogger.h (pulled in via logger.h) has the identical signature. std::ostream &operator<<(std::ostream &stream, const QVector &value) { @@ -86,8 +81,8 @@ namespace Polygons // regarding ExplosionCluster: bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry) { - return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint) - || (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + return (geometry == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint) + || (geometry == AreaEffectSimulation::AesExplosionGeometry::EgPoint); } // AreaBottomLeft : @@ -427,7 +422,7 @@ QPolygonF explosionClusterArea(const Database::AesExplosionCluster &explosionClu QPolygonF poly; const bool bIsPointSimilar = isPointSimilar(explosionCluster.explosionGeometryId); - if (bIsPointSimilar || explosionCluster.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) + if (bIsPointSimilar || explosionCluster.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial) { // get center ... (zog isn´t relevant yet) const double radius = explosionCluster.impactWidth / 2.0; @@ -626,7 +621,7 @@ QPolygonF effectClusterArea(const Database::AesEffectCluster &effectCluster) QPolygonF poly; const bool bIsPointSimilar = isPointSimilar(effectCluster.explosionGeometryId); - if (bIsPointSimilar || effectCluster.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) + if (bIsPointSimilar || effectCluster.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial) { // get center ... (zog isn´t relevant yet) const double radius = effectCluster.impactWidth / 2.0; @@ -962,7 +957,7 @@ QVector explosionClusterSingleExplosionsGAUSS_Mtp(const Database::AesEx // // calculate the subAreas / mtps: // - if (explosionCluster.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) + if (explosionCluster.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial) mtps_asUtm = explosionClusterRadialToMtps(areaBlWithTla, numberOfMTPsRequested, firingOriginUtm, centerUtm, &singleWidthOut, &singleHeightOut); else mtps_asUtm = explosionClusterAreaToMtps(areaBlWithTla, numberOfMTPsRequested, &singleWidthOut, &singleHeightOut); @@ -1662,14 +1657,14 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr

waitForHistoricalDataParticipant(1000); const ParticipantManagement::Participant &partData = ppmDtc->participant(unitParticipantId); - if (partData.id() != unitParticipantId) + if (partData.id != unitParticipantId) { ERROR_LOG(logger) << LOGFUNCTION << " ERROR, participant failed for id =" << unitParticipantId; return s_invalidPos; } ppmDtc->waitForHistoricalDataParticipantPosition(1000); - const std::vector &childIds = partData.inferiorIds(); + const std::vector &childIds = partData.inferiorIds; singlePositionsOut.clear(); singlePositionsOut.reserve(childIds.size()); @@ -1681,21 +1676,21 @@ LtsUtils::QPoint3D calculateFiringUnitCenterNonRecursive(const std::shared_ptr

participantPosition(childId); - if (childPos.participantId() != childId) + if (childPos.participantId != childId) { // may happen in real life: so ERROR_LOG to DEBUG_LOG DEBUG_LOG(logger) << LOGFUNCTION << " ERROR, participantPosition failed for id =" << childId; return s_invalidPos; } - const Core::GeoPosition &childGeoPos = childPos.pos(); + const Core::GeoPosition &childGeoPos = childPos.pos; singlePositionsOut.emplace_back(childGeoPos); - const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(childGeoPos.lon(), childGeoPos.lat(), utmZone); + const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(childGeoPos.lon, childGeoPos.lat, utmZone); if (utmZone == -1) utmZone = utm.zone; - pos += LtsUtils::QPoint3D(utm.x, utm.y, childGeoPos.z()); + pos += LtsUtils::QPoint3D(utm.x, utm.y, childGeoPos.z); ++childCount; } // for @@ -1743,7 +1738,7 @@ QVector geoVecToUtm(const std::vector geoVecToUtmPointF(const std::vector &vecPo points.reserve(vecPos.size()); for (const auto &pos : vecPos) { - const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), utmZone); + const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat, utmZone); if (utmZone == -1) utmZone = utm.zone; points.append(QPointF(utm.x, utm.y)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/_handler_explosion_single_central.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/_handler_explosion_single_central.cpp index d6672d49c..8f517f177 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/_handler_explosion_single_central.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/_handler_explosion_single_central.cpp @@ -69,14 +69,14 @@ 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.is_set() && 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.is_set() ? src.externalId.get() : 0; dst.angle = src.angle(); dst.fuseTypeId = src.fuseType().underlying(); dst.participantId = src.participantId(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/aes_dtc_impl_custom.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/aes_dtc_impl_custom.cpp index a9cad7814..652763bf6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/aes_dtc_impl_custom.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/aes_dtc_impl_custom.cpp @@ -28,8 +28,8 @@ bool DtcImplCustom::aesItemViewFromEntityId(int entityId, AesType aesType, AesIt } for (const auto &sample : m_dtcAesItemView->readAlive()) { - if ( (sample.data().aesItemId() == entityId) && - ( (sample.data().aesTypeId() == aesType) || (aesType==AesType_def::AtUnknown) ) + if ( (sample.data().aesItemId == entityId) && + ( (sample.data().aesTypeId == aesType) || (aesType==AesType::AtUnknown) ) ) { aesItemView = sample.data(); @@ -42,71 +42,71 @@ bool DtcImplCustom::aesItemViewFromEntityId(int entityId, AesType aesType, AesIt bool DtcImplCustom::aesItemFromId(int aesId, AesItem &aesItem) { aesItem = nContamination(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = bCContamination(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = explosionArea(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = explosionCluster(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = explosionSingle(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = mineArea(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = dangerArea(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = functionalArea(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = mineCorridor(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = borderline(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = technicalArea(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = airSupportImpact(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = gasPipe(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = boobyTrap(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = dusSingleMine(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = offRouteMine(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; aesItem = effectCluster(aesId); - if (aesItem.id() > 0) + if (aesItem.id > 0) return true; DEBUG_LOG(m_logger) << "No aesItem for aesId=" << aesId << " found"; @@ -122,76 +122,76 @@ AreaEffectSimulation::AesType DtcImplCustom::aesItemIdFromExternalId(long long e aesItemId = 0; for (const AreaEffectSimulation::BCContamination &bcCont : qAsConst(bcConts)) { - if (bcCont.externalId() == externalId) + if (bcCont.externalId == externalId) { - if (bcCont.id() > aesItemId) - aesItemId = bcCont.id(); + if (bcCont.id > aesItemId) + aesItemId = bcCont.id; } } if (aesItemId > 0) - return AreaEffectSimulation::AesType_def::AtBCContamination; + return AreaEffectSimulation::AesType::AtBCContamination; QMap nConts = nContaminations(); for (const AreaEffectSimulation::NContamination &nCont: qAsConst(nConts)) { - if (nCont.externalId() == externalId) + if (nCont.externalId == externalId) { - if (nCont.id() > aesItemId) - aesItemId = nCont.id(); + if (nCont.id > aesItemId) + aesItemId = nCont.id; } } if (aesItemId > 0) - return AreaEffectSimulation::AesType_def::AtNContamination; + return AreaEffectSimulation::AesType::AtNContamination; QMap explAreas = explosionAreas(); for (const AreaEffectSimulation::ExplosionArea &explArea : qAsConst(explAreas)) { - if (explArea.externalId() == externalId) + if (explArea.externalId == externalId) { - if (explArea.id() > aesItemId) - aesItemId = explArea.id(); + if (explArea.id > aesItemId) + aesItemId = explArea.id; } } if (aesItemId > 0) - return AreaEffectSimulation::AesType_def::AtExplosionArea; + return AreaEffectSimulation::AesType::AtExplosionArea; QMap explSingles = explosionSingles(); for (const AreaEffectSimulation::ExplosionSingle &explSingle : qAsConst(explSingles)) { - if (explSingle.externalId() == externalId) + if (explSingle.externalId == externalId) { - if (explSingle.id() > aesItemId) - aesItemId = explSingle.id(); + if (explSingle.id > aesItemId) + aesItemId = explSingle.id; } } if (aesItemId > 0) - return AreaEffectSimulation::AesType_def::AtExplosionSingle; + return AreaEffectSimulation::AesType::AtExplosionSingle; QMap mAreas = mineAreas(); for(const AreaEffectSimulation::MineArea &mArea : qAsConst(mAreas)) { - if (mArea.externalId() == externalId) + if (mArea.externalId == externalId) { - if (mArea.id() > aesItemId) - aesItemId = mArea.id(); + if (mArea.id > aesItemId) + aesItemId = mArea.id; } } if (aesItemId > 0) - return AreaEffectSimulation::AesType_def::AtMineArea; + return AreaEffectSimulation::AesType::AtMineArea; QMap mCorridors = mineCorridors(); for (const AreaEffectSimulation::MineCorridor &mCorridor : qAsConst(mCorridors)) { - if (mCorridor.externalId() == externalId) + if (mCorridor.externalId == externalId) { - if (mCorridor.id() > aesItemId) - aesItemId = mCorridor.id(); + if (mCorridor.id > aesItemId) + aesItemId = mCorridor.id; } } if (aesItemId > 0) - return AreaEffectSimulation::AesType_def::AtMineCorridor; + return AreaEffectSimulation::AesType::AtMineCorridor; - return AreaEffectSimulation::AesType_def::AtUnknown; + return AreaEffectSimulation::AesType::AtUnknown; } bool DtcImplCustom::triggeredImpactsFromEntityId(int entityId, AesType aesType, TriggeredImpacts &triggeredImpacts) @@ -206,8 +206,8 @@ bool DtcImplCustom::triggeredImpactsFromEntityId(int entityId, AesType aesType, } for (const auto &sample : m_dtcTriggeredImpacts->readAlive()) { - if ( (sample.data().aesItemId() == entityId) && - ( (sample.data().aesTypeId() == aesType) || (aesType==AesType_def::AtUnknown) ) + if ( (sample.data().aesItemId == entityId) && + ( (sample.data().aesTypeId == aesType) || (aesType==AesType::AtUnknown) ) ) { triggeredImpacts = sample.data(); @@ -229,8 +229,8 @@ bool DtcImplCustom::effectsFromEntityId(int entityId, AesType aesType, Effects & } for (const auto &sample : m_dtcEffects->readAlive()) { - if ( (sample.data().aesItemId() == entityId) && - ( (sample.data().aesTypeId() == aesType) || (aesType==AesType_def::AtUnknown) ) + if ( (sample.data().aesItemId == entityId) && + ( (sample.data().aesTypeId == aesType) || (aesType==AesType::AtUnknown) ) ) { effects = sample.data(); @@ -244,14 +244,14 @@ int DtcImplCustom::partyForDusMine(int dusMineId) const { for (const auto &dms : m_dusMineStateCont) { - for (const DusMine &dm : dms.mines()) + for (const DusMine &dm : dms.mines) { - if (dm.eqId() == dusMineId) + if (dm.eqId == dusMineId) { - auto it = m_mineAreaCont.find(dms.id()); + auto it = m_mineAreaCont.find(dms.id); if (it == m_mineAreaCont.end()) return 1; - return it.value().partyId().is_set() ? it.value().partyId().get() : 1; + return it.value().partyId.is_set() ? it.value().partyId.get() : 1; } } } @@ -263,8 +263,8 @@ QString DtcImplCustom::aesItemNameFromEntityId(int entityId) { AreaEffectSimulation::AesItem aesItem; aesItemFromId(entityId, aesItem); - if (!aesItem.name().empty()) - return QString::fromStdString(aesItem.name()); + if (!aesItem.name.empty()) + return QString::fromStdString(aesItem.name); //else use DAO if (!m_dao) @@ -355,8 +355,8 @@ QVector DtcImplCustom::trajectoriesTimeAwareFromOriginatorI for (const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware : qAsConst(trajectoryTimeAwareMap)) { // be aware of: [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) - if ((trajectoryTimeAware.originatorId() == originatorId) && - (trajectoryTimeAware.originatorTypeId() == originatorTypeId)) + if ((trajectoryTimeAware.originatorId == originatorId) && + (trajectoryTimeAware.originatorTypeId == originatorTypeId)) foundTrajectories.append(trajectoryTimeAware); } return foundTrajectories; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp index c1dd61033..2877ec31a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp @@ -141,7 +141,7 @@ qint64 DdsHandler::currentPartitionTimeMSec() const void DdsHandler::onPartitionTimeChanged(const Core::PartitionTime ¤tTime) { m_elapsedTimer.restart(); - m_currentTimeMSec = currentTime.timeStamp(); + m_currentTimeMSec = currentTime.timeStamp; } ProjectDataManagement::ChargeType DdsHandler::getChargeType(int chargeTypeId) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp index 422b2e875..e304f666d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp @@ -91,7 +91,7 @@ void EffectorStateMachine::stopAllTimer() QString EffectorStateMachine::getStateStr(AreaEffectSimulation::AesEffectorState state) { - switch (state.underlying()) + switch (state) { case AreaEffectSimulation::AesEffectorState::EsNotReadyToFire: return QStringLiteral("EstNotReadyToFire"); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_air_support_impact.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_air_support_impact.cpp index 7303ae3ae..979f8dc54 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_air_support_impact.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_air_support_impact.cpp @@ -12,7 +12,7 @@ namespace AreaEffectSimulation { HandlerAirSupportImpact::HandlerAirSupportImpact(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("AirSupportImpact"), s_areaCount[AesType::AtAirSupportImpact], s_areaCountCentral[AesType::AtAirSupportImpact]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("AirSupportImpact"), s_areaCount[static_cast(AesType::AtAirSupportImpact)], s_areaCountCentral[static_cast(AesType::AtAirSupportImpact)]) , Interface::Fts::AirSupportImpactModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::AirSupportImpactRemoveRequestHandler(mainHandler->dds()->fts()) {} @@ -39,7 +39,7 @@ bool HandlerAirSupportImpact::init() ERROR_LOG(m_logger) << ret(); return false; } - if (totalAreas() >= s_maxActiveAreas[AesType::AtAirSupportImpact]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtAirSupportImpact)]) { ERROR_LOG(m_logger) << "More active air support in database than allowed - ignoring the rest!"; delete ifs; @@ -57,29 +57,29 @@ bool HandlerAirSupportImpact::init() int HandlerAirSupportImpact::totalAreas() const { - return s_areaCount[AesType::AtAirSupportImpact]; + return s_areaCount[static_cast(AesType::AtAirSupportImpact)]; } int HandlerAirSupportImpact::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtAirSupportImpact]; + return s_areaCountCentral[static_cast(AesType::AtAirSupportImpact)]; } static void fillData(const AirSupportImpactModifyRequest &src, Database::AesAirSupportImpact &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + dst.id = src.id; - 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.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.effectDuration = 1000; // 1sec - dst.partyId = src.partyId().is_set() ? src.partyId().get() : 0; - dst.chargeTypeId = src.chargeTypeId(); - dst.participantId = src.participantId().is_set() ? src.participantId().get() : 0; - dst.flightTime = src.flightTime(); - dst.externalId = src.externalId().is_set() ? src.externalId().get() : 0; + dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0; + dst.chargeTypeId = src.chargeTypeId; + dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0; + dst.flightTime = src.flightTime; + dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0; } void HandlerAirSupportImpact::onAirSupportImpactModifyRequest(const rti::core::SampleIdentity &cookie, @@ -96,7 +96,7 @@ void HandlerAirSupportImpact::onAirSupportImpactModifyRequest(const rti::core::S Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactCreateRequest(const AirSupportImpactModifyRequest &request) { - if (totalAreas() >= s_maxActiveAreas[AesType::AtAirSupportImpact] && request.effectStart().is_set()) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtAirSupportImpact)] && request.effectStart.is_set()) { 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.")); @@ -135,13 +135,13 @@ Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactCreateRequest Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactModifyRequest(const AirSupportImpactModifyRequest &request) { Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && (getObjectFromMap(m_objectMap, std::abs(request.id()), ret) == nullptr))) + if (request.id == 0 || ((request.id < 0) && (getObjectFromMap(m_objectMap, std::abs(request.id), ret) == nullptr))) { DEBUG_LOG(m_logger) << LOGFUNCTION << " handle as createRequest, request:" << request; return airSupportImpactCreateRequest(request); } - ObjectAirSupportImpact *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectAirSupportImpact *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (ifs == nullptr) { ERROR_LOG(m_logger) << LOGFUNCTION << " getObjectFromMap failed, request:" << request; @@ -150,8 +150,8 @@ 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[AesType::AtAirSupportImpact] - && request.effectStart().is_set() + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtAirSupportImpact)] + && request.effectStart.is_set() && !ifs->isActivationTimeSet() && !ifs->isObjectModifiable()) { @@ -161,7 +161,7 @@ Core::FunctionReplyObject HandlerAirSupportImpact::airSupportImpactModifyRequest Database::AesAirSupportImpact aes(ifs->data()); fillData(request, aes); - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite air support impact Effect State for OC"; aes.effectStateId = AesEffectState::EsPrepared; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.cpp index b3c6e2342..31cf80b73 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.cpp @@ -70,10 +70,10 @@ HandlerBase::HandlerBase(MainHandler *mainHandler, s_mineAreaCreationInterval = nglSettings->settings()->value( QStringLiteral("AES/mineAreaCreationInterval"),20000).toInt(); - s_maxActiveAreas[AesType::AtBCContamination] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtBCContamination)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralBCContamination"),defaultMaxDecBCNContaminations).toInt(); - s_maxActiveAreas[AesType::AtNContamination] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtNContamination)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralNContamination"),defaultMaxDecBCNContaminations).toInt(); // Keep equal as the totalAreas sums the actual active areas up and compares to either N or BC @@ -83,15 +83,15 @@ HandlerBase::HandlerBase(MainHandler *mainHandler, // Keep equal as the totalAreas sums the actual active areas up and compares to either Area or Single // It is not distinguished any more. Therefore 50 (as the sum) ist the actual value for All Explosion Areas - s_maxActiveAreas[AesType::AtExplosionArea] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralExplosionAreas"),defaultMaxDecExplosions).toInt(); - s_maxActiveAreas[AesType::AtExplosionSingle] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralExplosionSingle"),defaultMaxDecExplosions).toInt(); - s_maxActiveAreas[AesType::AtExplosionCluster] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtExplosionCluster)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralExplosionClusters"),defaultMaxDecExplosionCluster).toInt(); - s_maxActiveAreas[AesType::AtMineArea] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtMineArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralMineAreas"),defaultMaxDecMineAreas).toInt(); @@ -105,60 +105,60 @@ HandlerBase::HandlerBase(MainHandler *mainHandler, s_safePzAbwWMiCount = nglSettings->settings()->value( QStringLiteral("AES/reservePzAbwWMi"),defaultReservePzAbwWMi).toInt(); - s_maxActiveAreas[AesType::AtFunctionalArea] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtFunctionalArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralFunctionalAreas"),defaultMaxDecFunctionalAreas).toInt(); - s_maxActiveAreas[AesType::AtTechnicalArea] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtTechnicalArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralTechnicalAreas"),defaultMaxDecTechnicalAreas).toInt(); - s_maxActiveAreas[AesType::AtGasPipe] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtGasPipe)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralGasPipes"),defaultMaxDecGasPipes).toInt(); - s_maxActiveAreas[AesType::AtDusSingleMine] = nglSettings->settings()->value( + s_maxActiveAreas[static_cast(AesType::AtDusSingleMine)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveDecentralDusSingleMines"),defaultMaxDecDusSingleMines).toInt(); - s_maxActiveAreas[AesType::AtAirSupportImpact] = 2147483647; // unlimited + s_maxActiveAreas[static_cast(AesType::AtAirSupportImpact)] = 2147483647; // unlimited // Central - s_maxActiveAreasCentral[AesType::AtBoobyTrap] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtBoobyTrap)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralBoobyTraps"),defaultMaxCenBoobyTraps).toInt(); - s_maxActiveAreasCentral[AesType::AtBCContamination] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralBCContamination"),defaultMaxCenBCNContaminations).toInt(); - s_maxActiveAreasCentral[AesType::AtNContamination] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralNContamination"),defaultMaxCenBCNContaminations).toInt(); // Keep equal as the totalAreas sums the actual active areas up and compares to either Area or Single // It is not distinguished any more. Therefore 200 (as the sum) ist the actual value for All Explosion Areas - s_maxActiveAreasCentral[AesType::AtExplosionArea] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralExplosionAreas"),defaultMaxCenExplosions).toInt(); - s_maxActiveAreasCentral[AesType::AtExplosionSingle] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralExplosionSingle"),defaultMaxCenExplosions).toInt(); - s_maxActiveAreasCentral[AesType::AtOffRouteMine] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtOffRouteMine)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralOffRouteMines"),defaultMaxCenOffRouteMines).toInt(); - s_maxActiveAreasCentral[AesType::AtMineArea] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtMineArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralMineAreas"),defaultMaxCenMineAreas).toInt(); - s_maxActiveAreasCentral[AesType::AtFunctionalArea] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtFunctionalArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralFunctionalAreas"),defaultMaxCenFunctionalAreas).toInt(); - s_maxActiveAreasCentral[AesType::AtTechnicalArea] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtTechnicalArea)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralTechnicalAreas"),defaultMaxCenTechnicalAreas).toInt(); - s_maxActiveAreasCentral[AesType::AtGasPipe] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtGasPipe)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralGasPipes"),defaultMaxCenGasPipes).toInt(); - s_maxActiveAreasCentral[AesType::AtDusSingleMine] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtDusSingleMine)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralDusSingleMines"),defaultMaxCenDusSingleMines).toInt(); - s_maxActiveAreasCentral[AesType::AtExplosionCluster] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionCluster)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralExplosionClusters"),defaultMaxCenExplosionCluster).toInt(); - s_maxActiveAreasCentral[AesType::AtEffectCluster] = nglSettings->settings()->value( + s_maxActiveAreasCentral[static_cast(AesType::AtEffectCluster)] = nglSettings->settings()->value( QStringLiteral("AES/maxActiveCentralEffectClusters"),defaultMaxCenEffectCluster).toInt(); - s_maxActiveAreasCentral[AesType::AtAirSupportImpact] = + s_maxActiveAreasCentral[static_cast(AesType::AtAirSupportImpact)] = 2147483647; // unlimited } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.h index dd30788c4..58b21a6a8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_base.h @@ -57,7 +57,7 @@ protected: bool isLockedTopic(int id) { AreaEffectSimulation::AesItem data; - data.id(id); + data.id = id; int exId = m_mainHandler->dds()->ddsConnector()->getPartitionId(); return m_mainHandler->dds()->topicLockMaster()->isLocked(data, exId); } @@ -187,30 +187,30 @@ public: return Core::FunctionReplyObject(id, tr_lts("dds", "Effect simulation with id %1 not found.")).arg(id); bool succ = false; - switch (effectState.underlying()) + switch (effectState) { - case AesEffectState_def::EsReceived: + case AesEffectState::EsReceived: succ = ifs->trySwitchToReceived(); break; - case AesEffectState_def::EsCreated: + case AesEffectState::EsCreated: succ = ifs->trySwitchToCreated(); break; - case AesEffectState_def::EsPrepared: + case AesEffectState::EsPrepared: succ = ifs->trySwitchToPrepared(); break; - case AesEffectState_def::EsFired: + case AesEffectState::EsFired: succ = ifs->trySwitchToFired(); break; - case AesEffectState_def::EsActivated: + case AesEffectState::EsActivated: succ = !ifs->activateObjectNow().error(); break; - case AesEffectState_def::EsPaused: + case AesEffectState::EsPaused: succ = ifs->trySwitchToPaused(); break; - case AesEffectState_def::EsExpired: + case AesEffectState::EsExpired: succ = ifs->trySwitchToExpired(); break; - case AesEffectState_def::EsRemoved: + case AesEffectState::EsRemoved: succ = ifs->trySwitchToRemoved(); break; default: @@ -218,14 +218,14 @@ public: } if (succ) return Core::FunctionReplyObject(); - return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(effectState.underlying()); + return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(effectState); } Core::FunctionReplyObject aesItemRemove(const Core::RemoveElementRequest &request) { DEBUG_LOG(m_logger) << "on" << m_typeName << "RemoveRequest: " << request; - int id = request.id(); + int id = request.id; Core::FunctionReplyObject ret; Obj *ifs = getObjectFromMap(m_objectMap, id, ret); @@ -242,11 +242,11 @@ public: Core::FunctionReplyObject removeReply(bool (AreaEffectSimulation::DatabaseInterface::*dbRemoveMethod)(qint32), const Core::RemoveElementRequest &request) { - if (request.id() >= 0) + if (request.id >= 0) return aesItemRemove(request); // else force = negative id - qint32 id = request.id() * -1; + qint32 id = request.id * -1; Obj *ifs = m_objectMap.value(id); if (ifs == nullptr) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_bccontamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_bccontamination.cpp index b95af285b..2b3f9d598 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_bccontamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_bccontamination.cpp @@ -14,7 +14,7 @@ namespace AreaEffectSimulation { HandlerBCContamination::HandlerBCContamination(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("BCContamination"), s_areaCount[AesType::AtBCContamination], s_areaCountCentral[AesType::AtBCContamination]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("BCContamination"), s_areaCount[static_cast(AesType::AtBCContamination)], s_areaCountCentral[static_cast(AesType::AtBCContamination)]) , Interface::Fts::BCContaminationModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::BCContaminationRemoveRequestHandler(mainHandler->dds()->fts()) {} @@ -40,7 +40,7 @@ bool HandlerBCContamination::init() } if(!ifs->data().isCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination])) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast(AesType::AtNContamination)])) { ERROR_LOG(m_logger) << "More active bc contaminationsin database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -50,7 +50,7 @@ bool HandlerBCContamination::init() } else { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtBCContamination] + s_maxActiveAreasCentral[AesType::AtNContamination])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)])) { ERROR_LOG(m_logger) << "More active bc contaminationsin database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -85,18 +85,18 @@ bool HandlerBCContamination::init() int HandlerBCContamination::totalAreas() const { - return s_areaCount[AesType::AtBCContamination] + s_areaCount[AesType::AtNContamination]; + return s_areaCount[static_cast(AesType::AtBCContamination)] + s_areaCount[static_cast(AesType::AtNContamination)]; } int HandlerBCContamination::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtBCContamination] + s_areaCountCentral[AesType::AtNContamination]; + return s_areaCountCentral[static_cast(AesType::AtBCContamination)] + s_areaCountCentral[static_cast(AesType::AtNContamination)]; } void HandlerBCContamination::onChangedToCentral() { - s_areaCount[AesType::AtBCContamination]--; - s_areaCountCentral[AesType::AtBCContamination]++; + s_areaCount[static_cast(AesType::AtBCContamination)]--; + s_areaCountCentral[static_cast(AesType::AtBCContamination)]++; DEBUG_LOG(m_logger) << "m_areaCount after Recount = " << m_areaCount; DEBUG_LOG(m_logger) << "m_areaCountCentral after Recount = " << m_areaCountCentral; @@ -105,39 +105,39 @@ void HandlerBCContamination::onChangedToCentral() static void fillData(const BCContaminationModifyRequest &src, Database::AesBCContamination &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-laptop + 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.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.chargeTypeId = src.chargeTypeId(); - dst.participantId = src.participantId().is_set() ? src.participantId().get() : 0; - dst.weatherSourceId = src.weatherSource(); - dst.externalId = src.externalId().is_set() ? src.externalId().get() : 0; - dst.upperOffset = src.upperOffset(); - dst.lowerOffset = src.lowerOffset(); + dst.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.chargeTypeId = src.chargeTypeId; + dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0; + dst.weatherSourceId = src.weatherSource; + dst.externalId = src.externalId.is_set() ? 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.is_set()) { - dst.weatherPosition.rx() = src.weatherPosition().get().lon(); - dst.weatherPosition.ry() = src.weatherPosition().get().lat(); + 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()) - dst.windSpeed = src.windSpeed().get(); - if(src.propagationDirection().is_set()) - dst.propagationDirection = src.propagationDirection().get(); - if(src.weatherTimestamp().is_set()) - dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.weatherTimestamp().get()); - else if(src.effectStart().is_set()) - dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.effectStart().get()); + if(src.windSpeed.is_set()) + dst.windSpeed = src.windSpeed.get(); + if(src.propagationDirection.is_set()) + dst.propagationDirection = src.propagationDirection.get(); + if(src.weatherTimestamp.is_set()) + dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.weatherTimestamp.get()); + else if(src.effectStart.is_set()) + dst.weatherTimestamp = QDateTime::fromMSecsSinceEpoch(src.effectStart.get()); } void HandlerBCContamination::onBCContaminationModifyRequest(const rti::core::SampleIdentity &cookie, @@ -170,7 +170,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c if (ifs->data().isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtBCContamination] + s_maxActiveAreasCentral[AesType::AtNContamination]) && request.effectStart().is_set()) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)]) && request.effectStart.is_set()) { 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[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination]) && request.effectStart().is_set()) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast(AesType::AtNContamination)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct @@ -208,23 +208,23 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationCreateRequest(c } m_objectMap.insert(ifs->id(), ifs); - if (request.withDangerArea().is_set() && request.withDangerArea().get()) + if (request.withDangerArea.is_set() && request.withDangerArea.get()) { DangerAreaModifyRequest req; - req.id(0); + req.id = 0; #ifdef GUEZ_MODE const QString name = QString::fromStdString(tr_lts("dds","%1 - Gefahrenbereich")).arg(ifs->data().name); #else const QString name = QString::fromStdString(tr_lts("dds","%1 - Danger Area")).arg(ifs->data().name); #endif - req.name(name.toStdString()); - req.partyId(ifs->data().partyId); - req.effectDuration(ifs->data().effectDuration); - req.chargeTypeId(ifs->data().chargeTypeId); - req.segments(Polygons::dangerAreaDefaultSegments(ifs->data().impactPosition, ifs->data().impactRadius + 50)); - req.associatedAesId(ifs->data().id); + req.name = name.toStdString(); + req.partyId = ifs->data().partyId; + req.effectDuration = ifs->data().effectDuration; + req.chargeTypeId = ifs->data().chargeTypeId; + req.segments = Polygons::dangerAreaDefaultSegments(ifs->data().impactPosition, ifs->data().impactRadius + 50); + req.associatedAesId = ifs->data().id; if(ifs->data().effectStart.isValid()) - req.effectStart(ifs->data().effectStart.toMSecsSinceEpoch()); + req.effectStart = ifs->data().effectStart.toMSecsSinceEpoch(); Core::FunctionReplyObject bretDangerArea= m_mainHandler->dangerAreaHandler()->dangerAreaCreateRequest(req); if (bretDangerArea.error()) ERROR_LOG(m_logger)<<"Couldn't create associated dangerArea to bcContamination: "<data().name; @@ -238,27 +238,27 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c { Core::FunctionReplyObject ret; ObjectBCContamination *ifs = nullptr; - if (request.externalId().is_set() && request.externalId().get() > 0) - ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId().get(), ret); + if (request.externalId.is_set() && request.externalId.get() > 0) + ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId.get(), ret); if (!ifs) { - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return bCContaminationCreateRequest(request); - ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; } - if (request.effectStart().is_set() && (request.effectStart().get() + request.effectDuration() < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) + if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) return removeObject(ifs); Database::AesBCContamination aea(ifs->data()); fillData(request, aea); - DEBUG_LOG(m_logger) << "request.upperOffset=" << request.upperOffset() - << " request.lowerOffset=" << request.lowerOffset() + DEBUG_LOG(m_logger) << "request.upperOffset=" << request.upperOffset + << " request.lowerOffset=" << request.lowerOffset << " aea.upperOffset=" << aea.upperOffset << " aea.lowerOffset=" << aea.lowerOffset; @@ -277,21 +277,21 @@ 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.is_set()) { if (isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtBCContamination] + s_maxActiveAreasCentral[AesType::AtNContamination]) - /*&& request.effectStart().is_set()*/) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)]) + /*&& request.effectStart.is_set()*/) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central B/C or N contamination areas.")); } } else { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination]) - /*&& request.effectStart().is_set()*/) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast(AesType::AtNContamination)]) + /*&& request.effectStart.is_set()*/) { 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.is_set() && ifs->isObjectModifiable()) { DEBUG_LOG(m_logger) << "isCentral: " << isCentral; @@ -311,8 +311,8 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c // Change from central to training area if (wasCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active B/C or N contamination areas.")); + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast(AesType::AtNContamination)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active B/C or N contamination areas.")); m_areaCount++; m_areaCountCentral--; @@ -321,8 +321,8 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c } else // Change from training area to central { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtBCContamination] + s_maxActiveAreasCentral[AesType::AtNContamination])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active central B/C or N contamination areas.")); + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active central B/C or N contamination areas.")); m_areaCount--; m_areaCountCentral++; DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtBCContamination] = " << m_areaCount; @@ -331,7 +331,7 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c } } - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite bc contamination Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; @@ -346,44 +346,44 @@ Core::FunctionReplyObject HandlerBCContamination::bCContaminationModifyRequest(c DEBUG_LOG(m_logger)<<"[bCContaminationModifyRequest] modify danger area associated to bcId: " <id() <<" dangerAreaId: "<data().impactPosition, ifs->data().impactRadius + 50)); - dangerRequest.associatedAesId(ifs->data().id); + dangerRequest.id = dangerArea.id; + dangerRequest.name = QStringLiteral("%1").arg(dangerArea.name).toStdString(); + dangerRequest.partyId = dangerArea.partyId; + dangerRequest.effectDuration = dangerArea.effectDuration; + dangerRequest.chargeTypeId = dangerArea.chargeTypeId; + dangerRequest.segments = Polygons::dangerAreaDefaultSegments(ifs->data().impactPosition, ifs->data().impactRadius + 50); + dangerRequest.associatedAesId = ifs->data().id; if(ifs->data().effectStart.isValid()) - dangerRequest.effectStart(ifs->data().effectStart.toMSecsSinceEpoch()); + dangerRequest.effectStart = ifs->data().effectStart.toMSecsSinceEpoch(); Core::FunctionReplyObject bretDangerArea= m_mainHandler->dangerAreaHandler()->dangerAreaModifyRequest(dangerRequest); if (bretDangerArea.error()) ERROR_LOG(m_logger)<<"[bCContaminationModifyRequest] couldn't update danger area: bccontamination.id: "<id() - <<" dangerArea.name: "<id(); DangerAreaModifyRequest newDangerRequest; - newDangerRequest.id(0); + newDangerRequest.id = 0; #ifdef GUEZ_MODE const QString name = QString::fromStdString(tr_lts("dds","%1 - Gefahrenbereich")).arg(ifs->data().name); #else const QString name = QString::fromStdString(tr_lts("dds","%1 - Danger Area")).arg(ifs->data().name); #endif - newDangerRequest.name(name.toStdString()); - newDangerRequest.partyId(ifs->data().partyId); - newDangerRequest.effectDuration(ifs->data().effectDuration); - newDangerRequest.chargeTypeId(ifs->data().chargeTypeId); - newDangerRequest.segments(Polygons::dangerAreaDefaultSegments(ifs->data().impactPosition, ifs->data().impactRadius + 50)); - newDangerRequest.associatedAesId(ifs->data().id); + newDangerRequest.name = name.toStdString(); + newDangerRequest.partyId = ifs->data().partyId; + newDangerRequest.effectDuration = ifs->data().effectDuration; + newDangerRequest.chargeTypeId = ifs->data().chargeTypeId; + newDangerRequest.segments = Polygons::dangerAreaDefaultSegments(ifs->data().impactPosition, ifs->data().impactRadius + 50); + newDangerRequest.associatedAesId = ifs->data().id; if(ifs->data().effectStart.isValid()) - newDangerRequest.effectStart(ifs->data().effectStart.toMSecsSinceEpoch()); + newDangerRequest.effectStart = ifs->data().effectStart.toMSecsSinceEpoch(); Core::FunctionReplyObject bretDangerArea = m_mainHandler->dangerAreaHandler()->dangerAreaCreateRequest(newDangerRequest); if (bretDangerArea.error()) ERROR_LOG(m_logger)<<"[bCContaminationModifyRequest] couldn't add danger area: bccontamination.id: "<id() - <<" dangerArea.name: "<dangerAreaHandler()->getDangerAreaByAssociatedAesId(request.id(), &dangerArea)) + if (m_mainHandler->dangerAreaHandler()->getDangerAreaByAssociatedAesId(request.id, &dangerArea)) { bool bret = m_mainHandler->dangerAreaHandler()->dangerAreaRemoveRequest(Core::RemoveElementRequest(dangerArea.id)); if (!bret) ERROR_LOG(m_logger)<<"[onBCContaminationRemoveRequest] couldn't remove danger area: "<(mainHandler, QStringLiteral("BoobyTrap"), s_areaCount[AesType::AtBoobyTrap], s_areaCountCentral[AesType::AtBoobyTrap]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("BoobyTrap"), s_areaCount[static_cast(AesType::AtBoobyTrap)], s_areaCountCentral[static_cast(AesType::AtBoobyTrap)]) , Interface::Fts::BoobyTrapModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::BoobyTrapRemoveRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::BoobyTrapTriggerRequestHandler(mainHandler->dds()->fts()) @@ -35,7 +35,7 @@ bool HandlerBoobyTrap::init() bRet = false; return; } - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtBoobyTrap] ) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtBoobyTrap)] ) { ERROR_LOG(m_logger) << "More active booby traps in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -64,32 +64,32 @@ bool HandlerBoobyTrap::init() int HandlerBoobyTrap::totalAreas() const { - return s_areaCount[AesType::AtBoobyTrap]; + return s_areaCount[static_cast(AesType::AtBoobyTrap)]; } int HandlerBoobyTrap::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtBoobyTrap]; + return s_areaCountCentral[static_cast(AesType::AtBoobyTrap)]; } static void fillData(const BoobyTrapModifyRequest &src, Database::AesBoobyTrap &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-laptop + 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.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.chargeTypeId = src.chargeTypeId(); - //dst.participantId = src.participantId().is_set() ? src.participantId().get() : 0; - //dst.externalId = src.externalId().is_set() ? 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.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.chargeTypeId = src.chargeTypeId; + //dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0; + //dst.externalId = src.externalId.is_set() ? 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.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[AesType::AtBoobyTrap]) && request.effectStart().is_set()) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBoobyTrap)]) && request.effectStart.is_set()) return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active booby traps.")); Database::AesBoobyTrap newData; @@ -134,7 +134,7 @@ Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapCreateRequest(const BoobyTr Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapModifyRequest(const BoobyTrapModifyRequest &request) { Core::FunctionReplyObject ret; - const QPointF &impactPos = QPointF(request.impactPosition().lon(),request.impactPosition().lat()); + const QPointF &impactPos = QPointF(request.impactPosition.lon,request.impactPosition.lat); // Convert Form to UTM bool isGroundLevel = true; const int exId = m_mainHandler->dds()->exerciseId(); @@ -145,28 +145,28 @@ Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapModifyRequest(const BoobyTr return Core::FunctionReplyObject(1, tr_lts("dds", "The Booby Trap is within a building")); } - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return boobyTrapCreateRequest(request); - ObjectBoobyTrap *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectBoobyTrap *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; - if (request.effectStart().is_set() && (request.effectStart().get() + request.effectDuration() < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) + if (request.effectStart.is_set() && (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[AesType::AtBoobyTrap]) - && request.effectStart().is_set() + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBoobyTrap)]) + && request.effectStart.is_set() && !ifs->isActivationTimeSet() /* && !ifs->isObjectModifiable()*/) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active booby traps.")); + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active booby traps.")); Database::AesBoobyTrap aea(ifs->data()); fillData(request, aea); - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite booby trap Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; @@ -193,7 +193,7 @@ void HandlerBoobyTrap::onBoobyTrapTriggerRequest(const rti::core::SampleIdentity Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapTriggerRequest(const BoobyTrapTriggerRequest &request) { Core::FunctionReplyObject ret; - ObjectBoobyTrap *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectBoobyTrap *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; @@ -201,7 +201,7 @@ Core::FunctionReplyObject HandlerBoobyTrap::boobyTrapTriggerRequest(const BoobyT Database::AesBoobyTrap aea(ifs->data()); DEBUG_LOG(m_logger) << "Overwrite booby trap Effect State to expired"; aea.effectStateId = AesEffectState::EsExpired; - aea.triggered = request.triggered(); + aea.triggered = request.triggered; aea.effectDuration = aea.effectStart.msecsTo(QDateTime::currentDateTimeUtc()); if (aea.effectDuration < 0) aea.effectDuration = 1; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_borderline.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_borderline.cpp index 0c8fc8a27..b64b20bba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_borderline.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_borderline.cpp @@ -14,7 +14,7 @@ namespace AreaEffectSimulation { HandlerBorderline::HandlerBorderline(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionArea"), s_areaCount[AesType::AtBorderline], s_areaCountCentral[AesType::AtBorderline]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionArea"), s_areaCount[static_cast(AesType::AtBorderline)], s_areaCountCentral[static_cast(AesType::AtBorderline)]) , Interface::Fts::BorderlineModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::BorderlineRemoveRequestHandler(mainHandler->dds()->fts()) { @@ -49,7 +49,7 @@ bool HandlerBorderline::init() for (const Database::AesBorderline &dbBorderline : qAsConst(borderlineVec)) { - if (dbBorderline.effectStateId == AesEffectState_def::EsRemoved) + if (dbBorderline.effectStateId == AesEffectState::EsRemoved) continue; dbBorderlineSegments.clear(); @@ -83,7 +83,7 @@ void HandlerBorderline::onBorderlineModifyRequest(const rti::core::SampleIdentit const BorderlineModifyRequest &request) { DEBUG_LOG(m_logger) << "onBorderlineModifyRequest: " << request; - Core::FunctionReplyObject ret = request.id() > 0 ? borderlineModifyRequest(request) : borderlineCreateRequest(request); + Core::FunctionReplyObject ret = request.id > 0 ? borderlineModifyRequest(request) : borderlineCreateRequest(request); if (ret.error()) WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->borderlineModifyReply(cookie, ret); @@ -94,14 +94,14 @@ Core::FunctionReplyObject HandlerBorderline::borderlineCreateRequest(const Borde { Database::AesBorderline newData; - newData.name = QString::fromStdString(request.name()); - newData.operatorId = request.operatorId() > 0 ? request.operatorId() : QVariant(); - newData.partyId = request.partyId(); + newData.name = QString::fromStdString(request.name); + newData.operatorId = request.operatorId > 0 ? request.operatorId : QVariant(); + newData.partyId = request.partyId; ObjectBorderline *ifs(new ObjectBorderline(m_mainHandler, this)); Core::FunctionReplyObject ret = ifs->createObject(newData, - request.segments(), + request.segments, QVector()); if (ret.error()) { @@ -117,17 +117,17 @@ Core::FunctionReplyObject HandlerBorderline::borderlineCreateRequest(const Borde Core::FunctionReplyObject HandlerBorderline::borderlineModifyRequest(const BorderlineModifyRequest &request) { Core::FunctionReplyObject ret; - ObjectBorderline *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectBorderline *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; Database::AesBorderline newData; - newData.name = QString::fromStdString(request.name()); - newData.operatorId = request.operatorId() > 0 ? request.operatorId() : QVariant(); - newData.partyId = request.partyId(); + newData.name = QString::fromStdString(request.name); + newData.operatorId = request.operatorId > 0 ? request.operatorId : QVariant(); + newData.partyId = request.partyId; - return ifs->updateObject(newData, request.segments()); + return ifs->updateObject(newData, request.segments); } // end of onBorderlineModifyRequest() //----------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_administration.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_administration.cpp index a5793188c..522852a09 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_administration.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_administration.cpp @@ -64,10 +64,10 @@ void HandlerChargeAdministration::onChargeAdministrationModifyRequest(const rti: { DEBUG_LOG(m_logger) << "onChargeAdministrationModifyRequest: " << request; ChargeAdministrationModifyRequest newRequest = request; - if (!newRequest.amountChangedByOperator()) - newRequest.id() = getObjectChargeAdministrationId(request.partyId(), request.chargeTypeId(), request.effectSourceId()); + if (!newRequest.amountChangedByOperator) + newRequest.id = getObjectChargeAdministrationId(request.partyId, request.chargeTypeId, request.effectSourceId); - const auto ret = newRequest.id() > 0 ? chargeAdministrationModifyRequest(newRequest) : chargeAdministrationCreateRequest(request); + const auto ret = newRequest.id > 0 ? chargeAdministrationModifyRequest(newRequest) : chargeAdministrationCreateRequest(request); if (ret.error()) WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->chargeAdministrationModifyReply(cookie, ret); @@ -77,11 +77,11 @@ Core::FunctionReplyObject HandlerChargeAdministration::chargeAdministrationCreat { Database::AesChargeAdministration newData; - newData.chargeTypeId = request.chargeTypeId(); - newData.partyId = request.partyId(); - newData.effectSourceId = request.effectSourceId(); - newData.amount = request.amount(); - newData.amountChangedByOperator = request.amountChangedByOperator(); + newData.chargeTypeId = request.chargeTypeId; + newData.partyId = request.partyId; + newData.effectSourceId = request.effectSourceId; + newData.amount = request.amount; + newData.amountChangedByOperator = request.amountChangedByOperator; ObjectChargeAdministration *ifs(new ObjectChargeAdministration(m_mainHandler, this)); @@ -98,19 +98,19 @@ Core::FunctionReplyObject HandlerChargeAdministration::chargeAdministrationCreat Core::FunctionReplyObject HandlerChargeAdministration::chargeAdministrationModifyRequest(const ChargeAdministrationModifyRequest &request) { Core::FunctionReplyObject ret; - ObjectChargeAdministration *ifs = getObjectFromMap(m_chargeAdminObjMap, request.id(), ret); + ObjectChargeAdministration *ifs = getObjectFromMap(m_chargeAdminObjMap, request.id, ret); if (!ifs) return ret; Database::AesChargeAdministration newData(ifs->data()); - newData.id = request.id(); - newData.chargeTypeId = request.chargeTypeId(); - newData.partyId = request.partyId(); - newData.amount = request.amount(); - newData.amountChangedByOperator = request.amountChangedByOperator(); + newData.id = request.id; + newData.chargeTypeId = request.chargeTypeId; + newData.partyId = request.partyId; + newData.amount = request.amount; + newData.amountChangedByOperator = request.amountChangedByOperator; if (newData.amountChangedByOperator && newData.amount < newData.planned) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Amount is smaller than planned (%1 < %2).")).arg(newData.amount).arg(newData.planned); + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Amount is smaller than planned (%1 < %2).")).arg(newData.amount).arg(newData.planned); return ifs->updateObject(newData); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp index a561dd5b9..04332f731 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp @@ -86,18 +86,18 @@ void HandlerChargeEffect::onChargeEffectModifyRequest(const rti::core::SampleIde return; } - if (request.id() == 0) // create + if (request.id == 0) // create { m_mainHandler->dds()->fts()->chargeEffectModifyReply(cookie, createChargeEffect(request)); return; } - if (request.id() < 0) // create with id + if (request.id < 0) // create with id { ChargeEffectModifyRequest requestWithPositiveId = request; - requestWithPositiveId.id(qAbs(request.id())); + requestWithPositiveId.id = qAbs(request.id); m_mainHandler->dds()->fts()->chargeEffectModifyReply(cookie, createChargeEffect(requestWithPositiveId)); @@ -165,12 +165,12 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf // Create ChargeAdministration Entry for reports DEBUG_LOG(m_logger) << "newChargeEffect id: " << newChargeEffect->id(); - DEBUG_LOG(m_logger) << "request.originatorTypeId: " << request.originatorTypeId(); - if (request.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation) + DEBUG_LOG(m_logger) << "request.originatorTypeId: " << request.originatorTypeId; + if (request.originatorTypeId == ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation) { int amount = 1; - int partyId = m_mainHandler->effectClusterHandler()->getPartyId(request.originatorId()); - m_mainHandler->chargeAdministrationHandler()->consumeCharge(request.chargeTypeId(), partyId, amount); + int partyId = m_mainHandler->effectClusterHandler()->getPartyId(request.originatorId); + m_mainHandler->chargeAdministrationHandler()->consumeCharge(request.chargeTypeId, partyId, amount); } // create @@ -180,9 +180,9 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf newChargeEffect->init(); // create trajectory - if (request.trajectoryTimeAware().is_set()) + if (request.trajectoryTimeAware.is_set()) { - int trajId = m_trajectoryHandler->create(trajectoryData(newChargeEffect->id(), request.trajectoryTimeAware().get())); + int trajId = m_trajectoryHandler->create(trajectoryData(newChargeEffect->id(), request.trajectoryTimeAware.get())); if (trajId < 0) ERROR_LOG(m_logger) << " Couldn't create trajectory for chargeEffect id: " << newChargeEffect->id(); else @@ -204,14 +204,14 @@ TrajectoryData HandlerChargeEffect::trajectoryData(int chargeEffectId, // act as { TrajectoryData td; td.id = trajObjId; - td.index = trajectoryTimeAware.index(); - td.startTime = trajectoryTimeAware.trajectoryStartTime(); - td.geometry = trajectoryTimeAware.geometry(); + td.index = trajectoryTimeAware.index; + td.startTime = trajectoryTimeAware.trajectoryStartTime; + td.geometry = trajectoryTimeAware.geometry; // [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) // td.aesItemId = trajectoryTimeAware.aesItemId(); // charge effect's parent // td.aesTypeId = trajectoryTimeAware.aesTypeId(); td.originatorId = chargeEffectId; - td.originatorTypeId = ProjectDataManagement::StateChangeOriginator::ChargeEffect; + td.originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ChargeEffect; return td; } @@ -227,7 +227,7 @@ const ObjectChargeEffect *HandlerChargeEffect::getChargeEffectById(int chargeEff Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEffectModifyRequest &request) { - Core::FunctionReplyObject reply(request.id()); + Core::FunctionReplyObject reply(request.id); if (!m_mainHandler) { reply.setStr("Not possible to update ChargeEffect --> No MainHandler present."); @@ -237,7 +237,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf return reply; } - if (!m_chargeEffects.contains(request.id())) + if (!m_chargeEffects.contains(request.id)) { reply.setStr("Not possible to update ChargeEffect --> Got invalid id."); @@ -247,12 +247,12 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf return reply; } - ObjectChargeEffect *chargeEffetObj = m_chargeEffects[request.id()]; + ObjectChargeEffect *chargeEffetObj = m_chargeEffects[request.id]; reply = chargeEffetObj->update(request); // update trajectory - if (!reply.error() && request.trajectoryTimeAware().is_set() - && m_trajectoryHandler->update(trajectoryData(chargeEffetObj->id(), request.trajectoryTimeAware().get(), m_trajObjIds.value(chargeEffetObj->id(), -1)))) + if (!reply.error() && request.trajectoryTimeAware.is_set() + && m_trajectoryHandler->update(trajectoryData(chargeEffetObj->id(), request.trajectoryTimeAware.get(), m_trajObjIds.value(chargeEffetObj->id(), -1)))) { // update failed should the trajectory be created again? reply.setStr("Not possible to update ChargeEffect --> Got invalid trajectory id."); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_danger_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_danger_area.cpp index 0f52c26b8..ced4a5271 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_danger_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_danger_area.cpp @@ -87,21 +87,21 @@ Core::FunctionReplyObject HandlerDangerArea::dangerAreaCreateRequest(const Dange { Database::AesDangerArea newData; - 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.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; + 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.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; ObjectDangerArea *ifs(new ObjectDangerArea(m_mainHandler, this)); Core::FunctionReplyObject ret = ifs->createObject(newData, - request.segments(), + request.segments, QVector()); if (ret.error()) { @@ -117,10 +117,10 @@ Core::FunctionReplyObject HandlerDangerArea::dangerAreaCreateRequest(const Dange bool HandlerDangerArea::dangerAreaRemoveRequest(const Core::RemoveElementRequest request) { - DEBUG_LOG(m_logger) << "onDangerAreaRemoveRequest dangerArea id: " << request.id(); + DEBUG_LOG(m_logger) << "onDangerAreaRemoveRequest dangerArea id: " << request.id; Core::FunctionReplyObject ret; const rti::core::SampleIdentity cookie; - ObjectDangerArea *ifs = getObjectFromMap(m_dangerAreaObjMap, request.id(), ret); + ObjectDangerArea *ifs = getObjectFromMap(m_dangerAreaObjMap, request.id, ret); if (!ifs) { return m_mainHandler->dds()->fts()->dangerAreaRemoveReply(cookie, ret); @@ -151,25 +151,25 @@ bool HandlerDangerArea::getDangerAreaByAssociatedAesId(const int &id, Database: Core::FunctionReplyObject HandlerDangerArea::dangerAreaModifyRequest(const DangerAreaModifyRequest &request) { Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_dangerAreaObjMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_dangerAreaObjMap, std::abs(request.id), ret))) return dangerAreaCreateRequest(request); - ObjectDangerArea *ifs = getObjectFromMap(m_dangerAreaObjMap, std::abs(request.id()), ret); + ObjectDangerArea *ifs = getObjectFromMap(m_dangerAreaObjMap, std::abs(request.id), ret); if (!ifs) return ret; Database::AesDangerArea newData(ifs->data()); - 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.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; + 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.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; - return ifs->updateObject(newData, request.segments()); + return ifs->updateObject(newData, request.segments); } void HandlerDangerArea::onDangerAreaRemoveRequest(const rti::core::SampleIdentity &cookie, @@ -177,7 +177,7 @@ void HandlerDangerArea::onDangerAreaRemoveRequest(const rti::core::SampleIdentit { DEBUG_LOG(m_logger) << "onDangerAreaRemoveRequest" << request; Core::FunctionReplyObject ret; - ObjectDangerArea *ifs = getObjectFromMap(m_dangerAreaObjMap, request.id(), ret); + ObjectDangerArea *ifs = getObjectFromMap(m_dangerAreaObjMap, request.id, ret); if (!ifs) { m_mainHandler->dds()->fts()->dangerAreaRemoveReply(cookie, ret); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_dus_single_mine.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_dus_single_mine.cpp index 3e037ccc8..62956841f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_dus_single_mine.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_dus_single_mine.cpp @@ -17,7 +17,7 @@ namespace AreaEffectSimulation { HandlerDusSingleMine::HandlerDusSingleMine(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("DusSingleMine"), s_areaCount[AesType::AtMineArea], s_areaCountCentral[AesType::AtMineArea]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("DusSingleMine"), s_areaCount[static_cast(AesType::AtMineArea)], s_areaCountCentral[static_cast(AesType::AtMineArea)]) , m_tabDtc(mainHandler->dds()->tabDtc()) {} @@ -41,7 +41,7 @@ bool HandlerDusSingleMine::init() // If active or prepared, check if it still can be handled and increment area count if (ifs->isObjectInTrainingArea()) { - if (totalAreas() >= s_maxActiveAreas[AesType::AtDusSingleMine]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtDusSingleMine)]) { ERROR_LOG(m_logger) << "More active DUS single mines in database than allowed - ignoring the rest!"; delete ifs; @@ -80,12 +80,12 @@ bool HandlerDusSingleMine::init() int HandlerDusSingleMine::totalAreas() const { - return s_areaCount[AesType::AtDusSingleMine]; + return s_areaCount[static_cast(AesType::AtDusSingleMine)]; } int HandlerDusSingleMine::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtDusSingleMine]; + return s_areaCountCentral[static_cast(AesType::AtDusSingleMine)]; } void HandlerDusSingleMine::onDusSingleMineState(const TrainingAreaBase::DusSingleMineState &data, DataModification modType) @@ -93,31 +93,31 @@ void HandlerDusSingleMine::onDusSingleMineState(const TrainingAreaBase::DusSingl if (modType == DataModification::eRemoved) return; - if (totalAreas() >= s_maxActiveAreas[AesType::AtDusSingleMine]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtDusSingleMine)]) { WARNING_LOG(m_logger) << "Too many active DUS single mines."; return; } // set old AES item to expired - if (m_activeMineIdToAesItemId.contains(data.mineId())) + if (m_activeMineIdToAesItemId.contains(data.mineId)) { - m_objectMap.value(m_activeMineIdToAesItemId.value(data.mineId()))->setExpired(); - m_activeMineIdToAesItemId.remove(data.mineId()); + m_objectMap.value(m_activeMineIdToAesItemId.value(data.mineId))->setExpired(); + m_activeMineIdToAesItemId.remove(data.mineId); } - if (data.state()) + if (data.state) { Database::AesDusSingleMine newData; - newData.mineId = data.mineId(); + newData.mineId = data.mineId; - newData.effectStart = QDateTime::fromMSecsSinceEpoch(data.effectStart() + Settings::getDusSingleMineEffectStartOffset()); // offset to get away from mine after laying it + newData.effectStart = QDateTime::fromMSecsSinceEpoch(data.effectStart + Settings::getDusSingleMineEffectStartOffset()); // offset to get away from mine after laying it if (newData.effectStart <= m_mainHandler->dds()->currentPartitionTime()) // telegram arrived late -> start effect area now newData.effectStart = QDateTime::fromMSecsSinceEpoch(m_mainHandler->dds()->currentPartitionTimeMSec() + 100); // needs to be slightly in the future - newData.position.rx() = data.position().lon(); - newData.position.ry() = data.position().lat(); - newData.chargeTypeId = data.chargeTypeId(); + newData.position.rx() = data.position.lon; + newData.position.ry() = data.position.lat; + newData.chargeTypeId = data.chargeTypeId; ObjectDusSingleMine *ifs(new ObjectDusSingleMine(m_mainHandler, this)); connect(ifs, &ObjectDusSingleMine::effectStateChanged, this, &HandlerDusSingleMine::onEffectStateChanged); @@ -139,7 +139,7 @@ void HandlerDusSingleMine::onMineTriggered(const TrainingAreaBase::MineTriggered { if (modType == DataModification::eRemoved) return; - auto it = m_objectMap.constFind(data.mineAreaId()); + auto it = m_objectMap.constFind(data.mineAreaId); if (it == m_objectMap.cend()) // is it a DUS single mine or just a normal mineArea? return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effect_cluster.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effect_cluster.cpp index 131bc03ff..f93d46d14 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effect_cluster.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effect_cluster.cpp @@ -28,8 +28,8 @@ namespace AreaEffectSimulation HandlerEffectCluster::HandlerEffectCluster(MainHandler *mainHandler) : HandlerBaseTmpl(mainHandler, QStringLiteral("EffectCluster"), - s_areaCount[AesType::AtEffectCluster], - s_areaCountCentral[AesType::AtEffectCluster]) + s_areaCount[static_cast(AesType::AtEffectCluster)], + s_areaCountCentral[static_cast(AesType::AtEffectCluster)]) , Interface::Fts::EffectClusterModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::EffectClusterModifyActorRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::EffectClusterSingleEffectOnlyModifyRequestHandler(mainHandler->dds()->fts()) @@ -147,12 +147,12 @@ void HandlerEffectCluster::onFireCommandReceived(const TrainingAreaBase::EX_Fire // get fireReference if (modtype == DataModification::eRemoved) return; - DEBUG_LOG(m_logger) << "got EX_Fire for ref: " << fire.reference() << " internal mapsize " << m_referenceToClusterId.size(); - auto *ifs = m_objectMap.value(m_referenceToClusterId.value(QString::fromStdString(fire.reference()))); + DEBUG_LOG(m_logger) << "got EX_Fire for ref: " << fire.reference << " internal mapsize " << m_referenceToClusterId.size(); + auto *ifs = m_objectMap.value(m_referenceToClusterId.value(QString::fromStdString(fire.reference))); if (!ifs) return; - ifs->sendFireCommand(AdlerJson::waffensystemkennerMap.key(fire.effectorId())); + ifs->sendFireCommand(AdlerJson::waffensystemkennerMap.key(fire.effectorId)); } void HandlerEffectCluster::onFireHoldReceived(const TrainingAreaBase::EX_CeaseFiring &ceaseFire, DataModification modType) @@ -162,7 +162,7 @@ void HandlerEffectCluster::onFireHoldReceived(const TrainingAreaBase::EX_CeaseFi return; } -int HandlerEffectCluster::totalAreasCentral() const { return s_areaCountCentral[AesType::AtEffectCluster]; } +int HandlerEffectCluster::totalAreasCentral() const { return s_areaCountCentral[static_cast(AesType::AtEffectCluster)]; } // Appends /* @@ -179,69 +179,69 @@ static void fillData(const EffectClusterModifyRequest &src, QVector &dstEffectorVector, MainHandler *mainHandler) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + dst.id = src.id; - dst.name = QString::fromStdString(src.name()); - dst.element = QString::fromStdString(src.element()); + dst.name = QString::fromStdString(src.name); + dst.element = QString::fromStdString(src.element); - dst.impactPosition.rx() = src.area().cornerBottomLeft().lon(); - dst.impactPosition.ry() = src.area().cornerBottomLeft().lat(); - dst.impactLength = src.area().height(); - dst.impactWidth = src.area().width(); - dst.rotationAngle = src.area().rotation(); + dst.impactPosition.rx() = src.area.cornerBottomLeft.lon; + dst.impactPosition.ry() = src.area.cornerBottomLeft.lat; + dst.impactLength = src.area.height; + dst.impactWidth = src.area.width; + dst.rotationAngle = src.area.rotation; - const bool bIsPointSimilar = (src.explosionGeometry() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint) - || (src.explosionGeometry() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + const bool bIsPointSimilar = (src.explosionGeometry == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint) + || (src.explosionGeometry == AreaEffectSimulation::AesExplosionGeometry::EgPoint); - dstEffectorVector.reserve(src.effectors().size()); + dstEffectorVector.reserve(src.effectors.size()); Database::AesEffectorData dstEffector; int localImpactCount = 0; int firstChargeTypeId = 0; - for (const auto &effector : src.effectors()) + for (const auto &effector : src.effectors) { // copy from Source Request. - dstEffector.angleOfFall = effector.angleOfFall(); - dstEffector.chargeAmount = effector.chargeAmount(); - dstEffector.chargeTypeId = effector.chargeStruct().chargeTypeId(); - dstEffector.entityId = src.id(); - dstEffector.flightTime = effector.flightTime(); - dstEffector.igniterTypeId = effector.chargeStruct().igniterTypeId(); - dstEffector.igniterFunctionId = effector.chargeStruct().igniterFunctionId(); - dstEffector.interval = effector.interval(); - dstEffector.mhpPosition.rx() = effector.mhpPosition().lon(); - dstEffector.mhpPosition.ry() = effector.mhpPosition().lat(); - dstEffector.mhpPosition.rz() = effector.mhpPosition().z(); // [E01562-399] - dstEffector.properties = QString::fromStdString(effector.properties()); + dstEffector.angleOfFall = effector.angleOfFall; + dstEffector.chargeAmount = effector.chargeAmount; + dstEffector.chargeTypeId = effector.chargeStruct.chargeTypeId; + dstEffector.entityId = src.id; + dstEffector.flightTime = effector.flightTime; + dstEffector.igniterTypeId = effector.chargeStruct.igniterTypeId; + dstEffector.igniterFunctionId = effector.chargeStruct.igniterFunctionId; + dstEffector.interval = effector.interval; + dstEffector.mhpPosition.rx() = effector.mhpPosition.lon; + dstEffector.mhpPosition.ry() = effector.mhpPosition.lat; + dstEffector.mhpPosition.rz() = effector.mhpPosition.z; // [E01562-399] + dstEffector.properties = QString::fromStdString(effector.properties); // FillScatterData - if (effector.mhpScatterLenght() > 0.0) - dstEffector.mhpScatterLenght = effector.mhpScatterLenght(); + if (effector.mhpScatterLenght > 0.0) + dstEffector.mhpScatterLenght = effector.mhpScatterLenght; else dstEffector.mhpScatterLenght = Settings::getScatterLenghtDefault(); - dstEffector.mhpScatterLengthDetonationHeight = effector.mhpScatterLengthDetonationHeight(); - if (effector.mhpScatterWidth() > 0.0) - dstEffector.mhpScatterWidth = effector.mhpScatterWidth(); + dstEffector.mhpScatterLengthDetonationHeight = effector.mhpScatterLengthDetonationHeight; + if (effector.mhpScatterWidth > 0.0) + dstEffector.mhpScatterWidth = effector.mhpScatterWidth; else dstEffector.mhpScatterWidth = Settings::getScatterWidthDefault(); - dstEffector.mhpScatterWidthDetonationHeight = effector.mhpScatterWidthDetonationHeight(); + dstEffector.mhpScatterWidthDetonationHeight = effector.mhpScatterWidthDetonationHeight; // Fill rest - dstEffector.participantId = effector.participantId(); - dstEffector.peakHeight = effector.peakHeight(); - dstEffector.trajectory = QString::fromStdString(TrajectoryRelative::toString(effector.trajectoryRelative())); + dstEffector.participantId = effector.participantId; + dstEffector.peakHeight = effector.peakHeight; + dstEffector.trajectory = QString::fromStdString(TrajectoryRelative::toString(effector.trajectoryRelative)); // sanity stuff localImpactCount = localImpactCount + dstEffector.chargeAmount; if (firstChargeTypeId <= 0) - firstChargeTypeId = effector.chargeStruct().chargeTypeId(); + firstChargeTypeId = effector.chargeStruct.chargeTypeId; // check if it's a single fire - if (bIsPointSimilar && ((src.area().width() <= 0) || (src.area().height() <= 0))) + if (bIsPointSimilar && ((src.area.width <= 0) || (src.area.height <= 0))) { - const Core::GeoPosition2D &cornerBottomLeft = src.area().cornerBottomLeft(); - const double impactDiameter = mainHandler->dds()->pdmDtc()->impactRadius(effector.chargeStruct().chargeTypeId(), - effector.chargeStruct().igniterTypeId(), - effector.chargeStruct().igniterFunctionId()) + const Core::GeoPosition2D &cornerBottomLeft = src.area.cornerBottomLeft; + const double impactDiameter = mainHandler->dds()->pdmDtc()->impactRadius(effector.chargeStruct.chargeTypeId, + effector.chargeStruct.igniterTypeId, + effector.chargeStruct.igniterFunctionId) * 2.0; // GUEZE-2634 - const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(QPointF(cornerBottomLeft.lon(), cornerBottomLeft.lat()), impactDiameter, impactDiameter, 0)); + const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(QPointF(cornerBottomLeft.lon, cornerBottomLeft.lat), impactDiameter, impactDiameter, 0)); dstEffector.mhpPosition.rx() = bottomLeft.x(); dstEffector.mhpPosition.ry() = bottomLeft.y(); @@ -252,14 +252,14 @@ static void fillData(const EffectClusterModifyRequest &src, } // Save the mhpCountRequest for later dst.mhpCountRequest = dstEffectorVector.size(); - dst.explosionGeometryId = src.explosionGeometry(); - dst.tla = src.tla(); + 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.is_set() && 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()) - dst.effectDuration = src.effectDuration(); + if (src.effectDuration) + dst.effectDuration = src.effectDuration; else { // Sometimes there is no effectDuration @@ -267,20 +267,20 @@ static void fillData(const EffectClusterModifyRequest &src, dst.effectDuration = DEFAULT_EFFECT_DURATION; } - dst.effectSourceId = src.effectSourceId(); + dst.effectSourceId = src.effectSourceId; - dst.firePurposeId = src.firePurposeId(); + 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.is_set() ? src.partyId.get() : 0; + dst.participantId = src.participantId.is_set() ? 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.effectMarkingInTa = src.effectMarkingInTa; + dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0; - dst.properties = QString::fromStdString(src.properties()); - dst.esmParticipantIds = LtsUtils::IntArray(src.esmParticipantIds()); + dst.properties = QString::fromStdString(src.properties); + dst.esmParticipantIds = LtsUtils::IntArray(src.esmParticipantIds); // some modules: // if (dst.impactCount == 0 && localImpactCount > 0) @@ -297,8 +297,8 @@ void HandlerEffectCluster::onEffectClusterModifyRequest(const rti::core::SampleI // DEBUG_LOG(m_logger) << "************************************ start onEffectClusterModifyRequest: " << request; Core::FunctionReplyObject ret = effectClusterModifyRequest(cookie, request); if (ret.error()) - WARNING_LOG(m_logger) << ret() << ", effectStart :" << request.effectStart(); - ret.setAdditionalInfo(request.properties().c_str()); + WARNING_LOG(m_logger) << ret() << ", effectStart :" << request.effectStart; + ret.setAdditionalInfo(request.properties.c_str()); // DEBUG_LOG(m_logger) << "************************************ SEND REPLY FOR onEffectClusterModifyRequest: " << request; m_mainHandler->dds()->fts()->effectClusterModifyReply(cookie, ret); @@ -309,7 +309,7 @@ void HandlerEffectCluster::onEffectClusterModifyActorRequest(const rti::core::Sa // DEBUG_LOG(m_logger) << "************************************ start onEffectClusterModifyActorRequest: " << request; Core::FunctionReplyObject ret; - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesId(), ret); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesId, ret); if (!ifs) { m_mainHandler->dds()->fts()->effectClusterModifyActorReply(cookie, ret); @@ -380,28 +380,28 @@ void HandlerEffectCluster::onEffectClusterOcModifyRequest(const rti::core::Sampl EffectClusterModifyRequest ecCommonModifyRequest; - ecCommonModifyRequest.id(request.id()); + ecCommonModifyRequest.id = request.id; // ecCommonModifyRequest.externalId(request.externalId()); - ecCommonModifyRequest.effectStart(request.effectStart()); - ecCommonModifyRequest.effectDuration(request.effectDuration()); + ecCommonModifyRequest.effectStart = request.effectStart; + ecCommonModifyRequest.effectDuration = request.effectDuration; // charge and geometry: - ecCommonModifyRequest.area(request.area()); + ecCommonModifyRequest.area = request.area; int impactCount = 0; - for (const auto &effector : request.effectors()) - effector.chargeAmount(); + for (const auto &effector : request.effectors) + effector.chargeAmount; if (impactCount == 1) - ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; else - ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); + ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; // ecCommonModifyRequest.zog(0); - ecCommonModifyRequest.effectors(request.effectors()); - ecCommonModifyRequest.name(request.name()); // ZpNummer - ecCommonModifyRequest.element(ecCommonModifyRequest.element()); // element + ecCommonModifyRequest.effectors = request.effectors; + ecCommonModifyRequest.name = request.name; // ZpNummer + ecCommonModifyRequest.element = ecCommonModifyRequest.element; // element - ecCommonModifyRequest.partyId(request.partyId()); + ecCommonModifyRequest.partyId = request.partyId; // ecCommonModifyRequest.participantId(-1); // -1 -> avoid trajectory // ToDo: no trajectory needed, but how can we transfer the rotation of MhpAreas? @@ -423,26 +423,26 @@ 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; - if (request.effectors().size() == 0) + const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0; + if (request.effectors.size() == 0) return Core::FunctionReplyObject(tr_lts("dds", "Invalid Effector Count")); // We assume that there is no mixture of GeraClasses between charges - const ProjectDataManagement::GearClass gearClass = m_mainHandler->gearClassOfChargeTypeId(request.effectors().at(0).chargeStruct().chargeTypeId()); + const ProjectDataManagement::GearClass gearClass = m_mainHandler->gearClassOfChargeTypeId(request.effectors.at(0).chargeStruct.chargeTypeId); - const bool bDoClaimPlannedCharge = (request.id() == 0) && (externalIdValue == 0) - && (gearClass != ProjectDataManagement::GearClass_def::AirSupport + const bool bDoClaimPlannedCharge = (request.id == 0) && (externalIdValue == 0) + && (gearClass != ProjectDataManagement::GearClass::GearClass_AirSupport //&& (m_mainHandler->dds()->pdmDtc()->isAdlerChargeType(request.chargeTypeId())) ) - && 1 == 2 && (request.effectSourceId() == ProjectDataManagement::EffectSource::ES_Internal); + && 1 == 2 && (request.effectSourceId == ProjectDataManagement::EffectSource::ES_Internal); if (bDoClaimPlannedCharge) { // get full charge amount per charge QMap mapChargeTypeAmount; // QMp - for (const auto &effector : request.effectors()) - mapChargeTypeAmount.insert(effector.chargeStruct().chargeTypeId(), mapChargeTypeAmount.value(effector.chargeStruct().chargeTypeId()) + effector.chargeAmount()); + for (const auto &effector : request.effectors) + mapChargeTypeAmount.insert(effector.chargeStruct.chargeTypeId, mapChargeTypeAmount.value(effector.chargeStruct.chargeTypeId) + effector.chargeAmount); QMapIterator it(mapChargeTypeAmount); while (it.hasNext()) { @@ -452,14 +452,14 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const if (chargeNeeded <= 0) return Core::FunctionReplyObject(tr_lts("dds", "Invalid impact count (<= 0).")); - if (request.id() == 0) + if (request.id == 0) { - int chargeLeft = m_mainHandler->chargeAdministrationHandler()->availableCharge(it.key(), request.partyId().get()); + int chargeLeft = m_mainHandler->chargeAdministrationHandler()->availableCharge(it.key(), request.partyId.get()); - QString chargeName = QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(it.key()).name()); + QString chargeName = QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(it.key()).name); QString fireUnitName; - if (request.participantId().is_set()) - fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId().get()).designator()); + if (request.participantId.is_set()) + fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId.get()).designator); if (chargeNeeded > chargeLeft) return Core::FunctionReplyObject(tr_lts("dds", "Invalid impact count. Fire Unit '%1' has %2 charges (%3), but for this cluster %4 are needed.")) @@ -474,11 +474,11 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const Database::AesEffectCluster newData; QVector newEffectorDataVec; - const QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(request.properties())).object(); + const QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(request.properties)).object(); 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.is_set() || request.effectStart.get() == 0)) { newData.isUsingEffectStateReceived = propertiesObject.value(QStringLiteral("useReceived")).toBool(); } @@ -513,7 +513,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air supports.")); } } - else if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtEffectCluster]) + (s_currentAirSupportCount) && request.effectStart().is_set()) + else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtEffectCluster)]) + (s_currentAirSupportCount) && request.effectStart.is_set()) { ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -543,21 +543,21 @@ 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.is_set() ? request.externalId.get() : 0; + // if (externalIdValue == 0 && !request.partyId.is_set()) // return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id.")); - DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart() << ", effectDuration :" - << request.effectDuration() + DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart << ", effectDuration :" + << request.effectDuration // << ", flightDuration :" << request.flightDuration() // << ", tapTime :" << request.tapTime() - << ", properties: " << request.properties(); + << ", properties: " << request.properties; Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return effectClusterCreateRequest(request); - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; @@ -569,12 +569,12 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const const QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(aea.properties.toStdString())).object(); // Context NASAT: check via chargeTypeId: - const ProjectDataManagement::GearClass gc = m_mainHandler->gearClassOfChargeTypeId(request.effectors().at(0).chargeStruct().chargeTypeId()); + const ProjectDataManagement::GearClass gc = m_mainHandler->gearClassOfChargeTypeId(request.effectors.at(0).chargeStruct.chargeTypeId); 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.is_set() && ifs->isObjectModifiable()) // ToDo: check { // Calculate new polygon here. Not nice, though auto poly = Polygons::effectClusterArea(aea); @@ -590,20 +590,20 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterModifyRequest(const } else { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtEffectCluster] + (s_currentAirSupportCount)) && request.effectStart().is_set() + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtEffectCluster)] + (s_currentAirSupportCount)) && request.effectStart.is_set() && ((wasCentral && !ifs->isActivationTimeSet()) || !wasCentral)) return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central effect clusters.")); } // For counting, only Elements being at least prepared are important: } - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; } - DEBUG_LOG(m_logger) << "request.properties()" << request.properties() << " aea.properties=" << aea.properties; + DEBUG_LOG(m_logger) << "request.properties()" << request.properties << " aea.properties=" << aea.properties; // ifs->setEffectors(effectorDataVec); // updateProperties(aea, effectorDataVec); <- done in fillData // update internalMap @@ -656,7 +656,7 @@ void HandlerEffectCluster::onEffectClusterPauseResumeRequest(const rti::core::Sa { DEBUG_LOG(m_logger) << "onEffectClusterPauseResumeRequest" << request; Core::FunctionReplyObject ret; - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) { m_mainHandler->dds()->fts()->effectClusterPauseResumeReply(cookie, ret); @@ -677,13 +677,13 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl Core::FunctionReplyObject ret; - ProjectDataManagement::L22_FireHaltCategory categorie = request.fireHaltCategory(); + ProjectDataManagement::L22_FireHaltCategory categorie = request.fireHaltCategory; QMap effectClusterPartyMap; for (const auto *area : qAsConst(m_objectMap)) { - if (area->data().partyId == request.partyId()) + if (area->data().partyId == request.partyId) { ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, area->data().id, ret); if (!ifs) @@ -696,7 +696,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl } } - switch (categorie.underlying()) + switch (categorie) { case ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_A: // Feuer Halt Allgemein { @@ -705,9 +705,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl { EffectClusterPauseResumeRequest req; - req.id(ifs->data().id); - req.remainingDuration(ifs->data().effectDuration); - req.resumeExecution(false); // false -> pause aes + req.id = ifs->data().id; + req.remainingDuration = ifs->data().effectDuration; + req.resumeExecution = false; // false -> pause aes ret = ifs->resumePause(req); } @@ -720,9 +720,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl // the fire hold with the corresponding target coordinate and circular area. for (auto *ifs : qAsConst(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.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; DEBUG_LOG(m_logger) << "[Feuer Halt Referenziert] " << "lonRad : " << lonRad << " " << "latRad : " << latRad << " " << "radius : " << radius; @@ -731,9 +731,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl DEBUG_LOG(m_logger) << "[Feuer Halt Referenziert ----- intersectWithCircle] " << "effectClusterId: " << ifs->data().id; EffectClusterPauseResumeRequest req; - req.id(ifs->data().id); - req.remainingDuration(ifs->data().effectDuration); - req.resumeExecution(false); // false -> pause aes + req.id = ifs->data().id; + req.remainingDuration = ifs->data().effectDuration; + req.resumeExecution = false; // false -> pause aes ifs->resumePause(req); } @@ -750,7 +750,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.is_set() ? request.entladenSchuss.get() : false); } break; } @@ -760,8 +760,8 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl DEBUG_LOG(m_logger) << "[Aufheben Feuer Halt Allgemein] " << "effectClusterId: " << ifs->data().id; EffectClusterPauseResumeRequest req; - req.remainingDuration(ifs->data().effectDuration); - req.resumeExecution(true); // true -> resume aes + req.remainingDuration = ifs->data().effectDuration; + req.resumeExecution = true; // true -> resume aes ifs->resumePause(req); } @@ -770,9 +770,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl { for (auto *ifs : qAsConst(effectClusterPartyMap)) { - const double lonRad = request.longitude().is_set() ? request.longitude().get() * LtsCoordTrans::deg2rad() : 0.0; // optional - const double latRad = request.latitude().is_set() ? request.latitude().get() * LtsCoordTrans::deg2rad() : 0.0; // optional - const int radius = request.radius().is_set() ? request.radius().get() : 0; + const double lonRad = request.longitude.is_set() ? request.longitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional + const double latRad = request.latitude.is_set() ? request.latitude.get() * LtsCoordTrans::deg2rad() : 0.0; // optional + const int radius = request.radius.is_set() ? request.radius.get() : 0; DEBUG_LOG(m_logger) << "[Aufheben Feuer Halt Referenziert] " << "lonRad : " << lonRad << " " << "latRad : " << latRad << " " << "radius : " << radius; @@ -782,9 +782,9 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl EffectClusterPauseResumeRequest req; - req.id(ifs->data().id); - req.remainingDuration(ifs->data().effectDuration); - req.resumeExecution(true); // true -> resume aes + req.id = ifs->data().id; + req.remainingDuration = ifs->data().effectDuration; + req.resumeExecution = true; // true -> resume aes ifs->resumePause(req); } @@ -792,7 +792,7 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl break; } default: - INFO_LOG(m_logger) << "EX-FH missing or wrong FireHaltCategory" << categorie.underlying(); + INFO_LOG(m_logger) << "EX-FH missing or wrong FireHaltCategory" << categorie; break; } @@ -805,8 +805,8 @@ void HandlerEffectCluster::onEffectClusterFireHaltRequest(const rti::core::Sampl void HandlerEffectCluster::onEffectClusterReleaseReceivedRequest(const rti::core::SampleIdentity &cookie, const EffectClusterReleaseReceivedRequest &request) { DEBUG_LOG(m_logger) << "onEffectClusterReleaseReceivedRequest" << request; - Core::FunctionReplyObject ret(request.id()); - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + Core::FunctionReplyObject ret(request.id); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) { ERROR_LOG(m_logger) << ret(); @@ -816,7 +816,7 @@ void HandlerEffectCluster::onEffectClusterReleaseReceivedRequest(const rti::core if (!ifs->isUsingEffectStateReceived()) { - ret = ret.setStr(tr_lts("dds", "EffectCluster with id %1 is not using EffectState Received")).arg(request.id()); + ret = ret.setStr(tr_lts("dds", "EffectCluster with id %1 is not using EffectState Received")).arg(request.id); ERROR_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->effectClusterReleaseReceivedReply(cookie, ret); return; @@ -832,9 +832,9 @@ void HandlerEffectCluster::onEffectClusterReleaseReceivedRequest(const rti::core void HandlerEffectCluster::onAcknowledgeExternalAesItemRequest(const rti::core::SampleIdentity &cookie, const AcknowledgeExternalAesItemRequest &request) { - DEBUG_LOG(m_logger) << "HandlerEffectCluster::onAcknowledgeExternalAesItemRequest for aesItem" << request.aesId(); - Core::FunctionReplyObject ret(request.aesId()); - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesId(), ret); + DEBUG_LOG(m_logger) << "HandlerEffectCluster::onAcknowledgeExternalAesItemRequest for aesItem" << request.aesId; + Core::FunctionReplyObject ret(request.aesId); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesId, ret); if (!ifs) { ERROR_LOG(m_logger) << ret(); @@ -852,18 +852,18 @@ void HandlerEffectCluster::onAcknowledgeExternalAesItemRequest(const rti::core:: void HandlerEffectCluster::onSetAesItemEffectorStateRequest(const rti::core::SampleIdentity &cookie, const SetAesItemEffectorStateRequest &request) { - DEBUG_LOG(m_logger) << "HandlerEffectCluster::onSetAesItemEffectorStateRequest for aesItem" << request.aesId() << " to State: " << request.newEffectorState(); - Core::FunctionReplyObject ret(request.aesId()); - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesId(), ret); + DEBUG_LOG(m_logger) << "HandlerEffectCluster::onSetAesItemEffectorStateRequest for aesItem" << request.aesId << " to State: " << request.newEffectorState; + Core::FunctionReplyObject ret(request.aesId); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesId, ret); if (!ifs) { ERROR_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->setAesItemEffectorStateReply(cookie, ret); return; } - if (!ifs->overrideEffectorStates(request.newEffectorState())) + if (!ifs->overrideEffectorStates(request.newEffectorState)) { - ret.setStr(tr_lts("dds", "EffectCluster with id %1 can't change to new State")).arg(request.aesId()); + ret.setStr(tr_lts("dds", "EffectCluster with id %1 can't change to new State")).arg(request.aesId); } m_mainHandler->dds()->fts()->setAesItemEffectorStateReply(cookie, ret); @@ -901,7 +901,7 @@ void HandlerEffectCluster::onTrajectoryAdlerModifyRequest(const rti::core::Sampl { DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyRequest" << request; Core::FunctionReplyObject ret; - ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesItemId(), ret); + ObjectEffectCluster *ifs = getObjectFromMap(m_objectMap, request.aesItemId, ret); if (!ifs) { m_mainHandler->dds()->fts()->trajectoryAdlerModifyReply(cookie, ret); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp index 8afb6760f..d4bafb639 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp @@ -68,20 +68,20 @@ void HandlerEffector::onParticipantChanged(const ParticipantManagement::Particip //DEBUG_LOG(m_logger)<<"onParticipantChanged participantId:" << data.id(); if (modType == DataModification::eRemoved) { - DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.id(); - if (m_effectors.contains(data.id())) - deleteEffector(data.id()); + DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.id; + if (m_effectors.contains(data.id)) + deleteEffector(data.id); return; } - if (m_ppmDtc->isArtilleryType(data.typeId())) + if (m_ppmDtc->isArtilleryType(data.typeId)) { // Filter TypeClass Unit - ParticipantManagement::Type type = m_ppmDtc->type(data.typeId()); - if (type.typeClass() != ParticipantManagement::TypeClass_def::Unit) - createEffector(data.id()); + ParticipantManagement::Type type = m_ppmDtc->type(data.typeId); + if (type.typeClass != ParticipantManagement::TypeClass::Unit) + createEffector(data.id); } else - if (m_effectors.contains(data.id())) - deleteEffector(data.id()); + if (m_effectors.contains(data.id)) + deleteEffector(data.id); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_area.cpp index 1e362934a..cf7b817c5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_area.cpp @@ -15,7 +15,7 @@ namespace AreaEffectSimulation { HandlerExplosionArea::HandlerExplosionArea(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionArea"), s_areaCount[AesType::AtExplosionArea], s_areaCountCentral[AesType::AtExplosionArea]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionArea"), s_areaCount[static_cast(AesType::AtExplosionArea)], s_areaCountCentral[static_cast(AesType::AtExplosionArea)]) , Interface::Fts::ExplosionAreaModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::ExplosionAreaRemoveRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::ExplosionAreaPauseResumeRequestHandler(m_mainHandler->dds()->fts()) @@ -40,7 +40,7 @@ bool HandlerExplosionArea::init() } if (!ifs->data().isCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle])) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)])) { ERROR_LOG(m_logger) << "More active explosion areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -50,7 +50,7 @@ bool HandlerExplosionArea::init() } else { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)])) { ERROR_LOG(m_logger) << "More active explosion areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -83,39 +83,39 @@ bool HandlerExplosionArea::init() int HandlerExplosionArea::totalAreas() const { - return s_areaCount[AesType::AtExplosionArea] + s_areaCount[AesType::AtExplosionSingle]; + return s_areaCount[static_cast(AesType::AtExplosionArea)] + s_areaCount[static_cast(AesType::AtExplosionSingle)]; } int HandlerExplosionArea::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtExplosionArea] + s_areaCountCentral[AesType::AtExplosionSingle]; + return s_areaCountCentral[static_cast(AesType::AtExplosionArea)] + s_areaCountCentral[static_cast(AesType::AtExplosionSingle)]; } static void fillData(const ExplosionAreaModifyRequest &src, Database::AesExplosionArea &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + dst.id = src.id; - dst.impactPosition.rx() = src.area().cornerBottomLeft().lon(); - 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.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.chargeTypeId = src.chargeTypeId(); - dst.participantId = src.participantId().is_set() ? 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.impactPosition.rx() = src.area.cornerBottomLeft.lon; + 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.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.chargeTypeId = src.chargeTypeId; + dst.participantId = src.participantId.is_set() ? 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; } void HandlerExplosionArea::onExplosionAreaModifyRequest(const rti::core::SampleIdentity &cookie, @@ -130,22 +130,22 @@ void HandlerExplosionArea::onExplosionAreaModifyRequest(const rti::core::SampleI Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const ExplosionAreaModifyRequest &request) { - if (!request.partyId().is_set()) + if (!request.partyId.is_set()) return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id.")); - int chargeNeeded = request.cannonCount() * request.cannonRounds(); + int chargeNeeded = request.cannonCount * request.cannonRounds; if (chargeNeeded <= 0) return Core::FunctionReplyObject(tr_lts("dds", "Invalid impact count (cannon round or cannon count <= 0).")); - if (request.id() == 0) + if (request.id == 0) { - int chargeLeft = m_mainHandler->chargeAdministrationHandler()->availableCharge(request.chargeTypeId(), request.partyId().get()); + int chargeLeft = m_mainHandler->chargeAdministrationHandler()->availableCharge(request.chargeTypeId, request.partyId.get()); if (chargeNeeded > chargeLeft) return Core::FunctionReplyObject(tr_lts("dds", "Invalid impact count (%1 charges needed but only %2 charges available for Charge Id %3 and Party Id %4).")) .arg(chargeNeeded) .arg(chargeLeft) - .arg(request.chargeTypeId()) - .arg(request.partyId().get()); + .arg(request.chargeTypeId) + .arg(request.partyId.get()); } Database::AesExplosionArea newData; @@ -164,7 +164,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const if (ifs->data().isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle]) && request.effectStart().is_set()) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)]) && request.effectStart.is_set()) { 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[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart().is_set()) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -208,10 +208,10 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaCreateRequest(const Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const ExplosionAreaModifyRequest &request) { Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return explosionAreaCreateRequest(request); - ObjectExplosionArea *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectExplosionArea *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; @@ -230,18 +230,18 @@ 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.is_set()) { if (isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)])) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central explosion areas and explosion singles")); } } else { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle])) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)])) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active explosion areas and explosion singles")); } @@ -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.is_set() && ifs->isObjectModifiable()) { // Calculate new polygon here. Not nice, though @@ -264,8 +264,8 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const // Change from central to training area if (wasCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active explosion areas and explosion singles")); + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active explosion areas and explosion singles")); m_areaCount++; m_areaCountCentral--; @@ -274,8 +274,8 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const } else // Change from training area to central { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active central explosion areas and explosion singles")); + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active central explosion areas and explosion singles")); m_areaCount--; m_areaCountCentral++; DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtExplosionArea] = " << m_areaCount; @@ -284,7 +284,7 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyRequest(const } } - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; @@ -297,27 +297,27 @@ Core::FunctionReplyObject HandlerExplosionArea::explosionAreaModifyGeometryReque { // WARNING: request.area.cornerBottomLeft() contains center point! Core::FunctionReplyObject ret; - ObjectExplosionArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectExplosionArea *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; // 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[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)]) + && request.effectStart.is_set() && !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")); + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active explosion areas and explosion singles")); // Todo: IsObjectModifiable() ?!? AreaEffectSimulation::Database::AesExplosionArea aea(ifs->data()); - aea.impactPosition = Polygons::centerPoint2BottomLeft(QPointF(request.area().cornerBottomLeft().lon(), - request.area().cornerBottomLeft().lat()), + aea.impactPosition = Polygons::centerPoint2BottomLeft(QPointF(request.area.cornerBottomLeft.lon, + request.area.cornerBottomLeft.lat), ifs->data().impactWidth, ifs->data().impactLength, - request.area().rotation()); - aea.rotationAngle = request.area().rotation(); + request.area.rotation); + aea.rotationAngle = request.area.rotation; return ifs->updateObject(aea); } @@ -343,7 +343,7 @@ void HandlerExplosionArea::onExplosionAreaPauseResumeRequest(const rti::core::Sa { DEBUG_LOG(m_logger) << "onExplosionAreaPauseResumeRequest" << request; Core::FunctionReplyObject ret; - ObjectExplosionArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectExplosionArea *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) { m_mainHandler->dds()->fts()->explosionAreaPauseResumeReply(cookie, ret); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_cluster.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_cluster.cpp index fee10c8ad..c48c1807e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_cluster.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_cluster.cpp @@ -23,7 +23,7 @@ namespace AreaEffectSimulation { HandlerExplosionCluster::HandlerExplosionCluster(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("HandlerExplosionCluster"), s_areaCount[AesType::AtExplosionCluster], s_areaCountCentral[AesType::AtExplosionCluster]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("HandlerExplosionCluster"), s_areaCount[static_cast(AesType::AtExplosionCluster)], s_areaCountCentral[static_cast(AesType::AtExplosionCluster)]) , Interface::Fts::ExplosionClusterModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::ExplosionClusterSingleEffectOnlyModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::ExplosionClusterOcModifyRequestHandler(mainHandler->dds()->fts()) @@ -68,7 +68,7 @@ bool HandlerExplosionCluster::init() return true; } } - else if (totalAreas() >= s_maxActiveAreas[AesType::AtExplosionCluster]) + else if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtExplosionCluster)]) { ERROR_LOG(m_logger) << "More active explosion areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -78,7 +78,7 @@ bool HandlerExplosionCluster::init() } else { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionCluster])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionCluster)])) { ERROR_LOG(m_logger) << "More active explosion areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -114,41 +114,41 @@ bool HandlerExplosionCluster::init() int HandlerExplosionCluster::totalAreas() const { - return s_areaCount[AesType::AtExplosionCluster]; + return s_areaCount[static_cast(AesType::AtExplosionCluster)]; } int HandlerExplosionCluster::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtExplosionCluster] ; + return s_areaCountCentral[static_cast(AesType::AtExplosionCluster)] ; } static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExplosionCluster &dst, MainHandler *mainHandler) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + dst.id = src.id; - dst.name = QString::fromStdString(src.name()); - dst.element = QString::fromStdString(src.element()); + dst.name = QString::fromStdString(src.name); + dst.element = QString::fromStdString(src.element); - dst.impactPosition.rx() = src.area().cornerBottomLeft().lon(); - dst.impactPosition.ry() = src.area().cornerBottomLeft().lat(); - dst.impactLength = src.area().height(); - dst.impactWidth = src.area().width(); - dst.rotationAngle = src.area().rotation(); + dst.impactPosition.rx() = src.area.cornerBottomLeft.lon; + dst.impactPosition.ry() = src.area.cornerBottomLeft.lat; + dst.impactLength = src.area.height; + dst.impactWidth = src.area.width; + dst.rotationAngle = src.area.rotation; - const bool bIsPointSimilar = (src.explosionGeometry() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint) || - (src.explosionGeometry() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + const bool bIsPointSimilar = (src.explosionGeometry == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint) || + (src.explosionGeometry == AreaEffectSimulation::AesExplosionGeometry::EgPoint); - if (bIsPointSimilar && ((src.area().width() <= 0) || (src.area().height() <= 0))) + if (bIsPointSimilar && ((src.area.width <= 0) || (src.area.height <= 0))) { - const Core::GeoPosition2D &cornerBottomLeft = src.area().cornerBottomLeft(); - const double impactDiameter = mainHandler->dds()->pdmDtc()->impactRadius(src.chargeStruct().chargeTypeId(), - src.chargeStruct().igniterTypeId(), - src.chargeStruct().igniterFunctionId()) * 2.0; // GUEZE-2634 + const Core::GeoPosition2D &cornerBottomLeft = src.area.cornerBottomLeft; + const double impactDiameter = mainHandler->dds()->pdmDtc()->impactRadius(src.chargeStruct.chargeTypeId, + src.chargeStruct.igniterTypeId, + src.chargeStruct.igniterFunctionId) * 2.0; // GUEZE-2634 - const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(QPointF(cornerBottomLeft.lon(), cornerBottomLeft.lat()), + const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(QPointF(cornerBottomLeft.lon, cornerBottomLeft.lat), impactDiameter, impactDiameter, 0)); dst.impactPosition.rx() = bottomLeft.x(); @@ -157,49 +157,49 @@ static void fillData(const ExplosionClusterModifyRequest &src, Database::AesExpl dst.impactWidth = impactDiameter; } - dst.explosionGeometryId = src.explosionGeometry(); - dst.zog = src.tla(); + 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.effectDuration = src.effectDuration(); - dst.effectSourceId = src.effectSourceId(); + dst.effectStart = src.effectStart.is_set() && src.effectStart.get() > 0 ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime(); + dst.effectDuration = src.effectDuration; + dst.effectSourceId = src.effectSourceId; - dst.chargeTypeId = src.chargeStruct().chargeTypeId(); - dst.igniterTypeId = src.chargeStruct().igniterTypeId(); - dst.igniterFunctionId = src.chargeStruct().igniterFunctionId(); - dst.firePurposeId = src.firePurposeId(); + dst.chargeTypeId = src.chargeStruct.chargeTypeId; + dst.igniterTypeId = src.chargeStruct.igniterTypeId; + 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.is_set() ? src.partyId.get() : 0; + dst.participantId = src.participantId.is_set() ? 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()) - dst.mhpRotationRequest = src.mhpRotation().get(); + dst.impactCount = src.impactCount; + dst.mhpCountRequest = src.mhpCount; + if (src.mhpRotation.is_set()) + dst.mhpRotationRequest = src.mhpRotation.get(); else dst.mhpRotationRequest = ObjectExplosionCluster::s_invalid_rotation_angle; dst.altitude = -1; - dst.peakHeight = src.peakHeight(); - dst.flightDuration = src.flightDuration(); + dst.peakHeight = src.peakHeight; + dst.flightDuration = src.flightDuration; // dst.originatorId = src.o(); // 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.effectMarkingInTa = src.effectMarkingInTa; + dst.externalId = src.externalId.is_set() ? src.externalId.get() : 0; - dst.launchVelocity = src.launchVelocity(); - dst.launchAngleDeg = src.launchAngleDeg(); - dst.dropAngle = src.dropAngle(); + dst.launchVelocity = src.launchVelocity; + dst.launchAngleDeg = src.launchAngleDeg; + dst.dropAngle = src.dropAngle; - dst.tapTimepoint = src.tapTime(); - dst.lcPrf = src.lcAttack(); - dst.lcTermination = src.lcTermination(); - dst.cloudBase = src.cloudBase(); - dst.properties = QString::fromStdString(src.properties()); - dst.esmParticipantIds = LtsUtils::IntArray(src.esmParticipantIds()); + dst.tapTimepoint = src.tapTime; + dst.lcPrf = src.lcAttack; + dst.lcTermination = src.lcTermination; + dst.cloudBase = src.cloudBase; + dst.properties = QString::fromStdString(src.properties); + dst.esmParticipantIds = LtsUtils::IntArray(src.esmParticipantIds); } void HandlerExplosionCluster::onExplosionClusterModifyRequest(const rti::core::SampleIdentity &cookie, @@ -209,8 +209,8 @@ void HandlerExplosionCluster::onExplosionClusterModifyRequest(const rti::core::S Core::FunctionReplyObject ret = explosionClusterModifyRequest(cookie, request); if (ret.error()) WARNING_LOG(m_logger) << ret() - << ", effectStart :" << request.effectStart(); - ret.setAdditionalInfo(request.properties().c_str()); + << ", effectStart :" << request.effectStart; + ret.setAdditionalInfo(request.properties.c_str()); m_mainHandler->dds()->fts()->explosionClusterModifyReply(cookie, ret); } @@ -224,35 +224,35 @@ void HandlerExplosionCluster::onExplosionClusterSingleEffectOnlyModifyRequest(co ExplosionClusterModifyRequest ecCommonModifyRequest; - ecCommonModifyRequest.id(request.id()); - ecCommonModifyRequest.externalId(request.externalId()); + ecCommonModifyRequest.id = request.id; + ecCommonModifyRequest.externalId = request.externalId; - ecCommonModifyRequest.effectStart(request.effectStart()); - ecCommonModifyRequest.effectDuration(1000); + ecCommonModifyRequest.effectStart = request.effectStart; + ecCommonModifyRequest.effectDuration = 1000; // charge and geometry: - ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; // ecCommonModifyRequest.zog(0); int igniterTypeId = 102; // from pdm_igniter_type (Impact Default) - ecCommonModifyRequest.chargeStruct().igniterTypeId(igniterTypeId); - ecCommonModifyRequest.chargeStruct().chargeTypeId(request.chargeTypeId()); + ecCommonModifyRequest.chargeStruct.igniterTypeId = igniterTypeId; + ecCommonModifyRequest.chargeStruct.chargeTypeId = request.chargeTypeId; // height, width are <=0 -> area will be adjusted using impactRadius of charge: - ecCommonModifyRequest.area().cornerBottomLeft(request.impactPosition()); - ecCommonModifyRequest.area().height(0); - ecCommonModifyRequest.area().width(0); + ecCommonModifyRequest.area.cornerBottomLeft = request.impactPosition; + ecCommonModifyRequest.area.height = 0; + ecCommonModifyRequest.area.width = 0; - ecCommonModifyRequest.mhpCount(1); - ecCommonModifyRequest.impactCount(1); + ecCommonModifyRequest.mhpCount = 1; + ecCommonModifyRequest.impactCount = 1; - ecCommonModifyRequest.name(request.name()); // ZpNummer - ecCommonModifyRequest.element(request.element()); // element + ecCommonModifyRequest.name = request.name; // ZpNummer + ecCommonModifyRequest.element = request.element; // element - ecCommonModifyRequest.partyId(request.partyId()); - ecCommonModifyRequest.participantId(-1); // -1 -> avoid trajectory + ecCommonModifyRequest.partyId = request.partyId; + ecCommonModifyRequest.participantId = -1; // -1 -> avoid trajectory @@ -273,33 +273,33 @@ void HandlerExplosionCluster::onExplosionClusterOcModifyRequest(const rti::core: ExplosionClusterModifyRequest ecCommonModifyRequest; - ecCommonModifyRequest.id(request.id()); + ecCommonModifyRequest.id = request.id; //ecCommonModifyRequest.externalId(request.externalId()); - ecCommonModifyRequest.effectStart(request.effectStart()); - ecCommonModifyRequest.effectDuration(request.effectDuration()); + ecCommonModifyRequest.effectStart = request.effectStart; + ecCommonModifyRequest.effectDuration = request.effectDuration; // charge and geometry: - ecCommonModifyRequest.area(request.area()); + ecCommonModifyRequest.area = request.area; - if (request.impactCount() == 1) - ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); + if (request.impactCount == 1) + ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; else - ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); + ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; // ecCommonModifyRequest.zog(0); - ecCommonModifyRequest.mhpCount(request.mhpCount()); - ecCommonModifyRequest.impactCount(request.impactCount()); - ecCommonModifyRequest.mhpRotation(request.mhpRotation()); + ecCommonModifyRequest.mhpCount = request.mhpCount; + ecCommonModifyRequest.impactCount = request.impactCount; + ecCommonModifyRequest.mhpRotation = request.mhpRotation; // was FtImpact - ecCommonModifyRequest.chargeStruct().igniterTypeId(request.chargeStruct().igniterTypeId()); - ecCommonModifyRequest.chargeStruct().chargeTypeId(request.chargeStruct().chargeTypeId()); + ecCommonModifyRequest.chargeStruct.igniterTypeId = request.chargeStruct.igniterTypeId; + ecCommonModifyRequest.chargeStruct.chargeTypeId = request.chargeStruct.chargeTypeId; - ecCommonModifyRequest.name(request.name()); // ZpNummer - ecCommonModifyRequest.element(ecCommonModifyRequest.element()); // element + ecCommonModifyRequest.name = request.name; // ZpNummer + ecCommonModifyRequest.element = ecCommonModifyRequest.element; // element - ecCommonModifyRequest.partyId(request.partyId()); + ecCommonModifyRequest.partyId = request.partyId; // ecCommonModifyRequest.participantId(-1); // -1 -> avoid trajectory // ToDo: no trajectory needed, but how can we transfer the rotation of MhpAreas? @@ -320,26 +320,26 @@ 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 ProjectDataManagement::GearClass gearClass = m_mainHandler->gearClassOfChargeTypeId(request.chargeStruct().chargeTypeId()); + const int externalIdValue = request.externalId.is_set() ? request.externalId.get() : 0; + const ProjectDataManagement::GearClass gearClass = m_mainHandler->gearClassOfChargeTypeId(request.chargeStruct.chargeTypeId); - const bool bDoClaimPlannedCharge = (request.id() == 0) && + const bool bDoClaimPlannedCharge = (request.id == 0) && (externalIdValue==0) && - (gearClass != ProjectDataManagement::GearClass_def::AirSupport); + (gearClass != ProjectDataManagement::GearClass::GearClass_AirSupport); if (bDoClaimPlannedCharge) { - int chargeNeeded = request.impactCount(); + int chargeNeeded = request.impactCount; if (chargeNeeded <= 0) return Core::FunctionReplyObject(tr_lts("dds", "Invalid impact count (<= 0).")); - if (request.id() == 0) + if (request.id == 0) { - int chargeLeft = m_mainHandler->chargeAdministrationHandler()->availableCharge(request.chargeStruct().chargeTypeId(), request.partyId().get()); + int chargeLeft = m_mainHandler->chargeAdministrationHandler()->availableCharge(request.chargeStruct.chargeTypeId, request.partyId.get()); - QString chargeName= QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(request.chargeStruct().chargeTypeId()).name()); + QString chargeName= QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(request.chargeStruct.chargeTypeId).name); QString fireUnitName; - if (request.participantId().is_set()) - fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId().get()).designator()); + if (request.participantId.is_set()) + fireUnitName = QString::fromStdString(m_mainHandler->dds()->ppmDtc()->participant(request.participantId.get()).designator); if (chargeNeeded > chargeLeft) return Core::FunctionReplyObject(tr_lts("dds", "Invalid impact count. Fire Unit '%1' has %2 charges (%3), but for this cluster %4 are needed.")) @@ -353,11 +353,11 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest Database::AesExplosionCluster newData; fillData(request, newData, m_mainHandler); - if (!request.properties().empty() && - (!request.effectStart().is_set() || - request.effectStart().get() == 0)) + if (!request.properties.empty() && + (!request.effectStart.is_set() || + request.effectStart.get() == 0)) { - QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(request.properties())).object(); + QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(request.properties)).object(); newData.isUsingEffectStateReceived = propertiesObject.value(QStringLiteral("useReceived")).toBool(); } @@ -368,7 +368,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest connect(ifs, &ObjectExplosionCluster::effectStateChanged, this, &HandlerExplosionCluster::onEffectStateChanged); // Context NASAT: check via chargeTypeId: - const ProjectDataManagement::GearClass gc = m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(request.chargeStruct().chargeTypeId()); + const ProjectDataManagement::GearClass gc = m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(request.chargeStruct.chargeTypeId); const bool bChargeIsAirSupport = gc == ProjectDataManagement::GearClass::GearClass_AirSupport; ifs->setAirSupportSource(bChargeIsAirSupport); @@ -395,7 +395,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active air supports.")); } } - else if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionCluster]) + (s_currentAirSupportCount) && request.effectStart().is_set()) + else if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionCluster)]) + (s_currentAirSupportCount) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -405,9 +405,9 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterCreateRequest } else { - DEBUG_LOG(m_logger) << "New dec ExplosionCluster: " << totalAreas() << " Max: " << s_maxActiveAreas[AesType::AtExplosionCluster] << " Is Set: " << request.effectStart().is_set(); + DEBUG_LOG(m_logger) << "New dec ExplosionCluster: " << totalAreas() << " Max: " << s_maxActiveAreas[static_cast(AesType::AtExplosionCluster)] << " Is Set: " << request.effectStart.is_set(); - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionCluster]) && request.effectStart().is_set()) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionCluster)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -446,21 +446,21 @@ 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.is_set() ? request.externalId.get() : 0; + // if (externalIdValue == 0 && !request.partyId.is_set()) // return Core::FunctionReplyObject(tr_lts("dds", "Explosion areas need a party id.")); - DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart() - << ", effectDuration :" << request.effectDuration() - << ", flightDuration :" << request.flightDuration() - << ", tapTime :" << request.tapTime() - << ", properties: " << request.properties(); + DEBUG_LOG(m_logger) << "request.effectStart :" << request.effectStart + << ", effectDuration :" << request.effectDuration + << ", flightDuration :" << request.flightDuration + << ", tapTime :" << request.tapTime + << ", properties: " << request.properties; Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return explosionClusterCreateRequest(request); - ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; @@ -470,12 +470,12 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest fillData(request, aea, m_mainHandler); // Context NASAT: check via chargeTypeId: - const ProjectDataManagement::GearClass gc = m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(request.chargeStruct().chargeTypeId()); + const ProjectDataManagement::GearClass gc = m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(request.chargeStruct.chargeTypeId); 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.is_set() && ifs->isObjectModifiable()) // ToDo: check { // Calculate new polygon here. Not nice, though auto poly = Polygons::explosionClusterArea(aea); @@ -502,7 +502,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest { // case 1: war zentral && effectStart war nicht gesetzt // case 2: war dezentral && effectStart ist gesetzt. - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionCluster] + (s_currentAirSupportCount)) && request.effectStart().is_set() + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionCluster)] + (s_currentAirSupportCount)) && request.effectStart.is_set() && ((wasCentral && !ifs->isActivationTimeSet()) || !wasCentral)) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central explosion clusters.")); @@ -513,7 +513,7 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest { // case 1: war dezentral && effectStart war nicht gesetzt // case 2: war zentral && effectStart ist gesetzt. - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionCluster]) && request.effectStart().is_set() + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionCluster)]) && request.effectStart.is_set() && (( !wasCentral && !ifs->isActivationTimeSet()) || wasCentral)) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active explosion clusters.")); @@ -522,7 +522,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.is_set() && ifs->isObjectModifiable()) { DEBUG_LOG(m_logger) << "isCentral: " << isCentral; @@ -534,8 +534,8 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest // Change from central to training area if (wasCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionCluster])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active explosion clusters.")); + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionCluster)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active explosion clusters.")); m_areaCount++; m_areaCountCentral--; @@ -544,8 +544,8 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest } else // Change from training area to central { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionCluster])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active central explosion clusters.")); + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionCluster)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active central explosion clusters.")); m_areaCount--; m_areaCountCentral++; DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtExplosionCluster] = " << m_areaCount; @@ -556,13 +556,13 @@ Core::FunctionReplyObject HandlerExplosionCluster::explosionClusterModifyRequest } - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; } - DEBUG_LOG(m_logger) << "request.properties()" << request.properties() + DEBUG_LOG(m_logger) << "request.properties()" << request.properties << " aea.properties=" << aea.properties; return ifs->updateObject(aea); } @@ -579,7 +579,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.is_set() && !ifs->isObjectModifiable()) return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active explosion areas.")); // Todo: IsObjectModifiable() ?!? @@ -638,7 +638,7 @@ void HandlerExplosionCluster::onExplosionClusterPauseResumeRequest(const rti::co { DEBUG_LOG(m_logger) << "onExplosionClusterPauseResumeRequest" << request; Core::FunctionReplyObject ret; - ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) { m_mainHandler->dds()->fts()->explosionClusterPauseResumeReply(cookie, ret); @@ -655,8 +655,8 @@ void HandlerExplosionCluster::onExplosionClusterPauseResumeRequest(const rti::co void HandlerExplosionCluster::onExplosionClusterReleaseReceivedRequest(const rti::core::SampleIdentity &cookie, const ExplosionClusterReleaseReceivedRequest &request) { DEBUG_LOG(m_logger) << "onExplosionClusterReleaseReceivedRequest" << request; - Core::FunctionReplyObject ret(request.id()); - ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + Core::FunctionReplyObject ret(request.id); + ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) { ERROR_LOG(m_logger) << ret(); @@ -666,7 +666,7 @@ void HandlerExplosionCluster::onExplosionClusterReleaseReceivedRequest(const rti if (!ifs->isUsingEffectStateReceived()) { - ret = ret.setStr(tr_lts("dds", "ExplosionCluster with id %1 is not using EffectState Received")).arg(request.id()); + ret = ret.setStr(tr_lts("dds", "ExplosionCluster with id %1 is not using EffectState Received")).arg(request.id); ERROR_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->explosionClusterReleaseReceivedReply(cookie, ret); return; @@ -684,7 +684,7 @@ void HandlerExplosionCluster::onTargetPositionsModifyRequest(const rti::core::Sa { DEBUG_LOG(m_logger) << "onTargetPositionsModifyRequest" << request; Core::FunctionReplyObject ret; - ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, request.aesItemId(), ret); + ObjectExplosionCluster *ifs = getObjectFromMap(m_objectMap, request.aesItemId, ret); if (!ifs) { m_mainHandler->dds()->fts()->targetPositionsModifyReply(cookie, ret); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_single.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_single.cpp index 74914c2e3..d3b5e25dc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_single.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_explosion_single.cpp @@ -15,7 +15,7 @@ namespace AreaEffectSimulation { HandlerExplosionSingle::HandlerExplosionSingle(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionSingle"), s_areaCount[AesType::AtExplosionSingle], s_areaCountCentral[AesType::AtExplosionSingle]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionSingle"), s_areaCount[static_cast(AesType::AtExplosionSingle)], s_areaCountCentral[static_cast(AesType::AtExplosionSingle)]) , Interface::Fts::ExplosionSingleModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::ExplosionSingleRemoveRequestHandler(mainHandler->dds()->fts()) {} @@ -43,7 +43,7 @@ bool HandlerExplosionSingle::init() } if(!ifs->data().isCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle])) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)])) { ERROR_LOG(m_logger) << "More active explosion single in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -54,7 +54,7 @@ bool HandlerExplosionSingle::init() else { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)])) { ERROR_LOG(m_logger) << "More active explosion single in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -80,38 +80,38 @@ bool HandlerExplosionSingle::init() int HandlerExplosionSingle::totalAreas() const { - return s_areaCount[AesType::AtExplosionArea] + s_areaCount[AesType::AtExplosionSingle]; + return s_areaCount[static_cast(AesType::AtExplosionArea)] + s_areaCount[static_cast(AesType::AtExplosionSingle)]; } int HandlerExplosionSingle::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtExplosionArea] + s_areaCountCentral[AesType::AtExplosionSingle]; + return s_areaCountCentral[static_cast(AesType::AtExplosionArea)] + s_areaCountCentral[static_cast(AesType::AtExplosionSingle)]; } static void fillGeometryData(const ExplosionSingleModifyRequest &src, Database::AesExplosionSingle &dst) { - dst.impactPosition.rx() = src.impactPosition().lon(); - dst.impactPosition.ry() = src.impactPosition().lat(); + dst.impactPosition.rx() = src.impactPosition.lon; + dst.impactPosition.ry() = src.impactPosition.lat; } static void fillData(const ExplosionSingleModifyRequest &src, Database::AesExplosionSingle &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + dst.id = src.id; 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.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.chargeTypeId = src.chargeTypeId(); - dst.participantId = src.participantId().is_set() ? 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.effectSourceId = src.effectSourceId; + dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0; + dst.chargeTypeId = src.chargeTypeId; + dst.participantId = src.participantId.is_set() ? 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; } void HandlerExplosionSingle::onExplosionSingleModifyRequest(const rti::core::SampleIdentity &cookie, @@ -144,7 +144,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c if (ifs->data().isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle]) && request.effectStart().is_set()) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -154,7 +154,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c } else { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) && request.effectStart().is_set()) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -182,16 +182,16 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleCreateRequest(c Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(const ExplosionSingleModifyRequest &request) { Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return explosionSingleCreateRequest(request); - ObjectExplosionSingle *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectExplosionSingle *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; // 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.is_set()) // return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active single explosions.")); Database::AesExplosionSingle aes(ifs->data()); @@ -206,25 +206,25 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c bool wasCentral = ifs->data().isCentral; - if(!ifs->isActivationTimeSet() && request.effectStart().is_set()) + if(!ifs->isActivationTimeSet() && request.effectStart.is_set()) { if (isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)])) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central explosion singles and explosion areas.")); } } else { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle]) ) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)]) ) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active explosion singles and explosion areas.")); } } } // For counting, only Elements being at least prepared are important: - if (request.effectStart().is_set() && ifs->isObjectModifiable()) + if (request.effectStart.is_set() && ifs->isObjectModifiable()) { DEBUG_LOG(m_logger) << "isCentral: " << isCentral; @@ -236,8 +236,8 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c // Change from central to training area if (wasCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtExplosionArea] + s_maxActiveAreas[AesType::AtExplosionSingle])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active explosion singles and explosion areas.")); + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active explosion singles and explosion areas.")); m_areaCount++; m_areaCountCentral--; @@ -246,8 +246,8 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c } else // Change from training area to central { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtExplosionArea] + s_maxActiveAreasCentral[AesType::AtExplosionSingle])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active central explosion singles and explosion areas")); + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreasCentral[static_cast(AesType::AtExplosionSingle)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active central explosion singles and explosion areas")); m_areaCount--; m_areaCountCentral++; DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtExplosionSingle] = " << m_areaCount; @@ -258,7 +258,7 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite single explostion Effect State for OC"; aes.effectStateId = AesEffectState::EsPrepared; @@ -270,17 +270,17 @@ Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyRequest(c Core::FunctionReplyObject HandlerExplosionSingle::explosionSingleModifyGeometryRequest(const ExplosionSingleModifyRequest &request) { Core::FunctionReplyObject ret; - ObjectExplosionSingle *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectExplosionSingle *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; // 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[static_cast(AesType::AtExplosionArea)] + s_maxActiveAreas[static_cast(AesType::AtExplosionSingle)]) + && request.effectStart.is_set() && !ifs->isActivationTimeSet() && !ifs->isObjectModifiable()) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active single explosions.")); + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active single explosions.")); Database::AesExplosionSingle aes(ifs->data()); fillGeometryData(request, aes); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_functional_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_functional_area.cpp index af3a0da9f..18d4de1e0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_functional_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_functional_area.cpp @@ -15,7 +15,7 @@ namespace AreaEffectSimulation { HandlerFunctionalArea::HandlerFunctionalArea(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("FunctionalArea"), s_areaCount[AesType::AtFunctionalArea], s_areaCountCentral[AesType::AtFunctionalArea]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("FunctionalArea"), s_areaCount[static_cast(AesType::AtFunctionalArea)], s_areaCountCentral[static_cast(AesType::AtFunctionalArea)]) , Interface::Fts::FunctionalAreaModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::FunctionalAreaRemoveRequestHandler(mainHandler->dds()->fts()) { @@ -87,7 +87,7 @@ bool HandlerFunctionalArea::init() } if (!ifs->data().isCentral) { - if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtFunctionalArea)]) { ERROR_LOG(m_logger) << "More active functional areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -97,7 +97,7 @@ bool HandlerFunctionalArea::init() } else { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtFunctionalArea]) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtFunctionalArea)]) { ERROR_LOG(m_logger) << "More active functional areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -148,40 +148,40 @@ QVector HandlerFunctionalArea::loadDefaultFunct int HandlerFunctionalArea::totalAreas() const { - return s_areaCount[AesType::AtFunctionalArea]; + return s_areaCount[static_cast(AesType::AtFunctionalArea)]; } int HandlerFunctionalArea::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtFunctionalArea]; + return s_areaCountCentral[static_cast(AesType::AtFunctionalArea)]; } template static void fillData(const T &src, Database::AesFunctionalArea &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + 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.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.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.functionalAreaTypeId = src.functionalAreaTypeId(); - dst.deconMode = src.deconMode(); - dst.deconTime = src.deconTime(); - dst.maintMode = src.maintMode(); - dst.maintTime = src.maintTime(); - dst.medicMode = src.medicMode(); - dst.medicTime = src.medicTime(); - dst.supplyMode = src.supplyMode(); - dst.supplyTime = src.supplyTime(); + dst.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.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.functionalAreaTypeId = src.functionalAreaTypeId; + dst.deconMode = src.deconMode; + dst.deconTime = src.deconTime; + dst.maintMode = src.maintMode; + dst.maintTime = src.maintTime; + dst.medicMode = src.medicMode; + dst.medicTime = src.medicTime; + dst.supplyMode = src.supplyMode; + dst.supplyTime = src.supplyTime; } void HandlerFunctionalArea::onFunctionalAreaModifyRequest(const rti::core::SampleIdentity &cookie, @@ -196,9 +196,9 @@ void HandlerFunctionalArea::onFunctionalAreaModifyRequest(const rti::core::Sampl Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(const FunctionalAreaModifyRequest &request) { - if (!request.partyId().is_set() && (request.supplyMode() != AesOperatingMode_def::OmWaitingTime)) + if (!request.partyId.is_set() && (request.supplyMode != AesOperatingMode::OmWaitingTime)) return Core::FunctionReplyObject(tr_lts("dds", "Functional areas need a party id.")); - if ((!request.participantId().is_set()) && (request.supplyMode() == AesOperatingMode_def::OmWaitingTime)) + if ((!request.participantId.is_set()) && (request.supplyMode == AesOperatingMode::OmWaitingTime)) return Core::FunctionReplyObject(tr_lts("dds", "Functional areas Supply need a participant id.")); @@ -220,7 +220,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con if (ifs->data().isCentral) { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtFunctionalArea] && request.effectStart().is_set()) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtFunctionalArea)] && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct @@ -231,7 +231,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con } else { - if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea] && request.effectStart().is_set()) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtFunctionalArea)] && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -258,16 +258,16 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaCreateRequest(con Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(const FunctionalAreaModifyRequest &request) { Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return functionalAreaCreateRequest(request); - ObjectFunctionalArea *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectFunctionalArea *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; // 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.is_set() && !ifs->isObjectModifiable()) // return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active functional areas.")); // Todo: IsObjectModifiable() ?!? @@ -286,19 +286,19 @@ 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.is_set()) { if (isCentral) { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtFunctionalArea]) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtFunctionalArea)]) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central functional areas.")); } } else { - if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtFunctionalArea)]) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active functional areas.")); } @@ -306,7 +306,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.is_set() && ifs->isObjectModifiable()) { @@ -326,8 +326,8 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con // Change from central to training area if (wasCentral) { - if (totalAreas() >= s_maxActiveAreas[AesType::AtFunctionalArea]) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active functional areas.")); + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtFunctionalArea)]) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active functional areas.")); m_areaCount++; m_areaCountCentral--; @@ -336,8 +336,8 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con } else // Change from training area to central { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtFunctionalArea]) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active central functional areas.")); + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtFunctionalArea)]) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active central functional areas.")); m_areaCount--; m_areaCountCentral++; DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtFunctionalArea] = " << m_areaCount; @@ -346,7 +346,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con } } - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite functinal area Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_gas_pipe.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_gas_pipe.cpp index c92837b46..fead9a3f9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_gas_pipe.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_gas_pipe.cpp @@ -17,7 +17,7 @@ namespace AreaEffectSimulation { HandlerGasPipe::HandlerGasPipe(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionArea"), s_areaCount[AesType::AtGasPipe], s_areaCountCentral[AesType::AtGasPipe]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("ExplosionArea"), s_areaCount[static_cast(AesType::AtGasPipe)], s_areaCountCentral[static_cast(AesType::AtGasPipe)]) , Interface::Fts::GasPipeModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::GasPipeRemoveRequestHandler(mainHandler->dds()->fts()) { @@ -52,7 +52,7 @@ bool HandlerGasPipe::init() for (const Database::AesGasPipe &dbGasPipe : qAsConst(gasPipeVec)) { - if (dbGasPipe.effectStateId == AesEffectState_def::EsRemoved) + if (dbGasPipe.effectStateId == AesEffectState::EsRemoved) continue; dbGasPipeSegments.clear(); @@ -84,7 +84,7 @@ void HandlerGasPipe::onGasPipeModifyRequest(const rti::core::SampleIdentity &coo const GasPipeModifyRequest &request) { DEBUG_LOG(m_logger) << "onGasPipeModifyRequest: " << request; - Core::FunctionReplyObject ret = request.id() > 0 ? gasPipeModifyRequest(request) : gasPipeCreateRequest(request); + Core::FunctionReplyObject ret = request.id > 0 ? gasPipeModifyRequest(request) : gasPipeCreateRequest(request); if (ret.error()) WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->gasPipeModifyReply(cookie, ret); @@ -95,15 +95,15 @@ 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.width = request.width(); - newData.effectDuration = request.effectDuration(); + 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.width = request.width; + newData.effectDuration = request.effectDuration; ObjectGasPipe *ifs(new ObjectGasPipe(m_mainHandler, this)); Core::FunctionReplyObject ret = ifs->createObject(newData, - request.segments(), + request.segments, QVector()); if (ret.error()) { @@ -114,7 +114,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi if (ifs->data().isCentral) { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtGasPipe] && request.effectStart().is_set()) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtGasPipe)] && request.effectStart.is_set()) { ifs->removeObject(); delete ifs; @@ -123,7 +123,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi } else { - if (totalAreas() >= s_maxActiveAreas[AesType::AtGasPipe] && request.effectStart().is_set()) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtGasPipe)] && request.effectStart.is_set()) { ifs->removeObject(); delete ifs; @@ -151,18 +151,18 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeCreateRequest(const GasPipeModi Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModifyRequest &request) { Core::FunctionReplyObject ret; - ObjectGasPipe *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectGasPipe *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; 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.width = request.width(); - newData.effectDuration = request.effectDuration(); - if (request.id() < 0 && checkStateForSfm(ifs)) + 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.width = request.width; + newData.effectDuration = request.effectDuration; + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite gas pipe Effect State for OC"; newData.effectStateId = AesEffectState::EsPrepared; @@ -171,19 +171,19 @@ 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.is_set()) { if (ifs->data().isCentral) { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtGasPipe]) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtGasPipe)]) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central functional areas.")); } } else { - if (totalAreas() >= s_maxActiveAreas[AesType::AtGasPipe]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtGasPipe)]) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active functional areas areas.")); } @@ -191,7 +191,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.is_set() && ifs->isObjectModifiable()) // { // // Calculate new polygon here. Not nice, though @@ -238,7 +238,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi // } - return ifs->updateObject(newData, request.segments()); + return ifs->updateObject(newData, request.segments); } // end of onGasPipeModifyRequest() //----------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_area.cpp index 068c3f9ed..4c2ae27a1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_area.cpp @@ -22,7 +22,7 @@ namespace AreaEffectSimulation { HandlerMineArea::HandlerMineArea(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("MineArea"), s_areaCount[AesType::AtMineArea], s_areaCountCentral[AesType::AtMineArea]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("MineArea"), s_areaCount[static_cast(AesType::AtMineArea)], s_areaCountCentral[static_cast(AesType::AtMineArea)]) , Interface::Fts::MineAreaModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::MineAreaRemoveRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::MineResetRequestHandler(mainHandler->dds()->fts()) @@ -35,12 +35,12 @@ HandlerMineArea::HandlerMineArea(MainHandler *mainHandler) bool HandlerMineArea::isDusMineArea(int chargeTypeId, int igniterTypeId, int igniterFunctionId) const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::DUS; + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::DUS; } bool HandlerMineArea::isConcreteMine(int chargeTypeId, int igniterTypeId, int igniterFunctionId) const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::Concrete; + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::Concrete; } bool HandlerMineArea::isFromMineLayer(int chargeTypeId, int igniterTypeId, int igniterFunctionId) const @@ -50,12 +50,12 @@ bool HandlerMineArea::isFromMineLayer(int chargeTypeId, int igniterTypeId, int i bool HandlerMineArea::isSingleVirtualMine(int chargeTypeId, int igniterTypeId, int igniterFunctionId) const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::VirtualSingle; + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::VirtualSingle; } bool HandlerMineArea::isVirtualMine(int chargeTypeId, int igniterTypeId, int igniterFunctionId) const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::Virtual; + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(chargeTypeId, igniterTypeId, igniterFunctionId)) == MineClass::Virtual; } bool HandlerMineArea::init() @@ -97,7 +97,7 @@ bool HandlerMineArea::init() if (!ifs->data().isCentral) { - if (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtMineArea)]) { ERROR_LOG(m_logger) << "More active mine areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -107,7 +107,7 @@ bool HandlerMineArea::init() } else { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtMineArea]) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtMineArea)]) { ERROR_LOG(m_logger) << "More active mine areas in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -196,9 +196,9 @@ bool HandlerMineArea::removeDuplicateMine(int mineId) return false; } -int HandlerMineArea::totalAreas() const { return s_areaCount[AesType::AtMineArea]; } +int HandlerMineArea::totalAreas() const { return s_areaCount[static_cast(AesType::AtMineArea)]; } -int HandlerMineArea::totalAreasCentral() const { return s_areaCountCentral[AesType::AtMineArea]; } +int HandlerMineArea::totalAreasCentral() const { return s_areaCountCentral[static_cast(AesType::AtMineArea)]; } template T getValueHelper(T in) { return in; } @@ -206,23 +206,23 @@ template T getValueHelper(const dds::core::optional &in) { retur template static void fillData(const T &src, Database::AesMineArea &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + 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.effectDuration = src.effectDuration(); - dst.effectSourceId = src.effectSourceId(); - dst.partyId = src.partyId().is_set() ? src.partyId().get() : 0; - dst.chargeTypeId = src.chargeStruct().chargeTypeId(); - dst.participantId = src.participantId().is_set() ? src.participantId().get() : 0; - dst.density = src.density(); - dst.width = src.width(); - dst.layingProcedureTypeId = src.layingProcedureType(); - dst.isLaidHidden = src.isLaidHidden(); - dst.effectMarkingInTa = src.effectMarkingInTa(); - dst.isCenterLine = src.isCenterLine(); - dst.externalId = getValueHelper(src.externalId()); + dst.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.chargeTypeId = src.chargeStruct.chargeTypeId; + dst.participantId = src.participantId.is_set() ? src.participantId.get() : 0; + dst.density = src.density; + dst.width = src.width; + dst.layingProcedureTypeId = src.layingProcedureType; + dst.isLaidHidden = src.isLaidHidden; + dst.effectMarkingInTa = src.effectMarkingInTa; + dst.isCenterLine = src.isCenterLine; + dst.externalId = getValueHelper(src.externalId); } static inline bool intersects(const QPolygonF &p1, const std::vector &ddsp2) @@ -230,7 +230,7 @@ static inline bool intersects(const QPolygonF &p1, const std::vector Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR if (isDusMineArea(newData.chargeTypeId, newData.igniterTypeId, newData.igniterFunctionId) || isConcreteMine(newData.chargeTypeId, newData.igniterTypeId, newData.igniterFunctionId)) { - if (!checkIfNullMineIsInArea(request.segments(), newData, request.distance())) + if (!checkIfNullMineIsInArea(request.segments, newData, request.distance)) { - QString chargeTypeName = QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(newData.chargeTypeId).name()); + QString chargeTypeName = QString::fromStdString(m_mainHandler->dds()->pdmDtc()->chargeType(newData.chargeTypeId).name); return Core::FunctionReplyObject(1, tr_lts("dds", "No mines of type '%1' found in chosen area")).arg(chargeTypeName); } } @@ -274,9 +274,9 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR ObjectMineArea *ifs(new ObjectMineArea(m_mainHandler, this)); connect(ifs, &ObjectMineArea::effectStateChanged, this, &HandlerMineArea::onEffectStateChanged); - Core::FunctionReplyObject ret = ifs->createObject(newData, request.segments()); + Core::FunctionReplyObject ret = ifs->createObject(newData, request.segments); - DEBUG_LOG(m_logger) << ">>> mineAreaCreateRequest: re.segSize: " << request.segments().size() << " // ifs.segSize: " << ifs->segments().size() + DEBUG_LOG(m_logger) << ">>> mineAreaCreateRequest: re.segSize: " << request.segments.size() << " // ifs.segSize: " << ifs->segments().size() << " // mineCount: " << ifs->mineCount(); if (ret.error()) { @@ -301,7 +301,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR bool isCentral = ifs->checkIsCentral(_form); if (isCentral) { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtMineArea] && request.effectStart().is_set()) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtMineArea)] && request.effectStart.is_set()) { ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -329,14 +329,14 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */) { - if (request.effectStart().is_set()) + if (request.effectStart.is_set()) --pzAbwWMiSafe; } if (pzAbwWMiSafe < 0) pzAbwWMiSafe = 0; - if (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] - pzAbwWMiSafe && request.effectStart().is_set()) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtMineArea)] - pzAbwWMiSafe && request.effectStart.is_set()) { ifs->removeObject(); // Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -346,7 +346,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */) { - if (request.effectStart().is_set()) + if (request.effectStart.is_set()) ++m_totalPzAbwWMis; } } @@ -374,8 +374,8 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaCreateR if (ifs->isDusMineArea() || ifs->isConcreteMine()) { assignMinesFromNullArea(ifs->id()); - DEBUG_LOG(m_logger) << "Start change to Line: " << request.setMineSorted(); - ret = ifs->changeSegmentsToLine(request.setMineSorted()); + DEBUG_LOG(m_logger) << "Start change to Line: " << request.setMineSorted; + ret = ifs->changeSegmentsToLine(request.setMineSorted); } return ret; } @@ -384,21 +384,21 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR { Core::FunctionReplyObject ret; ObjectMineArea *ifs = nullptr; - if (getValueHelper(request.externalId()) > 0) - ifs = getObjectFromMapByExternalId(m_objectMap, getValueHelper(request.externalId()), ret); + if (getValueHelper(request.externalId) > 0) + ifs = getObjectFromMapByExternalId(m_objectMap, getValueHelper(request.externalId), ret); if (!ifs) { - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return mineAreaCreateRequest(request); - ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; } - if (request.effectStart().is_set() && (request.effectStart().get() + request.effectDuration() < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) + if (request.effectStart.is_set() && (request.effectStart.get() + request.effectDuration < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) return removeObject(ifs); Database::AesMineArea newData(ifs->data()); @@ -407,7 +407,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR QVector vecSegments; double totalLength = 0.0; - ifs->createSegments(request.segments(), request.id(), vecSegments, totalLength); + ifs->createSegments(request.segments, request.id, vecSegments, totalLength); auto poly = Polygons::mineArea(vecSegments, newData.width, newData.density, newData.isCenterLine); // FIXME:Is segements filled here // Check if mine field is in building only @@ -422,12 +422,12 @@ template 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.is_set()) { if (isCentral) { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtMineArea] /*&& request.effectStart().is_set()*/) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtMineArea)] /*&& request.effectStart.is_set()*/) return Core::FunctionReplyObject(1, tr_lts("dds", "Too many central mine areas.")); ret = ifs->checkDensity(newData.density, totalLength, s_maxCentralSingleMinesCount); @@ -453,7 +453,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR if (pzAbwWMiSafe < 0) pzAbwWMiSafe = 0; - if (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] - pzAbwWMiSafe /*&& request.effectStart().is_set()*/) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtMineArea)] - pzAbwWMiSafe /*&& request.effectStart.is_set()*/) return Core::FunctionReplyObject(1, tr_lts("dds", "Too many peripheral mine areas.")); if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */) @@ -464,7 +464,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR } // For counting, only Elements being at least prepared are important: - if (request.effectStart().is_set() && ifs->isObjectModifiable()) + if (request.effectStart.is_set() && ifs->isObjectModifiable()) { // Calculate new polygon here. Not nice, though @@ -481,15 +481,15 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*PzAbwWmiV */) { - if (request.effectStart().is_set()) + if (request.effectStart.is_set()) --pzAbwWMiSafe; } if (pzAbwWMiSafe < 0) pzAbwWMiSafe = 0; - if (totalAreas() >= s_maxActiveAreas[AesType::AtMineArea] - pzAbwWMiSafe) // Minus PzAbwWmiV - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many peripheral mine areas.")); + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtMineArea)] - pzAbwWMiSafe) // Minus PzAbwWmiV + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many peripheral mine areas.")); if (newData.layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery /*&& newData.chargeTypeId == 216*/ /*PzAbwWmiV */) m_totalPzAbwWMis++; @@ -501,8 +501,8 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR else // Change from training area to central { - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtMineArea]) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many central mine areas.")); + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtMineArea)]) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many central mine areas.")); m_areaCount--; m_areaCountCentral++; @@ -514,7 +514,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR } } - if (request.layingProcedureType() == AesMaLayingProcedureType::LptPioneer && ifs->get().layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery && !isCentral) + if (request.layingProcedureType == AesMaLayingProcedureType::LptPioneer && ifs->get().layingProcedureTypeId == AesMaLayingProcedureType::LptArtillery && !isCentral) { --m_totalPzAbwWMis; @@ -525,13 +525,13 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR if (pzAbwWMiSafe < 0) pzAbwWMiSafe = 0; - if (totalAreas() > s_maxActiveAreas[AesType::AtMineArea] - pzAbwWMiSafe) // Minus PzAbwWmiV + if (totalAreas() > s_maxActiveAreas[static_cast(AesType::AtMineArea)] - pzAbwWMiSafe) // Minus PzAbwWmiV { ++m_totalPzAbwWMis; - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many peripheral mine areas.")); + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many peripheral mine areas.")); } } - else if (request.layingProcedureType() == AesMaLayingProcedureType::LptArtillery && ifs->get().layingProcedureTypeId == AesMaLayingProcedureType::LptPioneer + else if (request.layingProcedureType == AesMaLayingProcedureType::LptArtillery && ifs->get().layingProcedureTypeId == AesMaLayingProcedureType::LptPioneer && !isCentral) { @@ -540,7 +540,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR } } - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite mine area Effect State for OC"; newData.effectStateId = AesEffectState::EsPrepared; @@ -549,16 +549,16 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR // check: effectStart > time(NULL) ? int32_t oldChargeTypeId = ifs->data().chargeTypeId; - ret = ifs->updateObject(newData, request.segments()); + ret = ifs->updateObject(newData, request.segments); // assign mines from NullArea if applicable if (oldChargeTypeId != newData.chargeTypeId) if (ifs->isDusMineArea() || ifs->isConcreteMine()) { assignMinesFromNullArea(ifs->id()); - DEBUG_LOG(m_logger) << "Start change to Line(modify): " << request.setMineSorted(); + DEBUG_LOG(m_logger) << "Start change to Line(modify): " << request.setMineSorted; - ifs->changeSegmentsToLine(request.setMineSorted()); + ifs->changeSegmentsToLine(request.setMineSorted); } ifs->clearBuildings(); @@ -569,7 +569,7 @@ template Core::FunctionReplyObject HandlerMineArea::mineAreaModifyR void HandlerMineArea::onMineAreaRemoveRequest(const rti::core::SampleIdentity &cookie, const Core::RemoveElementRequest &request) { Core::FunctionReplyObject ret; - const qint32 id = request.id() < 0 ? (request.id() * -1) : request.id(); + const qint32 id = request.id < 0 ? (request.id * -1) : request.id; ObjectMineArea *ifs = getObjectFromMap(m_objectMap, id, ret); if (ifs == nullptr) @@ -597,23 +597,23 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque { // If they are DUS Mines that are not part of a mine area [yet] // request does not contain position, so it cannot be assigned to an area - if (request.mineAreaId() == 0) + if (request.mineAreaId == 0) { // If single mine... - if (request.mineId().is_set()) + if (request.mineId.is_set()) { DEBUG_LOG(m_logger) << "Checking in DUS-Mine-Areas"; bool found = false; auto it = m_objectMap.cbegin(); while (it != m_objectMap.cend() && !found) { - found = (*it)->resetMine(request.mineId().get()); + found = (*it)->resetMine(request.mineId.get()); ++it; } if (!found) { DEBUG_LOG(m_logger) << "Not found in DUS Mine Areas, resetting in NullArea!"; - m_nullArea->resetMine(request.mineId().get()); + m_nullArea->resetMine(request.mineId.get()); } } else @@ -628,24 +628,24 @@ Core::FunctionReplyObject HandlerMineArea::mineResetRequest(const MineResetReque mineAreaObj->resetMines(); } } - return Core::FunctionReplyObject(request.mineAreaId()); + return Core::FunctionReplyObject(request.mineAreaId); } // Both Virtual and DUS Mine Area - ObjectMineArea *ifs = m_objectMap.value(request.mineAreaId()); + ObjectMineArea *ifs = m_objectMap.value(request.mineAreaId); if (!ifs) - return Core::FunctionReplyObject(request.mineAreaId(), tr_lts("dds", "Mine area with id %1 not found.")).arg(request.mineAreaId()); + 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()) - bOk = ifs->resetMine(request.mineId().get()); + if (request.mineId.is_set()) + bOk = ifs->resetMine(request.mineId.get()); else bOk = ifs->resetMines(); if (!bOk) - return Core::FunctionReplyObject(request.mineAreaId(), tr_lts("dds", "Reset Virtual Mine(s) failed.")); + return Core::FunctionReplyObject(request.mineAreaId, tr_lts("dds", "Reset Virtual Mine(s) failed.")); - return Core::FunctionReplyObject(request.mineAreaId()); + return Core::FunctionReplyObject(request.mineAreaId); } void HandlerMineArea::onMineTriggered(const TrainingAreaBase::MineTriggered &data, DataModification modType) @@ -654,13 +654,13 @@ void HandlerMineArea::onMineTriggered(const TrainingAreaBase::MineTriggered &dat return; MineTriggeredRequest mtr; - mtr.mineAreaId(data.mineAreaId()); + 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()) - mtr.position(data.position().get()); - if (data.chargeTypeId().is_set()) - mtr.chargeTypeId(data.chargeTypeId().get()); + mtr.mineId = data.mineAreaId == 0 ? data.mineIndex : data.mineIndex - 1; + if (data.position.is_set()) + mtr.position = data.position.get(); + if (data.chargeTypeId.is_set()) + mtr.chargeTypeId = data.chargeTypeId.get(); auto ret = mineTriggeredRequest(mtr); if (ret.error()) @@ -679,17 +679,17 @@ 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.is_set() && isConcreteMine(request.chargeTypeId.get(), 0, 0))) { - int chargeTypeId = request.chargeTypeId().is_set() ? request.chargeTypeId().get() : 0; + int chargeTypeId = request.chargeTypeId.is_set() ? 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.is_set() && !isFromMineLayer(chargeTypeId, 0, 0)) { - position.setX(request.position().get().lon()); - position.setY(request.position().get().lat()); + position.setX(request.position.get().lon); + position.setY(request.position.get().lat); } Database::AesMineAreaTriggeredMines mine; @@ -699,20 +699,20 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge auto it = m_objectMap.cbegin(); while (it != m_objectMap.cend() && !mineFound) { - int mineId = request.mineId(); + int mineId = request.mineId; ObjectMineArea *mineArea = it.value(); DEBUG_LOG(m_logger) << "mineId: " << mineId << ", areaId:" << mineArea->id(); - if (request.mineAreaId() > 0 && request.mineAreaId() != mineArea->id()) + if (request.mineAreaId > 0 && request.mineAreaId != mineArea->id()) { it++; continue; } - DEBUG_LOG(m_logger) << "request.mineAreaId: " << request.mineAreaId(); + DEBUG_LOG(m_logger) << "request.mineAreaId: " << request.mineAreaId; if (mineArea->isConcreteMine()) { DEBUG_LOG(m_logger) << "isConcrete = true"; - mineId = mineArea->getMineIdByIndex(request.mineId()); + mineId = mineArea->getMineIdByIndex(request.mineId); } if ((mineArea->isDusMineArea() || mineArea->isConcreteMine()) && mineArea->hasMine(mineId)) // is mine in a DUS minearea @@ -723,7 +723,7 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge { DEBUG_LOG(m_logger) << "triggerMine: mineId: " << mineId; mineArea->triggerMine(mineId, true, position); - return Core::FunctionReplyObject(request.mineAreaId()); + return Core::FunctionReplyObject(request.mineAreaId); } mine = mineArea->takeMine(mineId); // take the mine, as it is not handled anymore } @@ -736,18 +736,18 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge while (it != m_objectMap.cend() && handlingAreaId == 0) { const ObjectMineArea *mineArea = it.value(); - if ((mineArea->isDusMineArea() || mineArea->isConcreteMine()) && mineArea->canHandleMine(request.mineId(), chargeTypeId, position)) + if ((mineArea->isDusMineArea() || mineArea->isConcreteMine()) && mineArea->canHandleMine(request.mineId, chargeTypeId, position)) handlingAreaId = mineArea->id(); ++it; } // if mine was not already in a mine area and there is an area that wants the mine, check if it can be taken from the null area if (!mineFound && handlingAreaId != 0) - mine = m_nullArea->takeMine(request.mineId()); + mine = m_nullArea->takeMine(request.mineId); if (mine.id != 0) // mine did exist already { - if (request.position().is_set()) // update position + if (request.position.is_set()) // update position mine.position = position; } @@ -764,7 +764,7 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge else { if (!triggerUnpairedMine(request)) - ifs->triggerMine(request.mineId(), true, position); + ifs->triggerMine(request.mineId, true, position); } } else @@ -775,20 +775,20 @@ Core::FunctionReplyObject HandlerMineArea::mineTriggeredRequest(const MineTrigge else { if (!triggerUnpairedMine(request)) - m_nullArea->triggerMine(request.mineId(), true, chargeTypeId, position); + m_nullArea->triggerMine(request.mineId, true, chargeTypeId, position); } } - return Core::FunctionReplyObject(request.mineAreaId()); + return Core::FunctionReplyObject(request.mineAreaId); } // Virtual: - ObjectMineArea *ifs = m_objectMap.value(request.mineAreaId()); + ObjectMineArea *ifs = m_objectMap.value(request.mineAreaId); if (!ifs) - return Core::FunctionReplyObject(request.mineAreaId(), tr_lts("dds", "Mine area with id %1 not found.")).arg(request.mineAreaId()); + return Core::FunctionReplyObject(request.mineAreaId, tr_lts("dds", "Mine area with id %1 not found.")).arg(request.mineAreaId); - ifs->triggerMine(request.mineId()); - return Core::FunctionReplyObject(request.mineAreaId()); + ifs->triggerMine(request.mineId); + return Core::FunctionReplyObject(request.mineAreaId); } void HandlerMineArea::onMineAreaModifyFromCtaDataRequest(const rti::core::SampleIdentity &cookie, const MineArea &request) @@ -802,12 +802,12 @@ void HandlerMineArea::onMineAreaModifyFromCtaDataRequest(const rti::core::Sample void HandlerMineArea::onNewMineCorridor(const AesItemView &aiv) { - if (aiv.effectStateId() != AesEffectState::EsActivated) + if (aiv.effectStateId != AesEffectState::EsActivated) return; for (ObjectMineArea *ma : qAsConst(m_objectMap)) { - if (intersects(ma->boundingRect(), aiv.form())) + if (intersects(ma->boundingRect(), aiv.form)) ma->clearCorridor(aiv); } } @@ -821,11 +821,11 @@ void HandlerMineArea::onNewMineCorridor(const AesItemView &aiv) Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceCreateRequest(const MineAreaReferenceModifyRequest &refRequest) { Core::FunctionReplyObject ret; - if (refRequest.mineData().empty() || refRequest.referenceAesItemId() <= 0) + if (refRequest.mineData.empty() || refRequest.referenceAesItemId <= 0) return Core::FunctionReplyObject(1, tr_lts("dds", "Invalid MineAreaReference data")); - DEBUG_LOG(m_logger) << "--[mineAreaReferenceCreateRequest] referenceAesItemId: " << refRequest.referenceAesItemId() - << " mindeData size: " << refRequest.mineData().size(); + DEBUG_LOG(m_logger) << "--[mineAreaReferenceCreateRequest] referenceAesItemId: " << refRequest.referenceAesItemId + << " mindeData size: " << refRequest.mineData.size(); Database::AesMineArea newData; if (!fillFromMineAreaReferenceRequest(refRequest, newData)) @@ -833,13 +833,13 @@ Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceCreateRequest(const // add referencedAesItemId into the properties QJsonObject propObj = QJsonDocument::fromJson(newData.properties.toUtf8()).object(); - propObj.insert(QStringLiteral("referencedAesItemId"), refRequest.referenceAesItemId()); + propObj.insert(QStringLiteral("referencedAesItemId"), refRequest.referenceAesItemId); newData.properties = QString::fromStdString(QJsonDocument(propObj).toJson().toStdString()); ObjectMineArea *ifs(new ObjectMineArea(m_mainHandler, this)); std::vector vecGeoSegment; double newWidth = newData.width; // always central - ret = ifs->createGeoSegmentsFromMineData(newWidth, refRequest.mineData(), vecGeoSegment); // segments will be filled through mineData + ret = ifs->createGeoSegmentsFromMineData(newWidth, refRequest.mineData, vecGeoSegment); // segments will be filled through mineData if (ret.error()) { delete ifs; @@ -848,7 +848,7 @@ Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceCreateRequest(const newData.width = newWidth; connect(ifs, &ObjectMineArea::effectStateChanged, this, &HandlerMineArea::onEffectStateChanged); - ret = ifs->createObjectFromMineData(newData, vecGeoSegment, refRequest.mineData()); + ret = ifs->createObjectFromMineData(newData, vecGeoSegment, refRequest.mineData); if (ret.error()) { @@ -874,7 +874,7 @@ Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceCreateRequest(const if (ifs->isObjectInTrainingArea()) ++m_areaCount; - DEBUG_LOG(m_logger) << "--[mineAreaReferenceCreateRequest]- -----> Mine Area created from MineData with refAesItemId: " << refRequest.referenceAesItemId() + DEBUG_LOG(m_logger) << "--[mineAreaReferenceCreateRequest]- -----> Mine Area created from MineData with refAesItemId: " << refRequest.referenceAesItemId << " ifs->id: " << ifs->id(); return ret; } @@ -889,10 +889,10 @@ Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceModifyRequest(const { DEBUG_LOG(m_logger) << "--[mineAreaReferenceModifyRequest]- Modify/Create Mine with refAesItemId: "; Core::FunctionReplyObject ret; - ObjectMineArea *ifs = getObjecMapByreferenceAesItemId(refRequest.referenceAesItemId()); + ObjectMineArea *ifs = getObjecMapByreferenceAesItemId(refRequest.referenceAesItemId); if (ifs == nullptr) { - DEBUG_LOG(m_logger) << "--[mineAreaReferenceModifyRequest]- #### no Ref mine create one... refAesItemId: "< vecGeoSegment; DEBUG_LOG(m_logger) << "--[mineAreaReferenceModifyRequest] create vector GeoPos from Mine data segments.. "; double newWidth = newData.width; - ret = ifs->createGeoSegmentsFromMineData(newWidth, refRequest.mineData(), vecGeoSegment); + ret = ifs->createGeoSegmentsFromMineData(newWidth, refRequest.mineData, vecGeoSegment); if (ret.error()) return ret; @@ -919,9 +919,9 @@ Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceModifyRequest(const return ret; // run update - ret = ifs->updateObjectFromMineData(newData, vecGeoSegment, refRequest.mineData()); + ret = ifs->updateObjectFromMineData(newData, vecGeoSegment, refRequest.mineData); ifs->clearBuildings(); - DEBUG_LOG(m_logger) << "--[mineAreaReferenceModifyRequest] Mine Area Updated with MineData. AesItemId" << refRequest.referenceAesItemId() + DEBUG_LOG(m_logger) << "--[mineAreaReferenceModifyRequest] Mine Area Updated with MineData. AesItemId" << refRequest.referenceAesItemId << " // data.id: " << ifs->id(); return ret; @@ -929,7 +929,7 @@ Core::FunctionReplyObject HandlerMineArea::mineAreaReferenceModifyRequest(const void HandlerMineArea::onMineAreaReferenceModifyRequest(const rti::core::SampleIdentity &cookie, const MineAreaReferenceModifyRequest &request) { - DEBUG_LOG(m_logger) << " onMineAreaReferenceModifyRequest: ADD MINE DATA with refAesItemId: " << request.referenceAesItemId(); + DEBUG_LOG(m_logger) << " onMineAreaReferenceModifyRequest: ADD MINE DATA with refAesItemId: " << request.referenceAesItemId; const Core::FunctionReplyObject ret = mineAreaReferenceModifyRequest(request); if (ret.error()) @@ -945,23 +945,23 @@ void HandlerMineArea::onMineAreaReferenceModifyRequest(const rti::core::SampleId */ bool HandlerMineArea::fillFromMineAreaReferenceRequest(const MineAreaReferenceModifyRequest &inReq, Database::AesMineArea &dbData) { - if (inReq.mineData().empty()) + if (inReq.mineData.empty()) return false; - const auto &mineData = std::min_element(inReq.mineData().begin(), - inReq.mineData().end(), - [](const MineData &first, const MineData &second) { return first.armingTime() < second.armingTime(); }); + const auto &mineData = std::min_element(inReq.mineData.begin(), + inReq.mineData.end(), + [](const MineData &first, const MineData &second) { return first.armingTime < second.armingTime; }); // get effect duration from chargeType properties - const auto chargeType = m_mainHandler->dds()->pdmDtc()->chargeType(inReq.chargeTypeId()); - const QJsonObject chargeTypePropObj = QJsonDocument::fromJson(chargeType.properties().c_str()).object(); + const auto chargeType = m_mainHandler->dds()->pdmDtc()->chargeType(inReq.chargeTypeId); + const QJsonObject chargeTypePropObj = QJsonDocument::fromJson(chargeType.properties.c_str()).object(); const qint64 effectStart = mineData->armingTime(); - const int effectDurationMsec = inReq.effectDurationMsec(); - auto effectCluster = m_mainHandler->effectClusterHandler()->getEffectClusterObj(inReq.referenceAesItemId()); // get partyId from effect cluster object + const int effectDurationMsec = inReq.effectDurationMsec; + auto effectCluster = m_mainHandler->effectClusterHandler()->getEffectClusterObj(inReq.referenceAesItemId); // get partyId from effect cluster object if (!effectCluster) { - ERROR_LOG(m_logger) << " -- fillFromMineAreaReferenceRequest Unknown effect cluster id: " << inReq.referenceAesItemId(); + ERROR_LOG(m_logger) << " -- fillFromMineAreaReferenceRequest Unknown effect cluster id: " << inReq.referenceAesItemId; return false; } @@ -970,12 +970,12 @@ bool HandlerMineArea::fillFromMineAreaReferenceRequest(const MineAreaReferenceMo bool effectMarkingTa = false; // default bool isLaidHidden = false; // default bool isCenterLine = true; // default - AreaEffectSimulation::AesMaLayingProcedureType layingProcedure = AreaEffectSimulation::AesMaLayingProcedureType_def::LptPioneer; + AreaEffectSimulation::AesMaLayingProcedureType layingProcedure = AreaEffectSimulation::AesMaLayingProcedureType::LptPioneer; // get effectDuration from effectorData int id = 0; QString name = QStringLiteral("%1 %2"); - ObjectMineArea *ifs = getObjecMapByreferenceAesItemId(inReq.referenceAesItemId()); + ObjectMineArea *ifs = getObjecMapByreferenceAesItemId(inReq.referenceAesItemId); if (ifs) // purpose is to get existing segments { id = ifs->id(); @@ -990,7 +990,7 @@ bool HandlerMineArea::fillFromMineAreaReferenceRequest(const MineAreaReferenceMo else { const auto chargeEffectChargeType = m_mainHandler->dds()->pdmDtc()->chargeType(effectCluster->data().chargeTypeId); - name = name.arg(QString::fromStdString(chargeEffectChargeType.shortName())).arg(effectCluster->name()); + name = name.arg(QString::fromStdString(chargeEffectChargeType.shortName)).arg(effectCluster->name()); } DEBUG_LOG(m_logger) << " Fill Mine from MineData effectCluster: id: " << effectCluster->data().id << " // effectClusterParty: " << effectCluster->data().partyId; @@ -1000,7 +1000,7 @@ bool HandlerMineArea::fillFromMineAreaReferenceRequest(const MineAreaReferenceMo dbData.effectDuration = effectDurationMsec; dbData.effectSourceId = effectCluster->data().effectSourceId; dbData.partyId = effectCluster->data().partyId; - dbData.chargeTypeId = chargeType.id(); + dbData.chargeTypeId = chargeType.id; dbData.participantId = LtsUtils::toOptional(0); dbData.density = density; dbData.width = width; @@ -1062,7 +1062,7 @@ void HandlerMineArea::assignMinesFromNullArea(int aesId) void HandlerMineArea::onMinelayerPositionChanged(const TrainingAreaBase::MinelayerTrailerPosition &data, DataModification modType) { - if (data.sampleTime() + 5000 < QDateTime::currentMSecsSinceEpoch()) + if (data.sampleTime + 5000 < QDateTime::currentMSecsSinceEpoch()) { DEBUG_LOG(m_logger) << "ignore old layer data"; return; @@ -1070,41 +1070,41 @@ void HandlerMineArea::onMinelayerPositionChanged(const TrainingAreaBase::Minelay if (modType == DataModification::eRemoved) return; - DEBUG_LOG(m_logger) << "lat: " << data.position().lat() << ", lon: " << data.position().lon(); - auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(data.position().lon(), data.position().lat()); + DEBUG_LOG(m_logger) << "lat: " << data.position.lat << ", lon: " << data.position.lon; + auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(data.position.lon, data.position.lat); QPointF position(utm.x, utm.y); - QPointF positionGeo(data.position().lon(), data.position().lat()); - m_zoneMap.insert(data.equipmentNumber(), utm.zone); + QPointF positionGeo(data.position.lon, data.position.lat); + m_zoneMap.insert(data.equipmentNumber, utm.zone); - DEBUG_LOG(m_logger) << "data." << data.equipmentNumber() << ", position: " << utm.mgrs(); + DEBUG_LOG(m_logger) << "data." << data.equipmentNumber << ", position: " << utm.mgrs(); - if (m_timerMap.contains(data.equipmentNumber())) + if (m_timerMap.contains(data.equipmentNumber)) { - QTimer *timer = m_timerMap.value(data.equipmentNumber()); + QTimer *timer = m_timerMap.value(data.equipmentNumber); if (timer->isActive()) { // Save Positions as QPolygon -> Vector not Map - QPolygonF pointsUtm = m_dusMinePosMapUtm.value(data.equipmentNumber()); + QPolygonF pointsUtm = m_dusMinePosMapUtm.value(data.equipmentNumber); pointsUtm.append(position); - m_dusMinePosMapUtm.insert(data.equipmentNumber(), pointsUtm); + m_dusMinePosMapUtm.insert(data.equipmentNumber, pointsUtm); // Save Positions as QPolygon -> Vector not Map - QPolygonF pointsGeo = m_dusMinePosMapGeo.value(data.equipmentNumber()); + QPolygonF pointsGeo = m_dusMinePosMapGeo.value(data.equipmentNumber); pointsGeo.append(positionGeo); - m_dusMinePosMapGeo.insert(data.equipmentNumber(), pointsGeo); + m_dusMinePosMapGeo.insert(data.equipmentNumber, pointsGeo); // m_dusMinePosMapUtm.insert(data.equipmentNumber(), position); // m_dusMinePosMapGeo.insert(data.equipmentNumber(), positionGeo); timer->start(); - DEBUG_LOG(m_logger) << "Timer restart for equipNo: " << data.equipmentNumber(); + DEBUG_LOG(m_logger) << "Timer restart for equipNo: " << data.equipmentNumber; } } else { - DEBUG_LOG(m_logger) << "Start Timer for equipNo: " << data.equipmentNumber(); + DEBUG_LOG(m_logger) << "Start Timer for equipNo: " << data.equipmentNumber; QTimer *timer = new QTimer(this); timer->setInterval(s_mineAreaCreationInterval); - int equipNo = data.equipmentNumber(); - int chargeTypeId = data.chargeTypeId(); + int equipNo = data.equipmentNumber; + int chargeTypeId = data.chargeTypeId; connect(timer, &QTimer::timeout, this, @@ -1115,11 +1115,11 @@ void HandlerMineArea::onMinelayerPositionChanged(const TrainingAreaBase::Minelay }); QPolygonF pointUtm; pointUtm.append(position); - m_dusMinePosMapUtm.insert(data.equipmentNumber(), pointUtm); + m_dusMinePosMapUtm.insert(data.equipmentNumber, pointUtm); QPolygonF pointGeo; pointGeo.append(positionGeo); - m_dusMinePosMapGeo.insert(data.equipmentNumber(), pointGeo); + m_dusMinePosMapGeo.insert(data.equipmentNumber, pointGeo); // m_dusMinePosMapUtm.insert(data.equipmentNumber(), position); // m_dusMinePosMapGeo.insert(data.equipmentNumber(), positionGeo); @@ -1127,21 +1127,21 @@ void HandlerMineArea::onMinelayerPositionChanged(const TrainingAreaBase::Minelay m_timerMap.insert(equipNo, timer); } - int dusSerialNo = data.dusSerialNo(); + int dusSerialNo = data.dusSerialNo; // DusMines with serialNo 0 should get a new serialNo ( > 70000), too // NOTE: igniterType/IgniterFunciton = 0 as long as MinelayerTrailerPosition does not contain values - if (isConcreteMine(data.chargeTypeId(), 0, 0) || (isDusMineArea(data.chargeTypeId(), 0, 0) && dusSerialNo == 0)) + if (isConcreteMine(data.chargeTypeId, 0, 0) || (isDusMineArea(data.chargeTypeId, 0, 0) && dusSerialNo == 0)) dusSerialNo = ++s_startPzAbwWMiCCount; else { - if (data.dusSerialNo() != 0 && removeDuplicateMine(data.dusSerialNo())) - INFO_LOG(m_logger) << "Existing mine with serialNo: " << data.dusSerialNo() << " removed"; + if (data.dusSerialNo != 0 && removeDuplicateMine(data.dusSerialNo)) + INFO_LOG(m_logger) << "Existing mine with serialNo: " << data.dusSerialNo << " removed"; } DEBUG_LOG(m_logger) << "dusSerialNo: " << dusSerialNo; - DEBUG_LOG(m_logger) << "isConcrete: " << isConcreteMine(data.chargeTypeId(), 0, 0); + DEBUG_LOG(m_logger) << "isConcrete: " << isConcreteMine(data.chargeTypeId, 0, 0); - m_nullArea->triggerMine(dusSerialNo, false, data.chargeTypeId(), {data.position().lon(), data.position().lat()}); + m_nullArea->triggerMine(dusSerialNo, false, data.chargeTypeId, {data.position.lon, data.position.lat}); } void HandlerMineArea::onTimeoutEquipNo(int equipNo, int chargeTypeId) @@ -1166,28 +1166,28 @@ void HandlerMineArea::onTimeoutEquipNo(int equipNo, int chargeTypeId) // QPolygonF boundingBox = msGetBoundingBoxPolygon(points, &width); MineAreaModifyRequest req; - req.chargeStruct().chargeTypeId(chargeTypeId); - req.density(0.7); - req.distance(0.5); - DEBUG_LOG(m_logger) << "density1: " << req.density(); - req.effectDuration(0); - req.effectStart(QDateTime::currentMSecsSinceEpoch() + Settings::getMineAreaByMiVSysEffectStart()); - req.isCenterLine(true); - req.isLaidHidden(false); - req.layingProcedureType(AesMaLayingProcedureType_def::LptPioneer); + req.chargeStruct.chargeTypeId = chargeTypeId; + req.density = 0.7; + req.distance = 0.5; + DEBUG_LOG(m_logger) << "density1: " << req.density; + req.effectDuration = 0; + req.effectStart = QDateTime::currentMSecsSinceEpoch() + Settings::getMineAreaByMiVSysEffectStart(); + req.isCenterLine = true; + req.isLaidHidden = false; + req.layingProcedureType = AesMaLayingProcedureType::LptPioneer; QString name = QString::number(equipNo); - req.name(name.toStdString()); + req.name = name.toStdString(); int participantID = m_mainHandler->dds()->ppmDtc()->participantIdByEquipmentNumber(equipNo); - req.partyId(m_mainHandler->dds()->ppmDtc()->participant(participantID).partyId()); - req.width(0); + req.partyId = m_mainHandler->dds()->ppmDtc()->participant(participantID).partyId; + req.width = 0; std::vector vec; vec.reserve(points.size()); for (QPointF bbPoint : qAsConst(points)) { Core::GeoPosition2D pos; - pos.lon(bbPoint.x()); - pos.lat(bbPoint.y()); + pos.lon = bbPoint.x(); + pos.lat = bbPoint.y(); vec.push_back(pos); } @@ -1205,13 +1205,13 @@ void HandlerMineArea::onTimeoutEquipNo(int equipNo, int chargeTypeId) // pos.lat(point.y()); // vec.push_back(pos); // } - req.segments(vec); + req.segments = vec; // Cannot create a minefield with only one segment => create two new segments with 10m distance - if (req.segments().size() < 2) + if (req.segments.size() < 2) { DEBUG_LOG(m_logger) << "only one segment - create 2 new with distance 10m"; - const LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(vec[0].lon(), vec[0].lat()); + const LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(vec[0].lon, vec[0].lat); LtsCoordTrans::UtmCoordinate point1Utm = pointUtm; LtsCoordTrans::UtmCoordinate point2Utm = pointUtm; point1Utm.y = pointUtm.y - 5.0; @@ -1223,11 +1223,11 @@ void HandlerMineArea::onTimeoutEquipNo(int equipNo, int chargeTypeId) Core::GeoPosition2D pos(point.x(), point.y()); vec.push_back(pos); point = point2Utm.geographic(); - pos.lon(point.x()); - pos.lat(point.y()); + pos.lon = point.x(); + pos.lat = point.y(); vec.push_back(pos); - req.segments(vec); - req.distance(10.0); + req.segments = vec; + req.distance = 10.0; } Core::FunctionReplyObject reply = mineAreaCreateRequest(req); @@ -1247,8 +1247,8 @@ bool HandlerMineArea::checkIfNullMineIsInArea(const std::vectorupdateMineByOldMineId(nearestMine, oldMineId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_corridor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_corridor.cpp index 8620d6b4a..1d2ef4cc7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_corridor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_mine_corridor.cpp @@ -13,7 +13,7 @@ namespace AreaEffectSimulation { HandlerMineCorridor::HandlerMineCorridor(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("MineCorridor"), s_areaCount[AesType::AtMineCorridor], s_areaCountCentral[AesType::AtMineCorridor]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("MineCorridor"), s_areaCount[static_cast(AesType::AtMineCorridor)], s_areaCountCentral[static_cast(AesType::AtMineCorridor)]) , Interface::Fts::MineCorridorModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::MineCorridorRemoveRequestHandler(mainHandler->dds()->fts()) {} @@ -87,13 +87,13 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe if (mod == DataModification::eRemoved) return; - if (data.operationalState() != MRF_MARSCH && data.operationalState() != MRF_RAEUMEN) + if (data.operationalState != MRF_MARSCH && data.operationalState != MRF_RAEUMEN) return; DEBUG_LOG(m_logger) << "onSpecialSensorDataChanged: " << data; - if (data.operationalState() == MRF_RAEUMEN) + if (data.operationalState == MRF_RAEUMEN) { - auto it = m_corridorCreators.constFind(data.equipmentNumber()); - if (data.position().is_set()) + auto it = m_corridorCreators.constFind(data.equipmentNumber); + if (data.position.is_set()) { MineCorridorCreator *mcc = nullptr; if (it == m_corridorCreators.constEnd()) @@ -105,7 +105,7 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe Database::AesMineCorridor newData; - newData.name = QStringLiteral("MRF_%1").arg(data.equipmentNumber()); + newData.name = QStringLiteral("MRF_%1").arg(data.equipmentNumber); newData.effectStart = QDateTime::currentDateTime(); newData.chargeTypeId = 315; // Mine Corridor Dummy newData.width = 5; // TODO: really? @@ -113,10 +113,10 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe ifs->createObject(newData, std::vector()); m_objectMap.insert(ifs->id(), ifs); - mcc = new MineCorridorCreator(data.equipmentNumber(), ifs); - m_corridorCreators[data.equipmentNumber()] = mcc; + mcc = new MineCorridorCreator(data.equipmentNumber, ifs); + m_corridorCreators[data.equipmentNumber] = mcc; TrainingAreaBase::SpecialSensorData stopTele(data); - stopTele.operationalState(MRF_MARSCH); + stopTele.operationalState = MRF_MARSCH; auto timeoutCb = [this, stopTele]() { onSpecialSensorDataChanged(stopTele, DataModification::eModified); @@ -125,14 +125,14 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe } else mcc = it.value(); - mcc->addPosition(data.position().get(), data.sampleTime()); + mcc->addPosition(data.position.get(), data.sampleTime); } else { // start a new corridor if (it != m_corridorCreators.constEnd()) { - WARNING_LOG(m_logger) << "Starting a new mine corridor but the last one was not closed...: " << data.equipmentNumber(); + WARNING_LOG(m_logger) << "Starting a new mine corridor but the last one was not closed...: " << data.equipmentNumber; it.value()->creationFinished(); delete it.value(); m_corridorCreators.erase(it); @@ -141,10 +141,10 @@ void HandlerMineCorridor::onSpecialSensorDataChanged(const TrainingAreaBase::Spe } else { - auto it = m_corridorCreators.constFind(data.equipmentNumber()); + auto it = m_corridorCreators.constFind(data.equipmentNumber); if (it == m_corridorCreators.constEnd()) { - WARNING_LOG(m_logger) << "Finishing a mine corridor but no data available...: " << data.equipmentNumber(); + WARNING_LOG(m_logger) << "Finishing a mine corridor but no data available...: " << data.equipmentNumber; return; } it.value()->creationFinished(); @@ -158,7 +158,7 @@ void HandlerMineCorridor::onMineCorridorModifyRequest(const rti::core::SampleIde const MineCorridorModifyRequest &request) { DEBUG_LOG(m_logger) << "onMineCorridorModifyRequest: " << request; - Core::FunctionReplyObject ret = request.id() > 0 ? mineCorridorModifyRequest(request) : mineCorridorCreateRequest(request); + Core::FunctionReplyObject ret = request.id > 0 ? mineCorridorModifyRequest(request) : mineCorridorCreateRequest(request); if (ret.error()) WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->mineCorridorModifyReply(cookie, ret); @@ -168,20 +168,20 @@ 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.name = QString::fromStdString(request.name); + newData.effectStart = request.effectStart.is_set() && 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.width = request.width(); - newData.externalId = request.externalId().is_set() ? request.externalId().get() : 0; + 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.width = request.width; + newData.externalId = request.externalId.is_set() ? request.externalId.get() : 0; ObjectMineCorridor *ifs(new ObjectMineCorridor(m_mainHandler, this)); Core::FunctionReplyObject ret = ifs->createObject(newData, - request.segments()); + request.segments); if (ret.error()) { delete ifs; @@ -200,39 +200,39 @@ Core::FunctionReplyObject HandlerMineCorridor::mineCorridorModifyRequest(const M Core::FunctionReplyObject ret; ObjectMineCorridor *ifs = nullptr; - if (request.externalId().is_set() && request.externalId().get() > 0) - ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId().get(), ret); + if (request.externalId.is_set() && request.externalId.get() > 0) + ifs = getObjectFromMapByExternalId(m_objectMap, request.externalId.get(), ret); if (!ifs) { - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return mineCorridorCreateRequest(request); - ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; } - if (request.effectStart().is_set() && (request.effectStart().get() + request.effectDuration() < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) + if (request.effectStart.is_set() && (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.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.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.width = request.width(); - newData.externalId = request.externalId().is_set() ? request.externalId().get() : 0; - if (request.id() < 0 && checkStateForSfm(ifs)) + 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.width = request.width; + newData.externalId = request.externalId.is_set() ? request.externalId.get() : 0; + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite mine corridor Effect State for OC"; newData.effectStateId = AesEffectState::EsPrepared; } - return ifs->updateObject(newData, request.segments()); + return ifs->updateObject(newData, request.segments); } void HandlerMineCorridor::onMineCorridorRemoveRequest(const rti::core::SampleIdentity &cookie, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_ncontamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_ncontamination.cpp index f8134c66e..3c0e98597 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_ncontamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_ncontamination.cpp @@ -15,7 +15,7 @@ namespace AreaEffectSimulation { HandlerNContamination::HandlerNContamination(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("NContamination"), s_areaCount[AesType::AtNContamination], s_areaCountCentral[AesType::AtNContamination]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("NContamination"), s_areaCount[static_cast(AesType::AtNContamination)], s_areaCountCentral[static_cast(AesType::AtNContamination)]) , Interface::Fts::NContaminationModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::NContaminationRemoveRequestHandler(mainHandler->dds()->fts()) {} @@ -48,7 +48,7 @@ bool HandlerNContamination::init() } if(!ifs->data().isCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination])) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast(AesType::AtNContamination)])) { ERROR_LOG(m_logger) << "More active n contaminations in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -58,7 +58,7 @@ bool HandlerNContamination::init() } else { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtBCContamination] + s_maxActiveAreasCentral[AesType::AtNContamination])) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)])) { ERROR_LOG(m_logger) << "More active n contaminations in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -89,18 +89,18 @@ bool HandlerNContamination::init() int HandlerNContamination::totalAreas() const { - return s_areaCount[AesType::AtBCContamination] + s_areaCount[AesType::AtNContamination]; + return s_areaCount[static_cast(AesType::AtBCContamination)] + s_areaCount[static_cast(AesType::AtNContamination)]; } int HandlerNContamination::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtBCContamination] + s_areaCountCentral[AesType::AtNContamination]; + return s_areaCountCentral[static_cast(AesType::AtBCContamination)] + s_areaCountCentral[static_cast(AesType::AtNContamination)]; } void HandlerNContamination::onChangedToCentral() { - s_areaCount[AesType::AtNContamination]--; - s_areaCountCentral[AesType::AtNContamination]++; + s_areaCount[static_cast(AesType::AtNContamination)]--; + s_areaCountCentral[static_cast(AesType::AtNContamination)]++; DEBUG_LOG(m_logger) << "m_areaCount after Recount = " << m_areaCount; DEBUG_LOG(m_logger) << "m_areaCountCentral after Recount = " << m_areaCountCentral; @@ -110,25 +110,25 @@ void HandlerNContamination::onChangedToCentral() static void fillData(const NContaminationModifyRequest &src, Database::AesNContamination &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-Laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-Laptop + 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.effectDuration = src.effectDuration(); - dst.impactPosition.rx() = src.impactPosition().lon(); - dst.impactPosition.ry() = src.impactPosition().lat(); - dst.impactRadius = src.impactRadius(); - dst.borderLengthInner = src.borderLengthInner(); - dst.borderLengthOuter = src.borderLengthOuter(); - dst.spanAngle = src.spanAngle(); - dst.rotationAngle = src.rotationAngle(); - dst.detonationValue = src.detonationValue(); - dst.partyId = src.partyId().is_set() ? 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.weatherSourceId = src.weatherSource(); + dst.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.borderLengthInner = src.borderLengthInner; + dst.borderLengthOuter = src.borderLengthOuter; + dst.spanAngle = src.spanAngle; + dst.rotationAngle = src.rotationAngle; + dst.detonationValue = src.detonationValue; + dst.partyId = src.partyId.is_set() ? 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.weatherSourceId = src.weatherSource; } void HandlerNContamination::onNContaminationModifyRequest(const rti::core::SampleIdentity &cookie, @@ -162,7 +162,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con if (ifs->data().isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtNContamination] + s_maxActiveAreasCentral[AesType::AtBCContamination]) && request.effectStart().is_set()) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -172,7 +172,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con } else { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtNContamination] + s_maxActiveAreas[AesType::AtBCContamination]) && request.effectStart().is_set()) + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtNContamination)] + s_maxActiveAreas[static_cast(AesType::AtBCContamination)]) && request.effectStart.is_set()) { ifs->removeObject(); //Not finally deleted from db after this,Fallback if DB deletion is not working correct ifs->removeObjectFromDb(); @@ -202,16 +202,16 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationCreateRequest(con Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(const NContaminationModifyRequest &request) { Core::FunctionReplyObject ret; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return nContaminationCreateRequest(request); - ObjectNContamination *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectNContamination *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; // 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.is_set() && !ifs->isObjectModifiable()) // return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active N contamination areas.")); Database::AesNContamination aea(ifs->data()); @@ -228,25 +228,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.is_set()) { if (isCentral) { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtNContamination] + s_maxActiveAreasCentral[AesType::AtBCContamination]) /*&& request.effectStart().is_set()*/) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)]) /*&& request.effectStart.is_set()*/) { return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active central N or B/C contamination areas.")); } } else { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtNContamination] + s_maxActiveAreas[AesType::AtBCContamination]) /*&& request.effectStart().is_set()*/) // upper if-condition handle start-time + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtNContamination)] + s_maxActiveAreas[static_cast(AesType::AtBCContamination)]) /*&& request.effectStart.is_set()*/) // 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.is_set() && ifs->isObjectModifiable()) { DEBUG_LOG(m_logger) << "isCentral: " << isCentral; @@ -258,8 +258,8 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con // Change from central to training area if (wasCentral) { - if (totalAreas() >= (s_maxActiveAreas[AesType::AtBCContamination] + s_maxActiveAreas[AesType::AtNContamination])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active N or B/C contamination areas.")); + if (totalAreas() >= (s_maxActiveAreas[static_cast(AesType::AtBCContamination)] + s_maxActiveAreas[static_cast(AesType::AtNContamination)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active N or B/C contamination areas.")); m_areaCount++; m_areaCountCentral--; @@ -268,8 +268,8 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con } else // Change from training area to central { - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtBCContamination] + s_maxActiveAreasCentral[AesType::AtNContamination])) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active central N or B/C contamination areas.")); + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtBCContamination)] + s_maxActiveAreasCentral[static_cast(AesType::AtNContamination)])) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active central N or B/C contamination areas.")); m_areaCount--; m_areaCountCentral++; DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtBCContamination] = " << m_areaCount; @@ -281,7 +281,7 @@ Core::FunctionReplyObject HandlerNContamination::nContaminationModifyRequest(con - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite n contamination Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_off_route_mine.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_off_route_mine.cpp index 44ed00a23..0f4aaaffb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_off_route_mine.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_off_route_mine.cpp @@ -12,7 +12,7 @@ namespace AreaEffectSimulation { HandlerOffRouteMine::HandlerOffRouteMine(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("OffRouteMine"), s_areaCount[AesType::AtOffRouteMine], s_areaCountCentral[AesType::AtOffRouteMine]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("OffRouteMine"), s_areaCount[static_cast(AesType::AtOffRouteMine)], s_areaCountCentral[static_cast(AesType::AtOffRouteMine)]) , Interface::Fts::OffRouteMineModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::OffRouteMineRemoveRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::OffRouteMineTriggerRequestHandler(mainHandler->dds()->fts()) @@ -33,7 +33,7 @@ bool HandlerOffRouteMine::init() bRet = false; return; } - if (totalAreasCentral() >= s_maxActiveAreasCentral[AesType::AtOffRouteMine]) + if (totalAreasCentral() >= s_maxActiveAreasCentral[static_cast(AesType::AtOffRouteMine)]) { ERROR_LOG(m_logger) << "More active off route mines in database than allowed - ignoring the rest!"; ifs->removeObject(); @@ -62,34 +62,34 @@ bool HandlerOffRouteMine::init() int HandlerOffRouteMine::totalAreas() const { - return s_areaCount[AesType::AtOffRouteMine]; + return s_areaCount[static_cast(AesType::AtOffRouteMine)]; } int HandlerOffRouteMine::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtOffRouteMine]; + return s_areaCountCentral[static_cast(AesType::AtOffRouteMine)]; } static void fillData(const OffRouteMineModifyRequest &src, Database::AesOffRouteMine &dst) { - if (src.id() < 0) // is the id given as negative? set id -> used by OC-laptop - dst.id = src.id(); + if (src.id < 0) // is the id given as negative? set id -> used by OC-laptop + 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.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.chargeTypeId = src.chargeTypeId(); + dst.name = QString::fromStdString(src.name); + dst.effectStart = src.effectStart.is_set() && 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.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.is_set() ? src.participantId.get() : 0; + //dst.externalId = src.externalId.is_set() ? 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[AesType::AtOffRouteMine]) && request.effectStart().is_set()) + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtOffRouteMine)]) && request.effectStart.is_set()) return Core::FunctionReplyObject(1, tr_lts("dds", "Too many active off route mines.")); Database::AesOffRouteMine newData; @@ -135,15 +135,15 @@ Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineModifyRequest(const O { Core::FunctionReplyObject ret; ObjectOffRouteMine *ifs = nullptr; - if (request.id() == 0 || ((request.id() < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id()), ret))) + if (request.id == 0 || ((request.id < 0) && !getObjectFromMap(m_objectMap, std::abs(request.id), ret))) return offRouteMineCreateRequest(request); - ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; - if (request.effectStart().is_set() && (request.effectStart().get() + request.effectDuration() < m_mainHandler->dds()->currentPartitionTime().toMSecsSinceEpoch())) + if (request.effectStart.is_set() && (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 @@ -151,16 +151,16 @@ Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineModifyRequest(const O /*! * If the effect start added after creation, the max amount need to be checked !*/ - if (totalAreasCentral() >= (s_maxActiveAreasCentral[AesType::AtOffRouteMine]) - && request.effectStart().is_set() + if (totalAreasCentral() >= (s_maxActiveAreasCentral[static_cast(AesType::AtOffRouteMine)]) + && request.effectStart.is_set() && !ifs->isActivationTimeSet() // check if time before change was not setted. /*&& !ifs->isObjectModifiable()*/) { - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active off route mines.")); + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active off route mines.")); } Database::AesOffRouteMine aea(ifs->data()); fillData(request, aea); - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite off route mine Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; @@ -187,15 +187,15 @@ void HandlerOffRouteMine::onOffRouteMineTriggerRequest(const rti::core::SampleId Core::FunctionReplyObject HandlerOffRouteMine::offRouteMineTriggerRequest(const OffRouteMineTriggerRequest &request) { Core::FunctionReplyObject ret; - ObjectOffRouteMine *ifs = getObjectFromMap(m_objectMap, std::abs(request.id()), ret); + ObjectOffRouteMine *ifs = getObjectFromMap(m_objectMap, std::abs(request.id), ret); if (!ifs) return ret; Database::AesOffRouteMine aea(ifs->data()); DEBUG_LOG(m_logger) << "Overwrite off route mine Effect State "; - aea.effectStateId = AesEffectState_def::EsExpired; - aea.triggered = request.triggered(); + aea.effectStateId = AesEffectState::EsExpired; + aea.triggered = request.triggered; aea.effectDuration = aea.effectStart.msecsTo(QDateTime::currentDateTimeUtc()); if (aea.effectDuration < 0) aea.effectDuration = 1; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_recon_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_recon_area.cpp index 6b818d3fe..742eb66b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_recon_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_recon_area.cpp @@ -55,19 +55,19 @@ bool HandlerReconArea::init() static void fillData(const ReconAreaModifyRequest &src, Database::AesReconArea &dst) { - dst.name = QString::fromStdString(src.name()); + dst.name = QString::fromStdString(src.name); dst.chargeTypeId = 103; // recon area dummy dst.effectDuration = 0; // forever active - dst.position.rx() = src.area().cornerBottomLeft().lon(); - dst.position.ry() = src.area().cornerBottomLeft().lat(); - dst.rotationAngle = src.area().rotation(); - dst.height = src.area().height(); - dst.width = src.area().width(); + dst.position.rx() = src.area.cornerBottomLeft.lon; + dst.position.ry() = src.area.cornerBottomLeft.lat; + dst.rotationAngle = src.area.rotation; + 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.participantId = src.participantId(); - dst.partyId = src.partyId().is_set() ? src.partyId().get() : 0; - dst.purpose = QString::fromStdString(src.purpose()); + dst.effectStart = src.effectStart.is_set() ? QDateTime::fromMSecsSinceEpoch(src.effectStart.get()) : QDateTime(); + dst.participantId = src.participantId; + dst.partyId = src.partyId.is_set() ? src.partyId.get() : 0; + dst.purpose = QString::fromStdString(src.purpose); } void HandlerReconArea::onReconAreaModifyRequest(const rti::core::SampleIdentity &cookie, @@ -100,8 +100,8 @@ Core::FunctionReplyObject HandlerReconArea::reconAreaCreateRequest(const ReconAr m_objectMap.insert(ifs->id(), ifs); if (ifs->isObjectInTrainingArea()) { - ++s_areaCount[AesType::AtReconArea]; - DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtReconArea] = " << s_areaCount[AesType::AtReconArea]; + ++s_areaCount[static_cast(AesType::AtReconArea)]; + DEBUG_LOG(m_logger) << "s_areaCount[AesType::AtReconArea] = " << s_areaCount[static_cast(AesType::AtReconArea)]; } connect(ifs, &ObjectReconArea::newAiv, this, &HandlerReconArea::newAiv); connect(ifs, &ObjectReconArea::removeAiv, this, &HandlerReconArea::removeAiv); @@ -110,11 +110,11 @@ Core::FunctionReplyObject HandlerReconArea::reconAreaCreateRequest(const ReconAr Core::FunctionReplyObject HandlerReconArea::reconAreaModifyRequest(const ReconAreaModifyRequest &request) { - if (request.id() <= 0) + if (request.id <= 0) return reconAreaCreateRequest(request); Core::FunctionReplyObject ret; - ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; @@ -130,19 +130,19 @@ Core::FunctionReplyObject HandlerReconArea::reconAreaModifyGeometryRequest(const { // WARNING: request.area.cornerBottomLeft() contains center point! Core::FunctionReplyObject ret; - ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; // Todo: IsObjectModifiable() ?!? AreaEffectSimulation::Database::AesReconArea aea(ifs->data()); - aea.position = Polygons::centerPoint2BottomLeft(QPointF(request.area().cornerBottomLeft().lon(), - request.area().cornerBottomLeft().lat()), + aea.position = Polygons::centerPoint2BottomLeft(QPointF(request.area.cornerBottomLeft.lon, + request.area.cornerBottomLeft.lat), ifs->data().width, ifs->data().height, - request.area().rotation()); - aea.rotationAngle = request.area().rotation(); + request.area.rotation); + aea.rotationAngle = request.area.rotation; return ifs->updateObject(aea); } @@ -163,23 +163,23 @@ Core::FunctionReplyObject HandlerReconArea::switchTo(int id, AesEffectState effe return Core::FunctionReplyObject(id, tr_lts("dds", "Recon area with id %1 not found.")).arg(id); bool succ = false; - switch (effectState.underlying()) { - case AesEffectState_def::EsActivated: + switch (effectState) { + case AesEffectState::EsActivated: succ = !ifs->activateObjectNow().error(); break; - case AesEffectState_def::EsPrepared: + case AesEffectState::EsPrepared: succ = ifs->trySwitchToPrepared(); break; - case AesEffectState_def::EsPaused: + case AesEffectState::EsPaused: succ = ifs->trySwitchToPaused(); break; - case AesEffectState_def::EsExpired: + case AesEffectState::EsExpired: succ = ifs->trySwitchToExpired(); break; - case AesEffectState_def::EsRemoved: + case AesEffectState::EsRemoved: succ = ifs->trySwitchToRemoved(); break; - case AesEffectState_def::EsCreated: + case AesEffectState::EsCreated: succ = ifs->trySwitchToCreated(); break; default: @@ -187,7 +187,7 @@ Core::FunctionReplyObject HandlerReconArea::switchTo(int id, AesEffectState effe } if (succ) return Core::FunctionReplyObject(); - return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(effectState.underlying()); + return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(effectState); } void HandlerReconArea::onReconAreaRemoveRequest(const rti::core::SampleIdentity &cookie, @@ -195,7 +195,7 @@ void HandlerReconArea::onReconAreaRemoveRequest(const rti::core::SampleIdentity { DEBUG_LOG(m_logger) << "onReconAreaRemoveRequest: " << request; Core::FunctionReplyObject ret; - ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectReconArea *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) { m_mainHandler->dds()->fts()->reconAreaRemoveReply(cookie, ret); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_technical_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_technical_area.cpp index 7e8939477..9c7d3dfbd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_technical_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_technical_area.cpp @@ -14,7 +14,7 @@ namespace AreaEffectSimulation { HandlerTechnicalArea::HandlerTechnicalArea(MainHandler *mainHandler) - : HandlerBaseTmpl(mainHandler, QStringLiteral("TechnicalArea"), s_areaCount[AesType::AtTechnicalArea], s_areaCountCentral[AesType::AtTechnicalArea]) + : HandlerBaseTmpl(mainHandler, QStringLiteral("TechnicalArea"), s_areaCount[static_cast(AesType::AtTechnicalArea)], s_areaCountCentral[static_cast(AesType::AtTechnicalArea)]) , Interface::Fts::TechnicalAreaModifyRequestHandler(mainHandler->dds()->fts()) , Interface::Fts::TechnicalAreaRemoveRequestHandler(mainHandler->dds()->fts()) { @@ -43,7 +43,7 @@ bool HandlerTechnicalArea::init() return false; } - if (totalAreas() >= s_maxActiveAreas[AesType::AtTechnicalArea]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtTechnicalArea)]) { ERROR_LOG(m_logger) << "More active technical areas in database than allowed - ignoring the rest!"; delete ifs; @@ -65,31 +65,31 @@ bool HandlerTechnicalArea::init() int HandlerTechnicalArea::totalAreas() const { - return s_areaCount[AesType::AtTechnicalArea]; + return s_areaCount[static_cast(AesType::AtTechnicalArea)]; } int HandlerTechnicalArea::totalAreasCentral() const { - return s_areaCountCentral[AesType::AtTechnicalArea]; + return s_areaCountCentral[static_cast(AesType::AtTechnicalArea)]; } static void fillData(const TechnicalAreaModifyRequest &src, Database::AesTechnicalArea &dst) { - dst.name = QString::fromStdString(src.name()); + dst.name = QString::fromStdString(src.name); dst.chargeTypeId = 421; // dummy dst.effectDuration = 0; // forever active - dst.typeId = src.type().underlying(); - 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.typeId = src.type; + dst.position.rx() = src.area.cornerBottomLeft.lon; + dst.position.ry() = src.area.cornerBottomLeft.lat; + dst.length = src.area.height; + dst.width = src.area.width; } void HandlerTechnicalArea::onTechnicalAreaModifyRequest(const rti::core::SampleIdentity &cookie, const TechnicalAreaModifyRequest &request) { DEBUG_LOG(m_logger) << "onTechnicalAreaModifyRequest: " << request; - Core::FunctionReplyObject ret = request.id() > 0 ? technicalAreaModifyRequest(request) : technicalAreaCreateRequest(request); + Core::FunctionReplyObject ret = request.id > 0 ? technicalAreaModifyRequest(request) : technicalAreaCreateRequest(request); if (ret.error()) WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->technicalAreaModifyReply(cookie, ret); @@ -97,7 +97,7 @@ void HandlerTechnicalArea::onTechnicalAreaModifyRequest(const rti::core::SampleI Core::FunctionReplyObject HandlerTechnicalArea::technicalAreaCreateRequest(const TechnicalAreaModifyRequest &request) { - if (totalAreas() >= s_maxActiveAreas[AesType::AtTechnicalArea]) + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtTechnicalArea)]) return Core::FunctionReplyObject(tr_lts("dds", "Too many active technical areas.")); Database::AesTechnicalArea newData; @@ -129,20 +129,20 @@ Core::FunctionReplyObject HandlerTechnicalArea::technicalAreaCreateRequest(const Core::FunctionReplyObject HandlerTechnicalArea::technicalAreaModifyRequest(const TechnicalAreaModifyRequest &request) { Core::FunctionReplyObject ret; - ObjectTechnicalArea *ifs = getObjectFromMap(m_objectMap, request.id(), ret); + ObjectTechnicalArea *ifs = getObjectFromMap(m_objectMap, request.id, ret); if (!ifs) return ret; // Anzahl aktiver Areas ist erreicht, der Wirkbeginn ist (soll) gesetzt sein, aber die Area war // vorher noch ohne Wirkbeginn - if (totalAreas() >= s_maxActiveAreas[AesType::AtTechnicalArea] && !ifs->isObjectModifiable()) - return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Too many active technical areas.")); + if (totalAreas() >= s_maxActiveAreas[static_cast(AesType::AtTechnicalArea)] && !ifs->isObjectModifiable()) + return Core::FunctionReplyObject(request.id, tr_lts("dds", "Too many active technical areas.")); // Todo: IsObjectModifiable() ?!? AreaEffectSimulation::Database::AesTechnicalArea aea(ifs->data()); fillData(request, aea); - if (request.id() < 0 && checkStateForSfm(ifs)) + if (request.id < 0 && checkStateForSfm(ifs)) { DEBUG_LOG(m_logger) << "Overwrite technical area Effect State for OC"; aea.effectStateId = AesEffectState::EsPrepared; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp index 267f22e7e..434b366ec 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp @@ -178,7 +178,7 @@ bool MainHandler::initAESHandler() if (!ltsElevationManager) { ERROR_LOG(m_logger) << LOGFUNCTION << " LtsElevation::createInstance failed."; - m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); + m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError); return false; } #endif // Q_OS_WIN @@ -190,7 +190,7 @@ bool MainHandler::initAESHandler() if (!trajectoryGenerator) { ERROR_LOG(m_logger) << LOGFUNCTION << " TrajectoryGenerator::getInstance failed."; - m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); + m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError); return false; } @@ -250,7 +250,7 @@ bool MainHandler::initAESHandler() if (!m_handlerBorderline->init()) { ERROR_LOG(m_logger) << LOGFUNCTION << " Initialisation HandlerBorderline failed."; - m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); + m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError); return false; } @@ -259,7 +259,7 @@ bool MainHandler::initAESHandler() if (!m_handlerGasPipe->init()) { ERROR_LOG(m_logger) << LOGFUNCTION << " Initialisation HandlerGasPipe failed."; - m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); + m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError); return false; } @@ -268,7 +268,7 @@ bool MainHandler::initAESHandler() if (!m_handlerChargeEffect->init()) { ERROR_LOG(m_logger) << LOGFUNCTION << " Initialisation HandlerChargeEffect failed."; - m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); + m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError); return false; } @@ -281,7 +281,7 @@ bool MainHandler::initAESHandler() if (!m_handlerEffector->init()) { ERROR_LOG(m_logger) << LOGFUNCTION << " Initialisation HandlerChargeEffect failed."; - m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); + m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError); return false; } // Effect Cluster last as we need Effector first diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/meteo_data_provider.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/meteo_data_provider.cpp index 647eeeb34..9ebf7dab7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/meteo_data_provider.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/meteo_data_provider.cpp @@ -37,38 +37,38 @@ MeteoDataManagement::MeteoData MeteoDataProvider::getStaticWeather() } // default values from wikipedia for aviations MeteoDataManagement::MeteoData dummyWeather; - dummyWeather.pressure(1013.25); - dummyWeather.temperature(15); - dummyWeather.humidity(0); + dummyWeather.pressure = 1013.25; + dummyWeather.temperature = 15; + dummyWeather.humidity = 0; - dummyWeather.timeStamp(m_mainHandler->dds()->currentPartitionTimeMSec()); - dummyWeather.windDirection(0); - dummyWeather.windSpeed(0); - dummyWeather.windOk(true); - dummyWeather.climateOk(true); + dummyWeather.timeStamp = m_mainHandler->dds()->currentPartitionTimeMSec(); + dummyWeather.windDirection = 0; + dummyWeather.windSpeed = 0; + dummyWeather.windOk = true; + dummyWeather.climateOk = true; return dummyWeather; } MeteoDataManagement::MeteoData MeteoDataProvider::getNearestWeather(const Core::GeoPosition2D &pos) { initWeatherData(); - LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat())); + LtsCoordTrans::UtmCoordinate utm(LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat)); double nearestDistanceSquared = std::numeric_limits::max(); MeteoDataManagement::MeteoData retMd; for (const auto &md : qAsConst(m_meteoData)) { - if (md.isStaticMeteoData()) + if (md.isStaticMeteoData) continue; - if (QDateTime::fromMSecsSinceEpoch(md.timeStamp()).addMSecs(Settings::getValidityPeriodWeatherData()) < m_mainHandler->dds()->currentPartitionTime()) + if (QDateTime::fromMSecsSinceEpoch(md.timeStamp).addMSecs(Settings::getValidityPeriodWeatherData()) < m_mainHandler->dds()->currentPartitionTime()) continue; - const double distanceSquared = LtsCoordTrans::squareDistance(utm, md.pos().lon(), md.pos().lat()); + const double distanceSquared = LtsCoordTrans::squareDistance(utm, md.pos.lon, md.pos.lat); if (distanceSquared < nearestDistanceSquared) { retMd = md; nearestDistanceSquared = distanceSquared; } } - return (retMd.id() > 0) ? retMd : getStaticWeather(); + return (retMd.id > 0) ? retMd : getStaticWeather(); } void MeteoDataProvider::meteoDataChanged(const MeteoDataManagement::MeteoData &data, DataModification modType) @@ -76,15 +76,15 @@ void MeteoDataProvider::meteoDataChanged(const MeteoDataManagement::MeteoData &d switch (modType) { case DataModification::eRemoved: - m_meteoData.remove(data.id()); - if (m_staticWeatherId == data.id()) + m_meteoData.remove(data.id); + if (m_staticWeatherId == data.id) m_staticWeatherId = 0; break; case DataModification::eAdded: case DataModification::eModified: - m_meteoData[data.id()] = data; - if (data.isStaticMeteoData()) - m_staticWeatherId = data.id(); + m_meteoData[data.id] = data; + if (data.isStaticMeteoData) + m_staticWeatherId = data.id; break; } } @@ -96,9 +96,9 @@ void MeteoDataProvider::initWeatherData() m_mdmDtc->waitForHistoricalDataMeteoData(); m_meteoData = m_mdmDtc->meteoDatas(); for (const auto &data : qAsConst(m_meteoData)) - if (data.isStaticMeteoData()) + if (data.isStaticMeteoData) { - m_staticWeatherId = data.id(); + m_staticWeatherId = data.id; return; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp index de9e6d0d3..80b01e31e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp @@ -47,11 +47,11 @@ void MineCorridorCreator::addPosition(const Core::GeoPosition2D &pos, qint64 ts) { m_timeoutTimer->start(); if (m_sortedCorridorData.isEmpty()) - m_sortedCorridorData.insert(ts, LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat())); + m_sortedCorridorData.insert(ts, LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat)); else { const auto &last = m_sortedCorridorData.last(); - const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), last.zone); + const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat, last.zone); if (isSamePoint(last, utm, s_samePointDistance)) { DEBUG_LOG(m_logger) << "got duplicated point (" << last.x << "/" << last.y diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.cpp index 709b3312b..c2e357c05 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.cpp @@ -95,23 +95,23 @@ void ObjectAirSupportImpact::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv.form()); - aiv.effectStart(toMSec(m_data.effectStart)); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtAirSupportImpact); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtAirSupportImpact); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv.form); + aiv.effectStart = toMSec(m_data.effectStart); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtAirSupportImpact; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtAirSupportImpact); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -122,7 +122,7 @@ void ObjectAirSupportImpact::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeExplosionSingleByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtAirSupportImpact); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtAirSupportImpact)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.h index b199c71a2..54bf31e40 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_air_support_impact.h @@ -22,7 +22,7 @@ public: Core::FunctionReplyObject updateObject(const Database::AesAirSupportImpact &data) override; - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtAirSupportImpact; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp index 71ddbedd7..019f93951 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp @@ -93,7 +93,7 @@ AesEffectState ObjectBase::checkEnterNewState() { DEBUG_LOG(m_logger) << id() << " checkEnterNewState - cur effect state is " << effectState(); bool bNeedToPublishNewData = false; - switch (effectState().underlying()) + switch (effectState()) { case AesEffectState::EsUnknown: // initial state, switch to Received or Created @@ -376,7 +376,7 @@ bool ObjectBase::trySwitchToExpired() bool ObjectBase::trySwitchToRemoved() { DEBUG_LOG(m_logger) << id() << " trySwitchToRemoved: " << effectState(); - switch (effectState().underlying()) + switch (effectState()) { case AesEffectState::EsReceived: setUseEffectStateReceived(false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h index 2b3ad543e..411e31bc8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h @@ -149,7 +149,7 @@ class ObjectBase : public QObject QPolygonF out; out.reserve(in.size()); for (const auto &pos : qAsConst(in)) - out.push_back(QPointF(pos.lon(), pos.lat())); + out.push_back(QPointF(pos.lon, pos.lat)); return out; } @@ -300,7 +300,7 @@ template class ObjectBaseTmpl : public ObjectBase m_data.effectStart = tTempStart; return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Can not activate effect simulation with id %1 which is in the effect state with id %2.")) .arg(m_data.id) - .arg(m_data.effectStateId.underlying()); + .arg(static_cast(m_data.effectStateId)); } return Core::FunctionReplyObject(); @@ -357,10 +357,10 @@ template class ObjectBaseTmpl : public ObjectBase if (wasCentral && (effectState() == AesEffectState::EsExpired || effectState() == AesEffectState::EsActivated || effectState() == AesEffectState::EsPaused)) return true; - if (static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::VirtualSingle) + if (static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::VirtualSingle) return true; - if (m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(m_data.chargeTypeId) == ProjectDataManagement::GearClass::AirSupport) + if (m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(m_data.chargeTypeId) == ProjectDataManagement::GearClass::GearClass_AirSupport) return true; // Laser-Guidable Weapons must always be calculated by CES @@ -368,7 +368,7 @@ template class ObjectBaseTmpl : public ObjectBase return true; // PzAbwVMi B always true - if (static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::Concrete) + if (static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::Concrete) return true; // If form didn't change, isCentral cannot change either: @@ -379,9 +379,9 @@ template class ObjectBaseTmpl : public ObjectBase const QMap spAMap = m_mainHandler->specialAreaProvider()->getSpecialAreas(); for (const InfrastructureManagement::SpecialArea &sa : spAMap) { - if (sa.specialType() != InfrastructureManagement::SpecialAreaType::SatCesArea) + if (sa.specialType != InfrastructureManagement::SpecialAreaType::SatCesArea) continue; - if (intersects(form, sa.polygon())) + if (intersects(form, sa.polygon)) return true; } return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.cpp index bb2e9839f..f2c045587 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.cpp @@ -139,8 +139,8 @@ void ObjectBCContamination::onUpdateWeatherData() else md = m_mainHandler->meteoData()->getStaticWeather(); - if (qFuzzyCompare(md.windDirection(), fmod(m_data.propagationDirection + 180.0, 360.0)) && - qFuzzyCompare(md.windSpeed(), m_data.windSpeed)) + if (qFuzzyCompare(md.windDirection, fmod(m_data.propagationDirection + 180.0, 360.0)) && + qFuzzyCompare(md.windSpeed, m_data.windSpeed)) { DEBUG_LOG(m_logger) << id() << " weather for " << m_typeName << " did not change - no need to publish new data"; @@ -148,8 +148,8 @@ void ObjectBCContamination::onUpdateWeatherData() } DEBUG_LOG(m_logger) << id() << " updating weather for " << m_typeName; - m_data.propagationDirection = fmod(md.windDirection() + 180.0, 360.0); - m_data.windSpeed = md.windSpeed(); + m_data.propagationDirection = fmod(md.windDirection + 180.0, 360.0); + m_data.windSpeed = md.windSpeed; m_data.weatherTimestamp = partitionTime() > m_data.effectStart ? partitionTime() : m_data.effectStart; m_data.weatherPosition = curCenterPointGeographic; m_publishDataTimer->start(); @@ -217,26 +217,26 @@ void ObjectBCContamination::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.effectStart(toMSec(m_data.effectStart)); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtBCContamination); - aiv.effectStateId(data().effectStateId); - aiv.id(1000 * m_data.id + AesType::AtBCContamination); + aiv.aesItemId = m_data.id; + aiv.effectStart = toMSec(m_data.effectStart); + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtBCContamination; + aiv.effectStateId = data().effectStateId; + aiv.id = 1000 * m_data.id + static_cast(AesType::AtBCContamination); // Check if aiv is in special area // effectStart needs to be set - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(m_aiv); @@ -278,7 +278,7 @@ void ObjectBCContamination::removeTopics() m_aivUpdateTimer->stop(); m_weatherTimer->stop(); dts->removeBCContaminationByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtBCContamination); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtBCContamination)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.h index 57ff558e3..a17d56ea4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_bccontamination.h @@ -29,7 +29,7 @@ public: */ bool removeObjectFromDb(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtBCContamination; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.cpp index c358f745e..c86823319 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.cpp @@ -164,22 +164,22 @@ void ObjectBoobyTrap::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.effectStart(toMSec(m_data.effectStart)); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtBoobyTrap); - aiv.effectStateId(data().effectStateId); - aiv.id(1000 * m_data.id + AesType::AtBoobyTrap); + aiv.aesItemId = m_data.id; + aiv.effectStart = toMSec(m_data.effectStart); + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtBoobyTrap; + aiv.effectStateId = data().effectStateId; + aiv.id = 1000 * m_data.id + static_cast(AesType::AtBoobyTrap); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(m_aiv); @@ -191,21 +191,21 @@ void ObjectBoobyTrap::publishAiv() const QPolygonF poly = Polygons::boobyTrapCake(data(), data().impactRadius); const QRectF bounds(poly.boundingRect()); AesItemView aiv2(m_aiv2); - aiv2.aesItemId(m_data.id); - aiv2.effectStart(toMSec(m_data.effectStart)); - aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv2.form()); - aiv2.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv2.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv2.aesTypeId(AesType::AtBoobyTrapSecondary); - aiv2.effectStateId(data().effectStateId); - aiv2.id(1000 * m_data.id + AesType::AtBoobyTrapSecondary); + aiv2.aesItemId = m_data.id; + aiv2.effectStart = toMSec(m_data.effectStart); + aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv2.form); + aiv2.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv2.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv2.aesTypeId = AesType::AtBoobyTrapSecondary; + aiv2.effectStateId = data().effectStateId; + aiv2.id = 1000 * m_data.id + static_cast(AesType::AtBoobyTrapSecondary); if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; if (aiv2 != m_aiv2) { - aiv2.sampleTime(partitionTimeMSec()); + aiv2.sampleTime = partitionTimeMSec(); m_aiv2 = aiv2; m_mainHandler->dds()->dts()->publish(aiv2); emit newAiv(aiv2); @@ -218,7 +218,7 @@ void ObjectBoobyTrap::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeBoobyTrapByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtBoobyTrap); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtBoobyTrap)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.h index fa412ca79..064e6e270 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_booby_trap.h @@ -29,7 +29,7 @@ public: */ bool removeObjectFromDb(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtBoobyTrap; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.cpp index 22e63d4e6..7da02f399 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.cpp @@ -36,7 +36,7 @@ Core::FunctionReplyObject ObjectBorderline::createObject(const Database::AesBord m_data = dbData; m_data.effectStart = partitionTime(); - m_data.effectStateId = AreaEffectSimulation::AesEffectState_def::EsCreated; + m_data.effectStateId = AreaEffectSimulation::AesEffectState::EsCreated; m_data.effectDuration = 0; m_data.chargeTypeId = 312; // see GearClass 1 -> 'pdm.pdm_charge_type' und 'pdm.pdm_gear_type_charge_type' in insert_pdm_values_xxx.sql @@ -58,7 +58,7 @@ Core::FunctionReplyObject ObjectBorderline::createObject(const Database::AesBord { dbSegment.id = 0; // Reset for insert. Otherwise second segment cannot be inserted! dbSegment.borderlineId = m_data.privBorderlineId; // db - dbSegment.position = QPointF(ddsSegments[i].lon(), ddsSegments[i].lat()); + dbSegment.position = QPointF(ddsSegments[i].lon, ddsSegments[i].lat); dbSegment.positionIndex = i; if (!m_mainHandler->db()->insert(dbSegment)) @@ -120,7 +120,7 @@ Core::FunctionReplyObject ObjectBorderline::updateObject(const Database::AesBord // update all segments in tmpDbSegments for (size_t i = 0; i < ddsSegments.size(); ++i) { - tmpDbSegments[i].position = QPointF(ddsSegments[i].lon(), ddsSegments[i].lat()); + tmpDbSegments[i].position = QPointF(ddsSegments[i].lon, ddsSegments[i].lat); tmpDbSegments[i].positionIndex = i; } @@ -174,19 +174,19 @@ void ObjectBorderline::onPublishData() AreaEffectSimulation::Borderline ddsData; - ddsData.id(m_data.id); - ddsData.name(m_data.name.toStdString()); - ddsData.operatorId(m_data.operatorId.isNull() ? 0 : m_data.operatorId.toInt()); - ddsData.isDeleted(effectState() == AesEffectState::EsRemoved); - ddsData.isUsed(false); - ddsData.sampleTime(m_mainHandler->dds()->currentPartitionTimeMSec()); - ddsData.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsData.effectDuration(m_data.effectDuration); - ddsData.effectStart(toOptional(toMSec(m_data.effectStart))); - ddsData.effectStateId(effectState()); - ddsData.partyId(toOptional(m_data.partyId)); - ddsData.participantId(toOptional(m_data.participantId)); - dbSegment2DdsSegment(m_dbSegments, ddsData.segments()); + ddsData.id = m_data.id; + ddsData.name = m_data.name.toStdString(); + ddsData.operatorId = m_data.operatorId.isNull() ? 0 : m_data.operatorId.toInt(); + ddsData.isDeleted = effectState() == AesEffectState::EsRemoved; + ddsData.isUsed = false; + ddsData.sampleTime = m_mainHandler->dds()->currentPartitionTimeMSec(); + ddsData.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsData.effectDuration = m_data.effectDuration; + ddsData.effectStart = toOptional(toMSec(m_data.effectStart)); + ddsData.effectStateId = effectState(); + ddsData.partyId = toOptional(m_data.partyId); + ddsData.participantId = toOptional(m_data.participantId); + dbSegment2DdsSegment(m_dbSegments, ddsData.segments); if (!m_mainHandler->dds()->dts()->publish(ddsData)) ERROR_LOG(m_logger) << "Error publishing AesBorderline-data to dds"; @@ -203,10 +203,10 @@ void ObjectBorderline::publishAiv() poly[i] = m_dbSegments.at(i).position; AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(partitionTimeMSec()); - ddsVecFromPoly(poly, aiv.form()); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = partitionTimeMSec(); + ddsVecFromPoly(poly, aiv.form); const QRectF bounds(poly.boundingRect()); // Hack @@ -220,18 +220,18 @@ void ObjectBorderline::publishAiv() y_topRight = bounds.topRight().y(); y_bottmLeft = bounds.bottomLeft().y(); } - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), y_bottmLeft)); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), y_topRight)); - aiv.aesTypeId(AesType::AtBorderline); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtBorderline); - aiv.partyId(m_data.partyId); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), y_bottmLeft); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), y_topRight); + aiv.aesTypeId = AesType::AtBorderline; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtBorderline); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -243,7 +243,7 @@ void ObjectBorderline::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeBorderlineByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtBorderline); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtBorderline)); } QPolygonF ObjectBorderline::generateForm() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.h index 8a7019cc0..619bd0fe1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_borderline.h @@ -40,7 +40,7 @@ public: Core::FunctionReplyObject removeObject() override; - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtBorderline; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp index 8dea2972d..be72eb3c7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp @@ -24,7 +24,7 @@ ObjectChargeEffect::ObjectChargeEffect(MainHandler *mainHandler, QObject *parent : QObject(parent) , m_mainHandler(mainHandler) , m_trajectoryId(-1) - , m_state(AesEffectState::inner_enum::EsUnknown) + , m_state(AesEffectState::EsUnknown) , m_stateChanged(false) , m_stateTimer(new QTimer(this)) , m_logger(getLogger(QStringLiteral("ObjectChargeEffect"))) @@ -38,16 +38,16 @@ ObjectChargeEffect::ObjectChargeEffect(MainHandler *mainHandler, QObject *parent Core::FunctionReplyObject ObjectChargeEffect::create(const ChargeEffectModifyRequest &data) { - Core::FunctionReplyObject reply(data.id()); + Core::FunctionReplyObject reply(data.id); Database::AesChargeEffect dbData = functionTopicToDatabase(data); if (!m_mainHandler) reply.setStr("Not possible to create ChargeEffect --> No MainHandler present."); - else if (data.effectStart() < QDateTime::currentMSecsSinceEpoch()) + else if (data.effectStart < QDateTime::currentMSecsSinceEpoch()) reply.setStr("Not possible to create ChargeEffect --> EffectStart has to be in the future."); - else if (data.effectDuration() < 1000) + else if (data.effectDuration < 1000) reply.setStr("Not possible to create ChargeEffect --> EffectDuration must be at least 1000ms."); - else if (data.name().empty()) + else if (data.name.empty()) reply.setStr("Not possible to create ChargeEffect --> Name must not be empty."); else if (!m_mainHandler->db()->insert(dbData)) reply.setStr("Not possible to create ChargeEffect --> Database insert failed."); @@ -68,14 +68,14 @@ Core::FunctionReplyObject ObjectChargeEffect::create(const ChargeEffectModifyReq Core::FunctionReplyObject ObjectChargeEffect::update(const ChargeEffectModifyRequest &data) { - Core::FunctionReplyObject reply(data.id()); + Core::FunctionReplyObject reply(data.id); Database::AesChargeEffect dbData = functionTopicToDatabase(data); if (!m_mainHandler) reply.setStr("Not possible to update ChargeEffect --> No MainHandler present."); - else if (data.id() != m_data.id) + else if (data.id != m_data.id) reply.setStr("Not possible to update ChargeEffect --> Id mismatch."); - else if (m_state != AesEffectState::inner_enum::EsPrepared) + else if (m_state != AesEffectState::EsPrepared) { // properties update is allowed!!! if (dbData.properties != m_data.properties) @@ -83,7 +83,7 @@ Core::FunctionReplyObject ObjectChargeEffect::update(const ChargeEffectModifyReq else reply.setStr("Not possible to update ChargeEffect --> It is not allowed to make changes EsState doesn't allow it."); } - else if (data.name().empty()) + else if (data.name.empty()) reply.setStr("Not possible to update ChargeEffect --> Name must not be empty."); else if (!hasChanges(dbData)) reply.setStr("Not possible to update ChargeEffect --> There are no changes."); @@ -150,19 +150,19 @@ Database::AesChargeEffect ObjectChargeEffect::functionTopicToDatabase(const Char { Database::AesChargeEffect dbData; - dbData.id = data.id(); - dbData.name = QString::fromStdString(data.name()); - dbData.chargeTypeId = data.chargeTypeId(); - dbData.igniterTypeId = data.igniterTypeId(); - dbData.effectDuration = data.effectDuration(); - dbData.effectStart = QDateTime::fromMSecsSinceEpoch(data.effectStart()); - dbData.gearTypeId = data.gearTypeId(); - dbData.originatorId = data.originatorId(); - dbData.originatorTypeId = static_cast(data.originatorTypeId().underlying()); - dbData.position.setX(data.position().lon()); - dbData.position.setY(data.position().lat()); - dbData.position.setZ(data.position().z()); - dbData.properties = QString::fromStdString(data.properties()); + dbData.id = data.id; + dbData.name = QString::fromStdString(data.name); + dbData.chargeTypeId = data.chargeTypeId; + dbData.igniterTypeId = data.igniterTypeId; + dbData.effectDuration = data.effectDuration; + dbData.effectStart = QDateTime::fromMSecsSinceEpoch(data.effectStart); + dbData.gearTypeId = data.gearTypeId; + dbData.originatorId = data.originatorId; + dbData.originatorTypeId = static_cast(data.originatorTypeId); + dbData.position.setX(data.position.lon); + dbData.position.setY(data.position.lat); + dbData.position.setZ(data.position.z); + dbData.properties = QString::fromStdString(data.properties); return dbData; } @@ -173,21 +173,21 @@ ChargeEffect ObjectChargeEffect::dataBaseToDataTopic(const Database::AesChargeEf { ChargeEffect dataTopic; - dataTopic.id(data.id); - dataTopic.name(data.name.toStdString()); - dataTopic.chargeTypeId(data.chargeTypeId); - dataTopic.effectDuration(data.effectDuration); - dataTopic.effectStart(data.effectStart.toMSecsSinceEpoch()); - dataTopic.igniterTypeId(data.igniterTypeId); - dataTopic.gearTypeId(data.gearTypeId); - dataTopic.originatorId(data.originatorId); - dataTopic.originatorTypeId(static_cast(data.originatorTypeId)); - dataTopic.position().lon(data.position.x()); - dataTopic.position().lat(data.position.y()); - dataTopic.position().z(data.position.z()); - dataTopic.state(m_state); - dataTopic.properties(data.properties.toStdString()); - dataTopic.sampleTime(m_mainHandler->dds()->currentPartitionTimeMSec()); + dataTopic.id = data.id; + dataTopic.name = data.name.toStdString(); + dataTopic.chargeTypeId = data.chargeTypeId; + dataTopic.effectDuration = data.effectDuration; + dataTopic.effectStart = data.effectStart.toMSecsSinceEpoch(); + dataTopic.igniterTypeId = data.igniterTypeId; + dataTopic.gearTypeId = data.gearTypeId; + dataTopic.originatorId = data.originatorId; + dataTopic.originatorTypeId = static_cast(data.originatorTypeId); + dataTopic.position.lon = data.position.x(); + dataTopic.position.lat = data.position.y(); + dataTopic.position.z = data.position.z(); + dataTopic.state = m_state; + dataTopic.properties = data.properties.toStdString(); + dataTopic.sampleTime = m_mainHandler->dds()->currentPartitionTimeMSec(); return dataTopic; } @@ -243,24 +243,24 @@ bool ObjectChargeEffect::isFinished() const void ObjectChargeEffect::onStateTimerTimeout() { - switch (m_state.underlying()) + switch (m_state) { - case AesEffectState::inner_enum::EsPrepared: - case AesEffectState::inner_enum::EsActivated: + case AesEffectState::EsPrepared: + case AesEffectState::EsActivated: setNextState(); startStateTimer(); publish(); return; - case AesEffectState::inner_enum::EsExpired: + case AesEffectState::EsExpired: emit finished(m_data.id); return; - case AesEffectState::inner_enum::EsUnknown: - case AesEffectState::inner_enum::EsError: - case AesEffectState::inner_enum::EsRemoved: - case AesEffectState::inner_enum::EsCreated: - case AesEffectState::inner_enum::EsPaused: + case AesEffectState::EsUnknown: + case AesEffectState::EsError: + case AesEffectState::EsRemoved: + case AesEffectState::EsCreated: + case AesEffectState::EsPaused: default: return; } @@ -273,20 +273,20 @@ void ObjectChargeEffect::setNextState() AesEffectState oldState = m_state; m_stateChanged = false; - switch (m_state.underlying()) + switch (m_state) { - case AesEffectState::inner_enum::EsPrepared: + case AesEffectState::EsPrepared: m_state = AesEffectState::EsActivated; break; - case AesEffectState::inner_enum::EsActivated: + case AesEffectState::EsActivated: m_state = AesEffectState::EsExpired; break; - case AesEffectState::inner_enum::EsExpired: - case AesEffectState::inner_enum::EsUnknown: - case AesEffectState::inner_enum::EsError: - case AesEffectState::inner_enum::EsRemoved: - case AesEffectState::inner_enum::EsCreated: - case AesEffectState::inner_enum::EsPaused: + case AesEffectState::EsExpired: + case AesEffectState::EsUnknown: + case AesEffectState::EsError: + case AesEffectState::EsRemoved: + case AesEffectState::EsCreated: + case AesEffectState::EsPaused: default: m_state = AesEffectState::EsUnknown; break; @@ -309,11 +309,11 @@ void ObjectChargeEffect::calculateInitEffectState() m_stateChanged = false; if (QDateTime::currentMSecsSinceEpoch() < effectStartMsecs) - m_state = AesEffectState::inner_enum::EsPrepared; + m_state = AesEffectState::EsPrepared; else if (QDateTime::currentMSecsSinceEpoch() >= effectStartMsecs && QDateTime::currentMSecsSinceEpoch() < durationEndMsecs) - m_state = AesEffectState::inner_enum::EsActivated; + m_state = AesEffectState::EsActivated; else // expired - m_state = AesEffectState::inner_enum::EsExpired; + m_state = AesEffectState::EsExpired; if (oldState != m_state) m_stateChanged = true; @@ -324,9 +324,9 @@ void ObjectChargeEffect::calculateInitEffectState() void ObjectChargeEffect::startStateTimer() { - switch (m_state.underlying()) + switch (m_state) { - case AesEffectState::inner_enum::EsPrepared: + case AesEffectState::EsPrepared: { qint64 timeToActivatedMsecs = m_data.effectStart.toMSecsSinceEpoch() - QDateTime::currentMSecsSinceEpoch(); @@ -336,7 +336,7 @@ void ObjectChargeEffect::startStateTimer() return; } - case AesEffectState::inner_enum::EsActivated: + case AesEffectState::EsActivated: { qint64 timeToExpiredMsecs = m_data.effectStart.toMSecsSinceEpoch() + m_data.effectDuration - QDateTime::currentMSecsSinceEpoch(); @@ -346,7 +346,7 @@ void ObjectChargeEffect::startStateTimer() return; } - case AesEffectState::inner_enum::EsExpired: + case AesEffectState::EsExpired: { qint64 timeToFinishMsecs = m_data.effectStart.toMSecsSinceEpoch() + m_data.effectDuration + s_afterglowMsecs - QDateTime::currentMSecsSinceEpoch(); @@ -356,11 +356,11 @@ void ObjectChargeEffect::startStateTimer() return; } - case AesEffectState::inner_enum::EsUnknown: - case AesEffectState::inner_enum::EsError: - case AesEffectState::inner_enum::EsRemoved: - case AesEffectState::inner_enum::EsCreated: - case AesEffectState::inner_enum::EsPaused: + case AesEffectState::EsUnknown: + case AesEffectState::EsError: + case AesEffectState::EsRemoved: + case AesEffectState::EsCreated: + case AesEffectState::EsPaused: default: return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.cpp index 54929e207..4d89ecd0a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.cpp @@ -72,7 +72,7 @@ Core::FunctionReplyObject ObjectDangerArea::createObject(const Database::AesDang Database::AesDangerSegment segment; segment.id = 0; segment.dangerAreaId = m_data.privDangerAreaId; // db - segment.position = QPointF(segmentDds.lon(), segmentDds.lat()); + segment.position = QPointF(segmentDds.lon, segmentDds.lat); // will update segment.id if (!m_mainHandler->db()->insert(segment)) return Core::FunctionReplyObject(getRightId(m_data.id, originOc), tr_lts("dds", "Error inserting AesDangerSegment-data into database.")); @@ -128,7 +128,7 @@ Core::FunctionReplyObject ObjectDangerArea::updateObject(const Database::AesDang tmpSegments.resize(newSegmentSize); // if count is decreased for (size_t i = 0; i < segments.size(); ++i) - tmpSegments[i].position = QPointF(segments[i].lon(), segments[i].lat()); + tmpSegments[i].position = QPointF(segments[i].lon, segments[i].lat); for (const Database::AesDangerSegment &segment : qAsConst(tmpSegments)) { @@ -174,7 +174,7 @@ void ObjectDangerArea::onPublishData() m_data.properties.toStdString(), {}, toOptional(m_data.associatedAesId)); - dbSegment2DdsSegment(m_segments, ddsData.segments()); + dbSegment2DdsSegment(m_segments, ddsData.segments); m_mainHandler->dds()->dts()->publish(ddsData); publishAiv(); @@ -191,30 +191,30 @@ void ObjectDangerArea::publishAiv() poly[i] = m_segments.at(i).position; AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); const QRectF bounds(poly.boundingRect()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtDangerArea); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtDangerArea); - aiv.partyId(0); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtDangerArea; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtDangerArea); + aiv.partyId = 0; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); } m_zone = LtsCoordTrans::UtmCoordinate::fromGeographic(poly[0]).zone; - m_utmPoly = utmPolyFromGeoVec(aiv.form(), m_zone); + m_utmPoly = utmPolyFromGeoVec(aiv.form, m_zone); onUpdateCorrelation(); } @@ -224,13 +224,13 @@ QPolygonF ObjectDangerArea::utmPolyFromGeoVec(const std::vectordds()->dts(); dts->removeDangerAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::inner_enum::AtDangerArea); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtDangerArea)); for (int idx : qAsConst(m_correlatedAesItems)) dts->removeDangerAreaCorrelatedAesItemByKey(idForCorrelatedItem(idx)); m_correlatedAesItems.clear(); @@ -285,9 +285,9 @@ void ObjectDangerArea::onUpdateCorrelation() for(int newItem : newItems) { DangerAreaCorrelatedAesItem item; - item.id(idForCorrelatedItem(newItem)); - item.aesItemId(newItem); - item.dangerAreaId(m_data.id); // on dds - correct + item.id = idForCorrelatedItem(newItem); + item.aesItemId = newItem; + item.dangerAreaId = m_data.id; // on dds - correct m_mainHandler->dds()->dts()->publish(item); } @@ -303,30 +303,30 @@ void ObjectDangerArea::onNewAiv(const AesItemView &itemView) // Warning: TypeId not in Key, so don't process multiple AIV per Type! // Todo: Change here if more than BC is needed - if (itemView.aesTypeId() != AesType_def::AtBCContamination) + if (itemView.aesTypeId != AesType::AtBCContamination) return; - if (effectState() != AesEffectState_def::EsActivated || - itemView.effectStateId() != AesEffectState_def::EsActivated) + if (effectState() != AesEffectState::EsActivated || + itemView.effectStateId != AesEffectState::EsActivated) { // If ES of this DA or the Contamination changed from(!) Activated to Whatever, kill the correlation - m_mainHandler->dds()->dts()->removeDangerAreaCorrelatedAesItemByKey(idForCorrelatedItem(itemView.aesItemId())); + m_mainHandler->dds()->dts()->removeDangerAreaCorrelatedAesItemByKey(idForCorrelatedItem(itemView.aesItemId)); return; } - DEBUG_LOG(m_logger) << "New Aiv iof Type BC Contamination: " << itemView.aesItemId(); - QPolygonF utmPolyBc = utmPolyFromGeoVec(itemView.form(), m_zone); + DEBUG_LOG(m_logger) << "New Aiv iof Type BC Contamination: " << itemView.aesItemId; + QPolygonF utmPolyBc = utmPolyFromGeoVec(itemView.form, m_zone); if (!intersects(m_utmPoly, utmPolyBc)) return; DEBUG_LOG(m_logger) << "intersects with Danger Area:" << m_data.id; DangerAreaCorrelatedAesItem item; - item.id(idForCorrelatedItem(itemView.aesItemId())); - item.aesItemId(itemView.aesItemId()); - item.dangerAreaId(m_data.id); + item.id = idForCorrelatedItem(itemView.aesItemId); + item.aesItemId = itemView.aesItemId; + item.dangerAreaId = m_data.id; m_mainHandler->dds()->dts()->publish(item); - m_correlatedAesItems += itemView.aesItemId(); + m_correlatedAesItems += itemView.aesItemId; } void ObjectDangerArea::onRemoveAiv(int32_t aesItemId) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.h index 2e1816613..725b3144d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_danger_area.h @@ -33,7 +33,7 @@ public: QVector segments() const { return m_segments; } - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtDangerArea; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.cpp index fe9a588f3..1477fe688 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.cpp @@ -34,7 +34,7 @@ #include // ToDo: mark the end of aes enum and update following (check Endemarke) -static_assert((int)AreaEffectSimulation::AesType_def::AtEffectClusterGunToTargetLine < 100, "id may overlap at runtime"); +static_assert((int)AreaEffectSimulation::AesType::AtEffectClusterGunToTargetLine < 100, "id may overlap at runtime"); using DetonationLocationRequest = CentralEffectSimulation::DetonationLocationRequest; using DetonationLocationReply = CentralEffectSimulation::DetonationLocationReply; @@ -55,25 +55,25 @@ inline std::vector toEffectorVec(const QList for (const auto &effectorData : effectorDataVec) { AreaEffectSimulation::EffectorData data; - data.angleOfFall() = effectorData.angleOfFall; - data.chargeAmount() = effectorData.chargeAmount; - data.chargeStruct().chargeTypeId() = effectorData.chargeTypeId; - data.flightTime() = effectorData.flightTime; - data.chargeStruct().igniterTypeId() = effectorData.igniterTypeId; - data.chargeStruct().igniterFunctionId() = effectorData.igniterFunctionId; - data.interval() = effectorData.interval; - data.mhpPosition().lat() = effectorData.mhpPosition.y(); - data.mhpPosition().lon() = effectorData.mhpPosition.x(); - data.mhpPosition().z() = effectorData.mhpPosition.z(); - data.mhpRotation() = effectorData.mhpRotation; - data.mhpScatterLenght() = effectorData.mhpScatterLenght; - data.mhpScatterLengthDetonationHeight() = effectorData.mhpScatterLengthDetonationHeight; - data.mhpScatterWidth() = effectorData.mhpScatterWidth; - data.mhpScatterWidthDetonationHeight() = effectorData.mhpScatterWidthDetonationHeight; - data.participantId() = effectorData.participantId; - data.peakHeight() = effectorData.peakHeight; - data.trajectoryRelative() = TrajectoryRelative::fromString(effectorData.trajectory); - data.properties() = effectorData.properties.toStdString(); + data.angleOfFall = effectorData.angleOfFall; + data.chargeAmount = effectorData.chargeAmount; + data.chargeStruct.chargeTypeId = effectorData.chargeTypeId; + data.flightTime = effectorData.flightTime; + data.chargeStruct.igniterTypeId = effectorData.igniterTypeId; + data.chargeStruct.igniterFunctionId = effectorData.igniterFunctionId; + data.interval = effectorData.interval; + data.mhpPosition.lat = effectorData.mhpPosition.y(); + data.mhpPosition.lon = effectorData.mhpPosition.x(); + data.mhpPosition.z = effectorData.mhpPosition.z(); + data.mhpRotation = effectorData.mhpRotation; + data.mhpScatterLenght = effectorData.mhpScatterLenght; + data.mhpScatterLengthDetonationHeight = effectorData.mhpScatterLengthDetonationHeight; + data.mhpScatterWidth = effectorData.mhpScatterWidth; + data.mhpScatterWidthDetonationHeight = effectorData.mhpScatterWidthDetonationHeight; + data.participantId = effectorData.participantId; + data.peakHeight = effectorData.peakHeight; + data.trajectoryRelative = TrajectoryRelative::fromString(effectorData.trajectory); + data.properties = effectorData.properties.toStdString(); ret.push_back(data); } return ret; @@ -143,7 +143,7 @@ Core::FunctionReplyObject ObjectEffectCluster::createObject(const Database::AesE // NASAT: AirSupport -> no claim required const bool bDoClaimPlannedCharge = (data.id == 0) && (data.externalId <= 0) && data.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER && data.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE - && (m_mainHandler->gearClassOfChargeTypeId(data.chargeTypeId) != ProjectDataManagement::GearClass_def::AirSupport); + && (m_mainHandler->gearClassOfChargeTypeId(data.chargeTypeId) != ProjectDataManagement::GearClass::GearClass_AirSupport); if (bDoClaimPlannedCharge) // new, not read from db ret = m_mainHandler->chargeAdministrationHandler()->claimPlannedCharge(data.chargeTypeId, data.partyId, data.impactCount); @@ -278,7 +278,7 @@ Core::FunctionReplyObject ObjectEffectCluster::createObject(const Database::AesE QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties.toStdString())).object(); FiringType firingType = FiringType::ReportReadyToFire; if (probObject.contains(AdlerJson::JsonKeys::ABFEUERUNGSART())) - firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); + firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); if (data.effectSourceId == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE && data.effectStateId != AesEffectState::EsExpired && data.effectStateId != AesEffectState::EsRemoved && firingType != FiringType::FireOnCommand) @@ -294,7 +294,7 @@ Core::FunctionReplyObject ObjectEffectCluster::createObject(const Database::AesE cadence = m_mainHandler->dds()->pdmDtc()->cadence(gearTypeIds.at(0)); DEBUG_LOG(m_logger) << "Fire Automaton cadence: " << cadence; - switch (firingType.underlying()) + switch (firingType) { case FiringType::FireNow: case FiringType::FireWithIndicationTOT: @@ -370,7 +370,7 @@ Core::FunctionReplyObject ObjectEffectCluster::updateObject(const Database::AesE const QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties.toStdString())).object(); FiringType firingType = FiringType::FireNow; if (probObject.contains(AdlerJson::JsonKeys::ABFEUERUNGSART())) - firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); + firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); // only allow some fields Database::AesEffectCluster tmpData(m_data); tmpData.id = std::abs(data.id); @@ -528,7 +528,7 @@ Core::FunctionReplyObject ObjectEffectCluster::updateObject(const Database::AesE setEffectors(newEffectorData); if (data.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER && data.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE - && (data.externalId <= 0) && m_mainHandler->gearClassOfChargeTypeId(m_data.chargeTypeId) != ProjectDataManagement::GearClass_def::AirSupport) // internal + && (data.externalId <= 0) && m_mainHandler->gearClassOfChargeTypeId(m_data.chargeTypeId) != ProjectDataManagement::GearClass::GearClass_AirSupport) // internal { // this is for party change or charge type change if (data.partyId != m_data.partyId || data.chargeTypeId != m_data.chargeTypeId) @@ -555,8 +555,8 @@ Core::FunctionReplyObject ObjectEffectCluster::updateObject(const Database::AesE } // reset some data: - m_aiv2.form().clear(); // enforce recalculation - m_effects.singleEffects().clear(); + m_aiv2.form.clear(); // enforce recalculation + m_effects.singleEffects.clear(); m_aivGunToTargetTrajectoryMap.clear(); // enforce recalculation m_temporaryData.reset(); // estimatedMaxFlightDurationMSec, mhPoints, mhWidth... @@ -667,7 +667,7 @@ bool ObjectEffectCluster::initialCalculations(QString *reasonOut) QVector mtps_asUtm; - if (m_data.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) + if (m_data.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial) mtps_asUtm = explosionClusterRadialToMtps(areaBlWithTla, m_data.mhpCountRequest, firingOriginUtm, centerUtm, &singleWidthOut, &singleHeightOut); else mtps_asUtm = explosionClusterAreaToMtps(areaBlWithTla, m_data.mhpCountRequest, &singleWidthOut, &singleHeightOut); @@ -733,10 +733,10 @@ bool ObjectEffectCluster::initialCalculations(QString *reasonOut) // ... and retrieve the duration: const TracjectoryData &tdRefGTL = m_trajectoryCont[-1]; const TrajectoryTimeAware &trajTimeAwareGTL = tdRefGTL.trajectoryTimeAware; - const Core::GeoPositionRelativeTime &geoPosRelTimeRef = trajTimeAwareGTL.geometry().back(); + const Core::GeoPositionRelativeTime &geoPosRelTimeRef = trajTimeAwareGTL.geometry.back(); - m_temporaryData.calculatedFlightDurationMsec = geoPosRelTimeRef.relativeTime(); - m_temporaryData.estimatedMaxFlightDurationMSec = (geoPosRelTimeRef.relativeTime() * 1.1) + 5 * 1000; // ( *1.1) + (10 *1000) + m_temporaryData.calculatedFlightDurationMsec = geoPosRelTimeRef.relativeTime; + m_temporaryData.estimatedMaxFlightDurationMSec = (geoPosRelTimeRef.relativeTime * 1.1) + 5 * 1000; // ( *1.1) + (10 *1000) m_temporaryData.calculatedFiringSpeed = TrajectoryGeneratorVulcano::defaultv0(); m_temporaryData.calculatedPeakHeightAbs = tdRefGTL.peakHeightAbs; @@ -819,11 +819,11 @@ Core::FunctionReplyObject ObjectEffectCluster::checkObjectData(const Database::A using geoType = AreaEffectSimulation::AesExplosionGeometry_def; const geoType::type curExGeoType = data.explosionGeometryId.underlying(); - static const QVector ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint, // 0 -> default - AreaEffectSimulation::AesExplosionGeometry_def::EgPoint, - AreaEffectSimulation::AesExplosionGeometry_def::EgArea, - AreaEffectSimulation::AesExplosionGeometry_def::EgRadial, - AreaEffectSimulation::AesExplosionGeometry_def::EgLine}; + static const QVector ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry::EgAimPoint, // 0 -> default + AreaEffectSimulation::AesExplosionGeometry::EgPoint, + AreaEffectSimulation::AesExplosionGeometry::EgArea, + AreaEffectSimulation::AesExplosionGeometry::EgRadial, + AreaEffectSimulation::AesExplosionGeometry::EgLine}; QString reason; @@ -863,7 +863,7 @@ bool ObjectEffectCluster::removeObjectFromDb() { return m_mainHandler->db()->rem Core::FunctionReplyObject ObjectEffectCluster::resumePause(const EffectClusterPauseResumeRequest &req) { Core::FunctionReplyObject ret; - if (req.resumeExecution()) + if (req.resumeExecution) { m_data.effectStart = partitionTime(); // resume @@ -896,14 +896,14 @@ Core::FunctionReplyObject ObjectEffectCluster::targetPositionsModify(const Targe const qint64 now = partitionTimeMSec(); const qint64 remainingMsec = m_data.effectStart.toMSecsSinceEpoch() - now; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " START" - << " TargetPositionsModifyRequest = " << req << ", s_counter = " << s_counter++ << ", current state = " << m_data.effectStateId.underlying() + << " TargetPositionsModifyRequest = " << req << ", s_counter = " << s_counter++ << ", current state = " << m_data.effectStateId << ", now = " << now << ", effectStart = " << m_data.effectStart.toMSecsSinceEpoch() << ", remainingMsec = " << remainingMsec; - const std::vector &positions = req.positions(); + const std::vector &positions = req.positions; Core::FunctionReplyObject ret; - if (m_data.effectStateId.underlying() == AreaEffectSimulation::AesEffectState_def::EsExpired) + if (m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired) { ret = Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error modifying explosion cluster with id %1 since object is already expired")).arg(m_data.id); ERROR_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " Error: " << ret.str(); @@ -937,11 +937,11 @@ Core::FunctionReplyObject ObjectEffectCluster::targetPositionsModify(const Targe return ret; } - const Core::GeoPosition &newTargetPos = req.positions().front(); + const Core::GeoPosition &newTargetPos = req.positions.front(); const int explosionIndex = 0; TracjectoryData &tdRef = m_trajectoryCont[explosionIndex]; TrajectoryTimeAware &trajTimeAwareRef = tdRef.trajectoryTimeAware; - std::vector &trajectoryTimeAwareGeometry = trajTimeAwareRef.geometry(); + std::vector &trajectoryTimeAwareGeometry = trajTimeAwareRef.geometry; if (trajectoryTimeAwareGeometry.empty()) { @@ -956,17 +956,17 @@ Core::FunctionReplyObject ObjectEffectCluster::targetPositionsModify(const Targe // m_aiv2 CHANGES HERE // - std::vector &formRef = m_aiv2.form(); + std::vector &formRef = m_aiv2.form; // compare former and updated ImpactPos: context targetModify if (m_logger.isDebugEnabled()) { Core::GeoPosition &curImpactPosRef = formRef[explosionIndex]; - LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon(), curImpactPosRef.lat()); - const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z()); + LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon, curImpactPosRef.lat); + const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z); - LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(newTargetPos.lon(), newTargetPos.lat(), utm1.zone); - const QVector3D u2Vec(utm2.x, utm2.y, newTargetPos.z()); + LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(newTargetPos.lon, newTargetPos.lat, utm1.zone); + const QVector3D u2Vec(utm2.x, utm2.y, newTargetPos.z); const QVector3D diff = u2Vec - u1Vec; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " for explosionIndex " << explosionIndex << ", curImpactPosRef " << curImpactPosRef << ", utm1 " << utm1 @@ -978,10 +978,10 @@ Core::FunctionReplyObject ObjectEffectCluster::targetPositionsModify(const Targe curImpactPosRef = newTargetPos; // Effects: - std::vector &singleEffectsRef = m_effects.singleEffects(); + std::vector &singleEffectsRef = m_effects.singleEffects; SingleEffect &ref = singleEffectsRef[explosionIndex]; - ref.position(newTargetPos); - ref.zPlacement(AesZPlacement_def::ZpAbsolute); // intersection: change from draped to absolute + ref.position = newTargetPos; + ref.zPlacement = AesZPlacement::ZpAbsolute; // intersection: change from draped to absolute // Trajectory publishTrajectory(explosionIndex); @@ -1028,7 +1028,7 @@ Core::FunctionReplyObject ObjectEffectCluster::checkPreConditionsComplete() } // if (m_data.externalId <= 0) // keep start of svc in mind: - if (m_data.effectStateId.underlying() != AreaEffectSimulation::AesEffectState_def::EsExpired) + if (m_data.effectStateId != AreaEffectSimulation::AesEffectState::EsExpired) ret = checkPreConditions(); if (ret.error()) @@ -1113,14 +1113,14 @@ void ObjectEffectCluster::onPublishData() // dds::core::optional(), // dds::core::optional(), m_data.esmParticipantIds(), - static_cast(m_data.effectorState), + static_cast(m_data.effectorState), m_temporaryData.annotationString); // publish only on real changes: if (m_EffectCluster != ddsData) { m_EffectCluster = ddsData; - ddsData.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + ddsData.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store m_mainHandler->dds()->dts()->publish(ddsData); } @@ -1136,14 +1136,14 @@ void ObjectEffectCluster::onDetonationLocationReply(const DetonationLocationRepl // int32_t explosionIndex, // explosionIndex // const Core::GeoPosition& position); - if (reply.id() != m_data.id) // aesItemId + if (reply.id != m_data.id) // aesItemId { - DEBUG_LOG(m_logger) << "ID mismatch: " << reply.id() << " != " << m_data.id; + DEBUG_LOG(m_logger) << "ID mismatch: " << reply.id << " != " << m_data.id; return; } // do we have the initial geometry? - const int explosionIndex = reply.index(); + const int explosionIndex = reply.index; if (!m_trajectoryCont.contains(explosionIndex)) { DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << "unknown explosionIndex " @@ -1151,8 +1151,8 @@ void ObjectEffectCluster::onDetonationLocationReply(const DetonationLocationRepl return; } - const Core::GeoPosition &replyPos = reply.position(); - if ((replyPos.lon() < 0.00001) || (replyPos.lat() < 0.00001)) + const Core::GeoPosition &replyPos = reply.position; + if ((replyPos.lon < 0.00001) || (replyPos.lat < 0.00001)) { // no intersection DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " got DetonationLocationReply" @@ -1165,7 +1165,7 @@ void ObjectEffectCluster::onDetonationLocationReply(const DetonationLocationRepl << " : INTERSECTION - reply.position is: " << ", reply.index() = " << explosionIndex << ", reply.position() " << replyPos; - adjustTrajectoryToDetonationLocation(explosionIndex, replyPos, reply.buildingId()); + adjustTrajectoryToDetonationLocation(explosionIndex, replyPos, reply.buildingId); } // publish new triggered explosions data here @@ -1176,7 +1176,7 @@ void ObjectEffectCluster::onDetonationLocationReply(const DetonationLocationRepl DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " Publishing AesItemView (AtEffectClusterSingleExplosions) for TriggeredExplosions, explosionIndex " << explosionIndex; - m_aiv2.sampleTime(partitionTimeMSec()); + m_aiv2.sampleTime = partitionTimeMSec(); // // m_mainHandler->dds()->dts()->publish(m_aiv2); // does anyone needs this topic??? m_aiv2HasChanged = false; emit newAiv(m_aiv2); @@ -1222,12 +1222,12 @@ void ObjectEffectCluster::adjustTrajectoryToDetonationLocation(int explosionInde } const Core::GeoPosition &trajFront = trajectoryGeometry.front(); - const double distToOriginSquared = LtsCoordTrans::squareDistance(trajFront.lon(), trajFront.lat(), intersectionLocation.lon(), intersectionLocation.lat()); + const double distToOriginSquared = LtsCoordTrans::squareDistance(trajFront.lon, trajFront.lat, intersectionLocation.lon, intersectionLocation.lat); ProjectDataManagement::IgniterFunctionBase ignFunctionBase - = m_mainHandler->dds()->pdmDtc()->getChargeTypeIgniterTypeIgniterFunction(m_data.chargeTypeId, 0, 0).igniterFunctionBaseId(); + = m_mainHandler->dds()->pdmDtc()->getChargeTypeIgniterTypeIgniterFunction(m_data.chargeTypeId, 0, 0).igniterFunctionBaseId; if ((ignFunctionBase == ProjectDataManagement::IgniterFunctionBase::IfbProximity) || (ignFunctionBase == ProjectDataManagement::IgniterFunctionBase::IfbImpact)) { - const double distTrajectorySquared = LtsCoordTrans::squareDistance(trajFront.lon(), trajFront.lat(), trajBack.lon(), trajBack.lat()); + const double distTrajectorySquared = LtsCoordTrans::squareDistance(trajFront.lon, trajFront.lat, trajBack.lon, trajBack.lat); if (distToOriginSquared > distTrajectorySquared) { ERROR_LOG(m_logger) << "adjustTrajectoryToDetonationLocation " << m_data.id << "Detonation location is outside of trajectory for ID: " << m_data.id @@ -1244,7 +1244,7 @@ void ObjectEffectCluster::adjustTrajectoryToDetonationLocation(int explosionInde { const Core::GeoPosition &curItem_geo = trajectoryGeometry[i - 1]; - const double distStartSegmentSquared = LtsCoordTrans::squareDistance(curItem_geo.lon(), curItem_geo.lat(), trajectoryOrigin_geo.lon(), trajectoryOrigin_geo.lat()); + const double distStartSegmentSquared = LtsCoordTrans::squareDistance(curItem_geo.lon, curItem_geo.lat, trajectoryOrigin_geo.lon, trajectoryOrigin_geo.lat); // remove... if (distStartSegmentSquared > distToOriginSquared) { @@ -1265,17 +1265,17 @@ void ObjectEffectCluster::adjustTrajectoryToDetonationLocation(int explosionInde // // m_aiv2 CHANGES HERE // - std::vector &formRef = m_aiv2.form(); + std::vector &formRef = m_aiv2.form; Core::GeoPosition &curImpactPosRef = formRef[explosionIndex]; // compare former and updated ImpactPos: context intersection if (m_logger.isDebugEnabled()) { - LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon(), curImpactPosRef.lat()); - const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z()); + LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon, curImpactPosRef.lat); + const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z); - LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(intersectionLocation.lon(), intersectionLocation.lat(), utm1.zone); - const QVector3D u2Vec(utm2.x, utm2.y, intersectionLocation.z()); + LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(intersectionLocation.lon, intersectionLocation.lat, utm1.zone); + const QVector3D u2Vec(utm2.x, utm2.y, intersectionLocation.z); const QVector3D diff = u2Vec - u1Vec; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " for explosionIndex " << explosionIndex << ", curImpactPosRef " << curImpactPosRef << ", utm1 " << utm1 @@ -1287,11 +1287,11 @@ void ObjectEffectCluster::adjustTrajectoryToDetonationLocation(int explosionInde m_aiv2HasChanged = true; // Effects: - std::vector &singleEffectsRef = m_effects.singleEffects(); + std::vector &singleEffectsRef = m_effects.singleEffects; SingleEffect &ref = singleEffectsRef[explosionIndex]; // ref.effectState(AesSingleEffectState_def::SesScheduled); - ref.position(intersectionLocation); - ref.zPlacement(AesZPlacement_def::ZpAbsolute); // intersection: change from draped to relative + ref.position = intersectionLocation; + ref.zPlacement = AesZPlacement::ZpAbsolute; // intersection: change from draped to relative // m_effectsHaveChanged = true; if (explosionIndex == m_data.impactCount - 1) @@ -1318,7 +1318,7 @@ void ObjectEffectCluster::publishAiv() if (bIsPoint && (m_lastSentTriggeredExplosionNumber == 1)) // 'move' only AFTER impact { // on svcRestart, m_aiv2 may not been set. To avoid crash: - const std::vector &formRef = m_aiv2.form(); + const std::vector &formRef = m_aiv2.form; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " since isPointSimilar==true form has to be updated" << ", m_data.effectStateId = " << m_data.effectStateId << ", m_data.impactWidth = " << m_data.impactWidth << ", m_lastSentTriggeredExplosionNumber = " << m_lastSentTriggeredExplosionNumber << ", formRef.size() = " << formRef.size(); @@ -1330,7 +1330,7 @@ void ObjectEffectCluster::publishAiv() else { const Core::GeoPosition &impactPosition_geo3D = formRef[0]; - centerGeo = QPointF(impactPosition_geo3D.lon(), impactPosition_geo3D.lat()); + centerGeo = QPointF(impactPosition_geo3D.lon, impactPosition_geo3D.lat); } // ... and now take zog into account: double radius = m_data.impactWidth / 2.0; @@ -1347,22 +1347,22 @@ void ObjectEffectCluster::publishAiv() // Major // AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct({m_data.chargeTypeId, 0, 0}); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.topLeft().x(), bounds.topLeft().y())); // QRectF's bigger values are at bottom - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.bottomRight().x(), bounds.bottomRight().y())); - aiv.aesTypeId(AesType::AtEffectCluster); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtEffectCluster); + aiv.aesItemId = m_data.id; + aiv.chargeStruct = {m_data.chargeTypeId, 0, 0}; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.topLeft().x(), bounds.topLeft().y()); // QRectF's bigger values are at bottom + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.bottomRight().x(), bounds.bottomRight().y()); + aiv.aesTypeId = AesType::AtEffectCluster; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtEffectCluster); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; // ObjectBaseTmpl::checkIsCentral honors pdm->isLaserGuidable // and therefore isCentral is set to true; ) - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); // // SingleExplosions @@ -1370,33 +1370,33 @@ void ObjectEffectCluster::publishAiv() { AesItemView aiv2(m_aiv2); - aiv2.aesItemId(m_data.id); - aiv2.chargeStruct({m_data.chargeTypeId, 0, 0}); - aiv2.effectStart(toMSec(m_data.effectStart)); + aiv2.aesItemId = m_data.id; + aiv2.chargeStruct = {m_data.chargeTypeId, 0, 0}; + aiv2.effectStart = toMSec(m_data.effectStart); // calculate just one time. // maybe intersections of trajectories with building will 'adjust' some impact positions later. - if (aiv2.form().empty()) + if (aiv2.form.empty()) { if (isVulcano() || (m_data.externalId > 0)) // m_data.externalId > 0 -> HLA / SingleFire / PointGeometry { const QPointF &impactPointGeo = AreaEffectSimulation::Polygons::bottomLeft2CenterPoint(m_data.impactPosition, m_data.impactWidth, m_data.impactLength, m_data.rotationAngle); - ddsVecFromPoly(QVector() << impactPointGeo, aiv2.form()); + ddsVecFromPoly(QVector() << impactPointGeo, aiv2.form); } else { const QVector &singleExplosions = Polygons::effectClusterSingleExplosionsGAUSS_Mtp(m_data, m_effectorData); - ddsVecFromPoly(singleExplosions, aiv2.form()); + ddsVecFromPoly(singleExplosions, aiv2.form); } } - aiv2.boundingBoxBottomLeft(aiv.boundingBoxBottomLeft()); - aiv2.boundingBoxTopRight(aiv.boundingBoxTopRight()); - aiv2.aesTypeId(AesType::AtEffectClusterSingleExplosions); - aiv2.id(1000 * m_data.id + AesType::AtEffectClusterSingleExplosions); - aiv2.effectStateId(effectState()); + aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft; + aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight; + aiv2.aesTypeId = AesType::AtEffectClusterSingleExplosions; + aiv2.id = 1000 * m_data.id + static_cast(AesType::AtEffectClusterSingleExplosions); + aiv2.effectStateId = effectState(); if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; // // m_aiv2 CHANGES HERE @@ -1410,25 +1410,25 @@ void ObjectEffectCluster::publishAiv() // emit newAiv(aiv2); // } - m_effects.id(1000 * m_data.id + AesType::AtEffectClusterSingleExplosions); - m_effects.aesItemId(m_data.id); - m_effects.aesTypeId(AesType::AtEffectClusterSingleExplosions); - std::vector &singleEffectsRef = m_effects.singleEffects(); + m_effects.id = 1000 * m_data.id + static_cast(AesType::AtEffectClusterSingleExplosions); + m_effects.aesItemId = m_data.id; + m_effects.aesTypeId = AesType::AtEffectClusterSingleExplosions; + std::vector &singleEffectsRef = m_effects.singleEffects; if (singleEffectsRef.empty()) { if (isVulcano() || (m_data.externalId > 0)) // m_data.externalId > 0 -> HLA / SingleFire / PointGeometry { singleEffectsRef.resize(1); SingleEffect &seRef = singleEffectsRef.front(); - seRef.singleEffectState(AesSingleEffectState_def::SesScheduled); + seRef.singleEffectState = AesSingleEffectState::SesScheduled; const QPointF &impactPointGeo = AreaEffectSimulation::Polygons::bottomLeft2CenterPoint(m_data.impactPosition, m_data.impactWidth, m_data.impactLength, m_data.rotationAngle); // seRef.position(Core::GeoPosition(impactPointGeo.x(), impactPointGeo.y(), 0.0)); const double elevation = getElevationFor(impactPointGeo, QStringLiteral("getElevationForSingleImpactVulcano")); - seRef.position(Core::GeoPosition(impactPointGeo.x(), impactPointGeo.y(), elevation)); + seRef.position = Core::GeoPosition(impactPointGeo.x(), impactPointGeo.y(), elevation); - seRef.zPlacement(AesZPlacement_def::ZpDraped); + seRef.zPlacement = AesZPlacement::ZpDraped; } else { @@ -1438,13 +1438,13 @@ void ObjectEffectCluster::publishAiv() for (const QPointF &singleExplosion : qAsConst(singleExplosions)) { SingleEffect se; - se.singleEffectState(AesSingleEffectState_def::SesScheduled); + se.singleEffectState = AesSingleEffectState::SesScheduled; // se.position(Core::GeoPosition(singleExplosion.x(), singleExplosion.y(), 0.0)); const double elevation = getElevationFor(singleExplosion, QStringLiteral("getElevationForSingleEffect")); - se.position(Core::GeoPosition(singleExplosion.x(), singleExplosion.y(), elevation)); + se.position = Core::GeoPosition(singleExplosion.x(), singleExplosion.y(), elevation); - se.zPlacement(AesZPlacement_def::ZpDraped); + se.zPlacement = AesZPlacement::ZpDraped; // // se.effectTime(); singleEffectsRef.push_back(se); } // for @@ -1478,26 +1478,26 @@ void ObjectEffectCluster::publishAiv() // AtEffectClusterGunToTargetLine is suppressed at map display, when main object changes to EsActivated // So it does not have to be changed/published anymore. // Especially helpful while restarting scvAes! - static QVector relevantEffStates = {AesEffectState_def::EsReceived, - AesEffectState_def::EsCreated, - AesEffectState_def::EsPrepared, - AesEffectState_def::EsFired, - AesEffectState_def::EsActivated, // Jira [LS-647] gefordert dauerhaft sichtbar - AesEffectState_def::EsExpired}; // Jira [LS-647] gefordert dauerhaft sichtbar + static QVector relevantEffStates = {AesEffectState::EsReceived, + AesEffectState::EsCreated, + AesEffectState::EsPrepared, + AesEffectState::EsFired, + AesEffectState::EsActivated, // Jira [LS-647] gefordert dauerhaft sichtbar + AesEffectState::EsExpired}; // Jira [LS-647] gefordert dauerhaft sichtbar - DEBUG_LOG(m_logger) << " AtEffectClusterGunToTargetLine RELEVANT " << relevantEffStates.contains(effectState().underlying()) << ", id " << m_data.id; + DEBUG_LOG(m_logger) << " AtEffectClusterGunToTargetLine RELEVANT " << relevantEffStates.contains(effectState()) << ", id " << m_data.id; for (const auto &effector : m_effectorData) { if (isOriginatorParticipantIdProvided() && // no Originator -> no curve - relevantEffStates.contains(effectState().underlying())) + relevantEffStates.contains(effectState())) { AesItemView aiv3(m_aivGunToTargetTrajectoryMap.value(effector.participantId)); - aiv3.aesItemId(m_data.id); - aiv3.chargeStruct({effector.chargeTypeId, 0, 0}); + aiv3.aesItemId = m_data.id; + aiv3.chargeStruct = {effector.chargeTypeId, 0, 0}; // aiv3.effectStart(0); - if (aiv3.form().empty()) + if (aiv3.form.empty()) { // E01562-294: Falsche Darstellung Flugkurve SMArt const auto &trajectoryRelativeToOriginator = TrajectoryRelative::fromString(effector.trajectory); @@ -1507,27 +1507,27 @@ void ObjectEffectCluster::publishAiv() DEBUG_LOG(m_logger) << "generateGunToTargetForm for id: " << " " << m_data.id << ": there is a step backward in time, reduce input used as GunToTargetLine."; const std::vector &form = ObjectEffectCluster::generateGunToTargetForm(trajectoryRelativeToOriginatorSingleDueToSMArt, effector.participantId); - aiv3.form(form); + aiv3.form = form; if (form.size() > 2) { QPolygonF polyGTL; polyGTL.reserve(2); - polyGTL.push_back(QPointF(form.front().lon(), form.front().lat())); - polyGTL.push_back(QPointF(form.back().lon(), form.back().lat())); + polyGTL.push_back(QPointF(form.front().lon, form.front().lat)); + polyGTL.push_back(QPointF(form.back().lon, form.back().lat)); const QRectF boundsGTL(polyGTL.boundingRect()); - aiv3.boundingBoxBottomLeft(Core::GeoPosition2D(boundsGTL.topLeft().x(), boundsGTL.topLeft().y())); // QRectF's bigger values are at bottom - aiv3.boundingBoxTopRight(Core::GeoPosition2D(boundsGTL.bottomRight().x(), boundsGTL.bottomRight().y())); + aiv3.boundingBoxBottomLeft = Core::GeoPosition2D(boundsGTL.topLeft().x(), boundsGTL.topLeft().y()); // QRectF's bigger values are at bottom + aiv3.boundingBoxTopRight = Core::GeoPosition2D(boundsGTL.bottomRight().x(), boundsGTL.bottomRight().y()); } } - aiv3.aesTypeId(AesType::AtEffectClusterGunToTargetLine); - aiv3.id(1000 * m_data.id * effector.participantId + AesType::AtEffectClusterGunToTargetLine); + aiv3.aesTypeId = AesType::AtEffectClusterGunToTargetLine; + aiv3.id = 1000 * m_data.id * effector.participantId + static_cast(AesType::AtEffectClusterGunToTargetLine); // aiv3.effectStateId(effectState()); if (m_data.partyId != 0) - aiv3.partyId(m_data.partyId); + aiv3.partyId = m_data.partyId; m_aivGunToTargetTrajectoryMap.insert(effector.participantId, aiv3); - aiv3.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + aiv3.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store m_mainHandler->dds()->dts()->publish(aiv3); emit newAiv(aiv3); } @@ -1535,14 +1535,14 @@ void ObjectEffectCluster::publishAiv() { auto dts = m_mainHandler->dds()->dts(); const bool errorMsgIfSampleDoesNotExists = false; - dts->removeAesItemViewByKey(1000 * m_data.id * effector.participantId + AesType::AtEffectClusterGunToTargetLine, errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id * effector.participantId + static_cast(AesType::AtEffectClusterGunToTargetLine), errorMsgIfSampleDoesNotExists); } } if (aiv != m_aiv) { m_aiv = aiv; - aiv.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + aiv.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); } @@ -1551,13 +1551,13 @@ void ObjectEffectCluster::publishAiv() bool ObjectEffectCluster::intersectWithCircle(double lonRad, double latRad, int radius) { LtsCoordTrans::UtmCoordinate bottomLeftUtm - = LtsCoordTrans::UtmCoordinate::fromGeographic(m_EffectCluster.area().cornerBottomLeft().lon(), m_EffectCluster.area().cornerBottomLeft().lat()); + = LtsCoordTrans::UtmCoordinate::fromGeographic(m_EffectCluster.area.cornerBottomLeft.lon, m_EffectCluster.area.cornerBottomLeft.lat); LtsCoordTrans::UtmCoordinate circleCenterUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(lonRad, latRad, bottomLeftUtm.zone); const double xMin = bottomLeftUtm.x; const double yMin = bottomLeftUtm.y; - const double xMax = bottomLeftUtm.x + m_EffectCluster.area().width(); - const double yMax = bottomLeftUtm.y + m_EffectCluster.area().height(); + const double xMax = bottomLeftUtm.x + m_EffectCluster.area.width; + const double yMax = bottomLeftUtm.y + m_EffectCluster.area.height; const double farthestX = (std::abs(circleCenterUtm.x - xMin) > std::abs(circleCenterUtm.x - xMax)) ? xMin : xMax; const double farthestY = (std::abs(circleCenterUtm.y - yMin) > std::abs(circleCenterUtm.y - yMax)) ? yMin : yMax; @@ -1639,19 +1639,19 @@ void ObjectEffectCluster::removeTopics() dts->removeEffectClusterByKey(m_data.id, errorMsgIfSampleDoesNotExists); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtEffectCluster, errorMsgIfSampleDoesNotExists); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtEffectClusterSingleExplosions, errorMsgIfSampleDoesNotExists); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtEffectClusterGunToTargetLine, errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtEffectCluster), errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtEffectClusterSingleExplosions), errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtEffectClusterGunToTargetLine), errorMsgIfSampleDoesNotExists); // ti.id(1000 * m_data.id + AesType::AtEffectClusterSingleExplosions); - dts->removeTriggeredImpactsByKey(1000 * m_data.id + AesType::AtEffectClusterSingleExplosions, errorMsgIfSampleDoesNotExists); + dts->removeTriggeredImpactsByKey(1000 * m_data.id + static_cast(AesType::AtEffectClusterSingleExplosions), errorMsgIfSampleDoesNotExists); // up to s_maxTrajectoriesPerEffectCluster are supported. One sample per trajectory. for (int explosionIndex = 0; explosionIndex < AreaEffectSimulation::s_maxTrajectoriesPerExplosionCluster; ++explosionIndex) dts->removeAesItemViewByKey(1000 * m_data.id + 100 + explosionIndex, errorMsgIfSampleDoesNotExists); // Effects / Impacts - dts->removeEffectsByKey(1000 * m_data.id + AesType::AtEffectClusterSingleExplosions, errorMsgIfSampleDoesNotExists); + dts->removeEffectsByKey(1000 * m_data.id + static_cast(AesType::AtEffectClusterSingleExplosions), errorMsgIfSampleDoesNotExists); emit removeAiv(m_data.id); } @@ -1734,8 +1734,8 @@ Core::FunctionReplyObject ObjectEffectCluster::trajectoryAdlerModify(const Traje Core::FunctionReplyObject ret; DEBUG_LOG(m_logger) << "ObjectEffectCluster::TrajectoryAdlerModify"; - DEBUG_LOG(m_logger) << "position vector (geometry) size= " << req.geometry().size(); - DEBUG_LOG(m_logger) << "explosion Index = " << req.explosionIndex(); + DEBUG_LOG(m_logger) << "position vector (geometry) size= " << req.geometry.size(); + DEBUG_LOG(m_logger) << "explosion Index = " << req.explosionIndex; int firstEffector = {std::numeric_limits::max()}; for (const auto &effectorData : m_effectorData) @@ -1744,33 +1744,33 @@ Core::FunctionReplyObject ObjectEffectCluster::trajectoryAdlerModify(const Traje firstEffector = effectorData.id; } // find first effector - auto effectorData = m_effectorData.value(req.explosionIndex()); + auto effectorData = m_effectorData.value(req.explosionIndex); if (effectorData.id) { DEBUG_LOG(m_logger) << "Found Effector for index " << effectorData.participantId; - effectorData.flightTime = req.geometry().at(req.geometry().size() - 1).relativeTime(); - if (req.flightTime() > 0.0) - effectorData.flightTime = req.flightTime(); - if (req.peakAltitude() > 0.0) - effectorData.peakHeight = req.peakAltitude(); + effectorData.flightTime = req.geometry.at(req.geometry.size() - 1).relativeTime; + if (req.flightTime > 0.0) + effectorData.flightTime = req.flightTime; + if (req.peakAltitude > 0.0) + effectorData.peakHeight = req.peakAltitude; - effectorData.trajectory = QString::fromStdString(TrajectoryRelative::toString(req.geometry())); + effectorData.trajectory = QString::fromStdString(TrajectoryRelative::toString(req.geometry)); - if (req.mhpScatterLenght() > 0.0) - effectorData.mhpScatterLenght = req.mhpScatterLenght(); + if (req.mhpScatterLenght > 0.0) + effectorData.mhpScatterLenght = req.mhpScatterLenght; else effectorData.mhpScatterLenght = Settings::getScatterLenghtDefault(); - if (req.mhpScatterLengthDetonationHeight() > 0.0) - effectorData.mhpScatterLengthDetonationHeight = req.mhpScatterLengthDetonationHeight(); + if (req.mhpScatterLengthDetonationHeight > 0.0) + effectorData.mhpScatterLengthDetonationHeight = req.mhpScatterLengthDetonationHeight; - if (req.mhpScatterWidth() > 0.0) - effectorData.mhpScatterWidth = req.mhpScatterWidth(); + if (req.mhpScatterWidth > 0.0) + effectorData.mhpScatterWidth = req.mhpScatterWidth; else effectorData.mhpScatterWidth = Settings::getScatterWidthDefault(); - if (req.mhpScatterWidthDetonationHeight() > 0.0) - effectorData.mhpScatterWidthDetonationHeight = req.mhpScatterWidthDetonationHeight(); + if (req.mhpScatterWidthDetonationHeight > 0.0) + effectorData.mhpScatterWidthDetonationHeight = req.mhpScatterWidthDetonationHeight; m_effectorData.insert(effectorData.participantId, effectorData); @@ -1796,9 +1796,9 @@ Core::FunctionReplyObject ObjectEffectCluster::trajectoryAdlerModify(const Traje onPublishData(); // remove aiv to force new generation on publish auto aiv = m_aivGunToTargetTrajectoryMap.value(effectorData.participantId); - if (aiv.form().size()) + if (aiv.form.size()) { - aiv.form().clear(); + aiv.form.clear(); m_aivGunToTargetTrajectoryMap.insert(effectorData.participantId, aiv); } publishAiv(); @@ -1812,7 +1812,7 @@ Core::FunctionReplyObject ObjectEffectCluster::effectClusterModifyActor(const Ef DEBUG_LOG(m_logger) << LOGFUNCTION << "-----> req: " << req; Core::FunctionReplyObject ret; - m_data.esmParticipantIds = LtsUtils::IntArray(req.esmParticipantIds()); + m_data.esmParticipantIds = LtsUtils::IntArray(req.esmParticipantIds); onPublishData(); return ret; } @@ -1845,7 +1845,7 @@ void ObjectEffectCluster::checkNextFire() // if (m_data.name.startsWith(QStringLiteral("SAAB"))) // return; - if (m_data.effectStateId == AreaEffectSimulation::AesEffectState_def::EsCreated) + if (m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsCreated) { DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " OBJECT IS EsCreated, RETURN;"; return; @@ -1944,7 +1944,7 @@ void ObjectEffectCluster::onEffectorReadyToFire(int participantId, int aesItemId return; } m_readytoFire.insert(participantId); - if (m_readytoFire.size() == m_effectorData.count() && m_data.effectorState == AesEffectorState::EsReadyToFire) + if (m_readytoFire.size() == m_effectorData.count() && m_data.effectorState == static_cast(AesEffectorState::EsReadyToFire)) onSendReadinessToTab(); } @@ -1971,7 +1971,7 @@ void ObjectEffectCluster::onEffectorReportedFired(int participantId, int aesItem FiringType firingType = FiringType::FireNow; if (probObject.contains(AdlerJson::JsonKeys::ABFEUERUNGSART())) - firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); + firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); // We always send the first firedReport regardless of the Firing Type bool firstTime = !m_firstFireSend.contains(participantId); @@ -1984,11 +1984,11 @@ void ObjectEffectCluster::onEffectorReportedFired(int participantId, int aesItem const QString reference = probObject[AdlerJson::JsonKeys::FEUERKAMPFREFERENZ()].toString(); TrainingAreaBase::SendExFiredReportRequest request; - request.reference() = reference.toStdString(); - request.partyId() = m_data.partyId; - request.participantId() = participantId; - request.identifier() = m_mainHandler->dds()->ppmDtc()->participant(participantId).name(); - request.unitIdentifier() = m_mainHandler->dds()->ppmDtc()->participant(m_data.participantId).name(); + request.reference = reference.toStdString(); + request.partyId = m_data.partyId; + request.participantId = participantId; + request.identifier = m_mainHandler->dds()->ppmDtc()->participant(participantId).name; + request.unitIdentifier = m_mainHandler->dds()->ppmDtc()->participant(m_data.participantId).name; m_mainHandler->dds()->tabFtc()->sendExFiredReportRequest(request, this); m_firstFireSend.insert(participantId); } @@ -2149,12 +2149,12 @@ bool ObjectEffectCluster::generateTrajectory(int explosionNumber, bool startDeto else { // take impactPosition from form: - const std::vector &formRef = m_aiv2.form(); + const std::vector &formRef = m_aiv2.form; Q_ASSERT(formRef.size() > 0); Q_ASSERT(explosionIndex >= 0); const Core::GeoPosition &impactPosition_geo3D = formRef[explosionIndex]; - endPosition_geo2D = QPointF(impactPosition_geo3D.lon(), impactPosition_geo3D.lat()); + endPosition_geo2D = QPointF(impactPosition_geo3D.lon, impactPosition_geo3D.lat); DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " *** generateTrajectory to: explosionIndex=" << explosionIndex << ", endPosition_geo2D = " << endPosition_geo2D; } @@ -2344,8 +2344,8 @@ bool ObjectEffectCluster::generateTrajectory(int explosionNumber, bool startDeto else { DetonationLocationReply reply; - reply.id(m_data.id); - reply.index(explosionIndex); + reply.id = m_data.id; + reply.index = explosionIndex; // reply.position(); // leave on default :-) onDetonationLocationReply(reply); } @@ -2442,7 +2442,7 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber, alphaRad, tapTime, options, - tdRef.trajectoryTimeAware.geometry(), + tdRef.trajectoryTimeAware.geometry, idealTapAbsoluteGeoOut, &localReasonOut); if (!localReasonOut.isEmpty()) @@ -2468,7 +2468,7 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber, if (m_data.cloudBase > std::numeric_limits::min()) { // get access to point tapT: - std::vector &geometryRef = tdRef.trajectoryTimeAware.geometry(); + std::vector &geometryRef = tdRef.trajectoryTimeAware.geometry; std::vector::reverse_iterator rit = geometryRef.rbegin(); const Core::GeoPositionRelativeTime impact = *rit; @@ -2476,7 +2476,7 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber, ++rit; const Core::GeoPositionRelativeTime tapT = *rit; - const bool bTapT_strichRequested = (m_data.cloudBase < tapT.z()) && (impact.z() < m_data.cloudBase); + const bool bTapT_strichRequested = (m_data.cloudBase < tapT.z) && (impact.z < m_data.cloudBase); DEBUG_LOG(m_logger) << " XXX cloudBase modification: " << ", tapT = " << tapT << ", m_data.cloudBase = " << m_data.cloudBase << ", impact = " << impact @@ -2484,11 +2484,11 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber, if (bTapT_strichRequested) { - const LtsCoordTrans::UtmCoordinate impactUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(impact.lon(), impact.lat()); - const LtsCoordTrans::UtmCoordinate tapTUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(tapT.lon(), tapT.lat(), impactUtm.zone); + const LtsCoordTrans::UtmCoordinate impactUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(impact.lon, impact.lat); + const LtsCoordTrans::UtmCoordinate tapTUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(tapT.lon, tapT.lat, impactUtm.zone); - const QVector3D impactVec3D(impactUtm.x, impactUtm.y, impact.z()); - const QVector3D tapTVec3D(tapTUtm.x, tapTUtm.y, tapT.z()); + const QVector3D impactVec3D(impactUtm.x, impactUtm.y, impact.z); + const QVector3D tapTVec3D(tapTUtm.x, tapTUtm.y, tapT.z); /* x | Tap (aka TapT) // \ | @@ -2526,14 +2526,14 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber, const QPointF &tapT_strichGeo = tapT_strichUtm.geographic(); // Time - double timeOffset = impact.relativeTime() - tapT.relativeTime(); + double timeOffset = impact.relativeTime - tapT.relativeTime; timeOffset *= scaleFactor; Core::GeoPositionRelativeTime tapT_strichRelTime; - tapT_strichRelTime.lon() = tapT_strichGeo.x(); - tapT_strichRelTime.lat() = tapT_strichGeo.y(); - tapT_strichRelTime.z() = tapT_strich.z(); - tapT_strichRelTime.relativeTime(impact.relativeTime() - timeOffset); + tapT_strichRelTime.lon = tapT_strichGeo.x(); + tapT_strichRelTime.lat = tapT_strichGeo.y(); + tapT_strichRelTime.z = tapT_strich.z(); + tapT_strichRelTime.relativeTime = impact.relativeTime - timeOffset; DEBUG_LOG(m_logger) << " tapT_strichRelTime " << tapT_strichRelTime; @@ -2547,7 +2547,7 @@ bool ObjectEffectCluster::generateTrajectoryVulcanoSpecific(int explosionNumber, // "convert" from time-aware curve 'back' to time-unaware trajectoryGeometry tdRef.trajectoryGeometry.clear(); - for (const Core::GeoPositionRelativeTime &geoPosRelTime : qAsConst(tdRef.trajectoryTimeAware.geometry())) + for (const Core::GeoPositionRelativeTime &geoPosRelTime : qAsConst(tdRef.trajectoryTimeAware.geometry)) tdRef.trajectoryGeometry.emplace_back(geoPosRelTime); // implicit // downcast tdRef.peakHeightAbs = peakHeightRelToOrigin + originatorPosition_geo.z(); @@ -2593,17 +2593,17 @@ bool ObjectEffectCluster::getFiringUnitOrigin(const int firingParticipantId, Lts return false; } - const bool isLeaf = ppmDtc->participant(firingParticipantId).inferiorIds().empty(); // isLeaf means single (Participant and not a Unit) + const bool isLeaf = ppmDtc->participant(firingParticipantId).inferiorIds.empty(); // isLeaf means single (Participant and not a Unit) if (isLeaf) { const ParticipantManagement::ParticipantPosition &partPos = ppmDtc->participantPosition(firingParticipantId); - if (partPos.participantId() != firingParticipantId) + if (partPos.participantId != firingParticipantId) return false; // relative zValue -> absolute zValue: // Keep NASAT in mind sending 'height' via NasatPosition (normally, 'height' is relative to ground) - const double zValue = getElevationFor({partPos.pos().lon(), partPos.pos().lat()}, QString(QStringLiteral("participantPosition_partId=%1")).arg(firingParticipantId)); - firingOriginOut = LtsUtils::QPoint3D(partPos.pos().lon(), partPos.pos().lat(), partPos.pos().z() + zValue); + const double zValue = getElevationFor({partPos.pos.lon, partPos.pos.lat}, QString(QStringLiteral("participantPosition_partId=%1")).arg(firingParticipantId)); + firingOriginOut = LtsUtils::QPoint3D(partPos.pos.lon, partPos.pos.lat, partPos.pos.z + zValue); } else { @@ -2622,8 +2622,8 @@ bool ObjectEffectCluster::getFiringUnitOrigin(const int firingParticipantId, Lts int idx = 0; for (Core::GeoPosition &geoPosRef : m_temporaryData.singleFiringPositions) { - const double zValue = getElevationFor({geoPosRef.lon(), geoPosRef.lat()}, QString(QStringLiteral("firingCannonPosition_index_%1")).arg(idx++)); - geoPosRef.z(zValue); + const double zValue = getElevationFor({geoPosRef.lon, geoPosRef.lat}, QString(QStringLiteral("firingCannonPosition_index_%1")).arg(idx++)); + geoPosRef.z = zValue; } if (m_logger.isDebugEnabled()) for (const Core::GeoPosition geoPosRef : m_temporaryData.singleFiringPositions) @@ -2702,10 +2702,10 @@ LtsUtils::QPoint3D ObjectEffectCluster::getFiringCannonGeoPosition(int explosion Core::GeoPosition geoPos = m_temporaryData.getFiringCannonGeoPosition(explosionIndex); // in case of missing coordinates for single cannons (or ModuleTest): - if (std::isnan(geoPos.lon()) || std::isnan(geoPos.lat()) || std::isnan(geoPos.z())) + if (std::isnan(geoPos.lon) || std::isnan(geoPos.lat) || std::isnan(geoPos.z)) return m_data.firingCenterPosition; - return LtsUtils::QPoint3D(geoPos.lon(), geoPos.lat(), geoPos.z()); + return LtsUtils::QPoint3D(geoPos.lon, geoPos.lat, geoPos.z); } LtsUtils::QPoint3D ObjectEffectCluster::getFiringCannonUtmPosition(int explosionIndex, int zoneToUse) const @@ -2751,40 +2751,40 @@ void ObjectEffectCluster::sendCalculateTrajectoryAdlerRequest(const QVector(probObject[AdlerJson::JsonKeys::WINKELGRUPPE()].toInt()); + angleGroup = static_cast(probObject[AdlerJson::JsonKeys::WINKELGRUPPE()].toInt()); // Send request TrainingAreaBase::AdlerCalculateTrajectoryRequest request; - const int partyId = m_mainHandler->dds()->ppmDtc()->participant(data.participantId).partyId(); - request.partyId(partyId); - request.positionLaunch(positionLaunch); - request.aesItemId(m_data.id); - request.positionTarget(positionTarget); - request.properties(m_data.properties.toStdString()); - request.trajectory().chargeTypeId() = data.chargeTypeId; - request.trajectory().igniterFunctionId() = data.igniterFunctionId; - request.trajectory().igniterTypeId() = data.igniterTypeId; - request.trajectory().loadTypeId() = loadTypeId; + const int partyId = m_mainHandler->dds()->ppmDtc()->participant(data.participantId).partyId; + request.partyId = partyId; + request.positionLaunch = positionLaunch; + request.aesItemId = m_data.id; + request.positionTarget = positionTarget; + request.properties = m_data.properties.toStdString(); + request.trajectory.chargeTypeId = data.chargeTypeId; + request.trajectory.igniterFunctionId = data.igniterFunctionId; + request.trajectory.igniterTypeId = data.igniterTypeId; + request.trajectory.loadTypeId = loadTypeId; const ProjectDataManagement::GearClass &gc = m_mainHandler->dds()->pdmDtc()->gearClassFromChargeTypeId(m_data.chargeTypeId); - switch (gc.underlying()) + switch (gc) { case ProjectDataManagement::GearClass::GearClass_Artillery: - request.weaponSystemType(TrainingAreaBase::WeaponSystemType::PZH); + request.weaponSystemType = TrainingAreaBase::WeaponSystemType::PZH; break; case ProjectDataManagement::GearClass::GearClass_Mortar: - request.weaponSystemType(TrainingAreaBase::WeaponSystemType::MRS); + request.weaponSystemType = TrainingAreaBase::WeaponSystemType::MRS; break; case ProjectDataManagement::GearClass::GearClass_Rocket: - request.weaponSystemType(TrainingAreaBase::WeaponSystemType::MARS); + request.weaponSystemType = TrainingAreaBase::WeaponSystemType::MARS; break; default: - request.weaponSystemType(TrainingAreaBase::WeaponSystemType::PZH); + request.weaponSystemType = TrainingAreaBase::WeaponSystemType::PZH; break; } - request.trajectory().loadNumber() = probObject[AdlerJson::JsonKeys::LADUNGSNUMMER()].toInt(); - request.angleGroup(angleGroup); + request.trajectory.loadNumber = probObject[AdlerJson::JsonKeys::LADUNGSNUMMER()].toInt(); + request.angleGroup = angleGroup; INFO_LOG(m_logger) << "call TAB::calculateTrajectoryAdler" << ", participantId: " << data.participantId << ", partyId: " << partyId << ", positionLaunch: " << positionLaunch << ", positionTarget: " << positionTarget << ", m_data.impactCount: " << m_data.impactCount << ", m_data.id aesItemId: " << m_data.id; @@ -2792,7 +2792,7 @@ void ObjectEffectCluster::sendCalculateTrajectoryAdlerRequest(const QVectordds()->tabFtc() && m_mainHandler->dds()->tabFtc()->isAdlerCalculateTrajectoryEnabled()) { @@ -2894,13 +2894,13 @@ std::vector ObjectEffectCluster::generateGunToTargetForm(cons // trajOut.push_back(participantPos.pos()); for (const auto adlerPos : trajectoryRelativeToOriginator) { - auto transPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPos.pos().lon(), participantPos.pos().lat()); + auto transPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPos.pos.lon, participantPos.pos.lat); - transPos.x += adlerPos.offsetX(); - transPos.y += adlerPos.offsetY(); - pos.lat() = transPos.geographic().y(); // participantPos.pos().lat() + (adlerPos.lat() * (M_PI / 180.0)); - pos.lon() = transPos.geographic().x(); // participantPos.pos().lon() + (adlerPos.lon() * (M_PI / 180.0)); - pos.z() = participantPos.pos().z() + adlerPos.offsetZ(); + transPos.x += adlerPos.offsetX; + transPos.y += adlerPos.offsetY; + pos.lat = transPos.geographic().y(); // participantPos.pos().lat() + (adlerPos.lat() * (M_PI / 180.0)); + pos.lon = transPos.geographic().x(); // participantPos.pos().lon() + (adlerPos.lon() * (M_PI / 180.0)); + pos.z = participantPos.pos.z + adlerPos.offsetZ; trajOut.push_back(pos); } } @@ -3006,31 +3006,31 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex) // enable access to TracjectoryData and add time-awarenes TracjectoryData &tdRef = m_trajectoryCont[explosionIndex]; TrajectoryTimeAware &trajectoryTimeAwareRef = tdRef.trajectoryTimeAware; - trajectoryTimeAwareRef.id(1000 * m_data.id + 100 + explosionIndex); - trajectoryTimeAwareRef.sampleTime(partitionTimeMSec()); + trajectoryTimeAwareRef.id = 1000 * m_data.id + 100 + explosionIndex; + trajectoryTimeAwareRef.sampleTime = partitionTimeMSec(); // trajectoryTimeAwareRef.aesItemId(m_data.id); // trajectoryTimeAwareRef.aesTypeId(AesType::AtEffectClusterSingleTrajectory); - trajectoryTimeAwareRef.index(explosionIndex); + trajectoryTimeAwareRef.index = explosionIndex; // [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) - trajectoryTimeAwareRef.originatorId(m_data.id); // m_data.id == aesItemId - trajectoryTimeAwareRef.originatorTypeId(ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation); + trajectoryTimeAwareRef.originatorId = m_data.id; // m_data.id == aesItemId + trajectoryTimeAwareRef.originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation; if (isVulcano()) { // Time: - trajectoryTimeAwareRef.trajectoryStartTime(m_data.effectStart.toMSecsSinceEpoch() - m_temporaryData.calculatedFlightDurationMsec); + trajectoryTimeAwareRef.trajectoryStartTime = m_data.effectStart.toMSecsSinceEpoch() - m_temporaryData.calculatedFlightDurationMsec; bool bPublished = m_mainHandler->dds()->dts()->publish(trajectoryTimeAwareRef); if (!bPublished) ERROR_LOG(m_logger) << LOGFUNCTION << " ERROR, publish failed" << m_data.id << " explosionIndex=" << explosionIndex - << ", trajectoryStartTime = " << trajectoryTimeAwareRef.trajectoryStartTime() - << ", geometry().size() = " << trajectoryTimeAwareRef.geometry().size(); + << ", trajectoryStartTime = " << trajectoryTimeAwareRef.trajectoryStartTime + << ", geometry().size() = " << trajectoryTimeAwareRef.geometry.size(); } else { // Time: // use sample time since FiringTimer is initiates trajectory calculation - trajectoryTimeAwareRef.trajectoryStartTime(trajectoryTimeAwareRef.sampleTime()); + trajectoryTimeAwareRef.trajectoryStartTime = trajectoryTimeAwareRef.sampleTime; const std::vector &trajectoryGeometry = tdRef.trajectoryGeometry; Core::GeoPosition first; @@ -3039,7 +3039,7 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex) DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " trajectoryGeometry=" << trajectoryGeometry.size() << ", first = " << first; - std::vector &geometryRef = trajectoryTimeAwareRef.geometry(); + std::vector &geometryRef = trajectoryTimeAwareRef.geometry; geometryRef.clear(); geometryRef.reserve(trajectoryGeometry.size()); int idx = 0; @@ -3071,7 +3071,7 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex) } // if ((trajSize > 20) && (idx>1)) } // if (!m_isAirSupportSource) - geometryRef.emplace_back(Core::GeoPositionRelativeTime(pos3D.lon(), pos3D.lat(), pos3D.z(), idx * flightDurationMSecSeg)); + geometryRef.emplace_back(Core::GeoPositionRelativeTime(pos3D.lon, pos3D.lat, pos3D.z, idx * flightDurationMSecSeg)); ++idx; } // for @@ -3084,25 +3084,25 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex) #endif DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " explosionIndex=" << explosionIndex << " has flightDurationMSecSeg=" << flightDurationMSecSeg - << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime() << ", geometry().size() = " << trajectoryTimeAwareRef.geometry().size(); + << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime << ", geometry().size() = " << trajectoryTimeAwareRef.geometry.size(); bool bPublished = m_mainHandler->dds()->dts()->publish(trajectoryTimeAwareRef); if (!bPublished) ERROR_LOG(m_logger) << LOGFUNCTION << " ERROR, publish failed" << m_data.id << " explosionIndex=" << explosionIndex - << " has flightDurationMSecSeg=" << flightDurationMSecSeg << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime() - << ", geometry().size() = " << trajectoryTimeAwareRef.geometry().size(); + << " has flightDurationMSecSeg=" << flightDurationMSecSeg << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime + << ", geometry().size() = " << trajectoryTimeAwareRef.geometry.size(); } m_publisedTrajectoriesForDebug[explosionIndex] = QString(QStringLiteral("trajectoryPublished m_data.id=%1 - explosionIndex=%2 - trajectoryStarttime=%3 - size=%4")) .arg(m_data.id) .arg(explosionIndex) - .arg(trajectoryTimeAwareRef.trajectoryStartTime()) - .arg(trajectoryTimeAwareRef.geometry().size()); + .arg(trajectoryTimeAwareRef.trajectoryStartTime) + .arg(trajectoryTimeAwareRef.geometry.size()); DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " add to m_publisedTrajectoriesForDebug " << m_publisedTrajectoriesForDebug[explosionIndex]; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " add to m_publisedTrajectoriesForDebug.size = " << m_publisedTrajectoriesForDebug.size(); - TRACE_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " XXXX 4 trajectoryTimeAware.geometry().size() = " << trajectoryTimeAwareRef.geometry().size() + TRACE_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " XXXX 4 trajectoryTimeAware.geometry().size() = " << trajectoryTimeAwareRef.geometry.size() // << ", bPublished=" << bPublished ; } @@ -3110,25 +3110,25 @@ void ObjectEffectCluster::publishTrajectory(int explosionIndex) AreaEffectSimulation::EffectorData ObjectEffectCluster::fromDatabase(const Database::AesEffectorData &data) { EffectorData ret; - ret.angleOfFall() = data.angleOfFall; - ret.chargeAmount() = data.chargeAmount; - ret.chargeStruct().chargeTypeId() = data.chargeTypeId; - ret.trajectoryRelative() = TrajectoryRelative::fromString(data.trajectory); - ret.flightTime() = data.flightTime; - ret.chargeStruct().igniterTypeId() = data.igniterTypeId; - ret.chargeStruct().igniterFunctionId() = data.igniterFunctionId; - ret.interval() = data.interval; - ret.participantId() = data.participantId; - ret.peakHeight() = data.peakHeight; - ret.mhpPosition().lat() = data.mhpPosition.y(); - ret.mhpPosition().lon() = data.mhpPosition.x(); - ret.mhpPosition().z() = data.mhpPosition.z(); - ret.mhpRotation() = data.mhpRotation; - ret.mhpScatterLenght() = data.mhpScatterLenght; - ret.mhpScatterLengthDetonationHeight() = data.mhpScatterLengthDetonationHeight; - ret.mhpScatterWidth() = data.mhpScatterWidth; - ret.mhpScatterWidthDetonationHeight() = data.mhpScatterWidthDetonationHeight; - ret.properties() = data.properties.toStdString(); + ret.angleOfFall = data.angleOfFall; + ret.chargeAmount = data.chargeAmount; + ret.chargeStruct.chargeTypeId = data.chargeTypeId; + ret.trajectoryRelative = TrajectoryRelative::fromString(data.trajectory); + ret.flightTime = data.flightTime; + ret.chargeStruct.igniterTypeId = data.igniterTypeId; + ret.chargeStruct.igniterFunctionId = data.igniterFunctionId; + ret.interval = data.interval; + ret.participantId = data.participantId; + ret.peakHeight = data.peakHeight; + ret.mhpPosition.lat = data.mhpPosition.y(); + ret.mhpPosition.lon = data.mhpPosition.x(); + ret.mhpPosition.z = data.mhpPosition.z(); + ret.mhpRotation = data.mhpRotation; + ret.mhpScatterLenght = data.mhpScatterLenght; + ret.mhpScatterLengthDetonationHeight = data.mhpScatterLengthDetonationHeight; + ret.mhpScatterWidth = data.mhpScatterWidth; + ret.mhpScatterWidthDetonationHeight = data.mhpScatterWidthDetonationHeight; + ret.properties = data.properties.toStdString(); return ret; } @@ -3136,14 +3136,14 @@ AreaEffectSimulation::EffectorData ObjectEffectCluster::fromDatabase(const Datab DetonationLocationRequest ObjectEffectCluster::detonationLocationRequest(int explosionIndex) const { DetonationLocationRequest req; - req.id(m_data.id); // m_data.id == AesItemId - req.index(explosionIndex); - req.chargeTypeId(m_data.chargeTypeId); + req.id = m_data.id; // m_data.id == AesItemId + req.index = explosionIndex; + req.chargeTypeId = m_data.chargeTypeId; // req.igniterTypeId(m_data.igniterTypeId); - req.igniterTypeId(0); + req.igniterTypeId = 0; // req.igniterFunctionId(m_data.igniterFunctionId); - req.igniterFunctionId(0); - req.trajectory(m_trajectoryCont[explosionIndex].trajectoryGeometry); + req.igniterFunctionId = 0; + req.trajectory = m_trajectoryCont[explosionIndex].trajectoryGeometry; return req; } @@ -3203,9 +3203,9 @@ bool ObjectEffectCluster::sendFireCommand(const QString &identifier) if (!m_effectorNameToIdMap.contains(identifier)) { - if (participant.id() <= 0) + if (participant.id <= 0) return false; - assignEffector(participant.id()); + assignEffector(participant.id); } if (!m_mainHandler->effectorHandler()) @@ -3235,11 +3235,11 @@ bool ObjectEffectCluster::sendFireCommand(const QString &identifier) if (m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsCreated) { - DEBUG_LOG(m_logger) << "move from recieved TO prepared: flightime: " << m_effectorData.value(participant.id()).flightTime + DEBUG_LOG(m_logger) << "move from recieved TO prepared: flightime: " << m_effectorData.value(participant.id).flightTime << " currentTime:" << partitionTime().toString(); // Set Actication time to current + flight duration of the current effector - DEBUG_LOG(m_logger) << "START STIME NEW: " << partitionTime().addSecs(m_effectorData.value(participant.id()).flightTime).toString(); - m_data.effectStart = partitionTime().addSecs(m_effectorData.value(participant.id()).flightTime); + DEBUG_LOG(m_logger) << "START STIME NEW: " << partitionTime().addSecs(m_effectorData.value(participant.id).flightTime).toString(); + m_data.effectStart = partitionTime().addSecs(m_effectorData.value(participant.id).flightTime); if (!trySwitchToPrepared()) { WARNING_LOG(m_logger) << "Could not switch to prepared for aesid " << m_data.id; @@ -3294,7 +3294,7 @@ bool ObjectEffectCluster::overrideEffectorStates(const AesEffectorState &newStat if (!m_mainHandler->effectClusterHandler()) return false; - switch (newState.underlying()) + switch (newState) { case AesEffectorState::EsReadyToFire: { @@ -3303,7 +3303,7 @@ bool ObjectEffectCluster::overrideEffectorStates(const AesEffectorState &newStat DEBUG_LOG(m_logger) << "Set Ready to Fire !"; onPublishData(); - if (m_readytoFire.size() == m_effectorData.count() && m_data.effectorState == AesEffectorState::EsReadyToFire) + if (m_readytoFire.size() == m_effectorData.count() && m_data.effectorState == static_cast(AesEffectorState::EsReadyToFire)) { // we need some time to handle the ack on tab QTimer::singleShot(1000, this, @@ -3317,7 +3317,7 @@ bool ObjectEffectCluster::overrideEffectorStates(const AesEffectorState &newStat FiringType firingType = FiringType::FireOnCommand; if (probObject.contains(AdlerJson::JsonKeys::ABFEUERUNGSART())) - firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); + firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); if (m_data.effectSourceId == ProjectDataManagement::EffectSource::ES_ADLER || (m_data.effectSourceId == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE && firingType != FiringType::FireNow)) @@ -3382,20 +3382,20 @@ ParticipantManagement::Participant ObjectEffectCluster::getParticipantFromIntern return {}; const auto originator = m_mainHandler->dds()->ppmDtc()->participant(m_data.participantId); - if (originator.name() == name.toStdString()) // in Case of a single originator and not a unit return the originator + if (originator.name == name.toStdString()) // in Case of a single originator and not a unit return the originator return originator; - if (originator.id() <= 0 || originator.isDeleted()) // no Originator found or is deleted + if (originator.id <= 0 || originator.isDeleted) // no Originator found or is deleted return {}; - const auto originatorType = m_mainHandler->dds()->ppmDtc()->type(originator.typeId()); + const auto originatorType = m_mainHandler->dds()->ppmDtc()->type(originator.typeId); - if (originatorType.typeClass() != ParticipantManagement::TypeClass::Unit) // not a unit + if (originatorType.typeClass != ParticipantManagement::TypeClass::Unit) // not a unit return {}; // Now we look up for the inferior participants to find the specific efdfector // the return value is either the correct participant or empty - return m_mainHandler->dds()->ppmDtc()->getParticipantByInternalName(originator.partyId(), QString::fromStdString(originator.name()), name); + return m_mainHandler->dds()->ppmDtc()->getParticipantByInternalName(originator.partyId, QString::fromStdString(originator.name), name); } bool ObjectEffectCluster::assignEffector(int participantId) @@ -3410,12 +3410,12 @@ bool ObjectEffectCluster::assignEffector(int participantId) return true; } const auto &participant = m_mainHandler->dds()->ppmDtc()->participant(participantId); - if (participant.id() <= 0) + if (participant.id <= 0) { ERROR_LOG(m_logger) << "TRY ASSIGN Effector " << participantId << " 2 no participant ID"; return false; } - if (participant.name().empty() && participant.designator().empty()) + if (participant.name.empty() && participant.designator.empty()) { ERROR_LOG(m_logger) << "TRY ASSIGN Effector " << participantId << " 3 no names"; return false; @@ -3431,14 +3431,14 @@ bool ObjectEffectCluster::assignEffector(int participantId) ERROR_LOG(m_logger) << "TRY ASSIGN Effector " << participantId << " 5 no effector for participantId"; return false; } - m_effectorNameToIdMap.insert(!participant.name().empty() ? QString::fromStdString(participant.name()) : QString::fromStdString(participant.name()), participant.id()); + m_effectorNameToIdMap.insert(!participant.name.empty() ? QString::fromStdString(participant.name) : QString::fromStdString(participant.name), participant.id); // just in case override timers with cadence const QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(m_data.properties.toStdString())).object(); FiringType firingType = FiringType::ReportReadyToFire; int cadence = 0; if (probObject.contains(AdlerJson::JsonKeys::ABFEUERUNGSART())) - firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); + firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); if (m_data.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER && firingType == FiringType::FireOnCommand) { const auto &gearTypeIds = m_mainHandler->dds()->pdmDtc()->gearTypeIdFromChargeTypeId(m_data.chargeTypeId); @@ -3512,7 +3512,7 @@ QVector ObjectEffectCluster::generateMHPs(const QVect const LtsCoordTrans::UtmCoordinate &firingOriginUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(m_data.firingCenterPosition.toPointF()); QVector mhps_asUtm; - switch (geometry.underlying()) + switch (geometry) { case AesExplosionGeometry::EgLine: case AesExplosionGeometry::EgArea: @@ -3577,7 +3577,7 @@ void ObjectEffectCluster::onSendReadinessToTab() FiringType firingType = FiringType::FireNow; if (probObject.contains(AdlerJson::JsonKeys::ABFEUERUNGSART())) - firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); + firingType = static_cast(probObject[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); // clear ready to fire. Wait for all beeing ready again m_readytoFire.clear(); @@ -3593,9 +3593,9 @@ void ObjectEffectCluster::onSendReadinessToTab() const QString reference = probObject[AdlerJson::JsonKeys::FEUERKAMPFREFERENZ()].toString(); TrainingAreaBase::SendExFireReadinessRequest request; - request.reference() = reference.toStdString(); - request.partyId() = m_data.partyId; - request.participantId() = m_data.participantId; + request.reference = reference.toStdString(); + request.partyId = m_data.partyId; + request.participantId = m_data.participantId; m_mainHandler->dds()->tabFtc()->sendExFireReadinessRequest(request, this); } @@ -3610,10 +3610,10 @@ void ObjectEffectCluster::onSendConfirmationReportToTab(int participantId) const QString reference = probObject[AdlerJson::JsonKeys::FEUERKAMPFREFERENZ()].toString(); TrainingAreaBase::SendExConfirmationReportRequest request; - request.reference() = reference.toStdString(); - request.partyId() = m_data.partyId; - request.unitIdentifier() = m_mainHandler->dds()->ppmDtc()->participant(m_data.participantId).name(); - request.identifier() = m_mainHandler->dds()->ppmDtc()->participant(participantId).name(); + request.reference = reference.toStdString(); + request.partyId = m_data.partyId; + request.unitIdentifier = m_mainHandler->dds()->ppmDtc()->participant(m_data.participantId).name; + request.identifier = m_mainHandler->dds()->ppmDtc()->participant(participantId).name; m_mainHandler->dds()->tabFtc()->sendExConfirmationReportRequest(request, this); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.h index c7f2f1716..343c548f4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effect_cluster.h @@ -96,7 +96,7 @@ public: bool initialCalculations(QString *reasonOut = nullptr); void abortPreStartTimer(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtExplosionArea; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp index efcdbf0eb..9ee69a849 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp @@ -169,10 +169,10 @@ void ObjectEffector::sendEffectorToDds() DEBUG_LOG(m_logger) << "sendEffectorToDds NewState= " << m_effectorStateMachine->getCurrentStateStr() << ", participantId=" << m_participantId << ", aesItemId=" << m_aesItemId; AreaEffectSimulation::Effector effector; - effector.id(m_participantId); - effector.effectorState(m_effectorStateMachine->getCurrentState()); - effector.aesItemId(m_aesItemId); - effector.participantId(m_participantId); + effector.id = m_participantId; + effector.effectorState = m_effectorStateMachine->getCurrentState(); + effector.aesItemId = m_aesItemId; + effector.participantId = m_participantId; m_mainHandler->dds()->dts()->publish(effector); } @@ -205,20 +205,20 @@ void ObjectEffector::setIndendedTrajectory(const std::vector(AesType::AtExplosionArea); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); const QVector singleExplosions = Polygons::explosionAreaSingleExplosions(data()); AesItemView aiv2(m_aiv2); - aiv2.aesItemId(m_data.id); - aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv2.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(singleExplosions, aiv2.form()); - aiv2.boundingBoxBottomLeft(aiv.boundingBoxBottomLeft()); - aiv2.boundingBoxTopRight(aiv.boundingBoxTopRight()); - aiv2.aesTypeId(AesType::AtExplosionAreaSingleExplosions); - aiv2.id(1000 * m_data.id + AesType::AtExplosionAreaSingleExplosions); - aiv2.effectStateId(effectState()); + aiv2.aesItemId = m_data.id; + aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv2.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(singleExplosions, aiv2.form); + aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft; + aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight; + aiv2.aesTypeId = AesType::AtExplosionAreaSingleExplosions; + aiv2.id = 1000 * m_data.id + static_cast(AesType::AtExplosionAreaSingleExplosions); + aiv2.effectStateId = effectState(); if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -301,7 +301,7 @@ void ObjectExplosionArea::publishAiv() if (aiv2 != m_aiv2) { - aiv2.sampleTime(partitionTimeMSec()); + aiv2.sampleTime = partitionTimeMSec(); m_aiv2 = aiv2; m_mainHandler->dds()->dts()->publish(aiv2); emit newAiv(aiv2); @@ -312,8 +312,8 @@ void ObjectExplosionArea::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeExplosionAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionArea); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionAreaSingleExplosions); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionArea)); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionAreaSingleExplosions)); emit removeAiv(m_data.id); } @@ -336,7 +336,7 @@ void ObjectExplosionArea::stopSingleExplosionHandling(AesEffectState newState) { m_singleExplosionTriggerTimer->stop(); - if (m_data.effectStateId != AesEffectState_def::EsActivated) + if (m_data.effectStateId != AesEffectState::EsActivated) return; // int chargeCountUntilLastStart = lrint((m_data.originalEffectDuration - m_data.effectDuration) / impactDeltaMSec()); @@ -401,18 +401,18 @@ void ObjectExplosionArea::checkNextSingleExplosion() // publish new triggered explosions data here TriggeredImpacts ti; - ti.id(1000 * m_data.id + AesType::AtExplosionAreaSingleExplosions); - ti.aesItemId(m_data.id); - ti.aesTypeId(AesType::AtExplosionAreaSingleExplosions); - ti.sampleTime(partitionTimeMSec()); + ti.id = 1000 * m_data.id + static_cast(AesType::AtExplosionAreaSingleExplosions); + ti.aesItemId = m_data.id; + ti.aesTypeId = AesType::AtExplosionAreaSingleExplosions; + ti.sampleTime = partitionTimeMSec(); - ti.impactCount(impactCount); - ti.bitfield().resize((impactCount + 7) / 8); + ti.impactCount = impactCount; + ti.bitfield.resize((impactCount + 7) / 8); // not very fast but ok for now for(int i = 0; i < impactCount; ++i) { // Triggered Impact == 0, if impact has taken place - LtsUtils::BitArray::setBit(ti.bitfield(), i, i >= curExplosionNumber); // not "<" -> explosion NUMBER + LtsUtils::BitArray::setBit(ti.bitfield, i, i >= curExplosionNumber); // not "<" -> explosion NUMBER } DEBUG_LOG(m_logger) << "Publishing TriggeredExplosions with curExplosionNumber " << curExplosionNumber; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_area.h index fbe7e690d..7d1f9fb45 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_area.h @@ -31,7 +31,7 @@ public: bool removeObjectFromDb(); Core::FunctionReplyObject resumePause(const ExplosionAreaPauseResumeRequest &req); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtExplosionArea; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.cpp index f74babd8b..6d0b68d7f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.cpp @@ -80,7 +80,7 @@ Trajectory: #define DUMP() dump(__FILE__, __LINE__) // ToDo: mark the end of aes enum and update following (check Endemarke) -static_assert((int)AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine < 100, "id may overlap at runtime"); +static_assert((int)AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine < 100, "id may overlap at runtime"); // Aufteilung der ids: // ExplosionCluster ddsData(m_data.id, @@ -204,7 +204,7 @@ Core::FunctionReplyObject ObjectExplosionCluster::createObject(const Database::A // external (externalId==0) -> claim required // NASAT: AirSupport -> no claim required const bool bDoClaimPlannedCharge - = (data.id == 0) && (data.externalId <= 0) && (m_mainHandler->gearClassOfChargeTypeId(data.chargeTypeId) != ProjectDataManagement::GearClass_def::AirSupport); + = (data.id == 0) && (data.externalId <= 0) && (m_mainHandler->gearClassOfChargeTypeId(data.chargeTypeId) != ProjectDataManagement::GearClass::GearClass_AirSupport); if (bDoClaimPlannedCharge) // new, not read from db ret = m_mainHandler->chargeAdministrationHandler()->claimPlannedCharge(data.chargeTypeId, data.partyId, data.impactCount); @@ -392,7 +392,7 @@ Core::FunctionReplyObject ObjectExplosionCluster::updateObject(const Database::A return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating explosion cluster with id %1 in database.")).arg(m_data.id); } - if ((data.externalId <= 0) && m_mainHandler->gearClassOfChargeTypeId(m_data.chargeTypeId) != ProjectDataManagement::GearClass_def::AirSupport) // internal + if ((data.externalId <= 0) && m_mainHandler->gearClassOfChargeTypeId(m_data.chargeTypeId) != ProjectDataManagement::GearClass::GearClass_AirSupport) // internal { // this is for party change or charge type change if (data.partyId != m_data.partyId || data.chargeTypeId != m_data.chargeTypeId) @@ -422,9 +422,9 @@ Core::FunctionReplyObject ObjectExplosionCluster::updateObject(const Database::A // m_lastSentTriggeredExplosionNumber = -1; // reset some data: - m_aiv2.form().clear(); // enforce recalculation - m_effects.singleEffects().clear(); - m_aivGunToTargetTrajectory.form().clear(); // enforce recalculation + m_aiv2.form.clear(); // enforce recalculation + m_effects.singleEffects.clear(); + m_aivGunToTargetTrajectory.form.clear(); // enforce recalculation m_temporaryData.reset(); // estimatedMaxFlightDurationMSec, mhPoints, mhWidth... // keep in mind: if no participantId is provided: no gunToTargetLine will be calculated @@ -495,7 +495,7 @@ bool ObjectExplosionCluster::initialCalculations(QString *reasonOut) QVector mtps_asUtm; - if (m_data.explosionGeometryId.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) + if (m_data.explosionGeometryId == AreaEffectSimulation::AesExplosionGeometry::EgRadial) mtps_asUtm = explosionClusterRadialToMtps(areaBlWithTla, m_data.mhpCountRequest, firingOriginUtm, centerUtm, &singleWidthOut, &singleHeightOut); else mtps_asUtm = explosionClusterAreaToMtps(areaBlWithTla, m_data.mhpCountRequest, &singleWidthOut, &singleHeightOut); @@ -561,17 +561,17 @@ bool ObjectExplosionCluster::initialCalculations(QString *reasonOut) // ... and retrieve the duration: const TracjectoryData &tdRefGTL = m_trajectoryCont[-1]; const TrajectoryTimeAware &trajTimeAwareGTL = tdRefGTL.trajectoryTimeAware; - const Core::GeoPositionRelativeTime &geoPosRelTimeRef = trajTimeAwareGTL.geometry().back(); + const Core::GeoPositionRelativeTime &geoPosRelTimeRef = trajTimeAwareGTL.geometry.back(); - m_temporaryData.calculatedFlightDurationMsec = geoPosRelTimeRef.relativeTime(); - m_temporaryData.estimatedMaxFlightDurationMSec = (geoPosRelTimeRef.relativeTime() * 1.1) + 5 * 1000; // ( *1.1) + (10 *1000) + m_temporaryData.calculatedFlightDurationMsec = geoPosRelTimeRef.relativeTime; + m_temporaryData.estimatedMaxFlightDurationMSec = (geoPosRelTimeRef.relativeTime * 1.1) + 5 * 1000; // ( *1.1) + (10 *1000) m_temporaryData.calculatedFiringSpeed = TrajectoryGeneratorVulcano::defaultv0(); m_temporaryData.calculatedPeakHeightAbs = tdRefGTL.peakHeightAbs; // to avoid re-calculation, store that at m_aivGunToTargetTrajectory. // At publishAiv the new calculation will be skipped: - m_aivGunToTargetTrajectory.form(tdRefGTL.trajectoryGeometry); + m_aivGunToTargetTrajectory.form = tdRefGTL.trajectoryGeometry; m_aivGunToTargetTrajectoryDirty = true; } else @@ -649,11 +649,11 @@ Core::FunctionReplyObject ObjectExplosionCluster::checkObjectData(const Database using geoType = AreaEffectSimulation::AesExplosionGeometry_def; const geoType::type curExGeoType = data.explosionGeometryId.underlying(); - static const QVector ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint, // 0 -> default - AreaEffectSimulation::AesExplosionGeometry_def::EgPoint, - AreaEffectSimulation::AesExplosionGeometry_def::EgArea, - AreaEffectSimulation::AesExplosionGeometry_def::EgRadial, - AreaEffectSimulation::AesExplosionGeometry_def::EgLine}; + static const QVector ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry::EgAimPoint, // 0 -> default + AreaEffectSimulation::AesExplosionGeometry::EgPoint, + AreaEffectSimulation::AesExplosionGeometry::EgArea, + AreaEffectSimulation::AesExplosionGeometry::EgRadial, + AreaEffectSimulation::AesExplosionGeometry::EgLine}; QString reason; @@ -707,7 +707,7 @@ bool ObjectExplosionCluster::removeObjectFromDb() { return m_mainHandler->db()-> Core::FunctionReplyObject ObjectExplosionCluster::resumePause(const ExplosionClusterPauseResumeRequest &req) { Core::FunctionReplyObject ret; - if (req.resumeExecution()) + if (req.resumeExecution) { // resume DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " RESUME" << " ... "; @@ -743,13 +743,13 @@ Core::FunctionReplyObject ObjectExplosionCluster::resumePause(const ExplosionClu // if (req.resumeExecution()) // { // // resume - // if (req.timeToResume().is_set()) - // m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume().get()); + // if (req.timeToResume.is_set()) + // m_data.effectStart = QDateTime::fromMSecsSinceEpoch(req.timeToResume.get()); // else // m_data.effectStart = partitionTime(); - // if (req.remainingDuration().is_set()) - // m_data.effectDuration = req.remainingDuration().get(); + // if (req.remainingDuration.is_set()) + // m_data.effectDuration = req.remainingDuration.get(); // // req.resumeSeed() currently not used, as it is calculated internaly. maybe in the future @@ -772,16 +772,16 @@ Core::FunctionReplyObject ObjectExplosionCluster::targetPositionsModify(const Ta const qint64 now = partitionTimeMSec(); const qint64 remainingMsec = m_data.effectStart.toMSecsSinceEpoch() - now; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " START" - << " TargetPositionsModifyRequest = " << req << ", s_counter = " << s_counter++ << ", current state = " << m_data.effectStateId.underlying() + << " TargetPositionsModifyRequest = " << req << ", s_counter = " << s_counter++ << ", current state = " << m_data.effectStateId << ", now = " << now << ", effectStart = " << m_data.effectStart.toMSecsSinceEpoch() << ", remainingMsec = " << remainingMsec; DUMP(); - const std::vector &positions = req.positions(); + const std::vector &positions = req.positions; Core::FunctionReplyObject ret; - if (m_data.effectStateId.underlying() == AreaEffectSimulation::AesEffectState_def::EsExpired) + if (m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired) { ret = Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error modifying explosion cluster with id %1 since object is already expired")).arg(m_data.id); ERROR_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " Error: " << ret.str(); @@ -815,11 +815,11 @@ Core::FunctionReplyObject ObjectExplosionCluster::targetPositionsModify(const Ta return ret; } - const Core::GeoPosition &newTargetPos = req.positions().front(); + const Core::GeoPosition &newTargetPos = req.positions.front(); const int explosionIndex = 0; TracjectoryData &tdRef = m_trajectoryCont[explosionIndex]; TrajectoryTimeAware &trajTimeAwareRef = tdRef.trajectoryTimeAware; - std::vector &trajectoryTimeAwareGeometry = trajTimeAwareRef.geometry(); + std::vector &trajectoryTimeAwareGeometry = trajTimeAwareRef.geometry; if (trajectoryTimeAwareGeometry.empty()) { @@ -860,17 +860,17 @@ Core::FunctionReplyObject ObjectExplosionCluster::targetPositionsModify(const Ta // m_aiv2 CHANGES HERE // - std::vector &formRef = m_aiv2.form(); + std::vector &formRef = m_aiv2.form; // compare former and updated ImpactPos: context targetModify if (m_logger.isDebugEnabled()) { Core::GeoPosition &curImpactPosRef = formRef[explosionIndex]; - LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon(), curImpactPosRef.lat()); - const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z()); + LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon, curImpactPosRef.lat); + const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z); - LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(newTargetPos.lon(), newTargetPos.lat(), utm1.zone); - const QVector3D u2Vec(utm2.x, utm2.y, newTargetPos.z()); + LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(newTargetPos.lon, newTargetPos.lat, utm1.zone); + const QVector3D u2Vec(utm2.x, utm2.y, newTargetPos.z); const QVector3D diff = u2Vec - u1Vec; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " for explosionIndex " << explosionIndex << ", curImpactPosRef " << curImpactPosRef << ", utm1 " << utm1 @@ -882,10 +882,10 @@ Core::FunctionReplyObject ObjectExplosionCluster::targetPositionsModify(const Ta curImpactPosRef = newTargetPos; // Effects: - std::vector &singleEffectsRef = m_effects.singleEffects(); + std::vector &singleEffectsRef = m_effects.singleEffects; SingleEffect &ref = singleEffectsRef[explosionIndex]; - ref.position(newTargetPos); - ref.zPlacement(AesZPlacement_def::ZpAbsolute); // intersection: change from draped to absolute + ref.position = newTargetPos; + ref.zPlacement = AesZPlacement::ZpAbsolute; // intersection: change from draped to absolute // Trajectory publishTrajectory(explosionIndex); @@ -937,7 +937,7 @@ Core::FunctionReplyObject ObjectExplosionCluster::checkPreConditionsComplete() // keep start of svc in mind: Core::FunctionReplyObject ret; - if (m_data.effectStateId.underlying() != AreaEffectSimulation::AesEffectState_def::EsExpired) + if (m_data.effectStateId != AreaEffectSimulation::AesEffectState::EsExpired) ret = checkPreConditions(); DUMP(); @@ -1109,20 +1109,20 @@ void ObjectExplosionCluster::onPublishData() m_temporaryData.calculatedFlightDurationMsec, m_data.peakHeight, m_data.flightDuration); - ddsData.flightCurve(toOptional(fc)); + ddsData.flightCurve = toOptional(fc); } if (isVulcano()) { LaserGuiding lg(m_data.lcPrf, m_data.lcTermination, m_data.tapTimepoint, m_data.cloudBase); - ddsData.laserGuiding(toOptional(lg)); + ddsData.laserGuiding = toOptional(lg); } // publish only on real changes: if (m_explosionCluster != ddsData) { m_explosionCluster = ddsData; - ddsData.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + ddsData.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store m_mainHandler->dds()->dts()->publish(ddsData); } @@ -1138,14 +1138,14 @@ void ObjectExplosionCluster::onDetonationLocationReply(const DetonationLocationR // int32_t explosionIndex, // explosionIndex // const Core::GeoPosition& position); - if (reply.id() != m_data.id) // aesItemId + if (reply.id != m_data.id) // aesItemId { - DEBUG_LOG(m_logger) << "ID mismatch: " << reply.id() << " != " << m_data.id; + DEBUG_LOG(m_logger) << "ID mismatch: " << reply.id << " != " << m_data.id; return; } // do we have the initial geometry? - const int explosionIndex = reply.index(); + const int explosionIndex = reply.index; if (!m_trajectoryCont.contains(explosionIndex)) { DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << "unknown explosionIndex " @@ -1153,8 +1153,8 @@ void ObjectExplosionCluster::onDetonationLocationReply(const DetonationLocationR return; } - const Core::GeoPosition &replyPos = reply.position(); - if ((replyPos.lon() < 0.00001) || (replyPos.lat() < 0.00001)) + const Core::GeoPosition &replyPos = reply.position; + if ((replyPos.lon < 0.00001) || (replyPos.lat < 0.00001)) { // no intersection DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " got DetonationLocationReply" @@ -1167,7 +1167,7 @@ void ObjectExplosionCluster::onDetonationLocationReply(const DetonationLocationR << " : INTERSECTION - reply.position is: " << ", reply.index() = " << explosionIndex << ", reply.position() " << replyPos; - adjustTrajectoryToDetonationLocation(explosionIndex, replyPos, reply.buildingId()); + adjustTrajectoryToDetonationLocation(explosionIndex, replyPos, reply.buildingId); } // publish new triggered explosions data here @@ -1178,7 +1178,7 @@ void ObjectExplosionCluster::onDetonationLocationReply(const DetonationLocationR DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " Publishing AesItemView (AtExplosionClusterSingleExplosions) for TriggeredExplosions, explosionIndex " << explosionIndex; - m_aiv2.sampleTime(partitionTimeMSec()); + m_aiv2.sampleTime = partitionTimeMSec(); // // m_mainHandler->dds()->dts()->publish(m_aiv2); // does anyone needs this topic??? m_aiv2HasChanged = false; emit newAiv(m_aiv2); @@ -1226,16 +1226,16 @@ void ObjectExplosionCluster::adjustTrajectoryToDetonationLocation(int explosionI } const Core::GeoPosition &trajFront = trajectoryGeometry.front(); - const double distToOriginSquared = LtsCoordTrans::squareDistance(trajFront.lon(), trajFront.lat(), intersectionLocation.lon(), intersectionLocation.lat()); + const double distToOriginSquared = LtsCoordTrans::squareDistance(trajFront.lon, trajFront.lat, intersectionLocation.lon, intersectionLocation.lat); ProjectDataManagement::IgniterFunctionBase ignFunctionBase = m_mainHandler->dds() ->pdmDtc() ->getChargeTypeIgniterTypeIgniterFunction(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId) - .igniterFunctionBaseId(); + .igniterFunctionBaseId; if ((ignFunctionBase == ProjectDataManagement::IgniterFunctionBase::IfbProximity) || (ignFunctionBase == ProjectDataManagement::IgniterFunctionBase::IfbImpact)) { - const double distTrajectorySquared = LtsCoordTrans::squareDistance(trajFront.lon(), trajFront.lat(), trajBack.lon(), trajBack.lat()); + const double distTrajectorySquared = LtsCoordTrans::squareDistance(trajFront.lon, trajFront.lat, trajBack.lon, trajBack.lat); if (distToOriginSquared > distTrajectorySquared) { ERROR_LOG(m_logger) << "adjustTrajectoryToDetonationLocation " << m_data.id << "Detonation location is outside of trajectory for ID: " << m_data.id @@ -1252,7 +1252,7 @@ void ObjectExplosionCluster::adjustTrajectoryToDetonationLocation(int explosionI { const Core::GeoPosition &curItem_geo = trajectoryGeometry[i - 1]; - const double distStartSegmentSquared = LtsCoordTrans::squareDistance(curItem_geo.lon(), curItem_geo.lat(), trajectoryOrigin_geo.lon(), trajectoryOrigin_geo.lat()); + const double distStartSegmentSquared = LtsCoordTrans::squareDistance(curItem_geo.lon, curItem_geo.lat, trajectoryOrigin_geo.lon, trajectoryOrigin_geo.lat); // remove... if (distStartSegmentSquared > distToOriginSquared) { @@ -1273,17 +1273,17 @@ void ObjectExplosionCluster::adjustTrajectoryToDetonationLocation(int explosionI // // m_aiv2 CHANGES HERE // - std::vector &formRef = m_aiv2.form(); + std::vector &formRef = m_aiv2.form; Core::GeoPosition &curImpactPosRef = formRef[explosionIndex]; // compare former and updated ImpactPos: context intersection if (m_logger.isDebugEnabled()) { - LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon(), curImpactPosRef.lat()); - const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z()); + LtsCoordTrans::UtmCoordinate utm1 = LtsCoordTrans::UtmCoordinate::fromGeographic(curImpactPosRef.lon, curImpactPosRef.lat); + const QVector3D u1Vec(utm1.x, utm1.y, curImpactPosRef.z); - LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(intersectionLocation.lon(), intersectionLocation.lat(), utm1.zone); - const QVector3D u2Vec(utm2.x, utm2.y, intersectionLocation.z()); + LtsCoordTrans::UtmCoordinate utm2 = LtsCoordTrans::UtmCoordinate::fromGeographic(intersectionLocation.lon, intersectionLocation.lat, utm1.zone); + const QVector3D u2Vec(utm2.x, utm2.y, intersectionLocation.z); const QVector3D diff = u2Vec - u1Vec; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " for explosionIndex " << explosionIndex << ", curImpactPosRef " << curImpactPosRef << ", utm1 " << utm1 @@ -1295,11 +1295,11 @@ void ObjectExplosionCluster::adjustTrajectoryToDetonationLocation(int explosionI m_aiv2HasChanged = true; // Effects: - std::vector &singleEffectsRef = m_effects.singleEffects(); + std::vector &singleEffectsRef = m_effects.singleEffects; SingleEffect &ref = singleEffectsRef[explosionIndex]; // ref.effectState(AesSingleEffectState_def::SesScheduled); - ref.position(intersectionLocation); - ref.zPlacement(AesZPlacement_def::ZpAbsolute); // intersection: change from draped to relative + ref.position = intersectionLocation; + ref.zPlacement = AesZPlacement::ZpAbsolute; // intersection: change from draped to relative // m_effectsHaveChanged = true; if (explosionIndex == m_data.impactCount - 1) @@ -1392,7 +1392,7 @@ void ObjectExplosionCluster::publishAiv() if (bIsPoint && (m_lastSentTriggeredExplosionNumber == 1)) // 'move' only AFTER impact { // on svcRestart, m_aiv2 may not been set. To avoid crash: - const std::vector &formRef = m_aiv2.form(); + const std::vector &formRef = m_aiv2.form; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " since isPointSimilar==true form has to be updated" << ", m_data.effectStateId = " << m_data.effectStateId << ", m_data.impactWidth = " << m_data.impactWidth << ", m_lastSentTriggeredExplosionNumber = " << m_lastSentTriggeredExplosionNumber << ", formRef.size() = " << formRef.size(); @@ -1406,7 +1406,7 @@ void ObjectExplosionCluster::publishAiv() else { const Core::GeoPosition &impactPosition_geo3D = formRef[0]; - centerGeo = QPointF(impactPosition_geo3D.lon(), impactPosition_geo3D.lat()); + centerGeo = QPointF(impactPosition_geo3D.lon, impactPosition_geo3D.lat); } // ... and now take zog into account: double radius = m_data.impactWidth / 2.0; @@ -1425,22 +1425,22 @@ void ObjectExplosionCluster::publishAiv() // Major // AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.topLeft().x(), bounds.topLeft().y())); // QRectF's bigger values are at bottom - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.bottomRight().x(), bounds.bottomRight().y())); - aiv.aesTypeId(AesType::AtExplosionCluster); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtExplosionCluster); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.topLeft().x(), bounds.topLeft().y()); // QRectF's bigger values are at bottom + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.bottomRight().x(), bounds.bottomRight().y()); + aiv.aesTypeId = AesType::AtExplosionCluster; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtExplosionCluster); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; // ObjectBaseTmpl::checkIsCentral honors pdm->isLaserGuidable // and therefore isCentral is set to true; ) - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); // // SingleExplosions @@ -1449,33 +1449,33 @@ void ObjectExplosionCluster::publishAiv() if (isEcValid) { AesItemView aiv2(m_aiv2); - aiv2.aesItemId(m_data.id); - aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv2.effectStart(toMSec(m_data.effectStart)); + aiv2.aesItemId = m_data.id; + aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv2.effectStart = toMSec(m_data.effectStart); // calculate just one time. // maybe intersections of trajectories with building will 'adjust' some impact positions later. - if (aiv2.form().empty()) + if (aiv2.form.empty()) { if (isVulcano() || (m_data.externalId > 0)) // m_data.externalId > 0 -> HLA / SingleFire / PointGeometry { const QPointF &impactPointGeo = AreaEffectSimulation::Polygons::bottomLeft2CenterPoint(m_data.impactPosition, m_data.impactWidth, m_data.impactLength, m_data.rotationAngle); - ddsVecFromPoly(QVector() << impactPointGeo, aiv2.form()); + ddsVecFromPoly(QVector() << impactPointGeo, aiv2.form); } else { const QVector &singleExplosions = Polygons::explosionClusterSingleExplosionsGAUSS_Mtp(m_data, m_temporaryData.calculatedMhpRotationNorthDeg); - ddsVecFromPoly(singleExplosions, aiv2.form()); + ddsVecFromPoly(singleExplosions, aiv2.form); } } - aiv2.boundingBoxBottomLeft(aiv.boundingBoxBottomLeft()); - aiv2.boundingBoxTopRight(aiv.boundingBoxTopRight()); - aiv2.aesTypeId(AesType::AtExplosionClusterSingleExplosions); - aiv2.id(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions); - aiv2.effectStateId(effectState()); + aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft; + aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight; + aiv2.aesTypeId = AesType::AtExplosionClusterSingleExplosions; + aiv2.id = 1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions); + aiv2.effectStateId = effectState(); if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; // // m_aiv2 CHANGES HERE @@ -1489,25 +1489,25 @@ void ObjectExplosionCluster::publishAiv() // emit newAiv(aiv2); // } - m_effects.id(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions); - m_effects.aesItemId(m_data.id); - m_effects.aesTypeId(AesType::AtExplosionClusterSingleExplosions); - std::vector &singleEffectsRef = m_effects.singleEffects(); + m_effects.id = 1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions); + m_effects.aesItemId = m_data.id; + m_effects.aesTypeId = AesType::AtExplosionClusterSingleExplosions; + std::vector &singleEffectsRef = m_effects.singleEffects; if (singleEffectsRef.empty()) { if (isVulcano() || (m_data.externalId > 0)) // m_data.externalId > 0 -> HLA / SingleFire / PointGeometry { singleEffectsRef.resize(1); SingleEffect &seRef = singleEffectsRef.front(); - seRef.singleEffectState(AesSingleEffectState_def::SesScheduled); + seRef.singleEffectState = AesSingleEffectState::SesScheduled; const QPointF &impactPointGeo = AreaEffectSimulation::Polygons::bottomLeft2CenterPoint(m_data.impactPosition, m_data.impactWidth, m_data.impactLength, m_data.rotationAngle); // seRef.position(Core::GeoPosition(impactPointGeo.x(), impactPointGeo.y(), 0.0)); const double elevation = getElevationFor(impactPointGeo, QStringLiteral("getElevationForSingleImpactVulcano")); - seRef.position(Core::GeoPosition(impactPointGeo.x(), impactPointGeo.y(), elevation)); + seRef.position = Core::GeoPosition(impactPointGeo.x(), impactPointGeo.y(), elevation); - seRef.zPlacement(AesZPlacement_def::ZpDraped); + seRef.zPlacement = AesZPlacement::ZpDraped; } else { @@ -1518,13 +1518,13 @@ void ObjectExplosionCluster::publishAiv() for (const QPointF &singleExplosion : qAsConst(singleExplosions)) { SingleEffect se; - se.singleEffectState(AesSingleEffectState_def::SesScheduled); + se.singleEffectState = AesSingleEffectState::SesScheduled; // se.position(Core::GeoPosition(singleExplosion.x(), singleExplosion.y(), 0.0)); const double elevation = getElevationFor(singleExplosion, QStringLiteral("getElevationForSingleEffect")); - se.position(Core::GeoPosition(singleExplosion.x(), singleExplosion.y(), elevation)); + se.position = Core::GeoPosition(singleExplosion.x(), singleExplosion.y(), elevation); - se.zPlacement(AesZPlacement_def::ZpDraped); + se.zPlacement = AesZPlacement::ZpDraped; // // se.effectTime(); singleEffectsRef.push_back(se); ++explosionIndex; @@ -1535,11 +1535,11 @@ void ObjectExplosionCluster::publishAiv() else { auto dts = m_mainHandler->dds()->dts(); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions)); // up to s_maxTrajectoriesPerExplosionCluster are supported. One sample per trajectory. const bool errorMsgIfSampleDoesNotExists = false; - dts->removeEffectsByKey(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions, errorMsgIfSampleDoesNotExists); + dts->removeEffectsByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions), errorMsgIfSampleDoesNotExists); } // @@ -1558,49 +1558,49 @@ void ObjectExplosionCluster::publishAiv() // AtExplosionClusterGunToTargetLine is suppressed at map display, when main object changes to EsActivated // So it does not have to be changed/published anymore. // Especially helpful while restarting scvAes! - static QVector relevantEffStates = { - AesEffectState_def::EsCreated, - AesEffectState_def::EsPrepared, - AesEffectState_def::EsActivated, // 2026-05-27, N.Thoden: E01562-393: GTL auch bei EsFired anzeigen, daher auch bei EsActivated - AesEffectState_def::EsFired, // 2026-05-27, N.Thoden: E01562-393: GTL auch bei EsFired anzeigen + static QVector relevantEffStates = { + AesEffectState::EsCreated, + AesEffectState::EsPrepared, + AesEffectState::EsActivated, // 2026-05-27, N.Thoden: E01562-393: GTL auch bei EsFired anzeigen, daher auch bei EsActivated + AesEffectState::EsFired, // 2026-05-27, N.Thoden: E01562-393: GTL auch bei EsFired anzeigen }; - DEBUG_LOG(m_logger) << " AtExplosionClusterGunToTargetLine RELEVANT " << relevantEffStates.contains(effectState().underlying()) << ", id " << m_data.id; + DEBUG_LOG(m_logger) << " AtExplosionClusterGunToTargetLine RELEVANT " << relevantEffStates.contains(effectState()) << ", id " << m_data.id; if (isEcValid && isOriginatorParticipantIdProvided() && // no Originator -> no curve - relevantEffStates.contains(effectState().underlying())) + relevantEffStates.contains(effectState())) { AesItemView aiv3(m_aivGunToTargetTrajectory); - aiv3.aesItemId(m_data.id); - aiv3.chargeStruct().chargeTypeId(m_data.chargeTypeId); + aiv3.aesItemId = m_data.id; + aiv3.chargeStruct.chargeTypeId = m_data.chargeTypeId; // aiv3.effectStart(0); - if (aiv3.form().empty()) + if (aiv3.form.empty()) { const std::vector &form = ObjectExplosionCluster::generateGunToTargetForm(); - aiv3.form(form); + aiv3.form = form; if (form.size() > 2) { QPolygonF polyGTL; polyGTL.reserve(2); - polyGTL.push_back(QPointF(form.front().lon(), form.front().lat())); - polyGTL.push_back(QPointF(form.back().lon(), form.back().lat())); + polyGTL.push_back(QPointF(form.front().lon, form.front().lat)); + polyGTL.push_back(QPointF(form.back().lon, form.back().lat)); const QRectF boundsGTL(polyGTL.boundingRect()); - aiv3.boundingBoxBottomLeft(Core::GeoPosition2D(boundsGTL.topLeft().x(), boundsGTL.topLeft().y())); // QRectF's bigger values are at bottom - aiv3.boundingBoxTopRight(Core::GeoPosition2D(boundsGTL.bottomRight().x(), boundsGTL.bottomRight().y())); + aiv3.boundingBoxBottomLeft = Core::GeoPosition2D(boundsGTL.topLeft().x(), boundsGTL.topLeft().y()); // QRectF's bigger values are at bottom + aiv3.boundingBoxTopRight = Core::GeoPosition2D(boundsGTL.bottomRight().x(), boundsGTL.bottomRight().y()); } } - aiv3.aesTypeId(AesType::AtExplosionClusterGunToTargetLine); - aiv3.id(1000 * m_data.id + AesType::AtExplosionClusterGunToTargetLine); + aiv3.aesTypeId = AesType::AtExplosionClusterGunToTargetLine; + aiv3.id = 1000 * m_data.id + static_cast(AesType::AtExplosionClusterGunToTargetLine); // aiv3.effectStateId(effectState()); if (m_data.partyId != 0) - aiv3.partyId(m_data.partyId); + aiv3.partyId = m_data.partyId; if (m_aivGunToTargetTrajectoryDirty || (aiv3 != m_aivGunToTargetTrajectory)) { m_aivGunToTargetTrajectoryDirty = false; m_aivGunToTargetTrajectory = aiv3; - aiv3.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + aiv3.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store m_mainHandler->dds()->dts()->publish(aiv3); emit newAiv(aiv3); } @@ -1609,7 +1609,7 @@ void ObjectExplosionCluster::publishAiv() { auto dts = m_mainHandler->dds()->dts(); const bool errorMsgIfSampleDoesNotExists = false; - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionClusterGunToTargetLine, errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterGunToTargetLine), errorMsgIfSampleDoesNotExists); } // if (!setupParticipantOrigin()) @@ -1620,7 +1620,7 @@ void ObjectExplosionCluster::publishAiv() if (aiv != m_aiv) { m_aiv = aiv; - aiv.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + aiv.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); } @@ -1642,12 +1642,12 @@ void ObjectExplosionCluster::removeTopics() dts->removeExplosionClusterByKey(m_data.id, errorMsgIfSampleDoesNotExists); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionCluster, errorMsgIfSampleDoesNotExists); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions, errorMsgIfSampleDoesNotExists); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionClusterGunToTargetLine, errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionCluster), errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions), errorMsgIfSampleDoesNotExists); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterGunToTargetLine), errorMsgIfSampleDoesNotExists); // ti.id(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions); - dts->removeTriggeredImpactsByKey(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions, errorMsgIfSampleDoesNotExists); + dts->removeTriggeredImpactsByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions), errorMsgIfSampleDoesNotExists); #ifdef USE_TRAJECTORY_VIA_HANDLER // remove TrajectoryTimeAware created via Handler: @@ -1666,7 +1666,7 @@ void ObjectExplosionCluster::removeTopics() // Effects / Impacts // m_effects.id (1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions) - dts->removeEffectsByKey(1000 * m_data.id + AesType::AtExplosionClusterSingleExplosions, errorMsgIfSampleDoesNotExists); + dts->removeEffectsByKey(1000 * m_data.id + static_cast(AesType::AtExplosionClusterSingleExplosions), errorMsgIfSampleDoesNotExists); emit removeAiv(m_data.id); } @@ -1694,7 +1694,7 @@ void ObjectExplosionCluster::removeTopics() //{ // m_singleExplosionTriggerTimer->stop(); -// if (m_data.effectStateId != AesEffectState_def::EsActivated) +// if (m_data.effectStateId != AesEffectState::EsActivated) // return; // // int chargeCountUntilLastStart = lrint((m_data.originalEffectDuration - m_data.effectDuration) / impactDeltaMSec()); @@ -1752,7 +1752,7 @@ void ObjectExplosionCluster::checkNextFire() // if (m_data.name.startsWith(QStringLiteral("SAAB"))) // return; - if (m_data.effectStateId == AreaEffectSimulation::AesEffectState_def::EsCreated) + if (m_data.effectStateId == AreaEffectSimulation::AesEffectState::EsCreated) { DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " OBJECT IS EsCreated, RETURN;"; return; @@ -1923,7 +1923,7 @@ void ObjectExplosionCluster::onFiringTimerImpact(int currentExplosionNumber, int const int curExplosionIndex = currentExplosionNumber - 1; // Effects: - std::vector &singleEffectsRef = m_effects.singleEffects(); + std::vector &singleEffectsRef = m_effects.singleEffects; if (singleEffectsRef.empty()) { WARNING_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " singleEffectsRef empty, currentExplosionNumber" << currentExplosionNumber; @@ -1938,16 +1938,16 @@ void ObjectExplosionCluster::onFiringTimerImpact(int currentExplosionNumber, int continue; SingleEffect &ref = singleEffectsRef[idx]; - if (ref.singleEffectState().underlying() != AesSingleEffectState_def::SesTriggered) + if (ref.singleEffectState != AesSingleEffectState::SesTriggered) { - ref.singleEffectState(AesSingleEffectState_def::SesTriggered); - ref.singleEffectTime(curPartTime); + ref.singleEffectState = AesSingleEffectState::SesTriggered; + ref.singleEffectTime = curPartTime; bChanged = true; } } // for if (bChanged) { - m_effects.sampleTime(curPartTime); + m_effects.sampleTime = curPartTime; m_mainHandler->dds()->dts()->publish(m_effects); } } // if (singleEffectsRef.empty()) @@ -1976,18 +1976,18 @@ void ObjectExplosionCluster::onFiringTimerStateChangeDelayedCommandAsInt(int cmd // setEffectState(AesEffectState::EsActivated); // return true; - AesEffectState newState = AesEffectState_def::EsUnknown; + AesEffectState newState = AesEffectState::EsUnknown; switch (cmd) { case FiringTimer::CMD::CMD_START: case FiringTimer::CMD::CMD_RESUME: - newState = AesEffectState_def::EsActivated; + newState = AesEffectState::EsActivated; m_data.effectStart = partitionTime(); break; case FiringTimer::CMD::CMD_PAUSE: { - newState = AesEffectState_def::EsPaused; + newState = AesEffectState::EsPaused; m_data.effectStart = QDateTime(); // Invalid QDateTime to mark it paused // @@ -2015,7 +2015,7 @@ void ObjectExplosionCluster::onFiringTimerStateChangeDelayedCommandAsInt(int cmd } break; case FiringTimer::CMD::CMD_EXPIRED_PLUS: - newState = AesEffectState_def::EsExpired; + newState = AesEffectState::EsExpired; DEBUG_LOG(m_logger) << "Expired!"; m_data.effectDuration = m_data.originalEffectDuration; m_data.effectStart = m_data.originalEffectStart; @@ -2029,7 +2029,7 @@ void ObjectExplosionCluster::onFiringTimerStateChangeDelayedCommandAsInt(int cmd DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " got signal stateChangeDelayed, setNewState " << newState << ", m_data.effectDuration = " << m_data.effectDuration << ", m_data.remainExplosionNumber (nextExplosion) = " << m_data.remainExplosionNumber; - if (newState != AesEffectState_def::EsUnknown) + if (newState != AesEffectState::EsUnknown) setEffectState(newState); } @@ -2084,12 +2084,12 @@ bool ObjectExplosionCluster::generateTrajectory(int explosionNumber, bool startD else { // take impactPosition from form: - const std::vector &formRef = m_aiv2.form(); + const std::vector &formRef = m_aiv2.form; Q_ASSERT(formRef.size() > 0); Q_ASSERT(explosionIndex >= 0); const Core::GeoPosition &impactPosition_geo3D = formRef[explosionIndex]; - endPosition_geo2D = QPointF(impactPosition_geo3D.lon(), impactPosition_geo3D.lat()); + endPosition_geo2D = QPointF(impactPosition_geo3D.lon, impactPosition_geo3D.lat); DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " *** generateTrajectory to: explosionIndex=" << explosionIndex << ", endPosition_geo2D = " << endPosition_geo2D; } @@ -2276,8 +2276,8 @@ bool ObjectExplosionCluster::generateTrajectory(int explosionNumber, bool startD else { DetonationLocationReply reply; - reply.id(m_data.id); - reply.index(explosionIndex); + reply.id = m_data.id; + reply.index = explosionIndex; // reply.position(); // leave on default :-) onDetonationLocationReply(reply); } @@ -2373,7 +2373,7 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb alphaRad, tapTime, options, - tdRef.trajectoryTimeAware.geometry(), + tdRef.trajectoryTimeAware.geometry, idealTapAbsoluteGeoOut, &localReasonOut); if (!localReasonOut.isEmpty()) @@ -2399,7 +2399,7 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb if (m_data.cloudBase > std::numeric_limits::min()) { // get access to point tapT: - std::vector &geometryRef = tdRef.trajectoryTimeAware.geometry(); + std::vector &geometryRef = tdRef.trajectoryTimeAware.geometry; std::vector::reverse_iterator rit = geometryRef.rbegin(); const Core::GeoPositionRelativeTime impact = *rit; @@ -2407,7 +2407,7 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb ++rit; const Core::GeoPositionRelativeTime tapT = *rit; - const bool bTapT_strichRequested = (m_data.cloudBase < tapT.z()) && (impact.z() < m_data.cloudBase); + const bool bTapT_strichRequested = (m_data.cloudBase < tapT.z) && (impact.z < m_data.cloudBase); ERROR_LOG(m_logger) << " XXX cloudBase modification: " << ", tapT = " << tapT << ", m_data.cloudBase = " << m_data.cloudBase << ", impact = " << impact @@ -2415,11 +2415,11 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb if (bTapT_strichRequested) { - const LtsCoordTrans::UtmCoordinate impactUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(impact.lon(), impact.lat()); - const LtsCoordTrans::UtmCoordinate tapTUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(tapT.lon(), tapT.lat(), impactUtm.zone); + const LtsCoordTrans::UtmCoordinate impactUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(impact.lon, impact.lat); + const LtsCoordTrans::UtmCoordinate tapTUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(tapT.lon, tapT.lat, impactUtm.zone); - const QVector3D impactVec3D(impactUtm.x, impactUtm.y, impact.z()); - const QVector3D tapTVec3D(tapTUtm.x, tapTUtm.y, tapT.z()); + const QVector3D impactVec3D(impactUtm.x, impactUtm.y, impact.z); + const QVector3D tapTVec3D(tapTUtm.x, tapTUtm.y, tapT.z); /* x | Tap (aka TapT) // \ | @@ -2457,14 +2457,14 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb const QPointF &tapT_strichGeo = tapT_strichUtm.geographic(); // Time - double timeOffset = impact.relativeTime() - tapT.relativeTime(); + double timeOffset = impact.relativeTime - tapT.relativeTime; timeOffset *= scaleFactor; Core::GeoPositionRelativeTime tapT_strichRelTime; - tapT_strichRelTime.lon() = tapT_strichGeo.x(); - tapT_strichRelTime.lat() = tapT_strichGeo.y(); - tapT_strichRelTime.z() = tapT_strich.z(); - tapT_strichRelTime.relativeTime(impact.relativeTime() - timeOffset); + tapT_strichRelTime.lon = tapT_strichGeo.x(); + tapT_strichRelTime.lat = tapT_strichGeo.y(); + tapT_strichRelTime.z = tapT_strich.z(); + tapT_strichRelTime.relativeTime = impact.relativeTime - timeOffset; DEBUG_LOG(m_logger) << " tapT_strichRelTime " << tapT_strichRelTime; @@ -2478,7 +2478,7 @@ bool ObjectExplosionCluster::generateTrajectoryVulcanoSpecific(int explosionNumb // "convert" from time-aware curve 'back' to time-unaware trajectoryGeometry tdRef.trajectoryGeometry.clear(); - for (const Core::GeoPositionRelativeTime &geoPosRelTime : qAsConst(tdRef.trajectoryTimeAware.geometry())) + for (const Core::GeoPositionRelativeTime &geoPosRelTime : qAsConst(tdRef.trajectoryTimeAware.geometry)) tdRef.trajectoryGeometry.emplace_back(geoPosRelTime); // implicit // downcast tdRef.peakHeightAbs = peakHeightRelToOrigin + originatorPosition_geo.z(); @@ -2523,17 +2523,17 @@ bool ObjectExplosionCluster::getFiringUnitOrigin(const int firingParticipantId, return false; } - const bool isLeaf = ppmDtc->participant(firingParticipantId).inferiorIds().empty(); // isLeaf means single (Participant and not a Unit) + const bool isLeaf = ppmDtc->participant(firingParticipantId).inferiorIds.empty(); // isLeaf means single (Participant and not a Unit) if (isLeaf) { const ParticipantManagement::ParticipantPosition &partPos = ppmDtc->participantPosition(firingParticipantId); - if (partPos.participantId() != firingParticipantId) + if (partPos.participantId != firingParticipantId) return false; // relative zValue -> absolute zValue: // Keep NASAT in mind sending 'height' via NasatPosition (normally, 'height' is relative to ground) - const double zValue = getElevationFor({partPos.pos().lon(), partPos.pos().lat()}, QString(QStringLiteral("participantPosition_partId=%1")).arg(firingParticipantId)); - firingOriginOut = LtsUtils::QPoint3D(partPos.pos().lon(), partPos.pos().lat(), partPos.pos().z() + zValue); + const double zValue = getElevationFor({partPos.pos.lon, partPos.pos.lat}, QString(QStringLiteral("participantPosition_partId=%1")).arg(firingParticipantId)); + firingOriginOut = LtsUtils::QPoint3D(partPos.pos.lon, partPos.pos.lat, partPos.pos.z + zValue); } else { @@ -2552,8 +2552,8 @@ bool ObjectExplosionCluster::getFiringUnitOrigin(const int firingParticipantId, int idx = 0; for (Core::GeoPosition &geoPosRef : m_temporaryData.singleFiringPositions) { - const double zValue = getElevationFor({geoPosRef.lon(), geoPosRef.lat()}, QString(QStringLiteral("firingCannonPosition_index_%1")).arg(idx++)); - geoPosRef.z(zValue); + const double zValue = getElevationFor({geoPosRef.lon, geoPosRef.lat}, QString(QStringLiteral("firingCannonPosition_index_%1")).arg(idx++)); + geoPosRef.z = zValue; } if (m_logger.isDebugEnabled()) for (const Core::GeoPosition geoPosRef : m_temporaryData.singleFiringPositions) @@ -2632,10 +2632,10 @@ LtsUtils::QPoint3D ObjectExplosionCluster::getFiringCannonGeoPosition(int explos Core::GeoPosition geoPos = m_temporaryData.getFiringCannonGeoPosition(explosionIndex); // in case of missing coordinates for single cannons (or ModuleTest): - if (std::isnan(geoPos.lon()) || std::isnan(geoPos.lat()) || std::isnan(geoPos.z())) + if (std::isnan(geoPos.lon) || std::isnan(geoPos.lat) || std::isnan(geoPos.z)) return m_data.firingCenterPosition; - return LtsUtils::QPoint3D(geoPos.lon(), geoPos.lat(), geoPos.z()); + return LtsUtils::QPoint3D(geoPos.lon, geoPos.lat, geoPos.z); } LtsUtils::QPoint3D ObjectExplosionCluster::getFiringCannonUtmPosition(int explosionIndex, int zoneToUse) const @@ -2703,19 +2703,19 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex) // enable access to TracjectoryData and add time-awarenes TracjectoryData &tdRef = m_trajectoryCont[explosionIndex]; TrajectoryTimeAware &trajectoryTimeAwareRef = tdRef.trajectoryTimeAware; - trajectoryTimeAwareRef.id(1000 * m_data.id + 100 + explosionIndex); - trajectoryTimeAwareRef.sampleTime(partitionTimeMSec()); + trajectoryTimeAwareRef.id = 1000 * m_data.id + 100 + explosionIndex; + trajectoryTimeAwareRef.sampleTime = partitionTimeMSec(); // [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) // trajectoryTimeAwareRef.aesItemId(m_data.id); // trajectoryTimeAwareRef.aesTypeId(AesType::AtExplosionClusterSingleTrajectory); - trajectoryTimeAwareRef.index(explosionIndex); + trajectoryTimeAwareRef.index = explosionIndex; if (isVulcano()) { // Time: - trajectoryTimeAwareRef.trajectoryStartTime(m_data.effectStart.toMSecsSinceEpoch() - m_temporaryData.calculatedFlightDurationMsec); + trajectoryTimeAwareRef.trajectoryStartTime = m_data.effectStart.toMSecsSinceEpoch() - m_temporaryData.calculatedFlightDurationMsec; #ifdef USE_TRAJECTORY_VIA_HANDLER publishTrajectoryViaHandler(trajectoryTimeAwareRef); @@ -2731,7 +2731,7 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex) { // Time: // use sample time since FiringTimer is initiates trajectory calculation - trajectoryTimeAwareRef.trajectoryStartTime(trajectoryTimeAwareRef.sampleTime()); + trajectoryTimeAwareRef.trajectoryStartTime = trajectoryTimeAwareRef.sampleTime; const std::vector &trajectoryGeometry = tdRef.trajectoryGeometry; Core::GeoPosition first; @@ -2740,7 +2740,7 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex) DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " trajectoryGeometry=" << trajectoryGeometry.size() << ", first = " << first; - std::vector &geometryRef = trajectoryTimeAwareRef.geometry(); + std::vector &geometryRef = trajectoryTimeAwareRef.geometry; geometryRef.clear(); geometryRef.reserve(trajectoryGeometry.size()); int idx = 0; @@ -2772,7 +2772,7 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex) } // if ((trajSize > 20) && (idx>1)) } // if (!m_isAirSupportSource) - geometryRef.emplace_back(Core::GeoPositionRelativeTime(pos3D.lon(), pos3D.lat(), pos3D.z(), idx * flightDurationMSecSeg)); + geometryRef.emplace_back(Core::GeoPositionRelativeTime(pos3D.lon, pos3D.lat, pos3D.z, idx * flightDurationMSecSeg)); ++idx; } // for @@ -2785,7 +2785,7 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex) #endif DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " explosionIndex=" << explosionIndex << " has flightDurationMSecSeg=" << flightDurationMSecSeg - << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime() << ", geometry().size() = " << trajectoryTimeAwareRef.geometry().size(); + << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime << ", geometry().size() = " << trajectoryTimeAwareRef.geometry.size(); #ifdef USE_TRAJECTORY_VIA_HANDLER publishTrajectoryViaHandler(trajectoryTimeAwareRef); @@ -2801,20 +2801,20 @@ void ObjectExplosionCluster::publishTrajectory(int explosionIndex) m_publisedTrajectoriesForDebug[explosionIndex] = QString(QStringLiteral("trajectoryPublished m_data.id=%1 - explosionIndex=%2 - trajectoryStarttime=%3 - size=%4")) .arg(m_data.id) .arg(explosionIndex) - .arg(trajectoryTimeAwareRef.trajectoryStartTime()) - .arg(trajectoryTimeAwareRef.geometry().size()); + .arg(trajectoryTimeAwareRef.trajectoryStartTime) + .arg(trajectoryTimeAwareRef.geometry.size()); DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " add to m_publisedTrajectoriesForDebug " << m_publisedTrajectoriesForDebug[explosionIndex]; DEBUG_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " add to m_publisedTrajectoriesForDebug.size = " << m_publisedTrajectoriesForDebug.size(); - TRACE_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " XXXX 4 trajectoryTimeAware.geometry().size() = " << trajectoryTimeAwareRef.geometry().size() + TRACE_LOG(m_logger) << LOGFUNCTION << " " << m_data.id << " XXXX 4 trajectoryTimeAware.geometry().size() = " << trajectoryTimeAwareRef.geometry.size() // << ", bPublished=" << bPublished ; } void ObjectExplosionCluster::publishTrajectoryViaHandler(const TrajectoryTimeAware &trajectoryTimeAwareRef) { - const int explosionIndex = trajectoryTimeAwareRef.index(); + const int explosionIndex = trajectoryTimeAwareRef.index; TrajectoryData trajData; trajData.id = m_trajectoryHandlerExplosionIndexToTopicId.value(explosionIndex, -1); // default value of -1 mean, create @@ -2824,17 +2824,17 @@ void ObjectExplosionCluster::publishTrajectoryViaHandler(const TrajectoryTimeAwa // trajData.aesTypeId = AesType::AtExplosionClusterSingleTrajectory; trajData.index = explosionIndex; trajData.originatorId = m_data.id; // m_data.id == aesItemId - trajData.originatorTypeId = ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation; + trajData.originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation; - trajData.startTime = trajectoryTimeAwareRef.trajectoryStartTime(); - trajData.geometry = trajectoryTimeAwareRef.geometry(); + trajData.startTime = trajectoryTimeAwareRef.trajectoryStartTime; + trajData.geometry = trajectoryTimeAwareRef.geometry; const int id = m_mainHandler->trajectoryHandler()->createUpdate(trajData); DEBUG_LOG(m_logger) << LOGFUNCTION << "trajectoryHandler::createUpdate with id= " << id; if (id < 0) { ERROR_LOG(m_logger) << LOGFUNCTION << " ERROR, publish failed" << m_data.id << " explosionIndex=" << explosionIndex - << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime() << ", geometry().size() = " << trajectoryTimeAwareRef.geometry().size(); + << ", startTime = " << trajectoryTimeAwareRef.trajectoryStartTime << ", geometry().size() = " << trajectoryTimeAwareRef.geometry.size(); } // update internal lookup table: @@ -2995,12 +2995,12 @@ void ObjectExplosionCluster::dump(const char *file, int lineNo) const DetonationLocationRequest ObjectExplosionCluster::detonationLocationRequest(int explosionIndex) const { DetonationLocationRequest req; - req.id(m_data.id); // m_data.id == AesItemId - req.index(explosionIndex); - req.chargeTypeId(m_data.chargeTypeId); - req.igniterTypeId(m_data.igniterTypeId); - req.igniterFunctionId(m_data.igniterFunctionId); - req.trajectory(m_trajectoryCont[explosionIndex].trajectoryGeometry); + req.id = m_data.id; // m_data.id == AesItemId + req.index = explosionIndex; + req.chargeTypeId = m_data.chargeTypeId; + req.igniterTypeId = m_data.igniterTypeId; + req.igniterFunctionId = m_data.igniterFunctionId; + req.trajectory = m_trajectoryCont[explosionIndex].trajectoryGeometry; return req; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.h index bf1983bfd..fd200c2bf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_cluster.h @@ -79,7 +79,7 @@ public: bool initialCalculations(QString *reasonOut = nullptr); void abortPreStartTimer(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtExplosionArea; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.cpp index d48d0adb0..04db053e3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.cpp @@ -169,23 +169,23 @@ void ObjectExplosionSingle::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv.form()); - aiv.effectStart(toMSec(m_data.effectStart)); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtExplosionSingle); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtExplosionSingle); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv.form); + aiv.effectStart = toMSec(m_data.effectStart); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtExplosionSingle; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtExplosionSingle); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -196,7 +196,7 @@ void ObjectExplosionSingle::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeExplosionSingleByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtExplosionSingle); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtExplosionSingle)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.h index 02b3945a7..5d91a64b7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_explosion_single.h @@ -33,7 +33,7 @@ public: bool removeObjectFromDb(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtExplosionSingle; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.cpp index 45851634c..2151831a9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.cpp @@ -42,7 +42,7 @@ Core::FunctionReplyObject ObjectFunctionalArea::createObject(const Database::Aes m_dataAesFunctionalArea = data; - if (data.supplyMode == AesOperatingMode_def::OmWaitingTime) + if (data.supplyMode == AesOperatingMode::OmWaitingTime) { setIsCentral = true; m_data.participantId = data.participantId; @@ -198,23 +198,23 @@ void ObjectFunctionalArea::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtFunctionalArea); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtFunctionalArea); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtFunctionalArea; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtFunctionalArea); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -225,7 +225,7 @@ void ObjectFunctionalArea::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeFunctionalAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtFunctionalArea); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtFunctionalArea)); emit removeAiv(m_data.id); } @@ -237,7 +237,7 @@ QPolygonF ObjectFunctionalArea::generateForm() QPointF ObjectFunctionalArea::geographic2Utm(const Core::GeoPosition2D &geoPos, int *zone) { const int zoneToUse = zone ? *zone : -1; - auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat(), zoneToUse); + auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat, zoneToUse); if (zone) *zone = utm.zone; return QPointF(utm.x, utm.y); @@ -247,10 +247,10 @@ QPointF ObjectFunctionalArea::geographic2Utm(const Core::GeoPosition2D &geoPos, void ObjectFunctionalArea::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType) { - if (modType != DataModification::eRemoved && (data.participantId() == m_data.participantId)) + if (modType != DataModification::eRemoved && (data.participantId == m_data.participantId)) { DEBUG_LOG(m_logger) << " onParticipantPositionChanged....." - << " participantId=" << data.participantId() + << " participantId=" << data.participantId << " aesId=" << m_data.id << " suppyParticipantId=" << m_data.participantId; DEBUG_LOG(m_logger) << "Supply Truck: onParticipantPositionChanged: " << data; @@ -258,10 +258,10 @@ void ObjectFunctionalArea::onParticipantPositionChanged(const ParticipantManagem { int zone = -1; - DEBUG_LOG(m_logger) << "New Supply Truck Position participantId: " << data.participantId() - << " pos: lat=" << data.pos().lat() << " lon=" << data.pos().lon(); + DEBUG_LOG(m_logger) << "New Supply Truck Position participantId: " << data.participantId + << " pos: lat=" << data.pos.lat << " lon=" << data.pos.lon; - const QPointF participantPosUtmPoint = geographic2Utm(data.pos(), &zone); + const QPointF participantPosUtmPoint = geographic2Utm(data.pos, &zone); DEBUG_LOG(m_logger) << "participantPosUtmPoint=" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y() << " zone=" << zone; @@ -275,7 +275,7 @@ void ObjectFunctionalArea::onParticipantPositionChanged(const ParticipantManagem //double squareDistance = LtsCoordTrans::squareDistance(participantPosUtmPoint, activationPosUtmPoint); - const double distanceSquared = LtsCoordTrans::squareDistance(data.pos().lon(), data.pos().lat(), m_activatePos.lon(), m_activatePos.lat()); + const double distanceSquared = LtsCoordTrans::squareDistance(data.pos.lon, data.pos.lat, m_activatePos.lon, m_activatePos.lat); DEBUG_LOG(m_logger) << "squareDistance=" << distanceSquared << " distance = " << sqrt(distanceSquared) << " getMaximumStepLengthStanding=" << Settings::getMaximumStepLengthStanding(); @@ -299,23 +299,23 @@ void ObjectFunctionalArea::onParticipantPositionChanged(const ParticipantManagem } } } - m_data.position.setX(data.pos().lon()); - m_data.position.setY(data.pos().lat()); - m_data.partyId = data.partyId(); + m_data.position.setX(data.pos.lon); + m_data.position.setY(data.pos.lat); + m_data.partyId = data.partyId; m_data.isCentral = true; - m_dataAesFunctionalArea.position.setX(data.pos().lon()); - m_dataAesFunctionalArea.position.setY(data.pos().lat()); - m_dataAesFunctionalArea.partyId = data.partyId(); + m_dataAesFunctionalArea.position.setX(data.pos.lon); + m_dataAesFunctionalArea.position.setY(data.pos.lat); + m_dataAesFunctionalArea.partyId = data.partyId; m_dataAesFunctionalArea.isCentral = true; { int zone = -1; - const QPointF participantPosUtmPoint = geographic2Utm(data.pos(), &zone); + const QPointF participantPosUtmPoint = geographic2Utm(data.pos, &zone); QPointF utmPointShift; utmPointShift.setX(participantPosUtmPoint.x() - m_dataAesFunctionalArea.length / 2); utmPointShift.setY(participantPosUtmPoint.y() - m_dataAesFunctionalArea.width / 2); - DEBUG_LOG(m_logger) << "data.pos=" << data.pos() + DEBUG_LOG(m_logger) << "data.pos=" << data.pos << " participantPosUtmPoint=" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y() << " utmPointShift=" << utmPointShift.x() << "/" << utmPointShift.y() << " length=" << m_dataAesFunctionalArea.length @@ -330,8 +330,8 @@ void ObjectFunctionalArea::onParticipantPositionChanged(const ParticipantManagem QPointF point = utm.geographic(); - m_activatePos.lon(point.x()); - m_activatePos.lat(point.y()); + m_activatePos.lon = point.x(); + m_activatePos.lat = point.y(); m_dataAesFunctionalArea.position.setX(point.x()); m_dataAesFunctionalArea.position.setY(point.y()); m_data.position.setX(point.x()); @@ -361,7 +361,7 @@ void ObjectFunctionalArea::myTimerSlot() // m_activePosAvailable = false; m_data.effectStateId = AesEffectState::EsActivated; m_dataAesFunctionalArea.effectStateId = AesEffectState::EsActivated; - DEBUG_LOG(m_logger) << "TimerSlot Setze Supply-Truck active aesItemId=" << m_aiv.aesItemId() + DEBUG_LOG(m_logger) << "TimerSlot Setze Supply-Truck active aesItemId=" << m_aiv.aesItemId << " participantId=" << m_data.participantId << " effectStateId=" << m_data.effectStateId; DEBUG_LOG(m_logger) << "onParticipantPositionChanged: Vor updateObject"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.h index 26ecc0fd9..d7fb585fc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_functional_area.h @@ -33,12 +33,12 @@ public: bool removeObjectFromDb(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtFunctionalArea; } bool isCentral() const override { - if (m_data.supplyMode == AesOperatingMode_def::OmWaitingTime) + if (m_data.supplyMode == AesOperatingMode::OmWaitingTime) return true; return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.cpp index 54e538482..c964a1376 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.cpp @@ -39,7 +39,7 @@ Core::FunctionReplyObject ObjectGasPipe::createObject(const Database::AesGasPipe m_data.operatorId = dbData.operatorId; m_data.partyId = dbData.partyId; m_data.effectStart = dbData.effectStart; - m_data.effectStateId = AreaEffectSimulation::AesEffectState_def::EsCreated; + m_data.effectStateId = AreaEffectSimulation::AesEffectState::EsCreated; m_data.effectDuration = dbData.effectDuration; m_data.chargeTypeId = 461; // 105 Dummy @@ -61,7 +61,7 @@ Core::FunctionReplyObject ObjectGasPipe::createObject(const Database::AesGasPipe { dbSegment.id = 0; // Reset for insert. Otherwise second segment cannot be inserted! dbSegment.gasPipeId = m_data.privGasPipeId; // db - dbSegment.position = QPointF(ddsSegments[i].lon(), ddsSegments[i].lat()); + dbSegment.position = QPointF(ddsSegments[i].lon, ddsSegments[i].lat); dbSegment.positionIndex = i; if (!m_mainHandler->db()->insert(dbSegment)) @@ -128,7 +128,7 @@ Core::FunctionReplyObject ObjectGasPipe::updateObject(const Database::AesGasPipe // update all segments in tmpDbSegments for (size_t i = 0; i < ddsSegments.size(); ++i) { - tmpDbSegments[i].position = QPointF(ddsSegments[i].lon(), ddsSegments[i].lat()); + tmpDbSegments[i].position = QPointF(ddsSegments[i].lon, ddsSegments[i].lat); tmpDbSegments[i].positionIndex = i; } @@ -183,20 +183,20 @@ void ObjectGasPipe::onPublishData() AreaEffectSimulation::GasPipe ddsData; - ddsData.id(m_data.id); - ddsData.name(m_data.name.toStdString()); - ddsData.isDeleted(effectState() == AesEffectState::EsRemoved); - ddsData.isUsed(false); - ddsData.sampleTime(m_mainHandler->dds()->currentPartitionTimeMSec()); - ddsData.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsData.effectDuration(m_data.effectDuration); - ddsData.effectStart(toOptional(toMSec(m_data.effectStart))); - ddsData.width(m_data.width); - ddsData.effectStateId(effectState()); - ddsData.partyId(toOptional(m_data.partyId)); - ddsData.participantId(toOptional(m_data.participantId)); - ddsData.isCentral(m_data.isCentral); - dbSegment2DdsSegment(m_dbSegments, ddsData.segments()); + ddsData.id = m_data.id; + ddsData.name = m_data.name.toStdString(); + ddsData.isDeleted = effectState() == AesEffectState::EsRemoved; + ddsData.isUsed = false; + ddsData.sampleTime = m_mainHandler->dds()->currentPartitionTimeMSec(); + ddsData.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsData.effectDuration = m_data.effectDuration; + ddsData.effectStart = toOptional(toMSec(m_data.effectStart)); + ddsData.width = m_data.width; + ddsData.effectStateId = effectState(); + ddsData.partyId = toOptional(m_data.partyId); + ddsData.participantId = toOptional(m_data.participantId); + ddsData.isCentral = m_data.isCentral; + dbSegment2DdsSegment(m_dbSegments, ddsData.segments); if (!m_mainHandler->dds()->dts()->publish(ddsData)) ERROR_LOG(m_logger) << "Error publishing AesGasPipe-data to dds"; @@ -211,22 +211,22 @@ void ObjectGasPipe::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(partitionTimeMSec()); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtGasPipe); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtGasPipe); - aiv.partyId(m_data.partyId); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = partitionTimeMSec(); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtGasPipe; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtGasPipe); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -238,7 +238,7 @@ void ObjectGasPipe::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeGasPipeByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtGasPipe); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtGasPipe)); } QPolygonF ObjectGasPipe::generateForm() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.h index ded756091..fe28d1af2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_gas_pipe.h @@ -40,7 +40,7 @@ public: Core::FunctionReplyObject removeObject() override; - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtGasPipe; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.cpp index 18ee89fa0..1a6a87d83 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.cpp @@ -74,25 +74,25 @@ bool ObjectMineArea::removeObjectFromDb() { return m_mainHandler->db()->removeAe bool ObjectMineArea::isDusMineArea() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::DUS; } bool ObjectMineArea::isConcreteMine() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::Concrete; } bool ObjectMineArea::isSingleVirtual() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::VirtualSingle; } bool ObjectMineArea::isVirtualMine() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::Virtual; } @@ -140,11 +140,11 @@ void ObjectMineArea::clearCorridor(const AesItemView &aiv) return; QPolygonF aivUtmPoly; - aivUtmPoly.reserve(aiv.form().size()); - int zone = LtsCoordTrans::UtmCoordinate::fromGeographic(aiv.form()[0].lon(), aiv.form()[0].lat()).zone; - for (const auto &pos : aiv.form()) // Last Pos just for Length and Direction... + aivUtmPoly.reserve(aiv.form.size()); + int zone = LtsCoordTrans::UtmCoordinate::fromGeographic(aiv.form[0].lon, aiv.form[0].lat).zone; + for (const auto &pos : aiv.form) // Last Pos just for Length and Direction... { - LtsCoordTrans::UtmCoordinate utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), zone); + LtsCoordTrans::UtmCoordinate utmPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat, zone); aivUtmPoly.push_back(QPointF(utmPos.x, utmPos.y)); } @@ -263,7 +263,7 @@ Core::FunctionReplyObject ObjectMineArea::createSegments(const std::vectordds()->dts()->publish(m_tis); } return true; @@ -370,19 +370,19 @@ bool ObjectMineArea::publishDusMineStatus() // DusMineStatus mines vector is coherent to triggered impacts bitfield DusMineState dms(m_dms); - dms.mines().resize(m_triggeredMines.size()); + dms.mines.resize(m_triggeredMines.size()); int i = 0; for (const auto &mine : qAsConst(m_triggeredMines)) { const DusMine entry(mine.mineId, mine.isTriggered, mine.chargeTypeId, {mine.position.x(), mine.position.y()}); - dms.mines()[i++] = entry; + dms.mines[i++] = entry; } if (m_dms != dms || m_triggeredMinesChanged) { m_dms = dms; - m_dms.sampleTime(partitionTimeMSec()); + m_dms.sampleTime = partitionTimeMSec(); return m_mainHandler->dds()->dts()->publish(m_dms); } return true; @@ -449,7 +449,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines) DEBUG_LOG(m_logger) << "index: " << index; Core::GeoPosition2D startPos = vec[index]; - LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.lon(), startPos.lat()); + LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.lon, startPos.lat); DEBUG_LOG(m_logger) << "startPosUtm: " << startPositionUtm.mgrs(); double length = 0.0; @@ -459,7 +459,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines) while (vec.size() > 0) { Core::GeoPosition2D &pos = vec.first(); - DEBUG_LOG(m_logger) << "pos: " << pos.lon() << ", " << pos.lat(); + DEBUG_LOG(m_logger) << "pos: " << pos.lon << ", " << pos.lat; if (pos == startPos) { @@ -468,7 +468,7 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines) continue; } - length = LtsCoordTrans::squareDistance(startPositionUtm, pos.lon(), pos.lat()); + length = LtsCoordTrans::squareDistance(startPositionUtm, pos.lon, pos.lat); DEBUG_LOG(m_logger) << "Distance between startPos and pos: " << length; Core::GeoPosition2D newPos = pos; @@ -477,9 +477,9 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines) if (pos2 == pos || pos2 == startPos) continue; - DEBUG_LOG(m_logger) << "pos2: " << pos2.lon() << ", " << pos2.lat(); + DEBUG_LOG(m_logger) << "pos2: " << pos2.lon << ", " << pos2.lat; - double length2 = LtsCoordTrans::squareDistance(startPositionUtm, pos2.lon(), pos2.lat()); + double length2 = LtsCoordTrans::squareDistance(startPositionUtm, pos2.lon, pos2.lat); DEBUG_LOG(m_logger) << "Distance between startPos and pos2: " << length; if (length2 < length) @@ -492,14 +492,14 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines) vecSorted.push_back(newPos); vec.removeOne(newPos); - startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(newPos.lon(), newPos.lat(), startPositionUtm.zone); + startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(newPos.lon, newPos.lat, startPositionUtm.zone); DEBUG_LOG(m_logger) << "New startPosUtm: " << startPositionUtm.mgrs(); } if (vecSorted.size() == 1) { DEBUG_LOG(m_logger) << "only one segment - create 2 new with distance 10m"; - const LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(vecSorted[0].lon(), vecSorted[0].lat()); + const LtsCoordTrans::UtmCoordinate pointUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(vecSorted[0].lon, vecSorted[0].lat); LtsCoordTrans::UtmCoordinate point1Utm = pointUtm; LtsCoordTrans::UtmCoordinate point2Utm = pointUtm; point1Utm.y = pointUtm.y - 5.01; @@ -511,8 +511,8 @@ Core::FunctionReplyObject ObjectMineArea::changeSegmentsToLine(bool sortMines) Core::GeoPosition2D pos(point.x(), point.y()); vecSorted.push_back(pos); point = point2Utm.geographic(); - pos.lon(point.x()); - pos.lat(point.y()); + pos.lon = point.x(); + pos.lat = point.y(); vecSorted.push_back(pos); } } @@ -671,12 +671,12 @@ template Core::FunctionReplyObject ObjectMineArea::createObjectTmpl } // Set TriggeredExplosions Base Data - m_tis.id(1000 * m_data.id + AesType::AtMineAreaSingleMines); - m_tis.aesItemId(m_data.id); - m_tis.aesTypeId(AesType::AtMineAreaSingleMines); + m_tis.id = 1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines); + m_tis.aesItemId = m_data.id; + m_tis.aesTypeId = AesType::AtMineAreaSingleMines; // Set DUS-Mine status Base Data - m_dms.id(m_data.id); + m_dms.id = m_data.id; trans.commit(); @@ -883,12 +883,12 @@ Core::FunctionReplyObject ObjectMineArea::createObjectFromMineData(const Databas return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error adding triggered mines to database.")); // Set TriggeredExplosions Base Data - m_tis.id(1000 * m_data.id + AesType::AtMineAreaSingleMines); - m_tis.aesItemId(m_data.id); - m_tis.aesTypeId(AesType::AtMineAreaSingleMines); + m_tis.id = 1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines); + m_tis.aesItemId = m_data.id; + m_tis.aesTypeId = AesType::AtMineAreaSingleMines; // Set DUS-Mine status Base Data - m_dms.id(m_data.id); + m_dms.id = m_data.id; trans.commit(); @@ -1062,7 +1062,7 @@ bool ObjectMineArea::canHandleMine(int mineId, int chargeTypeId, const QPointF & DEBUG_LOG(m_logger) << "Mine Area " << m_data.id << " is not a DUS mine area."; // EffectState has to be Created, Prepared, Active and Paused Areas - if (m_data.effectStateId.underlying() < AesEffectState::EsCreated) + if (m_data.effectStateId < AesEffectState::EsCreated) { DEBUG_LOG(m_logger) << "Mine Area " << m_data.id << " can not handle mine because its current AesEffectState is" << AreaEffectSimulation::toString(m_data.effectStateId); @@ -1237,9 +1237,9 @@ bool ObjectMineArea::addMineData(const std::vector &mineData) tm.mineAreaId = m_data.id; tm.chargeTypeId = m_data.chargeTypeId; tm.mineId = idx++; - tm.appearenceTime = QDateTime::fromMSecsSinceEpoch(mine.appearenceTime()); - tm.armingTime = QDateTime::fromMSecsSinceEpoch(mine.armingTime()); - tm.position = QPointF(mine.position().lon(), mine.position().lat()); + tm.appearenceTime = QDateTime::fromMSecsSinceEpoch(mine.appearenceTime); + tm.armingTime = QDateTime::fromMSecsSinceEpoch(mine.armingTime); + tm.position = QPointF(mine.position.lon, mine.position.lat); if (!m_mainHandler->db()->insert(tm)) { ERROR_LOG(m_logger) << "--[addMineData] Couldn't insert trigger mine into db"; @@ -1412,50 +1412,50 @@ void ObjectMineArea::publishAiv() // Better than aiv.id(1000 * aesItemId + AesType::AtMineArea); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(m_mineAreaPolygon, aiv.form()); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(m_mineAreaPolygon, aiv.form); const auto br = boundingRect(); // m_mineAreaPolygon.boundingRect() - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(br.bottomLeft().x(), br.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(br.topRight().x(), br.topRight().y())); - aiv.aesTypeId(AesType::AtMineArea); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtMineArea); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(br.bottomLeft().x(), br.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(br.topRight().x(), br.topRight().y()); + aiv.aesTypeId = AesType::AtMineArea; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtMineArea); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { DEBUG_LOG(m_logger) << "aiv changed - publish"; - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); } AesItemView aiv2(m_aiv2); - aiv2.aesItemId(m_data.id); - aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv2.effectStart(toMSec(m_data.effectStart)); - aiv2.form().clear(); - aiv2.form().reserve(m_triggeredMines.size()); + aiv2.aesItemId = m_data.id; + aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv2.effectStart = toMSec(m_data.effectStart); + aiv2.form.clear(); + aiv2.form.reserve(m_triggeredMines.size()); for (const auto &tm : qAsConst(m_triggeredMines)) - aiv2.form().resize(aiv2.form().size() + 1, Core::GeoPosition(tm.position.x(), tm.position.y(), 0.0)); - aiv2.boundingBoxBottomLeft(aiv.boundingBoxBottomLeft()); - aiv2.boundingBoxTopRight(aiv.boundingBoxTopRight()); - aiv2.aesTypeId(AesType::inner_enum::AtMineAreaSingleMines); - aiv2.id(1000 * m_data.id + AesType::inner_enum::AtMineAreaSingleMines); - aiv2.effectStateId(m_data.effectStateId); + aiv2.form.resize(aiv2.form.size() + 1, Core::GeoPosition(tm.position.x(), tm.position.y(), 0.0)); + aiv2.boundingBoxBottomLeft = aiv.boundingBoxBottomLeft; + aiv2.boundingBoxTopRight = aiv.boundingBoxTopRight; + aiv2.aesTypeId = AesType::AtMineAreaSingleMines; + aiv2.id = 1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines); + aiv2.effectStateId = m_data.effectStateId; if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; if (aiv2 != m_aiv2 || m_triggeredMinesChanged) { DEBUG_LOG(m_logger) << "aiv2 changed"; - aiv2.sampleTime(partitionTimeMSec()); + aiv2.sampleTime = partitionTimeMSec(); m_aiv2 = aiv2; m_mainHandler->dds()->dts()->publish(aiv2); emit newAiv(aiv2); @@ -1468,9 +1468,9 @@ void ObjectMineArea::removeTopics() auto dts = m_mainHandler->dds()->dts(); dts->removeMineAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::inner_enum::AtMineArea); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::inner_enum::AtMineAreaSingleMines); - dts->removeTriggeredImpactsByKey(1000 * m_data.id + AesType::inner_enum::AtMineAreaSingleMines); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtMineArea)); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines)); + dts->removeTriggeredImpactsByKey(1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines)); removeDusMineStateTopic(); emit removeAiv(m_data.id); } @@ -1497,14 +1497,14 @@ Core::FunctionReplyObject ObjectMineArea::createGeoSegmentsFromMineData(double & tempMinePos.emplace_back(Core::GeoPosition2D(t.position.x(), t.position.y())); for (const auto &md : mineData) - tempMinePos.emplace_back(md.position()); + tempMinePos.emplace_back(md.position); DEBUG_LOG(m_logger) << "--[createSegmentsFromMineData]: --> tempMinePos.Size: " << tempMinePos.size() << " m_triggeredMinesSIze: " << m_triggeredMines.size() << " mineDataSize " << mineData.size(); if (tempMinePos.empty()) return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Mine data couldn't be added")); - LtsCoordTrans::UtmCoordinate tempCoord = LtsCoordTrans::UtmCoordinate::fromGeographic(tempMinePos.front().lon(), tempMinePos.front().lat()); + LtsCoordTrans::UtmCoordinate tempCoord = LtsCoordTrans::UtmCoordinate::fromGeographic(tempMinePos.front().lon, tempMinePos.front().lat); // calculate position double angleDeg = 0.0; @@ -1557,7 +1557,7 @@ void ObjectMineArea::onEffectStateChanged() DEBUG_LOG(m_logger) << id() << " EffectStateChanged for MineArea " << m_data.id << ". Check if mines have to be released."; // If is an DUS-MineArea and it's state is Expired or Removed and still has mines if ((isDusMineArea() || isConcreteMine()) - && (m_data.effectStateId.underlying() == AesEffectState::EsExpired || m_data.effectStateId.underlying() == AesEffectState::EsRemoved) + && (m_data.effectStateId == AesEffectState::EsExpired || m_data.effectStateId == AesEffectState::EsRemoved) && !m_triggeredMines.isEmpty()) { DEBUG_LOG(m_logger) << id() << " Releasing all mines from " << toString(m_data.effectStateId) << " MineArea " << m_data.id; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.h index 5e9335ffc..0e9f090be 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area.h @@ -60,7 +60,7 @@ class ObjectMineArea final : public ObjectBaseTmpl void clearBuildings(); QVector unpairedMines() const; - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtMineArea; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.cpp index 1fd675f35..b2e09c58e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.cpp @@ -33,12 +33,12 @@ ObjectMineAreaNull::ObjectMineAreaNull(MainHandler *mainHandler, } // Set TriggeredExplosions Base Data - m_tis.id(AesType::AtMineAreaSingleMines); - m_tis.aesItemId(0); - m_tis.aesTypeId(AesType::AtMineAreaSingleMines); + m_tis.id = AesType::AtMineAreaSingleMines; + m_tis.aesItemId = 0; + m_tis.aesTypeId = AesType::AtMineAreaSingleMines; // Set DUS-Mine status Base Data - m_dms.mines().resize(m_triggeredMines.size()); + m_dms.mines.resize(m_triggeredMines.size()); onPublishData(); } @@ -49,25 +49,25 @@ ObjectMineAreaNull::~ObjectMineAreaNull() } bool ObjectMineAreaNull::isDusMineArea() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::DUS; } bool ObjectMineAreaNull::isConcreteMine() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::Concrete; } bool ObjectMineAreaNull::isVirtualSingleMine() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::VirtualSingle; } bool ObjectMineAreaNull::isVirtualMine() const { - return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) + return static_cast(m_mainHandler->dds()->pdmDtc()->mineClass(m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId)) == MineClass::Virtual; } int ObjectMineAreaNull::lastConcreteMineNo() @@ -232,8 +232,8 @@ void ObjectMineAreaNull::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeMineAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtMineAreaSingleMines); - dts->removeTriggeredImpactsByKey(1000 * m_data.id + AesType::AtMineAreaSingleMines); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines)); + dts->removeTriggeredImpactsByKey(1000 * m_data.id + static_cast(AesType::AtMineAreaSingleMines)); emit removeAiv(m_data.id); } @@ -252,24 +252,24 @@ void ObjectMineAreaNull::publishAiv() } AesItemView aiv2(m_aiv2); - aiv2.aesItemId(0); - aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId); // Shall be invalid. EffectSimulation has been conducted before, so not necessary for service sCES - aiv2.effectStart(0); - aiv2.form(vec); - aiv2.boundingBoxBottomLeft() = Core::GeoPosition2D(tmp.boundingRect().bottomLeft().x(), tmp.boundingRect().bottomLeft().y()); - aiv2.boundingBoxTopRight() = Core::GeoPosition2D(tmp.boundingRect().topRight().x(), tmp.boundingRect().topRight().y()); - aiv2.aesTypeId(AesType::inner_enum::AtMineAreaSingleMines); - aiv2.id(AesType::inner_enum::AtMineAreaSingleMines); - aiv2.effectStateId(AesEffectState::inner_enum::EsActivated); - aiv2.setId(dds::core::optional(m_setId)); + aiv2.aesItemId = 0; + aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId; // Shall be invalid. EffectSimulation has been conducted before, so not necessary for service sCES + aiv2.effectStart = 0; + aiv2.form = vec; + aiv2.boundingBoxBottomLeft = Core::GeoPosition2D(tmp.boundingRect().bottomLeft().x(), tmp.boundingRect().bottomLeft().y()); + aiv2.boundingBoxTopRight = Core::GeoPosition2D(tmp.boundingRect().topRight().x(), tmp.boundingRect().topRight().y()); + aiv2.aesTypeId = AesType::AtMineAreaSingleMines; + aiv2.id = AesType::AtMineAreaSingleMines; + aiv2.effectStateId = AesEffectState::EsActivated; + aiv2.setId = dds::core::optional(m_setId); if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv2.form(), m_aiv2.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv2.form, m_aiv2.form, m_data.isCentral); if (aiv2 != m_aiv2) { - aiv2.sampleTime(partitionTimeMSec()); + aiv2.sampleTime = partitionTimeMSec(); m_aiv2 = aiv2; m_mainHandler->dds()->dts()->publish(aiv2); emit newAiv(aiv2); @@ -280,20 +280,20 @@ bool ObjectMineAreaNull::publishTriggeredImpacts() { // Build an own tes-bitfield and compare, only store and publish if changed. TriggeredImpacts tis(m_tis); - tis.impactCount(m_triggeredMines.size()); - tis.bitfield().resize((m_triggeredMines.size() + 7) / 8); - tis.setId(dds::core::optional(m_setId)); + tis.impactCount = m_triggeredMines.size(); + tis.bitfield.resize((m_triggeredMines.size() + 7) / 8); + tis.setId = dds::core::optional(m_setId); int i = 0; for (const auto &mine : qAsConst(m_triggeredMines)) { // Triggered Impact == 0, if mine is disarmed/exploded - LtsUtils::BitArray::setBit(tis.bitfield(), i++, !mine.isTriggered); + LtsUtils::BitArray::setBit(tis.bitfield, i++, !mine.isTriggered); } if (m_tis != tis) { m_tis = tis; - m_tis.sampleTime(partitionTimeMSec()); + m_tis.sampleTime = partitionTimeMSec(); return m_mainHandler->dds()->dts()->publish(m_tis); } return true; @@ -304,19 +304,19 @@ bool ObjectMineAreaNull::publishDusMineStatus() // DusMineStatus mines vector is coherent to triggered impacts bitfield DusMineState dms(m_dms); - dms.mines().resize(m_triggeredMines.size()); - dms.setId(dds::core::optional(m_setId)); + dms.mines.resize(m_triggeredMines.size()); + dms.setId = dds::core::optional(m_setId); int i = 0; for (const auto &mine : qAsConst(m_triggeredMines)) { const DusMine entry(mine.mineId, mine.isTriggered, mine.chargeTypeId, {mine.position.x(), mine.position.y()}); - dms.mines()[i++] = entry; + dms.mines[i++] = entry; } if (m_dms != dms) { m_dms = dms; - m_dms.sampleTime(partitionTimeMSec()); + m_dms.sampleTime = partitionTimeMSec(); return m_mainHandler->dds()->dts()->publish(m_dms); } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.h index 57a4b21e5..ce502f7e7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_area_null.h @@ -38,7 +38,7 @@ public: std::vector form() const override { return {}; } QPolygonF generateForm() override; - AesType aesType() const override { return AesType_def::AtMineArea; } + AesType aesType() const override { return AesType::AtMineArea; } bool isCentral() const override { return m_data.isCentral; } int lastConcreteMineNo(); public Q_SLOTS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.cpp index 48d6697c5..46fdb0e58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.cpp @@ -74,7 +74,7 @@ Core::FunctionReplyObject ObjectMineCorridor::createObject(const Database::AesMi { segment.id = 0; segment.mineCorridorId = m_data.id; - segment.position = QPointF(ddsSeg.lon(), ddsSeg.lat()); + segment.position = QPointF(ddsSeg.lon, ddsSeg.lat); // will update segment.id if (!m_mainHandler->db()->insert(segment)) return Core::FunctionReplyObject(getRightId(m_data.id, originOc), tr_lts("dds", "Error inserting AesMineAreaSegment-data into database.")); @@ -138,7 +138,7 @@ Core::FunctionReplyObject ObjectMineCorridor::updateObject(const Database::AesMi tmpSegments.resize(newSegmentSize); // if count is decreased for (size_t i = 0; i < segments.size(); ++i) - tmpSegments[i].position = QPointF(segments[i].lon(), segments[i].lat()); + tmpSegments[i].position = QPointF(segments[i].lon, segments[i].lat); for (const Database::AesMineCorridorSegment &segment : qAsConst(tmpSegments)) { @@ -183,7 +183,7 @@ void ObjectMineCorridor::onPublishData() m_data.isCentral, m_data.properties.toStdString(), m_data.width, {}); - dbSegment2DdsSegment(m_segments, ddsData.segments()); + dbSegment2DdsSegment(m_segments, ddsData.segments); m_mainHandler->dds()->dts()->publish(ddsData); publishAiv(); @@ -201,22 +201,22 @@ void ObjectMineCorridor::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtMineCorridor); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtMineCorridor); - aiv.partyId(0); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtMineCorridor; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtMineCorridor); + aiv.partyId = 0; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -225,7 +225,7 @@ void ObjectMineCorridor::publishAiv() const int zone = LtsCoordTrans::UtmCoordinate::fromGeographic(poly[0]).zone; // Unused, Future use: Intersection with Mine Area to deactivate Mines - m_utmPoly = utmPolyFromGeoVec(aiv.form(), zone); + m_utmPoly = utmPolyFromGeoVec(aiv.form, zone); } @@ -234,13 +234,13 @@ QPolygonF ObjectMineCorridor::utmPolyFromGeoVec(const std::vectordds()->dts(); dts->removeMineCorridorByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::inner_enum::AtMineCorridor); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtMineCorridor)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.h index 1d3797f5a..6f2520fc9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_mine_corridor.h @@ -30,7 +30,7 @@ public: Core::FunctionReplyObject updateObject(const Database::AesMineCorridor &data, const std::vector &segments); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtMineCorridor; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.cpp index 9cb442916..bb9e92cde 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.cpp @@ -28,7 +28,7 @@ ObjectNContamination::~ObjectNContamination() Core::FunctionReplyObject ObjectNContamination::createObject(const Database::AesNContamination &data) { Core::FunctionReplyObject ret = ObjectBaseTmpl::createObject(data); - if (m_data.effectStateId == AesEffectState_def::EsActivated) + if (m_data.effectStateId == AesEffectState::EsActivated) m_updateWeatherData = true; return ret; @@ -92,7 +92,7 @@ void ObjectNContamination::onUpdateWeatherData() if (m_data.weatherSourceId != AesWeatherSource::AwsNone) { - m_data.rotationAngle = fmod(md.windDirection() + 180.0, 360.0); + m_data.rotationAngle = fmod(md.windDirection + 180.0, 360.0); m_publishDataTimer->start(); } @@ -107,7 +107,7 @@ void ObjectNContamination::onPublishData() if (!m_mainHandler->db()->update(m_data)) ERROR_LOG(m_logger) << "Error updating AesIndirectFireSingle-data in database"; - if (m_data.effectStateId == AesEffectState_def::EsActivated && !m_updateWeatherData) + if (m_data.effectStateId == AesEffectState::EsActivated && !m_updateWeatherData) onUpdateWeatherData(); NContamination ddsData(m_data.id, @@ -142,9 +142,9 @@ void ObjectNContamination::onPublishData() void ObjectNContamination::publishAiv() { QPolygonF poly; - if ((m_data.effectStateId == AesEffectState_def::EsCreated || - m_data.effectStateId == AesEffectState_def::EsPrepared || - m_data.effectStateId == AesEffectState_def::EsReceived) && m_data.weatherSourceId != AesWeatherSource_def::AwsNone) + if ((m_data.effectStateId == AesEffectState::EsCreated || + m_data.effectStateId == AesEffectState::EsPrepared || + m_data.effectStateId == AesEffectState::EsReceived) && m_data.weatherSourceId != AesWeatherSource::AwsNone) { Database::AesNContamination tmpData = m_data; tmpData.borderLengthInner = tmpData.impactRadius; @@ -158,23 +158,23 @@ void ObjectNContamination::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtNContamination); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtNContamination); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtNContamination; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtNContamination); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -185,7 +185,7 @@ void ObjectNContamination::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeNContaminationByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtNContamination); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtNContamination)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.h index 93044ea7f..1667ff6f3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_ncontamination.h @@ -29,7 +29,7 @@ public: */ bool removeObjectFromDb(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtNContamination; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.cpp index aa6bebfdf..231221570 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.cpp @@ -163,22 +163,22 @@ void ObjectOffRouteMine::publishAiv() const QPolygonF poly = Polygons::offRouteMineArea(m_data); const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.effectStart(toMSec(m_data.effectStart)); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtOffRouteMine); - aiv.effectStateId(data().effectStateId); - aiv.id(1000 * m_data.id + AesType::AtOffRouteMine); + aiv.aesItemId = m_data.id; + aiv.effectStart = toMSec(m_data.effectStart); + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtOffRouteMine; + aiv.effectStateId = data().effectStateId; + aiv.id = 1000 * m_data.id + static_cast(AesType::AtOffRouteMine); if (m_data.partyId != 0) - aiv.partyId(m_data.partyId); + aiv.partyId = m_data.partyId; if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(m_aiv); @@ -193,22 +193,22 @@ void ObjectOffRouteMine::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv2(m_aiv2); - aiv2.aesItemId(m_data.id); - aiv2.effectStart(toMSec(m_data.effectStart)); - aiv2.chargeStruct().chargeTypeId(m_data.chargeTypeId); - ddsVecFromPoly(poly, aiv2.form()); - aiv2.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv2.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv2.aesTypeId(AesType::AtOffRouteMineSecondary); - aiv2.effectStateId(data().effectStateId); - aiv2.id(1000 * m_data.id + AesType::AtOffRouteMineSecondary); + aiv2.aesItemId = m_data.id; + aiv2.effectStart = toMSec(m_data.effectStart); + aiv2.chargeStruct.chargeTypeId = m_data.chargeTypeId; + ddsVecFromPoly(poly, aiv2.form); + aiv2.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv2.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv2.aesTypeId = AesType::AtOffRouteMineSecondary; + aiv2.effectStateId = data().effectStateId; + aiv2.id = 1000 * m_data.id + static_cast(AesType::AtOffRouteMineSecondary); if (m_data.partyId != 0) - aiv2.partyId(m_data.partyId); + aiv2.partyId = m_data.partyId; if (aiv2 != m_aiv2) { - aiv2.sampleTime(partitionTimeMSec()); + aiv2.sampleTime = partitionTimeMSec(); m_aiv2 = aiv2; m_mainHandler->dds()->dts()->publish(aiv2); emit newAiv(aiv2); @@ -221,7 +221,7 @@ void ObjectOffRouteMine::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeOffRouteMineByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtOffRouteMine); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtOffRouteMine)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.h index 55fb89cd0..934870410 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_off_route_mine.h @@ -29,7 +29,7 @@ public: */ bool removeObjectFromDb(); - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtOffRouteMine; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.cpp index b51973523..1fa8634ae 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.cpp @@ -123,21 +123,21 @@ void ObjectReconArea::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtReconArea); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtReconArea); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtReconArea; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtReconArea); - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -148,7 +148,7 @@ void ObjectReconArea::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeReconAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtReconArea); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtReconArea)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.h index 536eefc0c..0da7a4721 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_recon_area.h @@ -24,7 +24,7 @@ public: Core::FunctionReplyObject updateObject(const Database::AesReconArea &data) override; Core::FunctionReplyObject removeObject() override; - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtReconArea; } bool isCentral() const override { return m_data.isCentral; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.cpp index e0b98f093..7cd289094 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.cpp @@ -119,21 +119,21 @@ void ObjectTechnicalArea::publishAiv() const QRectF bounds(poly.boundingRect()); AesItemView aiv(m_aiv); - aiv.aesItemId(m_data.id); - aiv.chargeStruct().chargeTypeId(m_data.chargeTypeId); - aiv.effectStart(toMSec(m_data.effectStart)); - ddsVecFromPoly(poly, aiv.form()); - aiv.boundingBoxBottomLeft(Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y())); - aiv.boundingBoxTopRight(Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y())); - aiv.aesTypeId(AesType::AtTechnicalArea); - aiv.effectStateId(effectState()); - aiv.id(1000 * m_data.id + AesType::AtTechnicalArea); + aiv.aesItemId = m_data.id; + aiv.chargeStruct.chargeTypeId = m_data.chargeTypeId; + aiv.effectStart = toMSec(m_data.effectStart); + ddsVecFromPoly(poly, aiv.form); + aiv.boundingBoxBottomLeft = Core::GeoPosition2D(bounds.bottomLeft().x(), bounds.bottomLeft().y()); + aiv.boundingBoxTopRight = Core::GeoPosition2D(bounds.topRight().x(), bounds.topRight().y()); + aiv.aesTypeId = AesType::AtTechnicalArea; + aiv.effectStateId = effectState(); + aiv.id = 1000 * m_data.id + static_cast(AesType::AtTechnicalArea); - checkIsCentralAndPublish(aiv.form(), m_aiv.form(), m_data.isCentral); + checkIsCentralAndPublish(aiv.form, m_aiv.form, m_data.isCentral); if (aiv != m_aiv) { - aiv.sampleTime(partitionTimeMSec()); + aiv.sampleTime = partitionTimeMSec(); m_aiv = aiv; m_mainHandler->dds()->dts()->publish(aiv); emit newAiv(aiv); @@ -144,7 +144,7 @@ void ObjectTechnicalArea::removeTopics() { auto dts = m_mainHandler->dds()->dts(); dts->removeTechnicalAreaByKey(m_data.id); - dts->removeAesItemViewByKey(1000 * m_data.id + AesType::AtTechnicalArea); + dts->removeAesItemViewByKey(1000 * m_data.id + static_cast(AesType::AtTechnicalArea)); emit removeAiv(m_data.id); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.h index 9a3c384a5..c9e39ef77 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_technical_area.h @@ -24,9 +24,9 @@ public: Core::FunctionReplyObject updateObject(const Database::AesTechnicalArea &data) override; Core::FunctionReplyObject removeObject() override; - std::vector form() const override { return m_aiv.form(); } + std::vector form() const override { return m_aiv.form; } QPolygonF generateForm() override; - AesType aesType() const override { return AesType_def::AtTechnicalArea; } + AesType aesType() const override { return AesType::AtTechnicalArea; } bool isCentral() const override { return m_data.isCentral; } void removeTopics(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.cpp index 7e7fcf8e0..12c2169a6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.cpp @@ -40,7 +40,7 @@ bool ObjectTrajectory::updateObject(const TrajectoryData &providedData) { if (!providedData.isIdValid()) return false; - if (providedData.id != m_ddsTrajectory.id()) + if (providedData.id != m_ddsTrajectory.id) return false; m_providedData = providedData; publish(); @@ -50,22 +50,22 @@ bool ObjectTrajectory::updateObject(const TrajectoryData &providedData) bool ObjectTrajectory::publish() { TrajectoryTimeAware newTrajectory; - newTrajectory.id(m_providedData.id); + newTrajectory.id = m_providedData.id; // // newTrajectory.sampleTime() will be set later - newTrajectory.index(m_providedData.index ); + newTrajectory.index = m_providedData.index; // [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId) // newTrajectory.aesItemId(m_providedData.aesItemId); // newTrajectory.aesTypeId(m_providedData.aesTypeId); - newTrajectory.trajectoryStartTime(m_providedData.startTime); - newTrajectory.geometry(m_providedData.geometry); - newTrajectory.originatorId(m_providedData.originatorId); - newTrajectory.originatorTypeId(m_providedData.originatorTypeId); + newTrajectory.trajectoryStartTime = m_providedData.startTime; + newTrajectory.geometry = m_providedData.geometry; + newTrajectory.originatorId = m_providedData.originatorId; + newTrajectory.originatorTypeId = m_providedData.originatorTypeId; if (!hasDdsChanged(newTrajectory)) return true; m_ddsTrajectory = newTrajectory; - newTrajectory.sampleTime(partitionTimeMSec()); // publish sampleTime, but do not store + newTrajectory.sampleTime = partitionTimeMSec(); // publish sampleTime, but do not store return m_mainHandler->dds()->dts()->publish(newTrajectory); //emit newAiv(newTrajectory); } @@ -77,10 +77,10 @@ bool ObjectTrajectory::hasDdsChanged(const TrajectoryTimeAware &trajectory) bool ObjectTrajectory::removeTopic() { - if (m_ddsTrajectory.id() <= 0) + if (m_ddsTrajectory.id <= 0) return false; auto dts = m_mainHandler->dds()->dts(); - return dts->removeTrajectoryTimeAwareByKey(m_ddsTrajectory.id()); + return dts->removeTrajectoryTimeAwareByKey(m_ddsTrajectory.id); } } // Namespace AreaEffectSimulation diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.h index bc5d5eb4e..eed918919 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_trajectory.h @@ -28,7 +28,7 @@ public: // int aesItemId = -1; // AesType aesTypeId = AesType::inner_enum::AtUnknown; int originatorId = -1; - ProjectDataManagement::StateChangeOriginator originatorTypeId = ProjectDataManagement::StateChangeOriginator::Unknown; + ProjectDataManagement::StateChangeOriginator originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Unknown; qint64 startTime = 0; std::vector geometry;