mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
Ref T231, Ref T236, Ref T238 improvements based on Unit test
* check for a correct callsign (assert) * set callsign if missing (fallback) * resetLastInterpolation - null last inperpolation
This commit is contained in:
@@ -29,6 +29,10 @@ namespace BlackMisc
|
||||
CAircraftSituation::CAircraftSituation()
|
||||
: m_groundElevation( { 0, nullptr }, CAltitude::MeanSeaLevel) {}
|
||||
|
||||
CAircraftSituation::CAircraftSituation(const CCallsign &correspondingCallsign)
|
||||
: m_correspondingCallsign(correspondingCallsign), m_groundElevation( { 0, nullptr }, CAltitude::MeanSeaLevel)
|
||||
{}
|
||||
|
||||
CAircraftSituation::CAircraftSituation(const CCoordinateGeodetic &position, const CHeading &heading, const CAngle &pitch, const CAngle &bank, const CSpeed &gs, const CAltitude &groundElevation)
|
||||
: m_position(position), m_heading(heading), m_pitch(pitch),
|
||||
m_bank(bank), m_groundSpeed(gs), m_groundElevation(groundElevation)
|
||||
@@ -167,6 +171,23 @@ namespace BlackMisc
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CAircraftSituation::isNull() const
|
||||
{
|
||||
return this->isPositionNull();
|
||||
}
|
||||
|
||||
void CAircraftSituation::setNull()
|
||||
{
|
||||
m_position.setNull();
|
||||
m_pressureAltitude.setNull();
|
||||
m_heading.setNull();
|
||||
m_pitch.setNull();
|
||||
m_bank.setNull();
|
||||
m_groundElevation.setNull();
|
||||
m_groundSpeed.setNull();
|
||||
m_onGroundReliability = CAircraftSituation::OnGroundReliabilityNoSet;
|
||||
}
|
||||
|
||||
const QString &CAircraftSituation::isOnGroundAsString() const
|
||||
{
|
||||
return CAircraftSituation::isOnGroundToString(this->isOnGround());
|
||||
|
||||
@@ -85,6 +85,9 @@ namespace BlackMisc
|
||||
//! Default constructor.
|
||||
CAircraftSituation();
|
||||
|
||||
//! Constructor with callsign
|
||||
CAircraftSituation(const CCallsign &correspondingCallsign);
|
||||
|
||||
//! Comprehensive constructor
|
||||
CAircraftSituation(const Geo::CCoordinateGeodetic &position,
|
||||
const CHeading &heading = {},
|
||||
@@ -117,6 +120,12 @@ namespace BlackMisc
|
||||
//! Position null?
|
||||
bool isPositionNull() const { return m_position.isNull(); }
|
||||
|
||||
//! Null situation
|
||||
virtual bool isNull() const override;
|
||||
|
||||
//! Set to null
|
||||
void setNull();
|
||||
|
||||
//! Set position
|
||||
void setPosition(const Geo::CCoordinateGeodetic &position) { m_position = position; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user