mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
[XP] Get the ground elevation under the own aircraft
This commit is contained in:
@@ -321,6 +321,7 @@ namespace BlackSimPlugin::XPlane
|
||||
m_serviceProxy->getOwnAircraftCom2DataAsync(&m_xplaneData);
|
||||
m_serviceProxy->getOwnAircraftXpdrAsync(&m_xplaneData);
|
||||
m_serviceProxy->getAllWheelsOnGroundAsync(&m_xplaneData.onGroundAll);
|
||||
m_serviceProxy->getGroundElevationAsync(&m_xplaneData.groundElevation);
|
||||
|
||||
CAircraftSituation situation;
|
||||
situation.setPosition({ m_xplaneData.latitudeDeg, m_xplaneData.longitudeDeg, 0 });
|
||||
@@ -333,6 +334,8 @@ namespace BlackSimPlugin::XPlane
|
||||
situation.setPitch({ m_xplaneData.pitchDeg, CAngleUnit::deg() });
|
||||
situation.setBank({ m_xplaneData.rollDeg, CAngleUnit::deg() });
|
||||
situation.setGroundSpeed({ m_xplaneData.groundspeedMs, CSpeedUnit::m_s() });
|
||||
const CAltitude elevation { std::isnan(m_xplaneData.groundElevation) ? 0 : m_xplaneData.groundElevation, CAltitude::MeanSeaLevel, CLengthUnit::m() };
|
||||
situation.setGroundElevation(elevation, CAircraftSituation::FromProvider);
|
||||
situation.setVelocity({ m_xplaneData.localXVelocityMs, m_xplaneData.localYVelocityMs, m_xplaneData.localZVelocityMs,
|
||||
CSpeedUnit::m_s(), m_xplaneData.pitchRadPerSec, m_xplaneData.rollRadPerSec, m_xplaneData.headingRadPerSec,
|
||||
CAngleUnit::rad(), CTimeUnit::s()});
|
||||
|
||||
@@ -86,6 +86,7 @@ namespace BlackSimPlugin::XPlane
|
||||
double rollRadPerSec = 0; //!< Roll angular velocity [rad/s]
|
||||
double headingRadPerSec = 0; //!< Heading angular velocity [rad/s]
|
||||
bool onGroundAll = false; //!< All wheels on ground?
|
||||
double groundElevation = 0; //!< Elevation of ground [m]
|
||||
int com1ActiveKhz = 122800; //!< COM1 active [kHz]
|
||||
int com1StandbyKhz = 122800; //!< COM1 standby [kHz]
|
||||
bool isCom1Receiving = true; //!< COM1 receiving
|
||||
|
||||
@@ -544,6 +544,16 @@ namespace BlackSimPlugin::XPlane
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAllWheelsOnGround"), setterCallback(o_allWheels));
|
||||
}
|
||||
|
||||
double CXSwiftBusServiceProxy::getGroundElevation() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getGroundElevation"));
|
||||
}
|
||||
|
||||
void CXSwiftBusServiceProxy::getGroundElevationAsync(double* o_elevationM)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getGroundElevation"), setterCallback(o_elevationM));
|
||||
}
|
||||
|
||||
int CXSwiftBusServiceProxy::getCom1ActiveKhz() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1ActiveKhz"));
|
||||
|
||||
@@ -329,6 +329,12 @@ namespace BlackSimPlugin::XPlane
|
||||
void getAllWheelsOnGroundAsync(bool *o_allWheels);
|
||||
//! @}
|
||||
|
||||
//! Get elevation of ground under the plane (in meters)
|
||||
//! @{
|
||||
double getGroundElevation() const;
|
||||
void getGroundElevationAsync(double *o_elevationM);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XSwiftBus::CService::getCom1ActiveKhz
|
||||
//! @{
|
||||
int getCom1ActiveKhz() const;
|
||||
|
||||
Reference in New Issue
Block a user