Ref T557 Metaclass flag to preserve measurement unit when marshalling PQ's in flight plans.

This commit is contained in:
Mat Sutcliffe
2019-03-04 01:14:09 +00:00
parent 567a55503f
commit 83dec5408b
10 changed files with 114 additions and 31 deletions

View File

@@ -183,8 +183,6 @@ namespace BlackMisc
{
constexpr double NaN = std::numeric_limits<double>::quiet_NaN();
argument << (this->isNull() ? NaN : this->value(UnitClass::defaultUnit()));
// argument << m_value;
// argument << m_unit;
}
template <class MU, class PQ>
@@ -196,8 +194,20 @@ namespace BlackMisc
{
this->setNull();
}
// argument >> m_value;
// argument >> m_unit;
}
template <class MU, class PQ>
void CPhysicalQuantity<MU, PQ>::marshallToDbus(QDBusArgument &argument, LosslessTag) const
{
argument << m_value;
argument << m_unit;
}
template <class MU, class PQ>
void CPhysicalQuantity<MU, PQ>::unmarshallFromDbus(const QDBusArgument &argument, LosslessTag)
{
argument >> m_value;
argument >> m_unit;
}
template <class MU, class PQ>

View File

@@ -213,6 +213,12 @@ namespace BlackMisc
//! \copydoc BlackMisc::Mixin::DBusByMetaClass::unmarshallFromDbus
void unmarshallFromDbus(const QDBusArgument &argument);
//! Marshal to DBus, preserving the measurement unit
void marshallToDbus(QDBusArgument &argument, LosslessTag) const;
//! Unmarshal from DBus, with preserved measurement unit
void unmarshallFromDbus(const QDBusArgument &argument, LosslessTag);
//! \copydoc BlackMisc::Mixin::HashByMetaClass::qHash
uint getValueHash() const;