Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+83
-83
@@ -47,24 +47,24 @@ bool AesHandler::init(MainDispatcher *mainDispatcher)
|
||||
|
||||
if (!m_ftcAes->enableAirSupportImpactModify() || !m_dtcAes->enableExplosionSingle())
|
||||
{
|
||||
ERROR_LOG() << "Can not enableAirSupportImpactModify or enableExplosionSingle";
|
||||
ERROR_LOG(m_logger) << "Can not enableAirSupportImpactModify or enableExplosionSingle";
|
||||
|
||||
}
|
||||
|
||||
if (!m_dtcAes->enableExplosionCluster() || !m_ftcAes->enableExplosionClusterModify() || !m_ftcAes->enableExplosionClusterReleaseReceived()
|
||||
|| !m_ftcAes->enableExplosionClusterPauseResume() || !m_ftcAes->enableTrajectoryAdlerModify() || !m_ftcAes->enableEffectClusterFireHalt())
|
||||
{
|
||||
ERROR_LOG() << "Can not enableExplosionCluster or enableExplosionClusterModify";
|
||||
ERROR_LOG(m_logger) << "Can not enableExplosionCluster or enableExplosionClusterModify";
|
||||
|
||||
}
|
||||
if (!m_dtcAes->enableEffectCluster() || !m_ftcAes->enableEffectClusterModify() || !m_ftcAes->enableEffectClusterReleaseReceived()
|
||||
|| !m_ftcAes->enableEffectClusterPauseResume() || !m_ftcAes->enableEffectClusterRemove())
|
||||
{
|
||||
ERROR_LOG() << "Can not enableEffectnCluster or enableEffectClusterModify";
|
||||
ERROR_LOG(m_logger) << "Can not enableEffectnCluster or enableEffectClusterModify";
|
||||
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "------ Connect Explosion Single Changed ------- ";
|
||||
DEBUG_LOG(m_logger) << "------ Connect Explosion Single Changed ------- ";
|
||||
connect(m_dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::explosionSingleChanged, this, &AesHandler::onExplosionSingleChanged);
|
||||
connect(m_dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::effectClusterChanged, this, &AesHandler::onEffectClusterChanged);
|
||||
|
||||
@@ -73,24 +73,24 @@ bool AesHandler::init(MainDispatcher *mainDispatcher)
|
||||
|
||||
void AesHandler::onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onOffRouteMineModifyReply"
|
||||
DEBUG_LOG(m_logger) << "onOffRouteMineModifyReply"
|
||||
<< ", replyObject.id :" << replyObject.id() << ", str :" << replyObject.str() << ", tanslated :" << replyObject.translated();
|
||||
};
|
||||
|
||||
void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onEffectClusterModifyReply"
|
||||
DEBUG_LOG(m_logger) << "onEffectClusterModifyReply"
|
||||
<< ", replyObject.id :" << replyObject.id() << ", str :" << replyObject.str() << ", tanslated :" << replyObject.translated()
|
||||
<< ", additinal Info :" << replyObject.additionalInfo();
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
|
||||
DEBUG_LOG() << "Got Reply";
|
||||
DEBUG_LOG(m_logger) << "Got Reply";
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
|
||||
|
||||
DEBUG_LOG() << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated();
|
||||
DEBUG_LOG(m_logger) << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated();
|
||||
ExTqTechnischeQuittung extq;
|
||||
extq.technischeDaten.beschreibung = replyObject.translated();
|
||||
extq.technischeDaten.status = Status_L32::DAT;
|
||||
@@ -100,11 +100,11 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
}
|
||||
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(replyObject.additionalInfo())).object();
|
||||
|
||||
ERROR_LOG() << "Try send notification0";
|
||||
ERROR_LOG(m_logger) << "Try send notification0";
|
||||
m_aesId = replyObject.id();
|
||||
ProjectDataManagement::EffectSource effectSource
|
||||
= static_cast<ProjectDataManagement::EffectSource::type>(propertiesObject.value(QStringLiteral("effectSource")).toInt());
|
||||
ERROR_LOG() << "Try send notification1 " << effectSource;
|
||||
ERROR_LOG(m_logger) << "Try send notification1 " << effectSource;
|
||||
|
||||
if (effectSource != ProjectDataManagement::EffectSource::ES_ADLER)
|
||||
return;
|
||||
@@ -181,14 +181,14 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
m_mainDispatcher->ddsHandler()->ftcNom()->createNotificationRequest(req, this);
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << "No recipent found for exercise";
|
||||
WARNING_LOG(m_logger) << "No recipent found for exercise";
|
||||
|
||||
}
|
||||
|
||||
void AesHandler::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Got onCreateNotificationReply ERROR: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << "Got onCreateNotificationReply ERROR: " << replyObject.translated();
|
||||
}
|
||||
|
||||
bool AesHandler::sendAesModifyRequest(const QJsonObject &data)
|
||||
@@ -247,7 +247,7 @@ void AesHandler::handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::C
|
||||
{
|
||||
auto strFromObj = QJsonDocument(data.toJson()).toJson(QJsonDocument::Compact);
|
||||
m_singleExplosions.insert(data.aesDdsId, AreaEffectSimulation::AesEffectState_def::EsCreated);
|
||||
DEBUG_LOG() << "TEST SINGLE EXPLOSION CREATED " << strFromObj;
|
||||
DEBUG_LOG(m_logger) << "TEST SINGLE EXPLOSION CREATED " << strFromObj;
|
||||
}
|
||||
|
||||
void AesHandler::handleEXFire(const Feuerkampfdaten &data, int wsId)
|
||||
@@ -280,7 +280,7 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
|
||||
|
||||
const auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId);
|
||||
|
||||
DEBUG_LOG() << "[EX-FQ(nFN)] data from SSA " << wsId << " : "
|
||||
DEBUG_LOG(m_logger) << "[EX-FQ(nFN)] data from SSA " << wsId << " : "
|
||||
<< "verein: " << data.verein << " "
|
||||
<< "kenner: " << data.kenner.underlying() << " "
|
||||
<< "feuerkampfReferenz: " << data.feuerkampfReferenz;
|
||||
@@ -295,18 +295,18 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
|
||||
|
||||
void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "onTrajectoryAdlerModifyReply"
|
||||
DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply"
|
||||
<< ", aesId :" << reply.id() << ", str :" << reply.str() << ", m_wirkmittelIndex :" << m_wirkmittelIndex
|
||||
<< ", m_data.feuerkommando.wirkmittel.size() :" << m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size();
|
||||
if (reply.error())
|
||||
ERROR_LOG() << reply.translated();
|
||||
ERROR_LOG(m_logger) << reply.translated();
|
||||
if (m_wirkmittelIndex == m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "TAB->SAA EX-MQ"
|
||||
DEBUG_LOG(m_logger) << "TAB->SAA EX-MQ"
|
||||
<< ", feuerkampfReferenz :" << m_wirkfeldPlanungsData.feuerkampfReferenz;
|
||||
|
||||
DEBUG_LOG() << "onTrajectoryAdlerModifyReply " << reply.id();
|
||||
DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply " << reply.id();
|
||||
ExFeuerbereit exFB;
|
||||
|
||||
exFB.feuerkampfdaten.feuerkampfReferenz = m_wirkfeldPlanungsData.feuerkampfReferenz;
|
||||
@@ -318,7 +318,7 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r
|
||||
if (m_wirkmittelIndex < m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1)
|
||||
{
|
||||
m_wirkmittelIndex++;
|
||||
DEBUG_LOG() << "sendTrajectoryAdlerModifyRequest"
|
||||
DEBUG_LOG(m_logger) << "sendTrajectoryAdlerModifyRequest"
|
||||
<< ", m_participantId :" << m_participantId << ", m_wirkmittelIndex :" << m_wirkmittelIndex << ", m_aesId :" << m_aesId;
|
||||
sendTrajectoryAdlerModifyRequest(m_wirkfeldPlanungsData, m_participantId, m_wirkmittelIndex, m_aesId);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r
|
||||
void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &data, int participantId, int wirkmittelIndex, int aesId)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "sendTrajectoryAdlerModifyRequest"
|
||||
DEBUG_LOG(m_logger) << "sendTrajectoryAdlerModifyRequest"
|
||||
<< ", participantId :" << participantId << ", wirkmittelIndex :" << wirkmittelIndex << ", aesId:" << aesId;
|
||||
std::vector<Core::RelativePositionRelativeTime> geometryRef;
|
||||
geometryRef.clear();
|
||||
@@ -338,7 +338,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
|
||||
for (int subordinate : std::as_const(subordinates))
|
||||
{
|
||||
DEBUG_LOG() << "subordinates(" << participantId << ") :" << subordinate;
|
||||
DEBUG_LOG(m_logger) << "subordinates(" << participantId << ") :" << subordinate;
|
||||
subordinatePositions.append(m_dtcPpm->participantPosition(subordinate));
|
||||
}
|
||||
|
||||
@@ -385,10 +385,10 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
matrix.rotate(-grad);
|
||||
|
||||
QPointF point(pntGeo.x(), pntGeo.y());
|
||||
DEBUG_LOG() << " POS bevore rot: " << point;
|
||||
DEBUG_LOG(m_logger) << " POS bevore rot: " << point;
|
||||
|
||||
auto rotatePoint = matrix.map(point);
|
||||
DEBUG_LOG() << " POS after rot: " << rotatePoint;
|
||||
DEBUG_LOG(m_logger) << " POS after rot: " << rotatePoint;
|
||||
|
||||
pntGeo.setX(rotatePoint.x());
|
||||
pntGeo.setY(rotatePoint.y());
|
||||
@@ -410,11 +410,11 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
impactPosition.z(data.zieldaten.koordinate.hoehe);
|
||||
newRequest->impactPosition(impactPosition);
|
||||
newRequest->geometry(geometryRef);
|
||||
DEBUG_LOG() << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size();
|
||||
DEBUG_LOG(m_logger) << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size();
|
||||
|
||||
if (newRequest->aesItemId() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "newRequest->aesItemId() <=0"
|
||||
ERROR_LOG(m_logger) << "newRequest->aesItemId() <=0"
|
||||
<< ", aesItemId :" << newRequest->aesItemId();
|
||||
return;
|
||||
}
|
||||
@@ -428,12 +428,12 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
|
||||
void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
{
|
||||
DEBUG_LOG() << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)"
|
||||
DEBUG_LOG(m_logger) << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)"
|
||||
<< ", feuerkampfReferenz :" << data.feuerkampfReferenz << ", wirkmittel.size() :" << data.feuerkommando.wirkmittel.size();
|
||||
|
||||
if (!m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId))
|
||||
{
|
||||
ERROR_LOG() << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return";
|
||||
ERROR_LOG(m_logger) << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return";
|
||||
return;
|
||||
}
|
||||
const QString &verein = data.feuerkommando.verein;
|
||||
@@ -448,7 +448,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
if (part.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Got EffectClusterData for " << verein << " but unit not found";
|
||||
ERROR_LOG(m_logger) << "Got EffectClusterData for " << verein << " but unit not found";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
AreaEffectSimulation::AesExplosionGeometry geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
AreaEffectSimulation::Area area;
|
||||
const bool createArea = data.zieldaten.breiteRadius == 0 && data.zieldaten.tiefe == 0;
|
||||
ERROR_LOG() << "create AREA??? " << createArea << " breite " << data.zieldaten.breiteRadius << " tiefe " << data.zieldaten.tiefe;
|
||||
ERROR_LOG(m_logger) << "create AREA??? " << createArea << " breite " << data.zieldaten.breiteRadius << " tiefe " << data.zieldaten.tiefe;
|
||||
|
||||
if (!createArea && data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Point)
|
||||
{
|
||||
@@ -485,7 +485,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
area.height(impactRadius * 2);
|
||||
area.width(impactRadius * 2);
|
||||
}
|
||||
@@ -515,28 +515,28 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
DEBUG_LOG() << "centerUtm="
|
||||
DEBUG_LOG(m_logger) << "centerUtm="
|
||||
<< ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone;
|
||||
const QPointF &bottomLeft = centerUtm.geographic(bl);
|
||||
DEBUG_LOG() << "bl="
|
||||
DEBUG_LOG(m_logger) << "bl="
|
||||
<< ", x :" << bl.x() << ", y :" << bl.y();
|
||||
DEBUG_LOG() << "bottomLeft="
|
||||
DEBUG_LOG(m_logger) << "bottomLeft="
|
||||
<< ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y();
|
||||
area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
|
||||
DEBUG_LOG() << "area.cornerBottomLeft="
|
||||
DEBUG_LOG(m_logger) << "area.cornerBottomLeft="
|
||||
<< ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
|
||||
DEBUG_LOG() << "cornerBottomLeftUtm="
|
||||
DEBUG_LOG(m_logger) << "cornerBottomLeftUtm="
|
||||
<< ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << " Need to generate area";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area";
|
||||
if (data.feuerkommando.wirkmittel.size() == 1)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << " Need to generate area SINGLE";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area SINGLE";
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
area.height(impactRadius * 2);
|
||||
area.width(impactRadius * 2);
|
||||
|
||||
@@ -561,25 +561,25 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
DEBUG_LOG() << "centerUtm="
|
||||
DEBUG_LOG(m_logger) << "centerUtm="
|
||||
<< ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone;
|
||||
const QPointF bottomLeft = centerUtm.geographic(bl);
|
||||
DEBUG_LOG() << "bl="
|
||||
DEBUG_LOG(m_logger) << "bl="
|
||||
<< ", x :" << bl.x() << ", y :" << bl.y();
|
||||
DEBUG_LOG() << "bottomLeft="
|
||||
DEBUG_LOG(m_logger) << "bottomLeft="
|
||||
<< ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y();
|
||||
area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
|
||||
DEBUG_LOG() << "area.cornerBottomLeft="
|
||||
DEBUG_LOG(m_logger) << "area.cornerBottomLeft="
|
||||
<< ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
|
||||
ERROR_LOG() << "cornerBottomLeftUtm="
|
||||
ERROR_LOG(m_logger) << "cornerBottomLeftUtm="
|
||||
<< ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone;
|
||||
}
|
||||
else if (data.feuerkommando.wirkmittel.size() > 1)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << " Need to generate area AREA";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area AREA";
|
||||
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
|
||||
@@ -590,7 +590,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
|
||||
|
||||
QList<AreaEffectSimulation::Area> areas;
|
||||
@@ -628,11 +628,11 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
|
||||
area = createMinimumRect(zone, vecPoints);
|
||||
DEBUG_LOG() << "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)
|
||||
{
|
||||
DEBUG_LOG() << " Need to generate area AREA";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area AREA";
|
||||
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
|
||||
@@ -677,7 +677,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
|
||||
area = createMinimumRect(zone, vecPoints);
|
||||
DEBUG_LOG() << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,9 +725,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
|
||||
effectorData.chargeStruct().igniterFunctionId()
|
||||
= m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion);
|
||||
DEBUG_LOG() << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
|
||||
DEBUG_LOG() << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
|
||||
DEBUG_LOG() << "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();
|
||||
std::vector<Core::RelativePositionRelativeTime> flightCurve;
|
||||
@@ -735,20 +735,20 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
const auto &startPos = m_dtcPpm->participantPosition(effectorData.participantId());
|
||||
const auto coordStart = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.pos().lon(), startPos.pos().lat());
|
||||
DEBUG_LOG() << "Start point: " << coordStart;
|
||||
DEBUG_LOG(m_logger) << "Start point: " << coordStart;
|
||||
|
||||
const auto coordEnd = LtsCoordTrans::UtmCoordinate::fromGeographic(effectorAdler.auftreffpunkt.koordinate.longitude * (M_PI / 180.0),
|
||||
effectorAdler.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
|
||||
DEBUG_LOG() << "End point: " << coordEnd;
|
||||
DEBUG_LOG(m_logger) << "End point: " << coordEnd;
|
||||
LtsCoordTrans::UtmCoordinate coordDiff = coordEnd;
|
||||
|
||||
coordDiff.x = coordDiff.x - coordStart.x;
|
||||
coordDiff.y = coordDiff.y - coordStart.y;
|
||||
DEBUG_LOG() << "Last point: " << coordDiff.x << " " << coordDiff.y;
|
||||
DEBUG_LOG() << "Last point ATAN: " << std::atan2(coordDiff.y, coordDiff.x);
|
||||
DEBUG_LOG(m_logger) << "Last point: " << coordDiff.x << " " << coordDiff.y;
|
||||
DEBUG_LOG(m_logger) << "Last point ATAN: " << std::atan2(coordDiff.y, coordDiff.x);
|
||||
|
||||
const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
DEBUG_LOG() << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
DEBUG_LOG(m_logger) << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
|
||||
for (const auto &flightPointAdler : std::as_const(effectorAdler.flugbahnpunkt))
|
||||
{
|
||||
@@ -761,10 +761,10 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
QTransform matrix;
|
||||
matrix.rotate(useNewGrad);
|
||||
const QPointF point(flightPoint.offsetX(), flightPoint.offsetY());
|
||||
TRACE_LOG() << " POS bevore rot: " << point;
|
||||
TRACE_LOG(m_logger) << " POS bevore rot: " << point;
|
||||
|
||||
const auto rotatePoint = matrix.map(point);
|
||||
TRACE_LOG() << " POS after rot: " << rotatePoint;
|
||||
TRACE_LOG(m_logger) << " POS after rot: " << rotatePoint;
|
||||
|
||||
flightPoint.offsetX() = rotatePoint.x();
|
||||
flightPoint.offsetY() = rotatePoint.y();
|
||||
@@ -785,8 +785,8 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.mhpScatterLengthDetonationHeight() = effectorAdler.streuung.laengsstreuungH;
|
||||
effectorData.mhpScatterWidth() = effectorAdler.streuung.seitenstreuung;
|
||||
effectorData.mhpScatterWidthDetonationHeight() = effectorAdler.streuung.seitenstreuungH;
|
||||
DEBUG_LOG() << effectorAdler.kenner;
|
||||
DEBUG_LOG() << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name()
|
||||
DEBUG_LOG(m_logger) << effectorAdler.kenner;
|
||||
DEBUG_LOG(m_logger) << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name()
|
||||
<< " effectorname: " << waffensystemkennerMap.key(effectorAdler.kenner);
|
||||
effectorData.peakHeight() = effectorAdler.gipfelhoehe;
|
||||
effectorVec.push_back(effectorData);
|
||||
@@ -809,14 +809,14 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.chargeStruct().igniterFunctionId()
|
||||
= m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion);
|
||||
|
||||
DEBUG_LOG() << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
|
||||
DEBUG_LOG() << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
|
||||
DEBUG_LOG() << "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() << "Could not find participant for partiyId " << part.partyId() << ", name " << part.name() << ", kenner " << effectorAdler.kenner;
|
||||
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;
|
||||
|
||||
@@ -852,7 +852,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
AreaEffectSimulation::TrajectoryGeoPosition trajectoryWithoutTime;
|
||||
|
||||
if (!AreaEffectSimulation::TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime))
|
||||
ERROR_LOG() << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein;
|
||||
ERROR_LOG(m_logger) << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein;
|
||||
|
||||
|
||||
|
||||
@@ -897,12 +897,12 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
req.tla(data.zieldaten.zog);
|
||||
|
||||
if (data.feuerkommando.wirkmittel.empty())
|
||||
DEBUG_LOG() << "flugzeit :"
|
||||
DEBUG_LOG(m_logger) << "flugzeit :"
|
||||
<< " -";
|
||||
else
|
||||
DEBUG_LOG() << "flugzeit :" << data.feuerkommando.wirkmittel.at(0).flugzeit;
|
||||
DEBUG_LOG(m_logger) << "flugzeit :" << data.feuerkommando.wirkmittel.at(0).flugzeit;
|
||||
|
||||
DEBUG_LOG() << "SEND " << data.feuerkampfReferenz << " ";
|
||||
DEBUG_LOG(m_logger) << "SEND " << data.feuerkampfReferenz << " ";
|
||||
int ammoCounter = 0;
|
||||
std::vector<ProjectDataManagement::L27_EffectorId> refWirkmittel;
|
||||
refWirkmittel.reserve(data.feuerkommando.wirkmittel.size());
|
||||
@@ -910,7 +910,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
for (const auto &wm : std::as_const(data.feuerkommando.wirkmittel))
|
||||
{
|
||||
ammoCounter += wm.geschoss.anzahl;
|
||||
DEBUG_LOG() << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner;
|
||||
DEBUG_LOG(m_logger) << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner;
|
||||
refWirkmittel.push_back(wm.kenner);
|
||||
}
|
||||
|
||||
@@ -966,7 +966,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
bool outOfAmmo = false;
|
||||
const int newAmmoAmount = std::max(0, refAmmoCounter - 1);
|
||||
|
||||
DEBUG_LOG() << "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)
|
||||
@@ -991,7 +991,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
exvm.feuerkampfdaten.kenner = kenner;
|
||||
exvm.feuerkampfdaten.verein = data.verein;
|
||||
|
||||
DEBUG_LOG() << "------------ SENDE ExVollzugsmeldung für ------------ " << kenner;
|
||||
DEBUG_LOG(m_logger) << "------------ SENDE ExVollzugsmeldung für ------------ " << kenner;
|
||||
|
||||
m_mainDispatcher->jsonDispatcher()->sendExVollzugsmeldung(exvm, saaPartyId);
|
||||
}
|
||||
@@ -1014,15 +1014,15 @@ void AesHandler::removeAllPendingEffectCluster(int partyId)
|
||||
if (effectClusterIds.isEmpty())
|
||||
return;
|
||||
|
||||
INFO_LOG() << "Pending effect cluster size: " << effectClusterIds.size();
|
||||
INFO_LOG(m_logger) << "Pending effect cluster size: " << effectClusterIds.size();
|
||||
Core::RemoveElementRequest req;
|
||||
for (const qint32 id : std::as_const(effectClusterIds))
|
||||
{
|
||||
req.id(id);
|
||||
INFO_LOG() << "Remove effect cluster id: " << id;
|
||||
INFO_LOG(m_logger) << "Remove effect cluster id: " << id;
|
||||
|
||||
qint32 ret = m_ftcAes->effectClusterRemoveRequest(req);
|
||||
INFO_LOG() << "m_ftsAes->effectClusterRemoveRequest(req) --> " << ret;
|
||||
INFO_LOG(m_logger) << "m_ftsAes->effectClusterRemoveRequest(req) --> " << ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1046,13 +1046,13 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "----------------- remove area ------------- ";
|
||||
DEBUG_LOG(m_logger) << "----------------- remove area ------------- ";
|
||||
m_singleExplosions.remove(data.id());
|
||||
return;
|
||||
}
|
||||
if (modType == DataModification::eAdded)
|
||||
{
|
||||
DEBUG_LOG() << "----------------- add area ------------- " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "----------------- add area ------------- " << data.effectStateId();
|
||||
m_singleExplosions.insert(data.id(), data.effectStateId());
|
||||
return;
|
||||
}
|
||||
@@ -1060,7 +1060,7 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
&& m_singleExplosions.value(data.id(), AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState_def::EsActivated)
|
||||
{
|
||||
const auto state = data.effectStateId();
|
||||
DEBUG_LOG() << "----------------- switch state ------------- " << state;
|
||||
DEBUG_LOG(m_logger) << "----------------- switch state ------------- " << state;
|
||||
m_singleExplosions.insert(data.id(), state);
|
||||
QJsonObject telegram;
|
||||
telegram[QStringLiteral("typeId")] = 80082;
|
||||
@@ -1089,12 +1089,12 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
|
||||
void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "Try auto handle effectCluster: " << data.name();
|
||||
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: " << data.name();
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Try auto handle effectCluster: probs: " << data.properties();
|
||||
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: probs: " << data.properties();
|
||||
|
||||
if (data.properties().empty())
|
||||
return;
|
||||
@@ -1102,20 +1102,20 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste
|
||||
if (!data.partyId().is_set())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "has PARTY " << data.properties();
|
||||
DEBUG_LOG(m_logger) << "has PARTY " << data.properties();
|
||||
|
||||
if (!data.participantId().is_set())
|
||||
return;
|
||||
|
||||
if (data.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER)
|
||||
return;
|
||||
DEBUG_LOG() << "has PARTICIPANTID " << data.properties();
|
||||
DEBUG_LOG(m_logger) << "has PARTICIPANTID " << data.properties();
|
||||
|
||||
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object();
|
||||
if (!propertiesObject.value(QStringLiteral("useReceived")).toBool())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "has USE RECEIVED " << data.effectStateId().underlying();
|
||||
DEBUG_LOG(m_logger) << "has USE RECEIVED " << data.effectStateId().underlying();
|
||||
|
||||
switch (data.effectStateId().underlying())
|
||||
{
|
||||
@@ -1136,7 +1136,7 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste
|
||||
|
||||
|
||||
m_aesIdToFeuerkampfReferenz.remove(data.id());
|
||||
DEBUG_LOG() << "SEND MQ for " << data.name() << " " << reference;
|
||||
DEBUG_LOG(m_logger) << "SEND MQ for " << data.name() << " " << reference;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user