Ref T299, pitch bank heading info

This commit is contained in:
Klaus Basan
2018-08-01 22:54:05 +02:00
parent 007e175721
commit ff9d6147c8
3 changed files with 18 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ namespace BlackGui
m_columns.addColumn(CColumn("latitude", CAircraftSituation::IndexLatitude, new CLatLonFormatter()));
m_columns.addColumn(CColumn("longitude", CAircraftSituation::IndexLongitude, new CLatLonFormatter()));
m_columns.addColumn(CColumn("gs.", CAircraftSituation::IndexGroundSpeed, new CSpeedKtsFormatter()));
m_columns.addColumn(CColumn::standardString("PBH", "pitch bank heading", CAircraftSituation::IndexPBHInfo));
m_columns.addColumn(CColumn("on gnd.", "is on gnd.", CAircraftSituation::IndexIsOnGround, new CBoolIconFormatter("yes", "no"), true));
m_columns.addColumn(CColumn::standardString("reliability", CAircraftSituation::IndexOnGroundReliabilityString));
m_columns.addColumn(CColumn::standardString("gnd.elv.", CAircraftSituation::IndexGroundElevationPlusInfo));

View File

@@ -303,6 +303,7 @@ namespace BlackMisc
case IndexAltitude: return this->getAltitude().propertyByIndex(index.copyFrontRemoved());
case IndexHeading: return m_heading.propertyByIndex(index.copyFrontRemoved());
case IndexPitch: return m_pitch.propertyByIndex(index.copyFrontRemoved());
case IndexPBHInfo: return CVariant::fromValue(this->getPBHInfo());
case IndexBank: return m_bank.propertyByIndex(index.copyFrontRemoved());
case IndexCG: return m_cg.propertyByIndex(index.copyFrontRemoved());
case IndexSceneryOffset: return m_sceneryOffset.propertyByIndex(index.copyFrontRemoved());
@@ -357,6 +358,7 @@ namespace BlackMisc
{
case IndexPosition: return m_position.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getPosition());
case IndexAltitude: return this->getAltitude().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getAltitude());
case IndexPBHInfo: // fall through
case IndexPitch: return m_pitch.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getPitch());
case IndexBank: return m_bank.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getBank());
case IndexCG: return m_cg.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCG());
@@ -381,7 +383,7 @@ namespace BlackMisc
{
const int c = Compare::compare(this->getGroundElevationInfo(), compareValue.getGroundElevationInfo());
if (c != 0) { return c; }
// fall thrue, compare flag
// fall through, compare flag
}
case IndexGroundElevationInfoTransferred: return Compare::compare(m_isElvInfoTransferred, compareValue.m_isElvInfoTransferred);
case IndexCanLikelySkipNearGroundInterpolation: return Compare::compare(this->canLikelySkipNearGroundInterpolation(), compareValue.canLikelySkipNearGroundInterpolation());
@@ -960,6 +962,16 @@ namespace BlackMisc
m_pressureAltitude = altitude;
}
QString CAircraftSituation::getPBHInfo() const
{
static const QString pbh("P: %1 %2 B: %3 %4 H: %5 %6");
return pbh.arg(
this->getPitch().valueRoundedWithUnit(CAngleUnit::deg(), 1, true), this->getPitch().valueRoundedWithUnit(CAngleUnit::rad(), 5, true),
this->getBank().valueRoundedWithUnit(CAngleUnit::deg(), 1, true), this->getBank().valueRoundedWithUnit(CAngleUnit::rad(), 5, true),
this->getHeading().valueRoundedWithUnit(CAngleUnit::deg(), 1, true), this->getHeading().valueRoundedWithUnit(CAngleUnit::rad(), 5, true)
);
}
bool CAircraftSituation::isMoving() const
{
const double gsKmh = this->getGroundSpeed().value(CSpeedUnit::km_h());

View File

@@ -66,6 +66,7 @@ namespace BlackMisc
IndexOnGroundReliability,
IndexOnGroundReliabilityString,
IndexPitch,
IndexPBHInfo,
IndexGroundSpeed,
IndexGroundElevationPlane,
IndexGroundElevationInfo,
@@ -409,6 +410,9 @@ namespace BlackMisc
//! Set bank (angle)
void setBank(const PhysicalQuantities::CAngle &bank) { m_bank = bank; }
//! Get PBH info (all together)
QString getPBHInfo() const;
//! Get ground speed
const PhysicalQuantities::CSpeed &getGroundSpeed() const { return m_groundSpeed; }