mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Reflecting discussed changes for interpolation performance refs #386
(based on FSX testing) * Only send changed situation to SIM * Split sending of parts / situations * Only send parts with a reduced frequency (means slower as positions) * Mark geodetic height as null for default values (the value is usually unavailable) * Fixed altitude to MSL for network data * Trace which aircrafts support aircraft parts via network * Renamed insert_fron push_front (as proposed by Roland) Status quo / lessons learnt * On slower PCs jitter is still noticed for interpolated aircraft. * Running interpolation in an independent process (aka core, not in GUI) reduced load dependencies => it seems to make sense to run driver in own thread * The onGround flag in parts seems clumsy as it required to retrieve parts for position updates * In interpolation performance really matters
This commit is contained in:
@@ -29,6 +29,14 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
CONTAINER ITimestampObjectList<OBJ, CONTAINER>::findBeforeAndRemove(qint64 msSinceEpoch)
|
||||
{
|
||||
CONTAINER result(findBefore(msSinceEpoch));
|
||||
this->removeBefore(msSinceEpoch);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
CONTAINER ITimestampObjectList<OBJ, CONTAINER>::findBeforeNowMinusOffset(qint64 msOffset) const
|
||||
{
|
||||
@@ -75,18 +83,18 @@ namespace BlackMisc
|
||||
OBJ ITimestampObjectList<OBJ, CONTAINER>::latestValue() const
|
||||
{
|
||||
if (this->container().isEmpty()) { return OBJ(); }
|
||||
CONTAINER container(container()); // copy
|
||||
container.sortLatestFirst();
|
||||
return container.front();
|
||||
CONTAINER copy(container()); // copy
|
||||
copy.sortLatestFirst();
|
||||
return copy.front();
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
OBJ ITimestampObjectList<OBJ, CONTAINER>::oldestValue() const
|
||||
{
|
||||
if (this->container().isEmpty()) { return OBJ(); }
|
||||
CONTAINER container(container()); // copy
|
||||
container.sortLatestFirst();
|
||||
return container.back();
|
||||
CONTAINER copy(container()); // copy
|
||||
copy.sortLatestFirst();
|
||||
return copy.back();
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
@@ -134,14 +142,14 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
void ITimestampObjectList<OBJ, CONTAINER>::insertTimestampObject(const OBJ &object, int maxElements)
|
||||
void ITimestampObjectList<OBJ, CONTAINER>::push_frontMaxElements(const OBJ &object, int maxElements)
|
||||
{
|
||||
Q_ASSERT(maxElements > 1);
|
||||
if (this->container().size() >= (maxElements - 1))
|
||||
{
|
||||
this->container().truncate(maxElements - 1);
|
||||
}
|
||||
this->container().insert_front(object);
|
||||
this->container().push_front(object);
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
|
||||
Reference in New Issue
Block a user