refs #852 Add a time offset to CAircraftParts.

This commit is contained in:
Mathew Sutcliffe
2017-01-09 01:42:17 +00:00
parent 4d30ce40c7
commit 3e70ab1207
2 changed files with 22 additions and 1 deletions

View File

@@ -116,6 +116,15 @@ namespace BlackMisc
//! Set aircraft on ground
void setOnGround(bool onGround) { m_isOnGround = onGround; }
//! Milliseconds to add to timestamp for interpolation
void setTimeOffsetMs(qint64 offset) { this->m_timeOffsetMs = offset; }
//! Milliseconds to add to timestamp for interpolation
qint64 getTimeOffsetMs() const { return this->m_timeOffsetMs; }
//! Timestamp with offset added for interpolation
qint64 getAdjustedMSecsSinceEpoch() const { return this->getMSecsSinceEpoch() + this->getTimeOffsetMs(); }
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;
@@ -126,6 +135,7 @@ namespace BlackMisc
bool m_gearDown = false;
bool m_spoilersOut = false;
bool m_isOnGround = false;
qint64 m_timeOffsetMs = 0;
BLACK_METACLASS(
CAircraftParts,
@@ -135,7 +145,8 @@ namespace BlackMisc
BLACK_METAMEMBER_NAMED(spoilersOut, "spoilers_out"),
BLACK_METAMEMBER_NAMED(engines, "engines"),
BLACK_METAMEMBER_NAMED(isOnGround, "on_ground"),
BLACK_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForJson | DisabledForComparison)
BLACK_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForJson | DisabledForComparison),
BLACK_METAMEMBER(timeOffsetMs, 0, DisabledForJson | DisabledForComparison)
);
};
} // namespace