mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
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:
@@ -485,7 +485,7 @@ namespace BlackSimPlugin
|
||||
situation.getPitch().value(CAngleUnit::deg()),
|
||||
situation.getBank().value(CAngleUnit::deg()),
|
||||
situation.getHeading().value(CAngleUnit::deg()),
|
||||
situation.getAdjustedMSecsSinceEpoch()); // fixme sim machine's clock must be synchronized
|
||||
situation.getAdjustedMSecsSinceEpoch() - QDateTime::currentMSecsSinceEpoch());
|
||||
}
|
||||
|
||||
void CSimulatorXPlane::ps_remoteProviderAddAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts)
|
||||
|
||||
@@ -86,9 +86,9 @@ namespace BlackSimPlugin
|
||||
m_dbusInterface->callDBus(QLatin1String("removeAllPlanes"));
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 time)
|
||||
void CXBusTrafficProxy::addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("addPlanePosition"), callsign, latitude, longitude, altitude, pitch, roll, heading, time);
|
||||
m_dbusInterface->callDBus(QLatin1String("addPlanePosition"), callsign, latitude, longitude, altitude, pitch, roll, heading, relativeTime);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setPlaneSurfaces(const QString &callsign, double gear, double flap, double spoiler, double speedBrake, double slat, double wingSweep, double thrust,
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackSimPlugin
|
||||
void removeAllPlanes();
|
||||
|
||||
//! \copydoc XBus::CTraffic::addPlanePosition
|
||||
void addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 time);
|
||||
void addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime);
|
||||
|
||||
//! \copydoc XBus::CTraffic::setPlaneSurfaces
|
||||
void setPlaneSurfaces(const QString &callsign, double gear, double flap, double spoiler, double speedBrake, double slat, double wingSweep, double thrust,
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace XBus
|
||||
void removeAllPlanes();
|
||||
|
||||
//! Set the position of a traffic aircraft
|
||||
void addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 time);
|
||||
void addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime);
|
||||
|
||||
//! Set the flight control surfaces and lights of a traffic aircraft
|
||||
void setPlaneSurfaces(const QString &callsign, double gear, double flap, double spoiler, double speedBrake, double slat, double wingSweep, double thrust,
|
||||
|
||||
Reference in New Issue
Block a user