mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
committed by
Mathew Sutcliffe
parent
229d7c6068
commit
978f3c88e5
@@ -7,46 +7,66 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
/*
|
||||
* String for converter
|
||||
*/
|
||||
QString CCoordinateGeodetic::convertToQString(bool i18n) const
|
||||
{
|
||||
QString s = "Geodetic: {%1, %2, %3}";
|
||||
return s.arg(this->m_latitude.valueRoundedWithUnit(6, i18n)).arg(this->m_longitude.valueRoundedWithUnit(6, i18n)).arg(this->m_height.valueRoundedWithUnit(i18n));
|
||||
}
|
||||
/*
|
||||
* String for converter
|
||||
*/
|
||||
QString CCoordinateGeodetic::convertToQString(bool i18n) const
|
||||
{
|
||||
QString s = "Geodetic: {%1, %2, %3}";
|
||||
return s.arg(this->m_latitude.valueRoundedWithUnit(6, i18n)).arg(this->m_longitude.valueRoundedWithUnit(6, i18n)).arg(this->m_height.valueRoundedWithUnit(i18n));
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall to Dbus
|
||||
*/
|
||||
void CCoordinateGeodetic::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << this->m_latitude;
|
||||
argument << this->m_longitude;
|
||||
argument << this->m_height;
|
||||
}
|
||||
/*
|
||||
* Marshall to Dbus
|
||||
*/
|
||||
void CCoordinateGeodetic::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << this->m_latitude;
|
||||
argument << this->m_longitude;
|
||||
argument << this->m_height;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall from Dbus
|
||||
*/
|
||||
void CCoordinateGeodetic::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> this->m_latitude;
|
||||
argument >> this->m_longitude;
|
||||
argument >> this->m_height;
|
||||
}
|
||||
/*
|
||||
* Unmarshall from Dbus
|
||||
*/
|
||||
void CCoordinateGeodetic::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> this->m_latitude;
|
||||
argument >> this->m_longitude;
|
||||
argument >> this->m_height;
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CCoordinateGeodetic::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CCoordinateGeodetic>(typeid(CCoordinateGeodetic).name());
|
||||
qDBusRegisterMetaType<CCoordinateGeodetic>();
|
||||
}
|
||||
/*
|
||||
* Same coordinate
|
||||
*/
|
||||
bool CCoordinateGeodetic::operator ==(const CCoordinateGeodetic &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return this->m_height == other.m_height &&
|
||||
this->m_latitude == other.m_latitude &&
|
||||
this->m_longitude == other.m_longitude;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CCoordinateGeodetic::operator !=(const CCoordinateGeodetic &other) const
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CCoordinateGeodetic::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CCoordinateGeodetic>();
|
||||
qDBusRegisterMetaType<CCoordinateGeodetic>();
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user