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

@@ -42,7 +42,7 @@ bool HandlerParticipant::init()
INFO_LOG() << "m_cheatingDistanceVehicle=" << m_cheatingDistanceVehicle
INFO_LOG(m_logger) << "m_cheatingDistanceVehicle=" << m_cheatingDistanceVehicle
<< " m_cheatingDistanceSoldier=" << m_cheatingDistanceSoldier;
// waitForHistorical...
@@ -101,7 +101,7 @@ bool HandlerParticipant::init()
connect(dtcTab.get(), &TrainingAreaBase::Interface::Dtc::restoreRadioReadinessChanged,
this, &HandlerParticipant::onRestoreRadioReadinessChanged);
INFO_LOG() << "HandlerParticipant::init() finished. "
INFO_LOG(m_logger) << "HandlerParticipant::init() finished. "
<< " m_positionsMap.size(): " << m_positionsMap.size();
return true;
} // end of init()
@@ -110,10 +110,10 @@ bool HandlerParticipant::init()
void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType)
{
DEBUG_LOG() << "onParticipantPositionChanged: " << data;
DEBUG_LOG(m_logger) << "onParticipantPositionChanged: " << data;
if (modType == DataModification::eRemoved)
{
DEBUG_LOG() << "m_participantsOutsideMap.remove participantId: " << data.participantId();
DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.participantId();
//m_participantsOutsideMap.remove(data.participantId());
}
else
@@ -133,10 +133,10 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
// ltsPosRef.setGeoPosition(data.pos(), 0.0); // hier wird 0.0 zu NaN umgewandelt ...
// ltsPosRef.setZValueAccordingElevation(0.0); // hier wird implizit der LtsElevationManager genutzt
// DEBUG_LOG() << "- ltsPosRef: " << ltsPosRef;
// DEBUG_LOG(m_logger) << "- ltsPosRef: " << ltsPosRef;
ltsCoordRef.replaceZValueByElevationIfValue(0.0);
DEBUG_LOG() << "- ltsCoordRef: " << ltsCoordRef;
DEBUG_LOG(m_logger) << "- ltsCoordRef: " << ltsCoordRef;
bool lastGeoPositionValid = false;
@@ -160,7 +160,7 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
}
else
{
INFO_LOG() << "m_positionsMap.insert="
INFO_LOG(m_logger) << "m_positionsMap.insert="
<< partPos;
m_positionsMap.insert(data.participantId(), partPos);
@@ -172,7 +172,7 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
{
partPos.buildingId(0);
partPos.roomId(0);
DEBUG_LOG() << "emit and insert newOutdoorPosition:"
DEBUG_LOG(m_logger) << "emit and insert newOutdoorPosition:"
<< partPos;
m_positionsMap.insert(data.participantId(), partPos);
emit newOutdoorPosition(partPos);
@@ -185,26 +185,26 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
}
}
DEBUG_LOG() << "checkCheating m_positionsCheatingMap.size=" << m_positionsCheatingMap.size();
DEBUG_LOG(m_logger) << "checkCheating m_positionsCheatingMap.size=" << m_positionsCheatingMap.size();
QHashIterator<int, CesParticipantData> i(m_positionsCheatingMap);
while (i.hasNext())
{
i.next();
DEBUG_LOG() << i.key() << ": " << i.value().participantId();
DEBUG_LOG(m_logger) << i.key() << ": " << i.value().participantId();
}
if (m_positionsCheatingMap.contains(data.participantId()))
{
DEBUG_LOG() << "checkCheatingPosition participantId=" << data.participantId();
DEBUG_LOG(m_logger) << "checkCheatingPosition participantId=" << data.participantId();
checkCheatingPosition(data.participantId());
}
INFO_LOG() << "onParticipantPositionChanged()"
INFO_LOG(m_logger) << "onParticipantPositionChanged()"
<< " participantId; " << data.participantId()
<< " participantTypeId: " << data.participantTypeId()
<< " partyId: " << data.partyId()
<< " vulnerabilityState: " << partPos.vulnerabilityState
<< " insideBuilding: " << partPos.insideBuilding();
INFO_LOG() << partPos;
INFO_LOG(m_logger) << partPos;
}
} // end of onParticipantPositionChanged()
@@ -213,7 +213,7 @@ void HandlerParticipant::onParticipantPositionChanged(const ParticipantManagemen
void HandlerParticipant::onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType)
{
DEBUG_LOG() << "onDynamicParticipantDataChanged";
DEBUG_LOG(m_logger) << "onDynamicParticipantDataChanged";
if (modType == DataModification::eRemoved)
return;
@@ -224,12 +224,12 @@ void HandlerParticipant::onDynamicParticipantDataChanged(const ParticipantManage
{
const ParticipantManagement::StateInformation &vul = ParticipantManagement::youngestStateInformation(data.stateHistory());
newVulnerabilityState = vul.vulnerabilityState();
DEBUG_LOG() << "newVulnerabilityState" << vul.vulnerabilityState();
DEBUG_LOG(m_logger) << "newVulnerabilityState" << vul.vulnerabilityState();
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
{
emit participantDecontaminated(participantPosition.participantId());
DEBUG_LOG() << "emit participantDecontaminated id=" << participantPosition.participantId();
DEBUG_LOG(m_logger) << "emit participantDecontaminated id=" << participantPosition.participantId();
}
}
if (participantPosition.vulnerabilityState != newVulnerabilityState)
@@ -246,7 +246,7 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
// Remove Participant:
if (modType == DataModification::eRemoved || data.isDeleted())
{
DEBUG_LOG() << "onParticipantChanged m_positionsMap.remove id=" << data.id();
DEBUG_LOG(m_logger) << "onParticipantChanged m_positionsMap.remove id=" << data.id();
m_participantData.remove(data.id());
m_positionsMap.remove(data.id());
return;
@@ -265,7 +265,7 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
pos.partyId(data.partyId());
pos.participantId(data.id());
pos.participantTypeId(data.typeId());
DEBUG_LOG() << "onParticipantChanged"
DEBUG_LOG(m_logger) << "onParticipantChanged"
<< " id=" << data.id()
<< " typeId=" << data.typeId()
<< " designator=" << data.designator();
@@ -277,7 +277,7 @@ void HandlerParticipant::onTypeChanged(const ParticipantManagement::Type &data,
if (modType == DataModification::eRemoved)
return;
m_typeMap.insert(data.id(), data.typeClass());
DEBUG_LOG() << "m_typeMap.size()" << m_typeMap.size()
DEBUG_LOG(m_logger) << "m_typeMap.size()" << m_typeMap.size()
<< " equipmentTypeId=" << data.id()
<< " typeClass=" << data.typeClass();
}
@@ -292,7 +292,7 @@ void HandlerParticipant::onRestoreRadioReadinessChanged(const TrainingAreaBase::
auto dtcPpm = m_ddsHandler->dtcPpm();
int participantId = dtcPpm->participantIdByEquipmentNumber(data.equipmentNumber());
DEBUG_LOG() << "onRestoreRadioReadinessChanged"
DEBUG_LOG(m_logger) << "onRestoreRadioReadinessChanged"
<< " data.equipmentNumber=" << data.equipmentNumber()
<< " participantId=" << participantId;
emit restoreRadioReadinessChanged(participantId);
@@ -360,12 +360,12 @@ QHash<int, HandlerParticipant::CesParticipantData> HandlerParticipant::positions
QVector<int32_t> HandlerParticipant::getParticipantsBuilding(const int32_t buildingId) const
{
QVector<int32_t> result;
DEBUG_LOG() << "getParticipantsBuilding:" << buildingId;
DEBUG_LOG(m_logger) << "getParticipantsBuilding:" << buildingId;
for (const HandlerParticipant::CesParticipantData &pos : m_positionsMap)
{
if (buildingId == pos.buildingId())
{
DEBUG_LOG() << "result.append " << pos.participantId();
DEBUG_LOG(m_logger) << "result.append " << pos.participantId();
result.append(pos.participantId());
}
}
@@ -375,17 +375,17 @@ QVector<int32_t> HandlerParticipant::getParticipantsBuilding(const int32_t build
bool HandlerParticipant::handleCheating(const ParticipantManagement::TypeClass typeClass,
const ProjectDataManagement::VulnerabilityState newVulnerabilityState)
{
DEBUG_LOG() << "handleCheating typeClass=" << typeClass
DEBUG_LOG(m_logger) << "handleCheating typeClass=" << typeClass
<< " newVulnerabilityState=" << newVulnerabilityState;
// unknown is necessary for the initialization phase
if (typeClass == ParticipantManagement::TypeClass::Unknown)
{
DEBUG_LOG() << "handle Cheating for Unknown";
DEBUG_LOG(m_logger) << "handle Cheating for Unknown";
return true;
}
if (typeClass == ParticipantManagement::TypeClass::Human)
{
DEBUG_LOG() << "handle Cheating for Human";
DEBUG_LOG(m_logger) << "handle Cheating for Human";
if (newVulnerabilityState >= ProjectDataManagement::VulnerabilityState::MediumDamage)
return true;
}
@@ -393,7 +393,7 @@ bool HandlerParticipant::handleCheating(const ParticipantManagement::TypeClass t
|| typeClass == ParticipantManagement::TypeClass::WeaponSystem
|| typeClass == ParticipantManagement::TypeClass::VehicleWithGear)
{
DEBUG_LOG() << "handle Cheating for Vehicle";
DEBUG_LOG(m_logger) << "handle Cheating for Vehicle";
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::MobilityKill
|| newVulnerabilityState == ProjectDataManagement::VulnerabilityState::VisibleMobilityKill)
return true;
@@ -406,17 +406,17 @@ void HandlerParticipant::checkCheating(const int participantId,
const CesParticipantData &participantPosition,
const ProjectDataManagement::VulnerabilityState newVulnerabilityState)
{
DEBUG_LOG() << "checkCheating state =" << newVulnerabilityState
DEBUG_LOG(m_logger) << "checkCheating state =" << newVulnerabilityState
<< " participantId=" << participantId;
if (!m_typeMap.contains(participantPosition.participantTypeId()))
WARNING_LOG() << "!m_typeMap.contains(" << participantPosition.participantTypeId() << ")";
WARNING_LOG(m_logger) << "!m_typeMap.contains(" << participantPosition.participantTypeId() << ")";
ParticipantManagement::TypeClass typeClass = m_typeMap[participantPosition.participantTypeId()];
if (handleCheating(typeClass, newVulnerabilityState))
{
if (!m_positionsCheatingMap.contains(participantId))
{
DEBUG_LOG() << "checkCheating insert id= " << participantId;
DEBUG_LOG(m_logger) << "checkCheating insert id= " << participantId;
m_positionsCheatingMap.insert(participantId, participantPosition);
}
}
@@ -424,7 +424,7 @@ void HandlerParticipant::checkCheating(const int participantId,
{
if (newVulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
{
DEBUG_LOG() << "checkCheating remove id= " << participantId;
DEBUG_LOG(m_logger) << "checkCheating remove id= " << participantId;
m_positionsCheatingMap.remove(participantId);
}
}
@@ -432,29 +432,29 @@ void HandlerParticipant::checkCheating(const int participantId,
void HandlerParticipant::checkCheatingPosition(const int participantId)
{
DEBUG_LOG() << "checkCheatingPosition id= " << participantId;
DEBUG_LOG(m_logger) << "checkCheatingPosition id= " << participantId;
CesParticipantData posMobilityKill = m_positionsCheatingMap[participantId];
CesParticipantData posActual = m_positionsMap[participantId];
ParticipantManagement::TypeClass typeClass = m_typeMap[participantId];
if (!posActual.insideWlsArea())
{
DEBUG_LOG() << "position participantId=" << participantId << " not insideWlsArea";
DEBUG_LOG(m_logger) << "position participantId=" << participantId << " not insideWlsArea";
return;
}
// Check, if valid position is available
if (posMobilityKill.participantId() == 0)
{
DEBUG_LOG() << "position participantId=" << participantId << " not valid";
DEBUG_LOG(m_logger) << "position participantId=" << participantId << " not valid";
m_positionsCheatingMap.insert(participantId, posActual);
return;
}
QPointF posUtmMobilityKill = CentralEffectSimulation::geographic2Utm(posMobilityKill.pos());
QPointF posUtmActual = CentralEffectSimulation::geographic2Utm(posActual.pos());
DEBUG_LOG() << "posUtmMobilityKill=" << posUtmMobilityKill.rx() << "/" << posUtmMobilityKill.ry();
DEBUG_LOG() << "posUtmActual=" << posUtmActual.rx() << "/" << posUtmActual.ry();
DEBUG_LOG(m_logger) << "posUtmMobilityKill=" << posUtmMobilityKill.rx() << "/" << posUtmMobilityKill.ry();
DEBUG_LOG(m_logger) << "posUtmActual=" << posUtmActual.rx() << "/" << posUtmActual.ry();
qreal distance = QLineF(posUtmMobilityKill, posUtmActual).length();
int cheatingDistance;
@@ -462,10 +462,10 @@ void HandlerParticipant::checkCheatingPosition(const int participantId)
cheatingDistance = m_cheatingDistanceSoldier;
else
cheatingDistance = m_cheatingDistanceVehicle;
DEBUG_LOG() << "distance=" << distance;
DEBUG_LOG(m_logger) << "distance=" << distance;
if (distance > cheatingDistance)
{
DEBUG_LOG() << " Send Manipulation to id= and save new Cheating Position" << participantId;
DEBUG_LOG(m_logger) << " Send Manipulation to id= and save new Cheating Position" << participantId;
m_positionsCheatingMap.insert(participantId, posActual);
sendBeStillWarning(participantId);
}
@@ -475,9 +475,9 @@ void HandlerParticipant::checkCheatingPosition(const int participantId)
void HandlerParticipant::onSendParticipantBeStillWarningReply(const Core::FunctionReplyObject &replyObject)
{
//if (replyObject.error())
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
//else
DEBUG_LOG() << "onSendParticipantBeStillWarningReply for id " << replyObject.id() << " success";
DEBUG_LOG(m_logger) << "onSendParticipantBeStillWarningReply for id " << replyObject.id() << " success";
}
void HandlerParticipant::sendBeStillWarning(const int32_t participantId)
@@ -492,9 +492,9 @@ void HandlerParticipant::sendBeStillWarning(const int32_t participantId)
void HandlerParticipant::onModifyStateReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "onModifyStateReply for id " << reply.id() << " failure";
ERROR_LOG(m_logger) << "onModifyStateReply for id " << reply.id() << " failure";
else
DEBUG_LOG() << "onModifyStateReply for id " << reply.id() << " success";
DEBUG_LOG(m_logger) << "onModifyStateReply for id " << reply.id() << " success";
}
void HandlerParticipant::modifyStateRequest(
@@ -523,10 +523,10 @@ long HandlerParticipant::getDirection(int originatorParticipantId, int targetPar
const QPointF originatorPosUtm = CentralEffectSimulation::geographic2Utm(originatorGeoPos, &zone);
const QPointF targetPosUtm = CentralEffectSimulation::geographic2Utm(targetGeoPos, zone);
const QLineF line(originatorPosUtm, targetPosUtm);
DEBUG_LOG() << "originatorPosUtm=" << originatorPosUtm.x() << " / " << originatorPosUtm.y();
DEBUG_LOG() << "targetPosUtm=" << targetPosUtm.x() << " / " << targetPosUtm.y();
DEBUG_LOG(m_logger) << "originatorPosUtm=" << originatorPosUtm.x() << " / " << originatorPosUtm.y();
DEBUG_LOG(m_logger) << "targetPosUtm=" << targetPosUtm.x() << " / " << targetPosUtm.y();
DEBUG_LOG() << "getDirection=" << (static_cast<int>(line.angle()) + 270) % 360 * 100;
DEBUG_LOG(m_logger) << "getDirection=" << (static_cast<int>(line.angle()) + 270) % 360 * 100;
return (static_cast<long>(line.angle()) + 270) % 360 * 100;
@@ -545,7 +545,7 @@ long HandlerParticipant::getDistance(int originatorParticipantId, int targetPart
const QPointF targetPosUtm = CentralEffectSimulation::geographic2Utm(targetGeoPos, zone);
const QLineF line(originatorPosUtm, targetPosUtm);
DEBUG_LOG() << "getDistance=" << line.length();
DEBUG_LOG(m_logger) << "getDistance=" << line.length();
return static_cast<int>(line.length());
}
@@ -573,7 +573,7 @@ void HandlerParticipant::setNotfightMode ( const int participantId, const bool n
{
CesParticipantData participantData = m_positionsMap.value(participantId);
participantData.notfightMode = notfightMode;
INFO_LOG() << "setNotfightMode m_positionsMap.insert="
INFO_LOG(m_logger) << "setNotfightMode m_positionsMap.insert="
<< participantData;
m_positionsMap.insert ( participantId,participantData );
emit newNotfightMode(participantData);