[FG] Getting ground elevation

This commit is contained in:
Lars Toenning
2020-01-19 19:29:46 +01:00
committed by Mat Sutcliffe
parent 24f3750843
commit 8053504acb
4 changed files with 19 additions and 0 deletions

View File

@@ -407,5 +407,15 @@ namespace BlackSimPlugin
{
m_dbusInterface->callDBusAsync(QLatin1String("getSpeedBrakeRatio"), setterCallback(o_speedBrakeRatio));
}
double CFGSwiftBusServiceProxy::getGroundElevation() const
{
return m_dbusInterface->callDBusRet<double>(QLatin1String("getGroundElevation"));
}
void CFGSwiftBusServiceProxy::getGroundElevationAsync(double *o_groundElevation)
{
m_dbusInterface->callDBusAsync(QLatin1String("getGroundElevation"),setterCallback(o_groundElevation));
}
} // ns
} // ns

View File

@@ -321,6 +321,12 @@ namespace BlackSimPlugin
double getSpeedBrakeRatio() const;
void getSpeedBrakeRatioAsync(double *o_speedBrakeRatio);
//! @}
//! Get ground elevation [m] for current airplane position
//! @{
double getGroundElevation() const;
void getGroundElevationAsync(double *o_groundElevation);
//! @}
};
}
}

View File

@@ -208,6 +208,7 @@ namespace BlackSimPlugin
m_serviceProxy->getTransponderModeAsync(&m_flightgearData.xpdrMode);
m_serviceProxy->getTransponderIdentAsync(&m_flightgearData.xpdrIdent);
m_serviceProxy->getAllWheelsOnGroundAsync(&m_flightgearData.onGroundAll);
m_serviceProxy->getGroundElevationAsync(&m_flightgearData.groundElevation);
CAircraftSituation situation;
situation.setPosition({ m_flightgearData.latitudeDeg, m_flightgearData.longitudeDeg, 0 });
@@ -217,6 +218,7 @@ namespace BlackSimPlugin
situation.setPitch({ m_flightgearData.pitchDeg, CAngleUnit::deg() });
situation.setBank({ m_flightgearData.rollDeg, CAngleUnit::deg() });
situation.setGroundSpeed({ m_flightgearData.groundspeedKts, CSpeedUnit::kts() });
situation.setGroundElevation(CAltitude(m_flightgearData.groundElevation,CAltitude::MeanSeaLevel,CLengthUnit::m()),CAircraftSituation::FromProvider);
// Updates
// Do not update ICAO codes, as this overrides reverse lookups

View File

@@ -98,6 +98,7 @@ namespace BlackSimPlugin
QList<double> enginesN1Percentage; //!< N1 per engine [%]
double speedBrakeRatio; //!< Speed break ratio [%]
double pressureAltitudeFt; //!< Pressure altitude [inhg]
double groundElevation; //!< Ground Elevation [m]
};
//! Flightgear ISimulator implementation