summaryrefslogtreecommitdiff
path: root/gr-qtgui/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/src/python')
-rwxr-xr-xgr-qtgui/src/python/pyqt_example.py2
-rwxr-xr-xgr-qtgui/src/python/pyqt_example_f.py2
-rwxr-xr-xgr-qtgui/src/python/qt_digital.py4
-rwxr-xr-xgr-qtgui/src/python/usrp_display.py270
-rw-r--r--gr-qtgui/src/python/usrp_display_qtgui.py164
-rw-r--r--gr-qtgui/src/python/usrp_display_qtgui.ui313
6 files changed, 651 insertions, 104 deletions
diff --git a/gr-qtgui/src/python/pyqt_example.py b/gr-qtgui/src/python/pyqt_example.py
index ac636295d..4fa8cdd92 100755
--- a/gr-qtgui/src/python/pyqt_example.py
+++ b/gr-qtgui/src/python/pyqt_example.py
@@ -114,7 +114,7 @@ class my_top_block(gr.top_block):
channel = gr.channel_model(0.001)
thr = gr.throttle(gr.sizeof_gr_complex, 100*fftsize)
self.snk1 = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- -Rs/2, Rs/2,
+ 0, Rs,
"Complex Signal Example",
True, True, False, True, False)
diff --git a/gr-qtgui/src/python/pyqt_example_f.py b/gr-qtgui/src/python/pyqt_example_f.py
index bf10c5c0e..46fe07e0d 100755
--- a/gr-qtgui/src/python/pyqt_example_f.py
+++ b/gr-qtgui/src/python/pyqt_example_f.py
@@ -113,7 +113,7 @@ class my_top_block(gr.top_block):
src = gr.add_ff()
thr = gr.throttle(gr.sizeof_float, 100*fftsize)
self.snk1 = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- -Rs/2, Rs/2,
+ 0, Rs,
"Float Signal Example",
True, True, False, True, False)
diff --git a/gr-qtgui/src/python/qt_digital.py b/gr-qtgui/src/python/qt_digital.py
index a9a0bd74a..ceb492c8d 100755
--- a/gr-qtgui/src/python/qt_digital.py
+++ b/gr-qtgui/src/python/qt_digital.py
@@ -183,10 +183,10 @@ class my_top_block(gr.top_block):
self.channel = gr.channel_model(noise, self.fo, self.to)
self.thr = gr.throttle(gr.sizeof_char, 10*fftsize)
- self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -1/2, 1/2,
+ self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 0, 1,
"Tx", True, True, False, True, True)
- self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -1/2, 1/2,
+ self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 0, 1,
"Rx", True, True, False, True, True)
self.connect(self.src, self.thr, self.mod, self.channel, self.snk_tx)
diff --git a/gr-qtgui/src/python/usrp_display.py b/gr-qtgui/src/python/usrp_display.py
index d5d2bc67d..ccb386341 100755
--- a/gr-qtgui/src/python/usrp_display.py
+++ b/gr-qtgui/src/python/usrp_display.py
@@ -6,114 +6,139 @@ from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from gnuradio.qtgui import qtgui
from optparse import OptionParser
-from PyQt4 import QtGui, QtCore
-import sys, sip
+import sys
-class dialog_box(QtGui.QWidget):
- def __init__(self, display, control):
- QtGui.QWidget.__init__(self, None)
- self.setWindowTitle('USRP FFT')
+try:
+ from gnuradio.qtgui import qtgui
+ from PyQt4 import QtGui, QtCore
+ import sip
+except ImportError:
+ print "Please install gr-qtgui."
+ sys.exit(1)
- self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, self)
- self.boxlayout.addWidget(display, 1)
- self.boxlayout.addWidget(control)
+try:
+ from usrp_display_qtgui import Ui_MainWindow
+except ImportError:
+ print "Error: could not find usrp_display_qtgui.py:"
+ print "\t\"pyuic4 usrp_display_qtgui.ui -o usrp_display_qtgui.py\""
+ sys.exit(1)
- self.resize(800, 500)
-class control_panel(QtGui.QWidget):
- def __init__(self, usrp, subdev, qtsink, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.setWindowTitle('USRP Control Panel')
-
- self.usrp = usrp
- self.subdev = subdev
- self.qtsink = qtsink
- self.adc_rate = self.usrp.converter_rate()
-
- self.freq = 0
- self.decim = 0
- self.bw = 0
- self.gain = 0
-
- self.setToolTip('Set the values of the USRP')
- QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10))
-
- self.layout = QtGui.QFormLayout(self)
- # Received frequency
- self.freqEdit = QtGui.QLineEdit(self)
- self.layout.addRow("Frequency:", self.freqEdit)
- self.connect(self.freqEdit, QtCore.SIGNAL("editingFinished()"),
- self.freqEditText)
+# ////////////////////////////////////////////////////////////////////
+# Define the QT Interface and Control Dialog
+# ////////////////////////////////////////////////////////////////////
- # Receiver gain
- self.gainEdit = QtGui.QLineEdit(self)
- self.layout.addRow("Gain:", self.gainEdit)
- self.connect(self.gainEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainEditText)
+class main_window(QtGui.QMainWindow):
+ def __init__(self, snk, fg, parent=None):
- # Decim / Bandwidth
- self.decimEdit = QtGui.QLineEdit(self)
- self.layout.addRow("Decim Rate:", self.decimEdit)
- self.connect(self.decimEdit, QtCore.SIGNAL("editingFinished()"),
- self.decimEditText)
+ QtGui.QWidget.__init__(self, parent)
+ self.gui = Ui_MainWindow()
+ self.gui.setupUi(self)
- self.quit = QtGui.QPushButton('Close', self)
- self.layout.addRow(self.quit)
+ self.fg = fg
- self.connect(self.quit, QtCore.SIGNAL('clicked()'),
- QtGui.qApp, QtCore.SLOT('quit()'))
+ # Add the qtsnk widgets to the layout box
+ self.gui.sinkLayout.addWidget(snk)
+ # Connect up some signals
+ self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
+ self.pauseFg)
+ self.connect(self.gui.frequencyEdit, QtCore.SIGNAL("editingFinished()"),
+ self.frequencyEditText)
+ self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
+ self.gainEditText)
+ self.connect(self.gui.bandwidthEdit, QtCore.SIGNAL("editingFinished()"),
+ self.bandwidthEditText)
+ self.connect(self.gui.amplifierEdit, QtCore.SIGNAL("editingFinished()"),
+ self.amplifierEditText)
+
+ self.connect(self.gui.actionSaveData, QtCore.SIGNAL("activated()"),
+ self.saveData)
+ self.gui.actionSaveData.setShortcut(QtGui.QKeySequence.Save)
+
+ def pauseFg(self):
+ if(self.gui.pauseButton.text() == "Pause"):
+ self.fg.stop()
+ self.fg.wait()
+ self.gui.pauseButton.setText("Unpause")
+ else:
+ self.fg.start()
+ self.gui.pauseButton.setText("Pause")
+
+
+ # Functions to set the values in the GUI
def set_frequency(self, freq):
self.freq = freq
sfreq = eng_notation.num_to_str(self.freq)
- self.freqEdit.setText(QtCore.QString("%1").arg(sfreq))
+ self.gui.frequencyEdit.setText(QtCore.QString("%1").arg(sfreq))
def set_gain(self, gain):
self.gain = gain
- self.gainEdit.setText(QtCore.QString("%1").arg(self.gain))
+ self.gui.gainEdit.setText(QtCore.QString("%1").arg(self.gain))
+
+ def set_bandwidth(self, bw):
+ self.bw = bw
+ sbw = eng_notation.num_to_str(self.bw)
+ self.gui.bandwidthEdit.setText(QtCore.QString("%1").arg(sbw))
+
+ def set_amplifier(self, bw):
+ self.amp = amp
+ self.gui.amplifierEdit.setText(QtCore.QString("%1").arg(self.amp))
- def set_decim(self, decim):
- self.decim = decim
- self.bw = self.adc_rate / float(self.decim) / 1000.0
- self.decimEdit.setText(QtCore.QString("%1").arg(self.decim))
- def freqEditText(self):
+ # Functions called when signals are triggered in the GUI
+ def frequencyEditText(self):
try:
- freq = eng_notation.str_to_num(self.freqEdit.text().toAscii())
- self.usrp.tune(0, self.subdev, freq)
+ freq = eng_notation.str_to_num(self.gui.frequencyEdit.text().toAscii())
+ self.fg.set_frequency(freq)
self.freq = freq
- self.qtsink.set_frequency_range(self.freq, self.freq-self.bw/2.0, self.freq+self.bw/2.0)
except RuntimeError:
pass
- #self.set_frequency(self.freq)
-
def gainEditText(self):
try:
- gain = float(self.gainEdit.text())
- self.subdev.set_gain(gain)
+ gain = float(self.gui.gainEdit.text())
+ self.fg.set_gain(gain)
self.gain = gain
except ValueError:
pass
+
+ def bandwidthEditText(self):
+ try:
+ bw = eng_notation.str_to_num(self.gui.bandwidthEdit.text().toAscii())
+ self.fg.set_bandwidth(bw)
+ self.bw = bw
+ except ValueError:
+ pass
- #self.set_gain(gain)
-
- def decimEditText(self):
+ def amplifierEditText(self):
try:
- decim = int(self.decimEdit.text())
- self.usrp.set_decim_rate(decim)
-
- self.decim = decim
- self.bw = self.adc_rate / self.decim
- self.qtsink.set_frequency_range(-self.bw/2.0, self.bw/2.0, self.freq)
-
+ amp = float(self.gui.amplifierEdit.text())
+ self.fg.set_amplifier_gain(amp)
+ self.amp = amp
except ValueError:
pass
- #self.set_decim(decim)
+ def saveData(self):
+ fileName = QtGui.QFileDialog.getSaveFileName(self, "Save data to file", ".");
+ if(len(fileName)):
+ self.fg.save_to_file(str(fileName))
+
+def pick_subdevice(u):
+ """
+ The user didn't specify a subdevice on the command line.
+ If there's a daughterboard on A, select A.
+ If there's a daughterboard on B, select B.
+ Otherwise, select A.
+ """
+ if u.db(0, 0).dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
+ return (0, 0)
+ if u.db(0, 0).dbid() >= 0:
+ return (1, 0)
+ return (0, 0)
class my_top_block(gr.top_block):
def __init__(self):
@@ -127,14 +152,12 @@ class my_top_block(gr.top_block):
help="select USRP Rx side A or B (default=first one with a daughterboard)")
parser.add_option("-A", "--antenna", default=None,
help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
+ parser.add_option("-W", "--bw", type="float", default=1e6,
+ help="set bandwidth of receiver [default=%default]")
parser.add_option("-f", "--freq", type="eng_float", default=None,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=None,
help="set gain in dB [default is midpoint]")
- parser.add_option("-W", "--waterfall", action="store_true", default=False,
- help="Enable waterfall display")
parser.add_option("-8", "--width-8", action="store_true", default=False,
help="Enable 8-bit samples across USB")
parser.add_option( "--no-hb", action="store_true", default=False,
@@ -158,49 +181,96 @@ class my_top_block(gr.top_block):
# Call this before creating the Qt sink
self.qapp = QtGui.QApplication(sys.argv)
- self.u = usrp.source_c(which=options.which, decim_rate=options.decim)
- rx_subdev_spec = (0,0)
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, rx_subdev_spec)
+ self._fftsize = 2048
+
+ self.u = usrp.source_c(which=options.which)
+ self._adc_rate = self.u.converter_rate()
+ self.set_bandwidth(options.bw)
+ if options.rx_subdev_spec is None:
+ options.rx_subdev_spec = pick_subdevice(self.u)
+ self._rx_subdev_spec = options.rx_subdev_spec
+ self.u.set_mux(usrp.determine_rx_mux_value(self.u, self._rx_subdev_spec))
+ self.subdev = usrp.selected_subdev(self.u, self._rx_subdev_spec)
+
+ self._gain_range = self.subdev.gain_range()
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
+ g = self._gain_range
options.gain = float(g[0]+g[1])/2
- self.subdev.set_gain(options.gain)
+ self.set_gain(options.gain)
if options.freq is None:
# if no frequency was specified, use the mid-point of the subdev
f = self.subdev.freq_range()
options.freq = float(f[0]+f[1])/2
- self.u.tune(0, self.subdev, options.freq)
+ self.set_frequency(options.freq)
- fftsize = 2048
- input_rate = self.u.converter_rate() / self.u.decim_rate()
- self.snk = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- -input_rate/2, input_rate/2,
+ self.snk = qtgui.sink_c(self._fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
+ self._freq, self._bandwidth,
"USRP Display",
True, True, False, True, False)
- amp = gr.multiply_const_cc(0.001)
- self.connect(self.u, amp, self.snk)
+ # Set up internal amplifier
+ self.amp = gr.multiply_const_cc(0.0)
+ self.set_amplifier_gain(0.001)
- self.ctrl_win = control_panel(self.u, self.subdev, self.snk)
+ # Connect the flow graph
+ self.connect(self.u, self.amp, self.snk)
- self.ctrl_win.set_frequency(options.freq)
- self.ctrl_win.set_gain(options.gain)
- self.ctrl_win.set_decim(options.decim)
# Get the reference pointer to the SpectrumDisplayForm QWidget
- pyQt = self.snk.pyqwidget()
-
# Wrap the pointer as a PyQt SIP object
- # This can now be manipulated as a PyQt4.QtGui.QWidget
- pyWin = sip.wrapinstance(pyQt, QtGui.QWidget)
+ # This can now be manipulated as a PyQt4.QtGui.QWidget
+ self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
+
+ self.main_win = main_window(self.pysink, self)
+
+ self.main_win.set_frequency(self._freq)
+ self.main_win.set_gain(self._gain)
+ self.main_win.set_bandwidth(self._bandwidth)
+
+ self.main_win.show()
+
+ def save_to_file(self, name):
+ # Pause the flow graph
+ self.stop()
+ self.wait()
+
+ # Add file sink to save data
+ self.file_sink = gr.file_sink(gr.sizeof_gr_complex, name)
+ self.connect(self.amp, self.file_sink)
+
+ # Restart flow graph
+ self.start()
+
+ def set_gain(self, gain):
+ self._gain = gain
+ self.subdev.set_gain(self._gain)
+
+ def set_frequency(self, freq):
+ self._freq = freq
+ self.u.tune(0, self.subdev, self._freq)
+
+ try:
+ self.snk.set_frequency_range(self._freq, self._bandwidth)
+ except:
+ pass
+
+ def set_bandwidth(self, bw):
+ self._bandwidth = bw
+ self._decim = int(self._adc_rate / self._bandwidth)
+ self.u.set_decim_rate(self._decim)
+
+ try:
+ self.snk.set_frequency_range(self._freq, self._bandwidth)
+ except:
+ pass
- self.main_box = dialog_box(pyWin, self.ctrl_win)
+ def set_amplifier_gain(self, amp):
+ self._amp_value = amp
+ self.amp.set_k(self._amp_value)
- self.main_box.show()
if __name__ == "__main__":
tb = my_top_block();
diff --git a/gr-qtgui/src/python/usrp_display_qtgui.py b/gr-qtgui/src/python/usrp_display_qtgui.py
new file mode 100644
index 000000000..326a823b0
--- /dev/null
+++ b/gr-qtgui/src/python/usrp_display_qtgui.py
@@ -0,0 +1,164 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'usrp_display_qtgui.ui'
+#
+# Created: Sun Jul 5 13:05:46 2009
+# by: PyQt4 UI code generator 4.4.3
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_MainWindow(object):
+ def setupUi(self, MainWindow):
+ MainWindow.setObjectName("MainWindow")
+ MainWindow.resize(820, 774)
+ self.centralwidget = QtGui.QWidget(MainWindow)
+ self.centralwidget.setObjectName("centralwidget")
+ self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget)
+ self.gridLayout_2.setObjectName("gridLayout_2")
+ self.horizontalLayout_2 = QtGui.QHBoxLayout()
+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.groupBox = QtGui.QGroupBox(self.centralwidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
+ self.groupBox.setSizePolicy(sizePolicy)
+ self.groupBox.setMinimumSize(QtCore.QSize(240, 150))
+ self.groupBox.setMaximumSize(QtCore.QSize(240, 16777215))
+ self.groupBox.setObjectName("groupBox")
+ self.formLayoutWidget = QtGui.QWidget(self.groupBox)
+ self.formLayoutWidget.setGeometry(QtCore.QRect(10, 20, 221, 124))
+ self.formLayoutWidget.setObjectName("formLayoutWidget")
+ self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
+ self.formLayout.setObjectName("formLayout")
+ self.frequencyLabel = QtGui.QLabel(self.formLayoutWidget)
+ self.frequencyLabel.setObjectName("frequencyLabel")
+ self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.frequencyLabel)
+ self.gainLabel = QtGui.QLabel(self.formLayoutWidget)
+ self.gainLabel.setObjectName("gainLabel")
+ self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.gainLabel)
+ self.bandwidthLabel = QtGui.QLabel(self.formLayoutWidget)
+ self.bandwidthLabel.setObjectName("bandwidthLabel")
+ self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.bandwidthLabel)
+ self.frequencyEdit = QtGui.QLineEdit(self.formLayoutWidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.frequencyEdit.sizePolicy().hasHeightForWidth())
+ self.frequencyEdit.setSizePolicy(sizePolicy)
+ self.frequencyEdit.setMinimumSize(QtCore.QSize(120, 26))
+ self.frequencyEdit.setObjectName("frequencyEdit")
+ self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.frequencyEdit)
+ self.gainEdit = QtGui.QLineEdit(self.formLayoutWidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.gainEdit.sizePolicy().hasHeightForWidth())
+ self.gainEdit.setSizePolicy(sizePolicy)
+ self.gainEdit.setMinimumSize(QtCore.QSize(120, 26))
+ self.gainEdit.setObjectName("gainEdit")
+ self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.gainEdit)
+ self.bandwidthEdit = QtGui.QLineEdit(self.formLayoutWidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.bandwidthEdit.sizePolicy().hasHeightForWidth())
+ self.bandwidthEdit.setSizePolicy(sizePolicy)
+ self.bandwidthEdit.setMinimumSize(QtCore.QSize(120, 26))
+ self.bandwidthEdit.setObjectName("bandwidthEdit")
+ self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.bandwidthEdit)
+ self.amplifierLabel = QtGui.QLabel(self.formLayoutWidget)
+ self.amplifierLabel.setObjectName("amplifierLabel")
+ self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.amplifierLabel)
+ self.amplifierEdit = QtGui.QLineEdit(self.formLayoutWidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.amplifierEdit.sizePolicy().hasHeightForWidth())
+ self.amplifierEdit.setSizePolicy(sizePolicy)
+ self.amplifierEdit.setMinimumSize(QtCore.QSize(120, 26))
+ self.amplifierEdit.setObjectName("amplifierEdit")
+ self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.amplifierEdit)
+ self.horizontalLayout_2.addWidget(self.groupBox)
+ spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ self.horizontalLayout_2.addItem(spacerItem)
+ self.verticalLayout = QtGui.QVBoxLayout()
+ self.verticalLayout.setObjectName("verticalLayout")
+ spacerItem1 = QtGui.QSpacerItem(20, 80, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
+ self.verticalLayout.addItem(spacerItem1)
+ self.pauseButton = QtGui.QPushButton(self.centralwidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.pauseButton.sizePolicy().hasHeightForWidth())
+ self.pauseButton.setSizePolicy(sizePolicy)
+ self.pauseButton.setObjectName("pauseButton")
+ self.verticalLayout.addWidget(self.pauseButton)
+ self.closeButton = QtGui.QPushButton(self.centralwidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.closeButton.sizePolicy().hasHeightForWidth())
+ self.closeButton.setSizePolicy(sizePolicy)
+ self.closeButton.setMinimumSize(QtCore.QSize(75, 0))
+ self.closeButton.setObjectName("closeButton")
+ self.verticalLayout.addWidget(self.closeButton)
+ self.horizontalLayout_2.addLayout(self.verticalLayout)
+ self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 1)
+ self.verticalLayout_2 = QtGui.QVBoxLayout()
+ self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.frame = QtGui.QFrame(self.centralwidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(1)
+ sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
+ self.frame.setSizePolicy(sizePolicy)
+ self.frame.setMinimumSize(QtCore.QSize(800, 550))
+ self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
+ self.frame.setFrameShadow(QtGui.QFrame.Raised)
+ self.frame.setObjectName("frame")
+ self.gridLayout = QtGui.QGridLayout(self.frame)
+ self.gridLayout.setObjectName("gridLayout")
+ self.sinkLayout = QtGui.QHBoxLayout()
+ self.sinkLayout.setObjectName("sinkLayout")
+ self.gridLayout.addLayout(self.sinkLayout, 0, 0, 1, 1)
+ self.verticalLayout_2.addWidget(self.frame)
+ self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
+ MainWindow.setCentralWidget(self.centralwidget)
+ self.menubar = QtGui.QMenuBar(MainWindow)
+ self.menubar.setGeometry(QtCore.QRect(0, 0, 820, 24))
+ self.menubar.setObjectName("menubar")
+ self.menuFile = QtGui.QMenu(self.menubar)
+ self.menuFile.setObjectName("menuFile")
+ MainWindow.setMenuBar(self.menubar)
+ self.statusbar = QtGui.QStatusBar(MainWindow)
+ self.statusbar.setObjectName("statusbar")
+ MainWindow.setStatusBar(self.statusbar)
+ self.actionExit = QtGui.QAction(MainWindow)
+ self.actionExit.setObjectName("actionExit")
+ self.actionSaveData = QtGui.QAction(MainWindow)
+ self.actionSaveData.setObjectName("actionSaveData")
+ self.menuFile.addAction(self.actionSaveData)
+ self.menuFile.addAction(self.actionExit)
+ self.menubar.addAction(self.menuFile.menuAction())
+
+ self.retranslateUi(MainWindow)
+ QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), MainWindow.close)
+ QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), MainWindow.close)
+ QtCore.QMetaObject.connectSlotsByName(MainWindow)
+
+ def retranslateUi(self, MainWindow):
+ MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "USRP Display", None, QtGui.QApplication.UnicodeUTF8))
+ self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
+ self.frequencyLabel.setText(QtGui.QApplication.translate("MainWindow", "Frequency (Hz)", None, QtGui.QApplication.UnicodeUTF8))
+ self.gainLabel.setText(QtGui.QApplication.translate("MainWindow", "RF Gain", None, QtGui.QApplication.UnicodeUTF8))
+ self.bandwidthLabel.setText(QtGui.QApplication.translate("MainWindow", "Bandwidth", None, QtGui.QApplication.UnicodeUTF8))
+ self.amplifierLabel.setText(QtGui.QApplication.translate("MainWindow", "Amplifier", None, QtGui.QApplication.UnicodeUTF8))
+ self.pauseButton.setText(QtGui.QApplication.translate("MainWindow", "Pause", None, QtGui.QApplication.UnicodeUTF8))
+ self.closeButton.setText(QtGui.QApplication.translate("MainWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
+ self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8))
+ self.actionSaveData.setText(QtGui.QApplication.translate("MainWindow", "&Save Data", None, QtGui.QApplication.UnicodeUTF8))
+
diff --git a/gr-qtgui/src/python/usrp_display_qtgui.ui b/gr-qtgui/src/python/usrp_display_qtgui.ui
new file mode 100644
index 000000000..d490e0530
--- /dev/null
+++ b/gr-qtgui/src/python/usrp_display_qtgui.ui
@@ -0,0 +1,313 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>820</width>
+ <height>774</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>USRP Display</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>240</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>240</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Receiver Parameters</string>
+ </property>
+ <widget class="QWidget" name="formLayoutWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>221</width>
+ <height>124</height>
+ </rect>
+ </property>
+ <layout class="QFormLayout" name="formLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="frequencyLabel" >
+ <property name="text" >
+ <string>Frequency (Hz)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="gainLabel" >
+ <property name="text" >
+ <string>RF Gain</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="bandwidthLabel" >
+ <property name="text" >
+ <string>Bandwidth</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLineEdit" name="frequencyEdit" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>26</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="gainEdit" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>26</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="bandwidthEdit" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>26</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="amplifierLabel" >
+ <property name="text" >
+ <string>Amplifier</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="amplifierEdit" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>120</width>
+ <height>26</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pauseButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Pause</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="closeButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>75</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>Close</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QFrame" name="frame" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>800</width>
+ <height>550</height>
+ </size>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" name="sinkLayout" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>820</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuFile" >
+ <property name="title" >
+ <string>&amp;File</string>
+ </property>
+ <addaction name="actionSaveData" />
+ <addaction name="actionExit" />
+ </widget>
+ <addaction name="menuFile" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ <action name="actionExit" >
+ <property name="text" >
+ <string>E&amp;xit</string>
+ </property>
+ </action>
+ <action name="actionSaveData" >
+ <property name="text" >
+ <string>&amp;Save Data</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>closeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>808</x>
+ <y>739</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>66</x>
+ <y>561</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionExit</sender>
+ <signal>triggered()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>617</x>
+ <y>327</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>