mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
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:
committed by
Klaus Basan
parent
51a90a9a71
commit
de4fe44156
@@ -212,7 +212,7 @@ namespace BlackCore
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CContextOwnAircraft::updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude)
|
||||
bool CContextOwnAircraft::updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude, const CAltitude &pressureAltitude)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << position << altitude; }
|
||||
QWriteLocker l(&m_lockAircraft);
|
||||
@@ -224,6 +224,12 @@ namespace BlackCore
|
||||
changed = true;
|
||||
m_ownAircraft.setAltitude(altitude);
|
||||
}
|
||||
|
||||
if (m_ownAircraft.getPressureAltitude() != pressureAltitude)
|
||||
{
|
||||
changed = true;
|
||||
m_ownAircraft.setPressureAltitude(pressureAltitude);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user