mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Regularly request remote aircraft data from X-Plane
This includes * ground elevation * model offset (to be implemented) ref T259
This commit is contained in:
committed by
Klaus Basan
parent
2ab6a96d57
commit
72497fdefc
@@ -380,6 +380,22 @@ namespace XSwiftBus
|
||||
}
|
||||
}
|
||||
|
||||
void CTraffic::requestRemoteAircraftData()
|
||||
{
|
||||
if (m_planesByCallsign.empty()) { return; }
|
||||
const QList<Plane *> planes = m_planesByCallsign.values();
|
||||
for (const Plane *plane : planes)
|
||||
{
|
||||
double lat = plane->position.lat;
|
||||
double lon = plane->position.lon;
|
||||
double elevation = plane->position.elevation;
|
||||
double groundElevation = plane->terrainProbe.getElevation(lat, lon, elevation);
|
||||
if (std::isnan(groundElevation)) { groundElevation = 0.0; }
|
||||
constexpr double fudgeFactor = 3.0; //! \fixme Value should be different for each plane, derived from the CSL model geometry
|
||||
emit remoteAircraftData(plane->callsign, lat, lon, groundElevation, fudgeFactor);
|
||||
}
|
||||
}
|
||||
|
||||
//! memcmp function which ignores the header ("size" member) and compares only the payload (the rest of the struct)
|
||||
template <typename T>
|
||||
int memcmpPayload(T *dst, T *src)
|
||||
|
||||
Reference in New Issue
Block a user