m_semaphoreHUD(1),
m_semaphoreScope(1),
m_semaphoreBackground(1),
- initialDimensionUpdateDone(false)
+ initialDimensionUpdateDone(false),
+ m_requestForcedUpdate(false)
{
m_scopePalette = QPalette();
void AbstractScopeWidget::prodScopeThread()
{
// Only start a new thread if the scope is actually visible
- // and not hidden by another widget on the stack.
- if (this->visibleRegion().isEmpty()) {
+ // and not hidden by another widget on the stack and if user want the scope to update.
+ if (this->visibleRegion().isEmpty() || (!m_aAutoRefresh->isChecked() && !m_requestForcedUpdate)) {
// qDebug() << "Scope " << m_widgetName << " is not visible. Not calculating scope.";
} else {
// Try to acquire the semaphore. This must only succeed if m_threadScope is not running
// See http://doc.qt.nokia.com/latest/qtconcurrentrun.html#run about
// running member functions in a thread
m_threadScope = QtConcurrent::run(this, &AbstractScopeWidget::renderScope, m_accelFactorScope, m_scopeImage);
+ m_requestForcedUpdate = false;
// qDebug() << "Scope thread started in " << m_widgetName;
void AbstractScopeWidget::mouseReleaseEvent(QMouseEvent *event)
{
- if (!m_aAutoRefresh->isChecked()) m_activeRender->sendFrameUpdate();
+ if (!m_aAutoRefresh->isChecked()) {
+ m_requestForcedUpdate = true;
+ m_activeRender->sendFrameUpdate();
+ }
prodHUDThread();
prodScopeThread();
prodBackgroundThread();