From 44bbc89ace7f60ccd12ab79b787f9819890b0cad Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 11 May 2015 13:37:46 +0200 Subject: [PATCH] Show frequency for highlighted marker on second line of frequency scale --- sdrbase/gui/glspectrum.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sdrbase/gui/glspectrum.cpp b/sdrbase/gui/glspectrum.cpp index 44c7a9724..418fa72a9 100644 --- a/sdrbase/gui/glspectrum.cpp +++ b/sdrbase/gui/glspectrum.cpp @@ -842,7 +842,7 @@ void GLSpectrum::applyChanges() int waterfallHeight = 0; int waterfallTop = 0; - int frequencyScaleHeight = fm.height() * 2; + int frequencyScaleHeight = fm.height() * 3; // +1 line for marker frequency scale int frequencyScaleTop; int histogramTop = 0; int histogramHeight = 20; @@ -1123,6 +1123,19 @@ void GLSpectrum::applyChanges() } } + // Frequency overlay on highlighted marker + for(int i = 0; i < m_channelMarkerStates.size(); ++i) { + ChannelMarkerState* dv = m_channelMarkerStates[i]; + if (dv->m_channelMarker->getHighlighted()) + { + qreal xc; + //ChannelMarker::sidebands_t sidebands = dv->m_channelMarker->getSidebands(); + xc = m_centerFrequency + dv->m_channelMarker->getCenterFrequency(); // marker center frequency + QString ftext = QString::number((m_centerFrequency + dv->m_channelMarker->getCenterFrequency())/1e6, 'f', 6); + painter.drawText(QPointF(leftMargin + m_frequencyScale.getPosFromValue(xc), 2*fm.height() + fm.ascent() / 2 - 1), ftext); + } + } + } if(m_frequencyTextureAllocated) deleteTexture(m_frequencyTexture);