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

@@ -41,7 +41,7 @@ bool HandlerAesData::init()
if (!m_aesDtc->enableBCContamination() || !m_aesDtc->enableExplosionArea() || !m_aesDtc->enableExplosionSingle() || !m_aesDtc->enableFunctionalArea()
|| !m_aesDtc->enableNContamination() || !m_aesDtc->enableMineArea() || !m_aesDtc->enableExplosionCluster())
{
ERROR_LOG() << "Error enabling AES Data-Topics.";
ERROR_LOG(m_logger) << "Error enabling AES Data-Topics.";
return false;
}
@@ -53,7 +53,7 @@ bool HandlerAesData::init()
|| !m_aesFtc->enableMineAreaRemove() || !m_aesFtc->enableExplosionClusterRemove() || !m_aesFtc->enableExplosionAreaPauseResume()
|| !m_aesFtc->enableMineAreaReferenceModify())
{
ERROR_LOG() << "Error enabling AES Function-Topics.";
ERROR_LOG(m_logger) << "Error enabling AES Function-Topics.";
return false;
}
@@ -61,7 +61,7 @@ bool HandlerAesData::init()
if (!m_pdmDtc->enableChargeType() || !m_pdmDtc->enableGearTypeChargeType() || !m_pdmDtc->enableGearType())
{
ERROR_LOG() << "Error enabling PDM Data-Topic.";
ERROR_LOG(m_logger) << "Error enabling PDM Data-Topic.";
return false;
}
@@ -70,11 +70,11 @@ bool HandlerAesData::init()
|| !m_aesDtc->waitForHistoricalDataNContamination(10000) || !m_aesDtc->waitForHistoricalDataMineArea(10000)
|| !m_aesDtc->waitForHistoricalDataExplosionCluster(10000))
{
ERROR_LOG() << "Error waiting for historical data AES.";
ERROR_LOG(m_logger) << "Error waiting for historical data AES.";
return false;
}
DEBUG_LOG() << "Initialisation successful";
DEBUG_LOG(m_logger) << "Initialisation successful";
return true;
}
@@ -125,7 +125,7 @@ void HandlerAesData::process(const QByteArray &data, int multiplexer)
break;
}
default:
WARNING_LOG() << "Got unknown multiplexer.";
WARNING_LOG(m_logger) << "Got unknown multiplexer.";
}
}
@@ -139,121 +139,121 @@ void HandlerAesData::specificsExercise(const OcTelegrams::SpecificsExercise &dat
void HandlerAesData::onMineAreaModifyFromCtaDataReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Mine area modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "Mine area modify failed: " << reply.translated();
else
DEBUG_LOG() << "Mine area modify successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Mine area modify successfull. Id: " << reply.id();
}
void HandlerAesData::onNContaminationModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "N contamination modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "N contamination modify failed: " << reply.translated();
else
DEBUG_LOG() << "N contamination modify successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "N contamination modify successfull. Id: " << reply.id();
}
void HandlerAesData::onFunctionalAreaModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Functional area modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "Functional area modify failed: " << reply.translated();
else
DEBUG_LOG() << "Functional area modify successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Functional area modify successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionSingleModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Explosion single modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "Explosion single modify failed: " << reply.translated();
else
DEBUG_LOG() << "Explosion single modify successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Explosion single modify successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionAreaModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Explosion area modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "Explosion area modify failed: " << reply.translated();
else
DEBUG_LOG() << "Explosion area modify successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Explosion area modify successfull. Id: " << reply.id();
}
void HandlerAesData::onBCContaminationModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "BC contamination modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "BC contamination modify failed: " << reply.translated();
else
DEBUG_LOG() << "BC contamination modify successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "BC contamination modify successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "ExplosionCluster modify failed: " << reply.translated();
ERROR_LOG(m_logger) << "ExplosionCluster modify failed: " << reply.translated();
else
DEBUG_LOG() << "ExplosionCluster successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "ExplosionCluster successfull. Id: " << reply.id();
}
void HandlerAesData::onMineAreaRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Mine area remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "Mine area remove failed: " << reply.translated();
else
DEBUG_LOG() << "Mine area remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Mine area remove successfull. Id: " << reply.id();
}
void HandlerAesData::onNContaminationRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "N contamination remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "N contamination remove failed: " << reply.translated();
else
DEBUG_LOG() << "N contamination remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "N contamination remove successfull. Id: " << reply.id();
}
void HandlerAesData::onFunctionalAreaRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Functional area remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "Functional area remove failed: " << reply.translated();
else
DEBUG_LOG() << "Functional area remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Functional area remove successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionSingleRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Explosion single remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "Explosion single remove failed: " << reply.translated();
else
DEBUG_LOG() << "Explosion single remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Explosion single remove successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionAreaRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Explosion area remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "Explosion area remove failed: " << reply.translated();
else
DEBUG_LOG() << "Explosion area remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Explosion area remove successfull. Id: " << reply.id();
}
void HandlerAesData::onBCContaminationRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "BC contamination remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "BC contamination remove failed: " << reply.translated();
else
DEBUG_LOG() << "BC contamination remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "BC contamination remove successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionClusterRemoveReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "ExplosionCluster remove failed: " << reply.translated();
ERROR_LOG(m_logger) << "ExplosionCluster remove failed: " << reply.translated();
else
DEBUG_LOG() << "ExplosionCluster remove successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "ExplosionCluster remove successfull. Id: " << reply.id();
}
void HandlerAesData::onExplosionAreaPauseResumeReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Explosion area pause/resume failed: " << reply.translated();
ERROR_LOG(m_logger) << "Explosion area pause/resume failed: " << reply.translated();
else
DEBUG_LOG() << "Explosion area pause/resume successfull. Id: " << reply.id();
DEBUG_LOG(m_logger) << "Explosion area pause/resume successfull. Id: " << reply.id();
}
template <typename T> static inline void getBasicData(const QByteArray &data, size_t &pos, T &req, bool withoutEffectStart = false)
@@ -300,8 +300,8 @@ static inline double mathToCompassAngle(int mathDegree)
void HandlerAesData::bcContaminations(const QByteArray &data)
{
INFO_LOG() << "Got new BC contamination data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new BC contamination data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
QList<int> aesToBeDeleted = m_aesDtc->bCContaminations().keys();
@@ -340,7 +340,7 @@ void HandlerAesData::bcContaminations(const QByteArray &data)
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Biological, tmp));
LtsUtils::get1Byte(data, pos, tmp);
DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "BC contamination: " << req;
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "BC contamination: " << req;
aesToBeDeleted.removeAll(req.id());
req.id(req.id() * -1);
@@ -354,7 +354,7 @@ void HandlerAesData::bcContaminations(const QByteArray &data)
continue;
if (m_aesDtc->bCContamination(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG() << "Removing BC contamination id: " << id;
DEBUG_LOG(m_logger) << "Removing BC contamination id: " << id;
m_aesFtc->bCContaminationRemoveRequest(Core::RemoveElementRequest(id), this);
}
}
@@ -362,8 +362,8 @@ void HandlerAesData::bcContaminations(const QByteArray &data)
void HandlerAesData::explosionAreas(const QByteArray &data)
{
INFO_LOG() << "Got new explosion cluster data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new explosion cluster data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
QList<int> aesToBeDeleted = m_aesDtc->explosionClusters().keys();
@@ -441,12 +441,12 @@ void HandlerAesData::explosionAreas(const QByteArray &data)
LtsUtils::get3Byte(data, pos, tmp);
}
DEBUG_LOG() << "New ExplosionClusterOcModifyRequest: "
DEBUG_LOG(m_logger) << "New ExplosionClusterOcModifyRequest: "
<< "\nid:" << req.id() << "\nname:" << req.name() << "\neffectStart:" << req.effectStart() << "\neffectDuration:" << req.effectDuration()
<< "\narea:" << req.area() << "\nmhpCount:" << req.mhpCount() << "\nmhpRotation:" << req.mhpRotation() << "\nimpactCount:" << req.impactCount()
<< "\nchargeTypeId:" << req.chargeStruct().chargeTypeId() << "\npartyId:" << req.partyId();
DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion cluster: " << req;
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion cluster: " << req;
aesToBeDeleted.removeOne(req.id());
req.id(req.id() * -1);
@@ -466,7 +466,7 @@ void HandlerAesData::explosionAreas(const QByteArray &data)
||
(exp.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsPaused))))
{
DEBUG_LOG() << "Removing explosion cluster with id: " << id;
DEBUG_LOG(m_logger) << "Removing explosion cluster with id: " << id;
m_aesFtc->explosionClusterRemoveRequest(Core::RemoveElementRequest(id), this);
}
}
@@ -474,8 +474,8 @@ void HandlerAesData::explosionAreas(const QByteArray &data)
void HandlerAesData::explosionSingles(const QByteArray &data)
{
INFO_LOG() << "Got new explosion single data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new explosion single data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
QList<int> aesToBeDeleted = m_aesDtc->explosionSingles().keys();
@@ -502,7 +502,7 @@ void HandlerAesData::explosionSingles(const QByteArray &data)
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Artillery, tmp));
if (req.chargeTypeId() == 0)
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Mortar, tmp));
DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion single: " << req;
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion single: " << req;
aesToBeDeleted.removeAll(req.id());
req.id(req.id() * -1);
@@ -517,7 +517,7 @@ void HandlerAesData::explosionSingles(const QByteArray &data)
if ((exp.effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
&& (exp.effectStart().is_set() && (exp.effectStart().get() > (m_dds->currentPartitionTime() + 5000))))
{
DEBUG_LOG() << "Removing explosion single id: " << id;
DEBUG_LOG(m_logger) << "Removing explosion single id: " << id;
m_aesFtc->explosionSingleRemoveRequest(Core::RemoveElementRequest(id), this);
}
}
@@ -525,8 +525,8 @@ void HandlerAesData::explosionSingles(const QByteArray &data)
void HandlerAesData::functionalAreas(const QByteArray &data)
{
INFO_LOG() << "Got functional area data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got functional area data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
QList<int> aesToBeDeleted = m_aesDtc->functionalAreas().keys();
@@ -571,7 +571,7 @@ void HandlerAesData::functionalAreas(const QByteArray &data)
req.medicTime(tmp * 10 * 60 * 1000);
req.chargeTypeId(411);
DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "functional area: " << req;
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "functional area: " << req;
aesToBeDeleted.removeAll(req.id());
req.id(req.id() * -1);
@@ -585,7 +585,7 @@ void HandlerAesData::functionalAreas(const QByteArray &data)
continue;
if (m_aesDtc->functionalArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG() << "Removing functional area id: " << id;
DEBUG_LOG(m_logger) << "Removing functional area id: " << id;
m_aesFtc->functionalAreaRemoveRequest(Core::RemoveElementRequest(id), this);
}
}
@@ -593,8 +593,8 @@ void HandlerAesData::functionalAreas(const QByteArray &data)
void HandlerAesData::nContaminations(const QByteArray &data)
{
INFO_LOG() << "Got new N contamination data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new N contamination data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
QList<int> aesToBeDeleted = m_aesDtc->nContaminations().keys();
@@ -628,7 +628,7 @@ void HandlerAesData::nContaminations(const QByteArray &data)
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Nuclear, 1));
DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "N contamination: " << req;
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "N contamination: " << req;
aesToBeDeleted.removeAll(req.id());
req.id(req.id() * -1);
@@ -642,7 +642,7 @@ void HandlerAesData::nContaminations(const QByteArray &data)
continue;
if (m_aesDtc->nContamination(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG() << "Removing N contamination id: " << id;
DEBUG_LOG(m_logger) << "Removing N contamination id: " << id;
m_aesFtc->nContaminationRemoveRequest(Core::RemoveElementRequest(id), this);
}
}
@@ -650,8 +650,8 @@ void HandlerAesData::nContaminations(const QByteArray &data)
void HandlerAesData::mineAreas(const QByteArray &data)
{
INFO_LOG() << "Got new mine area data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new mine area data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
QList<int> aesToBeDeleted = m_aesDtc->mineAreas().keys();
@@ -700,7 +700,7 @@ void HandlerAesData::mineAreas(const QByteArray &data)
req.isCenterLine(true);
DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "mine area: " << req;
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "mine area: " << req;
aesToBeDeleted.removeAll(req.id());
req.id(req.id() * -1);
@@ -715,7 +715,7 @@ void HandlerAesData::mineAreas(const QByteArray &data)
continue;
if (m_aesDtc->mineArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved)
{
DEBUG_LOG() << "Removing mine area id: " << id;
DEBUG_LOG(m_logger) << "Removing mine area id: " << id;
m_aesFtc->mineAreaRemoveRequest(Core::RemoveElementRequest(id), this);
}
}
@@ -723,8 +723,8 @@ void HandlerAesData::mineAreas(const QByteArray &data)
void HandlerAesData::explosionAreasPause(const QByteArray &data)
{
INFO_LOG() << "Got new explosion area pause data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new explosion area pause data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
size_t pos = 0;
int cnt;
@@ -734,7 +734,7 @@ void HandlerAesData::explosionAreasPause(const QByteArray &data)
for (int i = 0; i < cnt; ++i)
{
LtsUtils::get2Byte(data, pos, id);
DEBUG_LOG() << "Pausing ID: " << id;
DEBUG_LOG(m_logger) << "Pausing ID: " << id;
m_aesFtc->explosionAreaPauseResumeRequest(AreaEffectSimulation::ExplosionAreaPauseResumeRequest(id,
false,
dds::core::optional<rti::core::int64>(),
@@ -746,8 +746,8 @@ void HandlerAesData::explosionAreasPause(const QByteArray &data)
void HandlerAesData::explosionAreasResume(const QByteArray &data)
{
INFO_LOG() << "Got new explosion area resume data";
DEBUG_LOG() << "Binary data: " << data.toHex(' ');
INFO_LOG(m_logger) << "Got new explosion area resume data";
DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' ');
size_t pos = 0;
int cnt;
@@ -766,7 +766,7 @@ void HandlerAesData::explosionAreasResume(const QByteArray &data)
req.timeToResume(dds::core::optional<rti::core::int64>(tmp * 1000));
LtsUtils::get2Byte(data, pos, tmp);
req.remainingDuration(dds::core::optional<int32_t>(tmp));
DEBUG_LOG() << "Resuming: " << req;
DEBUG_LOG(m_logger) << "Resuming: " << req;
m_aesFtc->explosionAreaPauseResumeRequest(req, this);
}
}
@@ -779,7 +779,7 @@ int HandlerAesData::chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearCla
{
if (!m_pdmDtc->waitForHistoricalDataChargeType(20000))
{
ERROR_LOG() << "Can not read charge types from PDM";
ERROR_LOG(m_logger) << "Can not read charge types from PDM";
QCoreApplication::exit(-1);
return -1;
}