* add Optimization build type which uses -O3

* create QTimer object in AWDataEngineAggregator class, emit signal to
  this timer because timers could not be started in the separate thread
* increase limit x2 with leaving the thread pool size as was
This commit is contained in:
arcan1s
2015-10-07 01:39:10 +03:00
parent 69c1f0ed5a
commit f7e24f680a
4 changed files with 24 additions and 7 deletions

View File

@ -30,9 +30,16 @@ AWDataEngineAggregator::AWDataEngineAggregator(QObject *parent, const int interv
{
qCDebug(LOG_AW);
// timer events
m_timer = new QTimer(this);
m_timer->setSingleShot(true);
setInterval(interval);
initDataEngines();
connectVisualization();
connect(this, SIGNAL(startTimer()), m_timer, SLOT(start()));
connect(m_timer, SIGNAL(timeout()), this, SLOT(connectVisualization()));
}
@ -41,6 +48,7 @@ AWDataEngineAggregator::~AWDataEngineAggregator()
qCDebug(LOG_AW);
m_dataEngines.clear();
if (m_timer != nullptr) delete m_timer;
}
@ -50,6 +58,7 @@ void AWDataEngineAggregator::setInterval(const int _interval)
qCDebug(LOG_AW) << "Interval" << _interval;
m_interval = _interval;
m_timer->setInterval(5 * _interval);
}
@ -57,6 +66,7 @@ void AWDataEngineAggregator::connectVisualization()
{
qCDebug(LOG_AW);
// reconnectSources();
connect(this, SIGNAL(updateData(QString, QVariantMap)),
parent(), SLOT(dataUpdated(QString, QVariantMap)));
@ -70,8 +80,11 @@ void AWDataEngineAggregator::disconnectVisualization()
disconnect(this, SIGNAL(updateData(QString, QVariantMap)),
parent(), SLOT(dataUpdated(QString, QVariantMap)));
// m_dataEngines.clear();
return QTimer::singleShot(5 * m_interval, this, SLOT(connectVisualization()));
// HACK run timer in the main thread since a timer could not be started from
// the different thread
return emit(startTimer());
}