Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1718 files changed
+126739
-18495
No files matched your search
+227
-227
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user