mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 07:35:53 +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
@@ -148,7 +148,7 @@ private:
|
||||
//! \param wgsLatitude WGS latitude
|
||||
//! \param wgsLongitude WGS longitude
|
||||
//! \param altitude
|
||||
void setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const BlackMisc::Aviation::CAltitude &altitude);
|
||||
void setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const BlackMisc::Aviation::CAltitude &altitude, const BlackMisc::Aviation::CAltitude &pressureAltitude);
|
||||
|
||||
//! Is given main page selected?
|
||||
//! \param mainPage index to be checked
|
||||
|
||||
@@ -47,7 +47,7 @@ bool SwiftGuiStd::reloadOwnAircraft()
|
||||
return changed;
|
||||
}
|
||||
|
||||
void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude)
|
||||
void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgsLongitude, const CAltitude &altitude, const CAltitude &pressureAltitude)
|
||||
{
|
||||
CCoordinateGeodetic coordinate(
|
||||
CLatitude::fromWgs84(wgsLatitude),
|
||||
@@ -56,5 +56,5 @@ void SwiftGuiStd::setTestPosition(const QString &wgsLatitude, const QString &wgs
|
||||
|
||||
m_ownAircraft.setPosition(coordinate);
|
||||
m_ownAircraft.setAltitude(altitude);
|
||||
sGui->getIContextOwnAircraft()->updateOwnPosition(coordinate, altitude);
|
||||
sGui->getIContextOwnAircraft()->updateOwnPosition(coordinate, altitude, pressureAltitude);
|
||||
}
|
||||
|
||||
@@ -37,23 +37,33 @@ void SwiftGuiStd::onMenuClicked()
|
||||
QObject *sender = QObject::sender();
|
||||
if (sender == ui->menu_TestLocationsEDRY)
|
||||
{
|
||||
this->setTestPosition("N 049° 18' 17", "E 008° 27' 05", CAltitude(312, CAltitude::MeanSeaLevel, CLengthUnit::ft()));
|
||||
this->setTestPosition("N 049° 18' 17", "E 008° 27' 05",
|
||||
CAltitude(312, CAltitude::MeanSeaLevel, CLengthUnit::ft()),
|
||||
CAltitude(312, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::ft()));
|
||||
}
|
||||
else if (sender == ui->menu_TestLocationsEDNX)
|
||||
{
|
||||
this->setTestPosition("N 048° 14′ 22", "E 011° 33′ 41", CAltitude(486, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
this->setTestPosition("N 048° 14′ 22", "E 011° 33′ 41",
|
||||
CAltitude(486, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||
CAltitude(486, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
||||
}
|
||||
else if (sender == ui->menu_TestLocationsEDDM)
|
||||
{
|
||||
this->setTestPosition("N 048° 21′ 14", "E 011° 47′ 10", CAltitude(448, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
this->setTestPosition("N 048° 21′ 14", "E 011° 47′ 10",
|
||||
CAltitude(448, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||
CAltitude(448, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
||||
}
|
||||
else if (sender == ui->menu_TestLocationsEDDF)
|
||||
{
|
||||
this->setTestPosition("N 50° 2′ 0", "E 8° 34′ 14", CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
this->setTestPosition("N 50° 2′ 0", "E 8° 34′ 14",
|
||||
CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||
CAltitude(100, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
||||
}
|
||||
else if (sender == ui->menu_TestLocationsLOWW)
|
||||
{
|
||||
this->setTestPosition("N 48° 7′ 6.3588", "E 16° 33′ 39.924", CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
this->setTestPosition("N 48° 7′ 6.3588", "E 16° 33′ 39.924",
|
||||
CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||
CAltitude(100, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
||||
}
|
||||
else if (sender == ui->menu_WindowFont)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user