mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
Ref T429, style
This commit is contained in:
@@ -1963,8 +1963,15 @@ namespace BlackSimPlugin
|
|||||||
Q_ASSERT_X(!situation.isGeodeticHeightNull(), Q_FUNC_INFO, "Missing height (altitude)");
|
Q_ASSERT_X(!situation.isGeodeticHeightNull(), Q_FUNC_INFO, "Missing height (altitude)");
|
||||||
Q_ASSERT_X(!situation.isPositionNull(), Q_FUNC_INFO, "Missing position");
|
Q_ASSERT_X(!situation.isPositionNull(), Q_FUNC_INFO, "Missing position");
|
||||||
|
|
||||||
|
// lat/Lng, NO PBH
|
||||||
SIMCONNECT_DATA_INITPOSITION position = CSimulatorFsxCommon::coordinateToFsxPosition(situation);
|
SIMCONNECT_DATA_INITPOSITION position = CSimulatorFsxCommon::coordinateToFsxPosition(situation);
|
||||||
position.Heading = situation.getHeading().value(CAngleUnit::deg());
|
|
||||||
|
// MSFS has inverted pitch and bank angles
|
||||||
|
position.Pitch = -situation.getPitch().value(CAngleUnit::deg());
|
||||||
|
position.Bank = -situation.getBank().value(CAngleUnit::deg());
|
||||||
|
position.Heading = situation.getHeading().value(CAngleUnit::deg());
|
||||||
|
position.OnGround = 0U; // not on ground
|
||||||
|
|
||||||
const double gsKts = situation.getGroundSpeed().value(CSpeedUnit::kts());
|
const double gsKts = situation.getGroundSpeed().value(CSpeedUnit::kts());
|
||||||
position.Airspeed = static_cast<DWORD>(qRound(gsKts));
|
position.Airspeed = static_cast<DWORD>(qRound(gsKts));
|
||||||
|
|
||||||
@@ -1972,14 +1979,13 @@ namespace BlackSimPlugin
|
|||||||
if (gsKts < 0.0)
|
if (gsKts < 0.0)
|
||||||
{
|
{
|
||||||
// we get negative GS for pushback and helicopters
|
// we get negative GS for pushback and helicopters
|
||||||
// do do we handle them her with DWORD
|
// here we handle them her with DWORD (unsigned)
|
||||||
position.Airspeed = 0U;
|
position.Airspeed = 0U;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// MSFS has inverted pitch and bank angles
|
{
|
||||||
position.Pitch = -situation.getPitch().value(CAngleUnit::deg());
|
position.Airspeed = static_cast<DWORD>(qRound(gsKts));
|
||||||
position.Bank = -situation.getBank().value(CAngleUnit::deg());
|
}
|
||||||
position.OnGround = 0U; // not on ground
|
|
||||||
|
|
||||||
if (sendGnd && situation.isOnGroundInfoAvailable())
|
if (sendGnd && situation.isOnGroundInfoAvailable())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user