summaryrefslogtreecommitdiff
path: root/gr-qtgui/src
diff options
context:
space:
mode:
authorTom Rondeau2010-05-01 17:20:49 -0400
committerTom Rondeau2010-05-01 17:20:49 -0400
commit66ff2fa5db423851f69e8eb1b3f4f8ccd434facd (patch)
tree33fc33c1ee6fd47576f252315cfa477282b28db8 /gr-qtgui/src
parent7389f7a46fbad90dc1ae2c8232f770b03c27a38f (diff)
downloadgnuradio-66ff2fa5db423851f69e8eb1b3f4f8ccd434facd.tar.gz
gnuradio-66ff2fa5db423851f69e8eb1b3f4f8ccd434facd.tar.bz2
gnuradio-66ff2fa5db423851f69e8eb1b3f4f8ccd434facd.zip
Fixes units of pen in frequency plot.
Diffstat (limited to 'gr-qtgui/src')
-rw-r--r--gr-qtgui/src/lib/FrequencyDisplayPlot.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gr-qtgui/src/lib/FrequencyDisplayPlot.cc b/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
index 7deff8543..641b2272b 100644
--- a/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
@@ -73,15 +73,22 @@ public:
updateDisplay();
}
+ void SetUnitType(const std::string &type)
+ {
+ _unitType = type;
+ }
+
protected:
virtual QwtText trackerText( const QwtDoublePoint& p ) const
{
- QString strunits = (GetFrequencyPrecision() == 0) ? "Hz" : "kHz";
QwtText t(QString("%1 %2, %3 dB").arg(p.x(), 0, 'f',
- GetFrequencyPrecision()).arg(strunits).arg(p.y(), 0, 'f', 2));
+ GetFrequencyPrecision()).arg(_unitType.c_str()).arg(p.y(), 0, 'f', 2));
return t;
}
+
+private:
+ std::string _unitType;
};
FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
@@ -267,6 +274,7 @@ FrequencyDisplayPlot::SetFrequencyRange(const double constStartFreq,
setAxisScaleDraw(QwtPlot::xBottom, new FreqDisplayScaleDraw(display_units));
setAxisTitle(QwtPlot::xBottom, QString("Frequency (%1)").arg(strunits.c_str()));
((FreqDisplayZoomer*)_zoomer)->SetFrequencyPrecision(display_units);
+ ((FreqDisplayZoomer*)_zoomer)->SetUnitType(strunits);
// Load up the new base zoom settings
_zoomer->setZoomBase();