const QPen AbstractScopeWidget::penThick(QBrush(QColor(250, 250, 250)), 2, Qt::SolidLine);
const QPen AbstractScopeWidget::penThin(QBrush(QColor(250, 250, 250)), 1, Qt::SolidLine);
const QPen AbstractScopeWidget::penLight(QBrush(QColor(200, 200, 250, 150)), 1, Qt::SolidLine);
+const QPen AbstractScopeWidget::penLightDots(QBrush(QColor(200, 200, 250, 150)), 1, Qt::DotLine);
const QPen AbstractScopeWidget::penDark(QBrush(QColor(0, 0, 20, 250)), 1, Qt::SolidLine);
+const QPen AbstractScopeWidget::penDarkDots(QBrush(QColor(0, 0, 20, 250)), 1, Qt::DotLine);
-AbstractScopeWidget::AbstractScopeWidget(Monitor *projMonitor, Monitor *clipMonitor, bool trackMouse, QWidget *parent) :
+AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) :
QWidget(parent),
- m_projMonitor(projMonitor),
- m_clipMonitor(clipMonitor),
m_mousePos(0, 0),
m_mouseWithinWidget(false),
offset(5),
this->setContextMenuPolicy(Qt::CustomContextMenu);
- m_activeRender = (m_clipMonitor->isActive()) ? m_clipMonitor->render : m_projMonitor->render;
-
bool b = true;
b &= connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
- //b &= connect(m_activeRender, SIGNAL(rendererPosition(int)), this, SLOT(slotRenderZoneUpdated()));
- b &= connect(m_activeRender, SIGNAL(frameUpdated(QImage)), this, SLOT(slotRenderZoneUpdated(QImage)));
-
b &= connect(this, SIGNAL(signalHUDRenderingFinished(uint, uint)), this, SLOT(slotHUDRenderingFinished(uint, uint)));
b &= connect(this, SIGNAL(signalScopeRenderingFinished(uint, uint)), this, SLOT(slotScopeRenderingFinished(uint, uint)));
b &= connect(this, SIGNAL(signalBackgroundRenderingFinished(uint, uint)), this, SLOT(slotBackgroundRenderingFinished(uint, uint)));
// 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_threadScope = QtConcurrent::run(this, &AbstractScopeWidget::renderScope, m_accelFactorScope);
m_requestForcedUpdate = false;
// qDebug() << "Scope thread started in " << m_widgetName;
if (!doUpdate) {
return;
}
+ m_requestForcedUpdate = true;
m_newHUDUpdates.fetchAndAddRelaxed(1);
m_newScopeUpdates.fetchAndAddRelaxed(1);
m_newBackgroundUpdates.fetchAndAddRelaxed(1);
void AbstractScopeWidget::forceUpdateScope()
{
m_newScopeUpdates.fetchAndAddRelaxed(1);
- m_requestForcedUpdate = true;
+ m_requestForcedUpdate = true;
prodScopeThread();
}
{
if (!m_aAutoRefresh->isChecked()) {
m_requestForcedUpdate = true;
- m_activeRender->sendFrameUpdate();
}
prodHUDThread();
prodScopeThread();
{
// Update the dimension of the available rect for painting
m_scopeRect = scopeRect();
-
forceUpdate();
QWidget::resizeEvent(event);
}
}
-void AbstractScopeWidget::slotActiveMonitorChanged(bool isClipMonitor)
-{
-// qDebug() << "Active monitor has changed in " << m_widgetName << ". Is the clip monitor active now? " << isClipMonitor;
-
- bool b = m_activeRender->disconnect(this);
- Q_ASSERT(b);
-
- m_activeRender = (isClipMonitor) ? m_clipMonitor->render : m_projMonitor->render;
-
- //b &= connect(m_activeRender, SIGNAL(rendererPosition(int)), this, SLOT(slotRenderZoneUpdated()));
- b &= connect(m_activeRender, SIGNAL(frameUpdated(QImage)), this, SLOT(slotRenderZoneUpdated(QImage)));
- Q_ASSERT(b);
-
- // Update the scope for the new monitor.
- prodHUDThread();
- prodScopeThread();
- prodBackgroundThread();
-}
-
void AbstractScopeWidget::slotRenderZoneUpdated()
{
m_newHUDFrames.fetchAndAddRelaxed(1);
void AbstractScopeWidget::slotAutoRefreshToggled(bool autoRefresh)
{
- if (isVisible()) emit requestAutoRefresh(autoRefresh);
+ if (isVisible()) {
+ emit requestAutoRefresh(autoRefresh);
+ }
// TODO only if depends on input
if (autoRefresh) {
- forceUpdate();
+ //forceUpdate();
+ m_requestForcedUpdate = true;
}
}