summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau2009-08-25 18:22:06 -0400
committerTom Rondeau2009-08-25 18:22:06 -0400
commit785cacd477d50aba8a412bae16c57681c52a7fd2 (patch)
tree20bb87cf2fae4c4f228af11cc2175cca907c1005
parentab88e3c4fcf96093637eaadeae360df0d04282fa (diff)
downloadgnuradio-785cacd477d50aba8a412bae16c57681c52a7fd2.tar.gz
gnuradio-785cacd477d50aba8a412bae16c57681c52a7fd2.tar.bz2
gnuradio-785cacd477d50aba8a412bae16c57681c52a7fd2.zip
Added colorbar to spectrogram for magnitude measurement.
-rwxr-xr-xgr-utils/src/python/gr_plot_qt.py18
-rw-r--r--gr-utils/src/python/pyqt_plot.py4
-rw-r--r--gr-utils/src/python/pyqt_plot.ui8
3 files changed, 19 insertions, 11 deletions
diff --git a/gr-utils/src/python/gr_plot_qt.py b/gr-utils/src/python/gr_plot_qt.py
index 5579bbce2..a5e3463c8 100755
--- a/gr-utils/src/python/gr_plot_qt.py
+++ b/gr-utils/src/python/gr_plot_qt.py
@@ -195,10 +195,16 @@ class gr_plot_qt(QtGui.QMainWindow):
self.spec = Qwt.QwtPlotSpectrogram()
self.spec.setColorMap(colorMap)
self.spec.attach(self.gui.specPlot)
- self.spec.setContourLevels([0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5])
self.spec.setDisplayMode(Qwt.QwtPlotSpectrogram.ImageMode, True)
self.spec.setData(self.specdata)
+ self.rightAxis = self.gui.specPlot.axisWidget(Qwt.QwtPlot.yRight)
+ self.rightAxis.setTitle("Magnitude (dBm)")
+ self.rightAxis.setColorBarEnabled(True)
+ self.rightAxis.setColorMap(self.spec.data().range(),
+ self.spec.colorMap())
+ self.gui.specPlot.enableAxis(Qwt.QwtPlot.yRight)
+
# Set up initial color scheme
self.color_modes["Blue on Black"]()
@@ -488,13 +494,21 @@ class gr_plot_qt(QtGui.QMainWindow):
# since this is taken care of in the SpectrogramData class
self.specdata.set_data(self.spec_f, self.spec_t, self.iq_spec)
+ # Set the color map based on the new data
+ self.rightAxis.setColorMap(self.spec.data().range(),
+ self.spec.colorMap())
+
+ # Set the new axis base; include right axis for the intenisty color bar
self.gui.specPlot.setAxisScale(self.gui.specPlot.xBottom,
min(self.spec_f),
max(self.spec_f))
self.gui.specPlot.setAxisScale(self.gui.specPlot.yLeft,
min(self.spec_t),
max(self.spec_t))
-
+ self.gui.specPlot.setAxisScale(self.gui.specPlot.yRight,
+ self.iq_spec.min(),
+ self.iq_spec.max())
+
# Set the zoomer base to unzoom to the new axis
self.specZoomer.setZoomBase()
diff --git a/gr-utils/src/python/pyqt_plot.py b/gr-utils/src/python/pyqt_plot.py
index 2724d8546..74c43c3eb 100644
--- a/gr-utils/src/python/pyqt_plot.py
+++ b/gr-utils/src/python/pyqt_plot.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'pyqt_plot.ui'
#
-# Created: Tue Aug 25 15:28:55 2009
+# Created: Tue Aug 25 18:18:14 2009
# by: PyQt4 UI code generator 4.4.3
#
# WARNING! All changes made in this file will be lost!
@@ -175,7 +175,7 @@ class Ui_MainWindow(object):
self.menubar.addAction(self.menu_File.menuAction())
self.retranslateUi(MainWindow)
- self.tabGroup.setCurrentIndex(2)
+ self.tabGroup.setCurrentIndex(0)
QtCore.QObject.connect(self.action_exit, QtCore.SIGNAL("activated()"), MainWindow.close)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
diff --git a/gr-utils/src/python/pyqt_plot.ui b/gr-utils/src/python/pyqt_plot.ui
index 62125962b..19a62adf5 100644
--- a/gr-utils/src/python/pyqt_plot.ui
+++ b/gr-utils/src/python/pyqt_plot.ui
@@ -24,7 +24,7 @@
<item row="1" column="0" >
<widget class="QTabWidget" name="tabGroup" >
<property name="currentIndex" >
- <number>2</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="timeTab" >
<attribute name="title" >
@@ -80,9 +80,6 @@
</widget>
</item>
</layout>
- <zorder>formLayoutWidget</zorder>
- <zorder>psdFFTComboBox</zorder>
- <zorder>psdFFTSizeLabel</zorder>
</widget>
</item>
<item>
@@ -125,9 +122,6 @@
</widget>
</item>
</layout>
- <zorder>specFFTLabel</zorder>
- <zorder>specFFTComboBox</zorder>
- <zorder>specFFTComboBox</zorder>
</widget>
</item>
<item>