refs #666 XBus expects timestamp relative to current time, in case core and sim PCs run with different clock times.

This commit is contained in:
Mathew Sutcliffe
2016-06-05 14:44:35 +01:00
parent 73156c2e6d
commit 4c2bc31975
5 changed files with 7 additions and 7 deletions

View File

@@ -249,7 +249,7 @@ namespace XBus
m_planesById.clear();
}
void CTraffic::addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 time)
void CTraffic::addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime)
{
const auto plane = m_planesByCallsign.value(callsign, nullptr);
if (plane)
@@ -267,7 +267,7 @@ namespace XBus
CAngle(roll, CAngleUnit::deg()),
CSpeed(0, CSpeedUnit::kts())
}, maxSituationCount);
plane->situations.front().setMSecsSinceEpoch(time);
plane->situations.front().setMSecsSinceEpoch(relativeTime + QDateTime::currentMSecsSinceEpoch());
}
}