Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+59
-59
@@ -49,7 +49,7 @@ void ThreadOcSituationData::requestOcSituationData(OcSituation::SituationCenterT
|
||||
QSet<ParticipantManagement::TypeClass::type> typeClassList,
|
||||
bool initial)
|
||||
{
|
||||
INFO_LOG() << "OC-Situation Request for centerEquipmentId: " << centerEquipmentId
|
||||
INFO_LOG(m_logger) << "OC-Situation Request for centerEquipmentId: " << centerEquipmentId
|
||||
<< " from O/C-laptop-Id: " << m_equipmentId
|
||||
<< " with radius of " << radius
|
||||
<< "m, initial: " << initial;
|
||||
@@ -67,7 +67,7 @@ void ThreadOcSituationData::requestOcSituationData(OcSituation::SituationCenterT
|
||||
if (m_handler)
|
||||
m_handler->setRequestOcSituationData(centerType, centerEquipmentId, position, radius, filterActive, partyList, typeClassList, initial);
|
||||
else
|
||||
DEBUG_LOG() << "Thread doesn't exist up to now! Do nothing.";
|
||||
DEBUG_LOG(m_logger) << "Thread doesn't exist up to now! Do nothing.";
|
||||
}
|
||||
|
||||
void ThreadOcSituationData::run()
|
||||
@@ -76,7 +76,7 @@ void ThreadOcSituationData::run()
|
||||
{
|
||||
QMutexLocker l(&m_accessMutex);
|
||||
QMutexLocker m(&s_ddsAccesMutex);
|
||||
DEBUG_LOG() << "Instance new OC-Thread for O/C-Laptop-Id: " << m_equipmentId;
|
||||
DEBUG_LOG(m_logger) << "Instance new OC-Thread for O/C-Laptop-Id: " << m_equipmentId;
|
||||
|
||||
m_handler = new HandlerOcSituationData(m_mainHandler->dds(),
|
||||
m_baseCoordinate,
|
||||
@@ -86,7 +86,7 @@ void ThreadOcSituationData::run()
|
||||
m_handler->setRequestOcSituationData(m_centerType, m_centerEquipmentId, m_position, m_radius, m_filterActive, m_partyList, m_typeClassList, true);
|
||||
}
|
||||
|
||||
INFO_LOG() << "OC-Thread started for O/C-Laptop-Id: " << m_equipmentId;
|
||||
INFO_LOG(m_logger) << "OC-Thread started for O/C-Laptop-Id: " << m_equipmentId;
|
||||
exec();
|
||||
|
||||
{
|
||||
@@ -113,7 +113,7 @@ HandlerOcSituationData::HandlerOcSituationData(const std::shared_ptr<DdsHandler>
|
||||
, m_txTimer(new QTimer(this))
|
||||
, m_logger(getLogger(QStringLiteral("HandlerOcSituationData.") + QString::number(equipmentId)))
|
||||
{
|
||||
INFO_LOG() << "Create O/C-Handler for O/C-Laptop-Id: " << equipmentId
|
||||
INFO_LOG(m_logger) << "Create O/C-Handler for O/C-Laptop-Id: " << equipmentId
|
||||
<< " aliveTimeout: " << Settings::aliveTimeout() << " sec"
|
||||
<< " txCyleTime: " << Settings::txCycleTime() << " sec"
|
||||
<< " maxTransferBytes: " << Settings::maxNumOfBytePerTxCycle();
|
||||
@@ -161,10 +161,10 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
|
||||
QSet<ParticipantManagement::TypeClass::type> typeClasses,
|
||||
bool initial)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
QMutexLocker l(&m_accessMutex);
|
||||
DEBUG_LOG() << "Requested CenterEquipmentId: " << centerEquipmentId << " radius: " << radius;
|
||||
DEBUG_LOG(m_logger) << "Requested CenterEquipmentId: " << centerEquipmentId << " radius: " << radius;
|
||||
|
||||
bool endThread = false;
|
||||
|
||||
@@ -195,7 +195,7 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
|
||||
|
||||
if (centerParticipant.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Participant with EqId " << m_centerEquipmentId
|
||||
ERROR_LOG(m_logger) << "Participant with EqId " << m_centerEquipmentId
|
||||
<< " as center of the oc situation request does not exist!";
|
||||
endThread = true;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
|
||||
const ParticipantManagement::ParticipantPosition &partPosition = m_allParticipantPositions.value(centerParticipant.id());
|
||||
if (partPosition.participantId() == 0)
|
||||
{
|
||||
ERROR_LOG() << "Participant with EqId " << m_centerEquipmentId
|
||||
ERROR_LOG(m_logger) << "Participant with EqId " << m_centerEquipmentId
|
||||
<< " as center of the oc situation request has no position!";
|
||||
endThread = true;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
|
||||
}
|
||||
if (endThread && ++m_retryCount < 5)
|
||||
{
|
||||
INFO_LOG() << "Retry setting data - maybe participant is not yet available... " << m_retryCount;
|
||||
INFO_LOG(m_logger) << "Retry setting data - maybe participant is not yet available... " << m_retryCount;
|
||||
QTimer::singleShot(1000 * m_retryCount, this, [this]()
|
||||
{
|
||||
// must be initial here
|
||||
@@ -227,7 +227,7 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "Situation is not requested anymore -> end thread";
|
||||
INFO_LOG(m_logger) << "Situation is not requested anymore -> end thread";
|
||||
endThread = true;
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ void HandlerOcSituationData::setRequestOcSituationData(OcSituation::SituationCen
|
||||
|
||||
void HandlerOcSituationData::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
@@ -269,7 +269,7 @@ void HandlerOcSituationData::onParticipantChanged(const ParticipantManagement::P
|
||||
|
||||
if (!m_participants.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "m_participants does not contain participant id: " << participantId;
|
||||
DEBUG_LOG(m_logger) << "m_participants does not contain participant id: " << participantId;
|
||||
return; // participant is not of interest (now)
|
||||
}
|
||||
|
||||
@@ -290,11 +290,11 @@ void HandlerOcSituationData::onParticipantChanged(const ParticipantManagement::P
|
||||
setModified(participantId, OcSituation::ModificationFlag::eDesignator);
|
||||
|
||||
m_participants[participantId] = data;
|
||||
DEBUG_LOG() << "updated data in m_participants" << data;
|
||||
DEBUG_LOG(m_logger) << "updated data in m_participants" << data;
|
||||
|
||||
if (m_modifiedFlags.contains(participantId))
|
||||
{
|
||||
INFO_LOG() << "setModified for: " << m_participantId2EqId[participantId]
|
||||
INFO_LOG(m_logger) << "setModified for: " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId
|
||||
<< " bits: 0x" << QString::number(m_modifiedFlags[participantId], 16);
|
||||
}
|
||||
@@ -313,7 +313,7 @@ static inline int getEquipmentStateBits(const ParticipantManagement::DynamicPart
|
||||
|
||||
void HandlerOcSituationData::onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
@@ -322,7 +322,7 @@ void HandlerOcSituationData::onDynamicParticipantDataChanged(const ParticipantMa
|
||||
|
||||
if (!m_participants.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "m_participants does not contain participant id: " << participantId;
|
||||
DEBUG_LOG(m_logger) << "m_participants does not contain participant id: " << participantId;
|
||||
return; // participant does not interest us yet;
|
||||
}
|
||||
|
||||
@@ -343,11 +343,11 @@ void HandlerOcSituationData::onDynamicParticipantDataChanged(const ParticipantMa
|
||||
setModified(participantId, OcSituation::ModificationFlag::eState);
|
||||
|
||||
m_dynamicParticpantData[participantId] = data;
|
||||
DEBUG_LOG() << "updated data in m_dynamicParticpantData" << data;
|
||||
DEBUG_LOG(m_logger) << "updated data in m_dynamicParticpantData" << data;
|
||||
|
||||
if (m_modifiedFlags.contains(participantId))
|
||||
{
|
||||
INFO_LOG() << "setModified for: " << m_participantId2EqId[participantId]
|
||||
INFO_LOG(m_logger) << "setModified for: " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId
|
||||
<< " bits: 0x" << QString::number(m_modifiedFlags[participantId], 16);
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void HandlerOcSituationData::onDynamicParticipantDataChanged(const ParticipantMa
|
||||
|
||||
void HandlerOcSituationData::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
const int participantId = data.participantId();
|
||||
@@ -368,7 +368,7 @@ void HandlerOcSituationData::onParticipantPositionChanged(const ParticipantManag
|
||||
|
||||
if (!m_participants.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "m_participants does not contain participant id: " << participantId;
|
||||
DEBUG_LOG(m_logger) << "m_participants does not contain participant id: " << participantId;
|
||||
return; // participant does not interest us yet;
|
||||
}
|
||||
|
||||
@@ -404,11 +404,11 @@ void HandlerOcSituationData::onParticipantPositionChanged(const ParticipantManag
|
||||
}
|
||||
|
||||
m_participantPositions[participantId] = data;
|
||||
DEBUG_LOG() << "updated data in m_participantPositions" << data;
|
||||
DEBUG_LOG(m_logger) << "updated data in m_participantPositions" << data;
|
||||
|
||||
if (m_modifiedFlags.contains(participantId))
|
||||
{
|
||||
INFO_LOG() << "setModified for: " << m_participantId2EqId[participantId]
|
||||
INFO_LOG(m_logger) << "setModified for: " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId
|
||||
<< " bits: 0x" << QString::number(m_modifiedFlags[participantId], 16);
|
||||
}
|
||||
@@ -444,13 +444,13 @@ void HandlerOcSituationData::onDusMineStateChanged(const AreaEffectSimulation::D
|
||||
|
||||
void HandlerOcSituationData::handleSituation()
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
QMutexLocker l(&m_accessMutex);
|
||||
|
||||
if (m_radius == 0)
|
||||
{
|
||||
INFO_LOG() << "Do not send Situation as radius is 0, centerEquipmentId " << m_centerEquipmentId
|
||||
INFO_LOG(m_logger) << "Do not send Situation as radius is 0, centerEquipmentId " << m_centerEquipmentId
|
||||
<< ", m_position " << m_centerPosition;
|
||||
QTimer::singleShot(0, this, &HandlerOcSituationData::aliveTimeout); // ending thread
|
||||
return;
|
||||
@@ -462,7 +462,7 @@ void HandlerOcSituationData::handleSituation()
|
||||
const QByteArray data = createDataStream(Settings::maxNumOfBytePerTxCycle(), prioQueue);
|
||||
if (data.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "Don't send empty data to TAB.";
|
||||
DEBUG_LOG(m_logger) << "Don't send empty data to TAB.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ void HandlerOcSituationData::resetAliveTimer()
|
||||
|
||||
void HandlerOcSituationData::aliveTimeout()
|
||||
{
|
||||
INFO_LOG() << "O/C-Thread keep alive timeout for O/C-Laptop-Id: " << m_equipmentId
|
||||
INFO_LOG(m_logger) << "O/C-Thread keep alive timeout for O/C-Laptop-Id: " << m_equipmentId
|
||||
<< " - Thread will be finished id: " << QThread::currentThreadId();
|
||||
|
||||
QThread::currentThread()->quit();
|
||||
@@ -495,9 +495,9 @@ void HandlerOcSituationData::aliveTimeout()
|
||||
|
||||
void HandlerOcSituationData::onResetInternalData()
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
INFO_LOG() << "Resetting internal data!";
|
||||
INFO_LOG(m_logger) << "Resetting internal data!";
|
||||
m_participants.clear();
|
||||
m_dynamicParticpantData.clear();
|
||||
m_participantPositions.clear();
|
||||
@@ -514,15 +514,15 @@ void HandlerOcSituationData::onResetInternalData()
|
||||
|
||||
void HandlerOcSituationData::fetchParticipantsInRange()
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
const QPointF relCenterPos = PositionConverter::relativeFromGeographic(m_centerPosition, m_baseCoordinate);
|
||||
|
||||
if (m_centerType == OcSituation::SituationCenterType::Equipment)
|
||||
INFO_LOG() << "Fetching participants in radius around equipment " << m_centerEquipmentId
|
||||
INFO_LOG(m_logger) << "Fetching participants in radius around equipment " << m_centerEquipmentId
|
||||
<< " with position " << relCenterPos.x() << "/" << relCenterPos.y() << " and radius: " << m_radius << ", " << m_baseCoordinate.mgrs()
|
||||
<< ", " << m_centerPosition.lon() << ", " << m_centerPosition.lat();
|
||||
else
|
||||
INFO_LOG() << "Fetching participants in radius of position " << relCenterPos.x() << "/" << relCenterPos.y() << " radius: " << m_radius;
|
||||
INFO_LOG(m_logger) << "Fetching participants in radius of position " << relCenterPos.x() << "/" << relCenterPos.y() << " radius: " << m_radius;
|
||||
|
||||
const double rangeSqr = m_radius * m_radius;
|
||||
QMultiMap<double, int> curParticipantsInRange;
|
||||
@@ -542,7 +542,7 @@ void HandlerOcSituationData::fetchParticipantsInRange()
|
||||
if ((m_partyList.count() > 0 && m_partyList.contains(participant.partyId()) == false) ||
|
||||
(m_typeClassList.count() > 0 && m_typeClassList.contains(typeClass.underlying()) == false))
|
||||
{
|
||||
DEBUG_LOG() << participant.id() << " filtered out";
|
||||
DEBUG_LOG(m_logger) << participant.id() << " filtered out";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -554,13 +554,13 @@ void HandlerOcSituationData::fetchParticipantsInRange()
|
||||
|
||||
if (distanceSqr > rangeSqr)
|
||||
{
|
||||
DEBUG_LOG() << "Participant NOT in range equipment number: " << participant.equipmentNumber().get()
|
||||
DEBUG_LOG(m_logger) << "Participant NOT in range equipment number: " << participant.equipmentNumber().get()
|
||||
<< " pos: " << relPartPos.x() << "/" << relPartPos.y()
|
||||
<< " distance: " << std::sqrt(distanceSqr) << " distanceSqr: " << distanceSqr;
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Participant in range equipment number: " << participant.equipmentNumber().get()
|
||||
DEBUG_LOG(m_logger) << "Participant in range equipment number: " << participant.equipmentNumber().get()
|
||||
<< " pos: " << relPartPos.x() << "/" << relPartPos.y()
|
||||
<< " distance: " << std::sqrt(distanceSqr) << " distanceSqr: " << distanceSqr;
|
||||
curParticipantsInRange.insertMulti(distanceSqr, participant.id());
|
||||
@@ -574,7 +574,7 @@ void HandlerOcSituationData::fetchParticipantsInRange()
|
||||
{
|
||||
handleParticipant(m_allParticipants.value(id));
|
||||
curParticipants.insert(id);
|
||||
DEBUG_LOG() << "Added participant to hundred nearest: " << m_participantId2EqId[id]
|
||||
DEBUG_LOG(m_logger) << "Added participant to hundred nearest: " << m_participantId2EqId[id]
|
||||
<< " / " << id;
|
||||
++cnt;
|
||||
if (cnt >= Settings::maxParticipantsInSituation())
|
||||
@@ -591,7 +591,7 @@ void HandlerOcSituationData::fetchParticipantsInRange()
|
||||
{
|
||||
m_newlyOutdatedParticipants.insert(id);
|
||||
m_outdatedParticipants.insert(id);
|
||||
DEBUG_LOG() << "Participant outdated: " << m_participantId2EqId[id]
|
||||
DEBUG_LOG(m_logger) << "Participant outdated: " << m_participantId2EqId[id]
|
||||
<< " / " << id;
|
||||
}
|
||||
}
|
||||
@@ -600,7 +600,7 @@ void HandlerOcSituationData::fetchParticipantsInRange()
|
||||
|
||||
void HandlerOcSituationData::handleParticipant(const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
int participantId = participant.id();
|
||||
if (participant.equipmentNumber().is_set())
|
||||
@@ -611,7 +611,7 @@ void HandlerOcSituationData::handleParticipant(const ParticipantManagement::Part
|
||||
// now check if is a new participant
|
||||
if (!m_participants.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "Adding previously unknown participant to m_participants: " << m_participantId2EqId.value(participantId)
|
||||
DEBUG_LOG(m_logger) << "Adding previously unknown participant to m_participants: " << m_participantId2EqId.value(participantId)
|
||||
<< " / " << participantId;
|
||||
// new participant -> all modified
|
||||
setModified(participantId, OcSituation::ModificationFlag::eAll);
|
||||
@@ -625,7 +625,7 @@ void HandlerOcSituationData::handleParticipant(const ParticipantManagement::Part
|
||||
// old participant, check if was outdated
|
||||
if (m_outdatedParticipants.remove(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "Adding old player that is inside the radius again: " << m_participantId2EqId.value(participantId)
|
||||
DEBUG_LOG(m_logger) << "Adding old player that is inside the radius again: " << m_participantId2EqId.value(participantId)
|
||||
<< " / " << participantId;
|
||||
if (m_modifiedFlags[participantId] == OcSituation::ModificationFlag::eNone)
|
||||
setModified(participantId, OcSituation::ModificationFlag::ePosition2D);
|
||||
@@ -641,7 +641,7 @@ static inline bool sortParticipantsForRange(const QPair<int, float> &p1,
|
||||
|
||||
QVector<QPair<int, float>> HandlerOcSituationData::createPrioQueue() const
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
QVector<QPair<int, float>> participantsPrioQueue;
|
||||
participantsPrioQueue.reserve(m_participantsToSend.size());
|
||||
@@ -665,12 +665,12 @@ QVector<QPair<int, float>> HandlerOcSituationData::createPrioQueue() const
|
||||
cntNotSendDbg = participantIt.value();
|
||||
// Je nicht gesendeten -> 5 % abziehen, aber nie alles
|
||||
const int cntNotSend = participantIt.value() > 20 ? 19 : participantIt.value();
|
||||
DEBUG_LOG() << "prio: " << prio << ", prio / 20 * cntNotSend: " << prio / 20 * cntNotSend;
|
||||
DEBUG_LOG(m_logger) << "prio: " << prio << ", prio / 20 * cntNotSend: " << prio / 20 * cntNotSend;
|
||||
prio -= (prio / 20 * cntNotSend);
|
||||
}
|
||||
participantsPrioQueue.push_back(qMakePair(participantId, prio));
|
||||
|
||||
DEBUG_LOG() << "Radius from center for: " << m_participantId2EqId[participantId]
|
||||
DEBUG_LOG(m_logger) << "Radius from center for: " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId << " = " << sqrt(r2) << "m, prio: " << prio
|
||||
<< ", not sent: " << cntNotSendDbg << " time(s)";
|
||||
}
|
||||
@@ -681,7 +681,7 @@ QVector<QPair<int, float>> HandlerOcSituationData::createPrioQueue() const
|
||||
QByteArray HandlerOcSituationData::createDataStream(int maxSize,
|
||||
const QVector<QPair<int, float>> &participantsPrioQueue)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
|
||||
QByteArray ret;
|
||||
|
||||
@@ -690,7 +690,7 @@ QByteArray HandlerOcSituationData::createDataStream(int maxSize,
|
||||
maxSize -= 5;
|
||||
|
||||
// first: participants that are not in range any more
|
||||
DEBUG_LOG() << "m_newlyOutdatedParticipants: " << m_newlyOutdatedParticipants.size();
|
||||
DEBUG_LOG(m_logger) << "m_newlyOutdatedParticipants: " << m_newlyOutdatedParticipants.size();
|
||||
QSet<int> copyOfOutdated = m_newlyOutdatedParticipants;
|
||||
for (const auto participantId : std::as_const(m_newlyOutdatedParticipants))
|
||||
{
|
||||
@@ -701,21 +701,21 @@ QByteArray HandlerOcSituationData::createDataStream(int maxSize,
|
||||
continue;
|
||||
|
||||
QByteArray ba = m_bWithCompression ? qCompress(ret) : ret;
|
||||
DEBUG_LOG() << "Added info about oudated player " << m_participantId2EqId[participantId]
|
||||
DEBUG_LOG(m_logger) << "Added info about oudated player " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId
|
||||
<< " data size: " << ret.size()
|
||||
<< " compressed size: " << ba.size();
|
||||
if (ba.size() > maxSize)
|
||||
{
|
||||
m_newlyOutdatedParticipants = copyOfOutdated;
|
||||
TRACE_LOG() << "Uncompressed Data: " << ret.toHex(' ');
|
||||
TRACE_LOG(m_logger) << "Uncompressed Data: " << ret.toHex(' ');
|
||||
return ba;
|
||||
}
|
||||
}
|
||||
m_newlyOutdatedParticipants = copyOfOutdated;
|
||||
|
||||
// Data updates
|
||||
DEBUG_LOG() << "participantsPrioQueue: " << participantsPrioQueue.size();
|
||||
DEBUG_LOG(m_logger) << "participantsPrioQueue: " << participantsPrioQueue.size();
|
||||
for (auto prioPair : participantsPrioQueue)
|
||||
{
|
||||
int participantId = prioPair.first;
|
||||
@@ -734,7 +734,7 @@ QByteArray HandlerOcSituationData::createDataStream(int maxSize,
|
||||
// default DynamicParticipantData crashes the tablet software. we skip it ... for now
|
||||
if (dynamicParticipantData == ParticipantManagement::DynamicParticipantData())
|
||||
{
|
||||
INFO_LOG() << "There is only default DynamicParticipantData for participant with id " << participantId << " --> skipping";
|
||||
INFO_LOG(m_logger) << "There is only default DynamicParticipantData for participant with id " << participantId << " --> skipping";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -753,21 +753,21 @@ QByteArray HandlerOcSituationData::createDataStream(int maxSize,
|
||||
continue;
|
||||
|
||||
QByteArray ba = m_bWithCompression ? qCompress(ret) : ret;
|
||||
DEBUG_LOG() << "Added info about changed player " << m_participantId2EqId[participantId]
|
||||
DEBUG_LOG(m_logger) << "Added info about changed player " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId
|
||||
<< " bits: 0x" << QString::number(modifiedFlags, 16)
|
||||
<< " data size: " << ret.size()
|
||||
<< " compressed: " << ba.size();
|
||||
if (ba.size() > maxSize)
|
||||
{
|
||||
DEBUG_LOG() << "Uncompressed Data: " << ret.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Uncompressed Data: " << ret.toHex(' ');
|
||||
return ba;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ret.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "Uncompressed Data: " << ret.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Uncompressed Data: " << ret.toHex(' ');
|
||||
return m_bWithCompression ? qCompress(ret) : ret;
|
||||
}
|
||||
else
|
||||
@@ -776,7 +776,7 @@ QByteArray HandlerOcSituationData::createDataStream(int maxSize,
|
||||
|
||||
void HandlerOcSituationData::updatePrioOfNotSendParticipants()
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
// add a prio bonus to all participants not send this cycle
|
||||
QMap<int, OcSituation::ModificationBits>::const_iterator it = m_modifiedFlags.constBegin();
|
||||
for (; it != m_modifiedFlags.constEnd(); ++it)
|
||||
@@ -794,15 +794,15 @@ void HandlerOcSituationData::updatePrioOfNotSendParticipants()
|
||||
participantIt.value()++;
|
||||
notSentSince = participantIt.value();
|
||||
}
|
||||
DEBUG_LOG() << "Player " << m_participantId2EqId[participantId]
|
||||
DEBUG_LOG(m_logger) << "Player " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId << " not sent for " << notSentSince << " time(s)";
|
||||
}
|
||||
}
|
||||
|
||||
void HandlerOcSituationData::setModified(int participantId, OcSituation::ModificationBits bits)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
DEBUG_LOG() << "setModified " << bits << " for: " << m_participantId2EqId[participantId]
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << "setModified " << bits << " for: " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId;
|
||||
m_participantsToSend.insert(participantId);
|
||||
|
||||
@@ -817,8 +817,8 @@ void HandlerOcSituationData::setModified(int participantId, OcSituation::Modific
|
||||
|
||||
void HandlerOcSituationData::clearModified(int participantId)
|
||||
{
|
||||
TRACE_LOG() << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
DEBUG_LOG() << "clearModified for: " << m_participantId2EqId[participantId]
|
||||
TRACE_LOG(m_logger) << "Thread " << QThread::currentThreadId() << " function: " << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << "clearModified for: " << m_participantId2EqId[participantId]
|
||||
<< " / " << participantId;
|
||||
m_modifiedFlags.remove(participantId);
|
||||
m_participantsNotSend.remove(participantId);
|
||||
@@ -921,7 +921,7 @@ void HandlerOcSituationData::addVBG(QByteArray &buf, const ParticipantManagement
|
||||
uint8_t vitRes = (youngestStateInformation.vitality() / 10);
|
||||
if (vitRes > 10)
|
||||
{
|
||||
WARNING_LOG() << "Vitality of Participant " << data.participantId() << " is not between 0 and 100%. Putting to 100%";
|
||||
WARNING_LOG(m_logger) << "Vitality of Participant " << data.participantId() << " is not between 0 and 100%. Putting to 100%";
|
||||
vitRes = 10;
|
||||
}
|
||||
vitRes += ((int)youngestStateInformation.sanitationResult().underlying() << 4);
|
||||
|
||||
Reference in new issue
Block a user