performance enhancements

better 2D drawing
This commit is contained in:
2016-09-29 21:02:19 +02:00
parent 5ddc455bee
commit 833327bafd
10 changed files with 185 additions and 59 deletions

View File

@@ -270,8 +270,8 @@ private:
/** check whether its time for a filter update, and if so, execute the update and return true */
bool filterUpdateIfNeeded() {
//static float avgSum = 0;
//static int avgCount = 0;
static float avgSum = 0;
static int avgCount = 0;
// fixed update rate based on incoming sensor data
// allows working with live data and faster for offline data
@@ -287,7 +287,8 @@ private:
const Timestamp ts2 = Timestamp::fromUnixTime();
const Timestamp tsDiff = ts2-ts1;
const QString filterTime = QString::number(tsDiff.ms());
//avgSum += tsDiff.ms(); ++avgCount; std::cout << "ts:" << curObs.currentTime << " avg:" << (avgSum/avgCount) << std::endl;
avgSum += tsDiff.ms(); ++avgCount;
Log::add("xxx", "ts:" + std::to_string(curObs.currentTime.ms()) + " avg:" + std::to_string(avgSum/avgCount));
QMetaObject::invokeMethod(mainController->getInfoWidget(), "showFilterTime", Qt::QueuedConnection, Q_ARG(const QString&, filterTime));
return true;