mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
Changed order of samples directory, started with aviation classes.
This commit is contained in:
42
src/blackmisc/avaltitude.cpp
Normal file
42
src/blackmisc/avaltitude.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "avaltitude.h"
|
||||
|
||||
namespace BlackMisc {
|
||||
|
||||
/**
|
||||
* Own implementation for streaming
|
||||
*/
|
||||
QString CAltitude::stringForStreamingOperator() const
|
||||
{
|
||||
QString s = CLength::stringForStreamingOperator();
|
||||
return s.append(this->m_msl ? " MSL" : " AGL");
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigment
|
||||
*/
|
||||
CAltitude& CAltitude::operator =(const CAltitude &otherAltitude)
|
||||
{
|
||||
// Check for self-assignment!
|
||||
if (this == &otherAltitude) return *this;
|
||||
CLength::operator = (otherAltitude);
|
||||
this->m_msl = otherAltitude.m_msl;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Equal?
|
||||
*/
|
||||
bool CAltitude::operator ==(const CAltitude &otherAltitude)
|
||||
{
|
||||
return otherAltitude.m_msl == this->m_msl && CLength::operator ==(otherAltitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unequal?
|
||||
*/
|
||||
bool CAltitude::operator !=(const CAltitude &otherAltitude)
|
||||
{
|
||||
return !((*this) == otherAltitude);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user