mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #386, further improvements on interpolation
* extended unit tests for interpolator / parts testing * allow to skip sorting when splitting by time * update ot aircraft to FSX in own member function * Skip time sync parts (FSX) when disabled
This commit is contained in:
@@ -60,7 +60,7 @@ namespace BlackMisc
|
||||
CSequence(std::initializer_list<T> il) : m_pimpl(new Pimpl<QList<T>>(QList<T>(il))) {}
|
||||
|
||||
/*!
|
||||
* \brief By QList of type <T>.
|
||||
* \brief By QList of type T.
|
||||
*/
|
||||
CSequence(const QList<T> &list) : m_pimpl(new Pimpl<QList<T>>(QList<T>(list))) {}
|
||||
|
||||
|
||||
@@ -76,9 +76,17 @@ namespace BlackMisc
|
||||
void CRemoteAircraftProviderDummy::insertNewSituation(const CAircraftSituation &situation)
|
||||
{
|
||||
this->m_situations.push_frontMaxElements(situation, 20);
|
||||
this->m_situations.sortLatestFirst(); // like in real world, latest should be first
|
||||
emit addedRemoteAircraftSituation(situation);
|
||||
}
|
||||
|
||||
void CRemoteAircraftProviderDummy::insertNewAircraftParts(const CAircraftParts &parts)
|
||||
{
|
||||
this->m_parts.push_frontMaxElements(parts, 20);
|
||||
this->m_parts.sortLatestFirst(); // like in real world, latest should be first
|
||||
emit addedRemoteAircraftParts(parts);
|
||||
}
|
||||
|
||||
void CRemoteAircraftProviderDummy::clear()
|
||||
{
|
||||
m_situations.clear();
|
||||
|
||||
@@ -65,7 +65,10 @@ namespace BlackMisc
|
||||
//! For testing, add new situation and fire signals
|
||||
void insertNewSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||
|
||||
// clear all data
|
||||
//! For testing, add new parts and fire signals
|
||||
void insertNewAircraftParts(const BlackMisc::Aviation::CAircraftParts &parts);
|
||||
|
||||
//! Clear all data
|
||||
void clear();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
QList<CONTAINER> ITimestampObjectList<OBJ, CONTAINER>::splitByTime(qint64 msSinceEpoch) const
|
||||
QList<CONTAINER> ITimestampObjectList<OBJ, CONTAINER>::splitByTime(qint64 msSinceEpoch, bool alreadySortedLatestFirst) const
|
||||
{
|
||||
CONTAINER newer(this->container());
|
||||
newer.sortLatestFirst();
|
||||
if (!alreadySortedLatestFirst) { newer.sortLatestFirst(); }
|
||||
CONTAINER older;
|
||||
for (auto it = newer.begin(); it != newer.end(); ++it)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace BlackMisc
|
||||
|
||||
//! Split into 2 containers, [0] >= msSinceEpoch ("newer") [b] < msSinceEpoch ("older")
|
||||
//! \note Sort order: latest elements first
|
||||
QList<CONTAINER> splitByTime(qint64 msSinceEpoch) const;
|
||||
QList<CONTAINER> splitByTime(qint64 msSinceEpoch, bool alreadySortedLatestFirst = false) const;
|
||||
|
||||
//! Latest value
|
||||
OBJ latestValue() const;
|
||||
|
||||
Reference in New Issue
Block a user