Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+18
-19
@@ -14,10 +14,9 @@ static constexpr int s_maxWlsRetryCount = 3;
|
||||
|
||||
namespace WirelessLocationSystem
|
||||
{
|
||||
WlsParticipant::WlsParticipant(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_wlsTeleTimeoutTimer(new QTimer(this))
|
||||
{
|
||||
WlsParticipant::WlsParticipant(QObject *parent) : QObject(parent)
|
||||
, m_wlsTeleTimeoutTimer(new QTimer(this)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_wlsTeleTimeoutTimer->setSingleShot(true);
|
||||
m_wlsTeleTimeoutTimer->setTimerType(Qt::VeryCoarseTimer);
|
||||
m_wlsTeleTimeoutTimer->setInterval(s_dataCommunicationAliveTimeout);
|
||||
@@ -54,12 +53,12 @@ void WlsParticipant::setPosition(const RelativePosition &newPosition,
|
||||
if (tsCurrentPos == m_lastSeenPosition ||
|
||||
(((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout()) && comparePos(m_relativePosition, newPosition)))
|
||||
{
|
||||
DEBUG_LOG() << "Check for pos Update";
|
||||
DEBUG_LOG() << "Is Outdated= " <<((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout());
|
||||
DEBUG_LOG(m_logger) << "Check for pos Update";
|
||||
DEBUG_LOG(m_logger) << "Is Outdated= " <<((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout());
|
||||
|
||||
if (((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout()) && comparePos(m_relativePosition, newPosition))
|
||||
{
|
||||
DEBUG_LOG() << "Same Position or not older than 5000msecs " << tsCurrentPos - m_lastSeenPosition;
|
||||
DEBUG_LOG(m_logger) << "Same Position or not older than 5000msecs " << tsCurrentPos - m_lastSeenPosition;
|
||||
return;
|
||||
}
|
||||
const qint64 tsNow = QDateTime::currentMSecsSinceEpoch();
|
||||
@@ -99,7 +98,7 @@ void WlsParticipant::checkGpsOnOffTimeoutTimer(qint64 tNow)
|
||||
if (m_lastSeenDataCommunication > tNow - s_maxWlsRetryCount * s_dataCommunicationAliveTimeout)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << getPlayerIdStr() << ": lastSeenDataCommunication: "
|
||||
DEBUG_LOG(m_logger) << getPlayerIdStr() << ": lastSeenDataCommunication: "
|
||||
<< m_lastSeenDataCommunication << ", now: "
|
||||
<< (tNow - s_maxWlsRetryCount * s_dataCommunicationAliveTimeout)
|
||||
<< " (" << tNow << "), "
|
||||
@@ -141,14 +140,14 @@ void WlsParticipant::setWlsZone(int newWlsZone)
|
||||
m_dataCommunication = (newWlsZone > 3)
|
||||
? DataCommunication::On
|
||||
: DataCommunication::Off;
|
||||
INFO_LOG() << getPlayerIdStr() << ": wlsZone old: " << m_wlsZone << ", new: " << newWlsZone
|
||||
INFO_LOG(m_logger) << getPlayerIdStr() << ": wlsZone old: " << m_wlsZone << ", new: " << newWlsZone
|
||||
<< ", new gps mode: " << m_gpsMode
|
||||
<< ", new data comm mode: " << m_dataCommunication
|
||||
<< ", " << this;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << getPlayerIdStr() << ": Reset zone/data comunication status - sfm was restarted";
|
||||
INFO_LOG(m_logger) << getPlayerIdStr() << ": Reset zone/data comunication status - sfm was restarted";
|
||||
m_gpsMode = GpsMode::On;
|
||||
m_dataCommunication = DataCommunication::Unknown;
|
||||
m_lastSeenPosition = -1;
|
||||
@@ -169,7 +168,7 @@ bool WlsParticipant::handleSfmRxData(const SfmMsgTetra_rx *sfmTele)
|
||||
{
|
||||
if (!isRecvCounterCorrect(sfmTele->sendCounter()))
|
||||
{
|
||||
WARNING_LOG() << "Got data telegram with counter " << int(sfmTele->sendCounter())
|
||||
WARNING_LOG(m_logger) << "Got data telegram with counter " << int(sfmTele->sendCounter())
|
||||
<< " last one was " << int(m_lastRecvCounter) << " - ignoring";
|
||||
return false;
|
||||
}
|
||||
@@ -179,7 +178,7 @@ bool WlsParticipant::handleSfmRxData(const SfmMsgTetra_rx *sfmTele)
|
||||
{
|
||||
if (m_sfmRxPayloadFragmentNumber + 1 != sfmTele->fragmentNumber())
|
||||
{
|
||||
WARNING_LOG() << getPlayerIdStr() << ": Missing a fragment (waiting for "
|
||||
WARNING_LOG(m_logger) << getPlayerIdStr() << ": Missing a fragment (waiting for "
|
||||
<< (m_sfmRxPayloadFragmentNumber + 1)
|
||||
<< ", got " << sfmTele->fragmentNumber() << ")";
|
||||
if (sfmTele->fragmentNumber() != 1)
|
||||
@@ -200,7 +199,7 @@ bool WlsParticipant::handleSfmRxData(const SfmMsgTetra_rx *sfmTele)
|
||||
{
|
||||
|
||||
if (m_sfmRxPayloadFragmentNumber != 0)
|
||||
WARNING_LOG() << getPlayerIdStr()
|
||||
WARNING_LOG(m_logger) << getPlayerIdStr()
|
||||
<< ": Got unfragmented telegram but currently waiting for next fragment of a fragmented telegram";
|
||||
m_sfmRxPayloadFragmentNumber = 0;
|
||||
m_sfmRxPayloadData = sfmTele->payload();
|
||||
@@ -265,7 +264,7 @@ void WlsParticipant::sendBinarySfmData(const std::vector<unsigned char> &data)
|
||||
const QByteArray ba = LtsUtils::toQByteArray(data);
|
||||
if (!calcChunkCountAndLen(ba, chunkCount, chunkLen))
|
||||
{
|
||||
WARNING_LOG() << getPlayerIdStr()
|
||||
WARNING_LOG(m_logger) << getPlayerIdStr()
|
||||
<< ": Internal error calculating chunk size for payload size " << data.size();
|
||||
return;
|
||||
}
|
||||
@@ -290,7 +289,7 @@ void WlsParticipant::handleWlsAck(const Acknowledge_rx *ack)
|
||||
|
||||
if (ack->recvCounter() != m_nextSendCounter)
|
||||
{
|
||||
WARNING_LOG() << "Got ack for telegram with counter " << int(ack->recvCounter())
|
||||
WARNING_LOG(m_logger) << "Got ack for telegram with counter " << int(ack->recvCounter())
|
||||
<< " but expected " << int(m_nextSendCounter) << " - ignoring";
|
||||
return;
|
||||
}
|
||||
@@ -298,7 +297,7 @@ void WlsParticipant::handleWlsAck(const Acknowledge_rx *ack)
|
||||
{
|
||||
if (m_wlsQueue.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << "got an ack but nothing was sent - something went terribly wrong - resetting send/recv counter";
|
||||
ERROR_LOG(m_logger) << "got an ack but nothing was sent - something went terribly wrong - resetting send/recv counter";
|
||||
m_nextSendCounter = 0;
|
||||
m_lastRecvCounter = 0;
|
||||
return;
|
||||
@@ -343,7 +342,7 @@ void WlsParticipant::sendNextWlsTelegram(bool bIsResend)
|
||||
m_wlsQueue.clear();
|
||||
return;
|
||||
}
|
||||
WARNING_LOG() << getPlayerIdStr()
|
||||
WARNING_LOG(m_logger) << getPlayerIdStr()
|
||||
<< ": Trying to send a wls telegram but no data communication possible";
|
||||
|
||||
Q_ASSERT(false);
|
||||
@@ -364,14 +363,14 @@ void WlsParticipant::sendNextWlsTelegram(bool bIsResend)
|
||||
void WlsParticipant::onWlsTeleTimeout()
|
||||
{
|
||||
++m_wlsTeleTimeoutCounter;
|
||||
DEBUG_LOG() << getPlayerIdStr()
|
||||
DEBUG_LOG(m_logger) << getPlayerIdStr()
|
||||
<< ": Resend WLS connection to participant " << m_equipmentNumber
|
||||
<< "(" << m_tagId << ")"
|
||||
<< " m_wlsTeleTimeoutCounter =" << m_wlsTeleTimeoutCounter
|
||||
<< " s_maxWlsRetryCount=" << s_maxWlsRetryCount;
|
||||
if (m_wlsTeleTimeoutCounter == s_maxWlsRetryCount)
|
||||
{
|
||||
WARNING_LOG() << getPlayerIdStr()
|
||||
WARNING_LOG(m_logger) << getPlayerIdStr()
|
||||
<< ": Lost WLS connection to participant " << m_equipmentNumber
|
||||
<< "(" << m_tagId << ")";
|
||||
m_lastSeenDataCommunication = -1;
|
||||
|
||||
Reference in new issue
Block a user