Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+19
-19
@@ -71,14 +71,14 @@ bool HandlerJamming::init()
|
||||
this, &HandlerJamming::onParticipantGearEventChanged);
|
||||
|
||||
|
||||
DEBUG_LOG() << "HandlerJamming::init() finished.";
|
||||
DEBUG_LOG(m_logger) << "HandlerJamming::init() finished.";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent &data, DataModification modType)
|
||||
{
|
||||
ERROR_LOG() << "onParticipantGearEventChanged << modType=" << modType
|
||||
ERROR_LOG(m_logger) << "onParticipantGearEventChanged << modType=" << modType
|
||||
<< " originatorId=" << data.participantId()
|
||||
<< " chargeTypeId=" << data.charge().chargeTypeId()
|
||||
<< " gearTypeId=" << data.charge().gearTypeId()
|
||||
@@ -94,34 +94,34 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
double radius = m_ddsHandler->dtcPdm()->getMaxRange(data.charge().chargeTypeId(), data.charge().gearTypeId());
|
||||
|
||||
// int radius = 15;
|
||||
DEBUG_LOG() << "Radius=" << radius;
|
||||
DEBUG_LOG(m_logger) << "Radius=" << radius;
|
||||
for ( int uasId : uasIds)
|
||||
{
|
||||
DEBUG_LOG() << "uasId=" << uasId;
|
||||
DEBUG_LOG(m_logger) << "uasId=" << uasId;
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData cesParticipantData = m_handlerParticipant->position(uasId);
|
||||
if (!cesParticipantData.positionValid)
|
||||
{
|
||||
DEBUG_LOG() << "continue !positionValid participantId=" << uasId;
|
||||
DEBUG_LOG(m_logger) << "continue !positionValid participantId=" << uasId;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (LtsUtils::isPositionTimeOutdated(QDateTime::currentMSecsSinceEpoch(), cesParticipantData.sampleTime()))
|
||||
{
|
||||
DEBUG_LOG() << "continue positionTime outdated participantId=" << uasId;
|
||||
DEBUG_LOG(m_logger) << "continue positionTime outdated participantId=" << uasId;
|
||||
continue;
|
||||
}
|
||||
|
||||
long distance = m_handlerParticipant->getDistance(data.participantId(), uasId);
|
||||
DEBUG_LOG() << "distance = " << distance;
|
||||
DEBUG_LOG(m_logger) << "distance = " << distance;
|
||||
if ( distance < radius)
|
||||
{
|
||||
DEBUG_LOG() << " Send Jamming to TAB and destroy uasId";
|
||||
DEBUG_LOG(m_logger) << " Send Jamming to TAB and destroy uasId";
|
||||
//sendCesHitRequest(data.charge().chargeTypeId(), data.participantId(),cesParticipantData);
|
||||
if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
jammedUasIds.append(uasId);
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Not in Radius distance=" << distance
|
||||
DEBUG_LOG(m_logger) << "Not in Radius distance=" << distance
|
||||
<< " radius=" << radius;
|
||||
}
|
||||
// [ETB UASETBUAS-33] Equal distribution of jamming failures
|
||||
@@ -133,7 +133,7 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
{
|
||||
// search for an id from the list with an algorithm that contains an equal distribution
|
||||
jammedUasId = jammedUasIds.at(QRandomGenerator::global()->bounded(jammedUasIds.size() - 1));
|
||||
DEBUG_LOG() << "jammedUasId=" << jammedUasId
|
||||
DEBUG_LOG(m_logger) << "jammedUasId=" << jammedUasId
|
||||
<< " jammedUasIds.size()=" << jammedUasIds.size();
|
||||
}
|
||||
|
||||
@@ -145,21 +145,21 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
|
||||
void HandlerJamming::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error();
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error();
|
||||
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send enter/leave Area to participant in training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send enter/leave Area to participant in training area: " << replyObject();
|
||||
|
||||
// Send next Request, if available
|
||||
if (!m_sendCesHitRequestQueue.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size();
|
||||
DEBUG_LOG(m_logger) << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size();
|
||||
m_sendCesHitRequestQueue.dequeue();
|
||||
// Send next Message
|
||||
if (!m_sendCesHitRequestQueue.isEmpty())
|
||||
{
|
||||
const auto &hr = m_sendCesHitRequestQueue.head();
|
||||
DEBUG_LOG() << "sendCesHitRequest: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest: " << hr;
|
||||
m_ddsHandler->ftcTab()->sendCesHitRequest(hr, this);
|
||||
}
|
||||
}
|
||||
@@ -182,20 +182,20 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
|
||||
if (remaining < 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " participantId=" << participantData.participantId();
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
const int originatorEquimentNumber = m_ddsHandler->participantId2EquipNo(originatorId);
|
||||
const int originatorPartyId = m_handlerParticipant->getParticipantPosition(originatorId).partyId();
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
<< " equipNo = " << equipNo
|
||||
<< " chargeTypeId =" << chargeTypeId;
|
||||
|
||||
if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId == 0 CatastrophicKill)";
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId == 0 CatastrophicKill)";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,13 +220,13 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
|
||||
originatorPartyId, // originPartyId
|
||||
mineId
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId()
|
||||
<< " chargeTypeId=" << chargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
if (m_sendCesHitRequestQueue.size() == 1)
|
||||
{
|
||||
DEBUG_LOG() << "SendCesHitRequest: " << requestTab;
|
||||
DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab;
|
||||
m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this);
|
||||
}
|
||||
} // sendCesHitRequest
|
||||
|
||||
+1
@@ -57,6 +57,7 @@ public:
|
||||
bool init();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
+5
-5
@@ -48,7 +48,7 @@ bool CES_JammingInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CES_JammingInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,11 +62,11 @@ bool CES_JammingInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerJamming->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CES_JammingInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ QString CES_JammingInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_JammingInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user