Fix sending the correct pressure altitude for a pilot position

* Before this commit, only the true altitude was known for an aircraft situation. The pressure altitude was not available anywhere yet.
* This caused a wrong altitude in radar clients.
* We fix this reading the pressure altitude from the simulators and set it in the own aircraft situation.
* MS Flight Simulators have the pressure altitude in the APIs available.
* For X-Plane and emulated simulator, we need to calculate it from the pressure at sea level.
* Finally, we use the new available pressure altitude to send it to the FSD server.

Maniphest Tasks: Ref T223
This commit is contained in:
Roland Winklmeier
2018-01-12 13:30:30 +01:00
committed by Klaus Basan
parent 51a90a9a71
commit de4fe44156
30 changed files with 298 additions and 43 deletions

View File

@@ -187,6 +187,12 @@ namespace BlackMisc
//! Set altitude
void setAltitude(const CAltitude &altitude) { m_position.setGeodeticHeight(altitude); }
//! Get pressure altitude
const CAltitude &getPressureAltitude() const { return m_pressureAltitude; }
//! Set pressure altitude
void setPressureAltitude(const CAltitude &altitude);
//! Get pitch
const PhysicalQuantities::CAngle &getPitch() const { return m_pitch; }
@@ -238,6 +244,7 @@ namespace BlackMisc
private:
CCallsign m_correspondingCallsign;
Geo::CCoordinateGeodetic m_position;
Aviation::CAltitude m_pressureAltitude { 0, nullptr };
CHeading m_heading;
PhysicalQuantities::CAngle m_pitch;
PhysicalQuantities::CAngle m_bank;
@@ -252,6 +259,7 @@ namespace BlackMisc
CAircraftSituation,
BLACK_METAMEMBER(correspondingCallsign),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(pressureAltitude),
BLACK_METAMEMBER(heading),
BLACK_METAMEMBER(pitch),
BLACK_METAMEMBER(bank),