Style and check condition

This commit is contained in:
Klaus Basan
2018-09-02 14:36:14 +02:00
committed by Roland Winklmeier
parent a062607520
commit f85c6bcc30
2 changed files with 25 additions and 16 deletions

View File

@@ -213,6 +213,8 @@ namespace BlackSimPlugin
union FS_PBH union FS_PBH
{ {
unsigned int pbh = 0; //!< Pitch/Bank/Heading as integer value unsigned int pbh = 0; //!< Pitch/Bank/Heading as integer value
//! PBH
struct struct
{ {
unsigned int unused : 1; //!< unused bit unsigned int unused : 1; //!< unused bit
@@ -223,6 +225,6 @@ namespace BlackSimPlugin
}; };
}; };
} }
} } // ns
#endif // BLACKSIMPLUGIN_FS9_FS9SDK_H #endif // guard

View File

@@ -1675,6 +1675,13 @@ namespace BlackSimPlugin
position.Heading = situation.getHeading().value(CAngleUnit::deg()); position.Heading = situation.getHeading().value(CAngleUnit::deg());
position.Airspeed = static_cast<DWORD>(situation.getGroundSpeed().valueInteger(CSpeedUnit::kts())); position.Airspeed = static_cast<DWORD>(situation.getGroundSpeed().valueInteger(CSpeedUnit::kts()));
// sanity check
if (CBuildConfig::isLocalDeveloperDebugBuild() && situation.getGroundSpeed().isNegativeWithEpsilonConsidered())
{
BLACK_VERIFY_X(false, Q_FUNC_INFO, "Negative speed");
position.Airspeed = 0;
}
// MSFS has inverted pitch and bank angles // MSFS has inverted pitch and bank angles
position.Pitch = -situation.getPitch().value(CAngleUnit::deg()); position.Pitch = -situation.getPitch().value(CAngleUnit::deg());
position.Bank = -situation.getBank().value(CAngleUnit::deg()); position.Bank = -situation.getBank().value(CAngleUnit::deg());