Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -65,7 +65,7 @@ bool HandlerVulcano::init()
float vulcanoAttackAngleDeg = CesExplosions::Settings::vulcanoAttackAngleDeg();
float vulcanoAlphaDeg = CesExplosions::Settings::vulcanoMaximumDesignationAngleDeg();
DEBUG_LOG() << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
DEBUG_LOG(m_logger) << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
<< " vulcanoAttackAngleDeg=" << vulcanoAttackAngleDeg
<< " vulcanoAlphaDeg=" << vulcanoAlphaDeg;
@@ -77,9 +77,9 @@ bool HandlerVulcano::init()
void HandlerVulcano::onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject)
{
if (replyObject.error())
WARNING_LOG() << "Can not send TargetPositionsRequest: " << replyObject();
WARNING_LOG(m_logger) << "Can not send TargetPositionsRequest: " << replyObject();
else
DEBUG_LOG() << "TargetPositionsRequest for id " << replyObject.id() << " success\n"
DEBUG_LOG(m_logger) << "TargetPositionsRequest for id " << replyObject.id() << " success\n"
<< " replyObject.str() = " << replyObject.str();
}
@@ -97,7 +97,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
if (!data.effectStart().is_set())
{
DEBUG_LOG() << "No effectStart";
DEBUG_LOG(m_logger) << "No effectStart";
return;
}
@@ -113,13 +113,13 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
const AreaEffectSimulation::FlightCurve &fcData = data.flightCurve().get();
const AreaEffectSimulation::LaserGuiding &lgData = data.laserGuiding().get();
DEBUG_LOG() << "\n onExplosionClusterChanged id=" << data.id()
DEBUG_LOG(m_logger) << "\n onExplosionClusterChanged id=" << data.id()
<< " AesEffectState=" << data.effectStateId()
<< " lcPrf=" << lgData.lcAttack()
<< " originalEffectDuration=" << data.originalEffectDuration()
<< " effectStart=" << data.effectStart();
DEBUG_LOG() << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")"
DEBUG_LOG(m_logger) << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")"
<< " tapTimepoint=" << lgData.tapTime()
<< " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
<< " Timer interval =" << lgData.tapTime() - m_ddsHandler->currentPartitionTime();
@@ -142,7 +142,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
long long calculatedFlightDurationMSec = fcData.calculatedFlightDuration();
long long currentPartitionTime = m_ddsHandler->currentPartitionTime();
const int timerTimeout = effectStart - calculatedFlightDurationMSec - currentPartitionTime;
DEBUG_LOG() << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout;
DEBUG_LOG(m_logger) << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout;
if (timerTimeout >= 0)
timer->start(timerTimeout);
}
@@ -151,13 +151,13 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
void HandlerVulcano::onFiringTimeTimeout()
{
DEBUG_LOG() << "++++++++++++++ onFiringTimeTimeout";
DEBUG_LOG(m_logger) << "++++++++++++++ onFiringTimeTimeout";
QTimer *t = qobject_cast<QTimer *>(sender());
int aesId = t->property("aesId").toInt();
delete m_aesTimers.value(aesId);
m_aesTimers.remove(aesId);
DEBUG_LOG() << "onTimerTimeout aesId=" << aesId;
DEBUG_LOG(m_logger) << "onTimerTimeout aesId=" << aesId;
const auto &myEC = m_explosionCluster.value(aesId);
if (myEC.id() != aesId)
return;
@@ -168,7 +168,7 @@ void HandlerVulcano::onFiringTimeTimeout()
//auto dtcPpm = m_ddsHandler->dtcPpm();
//auto participantId = dtcPpm.get()->getParticipantFromPrf(prf);
//auto dpd = dtcPpm.get()->dynamicParticipantData(participantId);
//DEBUG_LOG() << "onTimerTimeout participantId=" << participantId;
//DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId;
QTimer *timer = new QTimer(this);
timer->setSingleShot(true);
QObject::connect(timer, &QTimer::timeout,
@@ -186,7 +186,7 @@ void HandlerVulcano::onFiringTimeTimeout()
const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId);
if (trajectoryTimeAware.geometry().size() < 2)
{
DEBUG_LOG() << "return";
DEBUG_LOG(m_logger) << "return";
return;
}
@@ -215,7 +215,7 @@ void HandlerVulcano::onFiringTimeTimeout()
int absTimeAtTap = myEC.effectStart().get() - timeDiffTapToExplosion;
// Und die ist in wieviel Sekunden?
int relTimeToTap = absTimeAtTap - m_ddsHandler->currentPartitionTime();
DEBUG_LOG() << "timer->start timeout= " << relTimeToTap
DEBUG_LOG(m_logger) << "timer->start timeout= " << relTimeToTap
<< " calculatedFlightDurationMSec= " << calculatedFlightDurationMSec;
if (relTimeToTap >= 0)
timer->start(relTimeToTap);
@@ -228,7 +228,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
delete m_aesTimers.value(aesId);
m_aesTimers.remove(aesId);
DEBUG_LOG() << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId;
DEBUG_LOG(m_logger) << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId;
const auto &myEC = m_explosionCluster.value(aesId);
if (myEC.id() != aesId)
return;
@@ -243,7 +243,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
auto participantId = dtcPpm->getParticipantFromPrf(prf);
auto dpd = dtcPpm->dynamicParticipantData(participantId);
const auto &designationsVec = dpd.designations();
DEBUG_LOG() << "onTimerTimeout participantId=" << participantId;
DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId;
for (const auto &designation : std::as_const(designationsVec))
{
@@ -252,15 +252,15 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId);
const std::vector<Core::GeoPositionRelativeTime> &trajGeometry = trajectoryTimeAware.geometry();
DEBUG_LOG() << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size();
DEBUG_LOG() << "Designation code=" << designation.code()
DEBUG_LOG(m_logger) << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size();
DEBUG_LOG(m_logger) << "Designation code=" << designation.code()
<< " prf=" << prf
<< " outputPower=" << designation.outputPower()
<< " designation.spotlocation=" << designation.spotLocation().lon() << "/" << designation.spotLocation().lat();
if (trajGeometry.size() < 2)
{
DEBUG_LOG() << "return";
DEBUG_LOG(m_logger) << "return";
return;
}
@@ -274,23 +274,23 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
const QPointF &pointToTestPt = CentralEffectSimulation::geographic2Utm(pointToTestGeo, &zone);
const QVector3D top(topPt.x(), topPt.y(), topGeo.z());
DEBUG_LOG() << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone;
DEBUG_LOG(m_logger) << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone;
const QVector3D bottom(bottomPt.x(), bottomPt.y(), bottomGeo.z());
DEBUG_LOG() << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone;
DEBUG_LOG(m_logger) << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone;
const QVector3D pointToTest(pointToTestPt.x(), pointToTestPt.y(), designation.spotLocation().z());
DEBUG_LOG() << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone;
DEBUG_LOG(m_logger) << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone;
float vulcanoViewAngleDeg = CesExplosions::Settings::vulcanoViewAngleDeg();
float vulcanoAttackAngleDeg = CesExplosions::Settings::vulcanoAttackAngleDeg();
DEBUG_LOG() << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
DEBUG_LOG(m_logger) << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
<< " vulcanoAttackAngleDeg=" << vulcanoAttackAngleDeg;
if (! isInCone(top, bottom, vulcanoAttackAngleDeg, pointToTest))
{
DEBUG_LOG() << "Punkt ist ausserhalb des Attack Angles. ";
DEBUG_LOG(m_logger) << "Punkt ist ausserhalb des Attack Angles. ";
return;
}
@@ -304,14 +304,14 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
double angle = CesExplosions::Settings::vulcanoMaximumDesignationAngleDeg();
DEBUG_LOG() << "isInAngle fe=" << fe.x() << "/" << fe.y()
DEBUG_LOG(m_logger) << "isInAngle fe=" << fe.x() << "/" << fe.y()
<< ", lp=" << lp.x() << "/" << lp.y()
<< ", observer=" << observer.x() << "/" << observer.y()
<< ", angle=" << angle
<< ", zone=" << zone;
if (! isInCone(lp, fe, angle, observer))
{
DEBUG_LOG() << "Keine neue Vulcano-Pos: Winkel ist zu gross. ";
DEBUG_LOG(m_logger) << "Keine neue Vulcano-Pos: Winkel ist zu gross. ";
return;
}
@@ -322,7 +322,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
AreaEffectSimulation::TargetPositionsModifyRequest posModify;
posModify.aesItemId(aesId);
posModify.positions().push_back(designation.spotLocation());
DEBUG_LOG() << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z()
DEBUG_LOG(m_logger) << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z()
<< " designation.z=" << designation.spotLocation().z()
<< " PosVulcano=" << posVulcano.lon() << "/" << posVulcano.lat();
m_ddsHandler->ftcAes()->targetPositionsModifyRequest(posModify, this);
@@ -339,7 +339,7 @@ AreaEffectSimulation::TrajectoryTimeAware HandlerVulcano::firstTrajectoryTimeAwa
ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation);
if (trajectories.empty())
{
DEBUG_LOG() << "no trajectories found for originatorId/aesItemId " << aesId;
DEBUG_LOG(m_logger) << "no trajectories found for originatorId/aesItemId " << aesId;
return {};
}
Q_ASSERT_X(trajectories.size() == 1, __FUNCTION__, "For Vulcano there should be just one trajectory");
@@ -356,14 +356,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
const qint64 relTime = timeParam - trajectoryTimeAwareValue.trajectoryStartTime();
//trajectoryTimeAwareValue = trajectoryTimeAware(aesId);
DEBUG_LOG() << " getTrajectoryPosFromTime aesId=" << aesId
DEBUG_LOG(m_logger) << " getTrajectoryPosFromTime aesId=" << aesId
<< " trajectoryTimeAwareValue.id=" << trajectoryTimeAwareValue.id()
<< " time=" << timeParam
<< " trajectoryStartTime=" << trajectoryTimeAwareValue.trajectoryStartTime()
<< " relTime=" << relTime;
if (trajectoryTimeAwareValue.geometry().empty())
{
DEBUG_LOG() << "getTrajectoryPosFromTime no pos available";
DEBUG_LOG(m_logger) << "getTrajectoryPosFromTime no pos available";
return {};
}
@@ -371,7 +371,7 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
int i = 0;
for (const auto &point : std::as_const(trajectoryTimeAwareValue.geometry()))
{
DEBUG_LOG() << "time=" << point.relativeTime();
DEBUG_LOG(m_logger) << "time=" << point.relativeTime();
if ( (point.relativeTime() > relTime) && (i > 0))
{
// Beachte: Geschwindigkeit wird _NICHT_ beruecksichtigt
@@ -382,14 +382,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
// result.z() = trajectoryTimeAwareValue.geometry()[i -1].z();
// and take benefits from downcasting
result = geoPosRelTime; // implicit downcast :-)
DEBUG_LOG() << "found i=" << i
DEBUG_LOG(m_logger) << "found i=" << i
<< " result=" << result.lat() << "/" << result.lon() << "/" << result.z();
return result;
}
++i;
} // for
result = trajectoryTimeAwareValue.geometry().back();
DEBUG_LOG() << " return last point result="
DEBUG_LOG(m_logger) << " return last point result="
<< " result=" << result.lat() << "/" << result.lon() << "/" << result.z();
return result;
@@ -400,14 +400,14 @@ void HandlerVulcano::onDynamicParticipantChanged(const ParticipantManagement::Dy
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG() << "onDynamicParticipantChanged"
DEBUG_LOG(m_logger) << "onDynamicParticipantChanged"
<< data.participantId()
<< data.designations().size();
if (data.designations().size() > 0)
{
for (const ParticipantManagement::LaserDesignation &designation : std::as_const(data.designations()))
{
DEBUG_LOG() << "gearId=" << designation.gearId()
DEBUG_LOG(m_logger) << "gearId=" << designation.gearId()
<< " code=" << designation.code()
<< " z=" << designation.spotLocation().z()
<< " outputPower=" << designation.outputPower();
@@ -36,7 +36,7 @@ CesExplosionInterfaceImpl::CesExplosionInterfaceImpl(CentralEffectSimulation::Pl
, m_logger(CentralEffectSimulation::getLogger("Plugin.Explosions.HandlerExplosions"))
{
Q_UNUSED(settings)
DEBUG_LOG() << "CesExplosionInterfaceImpl";
DEBUG_LOG(m_logger) << "CesExplosionInterfaceImpl";
}
CesExplosionInterfaceImpl::~CesExplosionInterfaceImpl()
@@ -48,11 +48,11 @@ CesExplosionInterfaceImpl::~CesExplosionInterfaceImpl()
bool CesExplosionInterfaceImpl::init(int domainId, int exerciseId)
{
DEBUG_LOG() << "CesExplosionInterfaceImpl init";
DEBUG_LOG(m_logger) << "CesExplosionInterfaceImpl init";
m_domainId = domainId;
m_exerciseId = exerciseId;
INFO_LOG() << "CesExplosionsInterfaceImpl::init()"
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init()"
<< " m_domainId=" << m_domainId
<< " m_exerciseId=" << m_exerciseId;
@@ -66,22 +66,22 @@ bool CesExplosionInterfaceImpl::init(int domainId, int exerciseId)
if (!m_handlerExplosions->init())
{
ERROR_LOG() << "Initialisation m_handlerExplosions failed.";
ERROR_LOG(m_logger) << "Initialisation m_handlerExplosions failed.";
return false;
}
INFO_LOG() << "CesExplosionsInterfaceImpl::init() return true";
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init() return true";
// initialize handlerVulcano
m_handlerVulcano = std::make_shared<HandlerVulcano>(m_ddsHandler, this);
if (!m_handlerVulcano->init())
{
ERROR_LOG() << "Initialisation m_handlerVulcano failed.";
ERROR_LOG(m_logger) << "Initialisation m_handlerVulcano failed.";
return false;
}
INFO_LOG() << "CesExplosionsInterfaceImpl::init() return true";
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init() return true";
return true;
}
@@ -90,8 +90,8 @@ QString CesExplosionInterfaceImpl::echo(const QString &message)
{
QString ret(QStringLiteral("<<<< %1 >>>> CesExplosionsInterfaceImpl::echo").arg(message));
INFO_LOG() << "CesExplosionsInterfaceImpl::echo return:" << ret;
DEBUG_LOG() << "DEBUG: CesExplosionsInterfaceImpl::echo return:" << ret;
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::echo return:" << ret;
DEBUG_LOG(m_logger) << "DEBUG: CesExplosionsInterfaceImpl::echo return:" << ret;
return ret;
}