Migrates residual Lts sources to generated rtiddsgen API

Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
berrux-dev committed 2026-09-23 12:05:37 +02:00
1 parent 5485a90385
commit 881d44f4dd
512 files changed
+6887 -6426

No files matched your search

@@ -111,12 +111,12 @@ void AlmTests::tryConfigureAlarms()
alarms[0].setMarker(true);
alarms[0].messageWindow(true);
alarms[0].vulnerabilityState(-1);
alarms[0].eventTypeId(ProjectDataManagement::PdmEventType_def::Hit);
alarms[0].eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
alarms[1].setMarker(true);
alarms[1].messageWindow(true);
alarms[1].vulnerabilityState(0);
alarms[1].eventTypeId(ProjectDataManagement::PdmEventType_def::EnterNuclear);
alarms[1].eventTypeId(ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
std::vector<int32_t> participantIds;
participantIds.push_back(0);
@@ -173,13 +173,13 @@ void AlmTests::tryConfigureAlarmsList()
alarms[0].setMarker(true);
alarms[0].messageWindow(true);
alarms[0].eventTypeId(ProjectDataManagement::PdmEventType_def::Hit);
alarms[0].eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
alarms[0].vulnerabilityState(-1);
alarms[1].setMarker(true);
alarms[1].messageWindow(true);
alarms[1].vulnerabilityState(-1);
alarms[1].eventTypeId(ProjectDataManagement::PdmEventType_def::WeaponAssignment);
alarms[1].eventTypeId(ProjectDataManagement::PdmEventType::EventType_WeaponAssignment);
std::vector<int32_t> participantIds;
participantIds.push_back(1);
@@ -204,7 +204,7 @@ void AlmTests::trySendEvent()
// publish new Event data here
pe.id(100);
//pe.aesItemId(5);
pe.eventTypeId(ProjectDataManagement::PdmEventType_def::Hit); // same as eventTypeId in ConfigureAlarms
pe.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit); // same as eventTypeId in ConfigureAlarms
pe.participantId(2);
pe.equipmentNumber(55);
pe.sampleTime(QDateTime::currentMSecsSinceEpoch());
@@ -164,7 +164,7 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto
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.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();
@@ -161,7 +161,7 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie
if (modType == DataModification::eRemoved)
return;
AreaEffectSimulation::AesType::type aesType = aesItemView.aesTypeId().underlying();
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
if (aesType != AreaEffectSimulation::AesType::AtEffectCluster)
return;
@@ -198,7 +198,7 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif
{
if (modType == DataModification::eRemoved)
return;
AreaEffectSimulation::AesType::type aesType = effects.aesTypeId().underlying();
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId());
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType;
++m_counterDds.cntEffectClusterEffects;
@@ -301,7 +301,7 @@ 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.cornerBottomLeft = Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0);
eaData.area.height = height;
eaData.area.width = width;
eaData.area.rotation = rot;
@@ -209,7 +209,7 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem
if (modType == DataModification::eRemoved)
return;
AreaEffectSimulation::AesType::type aesType = aesItemView.aesTypeId().underlying();
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id << ", aesType=" << aesType;
switch (aesType) {
@@ -219,7 +219,7 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
++m_counterDds.cntAtExplosionClusterGunToTargetLine;
break;
// case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
// case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
// ++m_counterDds.cntAtExplosionClusterSingleExplosions;
// m_aesItemViewSingleExplosions = aesItemView;
// break;
@@ -232,7 +232,7 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo
{
if (modType == DataModification::eRemoved)
return;
AreaEffectSimulation::AesType::type aesType = effects.aesTypeId().underlying();
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(effects.aesTypeId());
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id << ", aesType=" << aesType;
++m_counterDds.cntExplosionClusterEffects;
@@ -388,7 +388,7 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForTneVerification(const QStri
eaData.partyId = 2;
eaData.participantId = 7;
eaData.mhPoints({Core::GeoPosition2D(0.0, 0.0)});
eaData.mhPoints = {Core::GeoPosition2D(0.0, 0.0)};
eaData.impactCount = 10;
// SubStruct FlightCurve
@@ -409,7 +409,7 @@ ExplosionCluster ModuleTestExplosionCluster::getEcForTneVerification(const QStri
qCritical() << " bottomLeft" << bottomLeft;
eaData.area.cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0));
eaData.area.cornerBottomLeft = Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0);
eaData.area.height = height;
eaData.area.width = width;
eaData.area.rotation = rot;
@@ -459,7 +459,7 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor1104(const QString &eaName)
const double rot = 0;
// 0.202561460978929 0.916110427477059 == 32U PD 76937 18655
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.202561460978929, 0.916110427477059));
eaData.area.cornerBottomLeft = Core::GeoPosition2D(0.202561460978929, 0.916110427477059);
eaData.area.height = height;
eaData.area.width = width;
eaData.area.rotation = rot;
@@ -514,7 +514,7 @@ 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.cornerBottomLeft = Core::GeoPosition2D(pos.x(), pos.y());
eaData.area.height = height;
eaData.area.width = width;
eaData.area.rotation = rot;
@@ -567,7 +567,7 @@ 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.cornerBottomLeft = Core::GeoPosition2D(pos.x(), pos.y());
eaData.area.height = height;
eaData.area.width = width;
eaData.area.rotation = rot;
@@ -620,7 +620,7 @@ 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.cornerBottomLeft = Core::GeoPosition2D(pos.x(), pos.y());
eaData.area.height = height;
eaData.area.width = width;
eaData.area.rotation = rot;
@@ -760,7 +760,7 @@ void ModuleTestExplosionCluster::setupParticipants()
const LtsCoordTrans::UtmCoordinate &utmPos =
LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7690018000")); // 32U PD 76900 18000
QPointF pos = utmPos.geographic();
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
req.position = Core::GeoPosition(pos.x(), pos.y(), 0.0);
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
m_replyError = true;
@@ -780,7 +780,7 @@ void ModuleTestExplosionCluster::setupParticipants()
const LtsCoordTrans::UtmCoordinate &utmPos =
LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7600019000")); // 32U PD 76000 19000
QPointF pos = utmPos.geographic();
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
req.position = Core::GeoPosition(pos.x(), pos.y(), 0.0);
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
m_replyError = true;
@@ -803,7 +803,7 @@ void ModuleTestExplosionCluster::setupParticipants()
// LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7500018000")); // 32U PD 75000 18000
LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD5000018000")); // 32U PD 50000 18000
QPointF pos = utmPos.geographic();
req_SSPF.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
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() ;
@@ -827,7 +827,7 @@ void ModuleTestExplosionCluster::setupParticipants()
// LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7500018000")); // 32U PD 75000 18000
LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD0100018000")); // 32U PD 01000 18000
QPointF pos = utmPos.geographic();
req_SSPF.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
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() ;
@@ -2074,7 +2074,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104()
eaData.flightCurve.get().requestedRelativePeakHeight = 500;
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! should be interpreted at center of impact
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();
@@ -2134,7 +2134,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_SMArt_Proximity()
eaData.flightCurve.get().requestedRelativePeakHeight = 500;
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!! should be interpreted at center of impact
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();
@@ -2192,7 +2192,7 @@ void ModuleTestExplosionCluster::test_bldg_1104_OC()
name += QString::number(requestOC.effectStart);
requestOC.name = name.toStdString();
requestOC.area.cornerBottomLeft(Core::GeoPosition2D(0.2025, 0.91611)); // !!bottomLeft!!
requestOC.area.cornerBottomLeft = Core::GeoPosition2D(0.2025, 0.91611); // !!bottomLeft!!
requestOC.area.width = 20;
requestOC.area.height = 30;
requestOC.area.rotation = 17;
@@ -2246,7 +2246,7 @@ void ModuleTestExplosionCluster::test_point_geometry_bldg_1104_light()
eaData.chargeStruct.chargeTypeId = s_ChargeTypeId1;
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!!
eaData.area.cornerBottomLeft = Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705); // !!bottomLeft!!
eaData.area.width = 10;
eaData.area.height = 10;
eaData.area.rotation = 0;
@@ -2297,7 +2297,7 @@ void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_on
request.element = request.name;
const QPointF impactPointF(0.20256382834808495, 0.9161105453111705);
request.impactPosition(Core::GeoPosition2D(impactPointF.x(), impactPointF.y()));
request.impactPosition = Core::GeoPosition2D(impactPointF.x(), impactPointF.y());
INFO_LOG(m_logger) << LOGFUNCTION << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs();
request.chargeTypeId = 371;
@@ -2413,7 +2413,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104()
eaData.flightCurve.get().dropAngle = 45;
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!!
eaData.area.cornerBottomLeft = Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705); // !!bottomLeft!!
eaData.area.width = 25;
eaData.area.height = 25;
eaData.area.rotation = 0;
@@ -2470,7 +2470,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify()
eaData.flightCurve.get().dropAngle = 45;
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!!
eaData.area.cornerBottomLeft = Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705); // !!bottomLeft!!
eaData.area.width = 25;
eaData.area.height = 25;
eaData.area.rotation = 0;
@@ -2574,7 +2574,7 @@ void ModuleTestExplosionCluster::test_vulcano_bldg_1104_withTargetModify2()
eaData.flightCurve.get().dropAngle = 45;
eaData.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
eaData.area.cornerBottomLeft(Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705)); // !!bottomLeft!!
eaData.area.cornerBottomLeft = Core::GeoPosition2D(0.20256382834808495, 0.9161105453111705); // !!bottomLeft!!
eaData.area.width = 25;
eaData.area.height = 25;
eaData.area.rotation = 0;
@@ -695,7 +695,7 @@ ExplosionAreaModifyRequest ModuleTestLimits::getEa()
{
auto ea = ExplosionAreaModifyRequest();
ea.area(AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70));
ea.area = AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70);
ea.name = QStringLiteral("Test_AE__").toStdString();
ea.id = 0;
ea.cannonCount = 10;
@@ -821,7 +821,7 @@ FunctionalAreaModifyRequest ModuleTestLimits::getFA()
fa.id = 0;
fa.effectStart = QDateTime::currentMSecsSinceEpoch() + 30000000;
fa.effectDuration = 100000;
fa.area(AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70));
fa.area = AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70);
fa.chargeTypeId = 311;
fa.partyId = 2;
fa.deconMode = AreaEffectSimulation::AesOperatingMode::OmWaitingTime;
@@ -838,7 +838,7 @@ TechnicalAreaModifyRequest ModuleTestLimits::getTA()
{
auto ta = TechnicalAreaModifyRequest();
ta.id = 0;
ta.area(AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70));
ta.area = AreaEffectSimulation::Area(m_decentralPoint, 500, 600, 70);
ta.type = AreaEffectSimulation::AesTechnicalAreaType::TatRestingAreaVehicle;
return ta;
}
@@ -1145,7 +1145,7 @@ void ModuleTestLimits::setupParticipant()
req.participantId = 6; // according testDB
req.onlyOutdatedParticipants = false;
req.position(Core::GeoPosition(m_partPos.lon, m_partPos.lat, 0.0));
req.position = Core::GeoPosition(m_partPos.lon, m_partPos.lat, 0.0);
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
m_replyError = true;
@@ -1189,7 +1189,7 @@ void ModuleTestLimits::deleteAesAreas()
NOTICE_LOG(m_logger) << " removing most AesObject...";
const QVector<AesEffectState::type> sts = {AesEffectState::EsExpired, AesEffectState::EsRemoved, AesEffectState::EsActivated};
const QVector<AesEffectState> sts = {AesEffectState::EsExpired, AesEffectState::EsRemoved, AesEffectState::EsActivated};
auto clusters = m_aesDtc->explosionClusters();
for (auto cluster : qAsConst(clusters))
@@ -159,7 +159,7 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D
if (modType == DataModification::eRemoved)
return;
AreaEffectSimulation::AesType::type aesType = aesItemView.aesTypeId().underlying();
AreaEffectSimulation::AesType aesType = static_cast<AreaEffectSimulation::AesType>(aesItemView.aesTypeId());
DEBUG_LOG(m_logger) << " got onAesItemViewChanged, aesType=" << aesType;
switch (aesType)
@@ -302,7 +302,7 @@ void ModuleTestAesOthers::setupParticipants()
const LtsCoordTrans::UtmCoordinate &utmPos =
LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UPD7690018100")); // 32U PD 76900 18100
QPointF pos = utmPos.geographic();
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
req.position = Core::GeoPosition(pos.x(), pos.y(), 0.0);
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
m_replyError = true;
@@ -390,7 +390,7 @@ int ModuleTestAesOthers::doMoveParticipant(int participantId, const QString &new
const LtsCoordTrans::UtmCoordinate &utmPos =
LtsCoordTrans::UtmCoordinate::fromMgrs(newPositionMGRS); // 32U PD 76900 18100
QPointF pos = utmPos.geographic();
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
req.position = Core::GeoPosition(pos.x(), pos.y(), 0.0);
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
m_replyError = true;
@@ -114,7 +114,7 @@ void TestExplosionCluster::tryCreateExplosionCluster()
eaData.effectDuration(),
eaData.effectSourceId(),
eaData.area(),
AreaEffectSimulation::AesExplosionGeometry_def::EgArea,
AreaEffectSimulation::AesExplosionGeometry::EgArea,
0, // zog
eaData.mhPoints().size(), // mhpCount;
dds::core::optional<double>(), // mhpRotation for ExplosionClusterOcModify only
@@ -106,7 +106,7 @@ void TestMineArea::tryCreateMineArea()
esData.width(7.0);
esData.partyId(7);
esData.participantId(1234);
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType_def::LptArtillery);
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
esData.isLaidHidden(true);
std::vector<Core::GeoPosition2D> segments;
@@ -440,7 +440,7 @@ void TestMineArea::tryModifyMineArea()
m_maData.width(7.0);
m_maData.partyId(8);
m_maData.participantId(1235);
m_maData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType_def::LptArtillery);
m_maData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
m_maData.isLaidHidden(false);
const AreaEffectSimulation::MineArea esData(m_maData);
m_maData = AreaEffectSimulation::MineArea();
@@ -511,7 +511,7 @@ void TestMineArea::tryCreateAnotherMineArea()
esData.width(7.0);
esData.partyId(7);
esData.participantId(1234);
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType_def::LptArtillery);
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
esData.isLaidHidden(false);
std::vector<Core::GeoPosition2D> segments;
@@ -571,7 +571,7 @@ void TestMineArea::tryCreateMineArea2(int chargeTypeId, double density)
esData.width(7.0);
esData.partyId(7);
esData.participantId(1234);
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType_def::LptArtillery);
esData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptArtillery);
esData.isLaidHidden(false);
std::vector<Core::GeoPosition2D> segments;
@@ -44,8 +44,8 @@ Q_DECL_CONSTEXPR inline bool operator!=(const TrajectoryPoint &p1, const Traject
return p1.position != p2.position || p1.time != p2.time;
}
// Must live in this namespace so that ADL finds it from generic stream helpers
// (e.g. NGL::LogStreamHelper::operator<<), which rely on argument-dependent lookup.
TRAJECTORY_EXPORT std::ostream &operator<< (std::ostream &stream, const TrajectoryPoint &value);
} // namespace AreaEffectSimulation
// at global namespace:
TRAJECTORY_EXPORT std::ostream &operator<< (std::ostream &stream, const AreaEffectSimulation::TrajectoryPoint &value);
@@ -75,12 +75,12 @@ QVector<TrajectoryPoint> transformToNewTarget(
}
} // namespace TrajectoryTransform
} // namespace AreaEffectSimulation
std::ostream &operator<< (std::ostream &stream, const AreaEffectSimulation::TrajectoryPoint &value)
std::ostream &operator<< (std::ostream &stream, const TrajectoryPoint &value)
{
stream << "TrajectoryPoint(" << "position=" << value.position << "; time=" << value.time;
return stream;
}
} // namespace AreaEffectSimulation
@@ -82,7 +82,7 @@ void ObjectExplosionSingleCentral::onPublishData()
partitionTimeMSec(),
m_data.chargeTypeId,
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
toOptional(m_data.partyId),
toOptional(m_data.participantId),
@@ -9,7 +9,7 @@
#include <QtCore/QObject>
#include <QtCore/QTimer>
#include <QtCore/QString>
#include <aes_enums.hpp>
#include <AreaEffectSimulation/aes_enums.hpp>
#include "logger.h"
@@ -218,7 +218,7 @@ 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);
return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(static_cast<int>(effectState));
}
Core::FunctionReplyObject aesItemRemove(const Core::RemoveElementRequest &request)
@@ -342,9 +342,9 @@ void HandlerEffectCluster::onEffectClusterSingleEffectOnlyModifyRequest(const rt
ecCommonModifyRequest.effectDuration(1000);
// charge and geometry:
ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint);
ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgPoint);
// ecCommonModifyRequest.zog(0);
ecCommonModifyRequest.fuseType(ProjectDataManagement::FuseType_def::FtImpact);
ecCommonModifyRequest.fuseType(ProjectDataManagement::FuseType::FtImpact);
ecCommonModifyRequest.chargeTypeId(request.chargeTypeId());
// height, width are <=0 -> area will be adjusted using impactRadius of charge:
@@ -491,7 +491,7 @@ Core::FunctionReplyObject HandlerEffectCluster::effectClusterCreateRequest(const
const bool bChargeIsAirSupport = gearClass == ProjectDataManagement::GearClass::GearClass_AirSupport;
ifs->setAirSupportSource(bChargeIsAirSupport);
// Now we always need to send fire ready, never without
newData.effectorState = AesEffectorState::EsNotReadyToFire;
newData.effectorState = static_cast<int>(AesEffectorState::EsNotReadyToFire);
const Core::FunctionReplyObject ret = ifs->createObject(newData, newEffectorDataVec);
@@ -311,7 +311,7 @@ Core::FunctionReplyObject HandlerFunctionalArea::functionalAreaModifyRequest(con
// Supply-Truck always isCentral
// if ( request.supplyMode() == AesOperatingMode_def::OmWaitingTime)
// if ( request.supplyMode() == AesOperatingMode::OmWaitingTime)
// {
// isCentral = true;
// wasCentral = true;
@@ -202,7 +202,7 @@ Core::FunctionReplyObject HandlerGasPipe::gasPipeModifyRequest(const GasPipeModi
// bool isCentral = ifs->checkIsCentral(_form);
// bool wasCentral = ifs->data().isCentral;
// // Supply-Truck always isCentral
// // if ( request.supplyMode() == AesOperatingMode_def::OmWaitingTime)
// // if ( request.supplyMode() == AesOperatingMode::OmWaitingTime)
// // {
// // isCentral = true;
// // wasCentral = true;
@@ -956,7 +956,7 @@ bool HandlerMineArea::fillFromMineAreaReferenceRequest(const MineAreaReferenceMo
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 qint64 effectStart = mineData->armingTime;
const int effectDurationMsec = inReq.effectDurationMsec;
auto effectCluster = m_mainHandler->effectClusterHandler()->getEffectClusterObj(inReq.referenceAesItemId); // get partyId from effect cluster object
if (!effectCluster)
@@ -1001,14 +1001,14 @@ bool HandlerMineArea::fillFromMineAreaReferenceRequest(const MineAreaReferenceMo
dbData.effectSourceId = effectCluster->data().effectSourceId;
dbData.partyId = effectCluster->data().partyId;
dbData.chargeTypeId = chargeType.id;
dbData.participantId = LtsUtils::toOptional(0);
dbData.participantId = 0;
dbData.density = density;
dbData.width = width;
dbData.layingProcedureTypeId = layingProcedure;
dbData.isLaidHidden = isLaidHidden;
dbData.effectMarkingInTa = effectMarkingTa;
dbData.isCenterLine = isCenterLine;
dbData.externalId = LtsUtils::toOptional(0LL);
dbData.externalId = 0;
dbData.isCentral = true;
return true;
@@ -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);
return Core::FunctionReplyObject(id, tr_lts("dds", "Could not switch effect simulation with id %1 to state with id %2.")).arg(id).arg(static_cast<int>(effectState));
}
void HandlerReconArea::onReconAreaRemoveRequest(const rti::core::SampleIdentity &cookie,
@@ -71,7 +71,7 @@ void ObjectAirSupportImpact::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -129,10 +129,10 @@ class ObjectBase : public QObject
static qint64 toMSec(const QDateTime &dt);
template <typename T> dds::core::optional<T> toOptional(T inVal) { return inVal != T() ? dds::core::optional<T>(inVal) : dds::core::optional<T>(); }
dds::core::optional<qint64> toOptional(const QDateTime &dt)
dds::core::optional<int64_t> toOptional(const QDateTime &dt)
{
qint64 t = (dt.isValid() && !dt.isNull()) ? dt.toMSecsSinceEpoch() : 0;
return toOptional(t);
return toOptional<int64_t>(t);
}
template <typename T, typename U> static inline void ddsVecFromPoly(const T &in, const U &heights, std::vector<Core::GeoPosition> &out)
@@ -182,7 +182,7 @@ void ObjectBCContamination::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -130,7 +130,7 @@ void ObjectBoobyTrap::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId, 0,0 },
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -182,7 +182,7 @@ void ObjectBorderline::onPublishData()
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.effectStart = toOptional<int64_t>(toMSec(m_data.effectStart));
ddsData.effectStateId = effectState();
ddsData.partyId = toOptional(m_data.partyId);
ddsData.participantId = toOptional(m_data.participantId);
@@ -15,7 +15,7 @@
#include <aes_db.h>
#include <aes_dtc.h>
#include <aes_ftc.h>
#include <aes_enums.hpp>
#include <AreaEffectSimulation/aes_enums.hpp>
class QTimer;
@@ -163,7 +163,7 @@ void ObjectDangerArea::onPublishData()
m_mainHandler->dds()->currentPartitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
effectState(),
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -817,9 +817,9 @@ Core::FunctionReplyObject ObjectEffectCluster::checkObjectData(const Database::A
Core::FunctionReplyObject ret;
using geoType = AreaEffectSimulation::AesExplosionGeometry_def;
const geoType::type curExGeoType = data.explosionGeometryId.underlying();
static const QVector<geoType::type> ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry::EgAimPoint, // 0 -> default
using geoType = AreaEffectSimulation::AesExplosionGeometry;
const geoType curExGeoType = data.explosionGeometryId;
static const QVector<geoType> ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry::EgAimPoint, // 0 -> default
AreaEffectSimulation::AesExplosionGeometry::EgPoint,
AreaEffectSimulation::AesExplosionGeometry::EgArea,
AreaEffectSimulation::AesExplosionGeometry::EgRadial,
@@ -1089,7 +1089,7 @@ void ObjectEffectCluster::onPublishData()
0, // partitionTimeMSec(),
{m_effectorData.begin().value().chargeTypeId, m_effectorData.begin().value().igniterTypeId, m_effectorData.begin().value().igniterFunctionId},
m_data.effectDuration, // pause/resume: remainDuration
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -1289,7 +1289,7 @@ void ObjectEffectCluster::adjustTrajectoryToDetonationLocation(int explosionInde
// Effects:
std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = m_effects.singleEffects;
SingleEffect &ref = singleEffectsRef[explosionIndex];
// ref.effectState(AesSingleEffectState_def::SesScheduled);
// ref.effectState(AesSingleEffectState::SesScheduled);
ref.position = intersectionLocation;
ref.zPlacement = AesZPlacement::ZpAbsolute; // intersection: change from draped to relative
// m_effectsHaveChanged = true;
@@ -1478,7 +1478,7 @@ 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<AesEffectState::type> relevantEffStates = {AesEffectState::EsReceived,
static QVector<AesEffectState> relevantEffStates = {AesEffectState::EsReceived,
AesEffectState::EsCreated,
AesEffectState::EsPrepared,
AesEffectState::EsFired,
@@ -3298,7 +3298,7 @@ bool ObjectEffectCluster::overrideEffectorStates(const AesEffectorState &newStat
case AesEffectorState::EsReadyToFire:
{
// Override internal state in case DMF is not ready yet
m_data.effectorState = AesEffectorState::EsReadyToFire;
m_data.effectorState = static_cast<int>(AesEffectorState::EsReadyToFire);
DEBUG_LOG(m_logger) << "Set Ready to Fire !";
onPublishData();
@@ -227,7 +227,7 @@ void ObjectExplosionArea::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -647,9 +647,9 @@ Core::FunctionReplyObject ObjectExplosionCluster::checkObjectData(const Database
Core::FunctionReplyObject ret;
using geoType = AreaEffectSimulation::AesExplosionGeometry_def;
const geoType::type curExGeoType = data.explosionGeometryId.underlying();
static const QVector<geoType::type> ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry::EgAimPoint, // 0 -> default
using geoType = AreaEffectSimulation::AesExplosionGeometry;
const geoType curExGeoType = data.explosionGeometryId;
static const QVector<geoType> ecValidGeos = {AreaEffectSimulation::AesExplosionGeometry::EgAimPoint, // 0 -> default
AreaEffectSimulation::AesExplosionGeometry::EgPoint,
AreaEffectSimulation::AesExplosionGeometry::EgArea,
AreaEffectSimulation::AesExplosionGeometry::EgRadial,
@@ -675,7 +675,7 @@ Core::FunctionReplyObject ObjectExplosionCluster::checkObjectData(const Database
else if (!ecValidGeos.contains(curExGeoType))
reason = QString(QStringLiteral("ExplosionGeometryType not supported yet (%1)")).arg(static_cast<int>(curExGeoType));
// else if ((curExGeoType == AreaEffectSimulation::AesExplosionGeometry_def::EgArea) &&
// else if ((curExGeoType == AreaEffectSimulation::AesExplosionGeometry::EgArea) &&
// (data.impactCount <= 2))
// reason = QString(QStringLiteral("ImpactCount invalid (%1)")).arg(QStringLiteral("Area requires at least 2 impacts"));
@@ -1065,7 +1065,7 @@ void ObjectExplosionCluster::onPublishData()
0, // partitionTimeMSec(),
{m_data.chargeTypeId, m_data.igniterTypeId, m_data.igniterFunctionId},
m_data.effectDuration, // pause/resume: remainDuration
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -1297,7 +1297,7 @@ void ObjectExplosionCluster::adjustTrajectoryToDetonationLocation(int explosionI
// Effects:
std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = m_effects.singleEffects;
SingleEffect &ref = singleEffectsRef[explosionIndex];
// ref.effectState(AesSingleEffectState_def::SesScheduled);
// ref.effectState(AesSingleEffectState::SesScheduled);
ref.position = intersectionLocation;
ref.zPlacement = AesZPlacement::ZpAbsolute; // intersection: change from draped to relative
// m_effectsHaveChanged = true;
@@ -1558,7 +1558,7 @@ 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<AesEffectState::type> relevantEffStates = {
static QVector<AesEffectState> relevantEffStates = {
AesEffectState::EsCreated,
AesEffectState::EsPrepared,
AesEffectState::EsActivated, // 2026-05-27, N.Thoden: E01562-393: GTL auch bei EsFired anzeigen, daher auch bei EsActivated
@@ -1886,9 +1886,9 @@ void ObjectExplosionCluster::checkNextFire()
// continue;
// SingleEffect &ref = singleEffectsRef[idx];
// if (ref.singleEffectState().underlying() != AesSingleEffectState_def::SesTriggered)
// if (ref.singleEffectState().underlying() != AesSingleEffectState::SesTriggered)
// {
// ref.singleEffectState(AesSingleEffectState_def::SesTriggered);
// ref.singleEffectState(AesSingleEffectState::SesTriggered);
// ref.singleEffectTime(curPartTime);
// bChanged = true;
// }
@@ -143,7 +143,7 @@ void ObjectExplosionSingle::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -156,7 +156,7 @@ void ObjectFunctionalArea::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -190,7 +190,7 @@ void ObjectGasPipe::onPublishData()
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.effectStart = toOptional<int64_t>(toMSec(m_data.effectStart));
ddsData.width = m_data.width;
ddsData.effectStateId = effectState();
ddsData.partyId = toOptional(m_data.partyId);
@@ -1370,7 +1370,7 @@ void ObjectMineArea::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId, 0, 0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -33,7 +33,7 @@ ObjectMineAreaNull::ObjectMineAreaNull(MainHandler *mainHandler,
}
// Set TriggeredExplosions Base Data
m_tis.id = AesType::AtMineAreaSingleMines;
m_tis.id = static_cast<int>(AesType::AtMineAreaSingleMines);
m_tis.aesItemId = 0;
m_tis.aesTypeId = AesType::AtMineAreaSingleMines;
@@ -259,7 +259,7 @@ void ObjectMineAreaNull::publishAiv()
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.id = static_cast<int>(AesType::AtMineAreaSingleMines);
aiv2.effectStateId = AesEffectState::EsActivated;
aiv2.setId = dds::core::optional<rti::core::int64>(m_setId);
if (m_data.partyId != 0)
@@ -173,7 +173,7 @@ void ObjectMineCorridor::onPublishData()
m_mainHandler->dds()->currentPartitionTimeMSec(),
{m_data.chargeTypeId, 0,0 },
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
effectState(),
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -117,7 +117,7 @@ void ObjectNContamination::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -136,7 +136,7 @@ void ObjectOffRouteMine::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
toOptional(m_data.partyId),
@@ -94,7 +94,7 @@ void ObjectReconArea::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
dds::core::optional<int32_t>(),
@@ -90,7 +90,7 @@ void ObjectTechnicalArea::onPublishData()
partitionTimeMSec(),
{m_data.chargeTypeId,0,0},
m_data.effectDuration,
toOptional(toMSec(m_data.effectStart)),
toOptional<int64_t>(toMSec(m_data.effectStart)),
m_data.effectStateId,
m_data.effectSourceId,
dds::core::optional<int32_t>(),
@@ -26,7 +26,7 @@ public:
// [E01562-259] use originatorId, originatorTypeId (instead of aesItemId, aesTypeId)
// int aesItemId = -1;
// AesType aesTypeId = AesType::inner_enum::AtUnknown;
// AesType aesTypeId = AesType::AtUnknown;
int originatorId = -1;
ProjectDataManagement::StateChangeOriginator originatorTypeId = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Unknown;
qint64 startTime = 0;
@@ -49,7 +49,7 @@ public:
const Streams &findStreams(Asset *asset) override
{
Q_ASSERT(asset);
return findStreams(asset->data().id());
return findStreams(asset->data().id);
}
void insert(Streams &streams) override
@@ -124,7 +124,7 @@ public:
void remove(Asset *asset) override
{
Q_ASSERT(asset);
auto found = m_cache.find(asset->data().id());
auto found = m_cache.find(asset->data().id);
Q_ASSERT(found != m_cache.end());
const Streams &streams = found->second;
@@ -30,12 +30,12 @@ namespace
bool isRadioStation(const InfrastructureManagement::MainStructureElement &mse)
{
return mse.structureElementTypeId() == InfrastructureManagement::StructureElementType::RadioStation;
return mse.structureElementTypeId == InfrastructureManagement::StructureElementType::RadioStation;
}
QString hostnameForRadioStation(const InfrastructureManagement::MainStructureElement &mse)
{
LtsUtils::JsonObject properties = LtsUtils::JsonObject::fromJson(mse.properties());
LtsUtils::JsonObject properties = LtsUtils::JsonObject::fromJson(mse.properties);
return properties.valueOr("hostname", QString());
}
@@ -55,7 +55,7 @@ CnrChannel toDds(const Database::AvmCnrChannel &channel)
channel.ssrc,
channel.addacChannel,
channel.pttControl,
static_cast<FrequencyBand::inner_enum>(channel.frequencyBand));
static_cast<FrequencyBand>(channel.frequencyBand));
}
ModifyCnrConfigRequest toRequest(const Database::AvmCnrConfig &dbData, const boost::optional<int32_t> &requestId = boost::none)
@@ -72,28 +72,28 @@ ModifyCnrConfigRequest toRequest(const Database::AvmCnrConfig &dbData, const boo
ModifyCnrConfigRequest toRequest(const CnrConfig &cnrConfig)
{
return ModifyCnrConfigRequest(cnrConfig.id(),
cnrConfig.cnrChannelId(),
cnrConfig.exerciseId(),
cnrConfig.radioCircuit(),
cnrConfig.recording(),
cnrConfig.unitId(),
cnrConfig.partyId(),
cnrConfig.callSign());
return ModifyCnrConfigRequest(cnrConfig.id,
cnrConfig.cnrChannelId,
cnrConfig.exerciseId,
cnrConfig.radioCircuit,
cnrConfig.recording,
cnrConfig.unitId,
cnrConfig.partyId,
cnrConfig.callSign);
}
Database::AvmCnrConfig toDb(const ModifyCnrConfigRequest &config)
{
Database::AvmCnrConfig result;
result.id = config.id();
result.cnrChannelId = config.cnrChannelId();
result.radioCircuit = QString::fromStdString(config.radioCircuit());
result.callSign = QString::fromStdString(config.callSign());
result.partyId = config.partyId();
result.id = config.id;
result.cnrChannelId = config.cnrChannelId;
result.radioCircuit = QString::fromStdString(config.radioCircuit);
result.callSign = QString::fromStdString(config.callSign);
result.partyId = config.partyId;
if (config.unitId.is_set())
result.unitId = config.unitId.get();
result.recording = config.recording();
result.recording = config.recording;
if (config.exerciseId.is_set())
result.exerciseId = config.exerciseId.get();
@@ -120,22 +120,22 @@ public:
void create(const CnrConfig &config)
{
Q_ASSERT(!m_cache.contains(config.id()));
Q_ASSERT(!m_cache.contains(config.id));
Database::AvmDeviceConfig deviceConfig = m_handler->toDeviceConfig(config);
bool status = m_db->insert(deviceConfig);
if (!status)
ERROR_LOG(m_logger) << "Error while inserting device config";
m_cache.insert(config.id(), deviceConfig);
m_cache.insert(config.id, deviceConfig);
emit m_handler->avDbReloadNeeded();
}
void update(const CnrConfig &config)
{
Q_ASSERT(m_cache.contains(config.id()));
Q_ASSERT(m_cache.contains(config.id));
Database::AvmDeviceConfig oldDeviceConfig = m_cache.value(config.id());
Database::AvmDeviceConfig oldDeviceConfig = m_cache.value(config.id);
Database::AvmDeviceConfig newDeviceConfig = m_handler->toDeviceConfig(config);
newDeviceConfig.id = oldDeviceConfig.id;
@@ -143,13 +143,13 @@ public:
if (!status)
ERROR_LOG(m_logger) << "Error while updating device config";
m_cache[config.id()] = newDeviceConfig;
m_cache[config.id] = newDeviceConfig;
emit m_handler->avDbReloadNeeded();
}
void createOrUpdate(const CnrConfig &config)
{
if (m_cache.contains(config.id()))
if (m_cache.contains(config.id))
update(config);
else
create(config);
@@ -283,7 +283,7 @@ void CnrHandler::onRemoveCnrConfigRequest(const rti::core::SampleIdentity &cooki
void CnrHandler::onModifyCnrConfigRequest(const rti::core::SampleIdentity &cookie,
const ModifyCnrConfigRequest &request)
{
auto ret = (request.id() < 1 ? createCnrConfig(request) : modifyCnrConfig(request));
auto ret = (request.id < 1 ? createCnrConfig(request) : modifyCnrConfig(request));
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->modifyCnrConfigReply(cookie, ret);
@@ -365,10 +365,10 @@ void CnrHandler::onRadioStationChanged(const InfrastructureManagement::MainStruc
{
case DataModification::eAdded:
case DataModification::eModified:
onRadioStationAdded(data.id(), QString::fromStdString(data.name()), hostnameForRadioStation(data));
onRadioStationAdded(data.id, QString::fromStdString(data.name), hostnameForRadioStation(data));
break;
case DataModification::eRemoved:
onRadioStationRemoved(data.id());
onRadioStationRemoved(data.id);
break;
}
}
@@ -400,7 +400,7 @@ void CnrHandler::updateDeviceConfig()
DBTransaction trans(m_db->database());
for (const auto &config : qAsConst(m_cache))
if (config.isActive())
if (config.isActive)
m_deviceConfig->update(config);
trans.commit();
@@ -419,7 +419,7 @@ CnrConfig CnrHandler::toDds(const Database::AvmCnrConfig &config) const
false);
if (needDeviceConfig(cnrConfig))
cnrConfig.isActive(true);
cnrConfig.isActive = true;
return cnrConfig;
}
@@ -429,11 +429,11 @@ Database::AvmDeviceConfig CnrHandler::toDeviceConfig(const CnrConfig &cnrConfig)
static const QString recordingServer = QStringLiteral("EXCAVS01");
Database::AvmDeviceConfig deviceConfig;
const Database::AvmCnrChannel channel = channelById(cnrConfig.cnrChannelId());
const Database::AvmCnrChannel channel = channelById(cnrConfig.cnrChannelId);
deviceConfig.id = 0;
deviceConfig.context = exerciseList(cnrConfig);
deviceConfig.type = channel.addacChannel == 0 ? QStringLiteral("CNR_GUEZ_RT_CHANNEL") : QStringLiteral("ADDAC_RT_CHANNEL");
deviceConfig.name = QString::fromStdString(cnrConfig.radioCircuit());
deviceConfig.name = QString::fromStdString(cnrConfig.radioCircuit);
deviceConfig.controller = stationList(channel.addacChannel);
deviceConfig.definition = QStringLiteral("mode=1;ssrc=%1").arg(channel.ssrc);
//for UAE we need pttc controll to!
@@ -443,7 +443,7 @@ Database::AvmDeviceConfig CnrHandler::toDeviceConfig(const CnrConfig &cnrConfig)
#endif
if (channel.addacChannel)
deviceConfig.definition += QStringLiteral(";channel=%1").arg(normalizedAddacChannel(channel.addacChannel));
if (cnrConfig.recording())
if (cnrConfig.recording)
deviceConfig.definition.append(QStringLiteral(";recording=ECRS@%1").arg(recordingServer));
deviceConfig.link = 0;
@@ -457,17 +457,17 @@ Core::FunctionReplyObject CnrHandler::validateRequest(const ModifyCnrConfigReque
{
Core::FunctionReplyObject reply;
if (request.id() > 0)
if (request.id > 0)
{
reply.setId(request.id());
if (!m_cache.contains(request.id()))
return reply.setStr(tr_lts("dds", "Could not modify CNR config because id %1 is unknown")).arg(request.id());
reply.setId(request.id);
if (!m_cache.contains(request.id))
return reply.setStr(tr_lts("dds", "Could not modify CNR config because id %1 is unknown")).arg(request.id);
}
if (!isValidChannel(request.cnrChannelId()))
return reply.setStr(tr_lts("dds", "Could not create/modify CNR config because the channel with id %1 is invalid")).arg(request.cnrChannelId());
if (!isValidChannel(request.cnrChannelId))
return reply.setStr(tr_lts("dds", "Could not create/modify CNR config because the channel with id %1 is invalid")).arg(request.cnrChannelId);
if (!isStreamNameValid(request.radioCircuit()))
if (!isStreamNameValid(request.radioCircuit))
return reply.setStr(tr_lts("dds", "Could not create/modify CNR config because the circuit name is invalid"));
if (!isNameUnique(request))
@@ -483,7 +483,7 @@ bool CnrHandler::checkConstraint(const std::function<bool (const CnrConfig &)> &
{
for (const CnrConfig &config : qAsConst(m_cache))
{
if (excludeId == config.id())
if (excludeId == config.id)
continue;
// If both configs are local the constraint must hold if they are in the same exercise
@@ -526,31 +526,31 @@ bool CnrHandler::isValidChannel(int64_t channelId) const
bool CnrHandler::isFreeChannel(const ModifyCnrConfigRequest &request) const
{
boost::optional<int> exerciseId = toBoost(request.exerciseId());
boost::optional<int> exerciseId = toBoost(request.exerciseId);
if (request.id() <= 0)
return isFreeChannel(request.cnrChannelId(), exerciseId);
return isFreeChannel(request.cnrChannelId(), exerciseId, request.id());
if (request.id <= 0)
return isFreeChannel(request.cnrChannelId, exerciseId);
return isFreeChannel(request.cnrChannelId, exerciseId, request.id);
}
bool CnrHandler::isFreeChannel(int32_t channelId, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const
{
auto constraint = [&channelId] (const CnrConfig &config) { return config.cnrChannelId() != channelId; };
auto constraint = [&channelId] (const CnrConfig &config) { return config.cnrChannelId != channelId; };
return checkConstraint(constraint, exerciseId, excludeId);
}
bool CnrHandler::isNameUnique(const ModifyCnrConfigRequest &request)
{
boost::optional<int> exerciseId = toBoost(request.exerciseId());
boost::optional<int> exerciseId = toBoost(request.exerciseId);
if (request.id() <= 0)
return isNameUnique(request.radioCircuit(), exerciseId);
return isNameUnique(request.radioCircuit(), exerciseId, request.id());
if (request.id <= 0)
return isNameUnique(request.radioCircuit, exerciseId);
return isNameUnique(request.radioCircuit, exerciseId, request.id);
}
bool CnrHandler::isNameUnique(const std::string &name, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const
{
auto constraint = [&name] (const CnrConfig &config) { return config.radioCircuit() != name; };
auto constraint = [&name] (const CnrConfig &config) { return config.radioCircuit != name; };
return checkConstraint(constraint, exerciseId, excludeId);
}
@@ -576,10 +576,10 @@ Core::FunctionReplyObject CnrHandler::createCnrConfig(const ModifyCnrConfigReque
}
CnrConfig cnrConfig = toDds(dbConfigData);
m_cache.insert(cnrConfig.id(), cnrConfig);
m_cache.insert(cnrConfig.id, cnrConfig);
m_dts->publish(cnrConfig);
if (cnrConfig.isActive())
if (cnrConfig.isActive)
m_deviceConfig->create(cnrConfig);
return Core::FunctionReplyObject(dbConfigData.id);
@@ -593,7 +593,7 @@ Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigReque
if (reply.error())
return reply;
auto found = m_cache.find(request.id());
auto found = m_cache.find(request.id);
Q_ASSERT(found != m_cache.end());
const CnrConfig &oldCnrConfig = *found;
@@ -604,24 +604,24 @@ Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigReque
// But not every entry from the FrequencySet can be assigned, e.g. a CnrConfig of (channel-)type VHF cannot
// be assigned to a FrequencySet-entry of type HF.
// Thus changing the CnrChannel would possibly invalidate those assignments in the FrequencyPlanning.
if (request.cnrChannelId() != oldCnrConfig.cnrChannelId())
if (request.cnrChannelId != oldCnrConfig.cnrChannelId)
return reply.setStr(tr_lts("dds", "Changing the CNR channel is not allowed"));
Database::AvmCnrConfig dbConfigData = toDb(request);
CnrConfig newCnrConfig = toDds(dbConfigData);
if (newCnrConfig.isActive())
if (newCnrConfig.isActive)
m_deviceConfig->createOrUpdate(newCnrConfig);
else
m_deviceConfig->tryRemove(newCnrConfig.id());
m_deviceConfig->tryRemove(newCnrConfig.id);
if (newCnrConfig == oldCnrConfig)
return reply;
if (!m_db->update(dbConfigData))
return reply.setStr(tr_lts("dds", "Error updating CNR config data with id %1 in database")).arg(request.id());
return reply.setStr(tr_lts("dds", "Error updating CNR config data with id %1 in database")).arg(request.id);
m_cache[newCnrConfig.id()] = newCnrConfig;
m_cache[newCnrConfig.id] = newCnrConfig;
m_dts->publish(newCnrConfig);
@@ -633,7 +633,7 @@ Core::FunctionReplyObject CnrHandler::removeCnrConfig(const Core::RemoveElementR
{
DEBUG_LOG(m_logger) << "RemoveCnrConfigRequest: " << request;
int32_t configId = request.id();
int32_t configId = request.id;
Core::FunctionReplyObject reply(configId);
auto found = m_cache.find(configId);
@@ -647,7 +647,7 @@ Core::FunctionReplyObject CnrHandler::removeCnrConfig(const Core::RemoveElementR
m_dts->removeCnrConfigByKey(configId);
if (!m_db->removeAvmCnrConfig(configId))
return reply.setStr(tr_lts("dds", "Could not remove CNR config data with id %1")).arg(request.id());
return reply.setStr(tr_lts("dds", "Could not remove CNR config data with id %1")).arg(request.id);
emit cnrConfigRemoved(configId);
@@ -675,7 +675,7 @@ bool CnrHandler::needDeviceConfig(const CnrConfig &config) const
return false;
// Config needs to be referenced. (Wonder if its possible to have a non-referenced one...)
if (m_frequencyPlanningHandler->isReferencedByActivePlan(exerciseId, config.id()))
if (m_frequencyPlanningHandler->isReferencedByActivePlan(exerciseId, config.id))
return true;
return false;
@@ -48,18 +48,18 @@ CnrTvcProfile toDds(const Database::AvmCnrTvcProfile &circuitContainerDb, T circ
std::sort(circuitsDb.begin(), circuitsDb.end(), lessRadioCircuitsContent);
CnrTvcProfile circuitContainerDds(circuitContainerDb.id, circuitContainerDb.operatorId, circuitContainerDb.exerciseId, {});
circuitContainerDds.data().reserve(circuitsDb.size());
circuitContainerDds.data.reserve(circuitsDb.size());
for (const auto &currentCircuitDb : qAsConst(circuitsDb))
circuitContainerDds.data().push_back(toDds(currentCircuitDb));
circuitContainerDds.data.push_back(toDds(currentCircuitDb));
return circuitContainerDds;
}
Database::AvmCnrTvcProfile toDb(const CnrTvcProfile &profileDds)
{
Database::AvmCnrTvcProfile profileDb;
profileDb.id = profileDds.id();
profileDb.operatorId = profileDds.operatorId();
profileDb.exerciseId = profileDds.exerciseId();
profileDb.id = profileDds.id;
profileDb.operatorId = profileDds.operatorId;
profileDb.exerciseId = profileDds.exerciseId;
return profileDb;
}
@@ -69,14 +69,14 @@ Database::AvmCnrTvcProfileData toDb(const CnrTvcProfileData &circuitDds, int32_t
circuitDb.containerId = containerId;
circuitDb.sortIndex = sortIndex;
switch (circuitDds.radioSystemId().underlying())
switch (circuitDds.radioSystemId)
{
case RadioSystem::Cnr:
circuitDb.cnrConfigId = circuitDds.radioCircuitId();
circuitDb.cnrConfigId = circuitDds.radioCircuitId;
return circuitDb;
case RadioSystem::Tvc:
circuitDb.tvcConfigId = circuitDds.radioCircuitId();
circuitDb.tvcConfigId = circuitDds.radioCircuitId;
return circuitDb;
}
Q_ASSERT(false);
@@ -225,7 +225,7 @@ void CnrTvcProfileHandler::onModifyCnrTvcProfileRequest(const rti::core::SampleI
const CnrTvcProfile &request)
{
Core::FunctionReplyObject rep;
if (request.id() <= 0)
if (request.id <= 0)
rep = createProfile(request);
else
rep = modifyProfile(request);
@@ -249,7 +249,7 @@ void CnrTvcProfileHandler::onRemoveCnrTvcProfileRequest(const rti::core::SampleI
Core::FunctionReplyObject CnrTvcProfileHandler::createProfile(const CnrTvcProfile &createRequest)
{
Q_ASSERT(createRequest.id() <= 0);
Q_ASSERT(createRequest.id <= 0);
Core::FunctionReplyObject reply = validateRequest(createRequest);
if (reply.error())
@@ -263,7 +263,7 @@ Core::FunctionReplyObject CnrTvcProfileHandler::createProfile(const CnrTvcProfil
return reply.setStr(tr_lts("dds", "Failed to insert into 'avm.avm_cnr_tvc_profile'"));
reply.setId(dbEntry.id);
const auto circuitDataDb = insert(createRequest.data(), dbEntry.id, status);
const auto circuitDataDb = insert(createRequest.data, dbEntry.id, status);
if (!status)
return reply.setStr(tr_lts("dds", "Failed to insert into 'avm.avm_cnr_tvc_profile_data'"));
@@ -277,7 +277,7 @@ Core::FunctionReplyObject CnrTvcProfileHandler::createProfile(const CnrTvcProfil
Core::FunctionReplyObject CnrTvcProfileHandler::modifyProfile(const CnrTvcProfile &modifyRequest)
{
Q_ASSERT(modifyRequest.id() > 0);
Q_ASSERT(modifyRequest.id > 0);
Core::FunctionReplyObject reply = validateRequest(modifyRequest);
if (reply.error())
@@ -288,13 +288,13 @@ Core::FunctionReplyObject CnrTvcProfileHandler::modifyProfile(const CnrTvcProfil
bool status = m_db->update(dbEntry);
if (!status)
return reply.setStr(tr_lts("dds", "Failed to update 'avm.avm_cnr_tvc_profile' data with id %1")).arg(modifyRequest.id());
return reply.setStr(tr_lts("dds", "Failed to update 'avm.avm_cnr_tvc_profile' data with id %1")).arg(modifyRequest.id);
status = m_db->removeAvmCnrTvcProfileDataByContainerId(modifyRequest.id());
status = m_db->removeAvmCnrTvcProfileDataByContainerId(modifyRequest.id);
if (!status)
return reply.setStr(tr_lts("dds", "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with container_id %1")).arg(modifyRequest.id());
return reply.setStr(tr_lts("dds", "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with container_id %1")).arg(modifyRequest.id);
insert(modifyRequest.data(), modifyRequest.id(), status);
insert(modifyRequest.data, modifyRequest.id, status);
if (!status)
return reply.setStr(tr_lts("dds", "Failed to insert into 'avm.avm_cnr_tvc_profile_data'"));
@@ -312,16 +312,16 @@ Core::FunctionReplyObject CnrTvcProfileHandler::removeProfile(const Core::Remove
DBTransaction dbTransaction(m_db->database());
bool status = m_db->removeAvmCnrTvcProfileDataByContainerId(request.id());
bool status = m_db->removeAvmCnrTvcProfileDataByContainerId(request.id);
if (!status)
return reply.setStr(tr_lts("dds", "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with container_id %1")).arg(request.id());
return reply.setStr(tr_lts("dds", "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with container_id %1")).arg(request.id);
status = m_db->removeAvmCnrTvcProfile(request.id());
status = m_db->removeAvmCnrTvcProfile(request.id);
if (!status)
return reply.setStr(tr_lts("dds", "Failed to remove from 'avm.avm_cnr_tvc_profile' with id %1")).arg(request.id());
return reply.setStr(tr_lts("dds", "Failed to remove from 'avm.avm_cnr_tvc_profile' with id %1")).arg(request.id);
dbTransaction.commit();
removeProfile(request.id());
removeProfile(request.id);
return reply;
}
@@ -350,18 +350,18 @@ std::vector<Database::AvmCnrTvcProfileData> CnrTvcProfileHandler::insert(const s
void CnrTvcProfileHandler::addProfile(const CnrTvcProfile &profile)
{
Q_ASSERT(profile.id() > 0);
Q_ASSERT(!m_cache.contains(profile.id()));
Q_ASSERT(profile.id > 0);
Q_ASSERT(!m_cache.contains(profile.id));
OperatorExerciseKey key(profile);
Q_ASSERT(!m_uniqueKeys.contains(key));
m_cache[profile.id()] = profile;
m_cache[profile.id] = profile;
m_uniqueKeys.append(key);
bool status = m_dts->publish(profile);
if (!status)
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id());
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id);
}
void CnrTvcProfileHandler::removeProfile(int64_t id)
@@ -380,30 +380,30 @@ void CnrTvcProfileHandler::removeProfile(int64_t id)
void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile)
{
Q_ASSERT(profile.id() > 0);
Q_ASSERT(m_cache.contains(profile.id()));
Q_ASSERT(profile.id > 0);
Q_ASSERT(m_cache.contains(profile.id));
OperatorExerciseKey key(profile);
Q_ASSERT(m_uniqueKeys.contains(key));
if (m_cache[profile.id()] == profile)
if (m_cache[profile.id] == profile)
return;
m_cache[profile.id()] = profile;
m_cache[profile.id] = profile;
bool status = m_dts->publish(profile);
if (!status)
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id());
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id);
}
void CnrTvcProfileHandler::onCnrConfigChanged(const CnrConfig &cnrConfig)
{
onConfigChanged(cnrConfig.id(), RadioSystem::Cnr);
onConfigChanged(cnrConfig.id, RadioSystem::Cnr);
}
void CnrTvcProfileHandler::onTvcConfigChanged(const TvcConfig &tvcConfig)
{
onConfigChanged(tvcConfig.id(), RadioSystem::Tvc);
onConfigChanged(tvcConfig.id, RadioSystem::Tvc);
}
/**
@@ -461,38 +461,38 @@ Core::FunctionReplyObject CnrTvcProfileHandler::validateRequest(const CnrTvcProf
{
Core::FunctionReplyObject reply;
if (request.id() > 0)
if (request.id > 0)
{
// modify
reply.setId(request.id());
reply.setId(request.id);
if (!m_cache.contains(request.id()))
return reply.setStr(tr_lts("dds", "CnrTvcProfile for operator %1 in exercise %2 does not exist")).arg(request.operatorId()).arg(request.exerciseId());
if (!m_cache.contains(request.id))
return reply.setStr(tr_lts("dds", "CnrTvcProfile for operator %1 in exercise %2 does not exist")).arg(request.operatorId).arg(request.exerciseId);
if (OperatorExerciseKey(m_cache.value(request.id())) != OperatorExerciseKey(request))
if (OperatorExerciseKey(m_cache.value(request.id)) != OperatorExerciseKey(request))
return reply.setStr(tr_lts("dds", "operator or exercise may not be changed"));
}
else
{
// create
if (m_uniqueKeys.contains(OperatorExerciseKey(request)))
return reply.setStr(tr_lts("dds", "CnrTvcProfile for operator %1 already exists in exercise %2")).arg(request.operatorId()).arg(request.exerciseId());
return reply.setStr(tr_lts("dds", "CnrTvcProfile for operator %1 already exists in exercise %2")).arg(request.operatorId).arg(request.exerciseId);
}
if (request.data().size() == 0)
if (request.data.size() == 0)
return reply.setStr(tr_lts("dds", "CnrTvcProfile must not be empty"));
for (const auto &entry : request.data())
for (const auto &entry : request.data)
{
if (entry.radioSystemId() == RadioSystem::Tvc)
if (entry.radioSystemId == RadioSystem::Tvc)
{
auto reply2 = isValidTvc(entry.radioCircuitId(), request.exerciseId(), request.id());
auto reply2 = isValidTvc(entry.radioCircuitId, request.exerciseId, request.id);
if (reply2.error())
return reply2;
}
else if (entry.radioSystemId() == RadioSystem::Cnr)
else if (entry.radioSystemId == RadioSystem::Cnr)
{
auto reply2 = isValidCnr(entry.radioCircuitId(), request.exerciseId(), request.id());
auto reply2 = isValidCnr(entry.radioCircuitId, request.exerciseId, request.id);
if (reply2.error())
return reply2;
}
@@ -503,11 +503,11 @@ Core::FunctionReplyObject CnrTvcProfileHandler::validateRequest(const CnrTvcProf
Core::FunctionReplyObject CnrTvcProfileHandler::validateRequest(const Core::RemoveElementRequest &request) const
{
Q_ASSERT(request.id() > 0);
Core::FunctionReplyObject reply(request.id());
Q_ASSERT(request.id > 0);
Core::FunctionReplyObject reply(request.id);
if (!m_cache.contains(request.id()))
return reply.setStr(tr_lts("dds", "CnrTvcProfile %1 does not exist")).arg(request.id());
if (!m_cache.contains(request.id))
return reply.setStr(tr_lts("dds", "CnrTvcProfile %1 does not exist")).arg(request.id);
return reply;
}
@@ -571,8 +571,8 @@ void CnrTvcProfileHandler::onConfigChanged(int32_t configId, RadioSystem type)
// Find all CnrTvcProfiles where this config is referenced and reload those.
// Hint: reloading might modify m_cache. Thus the reloading is done in a separate loop.
for (const auto &profile : qAsConst(m_cache))
for (const auto &data : profile.data())
if (data.radioSystemId() == type && data.radioCircuitId() == configId)
for (const auto &data : profile.data)
if (data.radioSystemId == type && data.radioCircuitId == configId)
{
toBeReloaded.append(profile);
break;
@@ -102,8 +102,8 @@ private:
{}
explicit OperatorExerciseKey(const CnrTvcProfile &profile)
: operatorId(profile.operatorId())
, exerciseId(profile.exerciseId())
: operatorId(profile.operatorId)
, exerciseId(profile.exerciseId)
{}
qint64 operatorId{0};
@@ -29,15 +29,15 @@ std::set<int32_t> mountingPointsOfInterest(const InfrastructureManagement::Mai
{
std::set<int32_t> mountingPoints;
for (const auto &se : building.elements())
for (const auto &se : building.elements)
{
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType::MountingPoint)
if (se.structureElementTypeId != InfrastructureManagement::StructureElementType::MountingPoint)
continue;
if (se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::AnnouncementUnit ||
se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::IndoorCamera ||
se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::OutdoorCamera)
mountingPoints.insert(se.id());
if (se.mountingPointTypeId == InfrastructureManagement::MountingPointType::AnnouncementUnit ||
se.mountingPointTypeId == InfrastructureManagement::MountingPointType::IndoorCamera ||
se.mountingPointTypeId == InfrastructureManagement::MountingPointType::OutdoorCamera)
mountingPoints.insert(se.id);
}
return mountingPoints;
@@ -47,7 +47,7 @@ bool isStreamOfInterest(const AudioVideoManagement::Stream &stream, bool isAudio
{
using AudioVideoManagement::StreamType;
switch (stream.type().underlying())
switch (stream.type)
{
case StreamType::Video:
return !isAudio;
@@ -94,7 +94,7 @@ DefaultAvMenus::~DefaultAvMenus() = default;
void DefaultAvMenus::onStreamChanged(const Stream &stream)
{
m_streams[stream.id()] = stream;
m_streams[stream.id] = stream;
m_timer->start();
}
@@ -109,20 +109,20 @@ void DefaultAvMenus::onMainStructureElementChanged(const InfrastructureManagemen
if(modType == DataModification::eRemoved)
{
m_buildingDisplayNameForId.remove(data.id());
m_buildingDisplayNameForId.remove(data.id);
m_timer->start();
}
else if(modType == DataModification::eAdded)
{
m_buildingDisplayNameForId[data.id()] = buildingDisplayName;
m_buildingDisplayNameForId[data.id] = buildingDisplayName;
m_timer->start();
}
else
{
if(m_buildingDisplayNameForId.value(data.id(),buildingDisplayName) == buildingDisplayName)
if(m_buildingDisplayNameForId.value(data.id,buildingDisplayName) == buildingDisplayName)
return;
m_buildingDisplayNameForId[data.id()] = buildingDisplayName;
m_buildingDisplayNameForId[data.id] = buildingDisplayName;
m_timer->start();
}
}
@@ -150,17 +150,17 @@ void DefaultAvMenus::removeMenus()
void DefaultAvMenus::updateMenu(bool isAudio)
{
MenuStruct menu;
menu.id(menuStructId(isAudio));
menu.isDefault(true);
menu.name("Default");
menu.isAudio(isAudio);
menu.id = menuStructId(isAudio);
menu.isDefault = true;
menu.name = "Default";
menu.isAudio = isAudio;
std::vector<AvMenuEntry> allEntries;
const auto &buildings = m_ismDtc->mainStructureElements();
for (const auto &building : buildings)
{
m_buildingDisplayNameForId[building.id()] = getDisplayNameForBuilding(building);
m_buildingDisplayNameForId[building.id] = getDisplayNameForBuilding(building);
std::vector<AvMenuEntry> subMenu = subMenuForBuilding(building, isAudio);
std::move(subMenu.begin(), subMenu.end(), std::back_inserter(allEntries));
}
@@ -169,24 +169,24 @@ void DefaultAvMenus::updateMenu(bool isAudio)
{
bool addMenu = false;
AvMenuEntry mvsStreams;
mvsStreams.id(1000000);
mvsStreams.parentId(menuStructId(isAudio));
mvsStreams.name().set("MVS");
mvsStreams.isGroup(true);
mvsStreams.id = 1000000;
mvsStreams.parentId = menuStructId(isAudio);
mvsStreams.name = "MVS";
mvsStreams.isGroup = true;
const auto &videoTeams = m_videoTeamHandler->videoTeams();
for (const auto &videoTeam : videoTeams)
{
if (videoTeam.exerciseId() != m_context.id())
if (videoTeam.exerciseId != m_context.id())
continue;
addMenu = true;
AvMenuEntry streamEntry;
streamEntry.id(videoTeam.id());
streamEntry.parentId(mvsStreams.id());
streamEntry.mountingPointId(-1*videoTeam.id());
streamEntry.id = videoTeam.id;
streamEntry.parentId = mvsStreams.id;
streamEntry.mountingPointId = -1 * videoTeam.id;
// Also set the stream name which makes it easier for the clients.
streamEntry.name().set(videoTeam.streamName());
streamEntry.isGroup(false);
streamEntry.name = videoTeam.streamName;
streamEntry.isGroup = false;
allEntries.push_back(streamEntry);
// What about the rowId?
}
@@ -196,7 +196,7 @@ void DefaultAvMenus::updateMenu(bool isAudio)
}
}
menu.menuEntries(allEntries);
menu.menuEntries = allEntries;
HandlerMenuStruct::sortEntries(menu);
m_dts->publish(menu);
@@ -210,11 +210,11 @@ void DefaultAvMenus::updateMenu(bool isAudio)
QString DefaultAvMenus::getDisplayNameForBuilding(const InfrastructureManagement::MainStructureElement &data)
{
for (auto structure : data.elements()) {
if(structure.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
return QString::fromStdString(structure.displayName());
for (auto structure : data.elements) {
if(structure.structureElementTypeId == InfrastructureManagement::StructureElementType::Building)
return QString::fromStdString(structure.displayName);
}
return QString::fromStdString(data.name());
return QString::fromStdString(data.name);
}
std::vector<AvMenuEntry> DefaultAvMenus::subMenuForBuilding(const InfrastructureManagement::MainStructureElement &building, bool isAudio)
@@ -227,10 +227,10 @@ std::vector<AvMenuEntry> DefaultAvMenus::subMenuForBuilding(const Infrastructure
entries.reserve(streams.size() + 1);
AvMenuEntry buildingEntry;
buildingEntry.id(building.id());
buildingEntry.parentId(menuStructId(isAudio));
buildingEntry.name(getDisplayNameForBuilding(building).toStdString());
buildingEntry.isGroup(true);
buildingEntry.id = building.id;
buildingEntry.parentId = menuStructId(isAudio);
buildingEntry.name = getDisplayNameForBuilding(building).toStdString();
buildingEntry.isGroup = true;
// What about the rowId?
entries.push_back(buildingEntry);
@@ -238,12 +238,12 @@ std::vector<AvMenuEntry> DefaultAvMenus::subMenuForBuilding(const Infrastructure
for (const auto &stream : streams)
{
AvMenuEntry streamEntry;
streamEntry.id(stream.mountingPointId());
streamEntry.parentId(buildingEntry.id());
streamEntry.mountingPointId(stream.mountingPointId());
streamEntry.id = stream.mountingPointId;
streamEntry.parentId = buildingEntry.id;
streamEntry.mountingPointId = stream.mountingPointId;
// Also set the stream name which makes it easier for the clients.
streamEntry.name().set(AudioVideoHandlerImpl::internalStreamName(stream.mountingPointId()).toStdString());
streamEntry.isGroup(false);
streamEntry.name = AudioVideoHandlerImpl::internalStreamName(stream.mountingPointId).toStdString();
streamEntry.isGroup = false;
// What about the rowId?
entries.push_back(streamEntry);
@@ -263,7 +263,7 @@ std::vector<Stream> DefaultAvMenus::streamsForBuilding(const InfrastructureManag
if (!isStreamOfInterest(stream, isAudio))
continue;
if (!mountingPoints.count(stream.mountingPointId()))
if (!mountingPoints.count(stream.mountingPointId))
continue;
streams.push_back(stream);
@@ -189,7 +189,7 @@ void ExerciseHandler::onLastSeenTimerTimeout()
// and remove all device_config entries except the record/replay session
// when the cleanup is finished (signal from A/V) we remove also the last two sessions and delete our self
auto ex = exmDtc()->exercise(m_exContext.id());
if (ex.id() == m_exContext.id())
if (ex.id == m_exContext.id())
{
// found -> update last seen timestamp
m_lastSeen.context = m_exContext.toString();
@@ -263,7 +263,7 @@ void ExerciseHandler::onContextFilesDeleted(const ExerciseContext &context)
AVControl::OperatingMode ExerciseHandler::avModeFromExerciseState(ExerciseManagement::ExerciseState state)
{
switch (state.underlying())
switch (state)
{
case ExerciseManagement::ExerciseState::Unknown:
case ExerciseManagement::ExerciseState::Created:
@@ -115,7 +115,7 @@ void ExercisesHandler::onExerciseChanged(const ExerciseManagement::Exercise &dat
{
case DataModification::eAdded:
case DataModification::eModified:
exerciseModified(data.id(), data.state());
exerciseModified(data.id, data.state);
break;
case DataModification::eRemoved:
// nothing to do here
@@ -29,9 +29,9 @@ FrequencyPlanningData toDds(const Database::AvmFrequencyPlanningData &dbEntry)
{
FrequencyPlanningData ddsEntry;
ddsEntry.cnrConfigId(dbEntry.cnrConfigId);
ddsEntry.frequencyPlanningId(dbEntry.frequencyPlanningId);
ddsEntry.properties(dbEntry.properties.toStdString());
ddsEntry.cnrConfigId = dbEntry.cnrConfigId;
ddsEntry.frequencyPlanningId = dbEntry.frequencyPlanningId;
ddsEntry.properties = dbEntry.properties.toStdString();
return ddsEntry;
}
@@ -41,14 +41,14 @@ FrequencyPlanning toDds(const Database::AvmFrequencyPlanning &dbPlan,
{
FrequencyPlanning ddsPlan;
ddsPlan.id(dbPlan.id);
ddsPlan.date(dbPlan.dateOfCreation);
ddsPlan.id = dbPlan.id;
ddsPlan.date = dbPlan.dateOfCreation;
if (!dbPlan.exerciseId.isNull())
ddsPlan.exerciseId(dbPlan.exerciseId.value<int>());
ddsPlan.exerciseId = dbPlan.exerciseId.value<int>();
ddsPlan.frequencySetId(dbPlan.frequencySetId);
ddsPlan.name(dbPlan.name.toStdString());
ddsPlan.frequencySetId = dbPlan.frequencySetId;
ddsPlan.name = dbPlan.name.toStdString();
std::vector<FrequencyPlanningData> ddsEntries;
ddsEntries.reserve(dbEntries.size());
@@ -57,7 +57,7 @@ FrequencyPlanning toDds(const Database::AvmFrequencyPlanning &dbPlan,
ddsEntries.push_back(toDds(dbEntry));
}
ddsPlan.data(ddsEntries);
ddsPlan.data = ddsEntries;
return ddsPlan;
}
@@ -72,12 +72,12 @@ Database::AvmFrequencyPlanning toDb(const ModifyFrequencyPlanningRequest &reques
{
Database::AvmFrequencyPlanning result;
result.id = request.id();
result.name = QString::fromStdString(request.name());
if(request.exerciseId() != 0)
result.exerciseId = request.exerciseId();
result.dateOfCreation = request.date();
result.frequencySetId = request.frequencySetId();
result.id = request.id;
result.name = QString::fromStdString(request.name);
if(request.exerciseId != 0)
result.exerciseId = request.exerciseId;
result.dateOfCreation = request.date;
result.frequencySetId = request.frequencySetId;
return result;
}
@@ -85,11 +85,11 @@ Database::AvmFrequencyPlanning toDb(const ModifyFrequencyPlanningRequest &reques
Database::AvmFrequencyPlanning toDb(const FrequencyPlanning &ddsPlan)
{
Database::AvmFrequencyPlanning dbPlan;
dbPlan.id = ddsPlan.id();
dbPlan.id = ddsPlan.id;
if (ddsPlan.exerciseId.is_set())
dbPlan.exerciseId = ddsPlan.exerciseId.get();
dbPlan.dateOfCreation = ddsPlan.date();
dbPlan.frequencySetId = ddsPlan.frequencySetId();
dbPlan.dateOfCreation = ddsPlan.date;
dbPlan.frequencySetId = ddsPlan.frequencySetId;
return dbPlan;
}
@@ -99,8 +99,8 @@ Database::AvmFrequencyPlanningData toDb(const FrequencyPlanningData &data, int32
Database::AvmFrequencyPlanningData result;
result.frequencyPlanningId = frequencyPlanningId;
result.cnrConfigId = data.cnrConfigId();
result.properties = QString::fromStdString(data.properties());
result.cnrConfigId = data.cnrConfigId;
result.properties = QString::fromStdString(data.properties);
return result;
}
@@ -183,7 +183,7 @@ bool FrequencyPlanningHandler::init()
void FrequencyPlanningHandler::onModifyFrequencyPlanningRequest(const rti::core::SampleIdentity &cookie,
const ModifyFrequencyPlanningRequest &request)
{
auto ret = request.id() > 0 ? handleModify(request) : handleCreate(request);
auto ret = request.id > 0 ? handleModify(request) : handleCreate(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->modifyFrequencyPlanningReply(cookie, ret);
@@ -229,9 +229,9 @@ bool FrequencyPlanningHandler::isReferencedByActivePlan(int32_t exerciseId, int3
Q_ASSERT(m_cache.contains(found->frequencyPlanningId));
const FrequencyPlanning &activePlan = m_cache.value(found->frequencyPlanningId);
for (const FrequencyPlanningData &entry : activePlan.data())
for (const FrequencyPlanningData &entry : activePlan.data)
{
if (entry.cnrConfigId() == cnrConfigId)
if (entry.cnrConfigId == cnrConfigId)
return true;
}
@@ -240,7 +240,7 @@ bool FrequencyPlanningHandler::isReferencedByActivePlan(int32_t exerciseId, int3
Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFrequencyPlanningRequest &request)
{
Q_ASSERT(request.id() <= 0);
Q_ASSERT(request.id <= 0);
Core::FunctionReplyObject reply = validateRequest(request);
if (reply.error())
@@ -256,7 +256,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFre
bool status = false;
std::vector<Database::AvmFrequencyPlanningData> dbEntries;
for(auto data = request.data().begin(); data != request.data().end(); data++)
for(auto data = request.data.begin(); data != request.data.end(); data++)
{
Database::AvmFrequencyPlanningData dbEntry = toDb((*data), dbPlanning.id);
@@ -273,9 +273,9 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFre
trans.commit();
addPlan(toDds(dbPlanning, dbEntries));
if(request.exerciseId() == 0) //set global as active
if(request.exerciseId == 0) //set global as active
{
ModifyActiveFrequencyPlanningRequest modRequest(request.exerciseId() , dbPlanning.id);
ModifyActiveFrequencyPlanningRequest modRequest(request.exerciseId , dbPlanning.id);
modifyActiveFrequencyPlanningRequest(modRequest);
}
@@ -284,7 +284,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFre
Core::FunctionReplyObject FrequencyPlanningHandler::handleModify(const ModifyFrequencyPlanningRequest &request)
{
Q_ASSERT(request.id() > 0);
Q_ASSERT(request.id > 0);
Core::FunctionReplyObject reply = validateRequest(request);
if (reply.error())
@@ -294,13 +294,13 @@ Q_ASSERT(request.id() > 0);
DBTransaction trans(m_db->database());
if (!m_db->removeAvmFrequencyPlanningDataByFrequencyPlanningId(request.id()) ||
if (!m_db->removeAvmFrequencyPlanningDataByFrequencyPlanningId(request.id) ||
!m_db->update(dbPlanning))
return reply.setStr(tr_lts("dds", "Error updating FrequencyPlanning data with id %1")).arg(request.id());
return reply.setStr(tr_lts("dds", "Error updating FrequencyPlanning data with id %1")).arg(request.id);
bool status = false;
std::vector<Database::AvmFrequencyPlanningData> dbEntries;
for(auto data = request.data().begin(); data != request.data().end(); data++)
for(auto data = request.data.begin(); data != request.data.end(); data++)
{
Database::AvmFrequencyPlanningData dbEntry = toDb((*data), dbPlanning.id);
@@ -329,13 +329,13 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleRemove(const Core::Rem
// first remove the data
// removeAvmFrequencyPlanningDataByFrequencyPlanningId not really needed to due FK
if (!m_db->removeAvmFrequencyPlanningDataByFrequencyPlanningId(request.id()) ||
!m_db->removeAvmFrequencyPlanning(request.id()))
return reply.setStr(tr_lts("dds", "Error removing FrequencyPlanningRequest data with id %1 from database")).arg(request.id());
if (!m_db->removeAvmFrequencyPlanningDataByFrequencyPlanningId(request.id) ||
!m_db->removeAvmFrequencyPlanning(request.id))
return reply.setStr(tr_lts("dds", "Error removing FrequencyPlanningRequest data with id %1 from database")).arg(request.id);
trans.commit();
removePlan(request.id());
removePlan(request.id);
return reply;
}
@@ -344,7 +344,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const Modify
{
Core::FunctionReplyObject reply;
if (request.id() > 0)
if (request.id > 0)
{
reply = validateModifyRequest(request);
if (reply.error())
@@ -357,13 +357,13 @@ Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const Modify
// Validate that the FrequencySet-entries actually belong to the referenced FrequencySet.
for (const FrequencyPlanningData &entry : request.data())
for (const FrequencyPlanningData &entry : request.data)
{
QSet<int> frequencySetEntries = AudioVideoManagement::frequencySetDataIds(entry.properties());
QSet<int> frequencySetEntries = AudioVideoManagement::frequencySetDataIds(entry.properties);
for(const int &setEntry : qAsConst(frequencySetEntries))
{
if (setEntry != 0 && !m_frequencySetHandler->isValid(request.frequencySetId(), setEntry))
return reply.setStr(tr_lts("dds", "FrequencySetData %1 does not belong to FrequencySet %2")).arg(setEntry).arg(request.frequencySetId());
if (setEntry != 0 && !m_frequencySetHandler->isValid(request.frequencySetId, setEntry))
return reply.setStr(tr_lts("dds", "FrequencySetData %1 does not belong to FrequencySet %2")).arg(setEntry).arg(request.frequencySetId);
}
}
return reply;
@@ -374,54 +374,54 @@ Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const Modify
*/
Core::FunctionReplyObject FrequencyPlanningHandler::validateModifyRequest(const ModifyFrequencyPlanningRequest &request) const
{
Q_ASSERT(request.id() > 0);
Q_ASSERT(request.id > 0);
Core::FunctionReplyObject reply(request.id());
Core::FunctionReplyObject reply(request.id);
auto found = m_cache.constFind(request.id());
auto found = m_cache.constFind(request.id);
if (found == m_cache.constEnd())
return reply.setStr(tr_lts("dds", "FrequencyPlan %1 does not exist")).arg(request.id());
return reply.setStr(tr_lts("dds", "FrequencyPlan %1 does not exist")).arg(request.id);
const FrequencyPlanning &oldPlan = *found;
if ((oldPlan.exerciseId.is_set() && oldPlan.exerciseId.get() != request.exerciseId())
|| (!oldPlan.exerciseId.is_set() && request.exerciseId() != 0))
if ((oldPlan.exerciseId.is_set() && oldPlan.exerciseId.get() != request.exerciseId)
|| (!oldPlan.exerciseId.is_set() && request.exerciseId != 0))
return reply.setStr(tr_lts("dds", "Exercise may not be changed"));
if (request.frequencySetId() != oldPlan.frequencySetId())
if (request.frequencySetId != oldPlan.frequencySetId)
return reply.setStr(tr_lts("dds", "FrequencySet may not be changed"));
// In case the plan is already active (in an active Exercise), we need to check for conflicts with active FrequencyPlans of other active Exercises.
if (!m_activeExercises->isActive(ExerciseContext(request.exerciseId())))
if (!m_activeExercises->isActive(ExerciseContext(request.exerciseId)))
return reply;
auto foundActivePlan = m_activePlannings.constFind(request.exerciseId());
auto foundActivePlan = m_activePlannings.constFind(request.exerciseId);
if (foundActivePlan == m_activePlannings.constEnd())
return reply;
bool currentlyActive = foundActivePlan->frequencyPlanningId == request.id();
bool currentlyActive = foundActivePlan->frequencyPlanningId == request.id;
if (!currentlyActive)
return reply;
const std::vector<int> activePlans = otherActivePlans(request.exerciseId());
return testActivation(request.data(), activePlans, request.id());
const std::vector<int> activePlans = otherActivePlans(request.exerciseId);
return testActivation(request.data, activePlans, request.id);
}
Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const Core::RemoveElementRequest &request) const
{
Q_ASSERT(request.id() > 0);
Core::FunctionReplyObject reply(request.id());
Q_ASSERT(request.id > 0);
Core::FunctionReplyObject reply(request.id);
auto foundPlan = m_cache.constFind(request.id());
auto foundPlan = m_cache.constFind(request.id);
if (foundPlan == m_cache.constEnd())
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 does not exist")).arg(request.id());
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 does not exist")).arg(request.id);
const FrequencyPlanning &plan = *foundPlan;
int exerciseId = plan.exerciseId.is_set() ? plan.exerciseId.get() : 0;
auto foundActivePlan = m_activePlannings.constFind(exerciseId);
bool isActive = foundActivePlan != m_activePlannings.constEnd() && foundActivePlan->frequencyPlanningId == plan.id();
bool isActive = foundActivePlan != m_activePlannings.constEnd() && foundActivePlan->frequencyPlanningId == plan.id;
if (isActive)
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 cannot be removed because it is active")).arg(request.id());
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 cannot be removed because it is active")).arg(request.id);
return reply;
}
@@ -451,27 +451,27 @@ Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlannin
return reply;
Database::AvmActiveFrequencyPlanning dbData;
dbData.frequencyPlanningId = request.frequencyPlanningId();
if(request.exerciseId() != 0)
dbData.exerciseId = request.exerciseId();
dbData.frequencyPlanningId = request.frequencyPlanningId;
if(request.exerciseId != 0)
dbData.exerciseId = request.exerciseId;
if (!m_activePlannings.contains(request.exerciseId())) // create
if (!m_activePlannings.contains(request.exerciseId)) // create
{
if (!m_db->insert(dbData))
return reply.setStr(tr_lts("dds", "Error inserting ActiveFrequencyPlanning data with id %1 into DB")).arg(request.exerciseId());
return reply.setStr(tr_lts("dds", "Error inserting ActiveFrequencyPlanning data with id %1 into DB")).arg(request.exerciseId);
}
else // modify
{
dbData.id = m_activePlannings.value(request.exerciseId()).id;
dbData.id = m_activePlannings.value(request.exerciseId).id;
if (!m_db->update(dbData))
return reply.setStr(tr_lts("dds", "Error updating ActiveFrequencyPlanning data with id %1 in DB")).arg(request.exerciseId());
return reply.setStr(tr_lts("dds", "Error updating ActiveFrequencyPlanning data with id %1 in DB")).arg(request.exerciseId);
}
int exerciseId = dbData.exerciseId.isNull() ? 0 : dbData.exerciseId.value<int>();
m_activePlannings[exerciseId] = dbData;
if (!m_dts->publish(toDds(dbData)))
return reply.setStr(tr_lts("dds", "Error publishing ActiveFrequencyPlanning data with id %1 to DDS")).arg(request.exerciseId());
return reply.setStr(tr_lts("dds", "Error publishing ActiveFrequencyPlanning data with id %1 to DDS")).arg(request.exerciseId);
emit planningChanged();
@@ -482,22 +482,22 @@ Core::FunctionReplyObject FrequencyPlanningHandler::removeActiveFrequencyPlannin
{
DEBUG_LOG(m_logger) << "RemoveActiveFrequencyPlanningRequest: " << request;
Core::FunctionReplyObject reply(request.exerciseId());
Core::FunctionReplyObject reply(request.exerciseId);
if (!m_activePlannings.contains(request.exerciseId()))
return reply.setStr(tr_lts("dds", "No ActiveFrequencyPlanning for exercise %1")).arg(request.exerciseId());
if (!m_activePlannings.contains(request.exerciseId))
return reply.setStr(tr_lts("dds", "No ActiveFrequencyPlanning for exercise %1")).arg(request.exerciseId);
Database::AvmActiveFrequencyPlanning activePlanning = m_activePlannings.value(request.exerciseId());
if (activePlanning.exerciseId != request.exerciseId())
return reply.setStr(tr_lts("dds", "Error removing ActiveFrequencyPlanning data with exercise id %1 - not found")).arg(request.exerciseId());
Database::AvmActiveFrequencyPlanning activePlanning = m_activePlannings.value(request.exerciseId);
if (activePlanning.exerciseId != request.exerciseId)
return reply.setStr(tr_lts("dds", "Error removing ActiveFrequencyPlanning data with exercise id %1 - not found")).arg(request.exerciseId);
if (!m_dts->removeActiveFrequencyPlanningByKey(request.exerciseId()))
return reply.setStr(tr_lts("dds", "Error removing ActiveFrequencyPlanning data with exercise id %1 from DDS")).arg(request.exerciseId());
if (!m_dts->removeActiveFrequencyPlanningByKey(request.exerciseId))
return reply.setStr(tr_lts("dds", "Error removing ActiveFrequencyPlanning data with exercise id %1 from DDS")).arg(request.exerciseId);
if (!m_db->removeAvmActiveFrequencyPlanning(activePlanning.id))
return reply.setStr(tr_lts("dds", "Error removing ActiveFrequencyPlanning data with exercise id %1 from DB")).arg(request.exerciseId());
return reply.setStr(tr_lts("dds", "Error removing ActiveFrequencyPlanning data with exercise id %1 from DB")).arg(request.exerciseId);
m_activePlannings.remove(request.exerciseId());
m_activePlannings.remove(request.exerciseId);
emit planningChanged();
@@ -509,25 +509,25 @@ Core::FunctionReplyObject FrequencyPlanningHandler::removeActiveFrequencyPlannin
*/
Core::FunctionReplyObject FrequencyPlanningHandler::validateRequest(const ModifyActiveFrequencyPlanningRequest &request) const
{
Core::FunctionReplyObject reply(request.exerciseId());
Core::FunctionReplyObject reply(request.exerciseId);
auto foundPlan = m_cache.constFind(request.frequencyPlanningId());
auto foundPlan = m_cache.constFind(request.frequencyPlanningId);
if (foundPlan == m_cache.constEnd())
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 does not exist")).arg(request.frequencyPlanningId());
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 does not exist")).arg(request.frequencyPlanningId);
if (!m_activeExercises->isActive(ExerciseContext(request.exerciseId())))
if (!m_activeExercises->isActive(ExerciseContext(request.exerciseId)))
return reply;
const FrequencyPlanning &planToActivate = *foundPlan;
const std::vector<int> activePlans = otherActivePlans(request.exerciseId());
const std::vector<int> activePlans = otherActivePlans(request.exerciseId);
if (activePlans.empty())
return reply;
if (!hasSameFrequencySet(planToActivate, *m_cache.constFind(activePlans.front())))
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 cannot be activated because another FrequencyPlanning with a different FrequencySet is active already")).arg(request.frequencyPlanningId());
return reply.setStr(tr_lts("dds", "FrequencyPlanning %1 cannot be activated because another FrequencyPlanning with a different FrequencySet is active already")).arg(request.frequencyPlanningId);
return testActivation(planToActivate.data(), activePlans, request.exerciseId());
return testActivation(planToActivate.data, activePlans, request.exerciseId);
}
Core::FunctionReplyObject FrequencyPlanningHandler::testActivation(const std::vector<FrequencyPlanningData> &entries, const std::vector<int> &activePlans, int requestId) const
@@ -541,27 +541,27 @@ Core::FunctionReplyObject FrequencyPlanningHandler::testActivation(const std::ve
const std::vector<int> takenCnrConfigs = takenGlobalCnrConfigs(activePlans);
for (const FrequencyPlanningData &entry : entries)
{
const CnrConfig &cnrConfig = m_cnrHandler->config(entry.cnrConfigId());
const CnrConfig &cnrConfig = m_cnrHandler->config(entry.cnrConfigId);
bool isGlobal = !cnrConfig.exerciseId.is_set();
if (!isGlobal)
continue;
auto found = std::find(takenCnrConfigs.begin(), takenCnrConfigs.end(), cnrConfig.id());
auto found = std::find(takenCnrConfigs.begin(), takenCnrConfigs.end(), cnrConfig.id);
if (found != takenCnrConfigs.end())
return reply.setStr(tr_lts("dds", "FrequencyPlanning cannot be activated because CnrConfig \"%1\" is used by some other active FrequencyPlanning")).arg(cnrConfig.radioCircuit());
return reply.setStr(tr_lts("dds", "FrequencyPlanning cannot be activated because CnrConfig \"%1\" is used by some other active FrequencyPlanning")).arg(cnrConfig.radioCircuit);
}
// Check that the FrequencyPlanning does not reference an entry from the FrequencySet wich is already referenced by some other active FrequencyPlanning.
QSet<int> takenSetEntries = takenFrequencySetEntries(activePlans);
for (const FrequencyPlanningData &fpdEntry : entries)
{
QSet<int> frequencySetEntries = AudioVideoManagement::frequencySetDataIds(fpdEntry.properties());
QSet<int> frequencySetEntries = AudioVideoManagement::frequencySetDataIds(fpdEntry.properties);
for(const int &setEntry : qAsConst(frequencySetEntries))
{
if(takenSetEntries.contains(setEntry))
{
const CnrConfig &cnrConfig = m_cnrHandler->config(fpdEntry.cnrConfigId());
return reply.setStr(tr_lts("dds", "FrequencyPlanning cannot be activated because CnrConfig \"%1\" uses an entry in the FrequencySet which is used by some other active FrequencyPlanning")).arg(cnrConfig.radioCircuit());
const CnrConfig &cnrConfig = m_cnrHandler->config(fpdEntry.cnrConfigId);
return reply.setStr(tr_lts("dds", "FrequencyPlanning cannot be activated because CnrConfig \"%1\" uses an entry in the FrequencySet which is used by some other active FrequencyPlanning")).arg(cnrConfig.radioCircuit);
}
}
}
@@ -614,14 +614,14 @@ std::vector<int> FrequencyPlanningHandler::takenGlobalCnrConfigs(const std::vect
for (auto planId : plans)
{
const FrequencyPlanning &plan = m_cache.value(planId);
Q_ASSERT(plan.id() == planId);
Q_ASSERT(plan.id == planId);
for (const FrequencyPlanningData &entry : plan.data())
for (const FrequencyPlanningData &entry : plan.data)
{
const CnrConfig &cnrConfig = m_cnrHandler->config(entry.cnrConfigId());
const CnrConfig &cnrConfig = m_cnrHandler->config(entry.cnrConfigId);
bool isGlobal = !cnrConfig.exerciseId.is_set();
if (isGlobal)
result.push_back(cnrConfig.id());
result.push_back(cnrConfig.id);
}
}
@@ -638,11 +638,11 @@ QSet<int> FrequencyPlanningHandler::takenFrequencySetEntries(const std::vector<i
for (auto planId : plans)
{
const FrequencyPlanning &plan = m_cache.value(planId);
Q_ASSERT(plan.id() == planId);
Q_ASSERT(plan.id == planId);
for (const FrequencyPlanningData &entry : plan.data())
for (const FrequencyPlanningData &entry : plan.data)
{
result += AudioVideoManagement::frequencySetDataIds(entry.properties());
result += AudioVideoManagement::frequencySetDataIds(entry.properties);
}
}
@@ -651,7 +651,7 @@ QSet<int> FrequencyPlanningHandler::takenFrequencySetEntries(const std::vector<i
bool FrequencyPlanningHandler::hasSameFrequencySet(const FrequencyPlanning &plan1, const FrequencyPlanning &plan2) const
{
return plan1.frequencySetId() == plan2.frequencySetId();
return plan1.frequencySetId == plan2.frequencySetId;
}
bool FrequencyPlanningHandler::collectAndPublish(const Database::AvmFrequencyPlanning &planDb, bool isReload)
@@ -684,29 +684,29 @@ bool FrequencyPlanningHandler::collectAndPublish(const Database::AvmFrequencyPla
void FrequencyPlanningHandler::addPlan(const FrequencyPlanning &plan)
{
Q_ASSERT(plan.id() > 0);
Q_ASSERT(!m_cache.contains(plan.id()));
Q_ASSERT(plan.id > 0);
Q_ASSERT(!m_cache.contains(plan.id));
m_cache.insert(plan.id(), plan);
m_cache.insert(plan.id, plan);
bool status = m_dts->publish(plan);
if (!status)
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id());
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id);
emit planningChanged();
}
void FrequencyPlanningHandler::updatePlan(const FrequencyPlanning &plan)
{
Q_ASSERT(plan.id() > 0);
auto found = m_cache.find(plan.id());
Q_ASSERT(plan.id > 0);
auto found = m_cache.find(plan.id);
Q_ASSERT(found != m_cache.end());
*found = plan;
bool status = m_dts->publish(plan);
if (!status)
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id());
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id);
emit planningChanged();
}
@@ -762,22 +762,22 @@ void FrequencyPlanningHandler::onCnrConfigRemoved(int cnrConfigId)
for (FrequencyPlanning &fp : m_cache)
{
ModifyFrequencyPlanningRequest req;
req.data() = fp.data();
auto found = std::find_if(req.data().begin(), req.data().end(), [cnrConfigId](const FrequencyPlanningData &data)
req.data = fp.data;
auto found = std::find_if(req.data.begin(), req.data.end(), [cnrConfigId](const FrequencyPlanningData &data)
{
return data.cnrConfigId() == cnrConfigId;
return data.cnrConfigId == cnrConfigId;
});
if (found == req.data().end())
if (found == req.data.end())
continue;
// In this Frequency Planning, the (removed) cnrConfig ID is present. Therefore, we need to delete it also:
req.data().erase(found);
req.data.erase(found);
req.date() = fp.date();
req.exerciseId() = fp.exerciseId.is_set() ? fp.exerciseId.get() : 0;
req.frequencySetId() = fp.frequencySetId();
req.id() = fp.id();
req.name() = fp.name();
req.date = fp.date;
req.exerciseId = fp.exerciseId.is_set() ? fp.exerciseId.get() : 0;
req.frequencySetId = fp.frequencySetId;
req.id = fp.id;
req.name = fp.name;
handleModify(req);
}
}
@@ -56,17 +56,17 @@ FrequencySet FrequencySetHandler::toDdsFrequencySet(const Database::AvmFrequency
{
FrequencySet result;
result.id(dbData.id);
result.name(dbData.name.toStdString());
result.lastChange(dbData.lastChange);
result.id = dbData.id;
result.name = dbData.name.toStdString();
result.lastChange = dbData.lastChange;
auto cb = [&result] (const Database::AvmFrequencySetData &currentData)
{
result.data().push_back(toDdsFrequencySetDataWithId(currentData));
result.data.push_back(toDdsFrequencySetDataWithId(currentData));
};
m_db->selectByFrequencySetId(cb, result.id());
m_db->selectByFrequencySetId(cb, result.id);
DEBUG_LOG(m_logger) << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries";
DEBUG_LOG(m_logger) << "Frequency Set with ID " << dbData.id << " has " << result.data.size() << " data entries";
return result;
}
@@ -75,37 +75,37 @@ FrequencyBand FrequencySetHandler::getFrequencyBand(const QString &deviceString)
{
QString intermediate = deviceString.left(3);
if (QString::compare(intermediate, QStringLiteral("VHF"), Qt::CaseInsensitive) == 0)
return FrequencyBand_def::VHF;
return FrequencyBand::VHF;
else if (QString::compare(intermediate, QStringLiteral("UHF"), Qt::CaseInsensitive) == 0)
return FrequencyBand_def::UHF;
return FrequencyBand::UHF;
else if (QString::compare(intermediate, QStringLiteral("HF"), Qt::CaseInsensitive) == 0)
return FrequencyBand_def::HF;
return FrequencyBand::HF;
else //if (QString::compare(intermediate.left(1), QStringLiteral("R"), Qt::CaseInsensitive) == 0)
return FrequencyBand_def::REL;
return FrequencyBand::REL;
}
FrequencySetDataWithId FrequencySetHandler::toDdsFrequencySetDataWithId(const Database::AvmFrequencySetData &dbData)
{
FrequencySetDataWithId result;
result.id(dbData.id);
result.function(dbData.function.toStdString());
result.frequency(dbData.frequency);
result.id = dbData.id;
result.function = dbData.function.toStdString();
result.frequency = dbData.frequency;
// Todo: Put this into the database as well...
result.frequencyBand(getFrequencyBand(dbData.device));
result.frequencyBand = getFrequencyBand(dbData.device);
if (dbData.akwBundle >= 0)
result.akwBundle().set(dbData.akwBundle);
result.akwBundle = dbData.akwBundle;
if (dbData.fsbBundle >= 0)
result.fsbBundle().set(dbData.fsbBundle);
result.fsbBundle = dbData.fsbBundle;
if (dbData.akwRadioCircuit >= 0)
result.akwRadioCircuit().set(dbData.akwRadioCircuit);
result.akwRadioCircuit = dbData.akwRadioCircuit;
if (dbData.comsec >= 0)
result.comsec().set(dbData.comsec);
result.comsec = dbData.comsec;
return result;
}
@@ -114,15 +114,15 @@ void FrequencySetHandler::addFrequencySet(const FrequencySet &frequencySet)
{
QVector<int32_t> dataIds;
dataIds.reserve(frequencySet.data().size());
dataIds.reserve(frequencySet.data.size());
for (const FrequencySetDataWithId &currentData : frequencySet.data())
dataIds << currentData.id();
for (const FrequencySetDataWithId &currentData : frequencySet.data)
dataIds << currentData.id;
m_frequencySetDatas.insert(frequencySet.id(), dataIds);
m_frequencySetDatas.insert(frequencySet.id, dataIds);
if (!m_dts->publish(frequencySet))
ERROR_LOG(m_logger) << "Error while publishing Frequency Set with id " << frequencySet.id();
ERROR_LOG(m_logger) << "Error while publishing Frequency Set with id " << frequencySet.id;
}
} // namespace AudioVideoManagement
@@ -18,31 +18,31 @@ namespace AudioVideoManagement
//--------------------------------------------------------------------------------------------------
static FrequencyPlanningStatus convert(const ModifyFrequencyPlanningStatusRequest &request, const FrequencyPlanningStatus &oldData)
{
Q_ASSERT(request.client() == oldData.client());
Q_ASSERT(request.client == oldData.client);
FrequencyPlanningStatus newData(oldData);
if (!oldData.uuid().empty())
if (!oldData.uuid.empty())
{
if (oldData.uuid() != request.uuid())
if (oldData.uuid != request.uuid)
WARNING_LOG(getLogger("HandlerFrequencyPlanningStatus")) << "WARNING: Same client has concurrent GetConfigCNR requests.";
}
newData.uuid() = request.uuid().empty() ? oldData.uuid() : request.uuid();
newData.id() = oldData.id();
newData.uuid = request.uuid.empty() ? oldData.uuid : request.uuid;
newData.id = oldData.id;
if (request.sent.is_set())
{
newData.sent() = request.sent.get();
newData.requester() = request.requester(); // ! Requester is only sent, when data gets sent.
newData.sent = request.sent.get();
newData.requester = request.requester; // ! Requester is only sent, when data gets sent.
}
if (request.received.is_set())
newData.received() = request.received.get();
newData.received = request.received.get();
if (request.activated.is_set())
{
newData.activated() = request.activated.get();
newData.requester() = request.requester(); // ! Requester is only sent, when data gets activated.
newData.activated = request.activated.get();
newData.requester = request.requester; // ! Requester is only sent, when data gets activated.
}
newData.isActive() = request.isActive();
newData.content() = request.content();
newData.reason() = request.reason();
newData.isActive = request.isActive;
newData.content = request.content;
newData.reason = request.reason;
return newData;
}
@@ -92,7 +92,7 @@ bool HandlerFrequencyPlanningStatus::init()
ERROR_LOG(m_logger) << ret();
return false;
}
m_data.insert(ifs->getData().client(), ifs);
m_data.insert(ifs->getData().client, ifs);
}
return true;
}
@@ -102,7 +102,7 @@ void HandlerFrequencyPlanningStatus::onModifyFrequencyPlanningStatusRequest(cons
const ModifyFrequencyPlanningStatusRequest &request)
{
DEBUG_LOG(m_logger) << "onModifyFrequencyPlanningStatusRequest: " << request;
auto ret = m_data.contains(request.client()) ? frequencyPlanningStatusModifyRequest(request) : frequencyPlanningStatusCreateRequest(request);
auto ret = m_data.contains(request.client) ? frequencyPlanningStatusModifyRequest(request) : frequencyPlanningStatusCreateRequest(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->modifyFrequencyPlanningStatusReply(cookie, ret);
@@ -127,9 +127,9 @@ void HandlerFrequencyPlanningStatus::onRemoveFrequencyPlanningStatusByClientRequ
QVector<int> clients;
for (ObjectFrequencyPlanningStatus *ifs : qAsConst(m_data))
{
if (request.client() == 0 || ifs->getData().client() == request.client())
if (request.client == 0 || ifs->getData().client == request.client)
{
int client = ifs->getData().client();
int client = ifs->getData().client;
ret = ifs->removeObject();
if (ret.error())
ERROR_LOG(m_logger) << ret();
@@ -150,9 +150,9 @@ void HandlerFrequencyPlanningStatus::onRemoveFrequencyPlanningStatusByClientRequ
//--------------------------------------------------------------------------------------------------
Core::FunctionReplyObject HandlerFrequencyPlanningStatus::frequencyPlanningStatusModifyRequest(const ModifyFrequencyPlanningStatusRequest &request)
{
ObjectFrequencyPlanningStatus *ifs = m_data.value(request.client());
ObjectFrequencyPlanningStatus *ifs = m_data.value(request.client);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Team with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Team with id %1 not found")).arg(request.id);
FrequencyPlanningStatus ddsData = convert(request, ifs->getData());
@@ -170,7 +170,7 @@ Core::FunctionReplyObject HandlerFrequencyPlanningStatus::frequencyPlanningStatu
if (ret.error())
delete ifs;
else
m_data.insert(ifs->getData().client(), ifs);
m_data.insert(ifs->getData().client, ifs);
return ret;
}
@@ -25,9 +25,9 @@ AudioVideoManagement::MenuStruct toDdsToplevel(const AudioVideoManagement::Datab
Q_ASSERT(dbEntry.name.isValid());
AudioVideoManagement::MenuStruct ms;
ms.id(dbEntry.id);
ms.name(dbEntry.name.toString().toStdString());
ms.isAudio(dbEntry.isAudio);
ms.id = dbEntry.id;
ms.name = dbEntry.name.toString().toStdString();
ms.isAudio = dbEntry.isAudio;
return ms;
}
@@ -46,13 +46,13 @@ void insertChildren(std::vector<AudioVideoManagement::AvMenuEntry>& contToAdd,
bool lessToplevel(const AudioVideoManagement::AvMenuEntry &a,
const AudioVideoManagement::AvMenuEntry &b)
{
return a.id() < b.id();
return a.id < b.id;
}
bool lessSublevel(const AudioVideoManagement::AvMenuEntry &a,
const AudioVideoManagement::AvMenuEntry &b)
{
return std::make_tuple(a.parentId(), a.rowId(), a.id()) < std::make_tuple(b.parentId(), b.rowId(), b.id());
return std::make_tuple(a.parentId, a.rowId, a.id) < std::make_tuple(b.parentId, b.rowId, b.id);
}
} // anonymous namespace
@@ -67,14 +67,14 @@ AvMenuEntry HandlerMenuStruct::toDds(const Database::AvmMenuStruct &dbEntry)
AvMenuEntry ddsItem;
ddsItem.id(dbEntry.id);
ddsItem.parentId(dbEntry.parentId);
ddsItem.isGroup(dbEntry.isGroup);
ddsItem.rowId(dbEntry.rowid);
ddsItem.id = dbEntry.id;
ddsItem.parentId = dbEntry.parentId;
ddsItem.isGroup = dbEntry.isGroup;
ddsItem.rowId = dbEntry.rowid;
if (dbEntry.isGroup)
{
Q_ASSERT(dbEntry.name.isValid());
ddsItem.name().set(dbEntry.name.toString().toStdString());
ddsItem.name = dbEntry.name.toString().toStdString();
}
else
{
@@ -84,8 +84,8 @@ AvMenuEntry HandlerMenuStruct::toDds(const Database::AvmMenuStruct &dbEntry)
// Using the internal stream name here makes it easy for clients to directly
// use those when communicating with AVS.
Q_ASSERT(dbEntry.mountingPointId.isValid());
ddsItem.mountingPointId(dbEntry.mountingPointId.toInt());
ddsItem.name().set(AudioVideoHandlerImpl::internalStreamName(dbEntry.mountingPointId.toInt()).toStdString());
ddsItem.mountingPointId = dbEntry.mountingPointId.toInt();
ddsItem.name = AudioVideoHandlerImpl::internalStreamName(dbEntry.mountingPointId.toInt()).toStdString();
}
return ddsItem;
@@ -93,11 +93,11 @@ AvMenuEntry HandlerMenuStruct::toDds(const Database::AvmMenuStruct &dbEntry)
void HandlerMenuStruct::sortEntries(MenuStruct &menu)
{
auto isToplevel = [&menu] (const AvMenuEntry& entry) { return entry.parentId() == menu.id(); };
auto sublevelStart = std::partition(menu.menuEntries().begin(), menu.menuEntries().end(), isToplevel);
auto isToplevel = [&menu] (const AvMenuEntry& entry) { return entry.parentId == menu.id; };
auto sublevelStart = std::partition(menu.menuEntries.begin(), menu.menuEntries.end(), isToplevel);
std::sort(menu.menuEntries().begin(), sublevelStart, lessToplevel);
std::sort(sublevelStart, menu.menuEntries().end(), lessSublevel);
std::sort(menu.menuEntries.begin(), sublevelStart, lessToplevel);
std::sort(sublevelStart, menu.menuEntries.end(), lessSublevel);
}
HandlerMenuStruct::HandlerMenuStruct(Interface::Dts *dts, Interface::Fts *fts, DatabaseInterface *db)
@@ -163,7 +163,7 @@ void HandlerMenuStruct::reload()
for (const auto &ms : dbItems)
{
auto found = m_objMap.find(ms.id());
auto found = m_objMap.find(ms.id);
Q_ASSERT(found != m_objMap.end());
(*found)->updateFromDb(ms);
}
@@ -184,7 +184,7 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
for (auto dbEntry = vecMenuStruct.begin(); dbEntry != sublevelStart; ++dbEntry)
{
MenuStruct ms = toDdsToplevel(*dbEntry);
msMap.insert(ms.id(), ms);
msMap.insert(ms.id, ms);
}
// Go over all non-toplevel entries and create AvMenuEntries for those
@@ -198,9 +198,9 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
MenuStruct &parent = it.value();
AudioVideoManagement::AvMenuEntry me = toDds(*dbEntry);
parent.menuEntries().push_back(me);
parent.menuEntries.push_back(me);
insertChildren(parent.menuEntries(), me.id(), vecMenuStruct);
insertChildren(parent.menuEntries, me.id, vecMenuStruct);
}
@@ -211,7 +211,7 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
for (auto &ms : msMap)
{
sortEntries(ms);
totalCount += ms.menuEntries().size();
totalCount += ms.menuEntries.size();
}
Q_ASSERT(totalCount == vecMenuStruct.size());
@@ -224,7 +224,7 @@ void HandlerMenuStruct::onModifyMenuStructRequest(const rti::core::SampleIdentit
const MenuStruct &request)
{
DEBUG_LOG(m_logger) << "onModifyMenuStructRequest: " << request;
auto ret = request.id() > 0 ? modifyMenuStructRequest(request) : createMenuStructRequest(request);
auto ret = request.id > 0 ? modifyMenuStructRequest(request) : createMenuStructRequest(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->modifyMenuStructReply(cookie, ret);
@@ -234,7 +234,7 @@ Core::FunctionReplyObject HandlerMenuStruct::createMenuStructRequest(const MenuS
{
ObjectMenuStruct *ifs = new ObjectMenuStruct(m_dts, m_db);
DEBUG_LOG(m_logger) << "request.menuEntries.size() : " << request.menuEntries().size();
DEBUG_LOG(m_logger) << "request.menuEntries.size() : " << request.menuEntries.size();
Core::FunctionReplyObject ret = ifs->createFromDds(request);
if (ret.error())
@@ -247,15 +247,15 @@ Core::FunctionReplyObject HandlerMenuStruct::createMenuStructRequest(const MenuS
Core::FunctionReplyObject HandlerMenuStruct::modifyMenuStructRequest(const MenuStruct &request)
{
ObjectMenuStruct *ifs = m_objMap.value(request.id());
ObjectMenuStruct *ifs = m_objMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id);
auto ret = ifs->updateFromDds(request);
if (ret.error())
return ret;
Q_ASSERT(ifs->getId() == request.id());
Q_ASSERT(ifs->getId() == request.id);
return ret;
}
@@ -264,12 +264,12 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit
{
Core::FunctionReplyObject ret;
INFO_LOG(m_logger) << "onRemoveMenuStructRequest id = " << request.id();
INFO_LOG(m_logger) << "onRemoveMenuStructRequest id = " << request.id;
ObjectMenuStruct *ifs = m_objMap.value(request.id());
ObjectMenuStruct *ifs = m_objMap.value(request.id);
if (ifs == nullptr)
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id());
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "MenuStruct with id %1 not found")).arg(request.id);
}
else
{
@@ -277,7 +277,7 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit
if (!ret.error())
{
m_objMap.remove(request.id());
m_objMap.remove(request.id);
delete ifs;
}
}
@@ -100,7 +100,7 @@ void HandlerVideoReceiver::onVideoReceiverModifyRequest(const rti::core::SampleI
const VideoReceiverModifyRequest &request)
{
DEBUG_LOG(m_logger) << "onVideoReceiverModifyRequest: " << request;
auto ret = request.id() > 0 ? videoReceiverModifyRequest(request) : videoReceiverCreateRequest(request);
auto ret = request.id > 0 ? videoReceiverModifyRequest(request) : videoReceiverCreateRequest(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->videoReceiverModifyReply(cookie, ret);
@@ -116,7 +116,7 @@ void HandlerVideoReceiver::onVideoReceiverModifyActiveRequest(const rti::core::S
WARNING_LOG(m_logger) << ret();
else
// activate channel here
activateChannel(request.id(), request.isActive());
activateChannel(request.id, request.isActive);
m_fts->videoReceiverModifyActiveReply(cookie, ret);
}
@@ -134,17 +134,17 @@ void HandlerVideoReceiver::onVideoReceiverModifyAvsRequest(const rti::core::Samp
VideoReceiver HandlerVideoReceiver::convert(const VideoReceiverModifyRequest &request)
{
VideoReceiver newData;
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs)
newData = ifs->getData();
newData.id(request.id());
newData.mainStructureElementId(request.mainStructureElementId());
newData.teamId(request.teamId());
newData.streamName(request.streamName());
newData.info(request.info());
newData.hostName(request.hostName());
newData.frequency(request.frequency());
newData.isLocked(request.isLocked());
newData.id = request.id;
newData.mainStructureElementId = request.mainStructureElementId;
newData.teamId = request.teamId;
newData.streamName = request.streamName;
newData.info = request.info;
newData.hostName = request.hostName;
newData.frequency = request.frequency;
newData.isLocked = request.isLocked;
return newData;
}
@@ -152,12 +152,12 @@ VideoReceiver HandlerVideoReceiver::convert(const VideoReceiverModifyRequest &re
VideoReceiver HandlerVideoReceiver::convertAvs(const VideoReceiverModifyAvsRequest &request)
{
VideoReceiver newData;
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs)
newData = ifs->getData();
newData.id(request.id());
newData.dbm(request.dbm());
newData.snr(request.snr());
newData.id = request.id;
newData.dbm = request.dbm;
newData.snr = request.snr;
return newData;
}
@@ -165,11 +165,11 @@ VideoReceiver HandlerVideoReceiver::convertAvs(const VideoReceiverModifyAvsReque
VideoReceiver HandlerVideoReceiver::convertActive(const VideoReceiverModifyActiveRequest &request)
{
VideoReceiver newData;
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs)
newData = ifs->getData();
newData.id(request.id());
newData.isActive(request.isActive());
newData.id = request.id;
newData.isActive = request.isActive;
return newData;
}
@@ -177,9 +177,9 @@ VideoReceiver HandlerVideoReceiver::convertActive(const VideoReceiverModifyActiv
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyRequest(const VideoReceiverModifyRequest &request)
{
DEBUG_LOG(m_logger) << "videoReceiverModifyRequest";
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
return ifs->updateObject(convert(request));
}
@@ -187,9 +187,9 @@ Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyRequest(const
//--------------------------------------------------------------------------------------------------
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyActiveRequest(const VideoReceiverModifyActiveRequest &request)
{
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
return ifs->updateObject(convertActive(request));
}
@@ -197,9 +197,9 @@ Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyActiveRequest
//--------------------------------------------------------------------------------------------------
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyAvsRequest(const VideoReceiverModifyAvsRequest &request)
{
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
return ifs->updateObject(convertAvs(request));
}
@@ -223,18 +223,18 @@ void HandlerVideoReceiver::onVideoReceiverRemoveRequest(const rti::core::SampleI
const Core::RemoveElementRequest &request)
{
Core::FunctionReplyObject ret;
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id);
if (ifs == nullptr)
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id);
m_fts->videoReceiverRemoveReply(cookie, ret);
return;
}
if (m_mainHandler->ddsHandler()->topicLockMaster()->isLocked(ifs->getData(), m_mainHandler->exerciseId()))
{
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver '%1' is used by another user!")).arg(ifs->getId());
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Receiver '%1' is used by another user!")).arg(ifs->getId());
m_fts->videoReceiverRemoveReply(cookie, ret);
return;
}
@@ -247,7 +247,7 @@ void HandlerVideoReceiver::onVideoReceiverRemoveRequest(const rti::core::SampleI
{
// delete ObjectVideoReceiver
delete ifs;
m_videoReceiverObjMap.remove(request.id());
m_videoReceiverObjMap.remove(request.id);
}
m_fts->videoReceiverRemoveReply(cookie, ret);
@@ -266,16 +266,16 @@ void HandlerVideoReceiver::onGetStatus()
{
i.next();
ObjectVideoReceiver *objectVideoReceiver = i.value();
QString host = QString::fromStdString(objectVideoReceiver->getData().hostName()).toLower();
QString host = QString::fromStdString(objectVideoReceiver->getData().hostName).toLower();
DEBUG_LOG(m_logger) << " streamName=" << objectVideoReceiver->getData().streamName()
DEBUG_LOG(m_logger) << " streamName=" << objectVideoReceiver->getData().streamName
<< " hostName=" << host
<< " teamId=" << objectVideoReceiver->getData().teamId();
if ((objectVideoReceiver->getData().teamId() == 1)
<< " teamId=" << objectVideoReceiver->getData().teamId;
if ((objectVideoReceiver->getData().teamId == 1)
&& (!m_receiver.contains(host)))
{
DEBUG_LOG(m_logger) << " onSendHttpRequest host=" << host << " key=" << i.key()
<< " id=" << objectVideoReceiver->getData().id();
<< " id=" << objectVideoReceiver->getData().id;
m_receiver.insert(host, i.key());
onSendHttpRequest(i.key());
}
@@ -289,7 +289,7 @@ void HandlerVideoReceiver::onSendHttpRequest(const int key)
//request = QStringLiteral("http://localhost/set_param?remuxBitrate=90.0");
//request = QStringLiteral("http://localhost/status.json");
ObjectVideoReceiver *objectVideoReceiver = m_videoReceiverObjMap.value(key);
QString hostname = QString::fromStdString(objectVideoReceiver->getData().hostName());
QString hostname = QString::fromStdString(objectVideoReceiver->getData().hostName);
const QString request = QStringLiteral("http://%1/status.json").arg(hostname);
startRequest(QUrl(request));
@@ -547,13 +547,13 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
ObjectVideoReceiver *objectVideoReceiver = i.value();
DEBUG_LOG(m_logger) << "key=" << i.key()
<< " : value.Id=" << objectVideoReceiver->getId()
<< " mse=" << objectVideoReceiver->getData().mainStructureElementId()
<< " streamName=" << objectVideoReceiver->getData().streamName()
<< " hostName=" << objectVideoReceiver->getData().hostName()
<< " teamId=" << objectVideoReceiver->getData().teamId()
<< " snr=" << objectVideoReceiver->getData().snr()
<< " dbm=" << objectVideoReceiver->getData().dbm()
<< " isActive=" << objectVideoReceiver->getData().isActive();
<< " mse=" << objectVideoReceiver->getData().mainStructureElementId
<< " streamName=" << objectVideoReceiver->getData().streamName
<< " hostName=" << objectVideoReceiver->getData().hostName
<< " teamId=" << objectVideoReceiver->getData().teamId
<< " snr=" << objectVideoReceiver->getData().snr
<< " dbm=" << objectVideoReceiver->getData().dbm
<< " isActive=" << objectVideoReceiver->getData().isActive;
}
reply->deleteLater();
checkActiveState(key, remuxInputMask);
@@ -566,17 +566,17 @@ void HandlerVideoReceiver::updateObject(const int key, const double powerLevel,
if (ifs)
{
newData = ifs->getData();
newData.id(ifs->getId());
newData.mainStructureElementId(ifs->getData().mainStructureElementId());
newData.teamId(ifs->getData().teamId());
newData.streamName(ifs->getData().streamName());
newData.hostName(ifs->getData().hostName());
newData.info(ifs->getData().info());
newData.dbm(powerLevel);
newData.snr(snr);
newData.isActive(ifs->getData().isActive());
newData.isLocked(lockstatus);
newData.frequency(frequency);
newData.id = ifs->getId();
newData.mainStructureElementId = ifs->getData().mainStructureElementId;
newData.teamId = ifs->getData().teamId;
newData.streamName = ifs->getData().streamName;
newData.hostName = ifs->getData().hostName;
newData.info = ifs->getData().info;
newData.dbm = powerLevel;
newData.snr = snr;
newData.isActive = ifs->getData().isActive;
newData.isLocked = lockstatus;
newData.frequency = frequency;
ifs->updateObject(newData);
}
}
@@ -584,7 +584,7 @@ void HandlerVideoReceiver::updateObject(const int key, const double powerLevel,
void HandlerVideoReceiver::activateChannel(const int channelId, const bool activate)
{
// send new Host HTTP-Request to VideoReceiver
QString hostName = QString::fromStdString(m_videoReceiverObjMap.value(channelId)->getData().hostName());
QString hostName = QString::fromStdString(m_videoReceiverObjMap.value(channelId)->getData().hostName);
int active1 = 0;
int active2 = 0;
int active = 0;
@@ -592,7 +592,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
DEBUG_LOG(m_logger) << "activateChannel channelId=" << channelId
<< " activate = " << activate
<< " hostname = " << hostName
<< " teamId = " << m_videoReceiverObjMap.value(channelId)->getData().teamId();
<< " teamId = " << m_videoReceiverObjMap.value(channelId)->getData().teamId;
// make sure there are 2 channels
@@ -602,7 +602,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
return;
}
if (m_videoReceiverObjMap.value(channelId)->getData().teamId() == 1)
if (m_videoReceiverObjMap.value(channelId)->getData().teamId == 1)
{
id = channelId;
active1 = activate;
@@ -611,14 +611,14 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
ERROR_LOG(m_logger) << "channelId " << id + 1 << " does not exist";
return;
}
active2 = m_videoReceiverObjMap.value(id + 1)->getData().isActive();
active2 = m_videoReceiverObjMap.value(id + 1)->getData().isActive;
}
else
{
id = channelId - 1;
if (!m_videoReceiverObjMap.contains(id))
return;
active1 = m_videoReceiverObjMap.value(id)->getData().isActive();
active1 = m_videoReceiverObjMap.value(id)->getData().isActive;
active2 = activate;
}
active = active1 + active2 * 2;
@@ -646,10 +646,10 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM
<< " remuxInputMask=" << remuxInputMask << " channel1 == nullptr";
return;
}
int channel1Active = channel1->getData().isActive();
QString host = QString::fromStdString(channel1->getData().hostName()).toLower();
int channel1Active = channel1->getData().isActive;
QString host = QString::fromStdString(channel1->getData().hostName).toLower();
ObjectVideoReceiver *channel2 = m_videoReceiverObjMap.value(key + 1);
int channel2Active = channel2->getData().isActive();
int channel2Active = channel2->getData().isActive;
int active = channel1Active + channel2Active * 2;
DEBUG_LOG(m_logger) << "checkActiveState "
<< " key=" << key
@@ -31,36 +31,36 @@ public:
void create(const VideoTeam &videoTeam)
{
Q_ASSERT(!m_cache.contains(videoTeam.id()));
Q_ASSERT(!m_cache.contains(videoTeam.id));
Database::AvmDeviceConfig deviceConfig = toDeviceConfig(videoTeam);
if (!m_db->insert(deviceConfig))
ERROR_LOG(m_logger) << "Error while inserting device config into database";
m_cache.insert(videoTeam.id(), deviceConfig);
m_cache.insert(videoTeam.id, deviceConfig);
emit m_handler->avDbReloadNeeded();
}
void update(const VideoTeam &videoTeam)
{
Q_ASSERT(m_cache.contains(videoTeam.id()));
Q_ASSERT(m_cache.contains(videoTeam.id));
Database::AvmDeviceConfig deviceConfig = toDeviceConfig(videoTeam);
const Database::AvmDeviceConfig &oldDeviceConfig = m_cache[videoTeam.id()];
const Database::AvmDeviceConfig &oldDeviceConfig = m_cache[videoTeam.id];
deviceConfig.id = oldDeviceConfig.id;
if (!m_db->update(deviceConfig))
ERROR_LOG(m_logger) << "Error while updating device config";
m_cache[videoTeam.id()] = deviceConfig;
m_cache[videoTeam.id] = deviceConfig;
emit m_handler->avDbReloadNeeded();
}
void createOrUpdate(const VideoTeam &videoTeam)
{
if (m_cache.contains(videoTeam.id()))
if (m_cache.contains(videoTeam.id))
update(videoTeam);
else
create(videoTeam);
@@ -88,12 +88,12 @@ private:
static Database::AvmDeviceConfig toDeviceConfig(const VideoTeam &videoTeam)
{
Database::AvmDeviceConfig result;
result.context = ExerciseContext(videoTeam.exerciseId()).toString();
result.context = ExerciseContext(videoTeam.exerciseId).toString();
result.type = QStringLiteral("DEKTEC_VIDEO_CHANNEL");
result.name = QString::fromStdString(videoTeam.streamName());
result.name = QString::fromStdString(videoTeam.streamName);
result.controller = QStringLiteral("EXCAVS01");
result.definition = QStringLiteral("mode=1;ssrc=%1;port=%2;programid=%3;programtimeoffset=%4;recording=ECRS@%5")
.arg(videoTeam.ssrc()).arg(videoTeam.vtPort()).arg(videoTeam.programId()).arg(videoTeam.timeOffset()).arg(result.controller);
.arg(videoTeam.ssrc).arg(videoTeam.vtPort).arg(videoTeam.programId).arg(videoTeam.timeOffset).arg(result.controller);
return result;
}
@@ -178,7 +178,7 @@ void HandlerVideoTeam::onVideoTeamModifyRequest(const rti::core::SampleIdentity
const VideoTeamModifyRequest &request)
{
DEBUG_LOG(m_logger) << "onVideoTeamModifyRequest: " << request;
auto ret = request.id() > 0 ? videoTeamModifyRequest(request) : videoTeamCreateRequest(request);
auto ret = request.id > 0 ? videoTeamModifyRequest(request) : videoTeamCreateRequest(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->videoTeamModifyReply(cookie, ret);
@@ -186,9 +186,9 @@ void HandlerVideoTeam::onVideoTeamModifyRequest(const rti::core::SampleIdentity
bool HandlerVideoTeam::needDeviceConfig(const VideoTeam &videoTeam) const
{
if (videoTeam.exerciseId() == 0)
if (videoTeam.exerciseId == 0)
return false;
return m_activeExercises->isActive(ExerciseContext(videoTeam.exerciseId()));
return m_activeExercises->isActive(ExerciseContext(videoTeam.exerciseId));
}
void HandlerVideoTeam::onContextActivated(const ExerciseContext &context)
@@ -196,7 +196,7 @@ void HandlerVideoTeam::onContextActivated(const ExerciseContext &context)
for (const auto *ifs : qAsConst(m_videoTeamObjMap))
{
VideoTeam ddsData = ifs->getData();
if (ddsData.exerciseId() == context.id())
if (ddsData.exerciseId == context.id())
m_deviceConfig->create(ddsData);
}
}
@@ -208,10 +208,10 @@ void HandlerVideoTeam::onContextDeactivated(const ExerciseContext &context)
if (ifs->exerciseId() == context.id())
{
VideoTeam ddsData = ifs->getData();
ddsData.exerciseId(0);
ddsData.streamName(std::string());
ddsData.exerciseId = 0;
ddsData.streamName = std::string();
ifs->updateObject(ddsData);
m_deviceConfig->remove(ddsData.id());
m_deviceConfig->remove(ddsData.id);
}
}
}
@@ -219,27 +219,27 @@ void HandlerVideoTeam::onContextDeactivated(const ExerciseContext &context)
//--------------------------------------------------------------------------------------------------
static VideoTeam convert(const VideoTeamModifyRequest &request, const VideoTeam &oldData)
{
Q_ASSERT(request.id() == oldData.id());
Q_ASSERT(request.id == oldData.id);
VideoTeam newData(oldData);
newData.streamName(request.streamName());
newData.exerciseId(request.exerciseId());
newData.streamName = request.streamName;
newData.exerciseId = request.exerciseId;
return newData;
}
//--------------------------------------------------------------------------------------------------
Core::FunctionReplyObject HandlerVideoTeam::videoTeamModifyRequest(const VideoTeamModifyRequest &request)
{
ObjectVideoTeam *ifs = m_videoTeamObjMap.value(request.id());
ObjectVideoTeam *ifs = m_videoTeamObjMap.value(request.id);
if (ifs == nullptr)
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Team with id %1 not found")).arg(request.id());
DEBUG_LOG(m_logger) << "on Modify Request" << request.streamName() << " ID: " << request.name() << " exId " << request.exerciseId();
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Video Team with id %1 not found")).arg(request.id);
DEBUG_LOG(m_logger) << "on Modify Request" << request.streamName << " ID: " << request.name << " exId " << request.exerciseId;
VideoTeam ddsData = convert(request, ifs->getData());
if (needDeviceConfig(ddsData))
m_deviceConfig->createOrUpdate(ddsData);
else
m_deviceConfig->tryRemove(ddsData.id());
m_deviceConfig->tryRemove(ddsData.id);
Core::FunctionReplyObject ret = ifs->updateObject(ddsData);
emit mvsChanged();
@@ -26,7 +26,7 @@ Database::AvmDeviceConfig toDb(const ExerciseContext &context, const AssetManage
deviceConfig.context = context.toString();
deviceConfig.type = QStringLiteral("IMPORT_VIDEO_CHANNEL");
deviceConfig.name = QStringLiteral("ECRS");
deviceConfig.controller = QString::fromStdString(asset.name());
deviceConfig.controller = QString::fromStdString(asset.name);
deviceConfig.definition = QStringLiteral("recording=ECRS@EXCAVS01");
return deviceConfig;
}
@@ -91,11 +91,11 @@ void ImportHandler::onAssetChanged(const AssetManagement::Asset &asset, DataModi
if (!m_isActive)
return;
if (asset.assetTypeId() != AssetManagement::AssetType::Workstation)
if (asset.assetTypeId != AssetManagement::AssetType::Workstation)
return;
// Guard against a possible race condition, see comments in onContextActivated().
auto found = m_deviceConfigs.find(asset.id());
auto found = m_deviceConfigs.find(asset.id);
if (found != m_deviceConfigs.end())
return;
@@ -121,14 +121,14 @@ void ImportHandler::addToDb(const AssetManagement::Asset &asset)
{
Database::AvmDeviceConfig newConfig = ::toDb(m_context, asset);
m_db->insert(newConfig);
auto insertResult = m_deviceConfigs.insert({asset.id(), newConfig});
auto insertResult = m_deviceConfigs.insert({asset.id, newConfig});
Q_ASSERT(insertResult.second);
emit avDbReloadNeeded();
}
void ImportHandler::removeFromDb(const AssetManagement::Asset &asset)
{
auto found = m_deviceConfigs.find(asset.id());
auto found = m_deviceConfigs.find(asset.id);
Q_ASSERT(found != m_deviceConfigs.end());
m_db->removeAvmDeviceConfig(found->second.id);
m_deviceConfigs.erase(found);
@@ -28,29 +28,29 @@ ObjectFrequencyPlanningStatus::~ObjectFrequencyPlanningStatus()
Core::FunctionReplyObject ObjectFrequencyPlanningStatus::clearValues()
{
auto data(m_data);
data.uuid() = std::string();
data.sent().reset();
data.received().reset();
data.activated().reset();
data.isActive() = false;
data.requester() = std::string();
data.content() = std::string();
data.reason() = TransmissionReason::TR_Unknown;
data.uuid = std::string();
data.sent.reset();
data.received.reset();
data.activated.reset();
data.isActive = false;
data.requester = std::string();
data.content = std::string();
data.reason = TransmissionReason::TR_Unknown;
return updateObject(data);
}
//-------------------------------------------------------------------------------------------------------------
Core::FunctionReplyObject ObjectFrequencyPlanningStatus::createObject(const FrequencyPlanningStatus &data)
{
Q_ASSERT(m_data.id() <= 0);
Q_ASSERT(data.id() > 0); // only allow creation from existing db-entries
Q_ASSERT(m_data.id <= 0);
Q_ASSERT(data.id > 0); // only allow creation from existing db-entries
m_data = data;
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
//-------------------------------------------------------------------------------------------------------------
@@ -60,52 +60,52 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::createObjectFromDDS(con
Database::AvmFrequencyPlanningStatus dbData(toDbData(data));
if (!m_db->insert(dbData))
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoTeam into database"));
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating VideoTeam into database"));
m_data.id() = dbData.id;
DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << m_data.id();
m_data.id = dbData.id;
DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << m_data.id;
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(data.id());
return Core::FunctionReplyObject(data.id);
}
//-------------------------------------------------------------------------------------------------------------
Core::FunctionReplyObject ObjectFrequencyPlanningStatus::updateObject(const FrequencyPlanningStatus &data)
{
if (!isValid())
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
m_data = data;
Database::AvmFrequencyPlanningStatus dbData(toDbData(m_data));
if (!m_db->update(dbData))
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating FrequencyPlanningStatus into database"));
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating FrequencyPlanningStatus into database"));
DEBUG_LOG(m_logger) << "Data changed for FrequencyPlanningStatus Id: " << data.id();
DEBUG_LOG(m_logger) << "Data changed for FrequencyPlanningStatus Id: " << data.id;
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(data.id());
return Core::FunctionReplyObject(data.id);
}
Core::FunctionReplyObject ObjectFrequencyPlanningStatus::removeObject()
{
if (!m_db->removeAvmFrequencyPlanningStatus(m_data.id()))
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "FrequencyPlanningStatus with id %1 can not be removed from DB")).arg(m_data.id());
if (!m_db->removeAvmFrequencyPlanningStatus(m_data.id))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "FrequencyPlanningStatus with id %1 can not be removed from DB")).arg(m_data.id);
if (!m_dts->removeFrequencyPlanningStatusByKey(m_data.id()))
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "FrequencyPlanningStatus with id %1 can not be removed from DDS")).arg(m_data.id());
if (!m_dts->removeFrequencyPlanningStatusByKey(m_data.id))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "FrequencyPlanningStatus with id %1 can not be removed from DDS")).arg(m_data.id);
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
//-------------------------------------------------------------------------------------------------------------
void ObjectFrequencyPlanningStatus::onPublishData()
{
INFO_LOG(m_logger) << "Publish ObjectFrequencyPlanningStatus to dds (" << m_data.id() << ") ..." << m_data.client() << ") ...";
INFO_LOG(m_logger) << "Publish ObjectFrequencyPlanningStatus to dds (" << m_data.id << ") ..." << m_data.client << ") ...";
if (!m_dts->publish(m_data))
ERROR_LOG(m_logger) << "Error publishing ObjectFrequencyPlanningStatus to dds";
@@ -116,20 +116,20 @@ Database::AvmFrequencyPlanningStatus ObjectFrequencyPlanningStatus::toDbData(con
{
Database::AvmFrequencyPlanningStatus dbData;
dbData.id = ddsData.id();
dbData.uuid = QString::fromStdString(ddsData.uuid());
dbData.client = ddsData.client();
dbData.isActive = ddsData.isActive();
dbData.requester = QString::fromStdString(ddsData.requester());
dbData.content = QString::fromStdString(ddsData.content());
dbData.reason = ddsData.reason().underlying();
dbData.id = ddsData.id;
dbData.uuid = QString::fromStdString(ddsData.uuid);
dbData.client = ddsData.client;
dbData.isActive = ddsData.isActive;
dbData.requester = QString::fromStdString(ddsData.requester);
dbData.content = QString::fromStdString(ddsData.content);
dbData.reason = static_cast<int>(ddsData.reason);
if (ddsData.sent.is_set())
dbData.sent = ddsData.sent.get();
dbData.sent = static_cast<qint64>(ddsData.sent.get());
if (ddsData.received.is_set())
dbData.received = ddsData.received.get();
dbData.received = static_cast<qint64>(ddsData.received.get());
if (ddsData.activated.is_set())
dbData.activated = ddsData.activated.get();
dbData.activated = static_cast<qint64>(ddsData.activated.get());
return dbData;
}
@@ -139,20 +139,20 @@ AudioVideoManagement::FrequencyPlanningStatus ObjectFrequencyPlanningStatus::toD
{
AudioVideoManagement::FrequencyPlanningStatus ddsData;
ddsData.id(dbData.id);
ddsData.uuid() = dbData.uuid.toStdString();
ddsData.client() = dbData.client;
ddsData.isActive() = dbData.isActive;
ddsData.requester() = dbData.requester.toStdString();
ddsData.content() = dbData.content.toStdString();
ddsData.reason() = static_cast<TransmissionReason::inner_enum>(dbData.reason);
ddsData.id = dbData.id;
ddsData.uuid = dbData.uuid.toStdString();
ddsData.client = dbData.client;
ddsData.isActive = dbData.isActive;
ddsData.requester = dbData.requester.toStdString();
ddsData.content = dbData.content.toStdString();
ddsData.reason = static_cast<TransmissionReason>(dbData.reason);
if (!dbData.sent.isNull())
ddsData.sent(dbData.sent.value<int>());
ddsData.sent = dbData.sent.value<int>();
if (!dbData.received.isNull())
ddsData.received(dbData.received.value<int>());
ddsData.received = dbData.received.value<int>();
if (!dbData.activated.isNull())
ddsData.activated(dbData.activated.value<int>());
ddsData.activated = dbData.activated.value<int>();
return ddsData;
} // end of toDdsData()
@@ -21,7 +21,7 @@ public:
DatabaseInterface *db);
~ObjectFrequencyPlanningStatus();
int getId() const { return m_data.id(); }
int getId() const { return m_data.id; }
FrequencyPlanningStatus getData() const { return m_data; }
@@ -35,7 +35,7 @@ public:
static Database::AvmFrequencyPlanningStatus toDbData(const FrequencyPlanningStatus &ddsData); // dds -> db
static FrequencyPlanningStatus toDdsData(const Database::AvmFrequencyPlanningStatus &dbData); // db -> dds
bool isValid() const { return (m_data.client() > 0); }
bool isValid() const { return (m_data.client > 0); }
protected:
void onPublishData();
@@ -28,12 +28,12 @@ AudioVideoManagement::Database::AvmMenuStruct toDb(const AudioVideoManagement::A
{
AudioVideoManagement::Database::AvmMenuStruct dbItem;
dbItem.id = ddsItem.id() <= 0 ? 0 : ddsItem.id();
dbItem.id = ddsItem.id <= 0 ? 0 : ddsItem.id;
dbItem.parentId = parentId;
dbItem.isGroup = ddsItem.isGroup();
dbItem.rowid = ddsItem.rowId();
dbItem.isGroup = ddsItem.isGroup;
dbItem.rowid = ddsItem.rowId;
if (ddsItem.isGroup())
if (ddsItem.isGroup)
dbItem.name = QString::fromStdString(ddsItem.name.get());
else
dbItem.mountingPointId = ddsItem.mountingPointId.get();
@@ -45,27 +45,27 @@ void checkHierarchy(const std::vector<AudioVideoManagement::AvMenuEntry> &entrie
{
std::vector<AudioVideoManagement::AvMenuEntry> entries = entries_;
auto isToplevel = [toplevelId] (const AudioVideoManagement::AvMenuEntry &entry) { return entry.parentId() == toplevelId; };
auto isToplevel = [toplevelId] (const AudioVideoManagement::AvMenuEntry &entry) { return entry.parentId == toplevelId; };
auto sublevelStart = std::partition(entries.begin(), entries.end(), isToplevel);
std::set<int32_t> ids;
std::set<int32_t> groupIds;
for (auto entry = entries.begin(); entry != sublevelStart; ++entry)
{
auto result = ids.insert(entry->id());
auto result = ids.insert(entry->id);
Q_ASSERT(result.second);
if (entry->isGroup())
groupIds.insert(entry->id());
if (entry->isGroup)
groupIds.insert(entry->id);
}
for (auto entry = sublevelStart; entry != entries.end(); ++entry)
{
auto result = ids.insert(entry->id());
auto result = ids.insert(entry->id);
Q_ASSERT(result.second);
Q_ASSERT(!entry->isGroup());
Q_ASSERT(groupIds.count(entry->parentId()) > 0);
Q_ASSERT(!entry->isGroup);
Q_ASSERT(groupIds.count(entry->parentId) > 0);
}
}
@@ -86,12 +86,12 @@ ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db)
ObjectMenuStruct::~ObjectMenuStruct()
{
m_dts->removeMenuStructByKey(m_data.id());
m_dts->removeMenuStructByKey(m_data.id);
}
Core::FunctionReplyObject ObjectMenuStruct::createFromDds(const MenuStruct &data)
{
Q_ASSERT(data.id() <= 0 && m_data.id() <= 0);
Q_ASSERT(data.id <= 0 && m_data.id <= 0);
auto reply = insertUpdateDb(data);
onPublishData();
return reply;
@@ -99,7 +99,7 @@ Core::FunctionReplyObject ObjectMenuStruct::createFromDds(const MenuStruct &data
Core::FunctionReplyObject ObjectMenuStruct::updateFromDds(const MenuStruct &data)
{
Q_ASSERT(data.id() > 0 && data.id() == m_data.id());
Q_ASSERT(data.id > 0 && data.id == m_data.id);
auto reply = insertUpdateDb(data);
onPublishData();
return reply;
@@ -107,19 +107,19 @@ Core::FunctionReplyObject ObjectMenuStruct::updateFromDds(const MenuStruct &data
void ObjectMenuStruct::createFromDb(const MenuStruct &data)
{
Q_ASSERT(data.id() > 0 && m_data.id() <= 0);
checkHierarchy(data.menuEntries(), data.id());
Q_ASSERT(data.id > 0 && m_data.id <= 0);
checkHierarchy(data.menuEntries, data.id);
m_data = data;
onPublishData();
}
void ObjectMenuStruct::updateFromDb(const MenuStruct &data)
{
Q_ASSERT(data.id() > 0 && data.id() == m_data.id());
Q_ASSERT(data.id > 0 && data.id == m_data.id);
if (data == m_data)
return;
checkHierarchy(data.menuEntries(), data.id());
checkHierarchy(data.menuEntries, data.id);
m_data = data;
onPublishData();
}
@@ -128,31 +128,31 @@ Core::FunctionReplyObject ObjectMenuStruct::remove()
{
DBTransaction trans(m_db->database());
INFO_LOG(m_logger) << "menuEntries.size(): " << m_data.menuEntries().size();
for (const AudioVideoManagement::AvMenuEntry &me : m_data.menuEntries())
INFO_LOG(m_logger) << "menuEntries.size(): " << m_data.menuEntries.size();
for (const AudioVideoManagement::AvMenuEntry &me : m_data.menuEntries)
{
INFO_LOG(m_logger) << "Remove entries with id/parentId: " << me.id();
INFO_LOG(m_logger) << "Remove entries with id/parentId: " << me.id;
// no recursion needed, only 2 levels allowed
if (me.isGroup())
if (!m_db->removeAvmMenuStructByParentId(me.id()))
return Core::FunctionReplyObject(m_data.id(), "Error while removing menu entries");
if (!m_db->removeAvmMenuStruct(me.id()))
return Core::FunctionReplyObject(m_data.id(), "Error while removing menu entries");
if (me.isGroup)
if (!m_db->removeAvmMenuStructByParentId(me.id))
return Core::FunctionReplyObject(m_data.id, "Error while removing menu entries");
if (!m_db->removeAvmMenuStruct(me.id))
return Core::FunctionReplyObject(m_data.id, "Error while removing menu entries");
}
if (!m_db->removeAvmMenuStruct(m_data.id()))
return Core::FunctionReplyObject(m_data.id(), "Error while removing menu struct");
if (!m_db->removeAvmMenuStruct(m_data.id))
return Core::FunctionReplyObject(m_data.id, "Error while removing menu struct");
trans.commit();
m_dts->removeMenuStructByKey(m_data.id());
m_dts->removeMenuStructByKey(m_data.id);
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
void ObjectMenuStruct::onPublishData()
{
INFO_LOG(m_logger) << "Publish MenuStruct-data to dds (" << m_data.id() << ") ...";
INFO_LOG(m_logger) << "Publish MenuStruct-data to dds (" << m_data.id << ") ...";
if (!m_dts->publish(m_data))
ERROR_LOG(m_logger) << "Error publishing MenuStruct-data to dds";
@@ -161,24 +161,24 @@ void ObjectMenuStruct::onPublishData()
Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &data)
{
checkHierarchy(data.menuEntries(), data.id());
checkHierarchy(data.menuEntries, data.id);
const auto oldEntries = m_data.menuEntries();
const auto oldEntries = m_data.menuEntries;
m_data = data;
Database::AvmMenuStruct ms;
// Insert Parent
ms.parentId = 0;
ms.name = QString::fromStdString(data.name());
ms.isAudio = data.isAudio();
ms.name = QString::fromStdString(data.name);
ms.isAudio = data.isAudio;
ms.isGroup = true;
DBTransaction trans(m_db->database());
if (m_data.id() > 0)
if (m_data.id > 0)
{
ms.id = m_data.id();
ms.id = m_data.id;
if (!m_db->update(ms))
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AvmMenuStruct-data into database"));
}
@@ -188,14 +188,14 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AvmMenuStruct-data into database"));
}
m_data.id(ms.id);
const int virtualMenuStructId = data.id();
const int realMenuStructId = m_data.id();
m_data.id = ms.id;
const int virtualMenuStructId = data.id;
const int realMenuStructId = m_data.id;
std::vector<AvMenuEntry> newEntries;
newEntries.reserve(data.menuEntries().size());
newEntries.reserve(data.menuEntries.size());
auto ret = insertUpdateChildren(virtualMenuStructId, realMenuStructId, data.menuEntries(), newEntries);
auto ret = insertUpdateChildren(virtualMenuStructId, realMenuStructId, data.menuEntries, newEntries);
if (ret.error())
return ret;
@@ -203,23 +203,23 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat
for (const AvMenuEntry &me : oldEntries)
{
// new entries - ignore
if (me.id() <= 0)
if (me.id <= 0)
continue;
auto found = std::find_if(newEntries.begin(), newEntries.end(), [&me] (const AvMenuEntry &newEntry) { return me.id() == newEntry.id(); });
auto found = std::find_if(newEntries.begin(), newEntries.end(), [&me] (const AvMenuEntry &newEntry) { return me.id == newEntry.id; });
if (found == newEntries.end())
{
DEBUG_LOG(m_logger) << "Menu Entry with id not found - was removed: " << me.id();
m_db->removeAvmMenuStruct(me.id());
DEBUG_LOG(m_logger) << "Menu Entry with id not found - was removed: " << me.id;
m_db->removeAvmMenuStruct(me.id);
}
}
m_data.menuEntries(newEntries);
m_data.menuEntries = newEntries;
HandlerMenuStruct::sortEntries(m_data);
DEBUG_LOG(m_logger) << "new entries: " << m_data;
trans.commit();
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
Core::FunctionReplyObject ObjectMenuStruct::insertUpdateChildren(int virtualParentId,
@@ -229,7 +229,7 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateChildren(int virtualPare
{
for(const AudioVideoManagement::AvMenuEntry &ddsItem : entries)
{
if (ddsItem.parentId() != virtualParentId)
if (ddsItem.parentId != virtualParentId)
continue;
Database::AvmMenuStruct dbEntry = ::toDb(ddsItem, realParentId);
@@ -250,7 +250,7 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateChildren(int virtualPare
if (dbEntry.isGroup)
{
const int virtualId = ddsItem.id();
const int virtualId = ddsItem.id;
const int realId = dbEntry.id;
insertUpdateChildren(virtualId, realId, entries, newEntries);
}
@@ -47,7 +47,7 @@ public:
/** Called as a result of a Remove-request. */
Core::FunctionReplyObject remove();
long getId() const { return m_data.id(); }
long getId() const { return m_data.id; }
private:
void onPublishData();
@@ -30,7 +30,7 @@ ObjectVideoReceiver::~ObjectVideoReceiver()
Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver &data)
{
m_data = data;
if (m_data.id() <= 0)
if (m_data.id <= 0)
{
Database::AvmVideoReceiver dbData;
dbData = toDbData(data);
@@ -38,55 +38,55 @@ Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver
if (!m_db->insert(dbData))
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AvmVideoReceiver-data into database"));
m_data.id(dbData.id);
DEBUG_LOG(m_logger) << "New Id: " << m_data.id();
m_data.id = dbData.id;
DEBUG_LOG(m_logger) << "New Id: " << m_data.id;
}
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
//-------------------------------------------------------------------------------------------------------------
Core::FunctionReplyObject ObjectVideoReceiver::updateObject(const VideoReceiver &data)
{
m_data = data;
DEBUG_LOG(m_logger) << "ObjectVideoReceiver::updateObject id=" << data.id()
<< " isActive=" << data.isActive()
<< " hostName=" << data.hostName()
<< " isLocked=" << data.isLocked();
DEBUG_LOG(m_logger) << "ObjectVideoReceiver::updateObject id=" << data.id
<< " isActive=" << data.isActive
<< " hostName=" << data.hostName
<< " isLocked=" << data.isLocked;
Database::AvmVideoReceiver dbData(toDbData(data));
if (!m_db->update(dbData))
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoReceiver2 into database"));
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating VideoReceiver2 into database"));
DEBUG_LOG(m_logger) << "Data changed for VideoReceiver Id: " << data.id();
DEBUG_LOG(m_logger) << "Data changed for VideoReceiver Id: " << data.id;
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(data.id());
return Core::FunctionReplyObject(data.id);
}
//-------------------------------------------------------------------------------------------------------------
Core::FunctionReplyObject ObjectVideoReceiver::removeObject()
{
if (!m_db->removeAvmVideoReceiver(m_data.id()))
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Video Receiver with id %1 can not be removed from DB")).arg(m_data.id());
if (!m_db->removeAvmVideoReceiver(m_data.id))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Video Receiver with id %1 can not be removed from DB")).arg(m_data.id);
if (!m_dts->removeVideoReceiverByKey(m_data.id()))
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Video Receiver with id %1 can not be removed from DDS")).arg(m_data.id());
if (!m_dts->removeVideoReceiverByKey(m_data.id))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Video Receiver with id %1 can not be removed from DDS")).arg(m_data.id);
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
//-------------------------------------------------------------------------------------------------------------
void ObjectVideoReceiver::onPublishData()
{
INFO_LOG(m_logger) << "Publish MvsVideoReceiver-data to dds (" << m_data.id() << ") ...";
INFO_LOG(m_logger) << "Publish MvsVideoReceiver-data to dds (" << m_data.id << ") ...";
if (!m_dts->publish(m_data))
ERROR_LOG(m_logger) << "Error publishing MvsVideoReceiver-data to dds";
@@ -97,15 +97,15 @@ Database::AvmVideoReceiver ObjectVideoReceiver::toDbData(const VideoReceiver &dd
{
Database::AvmVideoReceiver dbData;
dbData.id = ddsData.id();
dbData.streamName = QString::fromStdString(ddsData.streamName());
dbData.mainStructureElementId = ddsData.mainStructureElementId();
dbData.teamId = ddsData.teamId();
dbData.isActive = ddsData.isActive();
dbData.info = QString::fromStdString(ddsData.info());
dbData.hostName = QString::fromStdString(ddsData.hostName());
dbData.frequency = ddsData.frequency();
dbData.isLocked = ddsData.isLocked();
dbData.id = ddsData.id;
dbData.streamName = QString::fromStdString(ddsData.streamName);
dbData.mainStructureElementId = ddsData.mainStructureElementId;
dbData.teamId = ddsData.teamId;
dbData.isActive = ddsData.isActive;
dbData.info = QString::fromStdString(ddsData.info);
dbData.hostName = QString::fromStdString(ddsData.hostName);
dbData.frequency = ddsData.frequency;
dbData.isLocked = ddsData.isLocked;
return dbData;
}
@@ -114,19 +114,19 @@ Database::AvmVideoReceiver ObjectVideoReceiver::toDbData(const VideoReceiver &dd
AudioVideoManagement::VideoReceiver ObjectVideoReceiver::toDdsData(const Database::AvmVideoReceiver &dbData)
{
AudioVideoManagement::VideoReceiver ddsData;
ddsData.id(dbData.id);
ddsData.streamName(dbData.streamName.toStdString());
ddsData.mainStructureElementId(dbData.mainStructureElementId);
ddsData.teamId(dbData.teamId);
ddsData.isActive(dbData.isActive);
ddsData.isLocked(dbData.isLocked);
ddsData.info(dbData.info.toStdString());
ddsData.hostName(dbData.hostName.toStdString());
ddsData.frequency(dbData.frequency);
ddsData.id = dbData.id;
ddsData.streamName = dbData.streamName.toStdString();
ddsData.mainStructureElementId = dbData.mainStructureElementId;
ddsData.teamId = dbData.teamId;
ddsData.isActive = dbData.isActive;
ddsData.isLocked = dbData.isLocked;
ddsData.info = dbData.info.toStdString();
ddsData.hostName = dbData.hostName.toStdString();
ddsData.frequency = dbData.frequency;
// init data not in db
ddsData.dbm(0);
ddsData.snr(0);
ddsData.dbm = 0;
ddsData.snr = 0;
return ddsData;
} // end of toDdsData()
@@ -31,13 +31,13 @@ public:
Core::FunctionReplyObject updateObject(const VideoReceiver &data);
Core::FunctionReplyObject removeObject();
int getId() const { return m_data.id(); }
int getId() const { return m_data.id; }
VideoReceiver getData() const { return m_data; }
static Database::AvmVideoReceiver toDbData(const VideoReceiver &ddsData); // dds -> db
static AudioVideoManagement::VideoReceiver toDdsData(const Database::AvmVideoReceiver &dbData); // db -> dds
bool isValid() const { return (m_data.id() > 0); }
bool isValid() const { return (m_data.id > 0); }
protected:
void onPublishData();
@@ -28,39 +28,39 @@ ObjectVideoTeam::~ObjectVideoTeam()
//-------------------------------------------------------------------------------------------------------------
Core::FunctionReplyObject ObjectVideoTeam::createObject(const VideoTeam &data)
{
Q_ASSERT(m_data.id() <= 0);
Q_ASSERT(data.id() > 0); // only allow creation from existing db-entries
Q_ASSERT(m_data.id <= 0);
Q_ASSERT(data.id > 0); // only allow creation from existing db-entries
m_data = data;
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
//-------------------------------------------------------------------------------------------------------------
Core::FunctionReplyObject ObjectVideoTeam::updateObject(const VideoTeam &data)
{
if (!isValid())
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
m_data = data;
Database::AvmVideoTeam dbData(toDbData(data));
if (!m_db->update(dbData))
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoTeam into database"));
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating VideoTeam into database"));
DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << data.id();
DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << data.id;
// Publish Data via DTS
onPublishData();
return Core::FunctionReplyObject(data.id());}
return Core::FunctionReplyObject(data.id);}
//-------------------------------------------------------------------------------------------------------------
void ObjectVideoTeam::onPublishData()
{
INFO_LOG(m_logger) << "Publish AvmVideoTeam-data to dds (" << m_data.id() << ") ...";
INFO_LOG(m_logger) << "Publish AvmVideoTeam-data to dds (" << m_data.id << ") ...";
if (!m_dts->publish(m_data))
ERROR_LOG(m_logger) << "Error publishing AvmVideoTeam-data to dds";
@@ -71,14 +71,14 @@ Database::AvmVideoTeam ObjectVideoTeam::toDbData(const VideoTeam &ddsData)
{
Database::AvmVideoTeam dbData;
dbData.id = ddsData.id();
dbData.name = QString::fromStdString(ddsData.name());
dbData.ssrc = ddsData.ssrc();
dbData.port = ddsData.vtPort();
dbData.programId = ddsData.programId();
dbData.timeOffset = ddsData.timeOffset();
dbData.streamName = QString::fromStdString(ddsData.streamName());
dbData.exerciseId = ddsData.exerciseId();
dbData.id = ddsData.id;
dbData.name = QString::fromStdString(ddsData.name);
dbData.ssrc = ddsData.ssrc;
dbData.port = ddsData.vtPort;
dbData.programId = ddsData.programId;
dbData.timeOffset = ddsData.timeOffset;
dbData.streamName = QString::fromStdString(ddsData.streamName);
dbData.exerciseId = ddsData.exerciseId;
return dbData;
}
@@ -88,14 +88,14 @@ AudioVideoManagement::VideoTeam ObjectVideoTeam::toDdsData(const Database::AvmVi
{
AudioVideoManagement::VideoTeam ddsData;
ddsData.id(dbData.id);
ddsData.name(dbData.name.toStdString());
ddsData.ssrc(dbData.ssrc);
ddsData.vtPort(dbData.port);
ddsData.programId(dbData.programId);
ddsData.timeOffset(dbData.timeOffset);
ddsData.exerciseId(dbData.exerciseId);
ddsData.streamName(dbData.streamName.toStdString());
ddsData.id = dbData.id;
ddsData.name = dbData.name.toStdString();
ddsData.ssrc = dbData.ssrc;
ddsData.vtPort = dbData.port;
ddsData.programId = dbData.programId;
ddsData.timeOffset = dbData.timeOffset;
ddsData.exerciseId = dbData.exerciseId;
ddsData.streamName = dbData.streamName.toStdString();
return ddsData;
} // end of toDdsData()
@@ -24,15 +24,15 @@ public:
Core::FunctionReplyObject createObject(const VideoTeam &data);
Core::FunctionReplyObject updateObject(const VideoTeam &data);
int getId() const { return m_data.id(); }
int exerciseId() const { return m_data.exerciseId(); }
int getId() const { return m_data.id; }
int exerciseId() const { return m_data.exerciseId; }
VideoTeam getData() const { return m_data; }
QString getName() const { return QString::fromStdString(m_data.name()); }
QString getName() const { return QString::fromStdString(m_data.name); }
static Database::AvmVideoTeam toDbData(const VideoTeam &ddsData); // dds -> db
static VideoTeam toDdsData(const Database::AvmVideoTeam &dbData); // db -> dds
bool isValid() const { return (m_data.id() > 0); }
bool isValid() const { return (m_data.id > 0); }
protected:
void onPublishData();
@@ -21,12 +21,12 @@ namespace
bool isMountingPointOfInterest(const InfrastructureManagement::StructureElement &se)
{
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType::MountingPoint)
if (se.structureElementTypeId != InfrastructureManagement::StructureElementType::MountingPoint)
return false;
if (se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::IndoorCamera ||
se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::OutdoorCamera ||
se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::AnnouncementUnit)
if (se.mountingPointTypeId == InfrastructureManagement::MountingPointType::IndoorCamera ||
se.mountingPointTypeId == InfrastructureManagement::MountingPointType::OutdoorCamera ||
se.mountingPointTypeId == InfrastructureManagement::MountingPointType::AnnouncementUnit)
return true;
return false;
@@ -35,10 +35,10 @@ bool isMountingPointOfInterest(const InfrastructureManagement::StructureElement
std::string displayName(const InfrastructureManagement::StructureElement &mp)
{
Q_ASSERT(isMountingPointOfInterest(mp));
if (mp.displayName().size() > 0)
return mp.displayName();
if (mp.displayName.size() > 0)
return mp.displayName;
return AudioVideoManagement::AudioVideoHandlerImpl::internalStreamName(mp.id()).toStdString();
return AudioVideoManagement::AudioVideoHandlerImpl::internalStreamName(mp.id).toStdString();
}
} // anonymous namespace
@@ -78,7 +78,7 @@ void StreamNameMappingPublisher::onMainStructureElementChanged(const Infrastruct
void StreamNameMappingPublisher::onMseChanged(const InfrastructureManagement::MainStructureElement &mse)
{
const auto &structureElements = mse.elements();
const auto &structureElements = mse.elements;
for (auto &se : structureElements)
if (isMountingPointOfInterest(se))
publish(se);
@@ -86,7 +86,7 @@ void StreamNameMappingPublisher::onMseChanged(const InfrastructureManagement::Ma
void StreamNameMappingPublisher::onMseRemoved(const InfrastructureManagement::MainStructureElement &mse)
{
const auto &structureElements = mse.elements();
const auto &structureElements = mse.elements;
for (auto &se : structureElements)
if (isMountingPointOfInterest(se))
remove(se);
@@ -95,18 +95,18 @@ void StreamNameMappingPublisher::onMseRemoved(const InfrastructureManagement::Ma
void StreamNameMappingPublisher::publish(const InfrastructureManagement::StructureElement &mountingPoint)
{
StreamName streamName;
streamName.mountingPointId(mountingPoint.id());
streamName.internalName(AudioVideoHandlerImpl::internalStreamName(mountingPoint.id()).toStdString());
streamName.displayName(displayName(mountingPoint));
streamName.mountingPointId = mountingPoint.id;
streamName.internalName = AudioVideoHandlerImpl::internalStreamName(mountingPoint.id).toStdString();
streamName.displayName = displayName(mountingPoint);
if (m_streamNames[mountingPoint.id()] != streamName)
if (m_streamNames[mountingPoint.id] != streamName)
m_dts->publish(streamName);
m_streamNames[mountingPoint.id()] = streamName;
m_streamNames[mountingPoint.id] = streamName;
}
void StreamNameMappingPublisher::remove(const InfrastructureManagement::StructureElement &mountingPoint)
{
m_dts->removeStreamNameByKey(mountingPoint.id());
m_dts->removeStreamNameByKey(mountingPoint.id);
}
} // namespace AudioVideoManagement
@@ -61,11 +61,11 @@ Database::AvmTvcConfig toDb(const ModifyTvcConfigRequest &request)
{
Database::AvmTvcConfig result;
result.id = request.id();
result.radioCircuit = QString::fromStdString(request.radioCircuit());
result.info = QString::fromStdString(request.info());
result.recording = request.recording();
result.tetraChannelId = request.tetraChannelId();
result.id = request.id;
result.radioCircuit = QString::fromStdString(request.radioCircuit);
result.info = QString::fromStdString(request.info);
result.recording = request.recording;
result.tetraChannelId = request.tetraChannelId;
if (request.exerciseId.is_set())
result.exerciseId = request.exerciseId.get();
@@ -92,36 +92,36 @@ public:
void create(const TvcConfig &config)
{
Q_ASSERT(!m_cache.contains(config.id()));
Q_ASSERT(!m_cache.contains(config.id));
Database::AvmDeviceConfig deviceConfig = toDeviceConfig(config);
if (!m_db->insert(deviceConfig))
ERROR_LOG(m_logger) << "Error while inserting device config into database";
m_cache.insert(config.id(), deviceConfig);
m_cache.insert(config.id, deviceConfig);
emit m_handler->avDbReloadNeeded();
}
void update(const TvcConfig &config)
{
Q_ASSERT(m_cache.contains(config.id()));
Q_ASSERT(m_cache.contains(config.id));
Database::AvmDeviceConfig deviceConfig = toDeviceConfig(config);
const Database::AvmDeviceConfig &oldDeviceConfig = m_cache[config.id()];
const Database::AvmDeviceConfig &oldDeviceConfig = m_cache[config.id];
deviceConfig.id = oldDeviceConfig.id;
if (!m_db->update(deviceConfig))
ERROR_LOG(m_logger) << "Error while updating device config";
m_cache[config.id()] = deviceConfig;
m_cache[config.id] = deviceConfig;
emit m_handler->avDbReloadNeeded();
}
void createOrUpdate(const TvcConfig &config)
{
if (m_cache.contains(config.id()))
if (m_cache.contains(config.id))
update(config);
else
create(config);
@@ -234,8 +234,8 @@ void TvcHandler::onModifyTvcConfigRequest(const rti::core::SampleIdentity &cooki
const ModifyTvcConfigRequest &request)
{
DEBUG_LOG(m_logger) << "onModifyTvcConfigRequest: " << request;
Q_ASSERT(request.id() >= 0);
auto ret = request.id() > 0 ? modifyTvcConfig(request) : createTvcConfig(request);
Q_ASSERT(request.id >= 0);
auto ret = request.id > 0 ? modifyTvcConfig(request) : createTvcConfig(request);
if (ret.error())
WARNING_LOG(m_logger) << ret();
m_fts->modifyTvcConfigReply(cookie, ret);
@@ -272,33 +272,33 @@ bool TvcHandler::isValidChannel(int64_t channelId) const
// If there are conflicts between the then-active exercises the start of the new exercise must be denied.
bool TvcHandler::isFreeChannel(const ModifyTvcConfigRequest &request) const
{
boost::optional<int> exerciseId = toBoost(request.exerciseId());
boost::optional<int> exerciseId = toBoost(request.exerciseId);
if (request.id() <= 0)
return isFreeChannel(request.tetraChannelId(), exerciseId);
return isFreeChannel(request.tetraChannelId(), exerciseId, request.id());
if (request.id <= 0)
return isFreeChannel(request.tetraChannelId, exerciseId);
return isFreeChannel(request.tetraChannelId, exerciseId, request.id);
}
bool TvcHandler::isFreeChannel(int32_t channelId, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const
{
auto constraint = [&channelId] (const TvcConfig &config) { return config.tetraChannelId() != channelId; };
auto constraint = [&channelId] (const TvcConfig &config) { return config.tetraChannelId != channelId; };
return checkConstraint(constraint, exerciseId, excludeId);
}
bool TvcHandler::isNameUnique(const ModifyTvcConfigRequest &request) const
{
boost::optional<int> exerciseId = toBoost(request.exerciseId());
boost::optional<int> exerciseId = toBoost(request.exerciseId);
if (request.id() <= 0)
return isNameUnique(request.radioCircuit(), exerciseId);
return isNameUnique(request.radioCircuit(), exerciseId, request.id());
if (request.id <= 0)
return isNameUnique(request.radioCircuit, exerciseId);
return isNameUnique(request.radioCircuit, exerciseId, request.id);
}
// Needs to be revised.
// See isFreeChannel().
bool TvcHandler::isNameUnique(const std::string &name, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const
{
auto constraint = [&name] (const TvcConfig &config) { return config.radioCircuit() != name; };
auto constraint = [&name] (const TvcConfig &config) { return config.radioCircuit != name; };
return checkConstraint(constraint, exerciseId, excludeId);
}
@@ -321,13 +321,13 @@ Core::FunctionReplyObject TvcHandler::createTvcConfig(const ModifyTvcConfigReque
}
TvcConfig tvcConfig = toDds(dbConfigData);
m_cache.insert(tvcConfig.id(), tvcConfig);
m_cache.insert(tvcConfig.id, tvcConfig);
m_dts->publish(tvcConfig);
if (needDeviceConfig(tvcConfig))
m_deviceConfig->create(tvcConfig);
return Core::FunctionReplyObject(tvcConfig.id());
return Core::FunctionReplyObject(tvcConfig.id);
}
Core::FunctionReplyObject TvcHandler::modifyTvcConfig(const ModifyTvcConfigRequest &request)
@@ -339,17 +339,17 @@ Core::FunctionReplyObject TvcHandler::modifyTvcConfig(const ModifyTvcConfigReque
Database::AvmTvcConfig dbConfigData = toDb(request);
if (!m_db->update(dbConfigData))
return reply.setStr(tr_lts("dds", "Could not update TVC config data in database with id %1")).arg(request.id());
return reply.setStr(tr_lts("dds", "Could not update TVC config data in database with id %1")).arg(request.id);
TvcConfig tvcConfig = toDds(dbConfigData);
m_cache[tvcConfig.id()] = tvcConfig;
m_cache[tvcConfig.id] = tvcConfig;
m_dts->publish(tvcConfig);
if (needDeviceConfig(tvcConfig))
m_deviceConfig->createOrUpdate(tvcConfig);
else
m_deviceConfig->tryRemove(tvcConfig.id());
m_deviceConfig->tryRemove(tvcConfig.id);
emit tvcConfigChanged(tvcConfig);
return reply;
@@ -357,7 +357,7 @@ Core::FunctionReplyObject TvcHandler::modifyTvcConfig(const ModifyTvcConfigReque
Core::FunctionReplyObject TvcHandler::removeTvcConfig(const Core::RemoveElementRequest &request)
{
int32_t configId = request.id();
int32_t configId = request.id;
Core::FunctionReplyObject reply(configId);
auto found = m_cache.find(configId);
@@ -371,7 +371,7 @@ Core::FunctionReplyObject TvcHandler::removeTvcConfig(const Core::RemoveElementR
m_dts->removeTvcConfigByKey(configId);
if (!m_db->removeAvmTvcConfig(configId))
return reply.setStr(tr_lts("dds", "Could not remove TVC config data with id %1")).arg(request.id());
return reply.setStr(tr_lts("dds", "Could not remove TVC config data with id %1")).arg(request.id);
return reply;
}
@@ -380,7 +380,7 @@ Database::AvmDeviceConfig TvcHandler::toDeviceConfig(const TvcConfig &tvcConfig)
{
Database::AvmDeviceConfig result;
Database::AvmTvcChannel tetraChannel = channelById(tvcConfig.tetraChannelId());
Database::AvmTvcChannel tetraChannel = channelById(tvcConfig.tetraChannelId);
QJsonObject settings = QJsonDocument::fromJson(tetraChannel.settings.toUtf8()).object();
QJsonObject data = settings[QStringLiteral("data")].toObject();
@@ -388,10 +388,10 @@ Database::AvmDeviceConfig TvcHandler::toDeviceConfig(const TvcConfig &tvcConfig)
{
result.context = exerciseList(tvcConfig);
result.type = QStringLiteral("TETRA_RT_CHANNEL");
result.name = QString::fromStdString(tvcConfig.radioCircuit());
result.name = QString::fromStdString(tvcConfig.radioCircuit);
result.controller = QStringLiteral("EXCAVS01");
result.definition = QStringLiteral("mode=1;ssrc=%1;port=%2").arg(data[QStringLiteral("ssrc")].toInt()).arg(data[QStringLiteral("port")].toInt());
if (tvcConfig.recording())
if (tvcConfig.recording)
result.definition.append(QStringLiteral(";recording=ECRS@%1").arg(result.controller));
result.link = 0;
}
@@ -399,10 +399,10 @@ Database::AvmDeviceConfig TvcHandler::toDeviceConfig(const TvcConfig &tvcConfig)
{
result.context = exerciseList(tvcConfig);
result.type = QStringLiteral("SOTAS_SIP_RT_CHANNEL");
result.name = QString::fromStdString(tvcConfig.radioCircuit());
result.name = QString::fromStdString(tvcConfig.radioCircuit);
result.controller = QStringLiteral("EXCAVS01");
result.definition = QStringLiteral("mode=1;sip=%1@%2").arg(data[QStringLiteral("role")].toString()).arg(data[QStringLiteral("host")].toString());
if (tvcConfig.recording())
if (tvcConfig.recording)
result.definition.append(QStringLiteral(";recording=ECRS@%1").arg(result.controller));
result.link = 0;
}
@@ -429,7 +429,7 @@ void TvcHandler::onContextActivated(const ExerciseContext &context)
bool isLocal = tvcConfig.exerciseId.is_set();
if (isLocal)
{
if (tvcConfig.exerciseId() == context.id())
if (tvcConfig.exerciseId == context.id())
m_deviceConfig->create(tvcConfig);
}
else
@@ -452,13 +452,13 @@ void TvcHandler::onContextDeactivated(const ExerciseContext &context)
if (isLocal)
{
if (tvcConfig.exerciseId() == context.id())
m_deviceConfig->remove(tvcConfig.id());
if (tvcConfig.exerciseId == context.id())
m_deviceConfig->remove(tvcConfig.id);
}
else
{
if (!haveActiveExercise)
m_deviceConfig->remove(tvcConfig.id());
m_deviceConfig->remove(tvcConfig.id);
else
m_deviceConfig->update(tvcConfig);
}
@@ -499,20 +499,20 @@ Core::FunctionReplyObject TvcHandler::validateRequest(const ModifyTvcConfigReque
{
Core::FunctionReplyObject reply;
if (request.id() > 0)
if (request.id > 0)
{
reply.setId(request.id());
if (!m_cache.contains(request.id()))
return reply.setStr(tr_lts("dds", "Could not modify TVC config because id %1 is unknown")).arg(request.id());
reply.setId(request.id);
if (!m_cache.contains(request.id))
return reply.setStr(tr_lts("dds", "Could not modify TVC config because id %1 is unknown")).arg(request.id);
}
if (!isValidChannel(request.tetraChannelId()))
return reply.setStr(tr_lts("dds", "Could not create/modify TVC config because the channel with id %1 is invalid")).arg(request.tetraChannelId());
if (!isValidChannel(request.tetraChannelId))
return reply.setStr(tr_lts("dds", "Could not create/modify TVC config because the channel with id %1 is invalid")).arg(request.tetraChannelId);
if (!isFreeChannel(request))
return reply.setStr(tr_lts("dds", "Could not create/modify TVC config because channel id %1 is already taken")).arg(request.tetraChannelId());
return reply.setStr(tr_lts("dds", "Could not create/modify TVC config because channel id %1 is already taken")).arg(request.tetraChannelId);
if (!isStreamNameValid(request.radioCircuit()))
if (!isStreamNameValid(request.radioCircuit))
return reply.setStr(tr_lts("dds", "Could not create/modify TVC config because the circuit name is invalid"));
if (!isNameUnique(request))
@@ -528,7 +528,7 @@ bool TvcHandler::checkConstraint(const std::function<bool (const TvcConfig &)> &
{
for (const TvcConfig &config : qAsConst(m_cache))
{
if (excludeId == config.id())
if (excludeId == config.id)
continue;
// If both configs are local the constraint must hold if they are in the same exercise
@@ -25,7 +25,7 @@ ADD_SUBDIRECTORY(MarkerManagement)
ADD_SUBDIRECTORY(Messaging)
ADD_SUBDIRECTORY(MeteoDataManagement)
ADD_SUBDIRECTORY(NotificationManagement)
#ADD_SUBDIRECTORY(NmeaManagement)
ADD_SUBDIRECTORY(NmeaManagement)
ADD_SUBDIRECTORY(OcBaseDownload)
ADD_SUBDIRECTORY(OcSituationClient)
ADD_SUBDIRECTORY(OcSituationServer)
@@ -944,7 +944,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
void CesTests::checkParticipantEvent()
{
ProjectDataManagement::PdmEventType expectedType = ProjectDataManagement::PdmEventType::Unknown;
ProjectDataManagement::PdmEventType expectedType = ProjectDataManagement::PdmEventType::EventType_Unknown;
switch (m_testId)
{
case 8:
@@ -303,7 +303,7 @@ void CesTestsBoobyTrap::onEventChanged(const CentralEffectSimulation::Participan
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
return;
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::HitMine)
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::EventType_HitMine)
{
m_countEventBoobyTrap ++;
DEBUG_LOG(m_logger) << "m_countEventBoobyTrap=" << m_countEventBoobyTrap
@@ -360,7 +360,7 @@ void CesTestsGasPipe::onEventChanged(const CentralEffectSimulation::ParticipantE
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
return;
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::HitGasPipe)
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::EventType_HitGasPipe)
{
m_countEventGasPipe ++;
DEBUG_LOG(m_logger) << "m_countEventGasPipe=" << m_countEventGasPipe;
@@ -399,7 +399,7 @@ void CesTestsMineAreas::onEventChanged(const CentralEffectSimulation::Participan
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
return;
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::HitGasPipe)
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::EventType_HitGasPipe)
{
m_countEventMineAreas ++;
DEBUG_LOG(m_logger) << "m_countEventMineAreas=" << m_countEventMineAreas;
@@ -66,16 +66,16 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleState.remove(data.id());
return;
}
// Only handle transitions from prepared or fired to activated
if ((m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared ||
m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if ((m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared ||
m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -197,13 +197,13 @@ void HandlerArtillerieSound::onTechnicalAreaChanged(const AreaEffectSimulation::
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove TechnicalArea";
m_technicalAreas.remove(data.id());
return;
}
if (data.type() == AreaEffectSimulation::AesTechnicalAreaType_def::TatSoundZone)
if (data.type() == AreaEffectSimulation::AesTechnicalAreaType::TatSoundZone)
{
int zone = -1;
m_technicalAreas.insert(data.id(), data);
@@ -77,24 +77,24 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState_def::EsFired:
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsReceived:
case AreaEffectSimulation::AesEffectState::EsFired:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
BorderlineUtm borderline(data);
DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id();
m_borderlines.insert(data.id(), borderline);
break;
}
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsPaused:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsPaused:
m_borderlines.remove(data.id());
break;
case AreaEffectSimulation::AesEffectState_def::EsUnknown:
case AreaEffectSimulation::AesEffectState_def::EsError:
case AreaEffectSimulation::AesEffectState::EsUnknown:
case AreaEffectSimulation::AesEffectState::EsError:
break;
}
break;
@@ -142,9 +142,9 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
if (result)
{
if (borderline.operatorId <= 0)
sendParticipantEvent(borderline, partPos, ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline);
sendParticipantEvent(borderline, partPos, ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
else
sendParticipantEvent(borderline, partPos, ProjectDataManagement::PdmEventType_def::CrossLocalBorderline);
sendParticipantEvent(borderline, partPos, ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
}
}
} // end of onParticipantPositionChanged()
@@ -163,10 +163,10 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
{
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Unknown)
return;
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
@@ -117,7 +117,7 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d
return;
}
AreaEffectSimulation::AesItemView itemView;
AreaEffectSimulation::AesType aesType = AreaEffectSimulation::AesType_def::AtBoobyTrap;
AreaEffectSimulation::AesType aesType = AreaEffectSimulation::AesType::AtBoobyTrap;
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(data.id(), aesType, itemView);
checkBuildingsHit(itemView);
@@ -139,18 +139,18 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
{
INFO_LOG(m_logger) << "AesEffectState_def::EsExpired"
INFO_LOG(m_logger) << "AesEffectState::EsExpired"
<< " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
<< " effectStart=" << data.effectStart()
<< " diff = " << m_ddsHandler->currentPartitionTime() - data.effectStart() ;
if (m_ddsHandler->currentPartitionTime() == 0)
return;
if ((data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
|| (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary))
if ((data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
|| (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary))
{
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
{
DEBUG_LOG(m_logger) << "AtOffRouteMineSecondary id=" << data.id() / 1000;
auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int)(data.id() / 1000));
@@ -176,7 +176,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
return;
}
}
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
{
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary id=" << data.id() / 1000;
//auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int) (data.id() / 1000));
@@ -214,7 +214,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data)
{
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtExplosionArea)
return;
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId();
// remove State for each building
@@ -349,16 +349,16 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleState.remove(data.id());
return;
}
// Only handle transitions from prepared or fired to activated
if ((m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared ||
m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if ((m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared ||
m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -399,7 +399,7 @@ void HandlerAesData::onEffectsChanged(const AreaEffectSimulation::Effects &effec
if (modType == DataModification::eRemoved)
return;
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
return;
DEBUG_LOG(m_logger) << " Got typechecked effects " << effects;
@@ -548,14 +548,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
// check for correct AES type artillery only
static QVector<AreaEffectSimulation::AesType_def::type> s_relevantTypes =
static QVector<AreaEffectSimulation::AesType> s_relevantTypes =
{
AreaEffectSimulation::AesType_def::AtExplosionArea,
AreaEffectSimulation::AesType_def::AtExplosionSingle,
AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions,
AreaEffectSimulation::AesType::AtExplosionArea,
AreaEffectSimulation::AesType::AtExplosionSingle,
AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions,
};
if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
{
bIsExplosionCluster = true;
ignFuncBase = igniterFunctionBaseExplosionCluster(aesItemId); // assume that fuseType does not differ within a single ExplosionArea
@@ -691,7 +691,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effects, const CentralEffectSimulation::HandlerBuildingData::Footprint &footprint)
{
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
return;
const int aesItemId = effects.aesItemId();
@@ -715,7 +715,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
++indexBitFieldIdx;
// just SesTriggered are relevant:
if (singleEffect.singleEffectState() != AreaEffectSimulation::AesSingleEffectState_def::SesTriggered)
if (singleEffect.singleEffectState() != AreaEffectSimulation::AesSingleEffectState::SesTriggered)
continue;
// already processed?
@@ -768,9 +768,9 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
properties += mseIdAsStr;
const AreaEffectSimulation::AesZPlacement_def::type zPlacement = singleEffect.zPlacement().underlying();
const AreaEffectSimulation::AesZPlacement zPlacement = static_cast<AreaEffectSimulation::AesZPlacement>(singleEffect.zPlacement());
if (zPlacement == AreaEffectSimulation::AesZPlacement_def::ZpDraped)
if (zPlacement == AreaEffectSimulation::AesZPlacement::ZpDraped)
{
// z-Value is 0 -> old:
Buildings::SendCesHitOnBuildingRequest requestBld(
@@ -793,7 +793,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
bitfieldState.insert(indexBitFieldIdx);
}
else if (zPlacement == AreaEffectSimulation::AesZPlacement_def::ZpAbsolute)
else if (zPlacement == AreaEffectSimulation::AesZPlacement::ZpAbsolute)
{
// since HandlerBuildingModel::handleDetonationLocationRequest has already
// calculated to ignFuncBase, the impactPosition is the detonationLocation:
@@ -879,12 +879,12 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
tmpBldg.buildingId(buildingId);
Core::GeoPosition impactPosition;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
{
impactPosition.lat(m_ddsHandler->dtcAes()->boobyTrap(data.aesItemId()).impactPosition().lat());
impactPosition.lon(m_ddsHandler->dtcAes()->boobyTrap(data.aesItemId()).impactPosition().lon());
}
else if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
else if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
{
int zone = -1;
LtsCoordTrans::UtmCoordinate bottomLeft = LtsCoordTrans::UtmCoordinate::fromGeographic(data.boundingBoxBottomLeft().lon(), data.boundingBoxBottomLeft().lat(), zone);
@@ -151,7 +151,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
}
// skip "Outdoor Cameras / Announcement Units"
if (data.structureElementTypeId() != InfrastructureManagement::StructureElementType_def::Building)
if (data.structureElementTypeId() != InfrastructureManagement::StructureElementType::Building)
return;
// Vor allem in der GUEZ-DB sind ca 23 Gebäude per Hand eingefügt. (Sakralbau, Bahnhof, Wasserwerk etc.)
@@ -583,12 +583,12 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
{
DEBUG_LOG(m_logger) << "RESULT: integrate free area...";
// free area and FuseType_def::IfbDelay:
// free area and FuseType::IfbDelay:
// We can´t move the detonation point _below_ the surface.
// That would be identical to a neagative 'startHat'
// In other words: lineOfSightElevation would deliver LineOfSight::LOS_ERROR
// so:
if (detonationDistance > 0) // detonationDistance > 0 === FuseType_def::IfbDelay
if (detonationDistance > 0) // detonationDistance > 0 === FuseType::IfbDelay
detonationDistance = 0;
}
} // if (bHasBuildingIntersection)
@@ -114,7 +114,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS
return;
int floorId = m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId());
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
m_participantFloor.remove(participantId);
else
m_participantFloor.insert(participantId, floorId);
@@ -214,7 +214,7 @@ int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId)
if (floorId == iteratorFloor)
{
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &localPartPos = m_handlerParticipant->position(iteratorParticipant);
if (localPartPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
if (localPartPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
continue; // Don't count participants with catastrophic Kill
const int partyId = localPartPos.partyId();
++partyCount[partyId];
@@ -106,12 +106,12 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
<< " data.aesTypeId()" << data.aesTypeId();
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
double chargeHeight; // Alle Stockwerke beruecksichtigen
double chargeDepression; // Alle Kellerraeume beruecksichtigen
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination)
{
chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen
chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen
@@ -126,8 +126,8 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
<< " chargeDepression=" << chargeDepression;
}
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBCContamination
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtBCContamination
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
{
DEBUG_LOG(m_logger) << "return1: AesItemView: " << data.effectStateId();
return;
@@ -135,8 +135,8 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
// Gebaeude die von einem sesshaften Kampfstoff betroffen sind, müssen als kontaminiert gelten.
const ProjectDataManagement::VolatilityType volatilityType = m_ddsHandler->volatilityTypeId(data.chargeStruct());
if (volatilityType != ProjectDataManagement::VolatilityType_def::Resident
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
if (volatilityType != ProjectDataManagement::VolatilityType::Resident
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
{
DEBUG_LOG(m_logger) << "return2: AesItemView: " << data.effectStateId();
return;
@@ -177,16 +177,16 @@ void HandlerContamination::calculateBuilding(int buildingId,
QVector<int> effectedRooms;
QVector<int> effectedFloors;
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBCContamination
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtBCContamination
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
{
DEBUG_LOG(m_logger) << "return: NO BC-Contamination AesItemView: " << data.effectStateId();
return;
}
const ProjectDataManagement::VolatilityType volatilityType = m_ddsHandler->volatilityTypeId(data.chargeStruct());
if ( volatilityType != ProjectDataManagement::VolatilityType_def::Resident
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
if ( volatilityType != ProjectDataManagement::VolatilityType::Resident
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtNContamination)
return;
DEBUG_LOG(m_logger) << "buildingId=" << buildingId;
@@ -197,22 +197,22 @@ void HandlerContamination::calculateBuilding(int buildingId,
if (!effectedRooms.empty())
{
DEBUG_LOG(m_logger) << "effectedRooms.size=" << effectedRooms.size();
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::CombatReady;
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
// [GUEZE-2752] N-Contamination: Only Contamionation inside Range1
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination
&& !isInsideRange1(buildingId, data.aesItemId()))
{
DEBUG_LOG(m_logger) << "!isInsideRange1 buildingId=" << buildingId;
return;
}
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBCContamination
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBCContamination
&& !isInsideBCContamination(buildingId, data.aesItemId()))
{
DEBUG_LOG(m_logger) << "AtBCContamination !isInsideRange buildingId=" << buildingId << "return";
return;
}
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination
&& isInsideInnerCircle(buildingId, data.aesItemId()))
{
constexpr int TIME_2_SECONDS = 2000;
@@ -220,7 +220,7 @@ void HandlerContamination::calculateBuilding(int buildingId,
if ( m_ddsHandler->dtcCore()->partitionTime().timeStamp() < (data.effectStart() + TIME_2_SECONDS))
{
DEBUG_LOG(m_logger) << "VulnerabilityState=CatastrophicKill";
vulnerabilityState = ProjectDataManagement::VulnerabilityState::CatastrophicKill;
vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill;
}
}
DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest buildingId=" << buildingId
@@ -266,7 +266,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
double chargeHeight = 0.0;
double chargeDepression = 0.0;
if (aesItemView.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination)
if (aesItemView.aesTypeId() == AreaEffectSimulation::AesType::AtNContamination)
{
chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen
chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen
@@ -118,28 +118,28 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsUnknown:
case AreaEffectSimulation::AesEffectState_def::EsError:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsUnknown:
case AreaEffectSimulation::AesEffectState::EsError:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
removeStates(data);
m_aesItemViews.remove(data.aesItemId());
break;
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsPaused:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState_def::EsFired:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPaused:
case AreaEffectSimulation::AesEffectState::EsActivated:
case AreaEffectSimulation::AesEffectState::EsFired:
m_aesItemViews.insert(data.aesItemId(), data);
break;
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsReceived:
break;
}
}
void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data)
{
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtExplosionArea)
return;
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId();
// remove State for each building
@@ -157,15 +157,15 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleState.remove(data.id());
return;
}
// Only handle transitions from prepared to activated
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared
&& data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared
&& data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -382,9 +382,9 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
// check for correct AES type artillery only
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
DEBUG_LOG(m_logger) << "Calculate";
break;
default:
@@ -225,25 +225,25 @@ void HandlerParticipantArea::onSendCesHitReply(const Core::FunctionReplyObject &
void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
{
// not needed, handled through HandlerParticipantGasPipe
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtGasPipe)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtGasPipe)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtUnknown)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtUnknown)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrap)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrap)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMine)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMine)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineArea)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineArea)
return;
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineCorridor)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineCorridor)
return;
if (m_ddsHandler->isSmartChargeType(data.chargeTypeId()))
@@ -264,7 +264,7 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
return;
}
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{
// build Polygon Mines:
auto &formMines = m_aesItemViews[data.aesItemId()].formMines;
@@ -281,26 +281,26 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPrepared:
{
m_aesItemViews.insert(data.aesItemId(), CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
break;
}
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineArea:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
break;
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
case AreaEffectSimulation::AesType::AtNContamination:
// for each participant:
// Bounding-Box Check,
// form-Check
@@ -308,31 +308,31 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
calculateBcContamination(aesItemViewUtm);
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
break;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtDangerArea:
calculateFunctionArea(aesItemViewUtm);
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtMineCorridor:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
break;
} // switch aesTypeId
break;
} // case EsActivated
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsExpired:
{
aesItemViewRemoved(aesItemId);
break;
@@ -354,14 +354,14 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
//DEBUG_LOG(m_logger) << "Got onDusSingleMineChanged data.id()=" << data.id();
CentralEffectSimulation::AesItemViewUtm itemView;
itemView.aesItemId = data.id();
itemView.chargeTypeId = data.chargeTypeId();
itemView.partyId = data.partyId.is_set() ? data.partyId.get() : -1;
itemView.aesTypeId = AreaEffectSimulation::AesType_def::AtDusSingleMine;
itemView.aesTypeId = AreaEffectSimulation::AesType::AtDusSingleMine;
itemView.effectStart = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
itemView.formMines.push_back(CentralEffectSimulation::geographic2Utm(data.position(), &itemView.zone));
itemView.dusMineId = data.mineId();
@@ -372,9 +372,9 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
m_triggeredImpacts[itemView.aesItemId] = ti;
break;
}
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
m_aesItemViews.remove(data.id());
break;
default:
@@ -395,14 +395,14 @@ void HandlerParticipantArea::onBCContaminationChanged(const AreaEffectSimulation
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
const auto dtcPdm = m_ddsHandler->dtcPdm();
if (dtcPdm->volatilityTypeId(data.chargeTypeId()) == ProjectDataManagement::VolatilityType_def::Resident)
if (dtcPdm->volatilityTypeId(data.chargeTypeId()) == ProjectDataManagement::VolatilityType::Resident)
{
ref.radials = {data.impactRadius()};
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition(), &ref.zone);
@@ -427,10 +427,10 @@ void HandlerParticipantArea::onNContaminationChanged(const AreaEffectSimulation:
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
ref.radials = {data.impactRadius(),
@@ -481,13 +481,13 @@ void HandlerParticipantArea::deleteFunctionalArea(const int aesItemId)
if (m_handlerParticipant->isOutdated(participantPos))
continue;
// Same as leave FunctionArea
if (itemView.aesTypeId == AreaEffectSimulation::AesType_def::AtFunctionalArea)
if (itemView.aesTypeId == AreaEffectSimulation::AesType::AtFunctionalArea)
{
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea);
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea);
sendEffectTypeEvent(itemView, participantPos, EffectType::FunctionalAreaLeave, -1, -1);
}
else
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId();
} // for all Participants
} // deleteFunctionalArea
@@ -503,7 +503,7 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
if (inFormCheck(itemView, participantPos))
// Check, if Participant is in a circle of mine
inMineRadiusCheck(itemView, participantPos);
@@ -511,15 +511,15 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
// no longer in mine area - reset all EffectiveMineRangeEnter mineIndexes
m_effectTypeBitFieldIndexes[itemView.aesItemId][participantPos.participantId()].clear();
break;
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
break;
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtDusSingleMine:
inMineRadiusCheck(itemView, participantPos);
break;
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType::AtBCContamination:
case AreaEffectSimulation::AesType::AtNContamination:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtDangerArea:
inFormCheck(itemView, participantPos);
break;
default:
@@ -552,7 +552,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae
continue;
}
const int mineIdx = (itemView.aesTypeId == AreaEffectSimulation::AesType_def::AtDusSingleMine)
const int mineIdx = (itemView.aesTypeId == AreaEffectSimulation::AesType::AtDusSingleMine)
? itemView.dusMineId : bitFieldIdx + 1; // mineIdx in minefield starts at 1
// Check, if participant is inside danger-radius of the mine
@@ -576,7 +576,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae
bool HandlerParticipantArea::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
if (m_handlerParticipant->isOutdated(participantPosition)) // Participant Position is not valid Todo Magic Number
@@ -603,7 +603,7 @@ bool HandlerParticipantArea::inBoundingBoxCheck(const CentralEffectSimulation::A
bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
if (m_handlerParticipant->isOutdated(participantPosition)) // Participant Position is not valid
@@ -626,23 +626,23 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
<< ", aesItemId: " << itemView.aesItemId;
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
sendEffectTypeEvent(itemView, participantPosition, effectTypeForBCContaminationArea(itemView, participantPosUtmPoint), -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterDangerArea);
case AreaEffectSimulation::AesType::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterDangerArea);
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterFunctionalArea);
case AreaEffectSimulation::AesType::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea);
sendEffectTypeEvent(itemView, participantPosition, EffectType::FunctionalAreaEnter, -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterMineArea);
case AreaEffectSimulation::AesType::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterMineArea);
break;
case AreaEffectSimulation::AesType_def::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::EnterNuclear);
case AreaEffectSimulation::AesType::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
sendEffectTypeEvent(itemView, participantPosition, effectTypeForNContaminationArea(itemView, participantPosUtmPoint, participantPosition.sampleTime()), -1, -1);
break;
default:
@@ -655,23 +655,23 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
// outside
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
sendEffectTypeEvent(itemView, participantPosition, EffectType::BCContaminationLeave, -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
case AreaEffectSimulation::AesType::AtDangerArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea);
case AreaEffectSimulation::AesType::AtFunctionalArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea);
sendEffectTypeEvent(itemView, participantPosition, EffectType::FunctionalAreaLeave, -1, -1);
break;
case AreaEffectSimulation::AesType_def::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveMineArea);
case AreaEffectSimulation::AesType::AtMineArea:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveMineArea);
break;
case AreaEffectSimulation::AesType_def::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType_def::LeaveNuclear);
case AreaEffectSimulation::AesType::AtNContamination:
sendParticipantEvent(itemView, participantPosition, ProjectDataManagement::PdmEventType::EventType_LeaveNuclear);
sendEffectTypeEvent(itemView, participantPosition, EffectType::NContaminationLeave, -1, -1);
break;
default:
@@ -699,14 +699,14 @@ void HandlerParticipantArea::onTriggeredImpactsChanged(const AreaEffectSimulatio
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: " << data;
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
// explosion at the position of participant
calculateImpacts(data);
break;
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtMineArea:
// participant run on mine
// => store Mine-State and take into account when a participant runs to one of this mines
m_triggeredImpacts.insert(data.aesItemId(), data);
@@ -746,16 +746,16 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
modType != DataModification::eModified)
return;
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleStates.remove(data.id());
return;
}
// Only handle transitions from prepared or fired to activated
if ((m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared ||
m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if ((m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared ||
m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState::EsFired) &&
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -806,16 +806,16 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
if (modType != DataModification::eAdded && modType != DataModification::eModified)
return;
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) // EsExpired? EsError? EsUnknown?
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved) // EsExpired? EsError? EsUnknown?
{
DEBUG_LOG(m_logger) << "Remove ExplosionSingleCentral with aesId = " << data.id();
m_explosionSingleCentralStates.remove(data.id());
return;
} // if
if ((m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState_def::EsFired) ||
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated)
if ((m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState::EsPrepared &&
m_explosionSingleCentralStates.value(data.id()) != AreaEffectSimulation::AesEffectState::EsFired) ||
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated)
{
m_explosionSingleCentralStates.insert(data.id(), data.effectStateId());
return;
@@ -915,7 +915,7 @@ void HandlerParticipantArea::calculateImpacts(const AreaEffectSimulation::Trigge
const auto participantPositions = m_handlerParticipant->positions();
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : participantPositions)
{
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
if (pPos.insideBuilding())
continue;
@@ -991,7 +991,7 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
return;
}
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -1000,7 +1000,7 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
const TrainingAreaBase::TabPosition pos(participantPosition.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantPosition.buildingId(),
participantPosition.roomId());
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
@@ -1058,7 +1058,7 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
} // if
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -1067,7 +1067,7 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId(), 0);
const int originatorEquipmentNumber = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
const TrainingAreaBase::TabPosition pos(
participantPosition.pos(), Core::PositionReportingSource_def::Gps, participantPosition.buildingId(),
participantPosition.pos(), Core::PositionReportingSource::Gps, participantPosition.buildingId(),
participantPosition.roomId()
);
TrainingAreaBase::SendCesHitRequest requestTab(
@@ -1092,12 +1092,12 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
bool calculateAes = false;
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Aircraft ||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Aircraft ||
typeClass == ParticipantManagement::TypeClass::Vessel ||
typeClass == ParticipantManagement::TypeClass::Unknown)
{
DEBUG_LOG(m_logger) << "Participant with id " << participantPosition.participantId()
<< " has invalid typeClass: " << typeClass
@@ -1131,12 +1131,12 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
}
// send hit events only with central AES Simulation
if (calculateAes
&& (eventType == ProjectDataManagement::PdmEventType_def::HitB
|| eventType == ProjectDataManagement::PdmEventType_def::HitC
|| eventType == ProjectDataManagement::PdmEventType_def::Hit
|| eventType == ProjectDataManagement::PdmEventType_def::HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType_def::HitMine
|| eventType == ProjectDataManagement::PdmEventType_def::HitN))
&& (eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitC
|| eventType == ProjectDataManagement::PdmEventType::EventType_Hit
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN))
{
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantPosition.participantId();
return;
@@ -1169,14 +1169,14 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
// Criterion for friendly Fire:
if (itemView.partyId != -1
&& ((eventType == ProjectDataManagement::PdmEventType_def::EnterMineArea
|| eventType == ProjectDataManagement::PdmEventType_def::EnterNuclear
|| eventType == ProjectDataManagement::PdmEventType_def::HitB
|| eventType == ProjectDataManagement::PdmEventType_def::HitC
|| eventType == ProjectDataManagement::PdmEventType_def::Hit
|| eventType == ProjectDataManagement::PdmEventType_def::HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType_def::HitMine
|| eventType == ProjectDataManagement::PdmEventType_def::HitN)
&& ((eventType == ProjectDataManagement::PdmEventType::EventType_EnterMineArea
|| eventType == ProjectDataManagement::PdmEventType::EventType_EnterNuclear
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitC
|| eventType == ProjectDataManagement::PdmEventType::EventType_Hit
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN)
&& itemView.partyId == participantPosition.partyId()))
pe.friendlyFire(true);
else
@@ -1268,29 +1268,29 @@ bool HandlerParticipantArea::eventMustBeSend(int aesItemId,
// - remove opposite events (e.g remove Enter event when we leave the area)
switch (eventType.underlying())
{
case ProjectDataManagement::PdmEventType_def::EnterDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterDangerArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterDangerArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveMineArea);
case ProjectDataManagement::PdmEventType::EventType_EnterMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveMineArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterMineArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterMineArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea);
case ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterFunctionalArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveNuclear);
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveNuclear);
break;
case ProjectDataManagement::PdmEventType_def::LeaveNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterNuclear);
case ProjectDataManagement::PdmEventType::EventType_LeaveNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
break;
default:
break;
@@ -1424,29 +1424,29 @@ ProjectDataManagement::PdmEventType HandlerParticipantArea::leaveEventTypeForAes
{
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtDangerArea:
return ProjectDataManagement::PdmEventType::LeaveDangerArea;
case AreaEffectSimulation::AesType_def::AtMineArea:
return ProjectDataManagement::PdmEventType::LeaveMineArea;
case AreaEffectSimulation::AesType_def::AtNContamination:
return ProjectDataManagement::PdmEventType::LeaveNuclear;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
return ProjectDataManagement::PdmEventType::LeaveFunctionalArea;
case AreaEffectSimulation::AesType::AtDangerArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea;
case AreaEffectSimulation::AesType::AtMineArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
case AreaEffectSimulation::AesType::AtNContamination:
return ProjectDataManagement::PdmEventType::EventType_LeaveNuclear;
case AreaEffectSimulation::AesType::AtFunctionalArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea;
default:
break;
}
return ProjectDataManagement::PdmEventType::Unknown;
return ProjectDataManagement::PdmEventType::EventType_Unknown;
}
EffectType HandlerParticipantArea::leaveEffectTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
{
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
return EffectType::BCContaminationLeave;
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
return EffectType::NContaminationLeave;
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
return EffectType::FunctionalAreaLeave;
default:
break;
@@ -1511,7 +1511,7 @@ void HandlerParticipantArea::aesItemViewRemoved(int aesItemId)
}
}
const auto eventTypeLeave = leaveEventTypeForAesType(aiv.aesTypeId);
if (eventTypeLeave != ProjectDataManagement::PdmEventType::Unknown)
if (eventTypeLeave != ProjectDataManagement::PdmEventType::EventType_Unknown)
{
DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave;
auto it = m_eventStates.find(aesItemId);
@@ -112,10 +112,10 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
// NASAT, MIDAS, AirSupport
// Der explizite HandlerAirSupport wird gestrichen.
// Der HandlerExplosions übernimmt die Aufgaben mit, da quasi identisch!!
// if (m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(data.chargeTypeId()) == ProjectDataManagement::GearClass_def::AirSupport)
// if (m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(data.chargeTypeId()) == ProjectDataManagement::GearClass::AirSupport)
// return;
static const QVector<AreaEffectSimulation::AesType> validAesTypes = {AesType_def::AtEffectCluster, AesType_def::AtExplosionAreaSingleExplosions, AesType_def::AtExplosionSingle, AesType_def::AtExplosionCluster};
static const QVector<AreaEffectSimulation::AesType> validAesTypes = {AesType::AtEffectCluster, AesType::AtExplosionAreaSingleExplosions, AesType::AtExplosionSingle, AesType::AtExplosionCluster};
if (!validAesTypes.contains(data.aesTypeId()))
return;
@@ -137,7 +137,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
{
const AreaEffectSimulation::ExplosionSingle &explosionSingle = m_ddsHandler->dtcAes()->explosionSingle(aesItemId);
isCentral = explosionSingle.isCentral();
@@ -206,17 +206,17 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsUnknown:
case AreaEffectSimulation::AesEffectState_def::EsError:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsUnknown:
case AreaEffectSimulation::AesEffectState::EsError:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
{
DEBUG_LOG(m_logger) << " remove aesItemId=" << data.aesItemId();
// do some cleanup:
m_handledImpactsStorage.removeAesItem(aesItemId);
Q_FALLTHROUGH();
}
case AreaEffectSimulation::AesEffectState_def::EsPaused:
case AreaEffectSimulation::AesEffectState::EsPaused:
{
// Man kann den m_enteredHazardDistanceStore nutzen.
// Und allen darin für dieses area/aesItemView gespeicherten participants
@@ -245,7 +245,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
// cleanup:
if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPaused)
if (data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPaused)
{
DEBUG_LOG(m_logger) << "Expired, remove aesItemId=" << aesItemId
<< ", m_aesItemViewsUtm.remove(" << aesItemId << ")";
@@ -257,9 +257,9 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
}
break;
}
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsFired:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsFired:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId()
<< " aesItemId=" << aesItemId
@@ -274,9 +274,9 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
// a) Aiv changes to EsActivated or
// b) Effects ?
// So be prepared and calculate hazardDistanceForm already at EsPrepared
if (aesTypeId == AreaEffectSimulation::AesType_def::AtExplosionCluster || aesTypeId == AreaEffectSimulation::AesType_def::AtEffectCluster)
if (aesTypeId == AreaEffectSimulation::AesType::AtExplosionCluster || aesTypeId == AreaEffectSimulation::AesType::AtEffectCluster)
{
// useHazardDistance = (aesTypeId == AreaEffectSimulation::AesType_def::AtExplosionCluster);
// useHazardDistance = (aesTypeId == AreaEffectSimulation::AesType::AtExplosionCluster);
const double hazardDistance = m_ddsHandler->dtcPdm()->hazardDistance(data.chargeStruct().chargeTypeId(),
data.chargeStruct().igniterTypeId(),
@@ -288,8 +288,8 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
aesItemViewUtm.hazardDistanceForm = ExpandPolygon::bufferUtmPolygon(aesItemViewUtm.form, aesItemViewUtm.zone, hazardDistance);
}
if ((aesTypeId == AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions) ||
(aesTypeId == AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions))
if ((aesTypeId == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions) ||
(aesTypeId == AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions))
m_aesItemViewsImpactsUtm.insert(aesItemId, aesItemViewUtm);
else
{
@@ -318,8 +318,8 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem
} // if (aesItemViewUtm.effectStart == AreaEffectSimulation::AesEffectState::EsActivated)
break;
}
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsReceived:
break;
} // switch
} // END onAesItemViewChanged
@@ -334,10 +334,10 @@ void HandlerExplosions::onTriggeredImpactsChanged(const AreaEffectSimulation::Tr
<< " bitfield().size=" << data.bitfield().size();
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
// explosion at the position of participant
calculateImpacts(data);
break;
@@ -363,7 +363,7 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
continue;
DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId();
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
DEBUG_LOG(m_logger) << "pPos.vulnerabilityState=" << pPos.vulnerabilityState;
if (pPos.insideBuilding())
@@ -392,7 +392,7 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect
requestTab.chargeTypeId(data.chargeTypeId());
//default
requestTab.aesId(0);
requestTab.eventType(ProjectDataManagement::EventType_def::FireEvent);
requestTab.eventType(ProjectDataManagement::EventType::FireEvent);
//
if (data.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::Participant)
{
@@ -414,7 +414,7 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect
else if (data.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
{
requestTab.aesId(data.originatorId());
requestTab.eventType(ProjectDataManagement::EventType_def::ExplosionCluster);
requestTab.eventType(ProjectDataManagement::EventType::ExplosionCluster);
}
requestTab.remainEffectPercent(remainEffectPercent);
requestTab.position(tabPosition);
@@ -514,7 +514,7 @@ void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::Exp
DEBUG_LOG(m_logger) << "onExplosionSingleChanged 1";
if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated)
return;
DEBUG_LOG(m_logger) << "onExplosionSingleChanged"
@@ -560,7 +560,7 @@ void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::Exp
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
continue;
DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId();
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
DEBUG_LOG(m_logger) << "pPos.vulnerabilityState=" << pPos.vulnerabilityState;
if (pPos.insideBuilding())
@@ -592,7 +592,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef
Q_UNUSED(modType);
// Until now (04/2024) AreaEffectSimulation::Effects is used at ExplosionCluster only:
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
return;
// older then 10sec? ignore
@@ -649,7 +649,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef
for (const AreaEffectSimulation::SingleEffect &se : qAsConst(singleEffectsRef))
{
++curSeIndex;
if (se.singleEffectState() != AreaEffectSimulation::AesSingleEffectState_def::SesTriggered)
if (se.singleEffectState() != AreaEffectSimulation::AesSingleEffectState::SesTriggered)
continue;
// compare current triggered idx with triggered idx of the past
@@ -672,7 +672,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef
const auto &participantPositions = m_handlerParticipant->positions();
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : qAsConst(participantPositions))
{
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
continue;
@@ -739,7 +739,7 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr
const CentralEffectSimulation::AesItemViewUtm &curAivUtmArea = *currentAreaIt;
// check aiv:
if (curAivUtmArea.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (curAivUtmArea.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
continue;
if (!curAivUtmArea.hasHazardDistance())
continue;
@@ -873,9 +873,9 @@ bool HandlerExplosions::inBoundingBoxCheck(const CentralEffectSimulation::AesIte
DEBUG_LOG(m_logger) << "inBoundingBoxCheck 1"
<< ", aesItemId=" << itemViewUtm.aesItemId
<< ", effectStateId=" << itemViewUtm.effectStateId;
if ((itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated) &&
(itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState_def::EsPrepared) &&
(itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState_def::EsFired))
if ((itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated) &&
(itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState::EsPrepared) &&
(itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState::EsFired))
return false;
DEBUG_LOG(m_logger) << "inBoundingBoxCheck 2";
@@ -961,12 +961,12 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId,
<< " typeClass=" << typeClass;
// Only send, if Any Participant is in Smart-Range (save Tetra load)
if (!bHumanFound && typeClass == ParticipantManagement::TypeClass_def::Human)
if (!bHumanFound && typeClass == ParticipantManagement::TypeClass::Human)
bHumanFound = inCircle(impactPos, impactRadius, participantPosUtmPoint);
if (typeClass != ParticipantManagement::TypeClass_def::GroundVehicle &&
typeClass != ParticipantManagement::TypeClass_def::VehicleWithGear &&
typeClass != ParticipantManagement::TypeClass_def::WeaponSystem)
if (typeClass != ParticipantManagement::TypeClass::GroundVehicle &&
typeClass != ParticipantManagement::TypeClass::VehicleWithGear &&
typeClass != ParticipantManagement::TypeClass::WeaponSystem)
continue;
DEBUG_LOG(m_logger) << "participantPosition.timestamp =" << participantPosition.sampleTime()
@@ -1007,10 +1007,10 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId,
{
DEBUG_LOG(m_logger) << "size=1";
// send two single fire to the same vehicle
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, impactTime , 100, ProjectDataManagement::EventType_def::HitEffectSimulation); // 100 Percent
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, impactTime + 1000, 100, ProjectDataManagement::EventType_def::HitEffectSimulation); // 100 Percent
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, ProjectDataManagement::EventType_def::HitEffectSimulation);
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, ProjectDataManagement::EventType_def::HitEffectSimulation);
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, impactTime , 100, ProjectDataManagement::EventType::HitEffectSimulation); // 100 Percent
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, impactTime + 1000, 100, ProjectDataManagement::EventType::HitEffectSimulation); // 100 Percent
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, ProjectDataManagement::EventType::HitEffectSimulation);
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, ProjectDataManagement::EventType::HitEffectSimulation);
}
else
{
@@ -1024,10 +1024,10 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId,
};
std::sort(vehiclesInSmartExplosion.begin(), vehiclesInSmartExplosion.end(), mapSortLessThan);
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.at(0).participantPosition, impactTime, 100, ProjectDataManagement::EventType_def::HitEffectSimulation); // 100 Percent
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.at(1).participantPosition, impactTime, 100, ProjectDataManagement::EventType_def::HitEffectSimulation); // 100 Percent
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.at(0).participantPosition, ProjectDataManagement::EventType_def::HitEffectSimulation);
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.at(1).participantPosition, ProjectDataManagement::EventType_def::HitEffectSimulation);
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.at(0).participantPosition, impactTime, 100, ProjectDataManagement::EventType::HitEffectSimulation); // 100 Percent
sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.at(1).participantPosition, impactTime, 100, ProjectDataManagement::EventType::HitEffectSimulation); // 100 Percent
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.at(0).participantPosition, ProjectDataManagement::EventType::HitEffectSimulation);
sendParticipantEvent(itemViewUtm, vehiclesInSmartExplosion.at(1).participantPosition, ProjectDataManagement::EventType::HitEffectSimulation);
}
} // calculateSmartExplosion
@@ -1050,8 +1050,8 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm
//CentralEffectSimulation::AesItemViewUtm aesItemViewUtm = m_aesItemViewsImpactsUtm.value(static_cast<int>(data.aesItemId()));
CentralEffectSimulation::AesItemViewUtm aesItemViewUtm;
if ((data.aesTypeId().underlying() == AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
|| (data.aesTypeId().underlying() == AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions))
if ((data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
|| (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions))
aesItemViewUtm = m_aesItemViewsImpactsUtm.value(static_cast<int>(data.aesItemId()));
else
aesItemViewUtm = m_aesItemViewsUtm.value(static_cast<int>(data.aesItemId()));
@@ -1095,7 +1095,7 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm
if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number
continue;
DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId();
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
DEBUG_LOG(m_logger) << "pPos.vulnerabilityState=" << pPos.vulnerabilityState;
if (pPos.insideBuilding())
@@ -1158,7 +1158,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae
// get radius of munition
const ProjectDataManagement::GearClass &gearClass = m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(itemView.chargeStruct.chargeTypeId());
const bool bIsAirSupport = (gearClass.underlying() == ProjectDataManagement::GearClass_def::AirSupport);
const bool bIsAirSupport = (gearClass.underlying() == ProjectDataManagement::GearClass::AirSupport);
const QVector<double> &rangesInMeter = chargeRanges(itemView.chargeStruct);
DEBUG_LOG(m_logger) << "calculateImpactsEffect" << " chargeRanges:"
@@ -1197,7 +1197,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae
//
// 1 range -> typical explosionCluster
// == impactRadius
// 3 ranges -> typical explosionCluster with chargeTypeId of GearClass_def::AirSupport
// 3 ranges -> typical explosionCluster with chargeTypeId of GearClass::AirSupport
// == lethalRadius, nonLethalRadius, hazardDistance
//
@@ -1218,7 +1218,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae
effect = 3; // hazardDistance
DEBUG_LOG(m_logger) << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << ", effect=" << effect;
sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(),
effect, ProjectDataManagement::EventType_def::EnterHazardDistance);
effect, ProjectDataManagement::EventType::EnterHazardDistance);
}
break;
case RANGE::NON_LETHAL:
@@ -1243,14 +1243,14 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae
{
DEBUG_LOG(m_logger) << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << ", effect=" << effect;
sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(),
effect, ProjectDataManagement::EventType_def::AirSupport); // AirSupport for both: LETHAL_RADIUS, NONLETHAL_RADIUS
effect, ProjectDataManagement::EventType::AirSupport); // AirSupport for both: LETHAL_RADIUS, NONLETHAL_RADIUS
}
#ifdef GUEZE_3136_IMPLEMENTED
else
{
DEBUG_LOG(m_logger) << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << " (Verdeckung -> EnterHazardDistance)";
sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(),
effect, ProjectDataManagement::EventType_def::EnterHazardDistance);
effect, ProjectDataManagement::EventType::EnterHazardDistance);
}
#endif // GUEZE_3136_IMPLEMENTED
} // case
@@ -1410,7 +1410,7 @@ QVector<double> HandlerExplosions::chargeRanges(const AreaEffectSimulation::Char
const ProjectDataManagement::GearClass &gearClass = m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(chargeStruct.chargeTypeId());
DEBUG_LOG(m_logger) << "chargeTypeId = " << chargeStruct.chargeTypeId() << ", gearClass = " << gearClass;
if (gearClass.underlying() == ProjectDataManagement::GearClass_def::AirSupport)
if (gearClass.underlying() == ProjectDataManagement::GearClass::AirSupport)
{
const double lethalRadius = m_ddsHandler->getLethalRadius(chargeStruct);
const double nonLethalRadius = m_ddsHandler->getNonLethalRadius(chargeStruct);
@@ -1523,7 +1523,7 @@ void HandlerExplosions::sendEffectTypeEvent(const CentralEffectSimulation::AesIt
//effectTime >= 0 ? effectTime : participantPosition.sampleTime(),
QDateTime::currentMSecsSinceEpoch(),
ctasEffectType,
ProjectDataManagement::EventType_def::HitEffectSimulation);
ProjectDataManagement::EventType::HitEffectSimulation);
}
// Send via TAB-Proxy to battlefield
@@ -1565,7 +1565,7 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem
return;
}
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -1579,7 +1579,7 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem
#endif // ORIGINATOR_AT_SENDCESHITREQUEST
const TrainingAreaBase::TabPosition pos(participantPosition.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantPosition.buildingId(),
participantPosition.roomId());
@@ -1618,7 +1618,7 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem
DEBUG_LOG(m_logger) << "ftcTab->SendCesHitRequest: " << requestTab;
m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this);
if (!m_ddsHandler->isSmartChargeType(itemView.chargeStruct))
sendParticipantEvent(m_aesItemViewsUtm.value(itemView.aesItemId), participantPosition, ProjectDataManagement::EventType_def::HitEffectSimulation);
sendParticipantEvent(m_aesItemViewsUtm.value(itemView.aesItemId), participantPosition, ProjectDataManagement::EventType::HitEffectSimulation);
}
double HandlerExplosions::getSquareDistance(const QPointF &centerUtm, const QPointF &pointUtm)
@@ -1645,13 +1645,13 @@ void HandlerExplosions::sendEnterHazardDistance(const int participantId, const i
m_enteredHazardDistanceStore.participantEnteringArea(participantId, aesItemId);
ProjectDataManagement::EventType eventType = ProjectDataManagement::EventType_def::EnterHazardDistance;
ProjectDataManagement::EventType eventType = ProjectDataManagement::EventType::EnterHazardDistance;
sendCesHitRequest(m_aesItemViewsUtm.value(aesItemId),
cesParticipantData,
QDateTime::currentMSecsSinceEpoch(),
ctasEffectType,
eventType);
sendParticipantEvent(m_aesItemViewsUtm.value(aesItemId), cesParticipantData, ProjectDataManagement::EventType_def::EnterHazardDistance);
sendParticipantEvent(m_aesItemViewsUtm.value(aesItemId), cesParticipantData, ProjectDataManagement::EventType::EnterHazardDistance);
}
void HandlerExplosions::sendLeaveHazardDistance(const int participantId, const int aesItemId, const int remaining)
@@ -1671,8 +1671,8 @@ void HandlerExplosions::sendLeaveHazardDistance(const int participantId, const i
cesParticipantData,
QDateTime::currentMSecsSinceEpoch(),
ctasEffectType,
ProjectDataManagement::EventType_def::LeaveHazardDistance);
sendParticipantEvent(itemView, cesParticipantData, ProjectDataManagement::EventType_def::LeaveHazardDistance);
ProjectDataManagement::EventType::LeaveHazardDistance);
sendParticipantEvent(itemView, cesParticipantData, ProjectDataManagement::EventType::LeaveHazardDistance);
}
void HandlerExplosions::sendParticipantEvent(const CentralEffectSimulation::AesItemViewUtm &item,
@@ -1682,10 +1682,10 @@ void HandlerExplosions::sendParticipantEvent(const CentralEffectSimulation::AesI
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId();
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Unknown)
return;
DEBUG_LOG(m_logger) << " sendParticipantEvent participantId=" << participantPosition.participantId();
@@ -90,8 +90,8 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
{
// order checks by effort:
if ((modType == DataModification::eRemoved)
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired)
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated))
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|| (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
return;
if (!data.effectStart.is_set())
@@ -101,7 +101,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
}
// Kriterium fuer NASAT/MIDAS
if (m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(data.chargeStruct().chargeTypeId()) == ProjectDataManagement::GearClass_def::AirSupport)
if (m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(data.chargeStruct().chargeTypeId()) == ProjectDataManagement::GearClass::AirSupport)
return;
if (!m_ddsHandler->isLaserGuidable(data.chargeStruct()))
@@ -166,7 +166,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
{
const int aesItemId = data.aesItemId();
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
if (data.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtFunctionalArea)
if (data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtFunctionalArea)
return;
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(data.aesItemId());
@@ -192,12 +192,12 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPrepared:
break;
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
bool isSupplyTruck = false;
if (fa.supplyMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
if (fa.supplyMode() == AreaEffectSimulation::AesOperatingMode::OmWaitingTime)
{
DEBUG_LOG(m_logger) << "isSupplyTruck = true";
isSupplyTruck = true;
@@ -231,8 +231,8 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
<< ", type: " << data.aesTypeId();
break;
} // case EsActivated
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsExpired:
{
aesItemViewRemoved(aesItemId);
m_aesPolygonEncloseBuilding.remove(aesItemId);
@@ -307,7 +307,7 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
{
///////////////////
/// \brief [GUEZE-2256] 3D Wirksim - Funktionsraum Nicht Kampffähig
@@ -350,7 +350,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
{
///////////////////
/// \brief [GUEZE-2256] 3D Wirksim - Funktionsraum Nicht Kampffähig
@@ -405,7 +405,7 @@ void HandlerFunctionalAreas::onRestoreRadioReadinessChanged(const int participan
bool HandlerFunctionalAreas::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
// QRectF(topLeft, bottomRight) -> no need to mormalize, QRectF:contains() handles it correct
@@ -429,7 +429,7 @@ bool HandlerFunctionalAreas::inBoundingBoxCheck(const CentralEffectSimulation::A
bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
const QRectF boundingBox(itemView.boundingBoxBottomLeft,
@@ -476,11 +476,11 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
switch (eventType.underlying())
{
case ProjectDataManagement::PdmEventType_def::EnterFunctionalArea:
case ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea:
DEBUG_LOG(m_logger) << "-------------- EnterFunctionalArea itemView =" << itemView.aesItemId;
remaining = 1;
break;
case ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea:
case ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea:
remaining = 0;
DEBUG_LOG(m_logger) << "-------------- LeaveFunctionalArea itemView =" << itemView.aesItemId;
break;
@@ -508,7 +508,7 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
return;
}
if (participantData.participantId() != 0 &&
participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -517,7 +517,7 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
const TrainingAreaBase::TabPosition pos(participantData.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantData.buildingId(),
participantData.roomId());
const int medicTime = fa.medicTime() / 600000; //reserve 2 = medical treatment
@@ -568,12 +568,12 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
{
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantData.participantTypeId());
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Aircraft ||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Aircraft ||
typeClass == ParticipantManagement::TypeClass::Vessel ||
typeClass == ParticipantManagement::TypeClass::Unknown)
{
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId()
<< " has invalid typeClass: " << typeClass
@@ -676,7 +676,7 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
if (inForm)
{
enterLeaveType.eventType = ProjectDataManagement::PdmEventType_def::EnterFunctionalArea;
enterLeaveType.eventType = ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea;
if (itemView.isSupplyTruck)
{
enterLeaveType.isAlreadySupplied = true;
@@ -695,8 +695,8 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
}
else
{
enterLeaveType.eventType = ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea;
if (itemView.isSupplyTruck && lastEnterLeaveType.eventType == ProjectDataManagement::PdmEventType_def::EnterFunctionalArea)
enterLeaveType.eventType = ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea;
if (itemView.isSupplyTruck && lastEnterLeaveType.eventType == ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea)
{
DEBUG_LOG(m_logger) << "sendEnterLeave.stopSupplyTimer";
enterLeaveType.isAlreadySupplied = false;
@@ -710,8 +710,8 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
}
}
if ((inForm && lastEnterLeaveType.eventType != ProjectDataManagement::PdmEventType_def::EnterFunctionalArea)
|| (!inForm && lastEnterLeaveType.eventType == ProjectDataManagement::PdmEventType_def::EnterFunctionalArea))
if ((inForm && lastEnterLeaveType.eventType != ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea)
|| (!inForm && lastEnterLeaveType.eventType == ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea))
{
CentralEffectSimulation::HandlerParticipant::CesParticipantData cesParticipantData = m_handlerParticipant.get()->getParticipantPosition(participantId);
sendParticipantEvent(itemView, cesParticipantData, enterLeaveType.eventType);
@@ -54,7 +54,7 @@ struct ParticipantDistance
struct EnterLeaveType
{
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
bool isAlreadySupplied = false;
};
@@ -76,27 +76,27 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsUnknown:
case AreaEffectSimulation::AesEffectState_def::EsError:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsUnknown:
case AreaEffectSimulation::AesEffectState::EsError:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
removeStates(data);
m_aesItemViews.remove(data.aesItemId());
break;
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState_def::EsPaused:
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPaused:
case AreaEffectSimulation::AesEffectState::EsActivated:
m_aesItemViews.insert(data.aesItemId(), data);
break;
case AreaEffectSimulation::AesEffectState_def::EsCreated:
case AreaEffectSimulation::AesEffectState_def::EsReceived:
case AreaEffectSimulation::AesEffectState::EsCreated:
case AreaEffectSimulation::AesEffectState::EsReceived:
break;
}
}
void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data)
{
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtExplosionArea)
return;
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId();
} // end removeStates
@@ -111,15 +111,15 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
m_explosionSingleState.remove(data.id());
return;
}
// Only handle transitions from prepared to activated
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared
&& data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPrepared
&& data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
{
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
handleExplosion = true;
@@ -336,9 +336,9 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
// check for correct AES type artillery only
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
DEBUG_LOG(m_logger) << "Calculate";
break;
default:
@@ -79,7 +79,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation:
{
INFO_LOG(m_logger) << "HandlerParticipantGasPipe::onAesItemViewChanged";
//
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtGasPipe)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtGasPipe)
return;
@@ -101,7 +101,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation:
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm prevData;
const double impactRadius = 0;
@@ -184,9 +184,9 @@ void HandlerParticipantGasPipe::calculateGasPipeParticipant(const CentralEffectS
if (result)
{
DEBUG_LOG(m_logger) << "sendParticipantEvent";
sendParticipantEvent(gasPipe, participantPosition, ProjectDataManagement::PdmEventType_def::HitGasPipe);
sendParticipantEvent(gasPipe, participantPosition, ProjectDataManagement::PdmEventType::EventType_HitGasPipe);
DEBUG_LOG(m_logger) << "sendParticipantHit";
sendParticipantHit(gasPipe, participantPosition, ProjectDataManagement::PdmEventType_def::HitGasPipe);
sendParticipantHit(gasPipe, participantPosition, ProjectDataManagement::PdmEventType::EventType_HitGasPipe);
}
}
@@ -217,7 +217,7 @@ void HandlerParticipantGasPipe::onParticipantPositionChanged(const CentralEffect
result = insideGasPipeArea(gasPipe.form, partPosGeo);
DEBUG_LOG(m_logger) << "result gasPipe Explosion = " << result<< gasPipe.aesItemId;
if (result)
sendParticipantEvent(gasPipe, partPos, ProjectDataManagement::PdmEventType_def::HitGasPipe);
sendParticipantEvent(gasPipe, partPos, ProjectDataManagement::PdmEventType::EventType_HitGasPipe);
}
} // end of onParticipantPositionChanged()
//-----------------------------------------------------------------------------
@@ -235,10 +235,10 @@ void HandlerParticipantGasPipe::sendParticipantEvent(const CentralEffectSimulati
{
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Unknown)
return;
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
@@ -117,7 +117,7 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
{
DEBUG_LOG(m_logger) << " Send Jamming to TAB and destroy uasId";
//sendCesHitRequest(data.charge().chargeTypeId(), data.participantId(),cesParticipantData);
if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState::CatastrophicKill)
jammedUasIds.append(uasId);
}
else
@@ -193,14 +193,14 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
<< " equipNo = " << equipNo
<< " chargeTypeId =" << chargeTypeId;
if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId == 0 CatastrophicKill)";
return;
}
const TrainingAreaBase::TabPosition pos(participantData.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantData.buildingId(),
participantData.roomId());
@@ -216,7 +216,7 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
remaining, // remainEffectPercent ( no protection outside Building )
pos,
effectTime, // effectTime
ProjectDataManagement::PdmEventType::Jamming, // EventType
ProjectDataManagement::PdmEventType::EventType_Jamming, // EventType
originatorPartyId, // originPartyId
mineId
);
@@ -34,7 +34,7 @@ struct ParticipantDistance
struct EnterLeaveType
{
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
bool isAlreadySupplied = false;
};
@@ -165,9 +165,9 @@ void HandlerMineAreas::onMineTriggeredReply(const Core::FunctionReplyObject &rep
// ///////////////////////////////////
void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
{
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineAreaSingleMines
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineArea
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineCorridor)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtMineAreaSingleMines
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtMineArea
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtMineCorridor)
{
DEBUG_LOG(m_logger) << "AesItemView return";
return;
@@ -183,7 +183,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
return;
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
{
DEBUG_LOG(m_logger) << "AesItemView expired return id=" << data.aesItemId();
aesItemViewRemoved(data.aesItemId());
@@ -212,7 +212,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
return;
}
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{
if (!m_aesItemViews.contains(aesItemId))
{
@@ -237,11 +237,11 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPrepared:
{
break;
}
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
@@ -255,8 +255,8 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
} // case EsActivated
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsExpired:
{
aesItemViewRemoved(aesItemId);
break;
@@ -284,12 +284,12 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Aircraft ||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Aircraft ||
typeClass == ParticipantManagement::TypeClass::Vessel ||
typeClass == ParticipantManagement::TypeClass::Unknown)
{
DEBUG_LOG(m_logger) << "return New Position Participant with id " << participantPosition.participantId()
<< " has invalid typeClass: " << typeClass;
@@ -305,7 +305,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
return;
}
if (participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "New Position CatastrophicKill return";
return;
@@ -346,7 +346,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
// DEBUG_LOG(m_logger) << "minePosGeo lat=" << minePosGeo.lat()
// << " lon=" << minePosGeo.lon()
// << " z=" << minePosGeo.z();
sendParticipantEvent(m_aesItemViews[aesItemId], minePosition, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(m_aesItemViews[aesItemId], minePosition, ProjectDataManagement::PdmEventType::EventType_HitMine);
m_mineLists[participantPosition.participantId()].remove(index);
@@ -379,19 +379,19 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId
<< " remainingTasCode=" << remaining;
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
continue;
if (typeClass == ParticipantManagement::TypeClass_def::Human && remaining > 50)
if (typeClass == ParticipantManagement::TypeClass::Human && remaining > 50)
{
DEBUG_LOG(m_logger) << "ParticipantManagement::TypeClass_def::Human && remaining > 50 continue";
DEBUG_LOG(m_logger) << "ParticipantManagement::TypeClass::Human && remaining > 50 continue";
continue;
}
if (typeClass == ParticipantManagement::TypeClass_def::Human && m_ddsHandler->isAtMine(itemView.chargeStruct))
if (typeClass == ParticipantManagement::TypeClass::Human && m_ddsHandler->isAtMine(itemView.chargeStruct))
continue;
if (itemView.aesTypeId.underlying() == AreaEffectSimulation::AesType_def::AtMineArea)
if (itemView.aesTypeId.underlying() == AreaEffectSimulation::AesType::AtMineArea)
{
// checks whether the participant has been positioned in the minefield or across it.
@@ -435,7 +435,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
void HandlerMineAreas::onNewParticipantState(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos)
{
DEBUG_LOG(m_logger) << "onNewParticipantState ";
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
{
DEBUG_LOG(m_logger) << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId());
if (m_mineLists.contains(participantPos.participantId()))
@@ -485,7 +485,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
}
}
const int mineIdx = (itemView.aesTypeId == AreaEffectSimulation::AesType_def::AtDusSingleMine)
const int mineIdx = (itemView.aesTypeId == AreaEffectSimulation::AesType::AtDusSingleMine)
? itemView.dusMineId : bitFieldIdx + 1; // mineIdx in minefield starts at 1
// Check, if participant is inside danger-radius of the mine
@@ -542,7 +542,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
// DEBUG_LOG(m_logger) << "minePosGeo lat=" << minePosGeo.lat()
// << " lon=" << minePosGeo.lon()
// << " z=" << minePosGeo.z();
sendParticipantEvent(itemView, minePosition, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(itemView, minePosition, ProjectDataManagement::PdmEventType::EventType_HitMine);
// aktuell verarbeitete Mine aus der Liste entfernen.
m_mineLists[participantPosition.participantId()].remove(mineListItemIndex);
}
@@ -671,14 +671,14 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: ";
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
//case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions: Plugin Artillery
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionSingle:
//case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions: Plugin Artillery
// explosion at the position of participant
calculateImpacts(data);
break;
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtMineArea:
// participant run on mine
// => store Mine-State and take into account when a participant runs to one of this mines
m_triggeredImpacts.insert(data.aesItemId(), data);
@@ -693,8 +693,8 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri
void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data)
{
if ((data.aesTypeId() == AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions)
|| (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions))
if ((data.aesTypeId() == AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions)
|| (data.aesTypeId() == AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions))
return;
@@ -743,7 +743,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp
<< " buildingId=" << pPos.buildingId()
<< " insideBuilding=" << pPos.insideBuilding()
<< " positionValid=" << pPos.positionValid;
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
if (pPos.insideBuilding())
continue;
@@ -801,7 +801,7 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
return;
}
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -810,12 +810,12 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
const TrainingAreaBase::TabPosition pos(participantPosition.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantPosition.buildingId(),
participantPosition.roomId());
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
TrainingAreaBase::SendCesHitRequest requestTab(
equipNo, // equipmentNumber
@@ -866,7 +866,7 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView
} // if
if (participantPosition.participantId() != 0 &&
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
return;
@@ -875,10 +875,10 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId(), 0);
const int originatorEquipmentNumber = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
const TrainingAreaBase::TabPosition pos(
participantPosition.pos(), Core::PositionReportingSource_def::Gps, participantPosition.buildingId(),
participantPosition.pos(), Core::PositionReportingSource::Gps, participantPosition.buildingId(),
participantPosition.roomId()
);
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
TrainingAreaBase::SendCesHitRequest requestTab(
equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber,
@@ -903,27 +903,27 @@ void HandlerMineAreas::sendParticipantEventEnterLeave(const CentralEffectSimulat
const ProjectDataManagement::PdmEventType &lastEvent = m_eventStates[itemView.aesItemId][participantPosition.participantId()];
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::EnterMineArea;
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
if (inFormCheckResult)
{
if (lastEvent == ProjectDataManagement::PdmEventType_def::EnterMineArea)
if (lastEvent == ProjectDataManagement::PdmEventType::EventType_EnterMineArea)
return;
else
{
eventType = ProjectDataManagement::PdmEventType_def::EnterMineArea;
m_eventStates[itemView.aesItemId][participantPosition.participantId()] = ProjectDataManagement::PdmEventType_def::EnterMineArea;
eventType = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
m_eventStates[itemView.aesItemId][participantPosition.participantId()] = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
}
}
else
{
if (lastEvent == ProjectDataManagement::PdmEventType_def::LeaveMineArea)
if (lastEvent == ProjectDataManagement::PdmEventType::EventType_LeaveMineArea)
return;
else
{
eventType = ProjectDataManagement::PdmEventType_def::LeaveMineArea;
m_eventStates[itemView.aesItemId][participantPosition.participantId()] = ProjectDataManagement::PdmEventType_def::LeaveMineArea;
eventType = ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
m_eventStates[itemView.aesItemId][participantPosition.participantId()] = ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
}
}
@@ -110,7 +110,7 @@ void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data,
DEBUG_LOG(m_logger)<<" -- onUasChanged : uas.id = "<<data.id() <<" participantId = "<<data.participantId();
// get mission object of corresponding uas participant
// if drone status is manual mode then cancel mission.
if (data.uasState() != ProjectDataManagement::UasState_def::Manual && modType != DataModification::eRemoved)
if (data.uasState() != ProjectDataManagement::UasState::Manual && modType != DataModification::eRemoved)
return;
for (auto planObj : m_missionPlanObjects)
@@ -204,7 +204,7 @@ bool CesMissionPlanHandler::isUasCombatReady(int participantId)
youngestState = si;
}
return (youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady);
return (youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
}
void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement::MissionAction &msa)
@@ -21,7 +21,7 @@ namespace CES_MISSIONPLAN
{
struct EnterLeaveType
{
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
bool isAlreadySupplied = false;
};
@@ -179,12 +179,12 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
const int aesItemId = data.aesItemId();
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
if ((data.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtDangerArea)
&& (data.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtBCContamination)
&& (data.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtNContamination))
if ((data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtDangerArea)
&& (data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtBCContamination)
&& (data.aesTypeId().underlying() != AreaEffectSimulation::AesType::AtNContamination))
return;
if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType_def::AtBCContamination)
if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtBCContamination)
{
const AreaEffectSimulation::BCContamination &bc = m_ddsHandler->dtcAes()->bCContamination(data.aesItemId());
if (!bc.isCentral())
@@ -196,7 +196,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
upperOffset = bCContamination.upperOffset();
lowerOffset = bCContamination.lowerOffset();
}
else if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType_def::AtDangerArea)
else if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtDangerArea)
{
const AreaEffectSimulation::DangerArea &da = m_ddsHandler->dtcAes()->dangerArea(data.aesItemId());
if (!da.isCentral())
@@ -205,7 +205,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
return;
}
}
else if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType_def::AtNContamination)
else if (data.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtNContamination)
{
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(data.aesItemId());
if (!nc.isCentral())
@@ -226,7 +226,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
case AreaEffectSimulation::AesEffectState::EsPrepared:
{
const auto &aesItemViewUtm = CentralEffectSimulation::AesItemViewUtm::create(data,
m_aesItemViews[data.aesItemId()],
@@ -239,7 +239,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
}
break;
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm aesItemViewUtm =
@@ -262,8 +262,8 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
switch (data.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
case AreaEffectSimulation::AesType::AtNContamination:
// for each participant:
// Bounding-Box Check,
// form-Check
@@ -273,7 +273,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
// DEBUG_LOG(m_logger) << "insert AtBCContamination oder AtNContamination AesItemView id: " << aesItemId
// << ", type: " << data.aesTypeId();
break;
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType::AtDangerArea:
calculateDangerArea(aesItemViewUtm);
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
DEBUG_LOG(m_logger) << "insert AtDangerArea AesItemView id: " << aesItemId
@@ -284,8 +284,8 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
} // switch aesTypeId
break;
} // case EsActivated
case AreaEffectSimulation::AesEffectState_def::EsRemoved:
case AreaEffectSimulation::AesEffectState_def::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsExpired:
{
aesItemViewRemoved(aesItemId);
break;
@@ -314,10 +314,10 @@ void HandlerNBC::onBCContaminationChanged(const AreaEffectSimulation::BCContamin
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
if (m_ddsHandler->volatilityTypeId(data.chargeStruct()) == ProjectDataManagement::VolatilityType_def::Resident)
if (m_ddsHandler->volatilityTypeId(data.chargeStruct()) == ProjectDataManagement::VolatilityType::Resident)
{
ref.radials = {data.impactRadius()};
ref.center = CentralEffectSimulation::geographic2Utm(data.impactPosition(), &ref.zone);
@@ -345,7 +345,7 @@ void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContaminat
case DataModification::eModified:
switch (data.effectStateId().underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm &ref = m_aesItemViews[data.id()];
ref.radials = {data.impactRadius(),
@@ -440,7 +440,7 @@ void HandlerNBC::deleteDangerArea(const int aesItemId)
const auto partPosMap = m_handlerParticipant->positions();
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
{
sendParticipantEvent(aesItemId, participantPos, ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
sendParticipantEvent(aesItemId, participantPos, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId();
}// for all Participants
} // deleteDangerArea
@@ -473,7 +473,7 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
bool aesIsAvailable = m_ddsHandler->dtcAes()->aesItemViewFromEntityId(m_isInContaminatedRoom.value(participantData.participantId()),AreaEffectSimulation::AesType::AtUnknown, aesItemView );
if (aesIsAvailable
&& (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated))
&& (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
{
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
m_isInContaminatedRoom.remove(participantData.participantId());
@@ -512,9 +512,9 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
}
switch (itemView.aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType::AtBCContamination:
case AreaEffectSimulation::AesType::AtNContamination:
case AreaEffectSimulation::AesType::AtDangerArea:
inFormCheck(itemView, participantData);
break;
default:
@@ -569,7 +569,7 @@ void HandlerNBC::onRestoreRadioReadinessChanged(const int participantId)
bool HandlerNBC::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
// QRectF(topLeft, bottomRight) -> no need to mormalize, QRectF:contains() handles it correct
@@ -616,7 +616,7 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), zone);
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
{
// since buildings can only be contaminated by resident bccontaminations
// effectType is EffectType::BCContaminationEnterResident if isIndoor
@@ -626,16 +626,16 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
sendEffectTypeEvent(aesItemId, participantData, effectType);
break;
}
case AreaEffectSimulation::AesType_def::AtDangerArea:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType_def::EnterDangerArea);
case AreaEffectSimulation::AesType::AtDangerArea:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType::EventType_EnterDangerArea);
break;
case AreaEffectSimulation::AesType_def::AtNContamination:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType_def::EnterNuclear);
case AreaEffectSimulation::AesType::AtNContamination:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
sendEffectTypeEvent(aesItemId, participantData, effectTypeForNContaminationArea(m_aesItemViews.value(aesItemId), participantPosUtmPoint, participantData.sampleTime(), participantData.insideBuilding()));
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtMineArea:
default:
INFO_LOG(m_logger) << "sendEvent Unhandled AES-Type" << aesTypeId;
break;
@@ -646,7 +646,7 @@ void HandlerNBC::sendLeaveEvent(const int aesItemId, const CentralEffectSimulati
{
AreaEffectSimulation::AesItemView aesItemView;
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(aesItemId, AreaEffectSimulation::AesType_def::AtUnknown, aesItemView);
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(aesItemId, AreaEffectSimulation::AesType::AtUnknown, aesItemView);
DEBUG_LOG(m_logger) << "sendLeaveEvent"
<< " aesId=" << aesItemId
@@ -656,21 +656,21 @@ void HandlerNBC::sendLeaveEvent(const int aesItemId, const CentralEffectSimulati
switch (aesItemView.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
sendEffectTypeEvent(aesItemId, participantData, EffectType::BCContaminationLeave);
break;
case AreaEffectSimulation::AesType_def::AtDangerArea:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
case AreaEffectSimulation::AesType::AtDangerArea:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
break;
case AreaEffectSimulation::AesType_def::AtMineArea:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType_def::LeaveMineArea);
case AreaEffectSimulation::AesType::AtMineArea:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType::EventType_LeaveMineArea);
break;
case AreaEffectSimulation::AesType_def::AtNContamination:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType_def::LeaveNuclear);
case AreaEffectSimulation::AesType::AtNContamination:
sendParticipantEvent(aesItemId, participantData, ProjectDataManagement::PdmEventType::EventType_LeaveNuclear);
sendEffectTypeEvent(aesItemId, participantData, EffectType::NContaminationLeave);
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
default:
break;
} // end switch
@@ -681,7 +681,7 @@ void HandlerNBC::sendLeaveEvent(const int aesItemId, const CentralEffectSimulati
bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &itemView,
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
{
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState::EsActivated)
return false;
const QRectF boundingBoxImpact(itemView.boundingBoxBottomLeft,
@@ -715,7 +715,7 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
<< " roomFound=" << roomFound
<< " offsetZ=" << structureElement.relPosition().offsetZ();
if ( (itemView.aesTypeId.underlying() != AreaEffectSimulation::AesType_def::AtNContamination)
if ( (itemView.aesTypeId.underlying() != AreaEffectSimulation::AesType::AtNContamination)
&& itemView.offsetIsSet
&& ( ( structureElement.relPosition().offsetZ() + 1.5 > itemView.upperOffset )
|| ( structureElement.relPosition().offsetZ() + 1.5 < itemView.lowerOffset)))
@@ -779,12 +779,12 @@ void HandlerNBC::sendCesHitRequest(const CentralEffectSimulation::AesItemViewUtm
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(itemView.aesItemId, 0);
const TrainingAreaBase::TabPosition pos(participantData.pos(),
Core::PositionReportingSource_def::Gps, // irrelevant
Core::PositionReportingSource::Gps, // irrelevant
participantData.buildingId(),
participantData.roomId());
const int originatorEquipNo = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
TrainingAreaBase::SendCesHitRequest requestTab(
equipNo, // equipmentNumber
participantData.participantId(), // participantId
@@ -878,10 +878,10 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
int32_t originatorParticipantId = m_aesItemId2partIdMap.value(aesItemId, 0);
const int originatorEquipmentNumber = m_ddsHandler->participantId2EquipNo(originatorParticipantId);
const TrainingAreaBase::TabPosition pos(
participantData.pos(), Core::PositionReportingSource_def::Gps, participantData.buildingId(),
participantData.pos(), Core::PositionReportingSource::Gps, participantData.buildingId(),
participantData.roomId()
);
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::Unknown;
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_Unknown;
TrainingAreaBase::SendCesHitRequest requestTab(
equipmentNumber, participantData.participantId(), legacyChargeTypeId, aesItemId, originatorEquipmentNumber,
remaining, pos, effectTime, eventType, partyId, mineFieldBitIndex
@@ -903,12 +903,12 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
{
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantData.participantTypeId());
// can happen since the positions are collected for all participants (no check if it is a SupportEntity or similar)
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Aircraft ||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Aircraft ||
typeClass == ParticipantManagement::TypeClass::Vessel ||
typeClass == ParticipantManagement::TypeClass::Unknown)
{
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId()
<< " has invalid typeClass: " << typeClass
@@ -931,12 +931,12 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
}
// send hit events only with central AES Simulation
if (eventType == ProjectDataManagement::PdmEventType_def::HitB
|| eventType == ProjectDataManagement::PdmEventType_def::HitC
|| eventType == ProjectDataManagement::PdmEventType_def::Hit
|| eventType == ProjectDataManagement::PdmEventType_def::HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType_def::HitMine
|| eventType == ProjectDataManagement::PdmEventType_def::HitN)
if (eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitC
|| eventType == ProjectDataManagement::PdmEventType::EventType_Hit
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN)
{
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantData.participantId();
return;
@@ -963,17 +963,17 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
pe.aesItemId(aesItemId);
pe.partyId(participantData.partyId());
if (eventType == ProjectDataManagement::PdmEventType_def::BCContamination)
if (eventType == ProjectDataManagement::PdmEventType::EventType_BCContamination)
{
const AreaEffectSimulation::BCContamination &bc = m_ddsHandler->dtcAes()->bCContamination(aesItemId);
pe.aesName(bc.name());
}
else if (eventType == ProjectDataManagement::PdmEventType_def::DangerArea)
else if (eventType == ProjectDataManagement::PdmEventType::EventType_DangerArea)
{
const AreaEffectSimulation::DangerArea &da = m_ddsHandler->dtcAes()->dangerArea(aesItemId);
pe.aesName(da.name());
}
else if (eventType == ProjectDataManagement::PdmEventType_def::NContamination)
else if (eventType == ProjectDataManagement::PdmEventType::EventType_NContamination)
{
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(aesItemId);
pe.aesName(nc.name());
@@ -988,14 +988,14 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
// Criterion for friendly Fire:
if (aesItem.partyId() != -1
&& ((eventType == ProjectDataManagement::PdmEventType_def::EnterMineArea
|| eventType == ProjectDataManagement::PdmEventType_def::EnterNuclear
|| eventType == ProjectDataManagement::PdmEventType_def::HitB
|| eventType == ProjectDataManagement::PdmEventType_def::HitC
|| eventType == ProjectDataManagement::PdmEventType_def::Hit
|| eventType == ProjectDataManagement::PdmEventType_def::HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType_def::HitMine
|| eventType == ProjectDataManagement::PdmEventType_def::HitN)
&& ((eventType == ProjectDataManagement::PdmEventType::EventType_EnterMineArea
|| eventType == ProjectDataManagement::PdmEventType::EventType_EnterNuclear
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitB
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitC
|| eventType == ProjectDataManagement::PdmEventType::EventType_Hit
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitMine
|| eventType == ProjectDataManagement::PdmEventType::EventType_HitN)
&& aesItem.partyId() == participantData.partyId()))
pe.friendlyFire(true);
else
@@ -1060,26 +1060,26 @@ bool HandlerNBC::eventMustBeSend(int aesItemId,
// - remove opposite events (e.g remove Enter event when we leave the area)
switch (eventType.underlying())
{
case ProjectDataManagement::PdmEventType_def::EnterDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveDangerArea);
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterDangerArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterDangerArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveMineArea);
case ProjectDataManagement::PdmEventType::EventType_EnterMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveMineArea);
break;
case ProjectDataManagement::PdmEventType_def::LeaveMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterMineArea);
case ProjectDataManagement::PdmEventType::EventType_LeaveMineArea:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterMineArea);
break;
case ProjectDataManagement::PdmEventType_def::EnterNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::LeaveNuclear);
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_LeaveNuclear);
break;
case ProjectDataManagement::PdmEventType_def::LeaveNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType_def::EnterNuclear);
case ProjectDataManagement::PdmEventType::EventType_LeaveNuclear:
activeEvents.remove(ProjectDataManagement::PdmEventType::EventType_EnterNuclear);
break;
case ProjectDataManagement::PdmEventType_def::EnterFunctionalArea:
case ProjectDataManagement::PdmEventType_def::LeaveFunctionalArea:
case ProjectDataManagement::PdmEventType::EventType_EnterFunctionalArea:
case ProjectDataManagement::PdmEventType::EventType_LeaveFunctionalArea:
default:
break;
}
@@ -1200,25 +1200,25 @@ ProjectDataManagement::PdmEventType HandlerNBC::leaveEventTypeForAesType(AreaEff
{
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtDangerArea:
return ProjectDataManagement::PdmEventType::LeaveDangerArea;
case AreaEffectSimulation::AesType_def::AtMineArea:
return ProjectDataManagement::PdmEventType::LeaveMineArea;
case AreaEffectSimulation::AesType_def::AtNContamination:
return ProjectDataManagement::PdmEventType::LeaveNuclear;
case AreaEffectSimulation::AesType::AtDangerArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveDangerArea;
case AreaEffectSimulation::AesType::AtMineArea:
return ProjectDataManagement::PdmEventType::EventType_LeaveMineArea;
case AreaEffectSimulation::AesType::AtNContamination:
return ProjectDataManagement::PdmEventType::EventType_LeaveNuclear;
default:
break;
}
return ProjectDataManagement::PdmEventType::Unknown;
return ProjectDataManagement::PdmEventType::EventType_Unknown;
}
EffectType HandlerNBC::leaveEffectTypeForAesType(AreaEffectSimulation::AesType aesTypeId)
{
switch (aesTypeId.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
return EffectType::BCContaminationLeave;
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
return EffectType::NContaminationLeave;
default:
break;
@@ -1329,7 +1329,7 @@ void HandlerNBC::aesItemViewRemoved(int aesItemId)
}
}
const auto eventTypeLeave = leaveEventTypeForAesType(aiv.aesTypeId);
if (eventTypeLeave != ProjectDataManagement::PdmEventType::Unknown)
if (eventTypeLeave != ProjectDataManagement::PdmEventType::EventType_Unknown)
{
DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave;
auto it = m_eventStates.find(aesItemId);
@@ -62,7 +62,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
TrainingAreaBase::SendParticipantBlockedAreaRequest pba;
pba.equipmentNumber(m_ddsHandler->participantId2EquipNo(partPos.participantId()));
pba.participantId(partPos.participantId());
// if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
// if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
// m_blockedAreas.remove(participantId);
if (!partPos.insideBuilding())
@@ -71,7 +71,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
if (it != m_blockedAreas.end())
{
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Leave);
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Leave);
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
m_blockedAreas.erase(it);
}
@@ -84,7 +84,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
(m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId()) < damagePercentBlockedAreas))
{
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Leave);
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Leave);
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
m_blockedAreas.remove(participantId);
return;
@@ -106,7 +106,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
&& !m_blockedAreas.contains(participantId))
{
DEBUG_LOG(m_logger) << "Send Enter Blocked Area to Participant:" << participantId;
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Enter);
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Enter);
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
m_blockedAreas.insert(participantId, partPos.roomId());
}
@@ -128,7 +128,7 @@ void HandlerBlockedAreas::onBuildingStateChanged(const int32_t buildingId)
TrainingAreaBase::SendParticipantBlockedAreaRequest pba;
pba.equipmentNumber(m_ddsHandler->participantId2EquipNo(participantId));
pba.participantId(participantId);
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Leave);
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode::Leave);
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
m_blockedAreas.remove(participantId);
}
@@ -181,7 +181,7 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
const int participantId = participantPos.participantId();
if (participantPos.roomId() != roomState.id())
continue;
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
continue;
const int equipNo = m_ddsHandler->participantId2EquipNo(participantId);
if (equipNo <= 0)
@@ -219,7 +219,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
CentralEffectSimulation::HandlerParticipant::CesParticipantData participantPos = participantsMap.value(participantId);
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType_def::HitBuilding;
const ProjectDataManagement::PdmEventType eventType = ProjectDataManagement::PdmEventType::EventType_HitBuilding;
AreaEffectSimulation::AesItem aesItem;
@@ -139,9 +139,9 @@ void HandlerTargetAreas::onParticipantChanged(const ParticipantManagement::Parti
// No OC in CES
ParticipantManagement::TypeClass typeClass = typeClassFromTypeId(data.typeId());
if (typeClass == ParticipantManagement::TypeClass_def::SupportEntity
|| typeClass == ParticipantManagement::TypeClass_def::SupportUnit
|| typeClass == ParticipantManagement::TypeClass_def::Unit)
if (typeClass == ParticipantManagement::TypeClass::SupportEntity
|| typeClass == ParticipantManagement::TypeClass::SupportUnit
|| typeClass == ParticipantManagement::TypeClass::Unit)
return;
m_participantData[data.id()] = data;
@@ -153,7 +153,7 @@ void HandlerTargetAreas::onParticipantChanged(const ParticipantManagement::Parti
<< " id=" << data.id()
<< " typeId=" << data.typeId()
<< " designator=" << data.designator();
if (typeClass == ParticipantManagement::TypeClass_def::Target)
if (typeClass == ParticipantManagement::TypeClass::Target)
DEBUG_LOG(m_logger) << "Typeclass = Target";
}
@@ -423,7 +423,7 @@ void HandlerTargetAreas::sendRequestsToTab(int participantId,
int32_t effectPercentFt = effectPercent;
rti::core::int64 effectTimeFt = m_ddsHandler->currentPartitionTime();
TrainingAreaBase::ControlDataCode controlCodeFt = TrainingAreaBase::ControlDataCode_def::Flashing;
TrainingAreaBase::ControlDataCode controlCodeFt = TrainingAreaBase::ControlDataCode::Flashing;
std::vector< uint8_t > controlDataFt;
@@ -471,19 +471,19 @@ void HandlerTargetAreas::on_preWarningIntervalFinished(int participantId, int ta
switch (shootbackTarget.targetInformation.prewarningEffect().underlying())
{
case ProjectDataManagement::VulnerabilityState_def::NoChange:
case ProjectDataManagement::VulnerabilityState::NoChange:
countBlink = 1;
effectPercent = 0;
break;
case ProjectDataManagement::VulnerabilityState_def::MobilityKill:
case ProjectDataManagement::VulnerabilityState::MobilityKill:
effectPercent = 30;
countBlink = 2;
break;
case ProjectDataManagement::VulnerabilityState_def::NearMiss:
case ProjectDataManagement::VulnerabilityState::NearMiss:
countBlink = 3;
effectPercent = 60;
break;
case ProjectDataManagement::VulnerabilityState_def::CatastrophicKill:
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
countBlink = 4;
effectPercent = 100;
break;
@@ -520,11 +520,11 @@ void HandlerTargetAreas::on_TimeToEffectFinished(int participantId, int targetPa
switch (shootbackTarget.targetInformation.takedownEffect().underlying())
{
case ProjectDataManagement::VulnerabilityState_def::MobilityKill:
case ProjectDataManagement::VulnerabilityState::MobilityKill:
effectPercent = 50;
countBlink = 5;
break;
case ProjectDataManagement::VulnerabilityState_def::CatastrophicKill:
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
countBlink = 6;
effectPercent = 100;
break;
@@ -42,7 +42,7 @@ public:
struct ParticipantPosition : public ParticipantManagement::ParticipantPosition
{
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::CombatReady;
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::CombatReady;
Core::GeoPosition lastGeoPosition;
bool positionValid = false;
@@ -115,9 +115,9 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
// prevData.aesItemId = 0;
// const CentralEffectSimulation::AesItemViewUtm boobyTrapUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius);
// if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrap)
// if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrap)
// m_boobyTrapItems.insert(data.aesItemId(), boobyTrapUtm);
// if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
// if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
// m_boobyTrapItemsSecondary.insert(data.aesItemId(), boobyTrapUtm);
// DEBUG_LOG(m_logger) << "Check each participant"
// << " aesTypeId=" << data.aesTypeId();
@@ -137,7 +137,7 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
continue;
}
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
{
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
continue;
@@ -165,7 +165,7 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|| modType == DataModification::eRemoved)
{
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
{
m_boobyTraps.remove(data.id());
m_boobyTrapItems.remove(data.id());
@@ -179,8 +179,8 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
}
//
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBoobyTrap
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtBoobyTrap
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
return;
const int aesItemId = data.aesItemId();
@@ -196,16 +196,16 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm prevData;
const double impactRadius = 0;
prevData.aesItemId = 0;
const CentralEffectSimulation::AesItemViewUtm boobyTrapUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius);
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrap)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrap)
m_boobyTrapItems.insert(data.aesItemId(), boobyTrapUtm);
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrapSecondary)
m_boobyTrapItemsSecondary.insert(data.aesItemId(), boobyTrapUtm);
DEBUG_LOG(m_logger) << "Check each participant"
<< " aesTypeId=" << data.aesTypeId();
@@ -224,14 +224,14 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
// DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
// continue;
// }
// if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
// if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
// {
// DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
// continue;
// }
// // Nur Positionsmeldungen, die neuer sind als die Mine koennen sie ausloesen!
// if ((participantPos.sampleTime() < data.sampleTime())
// && (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrap))
// && (data.aesTypeId() == AreaEffectSimulation::AesType::AtBoobyTrap))
// {
// DEBUG_LOG(m_logger) << " the time of the participant is older than the BoobyTrap participantId=" << participantPos.participantId()
// << " participantPos.sampleTime()=" << participantPos.sampleTime()
@@ -282,7 +282,7 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantsSecondary(int ae
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
continue;
}
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
{
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
continue;
@@ -373,9 +373,9 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantSecondary(const C
if (result)
{
DEBUG_LOG(m_logger) << "sendParticipantEvent";
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
DEBUG_LOG(m_logger) << "sendParticipantHit";
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
}
} // calculateBoobyTrapParticipantSecondary
@@ -472,9 +472,9 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
DEBUG_LOG(m_logger) << "sendFtcBoobyTrapTrigger id=" << aesItemView.aesItemId;
sendFtcBoobyTrapTrigger(aesItemView.aesItemId);
DEBUG_LOG(m_logger) << "sendParticipantEvent";
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
DEBUG_LOG(m_logger) << "sendParticipantHit";
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
//calculateBoobyTrapParticipantsSecondary(aesItemView.aesItemId, participantPos.participantId() );
}
return true;
@@ -490,7 +490,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
<< " lon=" << partPos.pos().lon()
<< " Anzahl BoobyTraps=" << m_boobyTrapItems.size();
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
{
DEBUG_LOG(m_logger) << "Not handle position: participant has vulnerability state CatastrophicKill";
return;
@@ -519,7 +519,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
const bool result = enteredOrCrossedArea(boobyTrap.form, posStepPoly);
DEBUG_LOG(m_logger) << "result BoobyTrap Explosion = " << result;
if (result)
sendParticipantEvent(boobyTrap, partPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(boobyTrap, partPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
}
} // end of onParticipantPositionChanged()
//-----------------------------------------------------------------------------
@@ -549,10 +549,10 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
m_triggeredMineParticipant.insert(boobyTrapItem.aesItemId, participantPosition.participantId());
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Unknown)
return;
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
@@ -108,8 +108,8 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
}
//
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtOffRouteMine
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtOffRouteMine
&& data.aesTypeId() != AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
return;
const int aesItemId = data.aesItemId();
@@ -125,16 +125,16 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
switch (effectState.underlying())
{
case AreaEffectSimulation::AesEffectState_def::EsActivated:
case AreaEffectSimulation::AesEffectState::EsActivated:
{
CentralEffectSimulation::AesItemViewUtm prevData;
const double impactRadius = 0;
prevData.aesItemId = 0;
const CentralEffectSimulation::AesItemViewUtm aesItemViewUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius);
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMine)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMine)
m_offRouteMineItems.insert(data.aesItemId(), aesItemViewUtm);
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
if (data.aesTypeId() == AreaEffectSimulation::AesType::AtOffRouteMineSecondary)
m_offRouteMineItemsSecondary.insert(data.aesItemId(), aesItemViewUtm);
// DEBUG_LOG(m_logger) << "Check each participant";
// // Check each participant
@@ -151,7 +151,7 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
// DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
// continue;
// }
// if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
// if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
// {
// DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
// continue;
@@ -271,9 +271,9 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantSecondary(c
if (result)
{
DEBUG_LOG(m_logger) << "sendParticipantEvent";
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine); //69
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine); //69
DEBUG_LOG(m_logger) << "sendParticipantHit";
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine); // 49
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine); // 49
}
} // calculateOffRouteMineParticipantSecondary
@@ -306,9 +306,9 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipant(const Cent
DEBUG_LOG(m_logger) << "sendFtcOffRouteMineTrigger id=" << aesItemView.aesItemId;
sendFtcOffRouteMineTrigger(aesItemView.aesItemId);
DEBUG_LOG(m_logger) << "sendParticipantEvent";
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
DEBUG_LOG(m_logger) << "sendParticipantHit";
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
calculateOffRouteMineParticipantsSecondary(aesItemView.aesItemId);
}
} // calculateOffRouteMineParticipant
@@ -326,15 +326,15 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
<< " lon=" << partPos.pos().lon()
<< " Anzahl OffRouteMines=" << m_offRouteMineItems.size();
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
{
DEBUG_LOG(m_logger) << "Not handle position: participant has vulnerability state CatastrophicKill";
return;
}
if (typeClass != ParticipantManagement::TypeClass_def::GroundVehicle
&& typeClass != ParticipantManagement::TypeClass_def::WeaponSystem
&& typeClass != ParticipantManagement::TypeClass_def::VehicleWithGear)
if (typeClass != ParticipantManagement::TypeClass::GroundVehicle
&& typeClass != ParticipantManagement::TypeClass::WeaponSystem
&& typeClass != ParticipantManagement::TypeClass::VehicleWithGear)
{
INFO_LOG(m_logger) << "Not handle position: No type vehicle ";
return;
@@ -377,7 +377,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
const bool result = enteredOrCrossedArea(offRouteMine.form, posStepPoly);
DEBUG_LOG(m_logger) << "result offRouteMine Explosion = " << result;
if (result)
sendParticipantEvent(offRouteMine, partPos, ProjectDataManagement::PdmEventType_def::HitMine);
sendParticipantEvent(offRouteMine, partPos, ProjectDataManagement::PdmEventType::EventType_HitMine);
}
} // end of onParticipantPositionChanged()
//-----------------------------------------------------------------------------
@@ -395,10 +395,10 @@ void HandlerParticipantOffRouteMine::sendParticipantEvent(const CentralEffectSim
{
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
if (typeClass == ParticipantManagement::TypeClass_def::Unit ||
typeClass == ParticipantManagement::TypeClass_def::SupportUnit ||
typeClass == ParticipantManagement::TypeClass_def::SupportEntity ||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::Unit ||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
typeClass == ParticipantManagement::TypeClass::SupportEntity ||
typeClass == ParticipantManagement::TypeClass::Unknown)
return;
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
@@ -21,23 +21,23 @@ AesItemViewUtm AesItemViewUtm::create(const AreaEffectSimulation::AesItemView &a
double lowerOffset)
{
if (prevData.aesItemId != 0)
Q_ASSERT(prevData.aesItemId == aiv.aesItemId());
if (aiv.aesTypeId() == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
Q_ASSERT(prevData.aesItemId == aiv.aesItemId);
if (aiv.aesTypeId == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
Q_ASSERT(false);
AesItemViewUtm ret = prevData;
//ret.zone;
ret.aesItemId = aiv.aesItemId();
ret.chargeStruct = aiv.chargeStruct();
ret.aesItemId = aiv.aesItemId;
ret.chargeStruct = aiv.chargeStruct;
ret.partyId = aiv.partyId.is_set() ? aiv.partyId.get() : -1;
ret.dusMineId = -1;
ret.isSupplyTruck = isSupplyTruck;
ret.aesTypeId = aiv.aesTypeId();
ret.effectStateId = aiv.effectStateId();
ret.effectStart = aiv.effectStart();
ret.boundingBoxBottomLeft = CentralEffectSimulation::geographic2Utm(aiv.boundingBoxBottomLeft(), &ret.zone);
ret.aesTypeId = aiv.aesTypeId;
ret.effectStateId = aiv.effectStateId;
ret.effectStart = aiv.effectStart;
ret.boundingBoxBottomLeft = CentralEffectSimulation::geographic2Utm(aiv.boundingBoxBottomLeft, &ret.zone);
ret.boundingBoxBottomLeft.setX(ret.boundingBoxBottomLeft.x() - impactRadius);
ret.boundingBoxTopRight = CentralEffectSimulation::geographic2Utm(aiv.boundingBoxTopRight(), ret.zone);
ret.boundingBoxTopRight = CentralEffectSimulation::geographic2Utm(aiv.boundingBoxTopRight, ret.zone);
ret.boundingBoxTopRight.setX(ret.boundingBoxTopRight.x() + impactRadius);
if ( ret.boundingBoxBottomLeft.y() > ret.boundingBoxTopRight.y())
{
@@ -61,9 +61,9 @@ AesItemViewUtm AesItemViewUtm::create(const AreaEffectSimulation::AesItemView &a
ret.form.clear();
ret.formGeo.clear();
ret.form.reserve(aiv.form().size());
ret.formGeo.reserve(aiv.form().size());
for (const Core::GeoPosition2D &pointGeo : aiv.form())
ret.form.reserve(aiv.form.size());
ret.formGeo.reserve(aiv.form.size());
for (const Core::GeoPosition2D &pointGeo : aiv.form)
{
ret.form.push_back(CentralEffectSimulation::geographic2Utm(pointGeo, ret.zone));
ret.formGeo.push_back(pointGeo);
@@ -32,7 +32,7 @@ struct SVCCESDDSCOMMON_EXPORT AesItemViewUtm
bool offsetIsSet = false;
double upperOffset = -1.0;
double lowerOffset = -1.0;
AreaEffectSimulation::AesType aesTypeId = AreaEffectSimulation::AesType_def::AtUnknown;
AreaEffectSimulation::AesType aesTypeId = AreaEffectSimulation::AesType::AtUnknown;
AreaEffectSimulation::AesEffectState effectStateId = AreaEffectSimulation::AesEffectState::EsExpired;
qint64 effectStart = 0;
QPointF boundingBoxBottomLeft;
@@ -208,7 +208,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
qint64 DdsHandler::currentPartitionTime() const
{
return m_dtcCore->partitionTime().timeStamp();
return m_dtcCore->partitionTime().timeStamp;
}
int DdsHandler::participantId2EquipNo(const int participantId) const
@@ -227,116 +227,116 @@ int DdsHandler::equipNo2ParticipantId(const int equipmentNumber) const
// ///////////////////////////////////
double DdsHandler::chargeTypeRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const double radius = m_dtcPdm->impactRadius(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const double radius = m_dtcPdm->impactRadius(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "chargeTypeRadius = " << radius;
return radius;
} // getRadiusOfMunition
double DdsHandler::chargeHeight(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const double height = m_dtcPdm->height(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const double height = m_dtcPdm->height(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "chargeHeight = " << height;
return height;
}
bool DdsHandler::isSmartChargeType(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const bool isSmart = m_dtcPdm->isSmart(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const bool isSmart = m_dtcPdm->isSmart(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "isSmartChargeType = " << isSmart;
return isSmart;
} // isSmartType
bool DdsHandler::isSmoke(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const bool isSmoke = m_dtcPdm->isSmoke(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const bool isSmoke = m_dtcPdm->isSmoke(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "isSmoke = " << isSmoke;
return isSmoke;
} // isSmoke
bool DdsHandler::isLaserGuidable(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const bool isLaserGuidable = m_dtcPdm->isLaserGuidable(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const bool isLaserGuidable = m_dtcPdm->isLaserGuidable(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "isLaserGuidable = " << isLaserGuidable;
return isLaserGuidable;
}
bool DdsHandler::isJamming(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const bool isJamming = m_dtcPdm->isJamming(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const bool isJamming = m_dtcPdm->isJamming(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "isJamming = " << isJamming;
return isJamming;
}
bool DdsHandler::isDus(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const bool isDus = m_dtcPdm->mineClass(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId())== AreaEffectSimulation::MineClass::Concrete;
const bool isDus = m_dtcPdm->mineClass(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId)== AreaEffectSimulation::MineClass::Concrete;
DEBUG_LOG(m_logger) << "isDus = " << isDus;
return isDus;
}
bool DdsHandler::isAtMine(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const bool isAtMine = m_dtcPdm->isAtMine(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const bool isAtMine = m_dtcPdm->isAtMine(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "isAtMine = " << isAtMine;
return isAtMine;
}
ProjectDataManagement::VolatilityType DdsHandler::volatilityTypeId(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const ProjectDataManagement::VolatilityType volatilityType= m_dtcPdm->volatilityTypeId(chargeStruct.chargeTypeId(),
chargeStruct.igniterTypeId(),
chargeStruct.igniterFunctionId());
const ProjectDataManagement::VolatilityType volatilityType= m_dtcPdm->volatilityTypeId(chargeStruct.chargeTypeId,
chargeStruct.igniterTypeId,
chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "volatilityType=" << volatilityType;
return volatilityType;
}
int DdsHandler::remainingTasCode(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->remainingTasCode(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->remainingTasCode(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
int DdsHandler::secondaryRemainingTasCode(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->secondaryRemainingTasCode(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->secondaryRemainingTasCode(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
int DdsHandler::getLethalRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->getLethalRadius(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->getLethalRadius(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
int DdsHandler::getNonLethalRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->getNonLethalRadius(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->getNonLethalRadius(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
int DdsHandler::getHazardDistance(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->hazardDistance(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->hazardDistance(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
ProjectDataManagement::IgniterFunctionBase DdsHandler::getIgniterFunctionBaseFromChargeTypeId(int chargeTypeId, int igniterTypeId, int igniterFunctionId)
{
return m_dtcPdm->getChargeTypeIgniterTypeIgniterFunction(chargeTypeId, igniterTypeId, igniterFunctionId).igniterFunctionBaseId();
return m_dtcPdm->getChargeTypeIgniterTypeIgniterFunction(chargeTypeId, igniterTypeId, igniterFunctionId).igniterFunctionBaseId;
}
QVector<ProjectDataManagement::CasEffect> DdsHandler::getCasEffects(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
return m_dtcPdm->casEffects(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->casEffects(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
int32_t DdsHandler::getLegacyIdFromChargeTypeId(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
int32_t legacyId = 0;
legacyId = m_dtcPdm->getChargeTypeIgniterTypeIgniterFunction(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId()).chargeLegacyId();
legacyId = m_dtcPdm->getChargeTypeIgniterTypeIgniterFunction(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId).chargeLegacyId;
DEBUG_LOG(m_logger) << "legacyId = " << legacyId;
return legacyId;
}
int DdsHandler::searchRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct)
{
const int searchRadius = m_dtcPdm->searchRadius(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
const int searchRadius = m_dtcPdm->searchRadius(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
DEBUG_LOG(m_logger) << "searchRadius = " << searchRadius;
return searchRadius;
} // searchRadius
@@ -66,53 +66,53 @@ bool HandlerBuildingData::init()
// ///////////////////////////////////
void HandlerBuildingData::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType)
{
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id();
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id;
if (modType == DataModification::eRemoved
|| !m_ddsHandler->dtcIsm()->isElementAssignedToExercise(data, m_ddsHandler->getExerciseId()))
{
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id() << " remove";
m_mainStructureElements.remove(data.id());
m_footprints.remove(data.id());
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id << " remove";
m_mainStructureElements.remove(data.id);
m_footprints.remove(data.id);
return;
}
m_mainStructureElements.insert(data.id(), data);
m_mainStructureElements.insert(data.id, data);
DEBUG_LOG(m_logger) << "Got MainStructureElement: " << data;
for (const InfrastructureManagement::StructureElement &ele : qAsConst(data.elements()))
for (const InfrastructureManagement::StructureElement &ele : qAsConst(data.elements))
{
if (ele.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Room)
if (ele.structureElementTypeId == InfrastructureManagement::StructureElementType::Room)
{
const std::vector<int32_t> &path = ele.path();
const std::vector<int32_t> &path = ele.path;
if (path.size() < 3)
continue;
const int structureElementId = path.at(0);
const int floorId = path.at(1);
const int roomId = path.at(2);
DEBUG_LOG(m_logger) << "ele.id=" << ele.id() << " name =" << ele.name()
<< " ele.StructureElementType=" << ele.structureElementTypeId()
DEBUG_LOG(m_logger) << "ele.id=" << ele.id << " name =" << ele.name
<< " ele.StructureElementType=" << ele.structureElementTypeId
<< " buildingId = " << structureElementId
<< " floorId =" << floorId
<< " roomId = " << roomId;
m_floorRoom.insert(roomId, floorId);
m_structureElementToFloor.insert(floorId, structureElementId);
m_buildingFloor.insert(floorId, data.id());
m_buildingFloor.insert(floorId, data.id);
}
// get assetPositions
{
if (ele.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
if (ele.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
{
DEBUG_LOG(m_logger) << "EGCU id=" << ele.id()
<< " displayName=" << ele.displayName()
<< " name=" << ele.name()
<< " type=" << ele.mountingPointTypeId();
DEBUG_LOG(m_logger) << "EGCU id=" << ele.id
<< " displayName=" << ele.displayName
<< " name=" << ele.name
<< " type=" << ele.mountingPointTypeId;
AssetPosition assetPosition;
assetPosition.structureElementId = ele.id();
assetPosition.mountingPointType = ele.mountingPointTypeId();
assetPosition.relPosition = ele.relPosition();
assetPosition.geoPosition = ele.geoPosition();
assetPosition.structureElementId = ele.id;
assetPosition.mountingPointType = ele.mountingPointTypeId;
assetPosition.relPosition = ele.relPosition;
assetPosition.geoPosition = ele.geoPosition;
const QPointF &posUtm = CentralEffectSimulation::geographic2Utm(assetPosition.geoPosition, m_zone);
qreal x = posUtm.x() + assetPosition.relPosition.offsetX();
qreal y = posUtm.y() + assetPosition.relPosition.offsetY();
qreal x = posUtm.x() + assetPosition.relPosition.offsetX;
qreal y = posUtm.y() + assetPosition.relPosition.offsetY;
const QPointF posAssetUtm(x, y);
assetPosition.positionUtm = posAssetUtm;
assetPosition.zone = m_zone;
@@ -140,11 +140,11 @@ void HandlerBuildingData::onMountingPointAssetChanged(const InfrastructureManage
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged id=" << data.id()
<< " assetId=" << data.assetId()
<< " structureElementId=" << data.structureElementId();
m_mountingPointAsset.insert(data.structureElementId(), m_assetMountingPoint.value(data.assetId()));
m_assetMountingPoint.insert(data.assetId(), data.structureElementId());
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged id=" << data.id
<< " assetId=" << data.assetId
<< " structureElementId=" << data.structureElementId;
m_mountingPointAsset.insert(data.structureElementId, m_assetMountingPoint.value(data.assetId));
m_assetMountingPoint.insert(data.assetId, data.structureElementId);
}
void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType)
@@ -152,15 +152,15 @@ void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureMana
if (modType == DataModification::eRemoved)
return;
if (data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
if (data.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
{
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id()
<< " hostname=" << data.hostname();
QString hostname = QString::fromStdString(data.hostname());
m_instrumentationAssets.insert(data.id(), hostname);
if (m_assetMountingPoint.contains(data.id()))
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id
<< " hostname=" << data.hostname;
QString hostname = QString::fromStdString(data.hostname);
m_instrumentationAssets.insert(data.id, hostname);
if (m_assetMountingPoint.contains(data.id))
{
int assetId = data.id();
int assetId = data.id;
int mountpointId = m_assetMountingPoint.value(assetId);
DEBUG_LOG(m_logger) << "m_instrumentationAsset.contains(" << assetId << ")"
<< " assetId=" << assetId
@@ -169,7 +169,7 @@ void HandlerBuildingData::onInstrumentationAssetChanged(const InfrastructureMana
{
AssetPosition assetPosition = m_assetPositions.value(mountpointId);
assetPosition.hostname = hostname;
assetPosition.mountingPointType = data.mountingPointTypeId();
assetPosition.mountingPointType = data.mountingPointTypeId;
m_assetPositions.insert(assetPosition.structureElementId, assetPosition);
DEBUG_LOG(m_logger) << "m_assetPositions.insert assetPosition structureElementId= " << assetPosition.structureElementId
<< " type=" << assetPosition.mountingPointType
@@ -119,10 +119,10 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
else
{
ParticipantManagement::TypeClass typeClass = typeClassFromTypeId(data.participantTypeId());
if (typeClass == ParticipantManagement::TypeClass_def::SupportEntity
|| typeClass == ParticipantManagement::TypeClass_def::SupportUnit
|| typeClass == ParticipantManagement::TypeClass_def::Unit
|| typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::SupportEntity
|| typeClass == ParticipantManagement::TypeClass::SupportUnit
|| typeClass == ParticipantManagement::TypeClass::Unit
|| typeClass == ParticipantManagement::TypeClass::Unknown)
return;
// [GUEZE-3102] Aufgesessene Teilnehmer bekommen den Schaden vom Fahrzeug, auf dem sie aufgesessen sind.
@@ -224,14 +224,14 @@ void HandlerParticipant::onDynamicParticipantDataChanged(const ParticipantManage
CesParticipantData &participantPosition = m_positionsMap[data.participantId()]; // reference!
// save vulnerabilityState in participantHandler
ProjectDataManagement::VulnerabilityState newVulnerabilityState = ProjectDataManagement::VulnerabilityState_def::CombatReady;
ProjectDataManagement::VulnerabilityState newVulnerabilityState = ProjectDataManagement::VulnerabilityState::CombatReady;
if (data.stateHistory().size() > 0)
{
const ParticipantManagement::StateInformation &vul = ParticipantManagement::youngestStateInformation(data.stateHistory());
newVulnerabilityState = vul.vulnerabilityState();
DEBUG_LOG(m_logger) << "newVulnerabilityState" << vul.vulnerabilityState();
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
{
emit participantDecontaminated(participantPosition.participantId());
DEBUG_LOG(m_logger) << "emit participantDecontaminated id=" << participantPosition.participantId();
@@ -259,10 +259,10 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
// No OC in CES
ParticipantManagement::TypeClass typeClass = typeClassFromTypeId(data.typeId());
if (typeClass == ParticipantManagement::TypeClass_def::SupportEntity
|| typeClass == ParticipantManagement::TypeClass_def::SupportUnit
|| typeClass == ParticipantManagement::TypeClass_def::Unit
|| typeClass == ParticipantManagement::TypeClass_def::Unknown)
if (typeClass == ParticipantManagement::TypeClass::SupportEntity
|| typeClass == ParticipantManagement::TypeClass::SupportUnit
|| typeClass == ParticipantManagement::TypeClass::Unit
|| typeClass == ParticipantManagement::TypeClass::Unknown)
return;
m_participantData[data.id()] = data;
@@ -353,7 +353,7 @@ QHash<int, HandlerParticipant::CesParticipantData> HandlerParticipant::positions
for (const HandlerParticipant::CesParticipantData &pos : m_positionsMap)
{
ParticipantManagement::TypeClass typeClass = typeClassFromTypeId(pos.participantTypeId());
if (typeClass != ParticipantManagement::TypeClass_def::Aircraft)
if (typeClass != ParticipantManagement::TypeClass::Aircraft)
continue;
if (!m_participantData.contains(pos.participantId()))
continue;
@@ -391,7 +391,7 @@ bool HandlerParticipant::handleCheating(const ParticipantManagement::TypeClass t
if (typeClass == ParticipantManagement::TypeClass::Human)
{
DEBUG_LOG(m_logger) << "handle Cheating for Human";
if (newVulnerabilityState >= ProjectDataManagement::VulnerabilityState::MediumDamage)
if (newVulnerabilityState >= ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage)
return true;
}
if (typeClass == ParticipantManagement::TypeClass::GroundVehicle
@@ -399,8 +399,8 @@ bool HandlerParticipant::handleCheating(const ParticipantManagement::TypeClass t
|| typeClass == ParticipantManagement::TypeClass::VehicleWithGear)
{
DEBUG_LOG(m_logger) << "handle Cheating for Vehicle";
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::MobilityKill
|| newVulnerabilityState == ProjectDataManagement::VulnerabilityState::VisibleMobilityKill)
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill
|| newVulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleMobilityKill)
return true;
}
return false;
@@ -427,7 +427,7 @@ void HandlerParticipant::checkCheating(const int participantId,
}
else
{
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady)
{
DEBUG_LOG(m_logger) << "checkCheating remove id= " << participantId;
m_positionsCheatingMap.remove(participantId);
@@ -40,7 +40,7 @@ public:
struct CesParticipantData : public ParticipantManagement::ParticipantPosition
{
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::CombatReady;
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
Core::GeoPosition lastGeoPosition;
bool positionValid{false};
bool lastPositionValid{false};
@@ -50,7 +50,7 @@ public:
mutable LtsCoordTrans::LtsCoordinate m_ltsCoordinate;
bool insideWlsArea() const { return reportingSource() == Core::PositionReportingSource::Wls; }
bool insideWlsArea() const { return reportingSource == Core::PositionReportingSource::Wls; }
bool insideBuilding() const { return insideBuildingValue; }
LtsCoordTrans::LtsCoordinate &ltsCoordinate()
@@ -65,7 +65,7 @@ public:
CesParticipantData() = default;
explicit CesParticipantData(const ParticipantManagement::ParticipantPosition &p)
: ParticipantManagement::ParticipantPosition(p)
, lastGeoPosition(p.pos())
, lastGeoPosition(p.pos)
, positionValid(true)
{}
}; // struct CesParticipantData
@@ -97,7 +97,7 @@ public:
ParticipantManagement::TypeClass typeClassFromTypeId(int typeId) const { return m_typeMap.value(typeId); }
bool isOutdated(const CesParticipantData &pos) const
{
return LtsUtils::isPositionTimeOutdated(m_ddsHandler->currentPartitionTime(), pos.sampleTime());
return LtsUtils::isPositionTimeOutdated(m_ddsHandler->currentPartitionTime(), pos.sampleTime);
}
QPolygonF getParticipantStep(int participantId, int zone) const;
Loaded 100 of 512 files, more files were not shown because too many files have changed in this diff. Show more