mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
committed by
Mathew Sutcliffe
parent
229d7c6068
commit
978f3c88e5
@@ -10,42 +10,62 @@ using BlackMisc::PhysicalQuantities::CLengthUnit;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
/*
|
||||
* Own implementation for streaming
|
||||
*/
|
||||
QString CAltitude::convertToQString(bool /* i18n */) const
|
||||
{
|
||||
QString s = this->CLength::convertToQString();
|
||||
return s.append(this->isMeanSeaLevel() ? " MSL" : " AGL");
|
||||
}
|
||||
/*
|
||||
* Own implementation for streaming
|
||||
*/
|
||||
QString CAltitude::convertToQString(bool /* i18n */) const
|
||||
{
|
||||
QString s = this->CLength::convertToQString();
|
||||
return s.append(this->isMeanSeaLevel() ? " MSL" : " AGL");
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CAltitude::operator ==(const CAltitude &other)
|
||||
{
|
||||
return other.m_datum == this->m_datum && this->CLength::operator ==(other);
|
||||
}
|
||||
/*
|
||||
* Marshall to DBus
|
||||
*/
|
||||
void CAltitude::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
this->CLength::marshallToDbus(argument);
|
||||
argument << qint32(this->m_datum);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CAltitude::operator !=(const CAltitude &other)
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
/*
|
||||
* Unmarshall from DBus
|
||||
*/
|
||||
void CAltitude::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
this->CLength::unmarshallFromDbus(argument);
|
||||
qint32 datum;
|
||||
argument >> datum;
|
||||
this->m_datum = static_cast<ReferenceDatum>(datum);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CAltitude::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CAltitude>(typeid(CAltitude).name());
|
||||
qDBusRegisterMetaType<CAltitude>();
|
||||
}
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CAltitude::operator ==(const CAltitude &other) const
|
||||
{
|
||||
return other.m_datum == this->m_datum && this->CLength::operator ==(other);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CAltitude::operator !=(const CAltitude &other) const
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CAltitude::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CAltitude>();
|
||||
qDBusRegisterMetaType<CAltitude>();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user