1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-12 22:43:36 -04:00

Fix opensky groundspeed and vertical rate.

This commit is contained in:
Jon Beniston
2026-07-30 18:17:58 +01:00
parent ea7571b31f
commit a92c944c2c
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -8427,13 +8427,13 @@ void ADSBDemodGUI::handleImportReply(QNetworkReply* reply)
aircraft->m_onSurface = state[8].toBool(false);
aircraft->m_onSurfaceValid = true;
if (!state[9].isNull()) {
aircraft->setGroundspeed((int)state[9].toDouble(), m_settings);
aircraft->setGroundspeed((int)std::round(Units::metresPerSecondToKnots(state[9].toDouble())), m_settings);
}
if (!state[10].isNull()) {
aircraft->setTrack((float)state[10].toDouble(), aircraft->m_rxTime);
}
if (!state[11].isNull()) {
aircraft->setVerticalRate((int)state[10].toDouble(), m_settings);
aircraft->setVerticalRate((int)std::round(Units::metresPerSecondToFeetPerMin(state[11].toDouble())), m_settings);
}
if (!state[14].isNull())
{
+10
View File
@@ -89,6 +89,11 @@ public:
return knots * 0.514444f;
}
static float metresPerSecondToKnots(float mps)
{
return mps * 1.94384f;
}
static float kmpsToKPH(float kps)
{
return kps * (60.0 * 60.0);
@@ -109,6 +114,11 @@ public:
return (int)std::round(feetPerMinToMetresPerSecond(fpm));
}
static float metresPerSecondToFeetPerMin(float mps)
{
return mps * 196.850394f;
}
template <class T>
static T degreesToRadians(T degrees)
{