Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set

new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
berrux-dev committed 2026-10-20 09:36:57 +02:00
1 parent eb1d949edc
commit 815e16368e
1718 files changed
+126739 -18495

No files matched your search

@@ -147,7 +147,7 @@ void MsgCompares::compareFeuerstellungsdaten(const AdlerJson::Feuerstellungsdate
QCOMPARE(feuerstellungsdaten.status, ProjectDataManagement::L28_Status::Einsatzbereit);
QCOMPARE(feuerstellungsdaten.feuereinheit.verein, QStringLiteral("verein ExFeuerstellungFS"));
QCOMPARE(feuerstellungsdaten.feuereinheit.r, 5);
QCOMPARE(feuerstellungsdaten.feuereinheit.oi, ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F3);
QCOMPARE(feuerstellungsdaten.feuereinheit.oi, ProjectDataManagement::L19_Oi::L19_Oi_F3);
QCOMPARE(feuerstellungsdaten.mittelpunkt.koordinate.latitude, 53.37791);
QCOMPARE(feuerstellungsdaten.mittelpunkt.koordinate.longitude, 8.759);
QCOMPARE(feuerstellungsdaten.mittelpunkt.hoehe, 20);
@@ -163,7 +163,7 @@ void MsgCompares::compareWaffensystemdaten(const AdlerJson::Waffensystemdaten &w
QCOMPARE(waffensystemdaten.status, ProjectDataManagement::L28_Status::NichtEinsatzbereit);
QCOMPARE(waffensystemdaten.einheit.verein, QStringLiteral("AB7X"));
QCOMPARE(waffensystemdaten.einheit.r, 6);
QCOMPARE(waffensystemdaten.einheit.oi, ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F6);
QCOMPARE(waffensystemdaten.einheit.oi, ProjectDataManagement::L19_Oi::L19_Oi_F6);
MsgCompares::compareGeschosse(waffensystemdaten.geschosse);
QCOMPARE(waffensystemdaten.koordinate.koordinate.latitude, 53.088354);
QCOMPARE(waffensystemdaten.koordinate.koordinate.longitude, 8.853092);
@@ -176,7 +176,7 @@ void MsgCompares::compareWaffensystemdaten(const AdlerJson::Waffensystemdaten &w
void MsgCompares::compareLadeplatzdaten(const AdlerJson::Ladeplatzdaten &ladeplatzdaten)
{
QCOMPARE(ladeplatzdaten.einheit.oi , ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F3);
QCOMPARE(ladeplatzdaten.einheit.oi , ProjectDataManagement::L19_Oi::L19_Oi_F3);
QCOMPARE(ladeplatzdaten.einheit.r, 5);
QCOMPARE(ladeplatzdaten.einheit.verein, QStringLiteral("verein StellungsmeldungLP"));
QCOMPARE(ladeplatzdaten.koordinate.koordinate.latitude, 53.37791);
@@ -187,7 +187,7 @@ void MsgCompares::compareWaffensystemdaten(const AdlerJson::Waffensystemdaten &w
void MsgCompares::compareStellungswechseldaten(const AdlerJson::Stellungswechseldaten &stellungswechseldaten)
{
QCOMPARE(stellungswechseldaten.oi, ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F3);
QCOMPARE(stellungswechseldaten.oi, ProjectDataManagement::L19_Oi::L19_Oi_F3);
QCOMPARE(stellungswechseldaten.r, 5);
QCOMPARE(stellungswechseldaten.verein, QStringLiteral("verein ExStellungswechsel"));
}
@@ -102,7 +102,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
extq.technischeDaten.beschreibung = replyObject.translated();
extq.technischeDaten.status = Status_L32::DAT;
// I dont Like it.. as we might get two request at the same time.. overriding but should work most of the
m_mainDispatcher->jsonDispatcher()->sendExTqTechnischeQuittung(extq, m_mainDispatcher->ppmHandler()->getDtc()->participant(m_participantId).partyId());
m_mainDispatcher->jsonDispatcher()->sendExTqTechnischeQuittung(extq, m_mainDispatcher->ppmHandler()->getDtc()->participant(m_participantId).partyId);
return;
}
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(replyObject.additionalInfo())).object();
@@ -132,35 +132,35 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
for (const auto &str : std::as_const(argsList))
args.emplace_back(str.toStdString());
req.notification().content(content.toStdString());
req.notification().contentArgs(args);
req.notification.content = content.toStdString();
req.notification.contentArgs = args;
// Which Exercise should parse the notification
req.notification().exerciseId(m_mainDispatcher->exerciseId());
req.notification.exerciseId = m_mainDispatcher->exerciseId();
req.notification().timeStamp(m_mainDispatcher->ddsHandler()->partitionTime());
req.notification.timeStamp = m_mainDispatcher->ddsHandler()->partitionTime();
// Priority: Highest: Klick Links immediatly
// Priority: High: Show message Box
req.notification().priority(NotificationManagement::Priority::High);
req.notification.priority = NotificationManagement::Priority::High;
// set priority after proccesed for all
req.notification().processedPriority(NotificationManagement::Priority::Low);
req.notification.processedPriority = NotificationManagement::Priority::Low;
//req.notification().title(tr_lts("Notification", "Wirkfeldplanung"));
req.notification().title(tr_lts("Notification", "AES-Planning"));
req.notification.title = tr_lts("Notification", "AES-Planning");
// Who is the sender, most of the time a Service
NotificationManagement::Address addressSender;
addressSender.addressType(NotificationManagement::AddressType::Service);
addressSender.addressType = NotificationManagement::AddressType::Service;
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByParty(partyId);
if (saa)
{
addressSender.name(saa->getSAAName().toStdString());
addressSender.name = saa->getSAAName().toStdString();
}else
{
// use Backup
addressSender.name(QStringLiteral("TAB").toStdString());
addressSender.name = QStringLiteral("TAB").toStdString();
}
req.notification().sender(addressSender);
req.notification().notificationType(NotificationManagement::NotificationType::CombatOrder);
req.notification().messageType(NotificationManagement::MessageType(NotificationManagement::MessageType::Success));
req.notification.sender = addressSender;
req.notification.notificationType = NotificationManagement::NotificationType::CombatOrder;
req.notification.messageType = NotificationManagement::MessageType(NotificationManagement::MessageType::Success);
// Notify all Adler User for Party
std::vector<NotificationManagement::Address> recipentVec;
@@ -168,22 +168,22 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
const QVector<int> recipientIds = m_mainDispatcher->ddsHandler()->dtcOpm()->getNotificationRecipents(m_mainDispatcher->exerciseId(),
partyId,
OperatorRights::AdlerExplosionClusterEdit,
req.notification().notificationType().underlying());
static_cast<int>(req.notification.notificationType));
std::vector<NotificationManagement::Address> recipientIdsDds;
recipientIdsDds.reserve(recipientIds.size());
for (const auto &recipientId : std::as_const(recipientIds))
{
NotificationManagement::Address addr;
addr.addressId(recipientId);
addr.isRead(false);
addr.addressId = recipientId;
addr.isRead = false;
const OperatorManagement::User user = m_mainDispatcher->ddsHandler()->dtcOpm()->user(recipientId);
addr.name(user.name());
addr.addressType(NotificationManagement::AddressType::Operator);
addr.name = user.name;
addr.addressType = NotificationManagement::AddressType::Operator;
recipentVec.emplace_back(addr);
}
req.notification().recipientIds(recipentVec);
if (req.notification().recipientIds().size() > 0)
req.notification.recipientIds = recipentVec;
if (req.notification.recipientIds.size() > 0)
{
m_mainDispatcher->ddsHandler()->ftcNom()->createNotificationRequest(req, this);
}
@@ -203,20 +203,20 @@ bool AesHandler::sendAesModifyRequest(const QJsonObject &data)
int equipmentNumber = data[QStringLiteral("header")].toObject()[QStringLiteral("equipmentNumber")].toInt();
AreaEffectSimulation::AirSupportImpactModifyRequest request;
request.chargeTypeId(data[QStringLiteral("chargeTypeId")].toInt());
request.externalId(data[QStringLiteral("eventId")].toInt());
request.name(data[QStringLiteral("name")].toString().toStdString());
request.impactPosition(Core::GeoPosition2D(data[QStringLiteral("impactPosition")].toObject()[QStringLiteral("lon")].toDouble(),
data[QStringLiteral("impactPosition")].toObject()[QStringLiteral("lat")].toDouble()));
request.flightTime(0);
request.chargeTypeId = data[QStringLiteral("chargeTypeId")].toInt();
request.externalId = data[QStringLiteral("eventId")].toInt();
request.name = data[QStringLiteral("name")].toString().toStdString();
request.impactPosition = Core::GeoPosition2D(data[QStringLiteral("impactPosition")].toObject()[QStringLiteral("lon")].toDouble(),
data[QStringLiteral("impactPosition")].toObject()[QStringLiteral("lat")].toDouble());
request.flightTime = 0;
qint64 requestedTime = static_cast<qint64>(data[QStringLiteral("header")].toObject()[QStringLiteral("timeStamp")].toDouble());
if (requestedTime < m_mainDispatcher->ddsHandler()->partitionTime())
requestedTime = m_mainDispatcher->ddsHandler()->partitionTime() + 500;
request.effectStart(requestedTime);
request.effectStart = requestedTime;
QJsonDocument doc(data);
if (equipmentNumber)
request.participantId(m_dtcPpm->participantIdByEquipmentNumber(equipmentNumber));
request.participantId = m_dtcPpm->participantIdByEquipmentNumber(equipmentNumber);
m_requestHelper->startSingleRequest([this, request]() { return m_ftcAes->airSupportImpactModifyRequest(request, this); });
return true;
}
@@ -226,22 +226,22 @@ bool AesHandler::sendExplosionArea(const QJsonObject &data)
Q_UNUSED(data)
AreaEffectSimulation::OffRouteMine orm;
orm.id(0);
orm.name(QString(QStringLiteral("test_offRouteMine_02")).toStdString());
orm.chargeStruct().chargeTypeId(254);
orm.effectDuration(6000);
orm.partyId(2);
orm.impactRadius(10);
orm.id = 0;
orm.name = QString(QStringLiteral("test_offRouteMine_02")).toStdString();
orm.chargeStruct.chargeTypeId = 254;
orm.effectDuration = 6000;
orm.partyId = 2;
orm.impactRadius = 10;
orm.area().cornerBottomLeft(Core::GeoPosition2D(0, 0));
orm.area().height(50);
orm.area().width(1);
orm.area().rotation(85);
orm.area.cornerBottomLeft = Core::GeoPosition2D(0, 0);
orm.area.height = 50;
orm.area.width = 1;
orm.area.rotation = 85;
orm.effectStart((time(nullptr) + 10) * 1000);
orm.effectStart = (time(nullptr) + 10) * 1000;
AreaEffectSimulation::OffRouteMineModifyRequest
req(orm.id(), orm.name(), orm.effectDuration(), orm.chargeStruct().chargeTypeId(), orm.area(), orm.impactRadius(), orm.effectStart(), orm.partyId());
req(orm.id, orm.name, orm.effectDuration, orm.chargeStruct.chargeTypeId, orm.area, orm.impactRadius, orm.effectStart, orm.partyId);
m_ftcAes->offRouteMineModifyRequest(req, this);
@@ -264,12 +264,12 @@ void AesHandler::handleEXFire(const Feuerkampfdaten &data, int wsId)
return;
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId);
int particpantId = m_dtcPpm->getParticipantByInternalName(saa->getPartyId(), data.verein, waffensystemkennerMap.key(data.kenner)).id();
int particpantId = m_dtcPpm->getParticipantByInternalName(saa->getPartyId(), data.verein, waffensystemkennerMap.key(data.kenner)).id;
TrainingAreaBase::EX_Fire outData;
outData.equipmentNumber() = particpantId;
outData.reference() = data.feuerkampfReferenz.toStdString();
outData.identifier() = data.verein.toStdString();
outData.effectorId() = data.kenner.underlying(); // static_cast<L27_EffectorId_def>((int)data.kenner);
outData.equipmentNumber = particpantId;
outData.reference = data.feuerkampfReferenz.toStdString();
outData.identifier = data.verein.toStdString();
outData.effectorId = data.kenner; // static_cast<L27_EffectorId_def>((int)data.kenner);
m_ddsHandler->dtsTab()->publish(outData);
QTimer::singleShot(3000, [this, particpantId]() { m_ddsHandler->dtsTab()->removeEX_FireByKey(particpantId); });
@@ -296,7 +296,7 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
DEBUG_LOG(m_logger) << "[EX-FQ(nFN)] data from SSA " << wsId << " : "
<< "verein: " << data.verein << " "
<< "kenner: " << data.kenner.underlying() << " "
<< "kenner: " << data.kenner << " "
<< "feuerkampfReferenz: " << data.feuerkampfReferenz;
handleAmmoCount(data, saa->getPartyId(), true);
@@ -357,12 +357,12 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
}
AreaEffectSimulation::TrajectoryAdlerModifyRequest *newRequest = new AreaEffectSimulation::TrajectoryAdlerModifyRequest();
newRequest->aesItemId(aesId);
newRequest->explosionIndex(wirkmittelIndex);
newRequest->aesItemId = aesId;
newRequest->explosionIndex = wirkmittelIndex;
int zone = -1;
Core::GeoPosition positionLaunch = subordinatePositions.at(wirkmittelIndex).pos();
auto utmLaunch = LtsCoordTrans::UtmCoordinate::fromGeographic(positionLaunch.lon(), positionLaunch.lat(), zone);
Core::GeoPosition positionLaunch = subordinatePositions.at(wirkmittelIndex).pos;
auto utmLaunch = LtsCoordTrans::UtmCoordinate::fromGeographic(positionLaunch.lon, positionLaunch.lat, zone);
double grad = (data.zieldaten.zielachse / 6400.) * 360.0;
@@ -385,7 +385,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
QPointF utmLaunchPt(utmLaunch.x, utmLaunch.y);
utm += utmLaunchPt;
double z = positionLaunch.z() + pos.yRelativ;
double z = positionLaunch.z + pos.yRelativ;
// see also: coordtrans_test::testRelativeMetricalOffet()
LtsCoordTrans::UtmCoordinate utmCoord;
@@ -430,24 +430,24 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
}
Core::GeoPosition impactPosition;
impactPosition.lat(data.zieldaten.koordinate.koordinate.latitude * M_PI / 180.0);
impactPosition.lon(data.zieldaten.koordinate.koordinate.longitude * M_PI / 180.0);
impactPosition.z(data.zieldaten.koordinate.hoehe);
newRequest->impactPosition(impactPosition);
newRequest->geometry(geometryRef);
DEBUG_LOG(m_logger) << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size();
impactPosition.lat = data.zieldaten.koordinate.koordinate.latitude * M_PI / 180.0;
impactPosition.lon = data.zieldaten.koordinate.koordinate.longitude * M_PI / 180.0;
impactPosition.z = data.zieldaten.koordinate.hoehe;
newRequest->impactPosition = impactPosition;
newRequest->geometry = geometryRef;
DEBUG_LOG(m_logger) << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry.size();
if (newRequest->aesItemId() <= 0)
if (newRequest->aesItemId <= 0)
{
ERROR_LOG(m_logger) << "newRequest->aesItemId() <=0"
<< ", aesItemId :" << newRequest->aesItemId();
<< ", aesItemId :" << newRequest->aesItemId;
return;
}
newRequest->peakAltitude(data.feuerkommando.wirkmittel.at(wirkmittelIndex).gipfelhoehe);
newRequest->mhpScatterLenght(data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.laengsstreuung);
newRequest->mhpScatterWidth(data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.seitenstreuung);
newRequest->mhpScatterLengthDetonationHeight(data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.laengsstreuungH);
newRequest->mhpScatterWidthDetonationHeight(data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.seitenstreuungH);
newRequest->peakAltitude = data.feuerkommando.wirkmittel.at(wirkmittelIndex).gipfelhoehe;
newRequest->mhpScatterLenght = data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.laengsstreuung;
newRequest->mhpScatterWidth = data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.seitenstreuung;
newRequest->mhpScatterLengthDetonationHeight = data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.laengsstreuungH;
newRequest->mhpScatterWidthDetonationHeight = data.feuerkommando.wirkmittel.at(wirkmittelIndex).streuung.seitenstreuungH;
m_ftcAes->trajectoryAdlerModifyRequest(*newRequest, this);
}
@@ -471,7 +471,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const bool isVerbund = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId)->getIsVerbund();
const ParticipantManagement::Participant &part = m_mainDispatcher->ppmHandler()->findParticipantByInternalName(verein, partyId, isVerbund);
// #endif
if (part.id() <= 0)
if (part.id <= 0)
{
ERROR_LOG(m_logger) << "Got EffectClusterData for " << verein << " but unit not found";
return;
@@ -479,7 +479,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
// get overall impacts
m_wirkfeldPlanungsData = data;
m_participantId = part.id();
m_participantId = part.id;
m_wirkmittelIndex = 0;
// for (const auto &wm : data.feuerkommando.wirkmittel)
@@ -511,38 +511,38 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
area.height(impactRadius * 2);
area.width(impactRadius * 2);
area.height = impactRadius * 2;
area.width = impactRadius * 2;
}
if (!createArea && data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Radial)
{
geometry = AreaEffectSimulation::AesExplosionGeometry::EgRadial;
// In Radial we need to double the radius and also set it as height/width
area.height(data.zieldaten.breiteRadius * 2);
area.width(data.zieldaten.breiteRadius * 2);
area.height = data.zieldaten.breiteRadius * 2;
area.width = data.zieldaten.breiteRadius * 2;
}
else if (!createArea) // we need the rect or the line
{
// maye wrong?
// not only maybe.. we need to swap .. yes..
area.height(data.zieldaten.breiteRadius);
area.height = data.zieldaten.breiteRadius;
if (data.zieldaten.tiefe > 0)
area.width(data.zieldaten.tiefe);
area.width = data.zieldaten.tiefe;
else
if (data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Linear)
area.width(5); // E01562-472 [Verbund] ImpactWidth invalid. Ein Wirkfeld mit der Zielgeometrie "Linear" kann nicht verarbeitet werden.
area.width = 5; // E01562-472 [Verbund] ImpactWidth invalid. Ein Wirkfeld mit der Zielgeometrie "Linear" kann nicht verarbeitet werden.
}
if (!createArea)
{
area.rotation((data.zieldaten.zielachse / 6400.) * 360); // UTM STRICH?
area.rotation = (data.zieldaten.zielachse / 6400.) * 360; // UTM STRICH?
// point is center
const QPointF centerPoint(data.zieldaten.koordinate.koordinate.longitude * (M_PI / 180.0), data.zieldaten.koordinate.koordinate.latitude * (M_PI / 180.0));
QRectF rect(QPointF(), QSizeF(area.height(), area.width()));
QRectF rect(QPointF(), QSizeF(area.height, area.width));
rect.moveCenter(QPointF());
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
const QPointF bl = QTransform().rotate(-area.rotation).map(rect.topLeft());
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
DEBUG_LOG(m_logger) << "centerUtm="
<< ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone;
@@ -551,11 +551,11 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
<< ", x :" << bl.x() << ", y :" << bl.y();
DEBUG_LOG(m_logger) << "bottomLeft="
<< ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y();
area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
area.cornerBottomLeft = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
DEBUG_LOG(m_logger) << "area.cornerBottomLeft="
<< ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat();
<< ", lon :" << area.cornerBottomLeft.lon << ", lat :" << area.cornerBottomLeft.lat;
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft.lon, area.cornerBottomLeft.lat);
DEBUG_LOG(m_logger) << "cornerBottomLeftUtm="
<< ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone;
}
@@ -579,16 +579,16 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
area.height(impactRadius * 2);
area.width(impactRadius * 2);
area.height = impactRadius * 2;
area.width = impactRadius * 2;
// point is center
const QPointF centerPoint(wirkmittel.auftreffpunkt.koordinate.longitude * (M_PI / 180.0), wirkmittel.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
QRectF rect(QPointF(), QSizeF(area.height(), area.width()));
QRectF rect(QPointF(), QSizeF(area.height, area.width));
rect.moveCenter(QPointF());
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
const QPointF bl = QTransform().rotate(-area.rotation).map(rect.topLeft());
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
DEBUG_LOG(m_logger) << "centerUtm="
<< ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone;
@@ -597,11 +597,11 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
<< ", x :" << bl.x() << ", y :" << bl.y();
DEBUG_LOG(m_logger) << "bottomLeft="
<< ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y();
area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
area.cornerBottomLeft = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
DEBUG_LOG(m_logger) << "area.cornerBottomLeft="
<< ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat();
<< ", lon :" << area.cornerBottomLeft.lon << ", lat :" << area.cornerBottomLeft.lat;
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft.lon, area.cornerBottomLeft.lat);
ERROR_LOG(m_logger) << "cornerBottomLeftUtm="
<< ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone;
}
@@ -632,9 +632,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const QPointF centerPoint(effector.auftreffpunkt.koordinate.longitude * (M_PI / 180.0), effector.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
AreaEffectSimulation::Area areaEffector;
areaEffector.height() = impactRadius * 2;
areaEffector.width() = impactRadius * 2;
QRectF rect(QPointF(), QSizeF(areaEffector.height(), areaEffector.width()));
areaEffector.height = impactRadius * 2;
areaEffector.width = impactRadius * 2;
QRectF rect(QPointF(), QSizeF(areaEffector.height, areaEffector.width));
rect.moveCenter(QPointF());
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
@@ -643,7 +643,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
zone = centerUtm.zone;
const QPointF bottomLeft = centerUtm.geographic(bl);
areaEffector.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
areaEffector.cornerBottomLeft = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
rect.moveCenter(QPointF(centerUtm.x, centerUtm.y));
// now add Area to list
@@ -657,7 +657,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
// Finally use the rerturning rect as Area
area = createMinimumRect(zone, vecPoints);
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft << " " << area.height << " " << area.width;
}
else if (data.feuerkommando.wirkmittelRakete.size() > 0)
{
@@ -682,9 +682,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const QPointF centerPoint(treffpunkt.koordinate.koordinate.longitude * (M_PI / 180.0), treffpunkt.koordinate.koordinate.latitude * (M_PI / 180.0));
AreaEffectSimulation::Area areaEffector;
areaEffector.height() = impactRadius * 2;
areaEffector.width() = impactRadius * 2;
QRectF rect(QPointF(), QSizeF(areaEffector.height(), areaEffector.width()));
areaEffector.height = impactRadius * 2;
areaEffector.width = impactRadius * 2;
QRectF rect(QPointF(), QSizeF(areaEffector.height, areaEffector.width));
rect.moveCenter(QPointF());
// Compass, not mathematical! "90-" left out as Polygon already is rotated by 90 degree
@@ -693,7 +693,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
zone = centerUtm.zone;
const QPointF bottomLeft = centerUtm.geographic(bl);
areaEffector.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
areaEffector.cornerBottomLeft = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
rect.moveCenter(QPointF(centerUtm.x, centerUtm.y));
// now add Area to list
@@ -706,7 +706,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
// Finally use the returning rect as Area
area = createMinimumRect(zone, vecPoints);
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft << " " << area.height << " " << area.width;
}
}
@@ -714,24 +714,24 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
for (const AreaEffectSimulation::EffectCluster &clus : m_dtcAes->effectClusters())
{
// ERROR_LOG(m_logger) << "Look for if: " << clus.element() << " is data: " << data.feuerkampfReferenz;
if (clus.partyId() != part.partyId())
if (clus.partyId != part.partyId)
continue;
if (clus.isDeleted())
if (clus.isDeleted)
continue;
if (clus.effectStateId() != AreaEffectSimulation::AesEffectState::EsPrepared && clus.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated
&& clus.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived)
if (clus.effectStateId != AreaEffectSimulation::AesEffectState::EsPrepared && clus.effectStateId != AreaEffectSimulation::AesEffectState::EsCreated
&& clus.effectStateId != AreaEffectSimulation::AesEffectState::EsReceived)
continue;
if (clus.element() != data.feuerkampfReferenz.trimmed().toStdString())
if (clus.element != data.feuerkampfReferenz.trimmed().toStdString())
continue;
req.id(clus.id());
req.id = clus.id;
}
QJsonObject obj;
obj[AdlerJson::JsonKeys::FEUERKAMPFREFERENZ()] = data.feuerkampfReferenz;
obj[QStringLiteral("useReceived")] = true;
obj[QStringLiteral("effectSource")] = ProjectDataManagement::EffectSource::ES_ADLER;
obj[QStringLiteral("effectSource")] = static_cast<int>(ProjectDataManagement::EffectSource::ES_ADLER);
obj[AdlerJson::JsonKeys::ABFEUERUNGSART()] = static_cast<int>(data.abfeuerungsArt);
// TargetData is often only optional
obj[AdlerJson::JsonKeys::TYP()] = m_mainDispatcher->pdmHandler()->getDtc()->getTargetTypeIdFromAdlerTargetType(data.zieldaten.typ);
@@ -739,7 +739,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
obj[AdlerJson::JsonKeys::ELEMENTE()] = data.zieldaten.elemente;
obj[AdlerJson::JsonKeys::NUMMER()] = data.zieldaten.nummer;
obj[QStringLiteral("partyId")] = part.partyId();
obj[QStringLiteral("partyId")] = part.partyId;
// fill EffectorData
std::vector<AreaEffectSimulation::EffectorData> effectorVec;
@@ -748,22 +748,22 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
for (const auto &effectorAdler : std::as_const(data.feuerkommando.wirkmittel))
{
AreaEffectSimulation::EffectorData effectorData;
effectorData.angleOfFall() = 0;
effectorData.chargeAmount() = effectorAdler.geschoss.anzahl;
effectorData.chargeStruct().chargeTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(effectorAdler.geschoss.geschosssorte);
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
effectorData.chargeStruct().igniterFunctionId()
effectorData.angleOfFall = 0;
effectorData.chargeAmount = effectorAdler.geschoss.anzahl;
effectorData.chargeStruct.chargeTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(effectorAdler.geschoss.geschosssorte);
effectorData.chargeStruct.igniterTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
effectorData.chargeStruct.igniterFunctionId
= m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion);
DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId();
effectorData.participantId()
= m_dtcPpm->getParticipantByInternalName(part.partyId(), QString::fromStdString(part.name()), waffensystemkennerMap.key(effectorAdler.kenner)).id();
DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct.chargeTypeId << " for " << effectorAdler.geschoss.geschosssorte;
DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct.igniterTypeId;
DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct.igniterFunctionId;
effectorData.participantId
= m_dtcPpm->getParticipantByInternalName(part.partyId, QString::fromStdString(part.name), waffensystemkennerMap.key(effectorAdler.kenner)).id;
std::vector<Core::RelativePositionRelativeTime> flightCurve;
flightCurve.reserve(effectorAdler.flugbahnpunkt.size());
const auto &startPos = m_dtcPpm->participantPosition(effectorData.participantId());
const auto coordStart = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.pos().lon(), startPos.pos().lat());
const auto &startPos = m_dtcPpm->participantPosition(effectorData.participantId);
const auto coordStart = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.pos.lon, startPos.pos.lat);
DEBUG_LOG(m_logger) << "Start point: " << coordStart;
const auto coordEnd = LtsCoordTrans::UtmCoordinate::fromGeographic(effectorAdler.auftreffpunkt.koordinate.longitude * (M_PI / 180.0),
@@ -782,42 +782,42 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
for (const auto &flightPointAdler : std::as_const(effectorAdler.flugbahnpunkt))
{
Core::RelativePositionRelativeTime flightPoint;
flightPoint.offsetX() = 0; // flightPointAdler.zRelativ;
flightPoint.offsetY() = flightPointAdler.xRelativ;
flightPoint.offsetZ() = flightPointAdler.yRelativ;
flightPoint.relativeTime() = flightPointAdler.zeit * 1000;
flightPoint.offsetX = 0; // flightPointAdler.zRelativ;
flightPoint.offsetY = flightPointAdler.xRelativ;
flightPoint.offsetZ = flightPointAdler.yRelativ;
flightPoint.relativeTime = flightPointAdler.zeit * 1000;
QTransform matrix;
matrix.rotate(useNewGrad);
const QPointF point(flightPoint.offsetX(), flightPoint.offsetY());
const QPointF point(flightPoint.offsetX, flightPoint.offsetY);
TRACE_LOG(m_logger) << " POS bevore rot: " << point;
const auto rotatePoint = matrix.map(point);
TRACE_LOG(m_logger) << " POS after rot: " << rotatePoint;
flightPoint.offsetX() = rotatePoint.x();
flightPoint.offsetY() = rotatePoint.y();
flightPoint.offsetX = rotatePoint.x();
flightPoint.offsetY = rotatePoint.y();
flightCurve.push_back(flightPoint);
}
effectorData.trajectoryRelative() = flightCurve;
effectorData.flightTime() = effectorAdler.flugzeit * 1000;
effectorData.chargeStruct().igniterTypeId() = 1; // effectorAdler.geschoss.zuender; //XKCD
effectorData.interval() = effectorAdler.geschoss.intervall;
effectorData.trajectoryRelative = flightCurve;
effectorData.flightTime = effectorAdler.flugzeit * 1000;
effectorData.chargeStruct.igniterTypeId = 1; // effectorAdler.geschoss.zuender; //XKCD
effectorData.interval = effectorAdler.geschoss.intervall;
Core::GeoPosition mhpPos;
mhpPos.lat() = effectorAdler.auftreffpunkt.koordinate.latitude * (M_PI / 180.0);
mhpPos.lon() = effectorAdler.auftreffpunkt.koordinate.longitude * (M_PI / 180.0);
mhpPos.z() = effectorAdler.auftreffpunkt.hoehe;
effectorData.mhpPosition() = mhpPos;
effectorData.mhpRotation() = 90.0 - (effectorAdler.schussrichtung / 6400.) * 360;
effectorData.mhpScatterLenght() = effectorAdler.streuung.laengsstreuung;
effectorData.mhpScatterLengthDetonationHeight() = effectorAdler.streuung.laengsstreuungH;
effectorData.mhpScatterWidth() = effectorAdler.streuung.seitenstreuung;
effectorData.mhpScatterWidthDetonationHeight() = effectorAdler.streuung.seitenstreuungH;
mhpPos.lat = effectorAdler.auftreffpunkt.koordinate.latitude * (M_PI / 180.0);
mhpPos.lon = effectorAdler.auftreffpunkt.koordinate.longitude * (M_PI / 180.0);
mhpPos.z = effectorAdler.auftreffpunkt.hoehe;
effectorData.mhpPosition = mhpPos;
effectorData.mhpRotation = 90.0 - (effectorAdler.schussrichtung / 6400.) * 360;
effectorData.mhpScatterLenght = effectorAdler.streuung.laengsstreuung;
effectorData.mhpScatterLengthDetonationHeight = effectorAdler.streuung.laengsstreuungH;
effectorData.mhpScatterWidth = effectorAdler.streuung.seitenstreuung;
effectorData.mhpScatterWidthDetonationHeight = effectorAdler.streuung.seitenstreuungH;
DEBUG_LOG(m_logger) << effectorAdler.kenner;
DEBUG_LOG(m_logger) << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name()
DEBUG_LOG(m_logger) << "Looking for participantID with stats = party: " << part.partyId << " unitname: " << part.name
<< " effectorname: " << waffensystemkennerMap.key(effectorAdler.kenner);
effectorData.peakHeight() = effectorAdler.gipfelhoehe;
effectorData.peakHeight = effectorAdler.gipfelhoehe;
effectorVec.push_back(effectorData);
// We will override with the last one but okay should be suffice
@@ -831,23 +831,23 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
{
AreaEffectSimulation::EffectorData effectorData;
effectorData.chargeAmount() = effectorAdler.geschoss.anzahl;
effectorData.angleOfFall() = effectorAdler.fallwinkel;
effectorData.chargeStruct().chargeTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(effectorAdler.geschoss.geschosssorte);
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
effectorData.chargeStruct().igniterFunctionId()
effectorData.chargeAmount = effectorAdler.geschoss.anzahl;
effectorData.angleOfFall = effectorAdler.fallwinkel;
effectorData.chargeStruct.chargeTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getChargeTypeIdFromAdlerCharges(effectorAdler.geschoss.geschosssorte);
effectorData.chargeStruct.igniterTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
effectorData.chargeStruct.igniterFunctionId
= m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion);
DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId();
DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct.chargeTypeId << " for " << effectorAdler.geschoss.geschosssorte;
DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct.igniterTypeId;
DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct.igniterFunctionId;
effectorData.participantId()
= m_dtcPpm->getParticipantByInternalName(part.partyId(), QString::fromStdString(part.name()), waffensystemkennerMap.key(effectorAdler.kenner)).id();
if (effectorData.participantId() == 0)
WARNING_LOG(m_logger) << "Could not find participant for partiyId " << part.partyId() << ", name " << part.name() << ", kenner " << effectorAdler.kenner;
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
effectorData.interval() = effectorAdler.geschoss.intervall;
effectorData.participantId
= m_dtcPpm->getParticipantByInternalName(part.partyId, QString::fromStdString(part.name), waffensystemkennerMap.key(effectorAdler.kenner)).id;
if (effectorData.participantId == 0)
WARNING_LOG(m_logger) << "Could not find participant for partiyId " << part.partyId << ", name " << part.name << ", kenner " << effectorAdler.kenner;
effectorData.chargeStruct.igniterTypeId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
effectorData.interval = effectorAdler.geschoss.intervall;
// create centroid
Core::GeoPosition mhpPos;
@@ -857,26 +857,26 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
centroid /= effectorAdler.treffpunkte.size();
mhpPos.lat() = centroid.x() * (M_PI / 180.0);
mhpPos.lon() = centroid.y() * (M_PI / 180.0);
mhpPos.z() = effectorAdler.treffpunkte.at(0).koordinate.hoehe;
effectorData.mhpPosition() = mhpPos;
effectorData.mhpRotation() = 90.0 - (effectorAdler.schussrichtung / 6400.) * 360;
effectorData.mhpScatterLenght() = 0.0;
effectorData.mhpScatterLengthDetonationHeight() = 0.0;
effectorData.mhpScatterWidth() = 0.0;
effectorData.mhpScatterWidthDetonationHeight() = 0.0;
effectorData.peakHeight() = effectorAdler.gipfelhoehe;
mhpPos.lat = centroid.x() * (M_PI / 180.0);
mhpPos.lon = centroid.y() * (M_PI / 180.0);
mhpPos.z = effectorAdler.treffpunkte.at(0).koordinate.hoehe;
effectorData.mhpPosition = mhpPos;
effectorData.mhpRotation = 90.0 - (effectorAdler.schussrichtung / 6400.) * 360;
effectorData.mhpScatterLenght = 0.0;
effectorData.mhpScatterLengthDetonationHeight = 0.0;
effectorData.mhpScatterWidth = 0.0;
effectorData.mhpScatterWidthDetonationHeight = 0.0;
effectorData.peakHeight = effectorAdler.gipfelhoehe;
QJsonObject properties;
AdlerJson::wirkmittelFeuerkommandoRaketeToJson(properties, effectorAdler);
effectorData.properties() = QJsonDocument(properties).toJson(QJsonDocument::Compact).toStdString();
effectorData.properties = QJsonDocument(properties).toJson(QJsonDocument::Compact).toStdString();
// trajectory without time start ------------------------------------------
const ParticipantManagement::ParticipantPosition &participantPosition = m_dtcPpm->participantPosition(effectorData.participantId());
const LtsUtils::QPoint3D trajectoryStart(participantPosition.pos().lon(), participantPosition.pos().lat(), participantPosition.pos().z());
const ParticipantManagement::ParticipantPosition &participantPosition = m_dtcPpm->participantPosition(effectorData.participantId);
const LtsUtils::QPoint3D trajectoryStart(participantPosition.pos.lon, participantPosition.pos.lat, participantPosition.pos.z);
const LtsUtils::QPoint3D trajectoryEnd(effectorData.mhpPosition().lon(), effectorData.mhpPosition().lat(), effectorData.mhpPosition().z());
const LtsUtils::QPoint3D trajectoryEnd(effectorData.mhpPosition.lon, effectorData.mhpPosition.lat, effectorData.mhpPosition.z);
AreaEffectSimulation::TrajectoryGeoPosition trajectoryWithoutTime;
@@ -885,16 +885,16 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
// trajectory without time end -------------------------------------------
// trajectory with time start -------------------------------------------
effectorData.flightTime() = effectorAdler.flugzeit * 1000;
const double flightTimeStep = effectorData.flightTime() / static_cast<double>(trajectoryWithoutTime.size());
effectorData.flightTime = effectorAdler.flugzeit * 1000;
const double flightTimeStep = effectorData.flightTime / static_cast<double>(trajectoryWithoutTime.size());
double currentFlightTime = 0.0;
const LtsCoordTrans::UtmCoordinate utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPosition.pos().lon(), participantPosition.pos().lat());
const LtsCoordTrans::UtmCoordinate utmStartPos = LtsCoordTrans::UtmCoordinate::fromGeographic(participantPosition.pos.lon, participantPosition.pos.lat);
for (const Core::GeoPosition &pos : std::as_const(trajectoryWithoutTime))
{
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat());
const LtsCoordTrans::UtmCoordinate utmCurrentPos = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon, pos.lat);
effectorData.trajectoryRelative().emplace_back(utmCurrentPos.x - utmStartPos.x, utmCurrentPos.y - utmStartPos.y, pos.z(),
effectorData.trajectoryRelative.emplace_back(utmCurrentPos.x - utmStartPos.x, utmCurrentPos.y - utmStartPos.y, pos.z,
currentFlightTime);
currentFlightTime += flightTimeStep;
@@ -907,23 +907,23 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
effectorVec.push_back(effectorData);
}
}
req.effectors() = effectorVec;
req.effectors = effectorVec;
QString propertiesStr = QString::fromStdString(QJsonDocument(obj).toJson(QJsonDocument::Compact).toStdString());
std::string properties = propertiesStr.toStdString();
req.properties(properties);
req.area(area);
req.effectMarkingInTa(true);
req.partyId(part.partyId());
req.explosionGeometry(geometry);
req.firePurposeId(static_cast<int>(data.forderung.underlying())); // TODO Mapping
req.effectSourceId(ProjectDataManagement::EffectSource::ES_ADLER);
req.name(data.feuerkampfReferenz.toStdString());
req.element(data.feuerkampfReferenz.toStdString());
req.effectDuration(data.dauer * 1000);
req.participantId(part.id());
req.externalId(7);
req.tla(data.zieldaten.zog); // defaults to 0 if not set
req.properties = properties;
req.area = area;
req.effectMarkingInTa = true;
req.partyId = part.partyId;
req.explosionGeometry = geometry;
req.firePurposeId = static_cast<int>(data.forderung); // TODO Mapping
req.effectSourceId = ProjectDataManagement::EffectSource::ES_ADLER;
req.name = data.feuerkampfReferenz.toStdString();
req.element = data.feuerkampfReferenz.toStdString();
req.effectDuration = data.dauer * 1000;
req.participantId = part.id;
req.externalId = 7;
req.tla = data.zieldaten.zog; // defaults to 0 if not set
if (data.feuerkommando.wirkmittel.empty())
DEBUG_LOG(m_logger) << "flugzeit :"
@@ -957,16 +957,16 @@ QList<qint32> AesHandler::findAllPendingEffectCluster(int partyId)
const auto &effectClusters = m_dtcAes->effectClusters();
for (const auto &effectCluster : std::as_const(effectClusters))
{
if (effectCluster.partyId() != partyId)
if (effectCluster.partyId != partyId)
continue;
if (effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived
&& effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated)
if (effectCluster.effectStateId != AreaEffectSimulation::AesEffectState::EsReceived
&& effectCluster.effectStateId != AreaEffectSimulation::AesEffectState::EsCreated)
continue;
if (effectCluster.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER /*&&
if (effectCluster.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER /*&&
effectCluster.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE*/)
continue;
ret.append(effectCluster.id());
ret.append(effectCluster.id);
}
return ret;
}
@@ -996,7 +996,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
for (const auto &aes : std::as_const(aesEffetClusters))
{
if (aes.isDeleted() || aes.partyId() != saaPartyId || aes.element() != refTrimmed.toStdString())
if (aes.isDeleted || aes.partyId != saaPartyId || aes.element != refTrimmed.toStdString())
{
continue;
}
@@ -1007,7 +1007,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
bool outOfAmmo = false;
const int newAmmoAmount = std::max(0, refAmmoCounter - 1);
DEBUG_LOG(m_logger) << "Handle ammo count - ID: " << aes.id() << " | Ref: " << refTrimmed << " | PartyID: " << saaPartyId << " | oldAmmoCount: " << refAmmoCounter
DEBUG_LOG(m_logger) << "Handle ammo count - ID: " << aes.id << " | Ref: " << refTrimmed << " | PartyID: " << saaPartyId << " | oldAmmoCount: " << refAmmoCounter
<< " | newAmmoCount: " << newAmmoAmount;
if (newAmmoAmount <= 0)
@@ -1038,7 +1038,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
}
Core::RemoveElementRequest req;
req.id(aes.id());
req.id = aes.id;
m_ftcAes->effectClusterRemoveRequest(req);
// After remove effectCluster remove FeuerkampfReferenz from Maps
@@ -1059,7 +1059,7 @@ void AesHandler::removeAllPendingEffectCluster(int partyId)
Core::RemoveElementRequest req;
for (const qint32 id : std::as_const(effectClusterIds))
{
req.id(id);
req.id = id;
INFO_LOG(m_logger) << "Remove effect cluster id: " << id;
qint32 ret = m_ftcAes->effectClusterRemoveRequest(req);
@@ -1075,10 +1075,10 @@ AreaEffectSimulation::Area AesHandler::createMinimumRect(int zone, const QVector
auto rec = AreaEffectSimulation::Polygons::getMinAreaRect(points, angle);
LtsCoordTrans::UtmCoordinate coord(zone, rec.bottomLeft().x(), rec.bottomLeft().y());
ret.cornerBottomLeft() = Core::GeoPosition2D(coord.geographic().x(), coord.geographic().y());
ret.rotation() = angle;
ret.height() = abs(rec.height());
ret.width() = abs(rec.width());
ret.cornerBottomLeft = Core::GeoPosition2D(coord.geographic().x(), coord.geographic().y());
ret.rotation = angle;
ret.height = abs(rec.height());
ret.width = abs(rec.width());
return ret;
}
@@ -1088,39 +1088,39 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
if (modType == DataModification::eRemoved)
{
DEBUG_LOG(m_logger) << "----------------- remove area ------------- ";
m_singleExplosions.remove(data.id());
m_singleExplosions.remove(data.id);
return;
}
if (modType == DataModification::eAdded)
{
DEBUG_LOG(m_logger) << "----------------- add area ------------- " << data.effectStateId();
m_singleExplosions.insert(data.id(), data.effectStateId());
DEBUG_LOG(m_logger) << "----------------- add area ------------- " << data.effectStateId;
m_singleExplosions.insert(data.id, data.effectStateId);
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated
&& m_singleExplosions.value(data.id(), AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState::EsActivated)
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated
&& m_singleExplosions.value(data.id, AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState::EsActivated)
{
const auto state = data.effectStateId();
const auto state = data.effectStateId;
DEBUG_LOG(m_logger) << "----------------- switch state ------------- " << state;
m_singleExplosions.insert(data.id(), state);
m_singleExplosions.insert(data.id, state);
QJsonObject telegram;
telegram[QStringLiteral("typeId")] = 80082;
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaExplosionSingleChanged");
QJsonObject headerJson;
headerJson[QStringLiteral("aesId")] = data.id();
headerJson[QStringLiteral("aesId")] = data.id;
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
QJsonObject impactPosition;
impactPosition[QStringLiteral("lon")] = data.impactPosition().lon();
impactPosition[QStringLiteral("lat")] = data.impactPosition().lat();
impactPosition[QStringLiteral("lon")] = data.impactPosition.lon;
impactPosition[QStringLiteral("lat")] = data.impactPosition.lat;
QJsonObject jsonData;
jsonData[QStringLiteral("header")] = headerJson;
jsonData[QStringLiteral("impactPosition")] = impactPosition; // detonationLocation
if (data.participantId().is_set())
if (data.participantId.has_value())
{
jsonData[QStringLiteral("participantId")] = data.participantId().get(); // firingObjectIdentifier
jsonData[QStringLiteral("participantId")] = data.participantId.get(); // firingObjectIdentifier
}
telegram[QStringLiteral("data")] = jsonData;
@@ -1130,54 +1130,54 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: " << data.name();
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: " << data.name;
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: probs: " << data.properties();
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: probs: " << data.properties;
if (data.properties().empty())
if (data.properties.empty())
return;
if (!data.partyId().is_set())
if (!data.partyId.has_value())
return;
DEBUG_LOG(m_logger) << "has PARTY " << data.properties();
DEBUG_LOG(m_logger) << "has PARTY " << data.properties;
if (!data.participantId().is_set())
if (!data.participantId.has_value())
return;
if (data.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER)
if (data.effectSourceId != ProjectDataManagement::EffectSource::ES_ADLER)
return;
DEBUG_LOG(m_logger) << "has PARTICIPANTID " << data.properties();
DEBUG_LOG(m_logger) << "has PARTICIPANTID " << data.properties;
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object();
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties)).object();
if (!propertiesObject.value(QStringLiteral("useReceived")).toBool())
return;
DEBUG_LOG(m_logger) << "has USE RECEIVED " << data.effectStateId().underlying();
DEBUG_LOG(m_logger) << "has USE RECEIVED " << data.effectStateId;
switch (data.effectStateId().underlying())
switch (data.effectStateId)
{
case AreaEffectSimulation::AesEffectState::EsCreated:
{
// Auftragsannahme (manuelle Quittung)
// Could be send via notification managment??
if (m_aesIdToFeuerkampfReferenz.contains(data.id()))
if (m_aesIdToFeuerkampfReferenz.contains(data.id))
{
const QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object();
const QJsonObject probObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties)).object();
const QString reference = probObject[AdlerJson::JsonKeys::FEUERKAMPFREFERENZ()].toString();
ExMqManuelleQuittung exmq;
// exmq.mqManuelleQuittungDaten.feuerkampfreferenz = QString::fromStdString(data.element());
exmq.mqManuelleQuittungDaten.feuerkampfreferenz = reference;
m_mainDispatcher->jsonDispatcher()->sendExMqManuelleQuittung(exmq, data.partyId().get());
m_mainDispatcher->jsonDispatcher()->sendExMqManuelleQuittung(exmq, data.partyId.get());
// After that we'll remove it form the list to not send an MQ again!
m_aesIdToFeuerkampfReferenz.remove(data.id());
DEBUG_LOG(m_logger) << "SEND MQ for " << data.name() << " " << reference;
m_aesIdToFeuerkampfReferenz.remove(data.id);
DEBUG_LOG(m_logger) << "SEND MQ for " << data.name << " " << reference;
break;
}
}
@@ -2,6 +2,7 @@
#include "asm_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
@@ -15,6 +16,7 @@ AsmHandler::AsmHandler(QObject *parent)
, m_dtcAsm(nullptr)
, m_ftcAsm(nullptr)
, m_exerciseId(-1)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
bool AsmHandler::init(MainDispatcher* mainDispatcher)
@@ -40,12 +42,12 @@ void AsmHandler::modifyAssetAdlerProperties(int assetId, bool isSaaConnected)
WARNING_LOG(m_logger)<<">> modify asset properties: set exerciseId: "<<m_exerciseId<<" assetName: "<<assetId;
AssetManagement::Asset asset = m_dtcAsm->asset(assetId);
if (asset.id() <= 0)
if (asset.id <= 0)
return;
QJsonObject assetPropsObj = QJsonDocument::fromJson(asset.properties().c_str()).object();
QJsonObject assetPropsObj = QJsonDocument::fromJson(asset.properties.c_str()).object();
assetPropsObj[QStringLiteral("exerciseId")] = isSaaConnected ? m_exerciseId : -1;
asset.properties(QJsonDocument(assetPropsObj).toJson().toStdString());
asset.properties = QJsonDocument(assetPropsObj).toJson().toStdString();
m_ftcAsm->assetModifyRequest(asset);
}
@@ -2,6 +2,7 @@
#include "flm_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <utility>
#include "FileManagement/flm_operator_rights.h"
#include "main_dispatcher.h"
@@ -25,6 +26,7 @@ FlmHandler::FlmHandler(QObject *parent)
, m_ftcFlm(nullptr)
, m_ftcNom(nullptr)
, m_opmDtc(nullptr)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
}
@@ -67,24 +69,24 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
}
FileManagement::FileContentModifyRequest fileContentReq;
fileContentReq.isTemplate(false);
fileContentReq.isHidden(true);
fileContentReq.folderId(folderHXMessagesId);
const QVector<int> fldPath = LtsUtils::convert<QVector<int>>(m_dtcFlm->folder(folderHXMessagesId).path());
fileContentReq.fileCategory(FileManagement::FileCategory::Exercise);
fileContentReq.fileType(FileManagement::FileType::AdlerJson);
fileContentReq.fileStatus(FileManagement::FileStatus::Valid);
fileContentReq.isTemplate = false;
fileContentReq.isHidden = true;
fileContentReq.folderId = folderHXMessagesId;
const QVector<int> fldPath = LtsUtils::convert<QVector<int>>(m_dtcFlm->folder(folderHXMessagesId).path);
fileContentReq.fileCategory = FileManagement::FileCategory::Exercise;
fileContentReq.fileType = FileManagement::FileType::AdlerJson;
fileContentReq.fileStatus = FileManagement::FileStatus::Valid;
QByteArray content = QJsonDocument(obj).toJson(QJsonDocument::Compact).constData();
fileContentReq.content(LtsUtils::convert<std::vector<uint8_t>>(content));
fileContentReq.content = LtsUtils::convert<std::vector<uint8_t>>(content);
fileContentReq.isUsedBy(false);
fileContentReq.usedBy(0);
fileContentReq.lastModified(m_mainDispatcher->ddsHandler()->partitionTime());
fileContentReq.exerciseId(m_exerciseId);
fileContentReq.operatorId(99);
fileContentReq.isUsedBy = false;
fileContentReq.usedBy = 0;
fileContentReq.lastModified = m_mainDispatcher->ddsHandler()->partitionTime();
fileContentReq.exerciseId = m_exerciseId;
fileContentReq.operatorId = 99;
DEBUG_LOG(m_logger) << "HQ: name: " << fileContentReq.name() << ", folderId: " << folderHXMessagesId << ", exerciseId: " << m_exerciseId << ", partyId: " << partyId;
DEBUG_LOG(m_logger) << "HQ: name: " << fileContentReq.name << ", folderId: " << folderHXMessagesId << ", exerciseId: " << m_exerciseId << ", partyId: " << partyId;
QRegularExpression re(QStringLiteral("_\\d+$"));
@@ -96,7 +98,7 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
ERROR_LOG(m_logger) << "BaseName: " << baseName << "|";
QStringList fileNames;
if (!m_dtcFlm->getAllFiles(fileContentReq.fileType(), folderHXMessagesId, fileNames, true))
if (!m_dtcFlm->getAllFiles(fileContentReq.fileType, folderHXMessagesId, fileNames, true))
{
ERROR_LOG(m_logger) << "Error while reading fileNames for folderId: " << folderHXMessagesId;
return false;
@@ -134,7 +136,7 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
const QString newName = baseName
+ QStringLiteral("_") + QString::number(++maxNumber);
DEBUG_LOG(m_logger) << "newName : " << newName;
fileContentReq.name(newName.toStdString());
fileContentReq.name = newName.toStdString();
m_partyId = partyId;
@@ -152,7 +154,7 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con
qint64 expiryTime = currentTime + s->getInteger(QStringLiteral("NOM/expiryIntervalMSec"), 2 * 24 * 60 * 60 * 1000);
NotificationManagement::NomNotification notif;
notif.title(tr("HQ Report").toStdString());
notif.title = tr("HQ Report").toStdString();
QString linkName = tr("Open HQ Report Dialog");
QString content = QStringLiteral("[%1](//flmHQReport/?party=%2&folder=%3&file=%4)").arg(linkName).arg(partyId).arg(folderId).arg(fileId);
@@ -167,28 +169,28 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con
content = content.replace(QStringLiteral("[%1](%2)").arg(it.value(), it.key()), QStringLiteral("<a href='%1'>%2</a>").arg(it.key(), it.value()));
}
notif.content(content.toStdString());
notif.timeStamp(currentTime);
notif.expiryTime(expiryTime);
notif.content = content.toStdString();
notif.timeStamp = currentTime;
notif.expiryTime = expiryTime;
int prio = s->getInteger(QStringLiteral("NOM/notificationPriority"), 3);
DEBUG_LOG(m_logger) << " Setting: NotificationPriority: " << prio;
notif.priority(static_cast<NotificationManagement::Priority>(prio));
notif.processedPriority(NotificationManagement::Priority::Low);
notif.exerciseId(m_exerciseId);
notif.priority = static_cast<NotificationManagement::Priority>(prio);
notif.processedPriority = NotificationManagement::Priority::Low;
notif.exerciseId = m_exerciseId;
for (const auto &userId : m_opmDtc->getOperatorsByOperatorRight(OperatorRights::FileManagementFilesEdit))
{
NotificationManagement::Address addr;
addr.addressId(userId);
addr.isRead(false);
addr.name(m_opmDtc->user(userId).name());
addr.addressType(NotificationManagement::AddressType::Operator);
notif.recipientIds().push_back(addr);
addr.addressId = userId;
addr.isRead = false;
addr.name = m_opmDtc->user(userId).name;
addr.addressType = NotificationManagement::AddressType::Operator;
notif.recipientIds.push_back(addr);
}
NotificationManagement::CreateNotificationRequest notifReq;
notifReq.notification(notif);
notifReq.notification = notif;
if (!m_ftcNom->createNotificationRequest(notifReq, this))
ERROR_LOG(m_logger) << "Error requesting create Notification data";
@@ -210,10 +212,10 @@ void FlmHandler::initHQFolders(int partyId)
std::vector<std::string> vecFolderNames = {"HQ Data", partyName.toStdString(), "Messages"};
FileManagement::PathCreateRequest req;
req.path(vecFolderNames);
req.parentId(exerciseFolderId);
req.isEditable(false);
req.operatorId(99);
req.path = vecFolderNames;
req.parentId = exerciseFolderId;
req.isEditable = false;
req.operatorId = 99;
m_ftcFlm->pathCreateRequest(req, this);
}
@@ -121,14 +121,14 @@ int JsonDispatcher::getAssetId(const QString &saaName) const
for (const auto &currAsset : m_mainDispatcher->asmHandler()->getDtc()->assets())
{
if (currAsset.assetTypeId() != AssetManagement::AssetType::AdlerSAA)
if (currAsset.assetTypeId != AssetManagement::AssetType::AdlerSAA)
continue;
const auto &dbSaa = saaNameFromProps(currAsset.properties());
const auto &dbSaa = saaNameFromProps(currAsset.properties);
if (dbSaa.toLower() != saaName.toLower())
continue;
return currAsset.id();
return currAsset.id;
}
return -1;
}
@@ -436,10 +436,10 @@ void JsonDispatcher::onSAAStatus(const int wsId, const EXStatus &status)
QString JsonDispatcher::getParticipantInfoLink(const QString &verein, const int partyId, const bool isVerbund)
{
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(verein, partyId, isVerbund);
DEBUG_LOG(m_logger) << "ParticipantId=" << part.id();
DEBUG_LOG(m_logger) << "ParticipantId=" << part.id;
QString ppmlink = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br />"))
.arg(part.id());
.arg(part.id);
return ppmlink;
@@ -481,7 +481,7 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS)
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQWS.einheit.verein, partyId, isVerbund);
m_ppmHandler->parseSQWS(exSQWS, wsId);
if (part.id() > 0)
if (part.id > 0)
{
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQWS.einheit);
return;
@@ -500,7 +500,7 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS
m_ppmHandler->parseSQFS(exSQFS, wsId);
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQFS.feuereinheit.verein, partyId, isVerbund);
if (part.id() > 0)
if (part.id > 0)
{
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQFS.feuereinheit);
return;
@@ -521,7 +521,7 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
m_ppmHandler->parseSQLP(exSQLP, wsId);
if (part.id() > 0)
if (part.id > 0)
{
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQLP.einheit);
return;
@@ -537,11 +537,11 @@ void JsonDispatcher::sendParticipantInfoNotification(const int wsId, const int p
QStringList args;
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(einheit.verein, partyId, isVerbund);
DEBUG_LOG(m_logger) << "sendParticipantInfoNotification ParticipantId=" << part.id();
DEBUG_LOG(m_logger) << "sendParticipantInfoNotification ParticipantId=" << part.id;
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
args.append(QString::number(part.id()));
args.append(QString::number(part.id));
args.append(ortsIdMap.key(einheit.oi));
args.append(QString::number(einheit.r));
args.append(einheit.verein);
@@ -626,8 +626,8 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer
DEBUG_LOG(m_logger) << "[EX-FH] data from SSA " << wsId << " : "
<< "verein: " << feuerhaltdaten.verein << " "
<< "kenner: " << feuerhaltdaten.kenner.underlying() << " "
<< "kategorie: " << feuerhaltdaten.kategorie.underlying() << " "
<< "kenner: " << feuerhaltdaten.kenner << " "
<< "kategorie: " << feuerhaltdaten.kategorie << " "
<< "feuerkampfReferenz: " << feuerhaltdaten.feuerkampfReferenz << " "
<< "zpNummer: " << feuerhaltdaten.zpNummer << " "
<< "koordinaten: "
@@ -642,17 +642,17 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer
AreaEffectSimulation::EffectClusterFireHaltRequest req;
req.partyId(partyId);
req.fireHaltCategory(kategorie);
req.kenner(kenner);
req.longitude(feuerhaltdaten.koordinate.longitude);
req.latitude(feuerhaltdaten.koordinate.latitude);
req.radius(feuerhaltdaten.radius);
req.entladenSchuss(feuerhaltdaten.entladenSchuss);
req.partyId = partyId;
req.fireHaltCategory = kategorie;
req.kenner = kenner;
req.longitude = feuerhaltdaten.koordinate.longitude;
req.latitude = feuerhaltdaten.koordinate.latitude;
req.radius = feuerhaltdaten.radius;
req.entladenSchuss = feuerhaltdaten.entladenSchuss;
const bool bRet = m_mainDispatcher->aesHandler()->getFtc()->effectClusterFireHaltRequest(req);
if (bRet && kategorie == ProjectDataManagement::L22_FireHaltCategory::E && !feuerhaltdaten.entladenSchuss) //we can send the EXVollzugsmeldung immediatly
if (bRet && kategorie == ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_E && !feuerhaltdaten.entladenSchuss) //we can send the EXVollzugsmeldung immediatly
{
Feuerkampfdaten fkd;
fkd.feuerkampfReferenz = feuerhaltdaten.feuerkampfReferenz;
@@ -770,27 +770,27 @@ QUrl JsonDispatcher::webSocketUrl() const { return QUrl(QStringLiteral("ws://127
void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleIdentity &cookie, const AdlerCalculateTrajectoryRequest &request)
{
Core::FunctionReplyObject ret;
m_explosionIndex = request.explosionIndex();
m_explosionIndex = request.explosionIndex;
m_cookieCalculateTrajectoryAdler = cookie;
DEBUG_LOG(m_logger) << "Adler Plugin onSendCalculateTrajectoryAdlerRequest"
<< ", m_saaInterfaces.size=" << m_saaInterfaces.size();
int wsId = 0;
std::shared_ptr<SAAInterface> saaInterface = getSAAByParty(request.partyId());
std::shared_ptr<SAAInterface> saaInterface = getSAAByParty(request.partyId);
if (saaInterface)
wsId = saaInterface->getWsId();
if (wsId == 0)
{
DEBUG_LOG(m_logger) << " No wsId found wsId=" << wsId << " return";
ret.setId(request.explosionIndex());
ret.setId(request.explosionIndex);
m_ftsTab->adlerCalculateTrajectoryReply(cookie, ret);
return;
}
DEBUG_LOG(m_logger) << "Adler Plugin onSendCalculateTrajectoryAdlerRequest"
<< " connect to SAA and send data"
<< ", partyId :" << request.partyId() << ", wsId :" << wsId;
<< ", partyId :" << request.partyId << ", wsId :" << wsId;
ExFlugbahnberechnung exFlugbahnberechnung;
exFlugbahnberechnung.sender = QStringLiteral("EXCON@GUEZ.DE");
@@ -804,57 +804,57 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
exFlugbahnberechnung.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
exFlugbahnberechnung.version = QStringLiteral("0.0.5");
exFlugbahnberechnung.flugbahnberechnungDaten.standort.koordinate.latitude = request.positionLaunch().lat() * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.standort.koordinate.longitude = request.positionLaunch().lon() * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.standort.hoehe = request.positionLaunch().z();
exFlugbahnberechnung.flugbahnberechnungDaten.standort.koordinate.latitude = request.positionLaunch.lat * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.standort.koordinate.longitude = request.positionLaunch.lon * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.standort.hoehe = request.positionLaunch.z;
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.koordinate.latitude = request.positionTarget().lat() * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.koordinate.longitude = request.positionTarget().lon() * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.hoehe = request.positionTarget().z();
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.koordinate.latitude = request.positionTarget.lat * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.koordinate.longitude = request.positionTarget.lon * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.hoehe = request.positionTarget.z;
exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem = ProjectDataManagement::L26_EffectingSystemType(request.weaponSystemType().underlying() + 1);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType().underlying();
exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem = static_cast<ProjectDataManagement::L26_EffectingSystemType>(static_cast<int>(request.weaponSystemType) + 1);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType;
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 L26_EffectingSystemType " << exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem;
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte
= m_mainDispatcher->pdmHandler()->getDtc()->adlerChargeTypeName(request.trajectory().chargeTypeId());
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 chargeTypeId " << request.trajectory().chargeTypeId();
= m_mainDispatcher->pdmHandler()->getDtc()->adlerChargeTypeName(request.trajectory.chargeTypeId);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 chargeTypeId " << request.trajectory.chargeTypeId;
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 geschosssorte " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte;
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender = m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterTypeName(request.trajectory().igniterTypeId());
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterTypeId " << request.trajectory().igniterTypeId();
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender = m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterTypeName(request.trajectory.igniterTypeId);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterTypeId " << request.trajectory.igniterTypeId;
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuender " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender;
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion
= m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterFunctionName(request.trajectory().igniterFunctionId());
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterFunctionId " << request.trajectory().igniterFunctionId();
= m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterFunctionName(request.trajectory.igniterFunctionId);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterFunctionId " << request.trajectory.igniterFunctionId;
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuenderFunktion " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion;
if (request.trajectory().loadTypeId() > 0)
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung = m_mainDispatcher->pdmHandler()->getDtc()->adlerLoadTypeName(request.trajectory().loadTypeId());
if (request.trajectory.loadTypeId > 0)
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung = m_mainDispatcher->pdmHandler()->getDtc()->adlerLoadTypeName(request.trajectory.loadTypeId);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 ladung " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung;
exFlugbahnberechnung.flugbahnberechnungDaten.sprenghoehe = static_cast<int>(request.explosionHeight());
exFlugbahnberechnung.flugbahnberechnungDaten.winkelgruppe = AdlerJson::Winkelgruppe(request.angleGroup().underlying());
exFlugbahnberechnung.flugbahnberechnungDaten.sprenghoehe = static_cast<int>(request.explosionHeight);
exFlugbahnberechnung.flugbahnberechnungDaten.winkelgruppe = AdlerJson::Winkelgruppe(request.angleGroup);
//////////////////////////////////////////////////
/// Daten aus dem ESG-Simulator
if (request.properties().empty())
if (request.properties.empty())
ERROR_LOG(m_logger) << "No properties available";
DEBUG_LOG(m_logger) << ", request.aesItemId() :" << request.aesItemId();
DEBUG_LOG(m_logger) << ", request.aesItemId() :" << request.aesItemId;
//////////////////////////////////////////////////
DEBUG_LOG(m_logger) << "UUID=" << exFlugbahnberechnung.uuid;
TrajectoryIdentifier trajectoryIdentifier;
trajectoryIdentifier.aesItemId = request.aesItemId();
trajectoryIdentifier.explosionId = request.explosionIndex();
trajectoryIdentifier.aesItemId = request.aesItemId;
trajectoryIdentifier.explosionId = request.explosionIndex;
QString uuidCleaned = exFlugbahnberechnung.uuid.remove(QStringLiteral("-"));
m_trajectoryIdentifier.insert(uuidCleaned, trajectoryIdentifier);
m_positionsLaunch.insert(uuidCleaned, request.positionLaunch());
m_positionsLaunch.insert(uuidCleaned, request.positionLaunch);
QJsonObject telegram;
telegram = exFlugbahnberechnung.toJson();
@@ -896,7 +896,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
const qint64 expiryTime = currentTime + 100 * 1000;
NotificationManagement::NomNotification notif;
notif.title(title.toStdString());
notif.title = title.toStdString();
const auto saa = getSAAByWs(wsId);
if (!saa)
@@ -907,25 +907,25 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
//QString content = QStringLiteral("[Open Notification List ](//nomEditGuiPlugin/)") + QStringLiteral("<br />");
const int partyId = saa->getPartyId();
const ParticipantManagement::Party party = m_ppmHandler->getDtc()->party(partyId);
const QString partyStr = QString::fromStdString(party.name());
const QString partyStr = QString::fromStdString(party.name);
std::vector<std::string> args;
args.reserve(contentArgs.size());
for (const auto & str : std::as_const(contentArgs))
args.emplace_back(str.toStdString());
notif.content(content.toStdString());
notif.contentArgs(args);
notif.timeStamp(currentTime);
notif.expiryTime(expiryTime);
notif.priority(NotificationManagement::Priority::High);
notif.processedPriority(NotificationManagement::Priority::High);
notif.exerciseId(m_mainDispatcher->exerciseId());
notif.content = content.toStdString();
notif.contentArgs = args;
notif.timeStamp = currentTime;
notif.expiryTime = expiryTime;
notif.priority = NotificationManagement::Priority::High;
notif.processedPriority = NotificationManagement::Priority::High;
notif.exerciseId = m_mainDispatcher->exerciseId();
const QVector<int> recipientIds = m_mainDispatcher->ddsHandler()->dtcOpm()->getNotificationRecipents(m_mainDispatcher->exerciseId(),
partyId,
OperatorRights::AdlerExplosionClusterEdit,
data.notification().notificationType().underlying());
static_cast<int>(data.notification.notificationType));
DEBUG_LOG(m_logger) << "getCreateNotificationRequestData recipientIds.size=" << recipientIds.size()
<< ", exerciseId=" << m_mainDispatcher->exerciseId();
std::vector<NotificationManagement::Address> recipientIdsDds;
@@ -934,22 +934,22 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
for (const auto &recipientId : std::as_const(recipientIds))
{
NotificationManagement::Address addr;
addr.addressId(recipientId);
addr.isRead(false);
addr.addressId = recipientId;
addr.isRead = false;
const OperatorManagement::User user = m_mainDispatcher->ddsHandler()->dtcOpm()->user(recipientId);
addr.name(user.name());
addr.addressType(NotificationManagement::AddressType::Operator);
notif.recipientIds().push_back(addr);
DEBUG_LOG(m_logger) << "recipientId=" << addr.name()
<< ", addr.addressId=" << addr.addressId();
addr.name = user.name;
addr.addressType = NotificationManagement::AddressType::Operator;
notif.recipientIds.push_back(addr);
DEBUG_LOG(m_logger) << "recipientId=" << addr.name
<< ", addr.addressId=" << addr.addressId;
}
NotificationManagement::Address addrSender;
addrSender.name(saa->getSAAName().toStdString());
addrSender.addressType(NotificationManagement::AddressType::Service);
notif.sender(addrSender);
addrSender.name = saa->getSAAName().toStdString();
addrSender.addressType = NotificationManagement::AddressType::Service;
notif.sender = addrSender;
data.notification(notif);
data.notification = notif;
} // end of getCreateNotificationRequestData()
void JsonDispatcher::createNotificationRequest(const int wsId,
@@ -963,16 +963,16 @@ void JsonDispatcher::createNotificationRequest(const int wsId,
<< ", content=" << content;
NotificationManagement::CreateNotification req;
getCreateNotificationRequestData(wsId, title, req, content, args);
if (req.notification().content().empty())
if (req.notification.content.empty())
{
INFO_LOG(m_logger) << "req.notification().content().empty()";
return;
}
req.notification().messageType(messageType);
req.notification().notificationType(notificationType);
req.notification.messageType = messageType;
req.notification.notificationType = notificationType;
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
if (req.notification().recipientIds().size() == 0)
if (req.notification.recipientIds.size() == 0)
{
INFO_LOG(m_logger) << "req.notification().recipientIds().size() == 0";
return;
@@ -2,6 +2,7 @@
#include "json_handler_tx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "json_dispatcher.h"
#include "ppm_handler.h"
#include "pdm_handler.h"
@@ -17,6 +18,7 @@ JsonHandlerTx::JsonHandlerTx(TrainingAreaBase::Plugin::DataProvider *pdp, MainDi
, m_mainDispatcher(mainDispatcher)
, m_webSocket(nullptr)
, m_bWebsocketConnectedToExternalSystem(false)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
void JsonHandlerTx::onWebSocketConnected(QWebSocket *webSocket)
@@ -87,7 +87,7 @@ bool MainDispatcher::init()
void MainDispatcher::onWebsocketConnected(quint16 port)
{
ERROR_LOG(m_logger) << "ApAdler started, Domain Id: " << QString::number(port);
m_ddsHandler->pacemaker()->addPort(port, Core::PortType::WebSocketAdlerServer);
m_ddsHandler->pacemaker()->addPort(port, Core::CorePortType::WebSocketAdlerServer);
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
}
@@ -2,6 +2,7 @@
#include "pdm_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
@@ -46,25 +47,25 @@ void PdmHandler::getChargeTypes()
for(const ProjectDataManagement::ChargeType &charge : chargeTypes)
{
if (charge.disEntity().empty())
if (charge.disEntity.empty())
continue;
QJsonObject chargeType;
chargeType[QStringLiteral("id")] = charge.id();
chargeType[QStringLiteral("name")] = QString::fromStdString(charge.name());
chargeType[QStringLiteral("entityTypeStruct")] = QString::fromStdString(charge.disEntity());
chargeType[QStringLiteral("id")] = charge.id;
chargeType[QStringLiteral("name")] = QString::fromStdString(charge.name);
chargeType[QStringLiteral("entityTypeStruct")] = QString::fromStdString(charge.disEntity);
int gearTypeId = 0;
for(const ProjectDataManagement::GearTypeChargeType &val : gearTypeChargeTypes)
{
if(val.chargeTypeId() == charge.id())
if(val.chargeTypeId == charge.id)
{
gearTypeId = val.gearTypeId();
gearTypeId = val.gearTypeId;
break;
}
}
chargeType[QStringLiteral("primaryGearTasCode")] = gearTypes[gearTypeId].tasCode();
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(charge.properties()));
chargeType[QStringLiteral("primaryGearTasCode")] = gearTypes[gearTypeId].tasCode;
QJsonDocument doc = QJsonDocument::fromJson(QByteArray::fromStdString(charge.properties));
QJsonObject prop = doc.object();
chargeType[QStringLiteral("radius")] = prop[QStringLiteral("impactRadius")];
@@ -2,6 +2,7 @@
#include "ppm_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <utility>
#include "Core/core.hpp"
@@ -22,6 +23,7 @@ static const int ADLER_NOT_OPERATIONAL = 127;
PpmHandler::PpmHandler(QObject *parent)
: QObject(parent)
, m_sendParticipantDataTimer(new QTimer(this))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
}
@@ -77,17 +79,17 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
ParticipantManagement::Party requestParty;
requestParty = m_dtcPpm->party(partyId);
QJsonObject origObj = QJsonDocument::fromJson(requestParty.properties().c_str()).object();
QJsonObject origObj = QJsonDocument::fromJson(requestParty.properties.c_str()).object();
QJsonObject adlerPropertiesObj = origObj[QStringLiteral("Adler")].toObject();
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = connectState.underlying();
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = static_cast<int>(connectState);
adlerPropertiesObj[QStringLiteral("szenarName")] = szenarName;
adlerPropertiesObj[QStringLiteral("saaName")] = saaName;
adlerPropertiesObj[QStringLiteral("wsId")] = wsId;
adlerPropertiesObj[QStringLiteral("assetId")] = ((connectState == ParticipantManagement::ConnectState::Connected) ? assetId : -1);
adlerPropertiesObj[QStringLiteral("isVerbund")] = isVerbund;
const QByteArray &propertiesBa = requestParty.properties().c_str();
const QByteArray &propertiesBa = requestParty.properties.c_str();
QJsonParseError parserError;
QJsonDocument doc(QJsonDocument::fromJson(propertiesBa, &parserError));
@@ -103,7 +105,7 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
obj[QStringLiteral("Adler")] = adlerPropertiesObj;
const QByteArray propertiesStr = QJsonDocument(obj).toJson(QJsonDocument::Compact);
requestParty.properties() = propertiesStr.data();
requestParty.properties = propertiesStr.data();
m_ftcPpm->modifyPartyDataRequest(requestParty);
}
@@ -145,13 +147,13 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
int superiorModId = 1000000007;
ParticipantManagement::Participant pUnit = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
if (pUdata.modId() > 0)
if (pUdata.modId > 0)
{
m_sendParticipantDataTimer->start();
return;
}
if (pUnit.id() > 0)
if (pUnit.id > 0)
{
@@ -171,38 +173,38 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
{
std::vector<ParticipantManagement::ParticipantData> list;
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType.underlying()), true, saa->getIsVerbund());
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), true, saa->getIsVerbund());
const auto root = findRootUnit(saa->getPartyId());
if (root.id() > 0)
if (root.id > 0)
{
DEBUG_LOG(m_logger) << "Append FS Unit to root Unit";
list.push_back(root);
}
ParticipantManagement::ParticipantData data = findParticipantDataByInternalName(rndNmbr, verein, saa->getIsVerbund());
data.id(0);
data.partyId(saa->getPartyId());
data.externalId(0);
data.hierarchyNumber(1);
data.name(verein.toStdString());
data.designator(verein.toStdString());
data.symbol(unitType.symbol());
data.tacticalIdentifier(verein.toStdString());
data.typeId(unitType.id());
data.modId(superiorModId);
data.isDeleted(false);
data.isSimulated(false);
data.superiorModId(root.modId());
data.id = 0;
data.partyId = saa->getPartyId();
data.externalId = 0;
data.hierarchyNumber = 1;
data.name = verein.toStdString();
data.designator = verein.toStdString();
data.symbol = unitType.symbol;
data.tacticalIdentifier = verein.toStdString();
data.typeId = unitType.id;
data.modId = superiorModId;
data.isDeleted = false;
data.isSimulated = false;
data.superiorModId = root.modId;
list.push_back(data);
ParticipantManagement::ModifyParticipantDataRequest newRequest;
newRequest.requestId(rndNmbr);
newRequest.data(list);
newRequest.requestId = rndNmbr;
newRequest.data = list;
m_tempPartDataList.insert(rndNmbr, list);
@@ -250,7 +252,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
m_tempPositionMap.insert(currentRandomNumber, posMap);
if (pp.id() > 0)
if (pp.id > 0)
{
DEBUG_LOG(m_logger) << "Found Participant only update pos";
@@ -266,9 +268,9 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
{
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType.underlying()), false, saa->getIsVerbund());
DEBUG_LOG(m_logger) << "found type with id: " << type.id() << " for name: " << waffensystemtypMap.key(internalType);
if (type.id() <= 0)
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), false, saa->getIsVerbund());
DEBUG_LOG(m_logger) << "found type with id: " << type.id << " for name: " << waffensystemtypMap.key(internalType);
if (type.id <= 0)
{
ERROR_LOG(m_logger) << "NO Type Found";
return;
@@ -280,27 +282,27 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
uint superiorModId = QRandomGenerator::global()->generate() / 2;
ParticipantManagement::Participant pUnit = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
DEBUG_LOG(m_logger) << "Looking for Verein: " << verein << " found Unit: " << pUnit.id() << " foundData: " << pUdata.modId();
DEBUG_LOG(m_logger) << "Looking for Verein: " << verein << " found Unit: " << pUnit.id << " foundData: " << pUdata.modId;
if (pUdata.modId() > 0)
if (pUdata.modId > 0)
{
superiorModId = pUdata.modId();
superiorModId = pUdata.modId;
DEBUG_LOG(m_logger) << "FOUND UNIT in list use their modId " << superiorModId << " RND: " << currentRandomNumber;
}
else if (pUnit.id() > 0)
else if (pUnit.id > 0)
{
ParticipantManagement::ParticipantData pUData = m_dtcPpm->convertParticipantToParticipantData(pUnit);
pUData.modId(superiorModId);
pUData.hierarchyNumber(1);
pUData.modId = superiorModId;
pUData.hierarchyNumber = 1;
list.push_back(pUData);
m_tempPartDataList.insert(currentRandomNumber, list);
DEBUG_LOG(m_logger) << "CREATE Uit from ppm " << superiorModId << " RND: " << currentRandomNumber;
ParticipantManagement::Participant tmp = pUnit;
while (tmp.superiorId() > 0)
while (tmp.superiorId > 0)
{
tmp = m_dtcPpm->participant(tmp.superiorId());
tmp = m_dtcPpm->participant(tmp.superiorId);
pUData = m_dtcPpm->convertParticipantToParticipantData(tmp);
list.push_back(pUData);
}
@@ -312,7 +314,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
const auto root = findRootUnit(saa->getPartyId());
if (root.id() > 0)
if (root.id > 0)
{
DEBUG_LOG(m_logger) << "Append to Unit" << superiorModId << " RND: " << currentRandomNumber;
list.push_back(root);
@@ -320,19 +322,19 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), true, saa->getIsVerbund());
DEBUG_LOG(m_logger) << "CREATE NEW Unit use supId" << superiorModId << " RND: " << currentRandomNumber;
ParticipantManagement::ParticipantData data;
data.id(0);
data.partyId(saa->getPartyId());
data.externalId(0);
data.hierarchyNumber(1);
data.name(verein.toStdString());
data.designator(verein.toStdString());
data.symbol(unitType.symbol());
data.tacticalIdentifier(verein.toStdString());
data.typeId(unitType.id());
data.modId(superiorModId);
data.isDeleted(false);
data.isSimulated(false);
data.superiorModId(root.modId());
data.id = 0;
data.partyId = saa->getPartyId();
data.externalId = 0;
data.hierarchyNumber = 1;
data.name = verein.toStdString();
data.designator = verein.toStdString();
data.symbol = unitType.symbol;
data.tacticalIdentifier = verein.toStdString();
data.typeId = unitType.id;
data.modId = superiorModId;
data.isDeleted = false;
data.isSimulated = false;
data.superiorModId = root.modId;
list.push_back(data);
}
@@ -342,19 +344,19 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
ParticipantManagement::ParticipantData data;
data.id(0);
data.partyId(saa->getPartyId());
data.externalId(0);
data.hierarchyNumber(list.size());
data.name(waffensystemkennerMap.key(internalName).toStdString());
data.designator(waffensystemkennerMap.key(internalName).toStdString());
data.symbol(type.symbol());
data.tacticalIdentifier(verein.toStdString());
data.typeId(type.id());
data.modId(QRandomGenerator::global()->generate() / 2);
data.isDeleted(false);
data.isSimulated(false);
data.superiorModId(superiorModId);
data.id = 0;
data.partyId = saa->getPartyId();
data.externalId = 0;
data.hierarchyNumber = list.size();
data.name = waffensystemkennerMap.key(internalName).toStdString();
data.designator = waffensystemkennerMap.key(internalName).toStdString();
data.symbol = type.symbol;
data.tacticalIdentifier = verein.toStdString();
data.typeId = type.id;
data.modId = QRandomGenerator::global()->generate() / 2;
data.isDeleted = false;
data.isSimulated = false;
data.superiorModId = superiorModId;
list.push_back(data);
@@ -392,7 +394,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
ParticipantManagement::Participant pp = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(QStringLiteral("LP"), false, saa->getIsVerbund());
if (pp.id() > 0)
if (pp.id > 0)
{
sendPositionFromTempMap(rndNmbr, saa->getPartyId(), saa->getIsVerbund());
@@ -416,7 +418,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
const auto root = findRootUnit(saa->getPartyId());
if (root.id() > 0)
if (root.id > 0)
{
DEBUG_LOG(m_logger) << "Append LP to Unit";
list.push_back(root);
@@ -424,23 +426,23 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
ParticipantManagement::ParticipantData data;
data.id(0);
data.partyId(saa->getPartyId());
data.externalId(0);
data.hierarchyNumber(1);
data.name(verein.toStdString());
data.designator(verein.toStdString());
data.symbol(type.symbol());
data.tacticalIdentifier(verein.toStdString());
data.typeId(type.id());
data.modId(1000000001);
data.isDeleted(false);
data.isSimulated(false);
data.superiorModId(root.modId());
data.id = 0;
data.partyId = saa->getPartyId();
data.externalId = 0;
data.hierarchyNumber = 1;
data.name = verein.toStdString();
data.designator = verein.toStdString();
data.symbol = type.symbol;
data.tacticalIdentifier = verein.toStdString();
data.typeId = type.id;
data.modId = 1000000001;
data.isDeleted = false;
data.isSimulated = false;
data.superiorModId = root.modId;
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
newRequest->requestId(rndNmbr);
newRequest->requestId = rndNmbr;
list.push_back(data);
newRequest->data(list);
newRequest->data = list;
m_tempPartDataList.insert(rndNmbr, list);
@@ -459,18 +461,18 @@ void PpmHandler::removeAllSAAParticipants(const int partyId)
std::vector<ParticipantManagement::ParticipantData> list;
for (const auto &part : std::as_const(participants))
{
const ParticipantManagement::Type &participantType = m_dtcPpm->type(part.typeId());
const ParticipantManagement::Type &participantType = m_dtcPpm->type(part.typeId);
bool isUnitType
= (participantType.typeClass() == ParticipantManagement::TypeClass::Unit) || (participantType.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
= (participantType.typeClass == ParticipantManagement::TypeClass::Unit) || (participantType.typeClass == ParticipantManagement::TypeClass::SupportUnit);
if (isUnitType)
continue;
ParticipantManagement::ParticipantData pToDel;
pToDel.id() = part.id();
pToDel.isDeleted() = true;
pToDel.id = part.id;
pToDel.isDeleted = true;
list.push_back(pToDel);
}
req.data(list);
req.data = list;
DEBUG_LOG(m_logger) << "Remove all participants (without Units): " << list.size();
m_ftcPpm->modifyParticipantDataRequest(req, this);
}
@@ -484,24 +486,24 @@ void PpmHandler::onCreateParticipant()
{
ParticipantManagement::ParticipantData data;
data.id(0);
data.partyId(3);
data.externalId(0);
data.hierarchyNumber(1);
data.name("Noah Thiering");
data.designator("Hund");
data.symbol("AP6D|CMPL|10011000001308000000");
data.tacticalIdentifier("14");
data.typeId(177);
data.modId(1000000001);
data.isDeleted(false);
data.isSimulated(false);
data.superiorModId(0);
data.id = 0;
data.partyId = 3;
data.externalId = 0;
data.hierarchyNumber = 1;
data.name = "Noah Thiering";
data.designator = "Hund";
data.symbol = "AP6D|CMPL|10011000001308000000";
data.tacticalIdentifier = "14";
data.typeId = 177;
data.modId = 1000000001;
data.isDeleted = false;
data.isSimulated = false;
data.superiorModId = 0;
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
newRequest->requestId(2);
newRequest->requestId = 2;
std::vector<ParticipantManagement::ParticipantData> liste;
liste.push_back(data);
newRequest->data(liste);
newRequest->data = liste;
@@ -556,26 +558,26 @@ bool PpmHandler::isEqNumberInExercise(const int equipmentNumber) const
void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &participant, DataModification modType)
{
if (!participant.equipmentNumber().is_set())
if (!participant.equipmentNumber.has_value())
{
for (auto it = m_participantIdsByEqNo.begin(); it != m_participantIdsByEqNo.end(); ++it)
if (it.value() == participant.id())
if (it.value() == participant.id)
{
m_participantIdsByEqNo.remove(it.key());
break;
}
return;
}
if (participant.externalId() > 0)
if (participant.externalId > 0)
return;
QJsonObject headerJson;
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber().get();
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber.get();
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
if (modType == DataModification::eRemoved)
{
m_participantIdsByEqNo.remove(participant.equipmentNumber().get());
m_participantIdsByEqNo.remove(participant.equipmentNumber.get());
QJsonObject telegram;
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
@@ -587,39 +589,39 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &
return;
}
if (m_participantIdsByEqNo.contains(participant.equipmentNumber().get()))
if (m_participantIdsByEqNo.contains(participant.equipmentNumber.get()))
{
if (m_participantIdsByEqNo[participant.equipmentNumber().get()] != participant.id())
if (m_participantIdsByEqNo[participant.equipmentNumber.get()] != participant.id)
{
for (auto it = m_participantIdsByEqNo.begin(); it != m_participantIdsByEqNo.end(); ++it)
if (it.value() == participant.id())
if (it.value() == participant.id)
{
m_participantIdsByEqNo.remove(it.key());
break;
}
m_participantIdsByEqNo[participant.equipmentNumber().get()] = participant.id();
m_participantIdsByEqNo[participant.equipmentNumber.get()] = participant.id;
}
}
else
m_participantIdsByEqNo[participant.equipmentNumber().get()] = participant.id();
m_participantIdsByEqNo[participant.equipmentNumber.get()] = participant.id;
ParticipantManagement::DynamicParticipantData dynamicData = m_dtcPpm->dynamicParticipantData(participant.id());
ParticipantManagement::Party party = m_dtcPpm->party(participant.partyId());
ParticipantManagement::Type type = m_dtcPpm->type(participant.typeId());
ParticipantManagement::ParticipantPosition partPos = m_dtcPpm->participantPosition(participant.id());
ParticipantManagement::DynamicParticipantData dynamicData = m_dtcPpm->dynamicParticipantData(participant.id);
ParticipantManagement::Party party = m_dtcPpm->party(participant.partyId);
ParticipantManagement::Type type = m_dtcPpm->type(participant.typeId);
ParticipantManagement::ParticipantPosition partPos = m_dtcPpm->participantPosition(participant.id);
QJsonObject telegram;
QJsonObject geoPositionObj;
geoPositionObj[QStringLiteral("lon")] = partPos.pos().lon();
geoPositionObj[QStringLiteral("lat")] = partPos.pos().lat();
geoPositionObj[QStringLiteral("z")] = partPos.pos().z();
geoPositionObj[QStringLiteral("lon")] = partPos.pos.lon;
geoPositionObj[QStringLiteral("lat")] = partPos.pos.lat;
geoPositionObj[QStringLiteral("z")] = partPos.pos.z;
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynamicData.stateHistory()).vulnerabilityState().underlying());
data[QStringLiteral("forceIdentifier")] = static_cast<int>(party.hlaForceIdentifier().underlying());
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynamicData.stateHistory).vulnerabilityState);
data[QStringLiteral("forceIdentifier")] = static_cast<int>(party.hlaForceIdentifier);
data[QStringLiteral("geoPosition")] = geoPositionObj;
telegram[QStringLiteral("data")] = data;
@@ -633,7 +635,7 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti
if (modType == DataModification::eRemoved)
return;
const bool participantIsExternal = m_dtcPpm->participant(position.participantId()).externalId() > 0;
const bool participantIsExternal = m_dtcPpm->participant(position.participantId).externalId > 0;
if (participantIsExternal)
{
@@ -650,9 +652,9 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
if (modType == DataModification::eRemoved)
return;
ParticipantManagement::Participant part = m_dtcPpm->participant(dynPartData.participantId());
ParticipantManagement::Participant part = m_dtcPpm->participant(dynPartData.participantId);
if (part.externalId() > 0 || !part.equipmentNumber().is_set())
if (part.externalId > 0 || !part.equipmentNumber.has_value())
return;
QJsonObject telegram;
@@ -660,13 +662,13 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaVulnerabilityStateChanged");
QJsonObject headerJson;
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber().get();
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber.get();
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynPartData.stateHistory()).vulnerabilityState().underlying());
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynPartData.stateHistory).vulnerabilityState);
telegram[QStringLiteral("data")] = data;
emit participantChanged(telegram);
@@ -679,57 +681,57 @@ void PpmHandler::onSendParticipantDataTimeout()
ERROR_LOG(m_logger) << "Cant Send ParticipantData RandomNumbers is empty";
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
int currentRandomNumber = m_randomNumbers.first();
newRequest->requestId(currentRandomNumber);
newRequest->data(m_tempPartDataList.value(currentRandomNumber));
newRequest->requestId = currentRandomNumber;
newRequest->data = m_tempPartDataList.value(currentRandomNumber);
m_ftcPpm->modifyParticipantDataRequest(*newRequest, this);
}
void PpmHandler::handleParticipantPositionChangedExternal(const ParticipantManagement::ParticipantPosition &position)
{
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId);
const bool participantPreviouslyMounted = m_mountedParticipants.contains(part.equipmentNumber().get());
const bool participantPreviouslyMounted = m_mountedParticipants.contains(part.equipmentNumber.get());
if (!participantPreviouslyMounted)
return;
const bool mountedOnOtherParticipant = position.mountedOn().is_set();
const bool mountedOnOtherParticipant = position.mountedOn.has_value();
if (!mountedOnOtherParticipant)
{
sendParticipantUnmount(part);
return;
}
const bool newMountedParticipantIsExternal = m_dtcPpm->participant(position.mountedOn().get()).externalId() != 0;
const bool newMountedParticipantIsExternal = m_dtcPpm->participant(position.mountedOn.get()).externalId != 0;
if (newMountedParticipantIsExternal)
{
m_mountedParticipants.remove(part.equipmentNumber().get());
m_mountedParticipants.remove(part.equipmentNumber.get());
}
}
void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position)
{
DEBUG_LOG(m_logger) << "handleParticipantPositionChangedInternal";
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId);
const bool hasMountedParticipants = position.mountedParticipants().is_set() && position.mountedParticipants().get().size() > 0;
const bool hasMountedParticipants = position.mountedParticipants.has_value() && position.mountedParticipants.get().size() > 0;
if (hasMountedParticipants)
{
const QVector<int32_t> mountedParticipantIds(position.mountedParticipants().get().begin(), position.mountedParticipants().get().end());
const QVector<int32_t> mountedParticipantIds(position.mountedParticipants.get().begin(), position.mountedParticipants.get().end());
for (int mountedParticipantId : std::as_const(mountedParticipantIds))
{
ParticipantManagement::Participant mountedParticipant = m_dtcPpm->participant(mountedParticipantId);
const bool isExternal = mountedParticipant.externalId() > 0;
const bool wasMountedOnThisPart = m_mountedParticipants.contains(mountedParticipant.equipmentNumber().get())
&& m_mountedParticipants[mountedParticipant.equipmentNumber().get()] == part.equipmentNumber().get();
const bool isExternal = mountedParticipant.externalId > 0;
const bool wasMountedOnThisPart = m_mountedParticipants.contains(mountedParticipant.equipmentNumber.get())
&& m_mountedParticipants[mountedParticipant.equipmentNumber.get()] == part.equipmentNumber.get();
if (!isExternal || wasMountedOnThisPart)
continue;
if (!part.equipmentNumber().is_set())
if (!part.equipmentNumber.has_value())
continue;
sendParticipantMount(mountedParticipant, part);
}
if (part.equipmentNumber().is_set())
if (part.equipmentNumber.has_value())
{
sendParticipantPositionChanged(position);
}
@@ -738,19 +740,19 @@ void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManag
void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &part, const ParticipantManagement::Participant &partToBeMounted)
{
m_mountedParticipants.insert(part.equipmentNumber().get(), partToBeMounted.equipmentNumber().get());
m_mountedParticipants.insert(part.equipmentNumber.get(), partToBeMounted.equipmentNumber.get());
ERROR_LOG(m_logger) << "Mount Participant";
QJsonObject telegram;
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantMount");
QJsonObject headerJson;
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber().get();
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber.get();
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
data[QStringLiteral("mountedOn")] = QJsonValue(partToBeMounted.equipmentNumber().get());
data[QStringLiteral("mountedOn")] = QJsonValue(partToBeMounted.equipmentNumber.get());
telegram[QStringLiteral("data")] = data;
emit participantMount(telegram);
@@ -758,14 +760,14 @@ void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &
void PpmHandler::sendParticipantUnmount(const ParticipantManagement::Participant &participant)
{
m_mountedParticipants.remove(participant.equipmentNumber().get());
m_mountedParticipants.remove(participant.equipmentNumber.get());
DEBUG_LOG(m_logger) << "Unmount Participant";
QJsonObject telegram;
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantUnmount");
QJsonObject headerJson;
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber().get();
headerJson[QStringLiteral("equipmentNumber")] = participant.equipmentNumber.get();
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
QJsonObject data;
@@ -777,21 +779,21 @@ void PpmHandler::sendParticipantUnmount(const ParticipantManagement::Participant
void PpmHandler::sendParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &position)
{
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId);
QJsonObject telegram;
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaPositionChanged");
QJsonObject headerJson;
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber().get();
headerJson[QStringLiteral("equipmentNumber")] = part.equipmentNumber.get();
headerJson[QStringLiteral("timeStamp")] = m_mainDispatcher->ddsHandler()->partitionTime();
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
data[QStringLiteral("lon")] = position.pos().lon();
data[QStringLiteral("lat")] = position.pos().lat();
data[QStringLiteral("z")] = position.pos().z();
data[QStringLiteral("lon")] = position.pos.lon;
data[QStringLiteral("lat")] = position.pos.lat;
data[QStringLiteral("z")] = position.pos.z;
telegram[QStringLiteral("data")] = data;
@@ -808,7 +810,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r
if (!m_tempPartDataList.contains(reply.id()))
return;
const int partyId = m_tempPartDataList.value(reply.id()).data()->partyId();
const int partyId = m_tempPartDataList.value(reply.id()).data()->partyId;
if (!m_mainDispatcher->jsonDispatcher()->getSAAByParty(partyId))
return;
@@ -853,11 +855,11 @@ QList<ParticipantManagement::Participant> PpmHandler::findAllSAAParticipants(con
const auto &list = m_dtcPpm->participants();
for (const auto &part : std::as_const(list))
{
if (part.partyId() != partyId || part.isDeleted())
if (part.partyId != partyId || part.isDeleted)
continue;
if (!m_dtcPpm->isArtilleryType(part.typeId()))
if (!m_dtcPpm->isArtilleryType(part.typeId))
continue;
if (part.name().empty())
if (part.name.empty())
continue;
ret.append(part);
}
@@ -872,10 +874,10 @@ ParticipantManagement::ParticipantData PpmHandler::findParticipantDataByInternal
{
for (const auto &part : m_tempPartDataList.value(randomNumber))
{
if (part.name() != internalName.toStdString())
if (part.name != internalName.toStdString())
continue;
if (m_dtcPpm->isAdlerVerbund(part.typeId()) != isVerbund)
if (m_dtcPpm->isAdlerVerbund(part.typeId) != isVerbund)
continue;
randomNumberInOut = randomNumber;
@@ -891,13 +893,13 @@ ParticipantManagement::ParticipantData PpmHandler::findRootUnit(const int partyI
const auto &list = m_dtcPpm->participants();
for (const auto &part : std::as_const(list))
{
if (part.partyId() != partyId || part.isDeleted())
if (part.partyId != partyId || part.isDeleted)
continue;
if (m_dtcPpm->type(part.typeId()).typeClass() != ParticipantManagement::TypeClass::Unit)
if (m_dtcPpm->type(part.typeId).typeClass != ParticipantManagement::TypeClass::Unit)
continue;
if (m_dtcPpm->isArtilleryType(part.typeId()))
if (m_dtcPpm->isArtilleryType(part.typeId))
continue;
if (part.superiorId() > 0)
if (part.superiorId > 0)
continue;
ret = m_dtcPpm->convertParticipantToParticipantData(part);
}
@@ -912,15 +914,15 @@ ParticipantManagement::Participant PpmHandler::findParticipantByInternalName(con
auto participantMap = m_dtcPpm->participants();
for (const auto &part : std::as_const(participantMap))
{
if (part.partyId() != partyId || part.isDeleted())
if (part.partyId != partyId || part.isDeleted)
continue;
if (!m_dtcPpm->isArtilleryType(part.typeId()))
if (!m_dtcPpm->isArtilleryType(part.typeId))
continue;
if (m_dtcPpm->isAdlerVerbund(part.typeId()) != isVerbund)
if (m_dtcPpm->isAdlerVerbund(part.typeId) != isVerbund)
continue;
if (part.name() != internalName.toStdString())
if (part.name != internalName.toStdString())
continue;
pp = part;
@@ -936,14 +938,14 @@ void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataMo
if (modType == DataModification::eRemoved)
return;
const ParticipantManagement::ConnectState connectState = m_dtcPpm->saaConnectedState(data.id());
const ParticipantManagement::ConnectState connectState = m_dtcPpm->saaConnectedState(data.id);
DEBUG_LOG(m_logger) << "++++ connectState: " << connectState;
if (connectState != ParticipantManagement::ConnectState::Disconnecting)
return;
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByParty(data.id());
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByParty(data.id);
if (!saa)
return;
@@ -952,7 +954,7 @@ void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataMo
EXStatus status;
status.status = Szenarstatus::Gestoppt;
m_mainDispatcher->jsonDispatcher()->onSAAStatus(saa->getWsId(), status);
m_mainDispatcher->jsonDispatcher()->onSAADeregistration(saa->getWsId(), data.id());
m_mainDispatcher->jsonDispatcher()->onSAADeregistration(saa->getWsId(), data.id);
}
void PpmHandler::sendPositionFromTempMap(int rndNmbr, const int partyId, const bool isVerbund)
@@ -967,22 +969,22 @@ void PpmHandler::sendPositionFromTempMap(int rndNmbr, const int partyId, const b
{
it.next();
ParticipantManagement::Participant pp = findParticipantByInternalName(it.key(), partyId, isVerbund);
if (pp.id() <= 0)
if (pp.id <= 0)
return;
TrainingAreaBase::EquipmentPosition equipPosReq;
Core::GeoPosition tlnPos;
TrainingAreaBase::TabPosition tabPos;
tlnPos.lat(it.value().koordinate.latitude * (M_PI / 180.0));
tlnPos.lon(it.value().koordinate.longitude * (M_PI / 180.0));
tlnPos.lat = it.value().koordinate.latitude * (M_PI / 180.0);
tlnPos.lon = it.value().koordinate.longitude * (M_PI / 180.0);
tabPos.position(tlnPos);
tabPos.reportingSource(Core::PositionReportingSource::SetByOperator);
tabPos.position = tlnPos;
tabPos.reportingSource = Core::PositionReportingSource::SetByOperator;
equipPosReq.sampleTime(m_mainDispatcher->ddsHandler()->partitionTime());
equipPosReq.position(tabPos);
equipPosReq.equipmentNumber(-1 * pp.id());
equipPosReq.sampleTime = m_mainDispatcher->ddsHandler()->partitionTime();
equipPosReq.position = tabPos;
equipPosReq.equipmentNumber = -1 * pp.id;
m_mainDispatcher->ddsHandler()->dtsTab()->publish(equipPosReq);
@@ -1015,18 +1017,18 @@ void PpmHandler::sendChargesFromTempMap(const int rndNmbr, const int partyId, co
if (chargeTypeId <= 0)
continue;
DEBUG_LOG(m_logger) << "---- participant.id:" << participant.id() << (participant.typeId() == type.id() ? " (Ladeplatz)" : "");
DEBUG_LOG(m_logger) << "---- participant.id:" << participant.id << (participant.typeId == type.id ? " (Ladeplatz)" : "");
QVector<int> gearTypesIds = m_mainDispatcher->pdmHandler()->getDtc()->gearTypeIdFromChargeTypeId(chargeTypeId);
gc.gearTypeId() = !gearTypesIds.isEmpty() ? gearTypesIds.first() : 0;
gc.gearId(participant.id());
gc.chargeTypeId(chargeTypeId);
gc.remain() = c.anzahl;
gearChargeState.charge().push_back(gc);
gc.gearTypeId = !gearTypesIds.isEmpty() ? gearTypesIds.first() : 0;
gc.gearId = participant.id;
gc.chargeTypeId = chargeTypeId;
gc.remain = c.anzahl;
gearChargeState.charge.push_back(gc);
}
gearChargeState.sampleTime(m_mainDispatcher->ddsHandler()->partitionTime());
gearChargeState.equipmentNumber(-1 * participant.id());
gearChargeState.sampleTime = m_mainDispatcher->ddsHandler()->partitionTime();
gearChargeState.equipmentNumber = -1 * participant.id;
m_mainDispatcher->ddsHandler()->dtsTab()->publish(gearChargeState);
}
m_tempChargesMap.remove(rndNmbr);
@@ -1040,9 +1042,9 @@ void PpmHandler::sendReadyMessageFromTempMap(int rndNmbr, const int partyId, con
{
ParticipantManagement::Participant participant = findParticipantByInternalName(readyMsg.first, partyId, isVerbund);
TrainingAreaBase::SpecialSensorData ssData;
ssData.sampleTime(m_mainDispatcher->ddsHandler()->partitionTime());
ssData.operationalState(convertStatus_L28(readyMsg.second));
ssData.equipmentNumber(-1 * participant.id());
ssData.sampleTime = m_mainDispatcher->ddsHandler()->partitionTime();
ssData.operationalState = convertStatus_L28(readyMsg.second);
ssData.equipmentNumber = -1 * participant.id;
m_mainDispatcher->ddsHandler()->dtsTab()->publish(ssData);
}
@@ -1051,7 +1053,7 @@ void PpmHandler::sendReadyMessageFromTempMap(int rndNmbr, const int partyId, con
int PpmHandler::convertStatus_L28(const ProjectDataManagement::L28_Status &status)
{
switch (status.underlying())
switch (status)
{
case ProjectDataManagement::L28_Status::Einsatzbereit:
return ADLER_OPERATIONAL;
@@ -7,6 +7,7 @@
#include "main_dispatcher.h"
#include "logger.h"
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_ftc.h>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
@@ -130,12 +130,12 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
geometryRef.reserve(flugbahndaten.flugbahnpunkt.size());
AreaEffectSimulation::TrajectoryAdlerModifyRequest *newRequest = new AreaEffectSimulation::TrajectoryAdlerModifyRequest();
newRequest->aesItemId(aesItemId);
newRequest->explosionIndex(exposionId);
newRequest->aesItemId = aesItemId;
newRequest->explosionIndex = exposionId;
int zone = -1;
const auto &utmLaunch = LtsCoordTrans::UtmCoordinate::fromGeographic(positionLaunch.lon(), positionLaunch.lat(), zone);
const auto &utmLaunch = LtsCoordTrans::UtmCoordinate::fromGeographic(positionLaunch.lon, positionLaunch.lat, zone);
DEBUG_LOG(m_logger) << " mmilirad: " << flugbahndaten.schussrichtung;
@@ -178,9 +178,9 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
<< ", yRelativ :" << pos.yRelativ
<< ", zRelativ :" << pos.zRelativ
<< ", zeit :" << pos.zeit
<< ", positionLaunch :" << positionLaunch.lon()
<< " / " << positionLaunch.lat()
<< " / " << positionLaunch.z()
<< ", positionLaunch :" << positionLaunch.lon
<< " / " << positionLaunch.lat
<< " / " << positionLaunch.z
<< "<< utmLaunch :" << utmLaunch.x
<< " / " << utmLaunch.y
<< " / " << utmLaunch.zone;
@@ -189,7 +189,7 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
QPointF utmLaunchPt(utmLaunch.x, utmLaunch.y);
utm += utmLaunchPt;
double z = positionLaunch.z() + pos.yRelativ;
double z = positionLaunch.z + pos.yRelativ;
LtsCoordTrans::UtmCoordinate utmCoord;
@@ -204,11 +204,11 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
matrix.rotate(useNewGrad);
Core::RelativePositionRelativeTime flightPoint;
flightPoint.offsetX() = 0;
flightPoint.offsetY() = pos.xRelativ;
flightPoint.offsetZ() = pos.yRelativ;
flightPoint.relativeTime() = pos.zeit;
QPointF point(flightPoint.offsetX(), flightPoint.offsetY());
flightPoint.offsetX = 0;
flightPoint.offsetY = pos.xRelativ;
flightPoint.offsetZ = pos.yRelativ;
flightPoint.relativeTime = pos.zeit;
QPointF point(flightPoint.offsetX, flightPoint.offsetY);
TRACE_LOG(m_logger) << " POS bevore rot: " << point;
@@ -224,30 +224,30 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
flightPoint.offsetX() = rotatePoint.x();
flightPoint.offsetY() = rotatePoint.y();
flightPoint.offsetZ() = pos.yRelativ;
flightPoint.relativeTime() = std::round(pos.zeit * 1000.0);
flightPoint.offsetX = rotatePoint.x();
flightPoint.offsetY = rotatePoint.y();
flightPoint.offsetZ = pos.yRelativ;
flightPoint.relativeTime = std::round(pos.zeit * 1000.0);
geometryRef.emplace_back(flightPoint);
}
Core::GeoPosition impactPosition;
impactPosition.lat(flugbahndaten.zielkoordinate.koordinate.latitude * M_PI / 180.0);
impactPosition.lon(flugbahndaten.zielkoordinate.koordinate.longitude * M_PI / 180.0);
impactPosition.z(flugbahndaten.zielkoordinate.hoehe);
newRequest->impactPosition(impactPosition);
newRequest->geometry(geometryRef);
newRequest->peakAltitude(flugbahndaten.gipfelhoehe);
newRequest->mhpScatterLenght(flugbahndaten.streuung.laengsstreuung);
newRequest->mhpScatterLengthDetonationHeight(flugbahndaten.streuung.laengsstreuungH);
newRequest->mhpScatterWidth(flugbahndaten.streuung.seitenstreuung);
newRequest->mhpScatterWidthDetonationHeight(flugbahndaten.streuung.seitenstreuungH);
newRequest->shootDirection((flugbahndaten.schussrichtung / 6400.) * 360);
newRequest->errorcode(static_cast<int>(flugbahndaten.fehlercode));
DEBUG_LOG(m_logger) << "!!!!!!!!!!!geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size()
<< ", newRequest->errorcode :" << newRequest->errorcode() << ", newRequest->Peak:" << newRequest->peakAltitude()
<< ", newRequest->direction:" << newRequest->shootDirection() << ", flugbahndaten.fehlercode :" << static_cast<int>(flugbahndaten.fehlercode);
impactPosition.lat = flugbahndaten.zielkoordinate.koordinate.latitude * M_PI / 180.0;
impactPosition.lon = flugbahndaten.zielkoordinate.koordinate.longitude * M_PI / 180.0;
impactPosition.z = flugbahndaten.zielkoordinate.hoehe;
newRequest->impactPosition = impactPosition;
newRequest->geometry = geometryRef;
newRequest->peakAltitude = flugbahndaten.gipfelhoehe;
newRequest->mhpScatterLenght = flugbahndaten.streuung.laengsstreuung;
newRequest->mhpScatterLengthDetonationHeight = flugbahndaten.streuung.laengsstreuungH;
newRequest->mhpScatterWidth = flugbahndaten.streuung.seitenstreuung;
newRequest->mhpScatterWidthDetonationHeight = flugbahndaten.streuung.seitenstreuungH;
newRequest->shootDirection = (flugbahndaten.schussrichtung / 6400.) * 360;
newRequest->errorcode = static_cast<int>(flugbahndaten.fehlercode);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry.size()
<< ", newRequest->errorcode :" << newRequest->errorcode << ", newRequest->Peak:" << newRequest->peakAltitude
<< ", newRequest->direction:" << newRequest->shootDirection << ", flugbahndaten.fehlercode :" << static_cast<int>(flugbahndaten.fehlercode);
m_ftcAes->trajectoryAdlerModifyRequest(*newRequest, this);
}
@@ -8,6 +8,7 @@
#include <AreaEffectSimulation/aes.hpp>
#include <AreaEffectSimulation/aes_ftc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
@@ -2,6 +2,7 @@
#include "hla_handler_rx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "hla_dispatcher.h"
#include "aes_handler.h"
#include "ppm_handler.h"
@@ -2,6 +2,7 @@
#include "pdm_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
@@ -2,6 +2,7 @@
#include "ppm_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonDocument>
@@ -101,7 +102,7 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &
if(!participant.equipmentNumber().is_set())
if(!participant.equipmentNumber().has_value())
{
for(auto it = m_participantIdsByEqNo.begin(); it != m_participantIdsByEqNo.end(); ++it)
if (it.value() == participant.id())
@@ -164,8 +165,8 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynamicData.stateHistory()).vulnerabilityState().underlying());
data[QStringLiteral("forceIdentifier")] = static_cast<int>(party.hlaForceIdentifier().underlying());
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynamicData.stateHistory()).vulnerabilityState());
data[QStringLiteral("forceIdentifier")] = static_cast<int>(party.hlaForceIdentifier());
data[QStringLiteral("ets")] = type.disEntities().empty() ? QStringLiteral("2.0.0.0.0.0.1") : fromDisInt(type.disEntities().front());
data[QStringLiteral("geoPosition")] = geoPositionObj;
@@ -184,7 +185,7 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
if (part.externalId() > 0 || !part.equipmentNumber().is_set())
if (part.externalId() > 0 || !part.equipmentNumber().has_value())
return;
QJsonObject telegram;
@@ -215,7 +216,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
ParticipantManagement::Participant part = m_dtcPpm->participant(dynPartData.participantId());
if (part.externalId() > 0 || !part.equipmentNumber().is_set())
if (part.externalId() > 0 || !part.equipmentNumber().has_value())
return;
QJsonObject telegram;
@@ -229,7 +230,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy
QJsonObject data;
data[QStringLiteral("header")] = headerJson;
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynPartData.stateHistory()).vulnerabilityState().underlying());
data[QStringLiteral("status")] = static_cast<int>(m_dtcPpm->youngestStateInformation(dynPartData.stateHistory()).vulnerabilityState());
telegram[QStringLiteral("data")] = data;
emit participantChanged(telegram);
@@ -6,6 +6,7 @@
#include "logger.h"
#include "dds_handler.h"
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
#include <QtCore/QObject>
@@ -14,7 +14,7 @@ ConvertToJsonFile::ConvertToJsonFile(const QString &txDir)
: SendToTab()
, m_bRetvalOnError(false)
, m_txDir(txDir + QLatin1Char('/'))
.getNGLLogger("TAB.Plugin.ConvertToJsonFile"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
resetSendCounter();
}
@@ -22,8 +22,7 @@ namespace TetraRadio
DirectoryCleaner::DirectoryCleaner(const QString &directory, unsigned int maxAgeSec, QObject *parent) : QObject(parent)
, m_cleanerThread(new QThread(this))
, m_worker(new DirectoryCleanerWorker(directory, maxAgeSec))
.getNGLLogger("TAB.Plugin.DirectoryCleaner")),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
QDir().mkpath(directory);
doInitialCleanup(directory);
m_worker->moveToThread(m_cleanerThread);
@@ -96,7 +95,7 @@ DirectoryCleanerWorker::DirectoryCleanerWorker(const QString &directory, unsigne
: m_directory(directory)
, m_maxAgeSec(maxAgeSec)
, m_bWarnedOnce(false)
.getNGLLogger("TRA.Plugin.DirectoryCleaner"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
void DirectoryCleanerWorker::onTimeout()
@@ -2,6 +2,7 @@
#include "hla_dispatcher.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "hla_handler_rx.h"
#include "hla_handler_tx.h"
@@ -22,6 +23,7 @@ HlaDispatcher::HlaDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_webSocket(new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this))
, m_webSocketReconnectTimer(new QTimer(this))
, m_bWarnedOnce(false)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
connect(m_webSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
this, &HlaDispatcher::onWebSocketError);
@@ -2,6 +2,7 @@
#include "hla_handler_rx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "hla_dispatcher.h"
#include <TrainingAreaBase/training_area_telegrams.h>
@@ -2,6 +2,7 @@
#include "hla_handler_tx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonDocument>
#include <QtWebSockets/QWebSocket>
@@ -12,6 +13,7 @@ HlaHandlerTx::HlaHandlerTx(TrainingAreaBase::Plugin::DataProvider *pdp)
: m_pdp(pdp)
, m_webSocket(nullptr)
, m_bHlaConnectedToExternalSystem(false)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
void HlaHandlerTx::onHlaConnected(QWebSocket *webSocket)
@@ -2,6 +2,7 @@
#include "main_dispatcher.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "main_handler_tx.h"
#include "hla_dispatcher.h"
#include "hla_handler_tx.h"
@@ -14,6 +15,7 @@ MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
: m_wlsDispatcher(new HlaDispatcher(pdp, recvFromTabCb, settings))
, m_recvFromTabCb(recvFromTabCb)
, m_mainHandlerTx(std::make_shared<MainHandlerTx>(std::dynamic_pointer_cast<HlaHandlerTx>(m_wlsDispatcher->sendToTab())))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
MainDispatcher::~MainDispatcher()
@@ -2,6 +2,7 @@
#include "main_handler_tx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "hla_handler_tx.h"
using namespace TrainingAreaBase;
@@ -10,6 +11,7 @@ namespace HlaJson
{
MainHandlerTx::MainHandlerTx(const std::shared_ptr<HlaHandlerTx> &wlsTx)
: m_wlsHandlerTx(wlsTx)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
SendToTab::HandleState MainHandlerTx::canHandleTelegram(int equipmentNumber, int telegramId) const
@@ -2,6 +2,7 @@
#include "nmea_handler_rx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <TrainingAreaBase/training_area_telegrams.h>
#include <QtCore/QDateTime>
#include <QtCore/QJsonDocument>
@@ -13,8 +13,7 @@ namespace TetraRadio
ConvertFromJson::ConvertFromJson(const std::shared_ptr<TrainingAreaBase::RecvFromTab> &rxHandler,
const char *loggerName) : m_rxHandler(rxHandler)
, m_bWarnedOnce(false)
.getNGLLogger(loggerName)),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter)
{
@@ -12,7 +12,7 @@ ConvertToJson::ConvertToJson(const char *loggerName)
: QObject()
, SendToTab()
, m_bConnected(false)
.getNGLLogger(loggerName))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
resetSendCounter();
}
@@ -39,7 +39,7 @@ TetraJsonInterfaceImpl::TetraJsonInterfaceImpl(TrainingAreaBase::Plugin::DataPro
, m_prtCnvApp(nullptr)
, m_exerciseId(0)
, m_radioGrpId(0)
.getNGLLogger("TAB.Plugin.TetraJsonInterfaceImpl"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
N_CoPrtCnv::CoPrtCnvTelegramConverter::setUse2BytesForSingleFireDiameter(
settings->settings()->value(QLatin1String("AES/use2BytesForSingleFireDiameter"), true).toBool());
@@ -68,16 +68,16 @@ bool TetraJsonInterfaceImpl::init()
void TetraJsonInterfaceImpl::exerciseChanged()
{
NOTICE_LOG(m_logger) << "TetraJsonInterfaceImpl::exerciseChanged";
if (m_pdp->exerciseRadioGroup().id() != m_radioGrpId)
if (m_pdp->exerciseRadioGroup().id != m_radioGrpId)
if (!updatePrtCnv())
ERROR_LOG(m_logger) << "Error changing PrtCnv state from radio grp id: "
<< m_radioGrpId
<< " to " << m_pdp->exerciseRadioGroup().id();
<< " to " << m_pdp->exerciseRadioGroup().id;
}
bool TetraJsonInterfaceImpl::updatePrtCnv()
{
int newRadioGrpId = m_pdp->exerciseRadioGroup().id();
int newRadioGrpId = m_pdp->exerciseRadioGroup().id;
if (newRadioGrpId == m_radioGrpId)
{
@@ -103,13 +103,13 @@ bool TetraJsonInterfaceImpl::updatePrtCnv()
s.setValue(QStringLiteral("Common/LogTelegramPath"), QStringLiteral("logdata/ex_%1").arg(m_exerciseId));
s.setValue(QStringLiteral("Common/LogTelegramPrefix"), QStringLiteral("PrtCnv_ex_%1").arg(m_exerciseId));
s.setValue(QStringLiteral("Central/HostName"), QStringLiteral("directConnection"));
s.setValue(QStringLiteral("Radio/HostName"), QString::fromStdString(radioGrp.radioHostname()));
s.setValue(QStringLiteral("Radio/Port"), radioGrp.radioPort());
s.setValue(QStringLiteral("Radio/HostName1"), QString::fromStdString(radioGrp.radioBackupHostname()));
s.setValue(QStringLiteral("Radio/Port1"), radioGrp.radioBackupPort());
s.setValue(QStringLiteral("Radio/HostISSI"), radioGrp.issi());
s.setValue(QStringLiteral("Radio/BroadcastISSI"), radioGrp.group_issi1());
s.setValue(QStringLiteral("Radio/ListenGroups"), radioGrp.group_issi2());
s.setValue(QStringLiteral("Radio/HostName"), QString::fromStdString(radioGrp.radioHostname));
s.setValue(QStringLiteral("Radio/Port"), radioGrp.radioPort);
s.setValue(QStringLiteral("Radio/HostName1"), QString::fromStdString(radioGrp.radioBackupHostname));
s.setValue(QStringLiteral("Radio/Port1"), radioGrp.radioBackupPort);
s.setValue(QStringLiteral("Radio/HostISSI"), radioGrp.issi);
s.setValue(QStringLiteral("Radio/BroadcastISSI"), radioGrp.group_issi1);
s.setValue(QStringLiteral("Radio/ListenGroups"), radioGrp.group_issi2);
s.setValue(QStringLiteral("Radio/UseScrambling"), m_pdp->useTetraScrambling() ? 1 : 0);
s.setValue(QStringLiteral("Injection/Port"), m_socketDispatcher->randomListenPort());
NOTICE_LOG(m_logger) << "TetraJson Injection/Port = " << s.value(QStringLiteral("Injection/Port")).toInt();
@@ -2,6 +2,7 @@
#include "uav_commander_impl.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "logger.h"
#include <LtsCoordTrans/lts_coord_trans.h>
@@ -23,7 +23,7 @@ FromTab::FromTab(const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler
, m_sendToDds(sendToDds)
, m_uavIAManager(uavIAManager)
, m_exerciseId(exerciseId)
.getNGLLogger("FromTab"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
m_dtcPpm->enableUAS();
m_dtcPpm->enableParticipant();
@@ -43,7 +43,7 @@ TrainingAreaBase::SendToTab::HandleState FromTab::canHandleTelegram(int equipmen
}
const auto &part = m_dtcPpm->participant(uas.participantId());
if (!part.equipmentNumber().is_set())
if (!part.equipmentNumber().has_value())
{
continue;
}
@@ -7,6 +7,7 @@
#include <TrainingAreaBase/send_to_tab.h>
#include <TrainingAreaBase/dds_handler.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
namespace ProjectDataManagement { namespace Interface { class Dtc; } }
@@ -2,6 +2,7 @@
#include "plugin_instance.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "from_tab.h"
#include "uav_ia_manager.h"
@@ -11,6 +12,7 @@
#include <CentralEffectSimulation/ces_dtc.h>
#include <ProjectDataManagement/pdm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <FileManagement/flm_dtc.h>
#include <Lts/Services/FileManagement/flm_ftc.h>
@@ -2,7 +2,9 @@
#include "uav_ia_manager.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "ParticipantManagement/ppm_ftc.h"
#include <ParticipantManagement/ppm_dtc.h>
#include "logger.h"
#include <LtsUtilsCore/json.h>
@@ -2,6 +2,7 @@
#include "main_dispatcher.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "main_handler_tx.h"
#include "wls_dispatcher.h"
#include "wls_handler_tx.h"
@@ -20,6 +21,7 @@ MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_recvFromTabCb(recvFromTabCb)
, m_mainHandlerTx(std::make_shared<MainHandlerTx>(std::dynamic_pointer_cast<WlsHandlerTx>(m_wlsDispatcher->sendToTab()),
std::dynamic_pointer_cast<TetraHandlerTx>(m_tetraDispatcher->sendToTab())))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
N_CoPrtCnv::CoPrtCnvTelegramConverter::setUse2BytesForSingleFireDiameter(
settings->settings()->value(QLatin1String("AES/use2BytesForSingleFireDiameter"), true).toBool());
@@ -2,6 +2,7 @@
#include "main_handler_tx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "tetra_handler_tx.h"
#include "wls_handler_tx.h"
@@ -40,6 +41,7 @@ MainHandlerTx::MainHandlerTx(const std::shared_ptr<WlsHandlerTx> &wlsTx,
const std::shared_ptr<TetraHandlerTx> &tetraTx)
: m_wlsHandlerTx(wlsTx)
, m_tetraHandlerTx(tetraTx)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
SendToTab::HandleState MainHandlerTx::canHandleTelegram(int equipmentNumber, int telegramId) const
@@ -257,6 +259,30 @@ bool MainHandlerTx::txData(const TetraIcd::SetDevicePowerRequest &data)
{
return sendToTxMixin(&data);
}
bool MainHandlerTx::txData(const TetraIcd::UAVPerformMission &data)
{
return sendToTxMixin(&data);
}
bool MainHandlerTx::txData(const TetraIcd::OcCommand &data)
{
return sendToTxMixin(&data);
}
bool MainHandlerTx::txData(const TetraIcd::ExFireReadiness &data)
{
return sendToTxMixin(&data);
}
bool MainHandlerTx::txData(const TetraIcd::ExFiredReport &data)
{
return sendToTxMixin(&data);
}
bool MainHandlerTx::txData(const TetraIcd::ExConfirmationReport &data)
{
return sendToTxMixin(&data);
}
bool MainHandlerTx::txData(const TetraIcd::UAVChangeState &data)
{
return sendToTxMixin(&data);
}
template <typename T>
bool MainHandlerTx::sendToTxMixin(const T *data)
{
@@ -63,6 +63,11 @@ public:
bool txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data) override;
bool txData(const TrainingAreaBase::TetraIcd::SetDevicePowerRequest &data) override;
bool txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) override;
bool txData(const TrainingAreaBase::TetraIcd::OcCommand &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExFireReadiness &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExFiredReport &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data) override;
bool txData(const TrainingAreaBase::TetraIcd::UAVChangeState &data) override;
private:
template <typename T>
bool sendToTxMixin(const T *data);
@@ -14,6 +14,7 @@ namespace WlsTetra
std::shared_ptr<TrainingAreaBase::Plugin::Interface> TabWlsPlugin::createInterface(TrainingAreaBase::Plugin::DataProvider *pdp,
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &recvFromTabCb,
const std::shared_ptr<TrainingAreaBase::TxMixin> &sendToTabCb,
const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler,
NGL::Settings *settings)
{
Q_UNUSED(sendToTabCb);
@@ -19,6 +19,7 @@ public:
std::shared_ptr<TrainingAreaBase::Plugin::Interface> createInterface(TrainingAreaBase::Plugin::DataProvider *pdp,
const std::shared_ptr<TrainingAreaBase::RecvFromTab> &recvFromTabCb,
const std::shared_ptr<TrainingAreaBase::TxMixin> &sendToTabCb,
const std::shared_ptr<TrainingAreaBase::DdsHandler> &ddsHandler,
NGL::Settings *settings) override;
};
@@ -2,6 +2,7 @@
#include "tetra_dispatcher.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "tetra_handler_rx.h"
#include "tetra_handler_tx.h"
@@ -18,6 +19,7 @@ TetraDispatcher::TetraDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_txHandler(std::make_shared<TetraHandlerTx>())
, m_tetraPrtCnv(new TetraPrtCnv(pdp, this))
, m_dataProvider(pdp)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
connect(m_tetraPrtCnv, &TetraPrtCnv::tetraConnectionChanged,
this, &TetraDispatcher::onTetraConnectionChanged);
@@ -2,6 +2,7 @@
#include "tetra_handler_rx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <TrainingAreaBase/training_area_telegrams.h>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
@@ -2,6 +2,7 @@
#include "tetra_handler_tx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
@@ -10,6 +11,7 @@ namespace WlsTetra
TetraHandlerTx::TetraHandlerTx()
: QObject()
, SendToTab()
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
resetSendCounter();
}
@@ -248,6 +250,31 @@ bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::UAVPerformMission
Q_UNUSED(data);
return false;
}
bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::OcCommand &data)
{
Q_UNUSED(data);
return false;
}
bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExFireReadiness &data)
{
Q_UNUSED(data);
return false;
}
bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExFiredReport &data)
{
Q_UNUSED(data);
return false;
}
bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data)
{
Q_UNUSED(data);
return false;
}
bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::UAVChangeState &data)
{
Q_UNUSED(data);
return false;
}
bool TetraHandlerTx::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data)
{
@@ -62,6 +62,11 @@ public:
bool txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data) override;
bool txData(const TrainingAreaBase::TetraIcd::SetDevicePowerRequest &data) override;
bool txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) override;
bool txData(const TrainingAreaBase::TetraIcd::OcCommand &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExFireReadiness &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExFiredReport &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data) override;
bool txData(const TrainingAreaBase::TetraIcd::UAVChangeState &data) override;
bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data);
Q_SIGNALS:
@@ -2,6 +2,7 @@
#include "plugin.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "tetra_prtcnv.h"
#include <nglsettings/nglsettings_connections.h>
#include <QtCore/QCoreApplication>
@@ -20,6 +21,7 @@ TetraPrtCnv::TetraPrtCnv(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_prtCnvApp(nullptr)
, m_exerciseId(0)
, m_radioGrpId(0)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
TetraPrtCnv::~TetraPrtCnv()
@@ -41,11 +43,11 @@ bool TetraPrtCnv::init()
void TetraPrtCnv::onExerciseChanged()
{
if (m_pdp->exerciseRadioGroup().id() != m_radioGrpId)
if (m_pdp->exerciseRadioGroup().id != m_radioGrpId)
if (!updatePrtCnv())
ERROR_LOG(m_logger) << "Error changing PrtCnv state from radio grp id: "
<< m_radioGrpId
<< " to " << m_pdp->exerciseRadioGroup().id();
<< " to " << m_pdp->exerciseRadioGroup().id;
}
void TetraPrtCnv::logWlsTelegram(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele, bool bIsSend)
@@ -56,7 +58,7 @@ void TetraPrtCnv::logWlsTelegram(const TrainingAreaBase::TetraIcd::TrainingAreaT
bool TetraPrtCnv::updatePrtCnv()
{
int newRadioGrpId = m_pdp->exerciseRadioGroup().id();
int newRadioGrpId = m_pdp->exerciseRadioGroup().id;
if (newRadioGrpId == m_radioGrpId)
{
@@ -83,13 +85,13 @@ bool TetraPrtCnv::updatePrtCnv()
s.setValue(QStringLiteral("Common/LogTelegramPath"), QStringLiteral("logdata/ex_%1").arg(m_exerciseId));
s.setValue(QStringLiteral("Common/LogTelegramPrefix"), QStringLiteral("PrtCnv_ex_%1").arg(m_exerciseId));
s.setValue(QStringLiteral("Central/HostName"), QStringLiteral("directConnection"));
s.setValue(QStringLiteral("Radio/HostName"), QString::fromStdString(radioGrp.radioHostname()));
s.setValue(QStringLiteral("Radio/Port"), radioGrp.radioPort());
s.setValue(QStringLiteral("Radio/HostName1"), QString::fromStdString(radioGrp.radioBackupHostname()));
s.setValue(QStringLiteral("Radio/Port1"), radioGrp.radioBackupPort());
s.setValue(QStringLiteral("Radio/HostISSI"), radioGrp.issi());
s.setValue(QStringLiteral("Radio/BroadcastISSI"), radioGrp.group_issi1());
s.setValue(QStringLiteral("Radio/ListenGroups"), radioGrp.group_issi2());
s.setValue(QStringLiteral("Radio/HostName"), QString::fromStdString(radioGrp.radioHostname));
s.setValue(QStringLiteral("Radio/Port"), radioGrp.radioPort);
s.setValue(QStringLiteral("Radio/HostName1"), QString::fromStdString(radioGrp.radioBackupHostname));
s.setValue(QStringLiteral("Radio/Port1"), radioGrp.radioBackupPort);
s.setValue(QStringLiteral("Radio/HostISSI"), radioGrp.issi);
s.setValue(QStringLiteral("Radio/BroadcastISSI"), radioGrp.group_issi1);
s.setValue(QStringLiteral("Radio/ListenGroups"), radioGrp.group_issi2);
s.setValue(QStringLiteral("Radio/UseScrambling"), m_pdp->useTetraScrambling() ? 1 : 0);
s.setValue(QStringLiteral("Injection/Port"), randomListenPort());
s.sync();
@@ -2,6 +2,7 @@
#include "wls_dispatcher.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "wls_handler_rx.h"
#include "wls_handler_tx.h"
@@ -22,6 +23,7 @@ WlsDispatcher::WlsDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_webSocket(new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this))
, m_webSocketReconnectTimer(new QTimer(this))
, m_bWarnedOnce(false)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
connect(m_webSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
this, &WlsDispatcher::onWebSocketError);
@@ -2,6 +2,7 @@
#include "wls_handler_rx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "wls_dispatcher.h"
#include <TrainingAreaBase/training_area_telegrams.h>
@@ -2,6 +2,7 @@
#include "wls_handler_tx.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "wls_dispatcher.h"
#include <QtCore/QJsonDocument>
@@ -19,6 +20,7 @@ WlsHandlerTx::WlsHandlerTx(TrainingAreaBase::Plugin::DataProvider *pdp, WlsDispa
, m_webSocket(nullptr)
, m_dispatcher(dispatcher)
, m_bWlsConnectedToExternalSystem(false)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
void WlsHandlerTx::onWlsConnected(QWebSocket *webSocket)
@@ -288,16 +290,41 @@ bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::SelectiveReammunitio
return sendToTx(&data);
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data)
{
return sendToTx(&data);
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data)
{
Q_UNUSED(data);
return false;
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::SetDevicePowerRequest &data)
{
Q_UNUSED(data);
return false;
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::OcCommand &data)
{
Q_UNUSED(data);
return false;
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExFireReadiness &data)
{
Q_UNUSED(data);
return false;
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExFiredReport &data)
{
Q_UNUSED(data);
return false;
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data)
{
Q_UNUSED(data);
return false;
}
bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::UAVChangeState &data)
{
Q_UNUSED(data);
return false;
}
void WlsHandlerTx::onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible)
{
@@ -64,6 +64,11 @@ public:
bool txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data) override;
bool txData(const TrainingAreaBase::TetraIcd::SetDevicePowerRequest &data) override;
bool txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) override;
bool txData(const TrainingAreaBase::TetraIcd::OcCommand &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExFireReadiness &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExFiredReport &data) override;
bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data) override;
bool txData(const TrainingAreaBase::TetraIcd::UAVChangeState &data) override;
public Q_SLOTS:
void onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible);
@@ -37,7 +37,7 @@ ExerciseManagement::Exercise ExmHandler::exercise(int exerciseId)
void ExmHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
{
if (!data.radioGroupId.is_set() || data.radioGroupId.get() == 0)
if (!data.radioGroupId.has_value() || data.radioGroupId.get() == 0)
modType = DataModification::eRemoved;
bool bExercise2RadioGroupChanged = false;
@@ -207,7 +207,7 @@ ProjectDataManagement::RadioGroup MainHandler::exerciseRadioGroup() const
}
const auto ex = m_exmHandler->exercise(exerciseId());
if (ex.radioGroupId.is_set())
if (ex.radioGroupId.has_value())
return m_pdmHandler->radioGroup(ex.radioGroupId.get());
return ProjectDataManagement::RadioGroup();
}
@@ -50,7 +50,7 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti
ParticipantManagement::Participant participant = m_ppmDtc->participant(data.participantId);
int equipNo = 0;
if (participant.equipmentNumber.is_set())
if (participant.equipmentNumber.has_value())
equipNo = participant.equipmentNumber.get();
if (equipNo > 0)
@@ -422,7 +422,7 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
sendResumeEffectSimulation(data);
}
else if (!data.effectStart.is_set() ||
else if (!data.effectStart.has_value() ||
data.effectStart.get() == 0 ||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved ||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
@@ -700,14 +700,14 @@ void setCommonParams(T &out, const S &in, const int aesTetraId)
Q_UNUSED(aesTetraId);
out.name = in.name;
out.partyId = in.partyId.is_set() ? in.partyId.get() : 0;
out.partyId = in.partyId.has_value() ? in.partyId.get() : 0;
}
template<typename T, typename S>
void setCommonCombatParams(T &out, const S &in, const int aesTetraId)
{
setCommonParams(out, in, aesTetraId);
out.effectStart = in.effectStart.is_set() ? in.effectStart.get() : 0;
out.effectStart = in.effectStart.has_value() ? in.effectStart.get() : 0;
out.effectDuration = in.effectDuration;
}
@@ -1275,7 +1275,7 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
aes.originalEffectDuration,
aes.effectDuration);
dAes.nextImpact = aes.remainExplosionNumber;
dAes.resumeTime = aes.effectStart.is_set() ? aes.effectStart.get() : 0;
dAes.resumeTime = aes.effectStart.has_value() ? aes.effectStart.get() : 0;
dAes.remainDuration = aes.effectDuration;
txData(dAes);
@@ -1315,7 +1315,7 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
aes.originalEffectDuration,
aes.effectDuration);
dAes.nextImpact = aes.remainExplosionNumber;
dAes.resumeTime = aes.effectStart.is_set() ? aes.effectStart.get() : 0;
dAes.resumeTime = aes.effectStart.has_value() ? aes.effectStart.get() : 0;
dAes.remainDuration = aes.effectDuration;
txData(dAes);
@@ -147,9 +147,9 @@ void RecvFromDdsFts::onSendLanguageSelectionRequest(const rti::core::SampleIdent
void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdentity &cookie, const SendEquipmentMessageRequest &request)
{
if (request.sender.is_set() &&
request.subject.is_set() &&
request.message.is_set())
if (request.sender.has_value() &&
request.subject.has_value() &&
request.message.has_value())
{
// Message to O/C
TetraIcd::EquipmentMessageOC data;
@@ -173,9 +173,9 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti
else
{
TetraIcd::EquipmentMessage data;
if (request.messageId.is_set())
if (request.messageId.has_value())
data.msgId = request.messageId.get();
else if (request.message.is_set())
else if (request.message.has_value())
data.message = request.message.get();
else
{
@@ -336,8 +336,8 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
else
data.originatorEquipmentNumber = request.originatorEquipmentNumber;
const auto &tabPos = request.position;
data.buildingId = tabPos.moutObjectId.is_set() ? tabPos.moutObjectId.get() : 0;
data.roomId = tabPos.moutRoomId.is_set() ? tabPos.moutRoomId.get() : 0;
data.buildingId = tabPos.moutObjectId.has_value() ? tabPos.moutObjectId.get() : 0;
data.roomId = tabPos.moutRoomId.has_value() ? tabPos.moutRoomId.get() : 0;
data.remainEffectPercent = request.remainEffectPercent;
data.relPosition = m_mainHandler->posHandler()->geographicToRelative(tabPos.position);
@@ -262,7 +262,7 @@ void SendToDds::rxData(const TetraIcd::StateChangeDirect &inData)
{
TetraIcd::MineTriggered mt;
mt.header.timeStamp = inData.header.timeStamp;
if (outData.position.is_set())
if (outData.position.has_value())
{
const TrainingAreaBase::TabPosition pos = outData.position.get();
mt.relPosition = m_posHandler->geographicToRelative(pos.position);
@@ -1108,7 +1108,7 @@ bool SendToDds::setPosition(T &data,
}
if (lastPosition.reportingSource == Core::PositionReportingSource::Ops &&
lastPosition.moutObjectId.is_set())
lastPosition.moutObjectId.has_value())
{
DEBUG_LOG(m_logger) << "Check leave Building equipmentNumber=" << data.equipmentNumber;
DEBUG_LOG(m_logger) << "relPos=" << relPos.offsetX << "/" << relPos.offsetY;