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:
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user