diff options
Diffstat (limited to 'gr-qtgui')
70 files changed, 4569 insertions, 7701 deletions
diff --git a/gr-qtgui/apps/gr_constellation_plot b/gr-qtgui/apps/gr_constellation_plot index ff5db1a9a6..8ca7104a61 100755 --- a/gr-qtgui/apps/gr_constellation_plot +++ b/gr-qtgui/apps/gr_constellation_plot @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function + from gnuradio import gr from gnuradio import blocks from gnuradio.eng_arg import eng_float, intx @@ -31,13 +33,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) try: import scipy except ImportError: - print "Error: Scipy required (www.scipy.org)." + print("Error: Scipy required (www.scipy.org).") sys.exit(1) try: @@ -166,7 +168,7 @@ def main(): tb = my_top_block(filelist, args.start, nsamples, max_nsamples); main_box = plot_constellation_form(tb, 'GNU Radio Constellation Plot', 10000.0) - for n in xrange(tb._nsigs): + for n in range(tb._nsigs): main_box._style_edit[n].setCurrentIndex(0) main_box.show() diff --git a/gr-qtgui/apps/plot_base.py b/gr-qtgui/apps/plot_base.py index 7a039e2135..ce409000bd 100644 --- a/gr-qtgui/apps/plot_base.py +++ b/gr-qtgui/apps/plot_base.py @@ -20,6 +20,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + from gnuradio import gr, blocks import os, sys @@ -30,13 +34,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) try: import scipy except ImportError: - print "Error: Scipy required (www.scipy.org)." + print("Error: Scipy required (www.scipy.org).") sys.exit(1) try: @@ -64,8 +68,8 @@ def read_samples(filename, start, in_size, min_size, dtype, dtype_size): if(min_size > 0): if(len(data) < in_size): - print "Warning: read in {0} samples but asked for {1} samples.".format( - len(data), in_size) + print("Warning: read in {0} samples but asked for {1} samples.".format( + len(data), in_size)) else: # If we have to, append 0's to create min_size samples of data if(len(data) < min_size): @@ -108,8 +112,8 @@ def read_samples_c(filename, start, in_size, min_size=0): if(min_size > 0): if(len(data) < in_size): - print "Warning: read in {0} samples but asked for {1} samples.".format( - len(data), in_size) + print("Warning: read in {0} samples but asked for {1} samples.".format( + len(data), in_size)) else: # If we have to, append 0's to create min_size samples of data if(len(data) < min_size): @@ -119,9 +123,9 @@ def read_samples_c(filename, start, in_size, min_size=0): class source_ints_to_float(gr.hier_block2): def __init__(self, data): - gr.hier_block2.__init__(self, "ints_to_floats", - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float)) + gr.hier_block2.__init__(self, "ints_to_floats", + gr.io_signature(0, 0, 0), + gr.io_signature(1, 1, gr.sizeof_float)) self.src = blocks.vector_source_i(data) self.cvt = blocks.int_to_float() self.connect(self.src, self.cvt, self) @@ -131,9 +135,9 @@ class source_ints_to_float(gr.hier_block2): class source_shorts_to_float(gr.hier_block2): def __init__(self, data): - gr.hier_block2.__init__(self, "shorts_to_floats", - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float)) + gr.hier_block2.__init__(self, "shorts_to_floats", + gr.io_signature(0, 0, 0), + gr.io_signature(1, 1, gr.sizeof_float)) self.src = blocks.vector_source_s(data) self.cvt = blocks.short_to_float() self.connect(self.src, self.cvt, self) @@ -143,9 +147,9 @@ class source_shorts_to_float(gr.hier_block2): class source_chars_to_float(gr.hier_block2): def __init__(self, data): - gr.hier_block2.__init__(self, "chars_to_floats", - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float)) + gr.hier_block2.__init__(self, "chars_to_floats", + gr.io_signature(0, 0, 0), + gr.io_signature(1, 1, gr.sizeof_float)) self.src = blocks.vector_source_b(data) self.cvt = blocks.char_to_float() self.connect(self.src, self.cvt, self) diff --git a/gr-qtgui/apps/plot_constellation_form.py b/gr-qtgui/apps/plot_constellation_form.py index 01c6ed1865..81cb76e233 100644 --- a/gr-qtgui/apps/plot_constellation_form.py +++ b/gr-qtgui/apps/plot_constellation_form.py @@ -20,6 +20,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + import sys from gnuradio import filter @@ -27,7 +31,7 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4." + print("Error: Program requires PyQt4.") sys.exit(1) try: @@ -48,8 +52,8 @@ class plot_constellation_form(plot_form): # Set the bar to go from 0.001 to max self.ybar.setMinimum(1) self.ybar.setMaximum(self._pos_scale*self.top_block._y_max) - self.ybar.setSingleStep(self._pos_scale*(max(self.top_block._y_range/10, 0.010))) - self.ybar.setPageStep(self._pos_scale*(max(self.top_block._y_range/2, 0.010))) + self.ybar.setSingleStep(self._pos_scale*(max(self.top_block._y_range / 10, 0.010))) + self.ybar.setPageStep(self._pos_scale*(max(self.top_block._y_range / 2, 0.010))) self.auto_scale = QtGui.QCheckBox("Auto Scale", self) if(self.top_block._auto_scale): diff --git a/gr-qtgui/apps/plot_form.py b/gr-qtgui/apps/plot_form.py index 931565bd3e..af262b97c3 100644 --- a/gr-qtgui/apps/plot_form.py +++ b/gr-qtgui/apps/plot_form.py @@ -20,11 +20,15 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4." + print("Error: Program requires PyQt4.") sys.exit(1) import numpy @@ -129,8 +133,8 @@ class plot_form(QtGui.QWidget): self.ybar = QtGui.QSlider(QtCore.Qt.Vertical, self) self.ybar.setMinimum(self._pos_scale*_ymin) self.ybar.setMaximum(self._pos_scale*_ymax) - self.ybar.setSingleStep(self._pos_scale*(_yrng/10)) - self.ybar.setPageStep(self._pos_scale*(_yrng/2)) + self.ybar.setSingleStep(self._pos_scale*(_yrng / 10)) + self.ybar.setPageStep(self._pos_scale*(_yrng / 2)) self.ybar.setValue(self._pos_scale*_ymax) self.connect(self.ybar, QtCore.SIGNAL("valueChanged(int)"), self.update_yaxis_slider) @@ -171,7 +175,7 @@ class plot_form(QtGui.QWidget): self._style_edit = [] self._marker_edit = [] self._alpha_edit = [] - for n in xrange(self.top_block._nsigs): + for n in range(self.top_block._nsigs): self._line_pages.append(QtGui.QDialog()) self._line_forms.append(QtGui.QFormLayout(self._line_pages[-1])) @@ -341,7 +345,7 @@ class plot_form(QtGui.QWidget): def update_yaxis_slider(self, value): if(not self.top_block._auto_scale): - value = value/self._pos_scale + value = value / self._pos_scale self.top_block._y_value = value self._y_min = value - self.top_block._y_range self._y_max = value diff --git a/gr-qtgui/apps/plot_psd_base.py b/gr-qtgui/apps/plot_psd_base.py index c3c03ec977..896371affb 100644 --- a/gr-qtgui/apps/plot_psd_base.py +++ b/gr-qtgui/apps/plot_psd_base.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + from gnuradio import gr, blocks from gnuradio.eng_arg import eng_float, intx from argparse import ArgumentParser @@ -30,13 +33,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) try: import scipy except ImportError: - print "Error: Scipy required (www.scipy.org)." + print("Error: Scipy required (www.scipy.org).") sys.exit(1) try: @@ -76,8 +79,8 @@ class plot_base(gr.top_block): n = 0 self.srcs = list() - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for f in self._filelist: data,_min,_max = self.read_samples(f, self._start, self._nsamps, self._psd_size) @@ -127,8 +130,8 @@ class plot_base(gr.top_block): self._start = newstart - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for s,f in zip(self.srcs, self._filelist): data,_min,_max = self.read_samples(f, self._start, newnsamps, self._psd_size) if(_min < self._data_min): diff --git a/gr-qtgui/apps/plot_psd_form.py b/gr-qtgui/apps/plot_psd_form.py index 2d1fcd10bc..93166f4faf 100644 --- a/gr-qtgui/apps/plot_psd_form.py +++ b/gr-qtgui/apps/plot_psd_form.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + import sys from gnuradio import filter @@ -27,7 +30,7 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4." + print("Error: Program requires PyQt4.") sys.exit(1) try: diff --git a/gr-qtgui/apps/plot_spectrogram_base.py b/gr-qtgui/apps/plot_spectrogram_base.py index f568100719..3527f3fa7b 100644 --- a/gr-qtgui/apps/plot_spectrogram_base.py +++ b/gr-qtgui/apps/plot_spectrogram_base.py @@ -20,6 +20,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals + from gnuradio import gr, blocks from gnuradio.eng_arg import eng_float, intx from argparse import ArgumentParser @@ -30,13 +34,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) try: import scipy except ImportError: - print "Error: Scipy required (www.scipy.org)." + print("Error: Scipy required (www.scipy.org).") sys.exit(1) try: @@ -76,8 +80,8 @@ class plot_base(gr.top_block): n = 0 self.srcs = list() - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for f in self._filelist: data,_min,_max = self.read_samples(f, self._start, self._nsamps, self._psd_size) @@ -100,7 +104,7 @@ class plot_base(gr.top_block): self.connect(s, (self.gui_snk, i+1)) self.gui_snk.set_update_time(0); - self.gui_snk.set_time_per_fft(self._psd_size/self._samp_rate) + self.gui_snk.set_time_per_fft(self._psd_size / self._samp_rate) self.gui_snk.enable_menu(False) self.gui_snk.set_fft_average(self._avg) @@ -127,13 +131,13 @@ class plot_base(gr.top_block): self.stop() self.wait() self.gui_snk.clear_data() - self.gui_snk.set_time_per_fft(self._psd_size/self._samp_rate) + self.gui_snk.set_time_per_fft(self._psd_size / self._samp_rate) self._start = newstart self._nsamps = newnsamps - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for s,f in zip(self.srcs, self._filelist): data,_min,_max = self.read_samples(f, self._start, newnsamps, self._psd_size) if(_min < self._data_min): diff --git a/gr-qtgui/apps/plot_spectrogram_form.py b/gr-qtgui/apps/plot_spectrogram_form.py index 17cb0335bd..6d1b17de67 100644 --- a/gr-qtgui/apps/plot_spectrogram_form.py +++ b/gr-qtgui/apps/plot_spectrogram_form.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + import sys from gnuradio import filter @@ -27,7 +30,7 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4." + print("Error: Program requires PyQt4.") sys.exit(1) try: @@ -113,7 +116,7 @@ class plot_spectrogram_form(plot_form): self._style_edit = [] self._marker_edit = [] self._alpha_edit = [] - for n in xrange(self.top_block._nsigs): + for n in range(self.top_block._nsigs): self._line_pages.append(QtGui.QDialog()) self._line_forms.append(QtGui.QFormLayout(self._line_pages[-1])) diff --git a/gr-qtgui/apps/plot_time_base.py b/gr-qtgui/apps/plot_time_base.py index cfbe5dc6cb..7078e332cd 100644 --- a/gr-qtgui/apps/plot_time_base.py +++ b/gr-qtgui/apps/plot_time_base.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + from gnuradio import gr, blocks from gnuradio.eng_arg import eng_float, intx from argparse import ArgumentParser @@ -30,13 +33,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) try: import scipy except ImportError: - print "Error: Scipy required (www.scipy.org)." + print("Error: Scipy required (www.scipy.org).") sys.exit(1) try: @@ -75,8 +78,8 @@ class plot_base(gr.top_block): n = 0 self.srcs = list() - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for f in self._filelist: data,_min,_max = self.read_samples(f, self._start, self._nsamps) if(_min < self._data_min): @@ -131,8 +134,8 @@ class plot_base(gr.top_block): self._start = newstart - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for s,f in zip(self.srcs, self._filelist): data,_min,_max = self.read_samples(f, self._start, newnsamps) if(_min < self._data_min): diff --git a/gr-qtgui/apps/plot_time_form.py b/gr-qtgui/apps/plot_time_form.py index 0ab94e6cfe..0a16aa6241 100644 --- a/gr-qtgui/apps/plot_time_form.py +++ b/gr-qtgui/apps/plot_time_form.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + import sys from gnuradio import filter @@ -27,7 +30,7 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4." + print("Error: Program requires PyQt4.") sys.exit(1) try: @@ -70,7 +73,7 @@ class plot_time_form(plot_form): index = self._qwtmarkers['Circle']+1 else: index = self._qwtmarkers['None']+1 - for n in xrange(self.top_block._nsigs): + for n in range(self.top_block._nsigs): self._marker_edit[n].setCurrentIndex(index) def update_samp_rate(self): diff --git a/gr-qtgui/apps/plot_time_raster_base.py b/gr-qtgui/apps/plot_time_raster_base.py index e84b84c295..4eb6ec4613 100644 --- a/gr-qtgui/apps/plot_time_raster_base.py +++ b/gr-qtgui/apps/plot_time_raster_base.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + from gnuradio import gr, blocks from gnuradio.eng_arg import eng_float, intx from argparse import ArgumentParser @@ -30,13 +33,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) try: import scipy except ImportError: - print "Error: Scipy required (www.scipy.org)." + print("Error: Scipy required (www.scipy.org).") sys.exit(1) try: @@ -75,8 +78,8 @@ class plot_base(gr.top_block): n = 0 self.srcs = list() - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for f in self._filelist: data,_min,_max = self.read_samples(f, self._start, self._nsamps) if(_min < self._data_min): @@ -129,8 +132,8 @@ class plot_base(gr.top_block): self._start = newstart - self._data_min = sys.maxint - self._data_max = -sys.maxint - 1 + self._data_min = sys.maxsize + self._data_max = -sys.maxsize - 1 for s,f in zip(self.srcs, self._filelist): data,_min,_max = self.read_samples(f, self._start, newnsamps) if(_min < self._data_min): diff --git a/gr-qtgui/apps/plot_time_raster_form.py b/gr-qtgui/apps/plot_time_raster_form.py index 32fbba0765..fd27d9574d 100644 --- a/gr-qtgui/apps/plot_time_raster_form.py +++ b/gr-qtgui/apps/plot_time_raster_form.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals + import sys, math from gnuradio import filter @@ -27,7 +30,7 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4." + print("Error: Program requires PyQt4.") sys.exit(1) try: @@ -81,7 +84,7 @@ class plot_time_raster_form(plot_form): self._style_edit = [] self._marker_edit = [] self._alpha_edit = [] - for n in xrange(self.top_block._nsigs): + for n in range(self.top_block._nsigs): self._line_pages.append(QtGui.QDialog()) self._line_forms.append(QtGui.QFormLayout(self._line_pages[-1])) @@ -153,5 +156,3 @@ class plot_time_raster_form(plot_form): nsamps = int(math.ceil(self.top_block._ncols*(n+1))) self.top_block.reset(self._start, nsamps) - - diff --git a/gr-qtgui/apps/uhd_display.py b/gr-qtgui/apps/uhd_display.py index 0e0c8a177d..58494f3af3 100755..100644 --- a/gr-qtgui/apps/uhd_display.py +++ b/gr-qtgui/apps/uhd_display.py @@ -20,6 +20,9 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import division +from __future__ import unicode_literals from gnuradio import gr from gnuradio import filter from gnuradio import blocks @@ -34,14 +37,14 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + print("Error: Program requires PyQt4 and gr-qtgui.") sys.exit(1) 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\"" + print("Error: could not find usrp_display_qtgui.py:") + print("\t\"pyuic4 usrp_display_qtgui.ui -o usrp_display_qtgui.py\"") sys.exit(1) @@ -182,13 +185,13 @@ class my_top_block(gr.top_block): if options.gain is None: # if no gain was specified, use the mid-point in dB g = self.u.get_gain_range() - options.gain = float(g.start()+g.stop())/2 + options.gain = float(g.start()+g.stop()) / 2 self.set_gain(options.gain) if options.freq is None: # if no freq was specified, use the mid-point r = self.u.get_freq_range() - options.freq = float(r.start()+r.stop())/2 + options.freq = float(r.start()+r.stop()) / 2 self.set_frequency(options.freq) self._fftsize = options.fft_size @@ -212,9 +215,9 @@ class my_top_block(gr.top_block): self.connect(self.u, self.amp, self.snk) if self.show_debug_info: - print "Bandwidth: ", self.u.get_samp_rate() - print "Center Freq: ", self.u.get_center_freq() - print "Freq Range: ", self.u.get_freq_range() + print("Bandwidth: ", self.u.get_samp_rate()) + print("Center Freq: ", self.u.get_center_freq()) + print("Freq Range: ", self.u.get_freq_range()) # Get the reference pointer to the SpectrumDisplayForm QWidget # Wrap the pointer as a PyQt SIP object diff --git a/gr-qtgui/apps/usrp_display_qtgui.py b/gr-qtgui/apps/usrp_display_qtgui.py index 4c9de3a53c..68c5d6cfb7 100644 --- a/gr-qtgui/apps/usrp_display_qtgui.py +++ b/gr-qtgui/apps/usrp_display_qtgui.py @@ -7,6 +7,7 @@ # # WARNING! All changes made in this file will be lost! +from __future__ import unicode_literals from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): diff --git a/gr-qtgui/examples/pyqt_const_c.py b/gr-qtgui/examples/pyqt_const_c.py index 0bb6c20d59..e789e013bf 100755..100644 --- a/gr-qtgui/examples/pyqt_const_c.py +++ b/gr-qtgui/examples/pyqt_const_c.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -109,14 +111,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -124,14 +126,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_example_c.py b/gr-qtgui/examples/pyqt_example_c.py index 89ca7b2820..5854d968c0 100755..100644 --- a/gr-qtgui/examples/pyqt_example_c.py +++ b/gr-qtgui/examples/pyqt_example_c.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -110,14 +112,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -125,14 +127,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_example_f.py b/gr-qtgui/examples/pyqt_example_f.py index 77a7478aa2..e2f41b57cf 100755..100644 --- a/gr-qtgui/examples/pyqt_example_f.py +++ b/gr-qtgui/examples/pyqt_example_f.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -104,14 +106,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -119,14 +121,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_freq_c.py b/gr-qtgui/examples/pyqt_freq_c.py index 954a078df8..9140bbb882 100755..100644 --- a/gr-qtgui/examples/pyqt_freq_c.py +++ b/gr-qtgui/examples/pyqt_freq_c.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -110,14 +112,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -125,14 +127,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_freq_f.py b/gr-qtgui/examples/pyqt_freq_f.py index d7d389b736..06a6d95b0b 100755..100644 --- a/gr-qtgui/examples/pyqt_freq_f.py +++ b/gr-qtgui/examples/pyqt_freq_f.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -105,14 +107,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -120,14 +122,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_histogram_f.py b/gr-qtgui/examples/pyqt_histogram_f.py index 81f7b9d40b..cf2f59b9a3 100755..100644 --- a/gr-qtgui/examples/pyqt_histogram_f.py +++ b/gr-qtgui/examples/pyqt_histogram_f.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr from gnuradio import blocks import sys @@ -118,21 +120,21 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def set_nsamps(self): res = self.hist_npts.text().toInt() diff --git a/gr-qtgui/examples/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py index b595c8ff85..8196b62dcc 100755..100644 --- a/gr-qtgui/examples/pyqt_time_c.py +++ b/gr-qtgui/examples/pyqt_time_c.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr from gnuradio import blocks import sys @@ -110,14 +112,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -125,14 +127,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_time_f.py b/gr-qtgui/examples/pyqt_time_f.py index 3689ebff54..9fc9dd5e4c 100755..100644 --- a/gr-qtgui/examples/pyqt_time_f.py +++ b/gr-qtgui/examples/pyqt_time_f.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr from gnuradio import blocks import sys @@ -104,14 +106,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -119,14 +121,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_time_raster_b.py b/gr-qtgui/examples/pyqt_time_raster_b.py index 7a94400283..278cb90ed0 100755..100644 --- a/gr-qtgui/examples/pyqt_time_raster_b.py +++ b/gr-qtgui/examples/pyqt_time_raster_b.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr from gnuradio import blocks from gnuradio import blocks @@ -30,7 +32,7 @@ try: from PyQt5 import QtWidgets, Qt import sip except ImportError: - print "Error: Program requires PyQt5 and gr-qtgui." + print("Error: Program requires PyQt5 and gr-qtgui.") sys.exit(1) class dialog_box(QtWidgets.QWidget): diff --git a/gr-qtgui/examples/pyqt_time_raster_f.py b/gr-qtgui/examples/pyqt_time_raster_f.py index 0f9de94bcb..249ec07010 100755..100644 --- a/gr-qtgui/examples/pyqt_time_raster_f.py +++ b/gr-qtgui/examples/pyqt_time_raster_f.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr from gnuradio import blocks import sys @@ -29,7 +31,7 @@ try: from PyQt5 import QtWidgets, Qt import sip except ImportError: - print "Error: Program requires PyQt5 and gr-qtgui." + print("Error: Program requires PyQt5 and gr-qtgui.") sys.exit(1) class dialog_box(QtWidgets.QWidget): diff --git a/gr-qtgui/examples/pyqt_waterfall_c.py b/gr-qtgui/examples/pyqt_waterfall_c.py index 3f7119f97f..2c183a99ac 100755..100644 --- a/gr-qtgui/examples/pyqt_waterfall_c.py +++ b/gr-qtgui/examples/pyqt_waterfall_c.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -110,14 +112,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -125,14 +127,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/examples/pyqt_waterfall_f.py b/gr-qtgui/examples/pyqt_waterfall_f.py index 71c72afad6..660e7595f2 100755..100644 --- a/gr-qtgui/examples/pyqt_waterfall_f.py +++ b/gr-qtgui/examples/pyqt_waterfall_f.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function +from __future__ import unicode_literals from gnuradio import gr, filter from gnuradio import blocks import sys @@ -104,14 +106,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq1Edit.text()) self.signal1.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp1EditText(self): try: newamp = float(self.amp1Edit.text()) self.signal1.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") def freq2EditText(self): @@ -119,14 +121,14 @@ class control_box(QtWidgets.QWidget): newfreq = float(self.freq2Edit.text()) self.signal2.set_frequency(newfreq) except ValueError: - print "Bad frequency value entered" + print("Bad frequency value entered") def amp2EditText(self): try: newamp = float(self.amp2Edit.text()) self.signal2.set_amplitude(newamp) except ValueError: - print "Bad amplitude value entered" + print("Bad amplitude value entered") class my_top_block(gr.top_block): diff --git a/gr-qtgui/grc/CMakeLists.txt b/gr-qtgui/grc/CMakeLists.txt index 74e6958639..f9ccf116cb 100644 --- a/gr-qtgui/grc/CMakeLists.txt +++ b/gr-qtgui/grc/CMakeLists.txt @@ -18,30 +18,30 @@ # Boston, MA 02110-1301, USA. ######################################################################## -file(GLOB xml_files "*.xml") +file(GLOB yml_files "*.yml") -macro(REPLACE_IN_FILE _xml_block match replace) - set(xml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_xml_block}") - set(xml_block "${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}") +macro(REPLACE_IN_FILE _yml_block match replace) + set(yml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_yml_block}") + set(yml_block "${CMAKE_CURRENT_BINARY_DIR}/${_yml_block}") - list(REMOVE_ITEM xml_files "${xml_block_src}") - file(READ "${xml_block_src}" xml_block_src_text) + list(REMOVE_ITEM yml_files "${yml_block_src}") + file(READ "${yml_block_src}" yml_block_src_text) string(REPLACE "${match}" "${replace}" - xml_block_text "${xml_block_src_text}") - file(WRITE "${xml_block}" "${xml_block_text}") + yml_block_text "${yml_block_src_text}") + file(WRITE "${yml_block}" "${yml_block_text}") - list(APPEND generated_xml_files "${xml_block}") + list(APPEND generated_yml_files "${yml_block}") endmacro() if(DESIRED_QT_VERSION EQUAL 4) - foreach(xml_block_src ${xml_files}) - get_filename_component(xml_block "${xml_block_src}" NAME) - REPLACE_IN_FILE("${xml_block}" "PyQt5" "PyQt4") + foreach(yml_block_src ${yml_files}) + get_filename_component(yml_block "${yml_block_src}" NAME) + REPLACE_IN_FILE("${yml_block}" "PyQt5" "PyQt4") endforeach() endif() install( - FILES ${xml_files} ${generated_xml_files} + FILES ${yml_files} ${generated_yml_files} DESTINATION "${GRC_BLOCKS_DIR}" ) diff --git a/gr-qtgui/grc/qtgui.tree.yml b/gr-qtgui/grc/qtgui.tree.yml new file mode 100644 index 0000000000..e479adf6af --- /dev/null +++ b/gr-qtgui/grc/qtgui.tree.yml @@ -0,0 +1,23 @@ +'[Core]': +- Instrumentation: + - QT: + - qtgui_freq_sink_x + - qtgui_time_sink_x + - qtgui_const_sink_x + - qtgui_waterfall_sink_x + - qtgui_time_raster_sink_x + - qtgui_bercurve_sink + - qtgui_histogram_sink_x + - qtgui_number_sink + - qtgui_vector_sink_f + - qtgui_sink_x +- GUI Widgets: + - QT: + - qtgui_tab_widget + - variable_qtgui_range + - variable_qtgui_chooser + - variable_qtgui_check_box + - variable_qtgui_push_button + - variable_qtgui_entry + - variable_qtgui_label + - qtgui_edit_box_msg diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.block.yml b/gr-qtgui/grc/qtgui_ber_sink_b.block.yml new file mode 100644 index 0000000000..ddf28cf1e5 --- /dev/null +++ b/gr-qtgui/grc/qtgui_ber_sink_b.block.yml @@ -0,0 +1,366 @@ +id: qtgui_bercurve_sink +label: QT GUI Bercurve Sink + +parameters: +- id: esno + label: esno + dtype: raw + default: numpy.arange(0.0, 4.0, .5) + hide: part +- id: berminerrors + label: Min. BER Errs. + dtype: int + default: '100' +- id: berlimit + label: BER Limit + dtype: real + default: '-7.0' +- id: num_curves + label: Num Curves + dtype: int + default: '1' + hide: part +- id: curvenames + label: Curve Names + dtype: raw + default: '[]' + hide: part +- id: ymin + label: Y min + dtype: real + default: '-10' + hide: part +- id: ymax + label: Y max + dtype: real + default: '0' + hide: part +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"Dark Blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['1', '2', '3', '4', '5', '0'] + option_labels: [Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot, None] + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['0', '1', '2', '3', '4', '6', '7', '8', '9', '-1'] + option_labels: [Circle, Rectangle, Diamond, Triangle, Down Triangle, Left Triangle, + Right Triangle, Cross, X-Cross, None] + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(num_curves) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(num_curves) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: byte + multiplicity: ${ len(esno)*2*num_curves } + +templates: + imports: |- + from PyQt5import Qt + from gnuradio import qtgui + import sip + import numpy + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.ber_sink_b( + ${esno}, #range of esnos + ${num_curves}, #number of curves + ${berminerrors}, #ensure at least + ${berlimit}, #cutoff + ${curvenames} #indiv. curve names + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.set_x_axis(${esno}[0], ${esno}[-1]) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${num_curves}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_style(i, styles[i]) + self.${id}.set_line_marker(i, markers[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.xml b/gr-qtgui/grc/qtgui_ber_sink_b.xml deleted file mode 100644 index 05a36dfbc0..0000000000 --- a/gr-qtgui/grc/qtgui_ber_sink_b.xml +++ /dev/null @@ -1,684 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Bercurve Sink</name> - <key>qtgui_bercurve_sink</key> - <import>from PyQt5import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <import>import numpy</import> - <make>#set $win = 'self._%s_win'%$id - qtgui.ber_sink_b( - $esno, \#range of esnos - $num_curves, \#number of curves - $berminerrors, \#ensure at least - $berlimit, \#cutoff - $curvenames, \#indiv. curve names - ) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).set_x_axis($(esno)[0], $(esno)[-1]) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange($num_curves): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - - <param> - <name>esno</name> - <key>esno</key> - <value>numpy.arange(0.0, 4.0, .5)</value> - <type>raw</type> - </param> - - <param> - <name>Min. BER Errs.</name> - <key>berminerrors</key> - <value>100</value> - <type>int</type> - </param> - - <param> - <name>BER Limit</name> - <key>berlimit</key> - <value>-7.0</value> - <type>real</type> - </param> - - <param> - <name>Num Curves</name> - <key>num_curves</key> - <value>1</value> - <type>int</type> - </param> - - <param> - <name>Curve Names</name> - <key>curvenames</key> - <value>[]</value> - <type>raw</type> - <hide>part</hide> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>0</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"Dark Blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <option> - <name>None</name> - <key>0</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <option> - <name>None</name> - <key>-1</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>out</name> - <type>byte</type> - <nports>len($esno)*2*$num_curves</nports> - </sink> - - <bus_structure_sink>map(lambda b: map(lambda a: b * len($esno) * 2 + a, range(len($esno)*2)), range($num_curves))</bus_structure_sink> - - <doc> - The GUI hint can be used to position the widget within the application. \ - The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ - Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_block_tree.xml b/gr-qtgui/grc/qtgui_block_tree.xml deleted file mode 100644 index 33fb12a7b5..0000000000 --- a/gr-qtgui/grc/qtgui_block_tree.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0"?> - -<!-- - Copyright 2012-2013 Free Software Foundation, Inc. - - This file is part of GNU Radio - - GNU Radio is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - GNU Radio is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU Radio; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, - Boston, MA 02110-1301, USA. ---> - -<!-- -################################################### -##Block Tree for GR QTGUI blocks. -################################################### - --> -<cat> - <name>[Core]</name> - <cat> - <name>Instrumentation</name> - <cat> - <name>QT</name> - <block>qtgui_freq_sink_x</block> - <block>qtgui_time_sink_x</block> - <block>qtgui_const_sink_x</block> - <block>qtgui_waterfall_sink_x</block> - <block>qtgui_time_raster_sink_x</block> - <block>qtgui_bercurve_sink</block> - <block>qtgui_histogram_sink_x</block> - <block>qtgui_number_sink</block> - <block>qtgui_vector_sink_f</block> - <block>qtgui_sink_x</block> - </cat> - </cat> - <cat> - <name>GUI Widgets</name> - <cat> - <name>QT</name> - <block>qtgui_tab_widget</block> - <block>variable_qtgui_range</block> - <block>variable_qtgui_chooser</block> - <block>variable_qtgui_check_box</block> - <block>variable_qtgui_push_button</block> - <block>variable_qtgui_entry</block> - <block>variable_qtgui_label</block> - <block>qtgui_edit_box_msg</block> - </cat> - </cat> -</cat> diff --git a/gr-qtgui/grc/qtgui_check_box.block.yml b/gr-qtgui/grc/qtgui_check_box.block.yml new file mode 100644 index 0000000000..dc67237e4f --- /dev/null +++ b/gr-qtgui/grc/qtgui_check_box.block.yml @@ -0,0 +1,66 @@ +id: variable_qtgui_check_box +label: QT GUI Check Box + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [float, int, str, bool, eval] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: 'True' +- id: 'true' + label: 'True' + dtype: ${ type } + default: 'True' +- id: 'false' + label: 'False' + dtype: ${ type } + default: 'False' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +asserts: +- ${value in (true, false)} + +templates: + imports: from PyQt5 import Qt + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - self._${id}_callback(${id}) + make: |- + <% + win = '_%s_check_box'%id + if not label: + label = id + %> + ${win} = Qt.QCheckBox(${label}) + self._${id}_choices = {True: ${true}, False: ${false}} + self._${id}_choices_inv = dict((v,k) for k,v in self._${id}_choices.iteritems()) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(${win}, "setChecked", Qt.Q_ARG("bool", self._${id}_choices_inv[i])) + self._${id}_callback(self.${id}) + ${win}.stateChanged.connect(lambda i: self.set_${id}(self._${id}_choices[bool(i)])) + ${gui_hint() % win} + +documentation: |- + This block creates a variable check box. Leave the label blank to use the variable id as the label. + + A check box selects between two values of similar type. Te values do not necessarily need to be of boolean type. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml deleted file mode 100644 index ccee59dd92..0000000000 --- a/gr-qtgui/grc/qtgui_check_box.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Check Box: -## a gui check box form -################################################### - --> -<block> - <name>QT GUI Check Box</name> - <key>variable_qtgui_check_box</key> - <import>from PyQt5 import Qt</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = '_%s_check_box'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$win = Qt.QCheckBox($label) -self._$(id)_choices = {True: $true, False: $false} -self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems()) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod($(win), "setChecked", Qt.Q_ARG("bool", self._$(id)_choices_inv[i])) -self._$(id)_callback(self.$id) -$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)])) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_callback($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:float</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>True</value> - <type>$type</type> - </param> - <param> - <name>True</name> - <key>true</key> - <value>True</value> - <type>$type</type> - </param> - <param> - <name>False</name> - <key>false</key> - <value>False</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <check>$value in ($true, $false)</check> - <doc> -This block creates a variable check box. \ -Leave the label blank to use the variable id as the label. - -A check box selects between two values of similar type. \ -Te values do not necessarily need to be of boolean type. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_chooser.block.yml b/gr-qtgui/grc/qtgui_chooser.block.yml new file mode 100644 index 0000000000..a342beccc0 --- /dev/null +++ b/gr-qtgui/grc/qtgui_chooser.block.yml @@ -0,0 +1,191 @@ +id: variable_qtgui_chooser +label: QT GUI Chooser +flags: has_python + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, raw] + option_labels: [Float, Integer, String, Any] + hide: part +- id: num_opts + label: Num Options + dtype: enum + default: '3' + options: ['0', '1', '2', '3', '4', '5'] + option_labels: [List, '1', '2', '3', '4', '5'] +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: options + label: Options + dtype: raw + default: '[0, 1, 2]' + hide: ${ ('all' if int(num_opts) else 'none') } +- id: labels + label: Labels + dtype: raw + default: '[]' + hide: ${ ('all' if int(num_opts) else 'none') } +- id: option0 + label: Option 0 + dtype: ${ type } + default: '0' + hide: ${ ('none' if int(num_opts) > 0 else 'all') } +- id: label0 + label: Label 0 + dtype: string + hide: ${ (int(num_opts) > 0) and (label0 and 'none' or 'part') or 'all' } +- id: option1 + label: Option 1 + dtype: ${ type } + default: '1' + hide: ${ ('none' if int(num_opts) > 1 else 'all') } +- id: label1 + label: Label 1 + dtype: string + hide: ${ (int(num_opts) > 1) and (label1 and 'none' or 'part') or 'all' } +- id: option2 + label: Option 2 + dtype: ${ type } + default: '2' + hide: ${ ('none' if int(num_opts) > 2 else 'all') } +- id: label2 + label: Label 2 + dtype: string + hide: ${ (int(num_opts) > 2) and (label2 and 'none' or 'part') or 'all' } +- id: option3 + label: Option 3 + dtype: ${ type } + default: '3' + hide: ${ ('none' if int(num_opts) > 3 else 'all') } +- id: label3 + label: Label 3 + dtype: string + hide: ${ (int(num_opts) > 3) and (label3 and 'none' or 'part') or 'all' } +- id: option4 + label: Option 4 + dtype: ${ type } + default: '4' + hide: ${ ('none' if int(num_opts) > 4 else 'all') } +- id: label4 + label: Label 4 + dtype: string + hide: ${ (int(num_opts) > 4) and (label4 and 'none' or 'part') or 'all' } +- id: widget + label: Widget + dtype: enum + default: combo_box + options: [combo_box, radio_buttons] + option_labels: [Combo Box, Radio Buttons] + hide: part +- id: orient + label: Orientation + dtype: enum + default: Qt.QVBoxLayout + options: [Qt.QHBoxLayout, Qt.QVBoxLayout] + option_labels: [Horizontal, Vertical] + hide: ${ ('part' if widget == 'radio_buttons' else 'all') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: |- + from PyQt5 import Qt + from PyQt5.QtCore import QObject, pyqtSlot + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - self._${id}_callback(${id}) + make: |- + <% + all_options = [ option0, option1, option2, option3, option4 ][:int(num_opts)] + all_labels = [ label0, label1, label2, label3, label4 ][:int(num_opts)] + if not label: + label = id + %>\ + # Create the options list + % if int(num_opts): + self._${id}_options = (\ + % for ch in all_options: + ${ch}, \ + % endfor + ) + % else: + self._${id]_options = ${options} + % endif + # Create the labels list + % if int(num_opts): + self._${id}_labels = (\ + % for i, lbl in all_labels: + % if lbl: + ${lbl}, \ + % else: + str(self._${id}_options[${i}], \ + % endif + % endfor + ) + % elif labels: + self._${id]_labels = ${labels} + % else: + self._${id}_map(str, self._${id}_options) + % endif + # Create the combo box + % if widget == 'combo_box': + <% + win = 'self._%s_tool_bar'%id + %>\ + ${win} = Qt.QToolBar(self) + ${win}.addWidget(Qt.QLabel(${label} + ": ")) + self._${id}_combo_box = Qt.QComboBox() + ${win}.addWidget(self._${id}_combo_box) + for label in self._${id}_labels: self._${id}_combo_box.addItem(label) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(self._${id}_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._${id}_options.index(i))) + self._${id}_callback(self.${id}) + self._${id}_combo_box.currentIndexChanged.connect( + lambda i: self.set_${id}(self._${id}_options[i])) + % endif + # Create the radio buttons + % if widget == 'radio_buttons': + <% + win = 'self._%s_group_box'%id + %>\ + ${win} = QtQGroupBox(${label}) + self._${id}_box = ${orient}() + class variable_chooser_button_group(Qt.QButtonGroup): + def __init__(self, parent=None): + Qt.QButtonGroup.__init__(self, parent) + @pyqtSlot(int) + def updateButtonChecked(self, button_id): + self.button(button_id).setChecked(True) + self._${id}_button_group = variable_chooser_button_group() + ${win}.setLayout(self._${id}_box) + for i, label in enumerate(self._${id}_labels): + radio_button = Qt.QRadioButton(label) + self._${id}_box.addWidget(radio_button) + self._${id}_button_group.addButton(radio_button, i) + self._${id}_callback = lambda i: Qt.QMetaObject.invokeMethod(self._${id}_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._${id}_options.index(i))) + self._${id}_callback(self.${id}) + self._${id}_button_group.buttonClicked[int].connect( + lambda i: self.set_${id}(self._${id}_options[i])) + % endif + ${gui_hint() % win} + +documentation: |- + This block creates a variable with enumerated options. The gui widget is implemented as a combo box or radio button group. Leave the label blank to use the variable id as the label. + + Choose the number of options available to your chooser. When the label is left blank, the option will be used as the label. Set the number of options to "list" to enter a single list of options and labels. When the labels is an empty list, the options will be used as the label. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml deleted file mode 100644 index f79bb8ccb3..0000000000 --- a/gr-qtgui/grc/qtgui_chooser.xml +++ /dev/null @@ -1,257 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Chooser: -## A chooser, radio buttons -################################################### - --> -<block> - <name>QT GUI Chooser</name> - <key>variable_qtgui_chooser</key> - <import>from PyQt5 import Qt</import> - <import>from PyQt5.QtCore import QObject, pyqtSlot</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#slurp -#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] -#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] -#if not $label() - #set $label = '"%s"'%$id -#end if -######################################################################## -## Create the options list -######################################################################## -#if int($num_opts()) -self._$(id)_options = (#slurp - #for $ch in $all_options -$ch, #slurp - #end for -) -#else -self._$(id)_options = $options -#end if -######################################################################## -## Create the labels list -######################################################################## -#if int($num_opts()) -self._$(id)_labels = (#slurp - #for i, $lbl in enumerate($all_labels) - #if $lbl() -$lbl, #slurp - #else -str(self._$(id)_options[$i]), #slurp - #end if - #end for -) -#elif $labels() -self._$(id)_labels = $labels -#else -self._$(id)_labels = map(str, self._$(id)_options) -#end if -######################################################################## -## Create the combo box -######################################################################## -#if $widget() == 'combo_box' -#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -$(win).addWidget(Qt.QLabel($label+": ")) -self._$(id)_combo_box = Qt.QComboBox() -$(win).addWidget(self._$(id)_combo_box) -for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod(self._$(id)_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._$(id)_options.index(i))) -self._$(id)_callback(self.$id) -self._$(id)_combo_box.currentIndexChanged.connect( - lambda i: self.set_$(id)(self._$(id)_options[i])) -#end if -######################################################################## -## Create the radio buttons -######################################################################## -#if $widget() == 'radio_buttons' -#set $win = 'self._%s_group_box'%$id -$win = Qt.QGroupBox($label) -self._$(id)_box = $(orient)() -class variable_chooser_button_group(Qt.QButtonGroup): - def __init__(self, parent=None): - Qt.QButtonGroup.__init__(self, parent) - @pyqtSlot(int) - def updateButtonChecked(self, button_id): - self.button(button_id).setChecked(True) -self._$(id)_button_group = variable_chooser_button_group() -$(win).setLayout(self._$(id)_box) -for i, label in enumerate(self._$(id)_labels): - radio_button = Qt.QRadioButton(label) - self._$(id)_box.addWidget(radio_button) - self._$(id)_button_group.addButton(radio_button, i) -self._$(id)_callback = lambda i: Qt.QMetaObject.invokeMethod(self._$(id)_button_group, "updateButtonChecked", Qt.Q_ARG("int", self._$(id)_options.index(i))) -self._$(id)_callback(self.$id) -self._$(id)_button_group.buttonClicked[int].connect( - lambda i: self.set_$(id)(self._$(id)_options[i])) -#end if -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>self._$(id)_callback($id)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key></option> - <option><name>Integer</name><key>int</key></option> - <option><name>String</name><key>string</key></option> - <option><name>Any</name><key>raw</key></option> - </param> - <param> - <name>Num Options</name> - <key>num_opts</key> - <value>3</value> - <type>enum</type> - <option><name>List</name><key>0</key></option> - <option><name>1</name><key>1</key></option> - <option><name>2</name><key>2</key></option> - <option><name>3</name><key>3</key></option> - <option><name>4</name><key>4</key></option> - <option><name>5</name><key>5</key></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>Options</name> - <key>options</key> - <value>[0, 1, 2]</value> - <type>raw</type> - <hide>#if int($num_opts()) then 'all' else 'none'#</hide> - </param> - <param> - <name>Labels</name> - <key>labels</key> - <value>[]</value> - <type>raw</type> - <hide>#if int($num_opts()) then 'all' else 'none'#</hide> - </param> - <param> - <name>Option 0</name> - <key>option0</key> - <value>0</value> - <type>$type</type> - <hide>#if int($num_opts()) > 0 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 0</name> - <key>label0</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 1</name> - <key>option1</key> - <value>1</value> - <type>$type</type> - <hide>#if int($num_opts()) > 1 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 1</name> - <key>label1</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 2</name> - <key>option2</key> - <value>2</value> - <type>$type</type> - <hide>#if int($num_opts()) > 2 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 2</name> - <key>label2</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 3</name> - <key>option3</key> - <value>3</value> - <type>$type</type> - <hide>#if int($num_opts()) > 3 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 3</name> - <key>label3</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Option 4</name> - <key>option4</key> - <value>4</value> - <type>$type</type> - <hide>#if int($num_opts()) > 4 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 4</name> - <key>label4</key> - <value></value> - <type>string</type> - <hide>$((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all')</hide> - </param> - <param> - <name>Widget</name> - <key>widget</key> - <value>combo_box</value> - <type>enum</type> - <hide>part</hide> - <option><name>Combo Box</name><key>combo_box</key></option> - <option><name>Radio Buttons</name><key>radio_buttons</key></option> - </param> - <param> - <name>Orientation</name> - <key>orient</key> - <value>Qt.QVBoxLayout</value> - <type>enum</type> - <hide>#if $widget() == 'radio_buttons' then 'part' else 'all'#</hide> - <option> - <name>Horizontal</name> - <key>Qt.QHBoxLayout</key> - </option> - <option> - <name>Vertical</name> - <key>Qt.QVBoxLayout</key> - </option> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a variable with enumerated options. \ -The gui widget is implemented as a combo box or radio button group. \ -Leave the label blank to use the variable id as the label. - -Choose the number of options available to your chooser. \ -When the label is left blank, the option will be used as the label. \ -Set the number of options to "list" to enter a single list of options and labels. \ -When the labels is an empty list, the options will be used as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_const_sink_x.block.yml b/gr-qtgui/grc/qtgui_const_sink_x.block.yml new file mode 100644 index 0000000000..1019393d6b --- /dev/null +++ b/gr-qtgui/grc/qtgui_const_sink_x.block.yml @@ -0,0 +1,457 @@ +id: qtgui_const_sink_x +label: QT GUI Constellation Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, msg_complex] + option_labels: [Complex, Complex Message] + option_attributes: + fcn: [const_sink_c, const_sink_c] + t: [complex, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: size + label: Number of Points + dtype: int + default: '1024' + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: ymin + label: Y min + dtype: real + default: '-2' + hide: part +- id: ymax + label: Y max + dtype: real + default: '2' + hide: part +- id: xmin + label: X min + dtype: real + default: '-2' + hide: part +- id: xmax + label: X max + dtype: real + default: '2' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: tr_mode + label: Trigger Mode + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_FREE + options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG] + option_labels: [Free, Auto, Normal, Tag] + hide: part +- id: tr_slope + label: Trigger Slope + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_POS + options: [qtgui.TRIG_SLOPE_POS, qtgui.TRIG_SLOPE_NEG] + option_labels: [Positive, Negative] + hide: part +- id: tr_level + label: Trigger Level + category: Trigger + dtype: float + default: '0.0' + hide: part +- id: tr_chan + label: Trigger Channel + category: Trigger + dtype: int + default: '0' + hide: part +- id: tr_tag + label: Trigger Tag Key + category: Trigger + dtype: string + default: '""' + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"Dark Blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['0', '1', '2', '3', '4', '5'] + option_labels: [None, Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['0', '1', '2', '3', '4', '6', '7', '8', '9', '-1'] + option_labels: [Circle, Rectangle, Diamond, Triangle, Down Triangle, Left Triangle, + Right Triangle, Cross, X-Cross, None] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_resize(${width}, ${height}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_chan}, + ${tr_tag}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${size}, #size + ${name}, #name + ${0 if type.startswith('msg') else nconnections} #number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.set_x_axis(${xmin}, ${xmax}) + self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_chan}, ${tr_tag}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + if not ${legend}: + self.${id}.disable_legend() + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + styles = [${style1}, ${style2}, ${style3}, ${style4}, ${style5}, + ${style6}, ${style7}, ${style8}, ${style9}, ${style10}] + markers = [${marker1}, ${marker2}, ${marker3}, ${marker4}, ${marker5}, + ${marker6}, ${marker7}, ${marker8}, ${marker9}, ${marker10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_style(i, styles[i]) + self.${id}.set_line_marker(i, markers[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + self._${id}_win = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_const_sink_x.xml b/gr-qtgui/grc/qtgui_const_sink_x.xml deleted file mode 100644 index 10f82cce82..0000000000 --- a/gr-qtgui/grc/qtgui_const_sink_x.xml +++ /dev/null @@ -1,859 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Constellation Sink</name> - <key>qtgui_const_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $size, \#size - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).set_x_axis($xmin, $xmax) -self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_chan, $tr_tag) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -if not $legend: - self.$(id).disable_legend() - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_resize($width, $height)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_chan, $tr_tag)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Trigger</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:const_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:const_sink_c</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Number of Points</name> - <key>size</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>X min</name> - <key>xmin</key> - <value>-2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>X max</name> - <key>xmax</key> - <value>2</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - - <param> - <name>Trigger Mode</name> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_FREE</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Free</name> - <key>qtgui.TRIG_MODE_FREE</key> - </option> - <option> - <name>Auto</name> - <key>qtgui.TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>qtgui.TRIG_MODE_NORM</key> - </option> - <option> - <name>Tag</name> - <key>qtgui.TRIG_MODE_TAG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Slope</name> - <key>tr_slope</key> - <value>qtgui.TRIG_MODE_POS</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Positive</name> - <key>qtgui.TRIG_SLOPE_POS</key> - </option> - <option> - <name>Negative</name> - <key>qtgui.TRIG_SLOPE_NEG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Level</name> - <key>tr_level</key> - <value>0.0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Channel</name> - <key>tr_chan</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Tag Key</name> - <key>tr_tag</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - - - <!-- Begin Config Tab items --> - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"Dark Blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>None</name> - <key>0</key> - </option> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <option> - <name>None</name> - <key>-1</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_edit_box_msg.block.yml b/gr-qtgui/grc/qtgui_edit_box_msg.block.yml new file mode 100644 index 0000000000..ac867bfcef --- /dev/null +++ b/gr-qtgui/grc/qtgui_edit_box_msg.block.yml @@ -0,0 +1,69 @@ +id: qtgui_edit_box_msg +label: QT GUI Message Edit Box + +parameters: +- id: type + label: Type + dtype: enum + default: string + options: [string, int, float, double, complex, int_vec, flt_vec, dbl_vec, cpx_vec] + option_labels: [String, Int, Float, Double, Complex, Int (Vec), Float (Vec), Double + (Vec), Complex (Vec)] + option_attributes: + t: [qtgui.STRING, qtgui.INT, qtgui.FLOAT, qtgui.DOUBLE, qtgui.COMPLEX, qtgui.INT_VEC, + qtgui.FLOAT_VEC, qtgui.DOUBLE_VEC, qtgui.COMPLEX_VEC] +- id: value + label: Value + dtype: string +- id: label + label: Label + dtype: string +- id: is_pair + label: Pair Mode + dtype: enum + default: 'True' + options: ['False', 'True'] +- id: is_static + label: Static Mode + dtype: enum + default: 'True' + options: ['False', 'True'] +- id: key + label: Key + dtype: string + hide: ${ ('none' if is_pair == 'True' else 'all') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part + +asserts: +- ${(is_pair and is_static and len(key) > 0) or not (is_pair and is_static)} + +inputs: +- domain: message + id: val + optional: true + +outputs: +- domain: message + id: msg + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + make: + <% + win = 'self._%s_win'%id + %>\ + qtgui.edit_box_msg(${type.t)}, ${value}, ${label}, ${is_pair}, ${is_static}, ${key}) + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_edit_box_msg.xml b/gr-qtgui/grc/qtgui_edit_box_msg.xml deleted file mode 100644 index d77a4b3e1b..0000000000 --- a/gr-qtgui/grc/qtgui_edit_box_msg.xml +++ /dev/null @@ -1,152 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Edit Box that sends messages -################################################### - --> -<block> - <name>QT GUI Message Edit Box</name> - <key>qtgui_edit_box_msg</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.edit_box_msg($(type.t), $value, $label, $is_pair, $is_static, $key) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - - <param> - <name>Type</name> - <key>type</key> - <value>string</value> - <type>enum</type> - <option> - <name>String</name> - <key>string</key> - <opt>t:qtgui.STRING</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>t:qtgui.INT</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>t:qtgui.FLOAT</opt> - </option> - <option> - <name>Double</name> - <key>double</key> - <opt>t:qtgui.DOUBLE</opt> - </option> - <option> - <name>Complex</name> - <key>complex</key> - <opt>t:qtgui.COMPLEX</opt> - </option> - <option> - <name>Int (Vec)</name> - <key>int_vec</key> - <opt>t:qtgui.INT_VEC</opt> - </option> - <option> - <name>Float (Vec)</name> - <key>flt_vec</key> - <opt>t:qtgui.FLOAT_VEC</opt> - </option> - <option> - <name>Double (Vec)</name> - <key>dbl_vec</key> - <opt>t:qtgui.DOUBLE_VEC</opt> - </option> - <option> - <name>Complex (Vec)</name> - <key>cpx_vec</key> - <opt>t:qtgui.COMPLEX_VEC</opt> - </option> - </param> - - <param> - <name>Value</name> - <key>value</key> - <value></value> - <type>string</type> - </param> - - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - </param> - - <param> - <name>Pair Mode</name> - <key>is_pair</key> - <value>True</value> - <type>enum</type> - <option> - <name>False</name> - <key>False</key> - </option> - <option> - <name>True</name> - <key>True</key> - </option> - </param> - - <param> - <name>Static Mode</name> - <key>is_static</key> - <value>True</value> - <type>enum</type> - <option> - <name>False</name> - <key>False</key> - </option> - <option> - <name>True</name> - <key>True</key> - </option> - </param> - - <param> - <name>Key</name> - <key>key</key> - <value></value> - <type>string</type> - <hide>#if $is_pair() == 'True' then 'none' else 'all'#</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <!-- If both is_pair and is_static are True, we require a default key. - If either or both are false, we don't care about a default key. - --> - <check>($is_pair and $is_static and len($key) > 0) or not ($is_pair and $is_static)</check> - - <sink> - <name>val</name> - <type>message</type> - <optional>1</optional> - </sink> - - <source> - <name>msg</name> - <type>message</type> - <optional>1</optional> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_entry.block.yml b/gr-qtgui/grc/qtgui_entry.block.yml new file mode 100644 index 0000000000..8a430b2874 --- /dev/null +++ b/gr-qtgui/grc/qtgui_entry.block.yml @@ -0,0 +1,57 @@ +id: variable_qtgui_entry +label: QT GUI Entry + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [eng_notation.str_to_num, int, str, bool, eval] + str: [eng_notation.num_to_str, str, str, str, repr] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import eng_notation + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + - Qt.QMetaObject.invokeMethod(self._${id}_line_edit, "setText", Qt.Q_ARG("QString", + ${type.str}(${id}))) + make: |- + <% + win = 'self._%s_tool_bar'%id + if not label: + label = '"%s"'%id + %> + ${win} = Qt.QToolBar(self) + ${win}.addWidget(Qt.QLabel(${label}+": ")) + self._${id}_line_edit = Qt.QLineEdit(str(self.${id})) + self._${id}_tool_bar.addWidget(self._${id}_line_edit) + self._${id}_line_edit.returnPressed.connect( + lambda: self.set_${id}(${type.conv}(str(self._${id}_line_edit.text().toAscii())))) + ${gui_hint() % win} + +documentation: |- + This block creates a variable with a text entry box. Leave the label blank to use the variable id as the label. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml deleted file mode 100644 index fc0f4089d1..0000000000 --- a/gr-qtgui/grc/qtgui_entry.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Text Entry: -## a gui text box form -################################################### - --> -<block> - <name>QT GUI Entry</name> - <key>variable_qtgui_entry</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import eng_notation</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if not $label() - #set $label = '"%s"'%$id -#end if -$(win).addWidget(Qt.QLabel($label+": ")) -self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) -self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) -self._$(id)_line_edit.returnPressed.connect( - lambda: self.set_$(id)($(type.conv)(str(self._$(id)_line_edit.text().toAscii())))) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <callback>Qt.QMetaObject.invokeMethod(self._$(id)_line_edit, "setText", Qt.Q_ARG("QString", $(type.str)($id)))</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a variable with a text entry box. \ -Leave the label blank to use the variable id as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.block.yml b/gr-qtgui/grc/qtgui_freq_sink_x.block.yml new file mode 100644 index 0000000000..d935f04c4e --- /dev/null +++ b/gr-qtgui/grc/qtgui_freq_sink_x.block.yml @@ -0,0 +1,447 @@ +id: qtgui_freq_sink_x +label: QT GUI Frequency Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float, msg_complex, msg_float] + option_labels: [Complex, Float, Complex Message, Float Message] + option_attributes: + fcn: [freq_sink_c, freq_sink_f, freq_sink_c, freq_sink_f] + t: [complex, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: fftsize + label: FFT Size + dtype: int + default: '1024' + hide: ${ ('all' if (type == 'msg_complex' or type == 'msg_float') else 'none') } +- id: freqhalf + label: Spectrum Width + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: [Full, Half] + hide: ${ ('part' if type == "float" or type == "msg_float" else 'all') } +- id: wintype + label: Window Type + dtype: enum + default: firdes.WIN_BLACKMAN_hARRIS + options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN, + firdes.WIN_RECTANGULAR, firdes.WIN_KAISER, firdes.WIN_FLATTOP] + option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser, + Flat-top] + hide: part +- id: fc + label: Center Frequency (Hz) + dtype: real + default: '0' +- id: bw + label: Bandwidth (Hz) + dtype: real + default: samp_rate +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: average + label: Average + dtype: enum + default: 'False' + options: ['1.0', '0.2', '0.1', '0.05'] + option_labels: [None, Low, Medium, High] + hide: part +- id: ymin + label: Y min + dtype: real + default: '-140' + hide: part +- id: ymax + label: Y max + dtype: real + default: '10' + hide: part +- id: label + label: Y label + dtype: string + default: Relative Gain + hide: part +- id: units + label: Y units + dtype: string + default: dB + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if (type == 'msg_complex' or type == 'msg_float') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part +- id: tr_mode + label: Trigger Mode + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_FREE + options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG] + option_labels: [Free, Auto, Normal, Tag] + hide: part +- id: tr_level + label: Trigger Level + category: Trigger + dtype: float + default: '0.0' + hide: part +- id: tr_chan + label: Trigger Channel + category: Trigger + dtype: int + default: '0' + hide: part +- id: tr_tag + label: Trigger Tag Key + category: Trigger + dtype: string + default: '""' + hide: part +- id: ctrlpanel + label: Control Panel + category: Config + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"dark blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + default: "''" + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + default: '1' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if (type == 'msg_complex' or type == 'msg_float') else nconnections) } + optional: true +- domain: message + id: freq + optional: true + hide: ${ showports } + +outputs: +- domain: message + id: freq + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_frequency_range(${fc}, ${bw}) + - set_update_time(${update_time}) + - set_y_axis(${ymin}, ${ymax}) + - self.${id}.set_trigger_mode(${tr_mode}, ${tr_level}, ${tr_chan}, ${tr_tag}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${fftsize}, #size + ${wintype}, #wintype + ${fc}, #fc + ${bw}, #bw + ${name}, #name + ${ 0 if (type == 'msg_complex' or type == 'msg_float') else nconnections } + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.set_y_label(${label}, ${units}) + self.${id}.set_trigger_mode(${tr_mode}, ${tr_level}, ${tr_chan}, ${tr_tag}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.set_fft_average(${average}) + self.${id}.enable_axis_labels(${axislabels}) + self.${id}.enable_control_panel(${ctrlpanel}) + + if not ${legend}: + self.${id}.disable_legend() + + if ${type} == "float" or ${type} == "msg_float": + self.${id}.set_plot_pos_half(not ${freqhalf}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if (type == 'msg_complex' or type == 'msg_float') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${ gui_hint()(win)} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.xml b/gr-qtgui/grc/qtgui_freq_sink_x.xml deleted file mode 100644 index ed39db7781..0000000000 --- a/gr-qtgui/grc/qtgui_freq_sink_x.xml +++ /dev/null @@ -1,791 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Frequency Sink</name> - <key>qtgui_freq_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $fftsize, \#size - $wintype, \#wintype - $fc, \#fc - $bw, \#bw - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).set_y_label($label, $units) -self.$(id).set_trigger_mode($tr_mode, $tr_level, $tr_chan, $tr_tag) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).set_fft_average($average) -self.$(id).enable_axis_labels($axislabels) -self.$(id).enable_control_panel($ctrlpanel) - -if not $legend: - self.$(id).disable_legend() - -if "$type" == "float" or "$type" == "msg_float": - self.$(id).set_plot_pos_half(not $freqhalf) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_frequency_range($fc, $bw)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_y_axis($ymin, $ymax)</callback> - <callback>self.$(id).set_trigger_mode($tr_mode, $tr_level, $tr_chan, $tr_tag)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Trigger</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:freq_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:freq_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:freq_sink_c</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:freq_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>FFT Size</name> - <key>fftsize</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Spectrum Width</name> - <key>freqhalf</key> - <value>True</value> - <type>enum</type> - <hide>#if $type() == "float" or $type() == "msg_float" then 'part' else 'all'#</hide> - <option> - <name>Full</name> - <key>True</key> - </option> - <option> - <name>Half</name> - <key>False</key> - </option> - </param> - - <param> - <name>Window Type</name> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Blackman-harris</name> - <key>firdes.WIN_BLACKMAN_hARRIS</key> - </option> - <option> - <name>Hamming</name> - <key>firdes.WIN_HAMMING</key> - </option> - <option> - <name>Hann</name> - <key>firdes.WIN_HANN</key> - </option> - <option> - <name>Blackman</name> - <key>firdes.WIN_BLACKMAN</key> - </option> - <option> - <name>Rectangular</name> - <key>firdes.WIN_RECTANGULAR</key> - </option> - <option> - <name>Kaiser</name> - <key>firdes.WIN_KAISER</key> - </option> - <option> - <name>Flat-top</name> - <key>firdes.WIN_FLATTOP</key> - </option> - </param> - - <param> - <name>Center Frequency (Hz)</name> - <key>fc</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Bandwidth (Hz)</name> - <key>bw</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>None</name> - <key>1.0</key> - </option> - <option> - <name>Low</name> - <key>0.2</key> - </option> - <option> - <name>Medium</name> - <key>0.1</key> - </option> - <option> - <name>High</name> - <key>0.05</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-140</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Y label</name> - <key>label</key> - <value>Relative Gain</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Y units</name> - <key>units</key> - <value>dB</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - - <!-- Begin Trigger Tab items --> - <param> - <name>Trigger Mode</name> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_FREE</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Free</name> - <key>qtgui.TRIG_MODE_FREE</key> - </option> - <option> - <name>Auto</name> - <key>qtgui.TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>qtgui.TRIG_MODE_NORM</key> - </option> - <option> - <name>Tag</name> - <key>qtgui.TRIG_MODE_TAG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Level</name> - <key>tr_level</key> - <value>0.0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Channel</name> - <key>tr_chan</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Tag Key</name> - <key>tr_tag</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - - - <!-- Begin Config Tab items --> - <param> - <name>Control Panel</name> - <key>ctrlpanel</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"dark blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <sink> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </sink> - - <source> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml b/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml new file mode 100644 index 0000000000..f71c2edb94 --- /dev/null +++ b/gr-qtgui/grc/qtgui_histogram_sink_x.block.yml @@ -0,0 +1,419 @@ +id: qtgui_histogram_sink_x +label: QT GUI Histogram Sink + +parameters: +- id: type + label: Type + dtype: enum + default: float + options: [float, msg_float] + option_labels: [Float, Float Message] + option_attributes: + fcn: [histogram_sink_f, histogram_sink_f] + t: [float, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: size + label: Number of Points + dtype: int + default: '1024' + hide: ${ ('all' if type.startwith('msg') else 'none') } +- id: bins + label: Number of Bins + dtype: int + default: '100' +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: accum + label: Accumulate + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: xmin + label: Min x-axis + dtype: real + default: '-1' +- id: xmax + label: Max x-axis + dtype: real + default: '1' +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startwith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: float + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"dark blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['1', '2', '3', '4', '5', '0'] + option_labels: [Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot, None] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['-1', '0', '1', '2', '3', '4', '6', '7', '8', '9'] + option_labels: [None, Circle, Rectangle, Diamond, Triangle, Down Triangle, Left + Triangle, Right Triangle, Cross, X-Cross] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - set_bins(${bins}) + - set_bins(${bins}) + - set_x_axis(${xmin}, ${xmax}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.histogram_sink_f( + $size, + $bins, + $xmin, + $xmax, + $name, + ${ 0 if type.startswith('msg') else nconnections} + ) + + self.${id}.set_update_time(${update_time}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_accumulate(${accum}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + if not ${legend}: + self.${id}.disable_legend() + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_style(i, styles[i]) + self.${id}.set_line_marker(i, markers[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.xml b/gr-qtgui/grc/qtgui_histogram_sink_x.xml deleted file mode 100644 index 9e3dcb104f..0000000000 --- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml +++ /dev/null @@ -1,794 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Histogram Sink -################################################### - --> -<block> - <name>QT GUI Histogram Sink</name> - <key>qtgui_histogram_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.histogram_sink_f( - $size, - $bins, - $xmin, - $xmax, - $name, - #if $type.t == 'message' then 0 else $nconnections# -) - -self.$(id).set_update_time($update_time) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_accumulate($accum) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -if not $legend: - self.$(id).disable_legend() - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win)) - </make> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_bins($bins)</callback> - <callback>set_bins($bins)</callback> - <callback>set_x_axis($xmin, $xmax)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>float</value> - <type>enum</type> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:histogram_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:histogram_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Number of Points</name> - <key>size</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Number of Bins</name> - <key>bins</key> - <value>100</value> - <type>int</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>True</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Accumulate</name> - <key>accum</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Min x-axis</name> - <key>xmin</key> - <value>-1</value> - <type>real</type> - </param> - - <param> - <name>Max x-axis</name> - <key>xmax</key> - <value>1</value> - <type>real</type> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <!-- Begin Config Tab items --> - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"dark blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <option> - <name>None</name> - <key>0</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>None</name> - <key>-1</key> - </option> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_label.block.yml b/gr-qtgui/grc/qtgui_label.block.yml new file mode 100644 index 0000000000..e86aa20727 --- /dev/null +++ b/gr-qtgui/grc/qtgui_label.block.yml @@ -0,0 +1,66 @@ +id: variable_qtgui_label +label: QT GUI Label + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [eng_notation.str_to_num, int, str, bool, eval] + str: [eng_notation.num_to_str, str, str, str, repr] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: formatter + label: Formatter + dtype: raw + default: None + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import eng_notation + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(self._${id}_formatter(${value})) + - Qt.QMetaObject.invokeMethod(self._${id}_label, "setText", Qt.Q_ARG("QString", + ${id})) + make: |- + <% + win = 'self._%s_win'%id + if not label: + label = 'self._%s_tool_bar'%id + %>\ + ${win} = Qt.QToolBar(self) + + if ${formatter}: + self._${id}_formatter = ${formatter} + else: + self._${id}_formatter = lambda x: ${type.str}(x) + + ${win}.addWidget(Qt.QLabel(${label}+": ")) + self._${id}_label = Qt.QLabel(str(self._${id}_formatter(self.${id}))) + self._${id}_tool_bar.addWidget(self._${id}_label) + ${gui_hint() % win} + +documentation: |- + This block creates a variable with a label widget for text. Leave the label blank to use the variable id as the label. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml deleted file mode 100644 index 946cee36ab..0000000000 --- a/gr-qtgui/grc/qtgui_label.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Label Text: -## a gui static text form -################################################### - --> - -<block> - <name>QT GUI Label</name> - <key>variable_qtgui_label</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import eng_notation</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = 'self._%s_tool_bar'%$id -$win = Qt.QToolBar(self) -#if not $label() - #set $label = '"%s"'%$id -#end if - -if $(formatter): - self._$(id)_formatter = $formatter -else: - self._$(id)_formatter = lambda x: $(type.str)(x) - -$(win).addWidget(Qt.QLabel($label+": ")) -self._$(id)_label = Qt.QLabel(str(self._$(id)_formatter(self.$id))) -self._$(id)_tool_bar.addWidget(self._$(id)_label) -$(gui_hint()($win)) - </make> - - <callback>self.set_$(id)(self._$(id)_formatter($value))</callback> - <callback>Qt.QMetaObject.invokeMethod(self._$(id)_label, "setText", Qt.Q_ARG("QString", $id))</callback> - - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> - </param> - - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - - <param> - <name>Formatter</name> - <key>formatter</key> - <value>None</value> - <type>raw</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <doc> -This block creates a variable with a label widget for text. \ -Leave the label blank to use the variable id as the label. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_number_sink.block.yml b/gr-qtgui/grc/qtgui_number_sink.block.yml new file mode 100644 index 0000000000..05adc13d3c --- /dev/null +++ b/gr-qtgui/grc/qtgui_number_sink.block.yml @@ -0,0 +1,283 @@ +id: qtgui_number_sink +label: QT GUI Number Sink + +parameters: +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: type + label: Input Type + category: General + dtype: enum + options: [float, int, short, byte] + option_attributes: + size: [gr.sizeof_float, gr.sizeof_int, gr.sizeof_short, gr.sizeof_char] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: avg + label: Average + category: General + dtype: float + default: '0' +- id: graph_type + label: Graph Type + category: General + dtype: enum + options: [qtgui.NUM_GRAPH_HORIZ, qtgui.NUM_GRAPH_VERT, qtgui.NUM_GRAPH_NONE] + option_labels: [Horizontal, Vertical, None] +- id: nconnections + label: Number of Inputs + category: General + dtype: int + default: '1' + hide: part +- id: min + label: Min + dtype: float + default: '-1' + hide: part +- id: max + label: Max + dtype: float + default: '1' + hide: part +- id: update_time + label: Update Period + category: General + dtype: float + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + category: General + dtype: gui_hint + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: unit1 + label: Line 1 Unit + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['("black", "black")', '("blue", "red")', '("black", "white")', '("white", + "black")', '("black", "red")'] + option_labels: [Black, Blue-Red, White Hot, Black Hot, Black-Red] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: factor1 + label: Line 1 Factor + category: Config + dtype: float + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: unit2 + label: Line 2 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: factor2 + label: Line 2 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: unit3 + label: Line 3 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: factor3 + label: Line 3 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: unit4 + label: Line 4 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: factor4 + label: Line 4 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: unit5 + label: Line 5 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: factor5 + label: Line 5 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: unit6 + label: Line 6 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: factor6 + label: Line 6 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: unit7 + label: Line 7 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: factor7 + label: Line 7 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: unit8 + label: Line 8 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: factor8 + label: Line 8 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: unit9 + label: Line 9 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: factor9 + label: Line 9 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: unit10 + label: Line 10 Unit + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: factor10 + label: Line 10 Factor + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type } + multiplicity: ${ nconnections } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_update_time(${update_time}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.number_sink( + ${type.size}, + ${avg}, + ${graph_type}, + ${nconnections} + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_title(${name}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + units = [${unit1}, ${unit2}, ${unit3}, ${unit4}, ${unit5}, + ${unit6}, ${unit7}, ${unit8}, ${unit9}, ${unit10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + factor = [${factor1}, ${factor2}, ${factor3}, ${factor4}, ${factor5}, + ${factor6}, ${factor7}, ${factor8}, ${factor9}, ${factor10}] + + for i in range(${nconnections}): + self.${id}.set_min(i, ${min}) + self.${id}.set_max(i, ${max}) + self.${id}.set_color(i, colors[i][0], colors[i][1]) + if len(labels[i]) == 0: + self.${id}.set_label(i, "Data {0}".format(i)) + else: + self.${id}.set_label(i, labels[i]) + self.${id}.set_unit(i, units[i]) + self.${id}.set_factor(i, factor[i]) + + self.${id}.enable_autoscale(${autoscale}) + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_number_sink.xml b/gr-qtgui/grc/qtgui_number_sink.xml deleted file mode 100644 index 06837493c3..0000000000 --- a/gr-qtgui/grc/qtgui_number_sink.xml +++ /dev/null @@ -1,496 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Number Sink -################################################### - --> -<block> - <name>QT GUI Number Sink</name> - <key>qtgui_number_sink</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.number_sink( - $type.size, - $avg, - $graph_type, - $nconnections -) -self.$(id).set_update_time($update_time) -self.$(id).set_title($name) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -units = [$unit1, $unit2, $unit3, $unit4, $unit5, - $unit6, $unit7, $unit8, $unit9, $unit10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -factor = [$factor1, $factor2, $factor3, $factor4, $factor5, - $factor6, $factor7, $factor8, $factor9, $factor10] -for i in xrange($nconnections): - self.$(id).set_min(i, $min) - self.$(id).set_max(i, $max) - self.$(id).set_color(i, colors[i][0], colors[i][1]) - if len(labels[i]) == 0: - self.$(id).set_label(i, "Data {0}".format(i)) - else: - self.$(id).set_label(i, labels[i]) - self.$(id).set_unit(i, units[i]) - self.$(id).set_factor(i, factor[i]) - -self.$(id).enable_autoscale($autoscale) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_update_time($update_time)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - <tab>General</tab> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Average</name> - <key>avg</key> - <value>0</value> - <type>float</type> - <tab>General</tab> - </param> - - <param> - <name>Graph Type</name> - <key>graph_type</key> - <type>enum</type> - <option> - <name>Horizontal</name> - <key>qtgui.NUM_GRAPH_HORIZ</key> - </option> - <option> - <name>Vertical</name> - <key>qtgui.NUM_GRAPH_VERT</key> - </option> - <option> - <name>None</name> - <key>qtgui.NUM_GRAPH_NONE</key> - </option> - <tab>General</tab> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>part</hide> - <tab>General</tab> - </param> - - <param> - <name>Min</name> - <key>min</key> - <value>-1</value> - <type>float</type> - <hide>part</hide> - </param> - <param> - <name>Max</name> - <key>max</key> - <value>1</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>float</type> - <hide>part</hide> - <tab>General</tab> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - <tab>General</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Unit</name> - <key>unit1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Black</name> - <key>("black", "black")</key> - </option> - <option> - <name>Blue-Red</name> - <key>("blue", "red")</key> - </option> - <option> - <name>White Hot</name> - <key>("black", "white")</key> - </option> - <option> - <name>Black Hot</name> - <key>("white", "black")</key> - </option> - <option> - <name>Black-Red</name> - <key>("black", "red")</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Factor</name> - <key>factor1</key> - <value>1</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 2 Unit</name> - <key>unit2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 2 Factor</name> - <key>factor2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 3 Unit</name> - <key>unit3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 3 Factor</name> - <key>factor3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 4 Unit</name> - <key>unit4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 4 Factor</name> - <key>factor4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 5 Unit</name> - <key>unit5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 5 Factor</name> - <key>factor5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 6 Unit</name> - <key>unit6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 6 Factor</name> - <key>factor6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 7 Unit</name> - <key>unit7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 7 Factor</name> - <key>factor7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 8 Unit</name> - <key>unit8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 8 Factor</name> - <key>factor8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 9 Unit</name> - <key>unit9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 9 Factor</name> - <key>factor9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>unit1</base_key> - <name>Line 10 Unit</name> - <key>unit10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>factor1</base_key> - <name>Line 10 Factor</name> - <key>factor10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type</type> - <nports>$nconnections</nports> - </sink> - <doc> - The GUI hint can be used to position the widget within the application. \ - The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ - Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_push_button.block.yml b/gr-qtgui/grc/qtgui_push_button.block.yml new file mode 100644 index 0000000000..20e4593404 --- /dev/null +++ b/gr-qtgui/grc/qtgui_push_button.block.yml @@ -0,0 +1,60 @@ +id: variable_qtgui_push_button +label: QT GUI Push Button + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: type + label: Type + dtype: enum + default: int + options: [real, int, string, bool, raw] + option_labels: [Float, Integer, String, Boolean, Any] + option_attributes: + conv: [float, int, str, bool, eval] + hide: part +- id: value + label: Default Value + dtype: ${ type } + default: '0' +- id: pressed + label: Pressed + dtype: ${ type } + default: '1' +- id: released + label: Released + dtype: ${ type } + default: '0' +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +templates: + imports: from PyQt5 import Qt + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + make: |- + <% + win = '_%s_push_button'%id + if not label: + label = '"%s"'%id + %>\ + ${win} = Qt.QPushButton(${label}) + self._${id}_choices = {'Pressed': ${pressed}, 'Released': ${released}} + ${win}.pressed.connect(lambda: self.set_${id}(self._${id}_choices['Pressed'])) + ${win}.released.connect(lambda: self.set_${id}(self._${id}_choices['Released'])) + ${gui_hint() % win} + +documentation: |- + This block creates a variable push button. Leave the label blank to use the variable id as the label. + + A push button selects between two values of similar type. The variable will take on one value or the other depending on whether the button is pressed or released. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_push_button.xml b/gr-qtgui/grc/qtgui_push_button.xml deleted file mode 100644 index 49c2e9d6f0..0000000000 --- a/gr-qtgui/grc/qtgui_push_button.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Push Button: -## a gui push button form -################################################### - --> -<block> - <name>QT GUI Push Button</name> - <key>variable_qtgui_push_button</key> - <import>from PyQt5 import Qt</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = '_%s_push_button'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$win = Qt.QPushButton($label) -self._$(id)_choices = {'Pressed': $pressed, 'Released': $released} -$(win).pressed.connect(lambda: self.set_$(id)(self._$(id)_choices['Pressed'])) -$(win).released.connect(lambda: self.set_$(id)(self._$(id)_choices['Released'])) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - <param> - <name>Type</name> - <key>type</key> - <value>int</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>real</key><opt>conv:float</opt></option> - <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> - <option><name>String</name><key>string</key><opt>conv:str</opt></option> - <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> - <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> - </param> - <param> - <name>Default Value</name> - <key>value</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>Pressed</name> - <key>pressed</key> - <value>1</value> - <type>$type</type> - </param> - <param> - <name>Released</name> - <key>released</key> - <value>0</value> - <type>$type</type> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a variable push button. \ -Leave the label blank to use the variable id as the label. - -A push button selects between two values of similar type. \ -The variable will take on one value or the other depending \ -on whether the button is pressed or released. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_range.block.yml b/gr-qtgui/grc/qtgui_range.block.yml new file mode 100644 index 0000000000..a4aaa5925c --- /dev/null +++ b/gr-qtgui/grc/qtgui_range.block.yml @@ -0,0 +1,86 @@ +id: variable_qtgui_range +label: QT GUI Range + +parameters: +- id: label + label: Label + dtype: string + hide: ${ ('none' if label else 'part') } +- id: rangeType + label: Type + dtype: enum + default: '"float"' + options: [float, int] + option_attributes: + type: [float, int] + hide: part +- id: value + label: Default Value + dtype: ${ rangeType.type } + default: '50' +- id: start + label: Start + dtype: ${ rangeType.type } + default: '0' +- id: stop + label: Stop + dtype: ${ rangeType.type } + default: '100' +- id: step + label: Step + dtype: ${ rangeType.type } + default: '1' +- id: widget + label: Widget + dtype: enum + default: counter_slider + options: [counter_slider, counter, slider, dial] + option_labels: [Counter + Slider, Counter, Slider, Knob] + hide: part +- id: orient + label: Orientation + dtype: enum + default: Qt.Horizontal + options: [Qt.Horizontal, Qt.Vertical] + option_labels: [Horizontal, Vertical] + option_attributes: + minfcn: [setMinimumWidth, setMinimumHeight] + scalepos: [BottomScale, LeftScale] + hide: ${ ('part' if widget == "slider" else 'all') } +- id: min_len + label: Minimum Length + dtype: int + default: '200' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +value: ${ value } + +asserts: +- ${start <= value <= stop} +- ${start <= stop} + +templates: + imports: from gnuradio.qtgui import Range, RangeWidget + var_make: self.${id} = ${id} = ${value} + callbacks: + - self.set_${id}(${value}) + make: |- + <% + win = 'self._%s_win'%id + range = 'self._%s_range'%id + if not label: + label = '"%s"'%id + %>\ + ${range} = Range(${start}, ${stop}, ${step}, ${value}, ${min_len}) + ${win} = RangeWidget(${range}, self.set_${id}, ${label}, "${widget}", ${rangeType}) + ${gui_hint() % win} + +documentation: |- + This block creates a variable with a slider. Leave the label blank to use the variable id as the label. The value must be a real number. The value must be between the start and the stop. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml deleted file mode 100644 index 71b614cc5e..0000000000 --- a/gr-qtgui/grc/qtgui_range.xml +++ /dev/null @@ -1,131 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Range: -## ranged widgets like a slider or a knob -################################################### - --> -<block> - <name>QT GUI Range</name> - <key>variable_qtgui_range</key> - <import>from gnuradio.qtgui import Range, RangeWidget</import> - <var_make>self.$(id) = $(id) = $value</var_make> - <make>#set $win = 'self._%s_win'%$id - #set $range = 'self._%s_range'%$id -#if not $label() - #set $label = '"%s"'%$id -#end if -$(range) = Range($start, $stop, $step, $value, $min_len) -$(win) = RangeWidget($range, self.set_$(id), $label, "$widget", $rangeType) -$(gui_hint()($win))</make> - <callback>self.set_$(id)($value)</callback> - - <param> - <name>Label</name> - <key>label</key> - <value></value> - <type>string</type> - <hide>#if $label() then 'none' else 'part'#</hide> - </param> - - <param> - <name>Type</name> - <key>rangeType</key> - <value>"float"</value> - <type>enum</type> - <hide>part</hide> - <option><name>Float</name><key>float</key><opt>type:float</opt></option> - <option><name>Int</name><key>int</key><opt>type:int</opt></option> - </param> - - <param> - <name>Default Value</name> - <key>value</key> - <value>50</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Start</name> - <key>start</key> - <value>0</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Stop</name> - <key>stop</key> - <value>100</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Step</name> - <key>step</key> - <value>1</value> - <type>$rangeType.type</type> - </param> - - <param> - <name>Widget</name> - <key>widget</key> - <value>counter_slider</value> - <type>enum</type> - <hide>part</hide> - <option><name>Counter + Slider</name><key>counter_slider</key></option> - <option><name>Counter</name><key>counter</key></option> - <option><name>Slider</name><key>slider</key></option> - <option><name>Knob</name><key>dial</key></option> - </param> - - <param> - <name>Orientation</name> - <key>orient</key> - <value>Qt.Horizontal</value> - <type>enum</type> - <hide>#if $widget() == "slider" then 'part' else 'all'#</hide> - <option> - <name>Horizontal</name> - <key>Qt.Horizontal</key> - <opt>scalepos:BottomScale</opt> - <opt>minfcn:setMinimumWidth</opt> - </option> - <option> - <name>Vertical</name> - <key>Qt.Vertical</key> - <opt>scalepos:LeftScale</opt> - <opt>minfcn:setMinimumHeight</opt> - </option> - </param> - - <param> - <name>Minimum Length</name> - <key>min_len</key> - <value>200</value> - <type>int</type> - <hide>part</hide> - </param> - <!-- from min_len <hide>#if $widget().split('_')[0] in ("slider", "counter") then 'part' else 'all'#</hide>--> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <check>$start <= $value <= $stop</check> - <check>$start < $stop</check> - - <doc> - This block creates a variable with a slider. \ - Leave the label blank to use the variable id as the label. \ - The value must be a real number. \ - The value must be between the start and the stop. - - The GUI hint can be used to position the widget within the application. \ - The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ - Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_sink_x.block.yml b/gr-qtgui/grc/qtgui_sink_x.block.yml new file mode 100644 index 0000000000..30194a7a57 --- /dev/null +++ b/gr-qtgui/grc/qtgui_sink_x.block.yml @@ -0,0 +1,148 @@ +id: qtgui_sink_x +label: QT GUI Sink +flags: has_python + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float] + option_attributes: + fcn: [sink_c, sink_f] + hide: part +- id: name + label: Name + dtype: string + default: '""' +- id: fftsize + label: FFT Size + dtype: int + default: '1024' +- id: wintype + label: Window Type + dtype: int + default: firdes.WIN_BLACKMAN_hARRIS + options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN, + firdes.WIN_RECTANGULAR, firdes.WIN_KAISER] + option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser] + hide: part +- id: fc + label: Center Frequency (Hz) + dtype: real + default: '0' +- id: bw + label: Bandwidth (Hz) + dtype: real + default: samp_rate +- id: rate + label: Update Rate + dtype: real + default: '10' +- id: showrf + label: Show RF Freq + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: plotfreq + label: Plot Frequency + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: plotwaterfall + label: Plot Waterfall + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: plottime + label: Plot Time + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: plotconst + label: Plot Const + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ['On', 'Off'] + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: freqchangevar + label: Clicked freq variable + dtype: raw + default: None + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part + +inputs: +- domain: stream + dtype: ${ type } + multiplicity: ${ num_inputs } +- domain: message + id: freq + optional: true + hide: ${ showports } + +outputs: +- domain: message + id: freq + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_frequency_range(${fc}, ${bw}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${fftsize}, #fftsize + ${wintype}, #wintype + ${fc}, #fc + ${bw}, #bw + ${name}, #name + ${plotfreq}, #plotfreq + ${plotwaterfall}, #plotwaterfall + ${plottime}, #plottime + ${plotconst} #plotconst + ) + self.${id}.set_update_time(1.0/${rate}) + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + + self.${id}.enable_rf_freq($showrf) + + % if freqchangevar is not None: + def ${id}_callback(p, num): + if num == 1 or num == 2: + self.set_${freqchangevar}(p.x()) + + Qt.QObject.connect(self._${id}_win, Qt.SIGNAL("plotPointSelected(QPointF, int)"), ${id}_callback) + % endif + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml deleted file mode 100644 index a9bc469cd2..0000000000 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ /dev/null @@ -1,232 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Sink</name> - <key>qtgui_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $fftsize, \#fftsize - $wintype, \#wintype - $fc, \#fc - $bw, \#bw - $name, \#name - $plotfreq, \#plotfreq - $plotwaterfall, \#plotwaterfall - $plottime, \#plottime - $plotconst, \#plotconst -) -self.$(id).set_update_time(1.0/$rate) -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win)) - -self.$(id).enable_rf_freq($showrf) - -#if $freqchangevar() is not None -def $(id)_callback(p, num): - if num == 1 or num == 2: self.set_$(freqchangevar)(p.x()) - -Qt.QObject.connect(self._$(id)_win, Qt.SIGNAL("plotPointSelected(QPointF, int)"), $(id)_callback ) -#end if - - </make> - <callback>set_frequency_range($fc, $bw)</callback> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option><name>Complex</name><key>complex</key><opt>fcn:sink_c</opt></option> - <option><name>Float</name><key>float</key><opt>fcn:sink_f</opt></option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>FFT Size</name> - <key>fftsize</key> - <value>1024</value> - <type>int</type> - </param> - - <param> - <name>Window Type</name> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - <type>int</type> - <hide>part</hide> - <option> - <name>Blackman-harris</name> - <key>firdes.WIN_BLACKMAN_hARRIS</key> - </option> - <option> - <name>Hamming</name> - <key>firdes.WIN_HAMMING</key> - </option> - <option> - <name>Hann</name> - <key>firdes.WIN_HANN</key> - </option> - <option> - <name>Blackman</name> - <key>firdes.WIN_BLACKMAN</key> - </option> - <option> - <name>Rectangular</name> - <key>firdes.WIN_RECTANGULAR</key> - </option> - <option> - <name>Kaiser</name> - <key>firdes.WIN_KAISER</key> - </option> - </param> - - <param> - <name>Center Frequency (Hz)</name> - <key>fc</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Bandwidth (Hz)</name> - <key>bw</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Update Rate</name> - <key>rate</key> - <value>10</value> - <type>real</type> - </param> - - <param> - <name>Show RF Freq</name> - <key>showrf</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Plot Frequency</name> - <key>plotfreq</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>Plot Waterfall</name> - <key>plotwaterfall</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>Plot Time</name> - <key>plottime</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>Plot Const</name> - <key>plotconst</key> - <value>True</value> - <type>bool</type> - <hide>part</hide> - <option><name>On</name><key>True</key></option> - <option><name>Off</name><key>False</key></option> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Clicked freq variable</name> - <key>freqchangevar</key> - <value>None</value> - <type>raw</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - <sink> - <name>in</name> - <type>$type</type> - <nports>$num_inputs</nports> - </sink> - - <sink> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </sink> - - <source> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_tab_widget.block.yml b/gr-qtgui/grc/qtgui_tab_widget.block.yml new file mode 100644 index 0000000000..12a902eac2 --- /dev/null +++ b/gr-qtgui/grc/qtgui_tab_widget.block.yml @@ -0,0 +1,141 @@ +id: qtgui_tab_widget +label: QT GUI Tab Widget + +parameters: +- id: num_tabs + label: Num Tabs + dtype: enum + default: '1' + options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', + '14', '15', '16', '17', '18', '19', '20'] +- id: label0 + label: Label 0 + dtype: string + default: Tab 0 + hide: ${ ('none' if int(num_tabs) > 0 else 'all') } +- id: label1 + label: Label 1 + dtype: string + default: Tab 1 + hide: ${ ('none' if int(num_tabs) > 1 else 'all') } +- id: label2 + label: Label 2 + dtype: string + default: Tab 2 + hide: ${ ('none' if int(num_tabs) > 2 else 'all') } +- id: label3 + label: Label 3 + dtype: string + default: Tab 3 + hide: ${ ('none' if int(num_tabs) > 3 else 'all') } +- id: label4 + label: Label 4 + dtype: string + default: Tab 4 + hide: ${ ('none' if int(num_tabs) > 4 else 'all') } +- id: label5 + label: Label 5 + dtype: string + default: Tab 5 + hide: ${ ('none' if int(num_tabs) > 5 else 'all') } +- id: label6 + label: Label 6 + dtype: string + default: Tab 6 + hide: ${ ('none' if int(num_tabs) > 6 else 'all') } +- id: label7 + label: Label 7 + dtype: string + default: Tab 7 + hide: ${ ('none' if int(num_tabs) > 7 else 'all') } +- id: label8 + label: Label 8 + dtype: string + default: Tab 8 + hide: ${ ('none' if int(num_tabs) > 8 else 'all') } +- id: label9 + label: Label 9 + dtype: string + default: Tab 9 + hide: ${ ('none' if int(num_tabs) > 9 else 'all') } +- id: label10 + label: Label 10 + dtype: string + default: Tab 10 + hide: ${ ('none' if int(num_tabs) > 10 else 'all') } +- id: label11 + label: Label 11 + dtype: string + default: Tab 11 + hide: ${ ('none' if int(num_tabs) > 11 else 'all') } +- id: label12 + label: Label 12 + dtype: string + default: Tab 12 + hide: ${ ('none' if int(num_tabs) > 12 else 'all') } +- id: label13 + label: Label 13 + dtype: string + default: Tab 13 + hide: ${ ('none' if int(num_tabs) > 13 else 'all') } +- id: label14 + label: Label 14 + dtype: string + default: Tab 14 + hide: ${ ('none' if int(num_tabs) > 14 else 'all') } +- id: label15 + label: Label 15 + dtype: string + default: Tab 15 + hide: ${ ('none' if int(num_tabs) > 15 else 'all') } +- id: label16 + label: Label 16 + dtype: string + default: Tab 16 + hide: ${ ('none' if int(num_tabs) > 16 else 'all') } +- id: label17 + label: Label 17 + dtype: string + default: Tab 17 + hide: ${ ('none' if int(num_tabs) > 17 else 'all') } +- id: label18 + label: Label 18 + dtype: string + default: Tab 18 + hide: ${ ('none' if int(num_tabs) > 18 else 'all') } +- id: label19 + label: Label 19 + dtype: string + default: Tab 19 + hide: ${ ('none' if int(num_tabs) > 19 else 'all') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part + +templates: + imports: from PyQt5 import Qt + make: |- + <% + win = 'self._%s_win'%id + all_labels = [label0, label1, label2, label3, label4, + label5, label6, label7, label8, label9, + label10, label11, label12, label13, label14, + label15, label16, label17, label18, label19][:int(num_tabs())] + %>\ + Qt.QTabWidget() + % for i, label in enumrate(all_labels): + self.${id}_widget_${i} = Qt.QWidget() + self.${id}_layout_${i} = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.${id}_widget_${i}) + self.${id}_grid_layout_${i} = Qt.QGridLayout() + self.${id}_layout_${i}.addLayout(self.${id}_grid_layout_${i}) + ${win}.addTab(self.${id}_widget_${i}, ${label}) + % endfor + ${gui_hint() % win} + +documentation: |- + This block creates a tabbed widget to organize other widgets. The ID of this block can be used as the tab_id in the GUI hints of other widgets. + + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml deleted file mode 100644 index 805542cc8b..0000000000 --- a/gr-qtgui/grc/qtgui_tab_widget.xml +++ /dev/null @@ -1,206 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##WX GUI Notebook -################################################### - --> -<block> - <name>QT GUI Tab Widget</name> - <key>qtgui_tab_widget</key> - <import>from PyQt5 import Qt</import> - <make>#set $win = 'self.%s'%$id -Qt.QTabWidget() -#set $all_labels = [$label0, $label1, $label2, $label3, $label4, - $label5, $label6, $label7, $label8, $label9, - $label10, $label11, $label12, $label13, $label14, - $label15, $label16, $label17, $label18, $label19][:int($num_tabs())] -#for i, label in enumerate($all_labels) -self.$(id)_widget_$(i) = Qt.QWidget() -self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) -self.$(id)_grid_layout_$(i) = Qt.QGridLayout() -self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) -$(win).addTab(self.$(id)_widget_$(i), $label) -#end for -$(gui_hint()($win))</make> - <param> - <name>Num Tabs</name> - <key>num_tabs</key> - <value>1</value> - <type>enum</type> - <option><name>1</name><key>1</key></option> - <option><name>2</name><key>2</key></option> - <option><name>3</name><key>3</key></option> - <option><name>4</name><key>4</key></option> - <option><name>5</name><key>5</key></option> - <option><name>6</name><key>6</key></option> - <option><name>7</name><key>7</key></option> - <option><name>8</name><key>8</key></option> - <option><name>9</name><key>9</key></option> - <option><name>10</name><key>10</key></option> - <option><name>11</name><key>11</key></option> - <option><name>12</name><key>12</key></option> - <option><name>13</name><key>13</key></option> - <option><name>14</name><key>14</key></option> - <option><name>15</name><key>15</key></option> - <option><name>16</name><key>16</key></option> - <option><name>17</name><key>17</key></option> - <option><name>18</name><key>18</key></option> - <option><name>19</name><key>19</key></option> - <option><name>20</name><key>20</key></option> - </param> - <param> - <name>Label 0</name> - <key>label0</key> - <value>Tab 0</value> - <type>string</type> - <hide>#if int($num_tabs()) > 0 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 1</name> - <key>label1</key> - <value>Tab 1</value> - <type>string</type> - <hide>#if int($num_tabs()) > 1 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 2</name> - <key>label2</key> - <value>Tab 2</value> - <type>string</type> - <hide>#if int($num_tabs()) > 2 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 3</name> - <key>label3</key> - <value>Tab 3</value> - <type>string</type> - <hide>#if int($num_tabs()) > 3 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 4</name> - <key>label4</key> - <value>Tab 4</value> - <type>string</type> - <hide>#if int($num_tabs()) > 4 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 5</name> - <key>label5</key> - <value>Tab 5</value> - <type>string</type> - <hide>#if int($num_tabs()) > 5 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 6</name> - <key>label6</key> - <value>Tab 6</value> - <type>string</type> - <hide>#if int($num_tabs()) > 6 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 7</name> - <key>label7</key> - <value>Tab 7</value> - <type>string</type> - <hide>#if int($num_tabs()) > 7 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 8</name> - <key>label8</key> - <value>Tab 8</value> - <type>string</type> - <hide>#if int($num_tabs()) > 8 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 9</name> - <key>label9</key> - <value>Tab 9</value> - <type>string</type> - <hide>#if int($num_tabs()) > 9 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 10</name> - <key>label10</key> - <value>Tab 10</value> - <type>string</type> - <hide>#if int($num_tabs()) > 10 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 11</name> - <key>label11</key> - <value>Tab 11</value> - <type>string</type> - <hide>#if int($num_tabs()) > 11 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 12</name> - <key>label12</key> - <value>Tab 12</value> - <type>string</type> - <hide>#if int($num_tabs()) > 12 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 13</name> - <key>label13</key> - <value>Tab 13</value> - <type>string</type> - <hide>#if int($num_tabs()) > 13 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 14</name> - <key>label14</key> - <value>Tab 14</value> - <type>string</type> - <hide>#if int($num_tabs()) > 14 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 15</name> - <key>label15</key> - <value>Tab 15</value> - <type>string</type> - <hide>#if int($num_tabs()) > 15 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 16</name> - <key>label16</key> - <value>Tab 16</value> - <type>string</type> - <hide>#if int($num_tabs()) > 16 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 17</name> - <key>label17</key> - <value>Tab 17</value> - <type>string</type> - <hide>#if int($num_tabs()) > 17 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 18</name> - <key>label18</key> - <value>Tab 18</value> - <type>string</type> - <hide>#if int($num_tabs()) > 18 then 'none' else 'all'#</hide> - </param> - <param> - <name>Label 19</name> - <key>label19</key> - <value>Tab 19</value> - <type>string</type> - <hide>#if int($num_tabs()) > 19 then 'none' else 'all'#</hide> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - <doc> -This block creates a tabbed widget to organize other widgets. \ -The ID of this block can be used as the tab_id in the GUI hints of other widgets. - -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_time_raster_x.block.yml b/gr-qtgui/grc/qtgui_time_raster_x.block.yml new file mode 100644 index 0000000000..6ffaf1934a --- /dev/null +++ b/gr-qtgui/grc/qtgui_time_raster_x.block.yml @@ -0,0 +1,266 @@ +id: qtgui_time_raster_sink_x +label: QT GUI Time Raster Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [byte, float, msg_byte, msg_float] + option_labels: [Byte, Float, Byte Message, Float Message] + option_attributes: + fcn: [time_raster_sink_b, time_raster_sink_f, time_raster_sink_b, time_raster_sink_f] + t: [byte, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: samp_rate + label: Sample Rate + dtype: real + default: samp_rate +- id: nrows + label: Num. Rows + dtype: int + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: ncols + label: Num. Cols + dtype: int +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: zmin + label: Int. min + dtype: real + default: '-1' + hide: part +- id: zmax + label: Int. max + dtype: real + default: '1' + hide: part +- id: mult + label: Multiplier + dtype: real_vector + default: '[]' + hide: part +- id: offset + label: Offset + dtype: real_vector + default: '[]' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['0', '1', '2', '3', '5', '6'] + option_labels: [Multi Color, White Hot, Black Hot, Incandescent, Sunset, Cool] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_num_rows(${nrows}) + - set_num_cols(${ncols}) + - set_multiplier(${mult}) + - set_offset(${offset}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${samp_rate}, + ${nrows}, + ${ncols}, + ${mult}, + ${offset}, + ${name}, + ${0 if type.startswith('msg') else nconnections} + ) + + self.${id}.set_update_time(${update_time}) + self.${id}.set_intensity_range(${zmin}, ${zmax}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_color_map(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_time_raster_x.xml b/gr-qtgui/grc/qtgui_time_raster_x.xml deleted file mode 100644 index d458f67eb9..0000000000 --- a/gr-qtgui/grc/qtgui_time_raster_x.xml +++ /dev/null @@ -1,466 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Time Raster Sink</name> - <key>qtgui_time_raster_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $samp_rate, - $nrows, - $ncols, - $mult, - $offset, - $name, - #if $type.t == 'message' then 0 else $nconnections#, - ) - -self.$(id).set_update_time($update_time) -self.$(id).set_intensity_range($zmin, $zmax) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_color_map(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_num_rows($nrows)</callback> - <callback>set_num_cols($ncols)</callback> - <callback>set_multiplier($mult)</callback> - <callback>set_offset($offset)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:time_raster_sink_b</opt> - <opt>t:byte</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:time_raster_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Byte Message</name> - <key>msg_byte</key> - <opt>fcn:time_raster_sink_b</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:time_raster_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Num. Rows</name> - <key>nrows</key> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Num. Cols</name> - <key>ncols</key> - <type>int</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Int. min</name> - <key>zmin</key> - <value>-1</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Int. max</name> - <key>zmax</key> - <value>1</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>Multiplier</name> - <key>mult</key> - <value>[]</value> - <type>real_vector</type> - <hide>part</hide> - </param> - - <param> - <name>Offset</name> - <key>offset</key> - <value>[]</value> - <type>real_vector</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Multi Color</name> - <key>0</key> - </option> - <option> - <name>White Hot</name> - <key>1</key> - </option> - <option> - <name>Black Hot</name> - <key>2</key> - </option> - <option> - <name>Incandescent</name> - <key>3</key> - </option> - <option> - <name>Sunset</name> - <key>5</key> - </option> - <option> - <name>Cool</name> - <key>6</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_time_sink_x.block.yml b/gr-qtgui/grc/qtgui_time_sink_x.block.yml new file mode 100644 index 0000000000..e59bbca04d --- /dev/null +++ b/gr-qtgui/grc/qtgui_time_sink_x.block.yml @@ -0,0 +1,568 @@ +id: qtgui_time_sink_x +label: QT GUI Time Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float, msg_complex, msg_float] + option_labels: [Complex, Float, Complex Message, Float Message] + option_attributes: + fcn: [time_sink_c, time_sink_f, time_sink_c, time_sink_f] + t: [complex, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: ylabel + label: Y Axis Label + dtype: string + default: Amplitude + hide: part +- id: yunit + label: Y Axis Unit + dtype: string + default: '""' + hide: part +- id: size + label: Number of Points + dtype: int + default: '1024' + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: srate + label: Sample Rate + dtype: float + default: samp_rate +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] +- id: ymin + label: Y min + dtype: float + default: '-1' + hide: part +- id: ymax + label: Y max + dtype: float + default: '1' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: float + default: '0.10' + hide: part +- id: entags + label: Disp. Tags + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: tr_mode + label: Trigger Mode + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_FREE + options: [qtgui.TRIG_MODE_FREE, qtgui.TRIG_MODE_AUTO, qtgui.TRIG_MODE_NORM, qtgui.TRIG_MODE_TAG] + option_labels: [Free, Auto, Normal, Tag] + hide: part +- id: tr_slope + label: Trigger Slope + category: Trigger + dtype: enum + default: qtgui.TRIG_MODE_POS + options: [qtgui.TRIG_SLOPE_POS, qtgui.TRIG_SLOPE_NEG] + option_labels: [Positive, Negative] + hide: part +- id: tr_level + label: Trigger Level + category: Trigger + dtype: float + default: '0.0' + hide: part +- id: tr_delay + label: Trigger Delay + category: Trigger + dtype: float + default: '0' + hide: part +- id: tr_chan + label: Trigger Channel + category: Trigger + dtype: int + default: '0' + hide: part +- id: tr_tag + label: Trigger Tag Key + category: Trigger + dtype: string + default: '""' + hide: part +- id: ctrlpanel + label: Control Panel + category: Config + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: stemplot + label: Stem Plot + category: Config + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"Dark Blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: style1 + label: Line 1 Style + category: Config + dtype: enum + options: ['1', '2', '3', '4', '5', '0'] + option_labels: [Solid, Dash, Dots, Dash-Dot, Dash-Dot-Dot, None] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: marker1 + label: Line 1 Marker + category: Config + dtype: enum + options: ['-1', '0', '1', '2', '3', '4', '6', '7', '8', '9'] + option_labels: [None, Circle, Rectangle, Diamond, Triangle, Down Triangle, Left + Triangle, Right Triangle, Cross, X-Cross] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: style2 + label: Line 2 Style + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: marker2 + label: Line 2 Marker + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if (int(nconnections) >= 2 or (type == "complex" and int(nconnections) + >= 1) or (type == "msg_complex")) and (not type == "msg_float") else 'all') + } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: style3 + label: Line 3 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: marker3 + label: Line 3 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 3 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: style4 + label: Line 4 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: marker4 + label: Line 4 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 4 or (type == "complex" and int(nconnections) + >= 2)) and not type.t == "message") else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: style5 + label: Line 5 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: marker5 + label: Line 5 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 5 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: style6 + label: Line 6 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: marker6 + label: Line 6 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 6 or (type == "complex" and int(nconnections) + >= 3)) and not type.t == "message") else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: style7 + label: Line 7 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: marker7 + label: Line 7 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 7 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: style8 + label: Line 8 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: marker8 + label: Line 8 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 8 or (type == "complex" and int(nconnections) + >= 4)) and not type.t == "message") else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: style9 + label: Line 9 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: marker9 + label: Line 9 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 9 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: style10 + label: Line 10 Style + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: marker10 + label: Line 10 Marker + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if ((int(nconnections) >= 10 or (type == "complex" and int(nconnections) + >= 5)) and not type.t == "message") else 'all') } + +asserts: +- ${nconnections <= (5 if type == 'complex' else 10)} + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_time_domain_axis(${min}, ${max}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - set_y_axis(${ymin}, ${ymax}) + - set_samp_rate(${srate}) + - self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_delay}, + ${tr_chan}, ${tr_tag}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${size}, #size + ${srate}, #samp_rate + ${name}, #name + ${0 if type.startswith('msg') else nconnections} #number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + + self.${id}.set_y_label(${ylabel}, ${yunit}) + + self.${id}.enable_tags(-1, ${entags}) + self.${id}.set_trigger_mode(${tr_mode}, ${tr_slope}, ${tr_level}, ${tr_delay}, ${tr_chan}, ${tr_tag}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + self.${id}.enable_control_panel(${ctrlpanel}) + self.${id}.enable_stem_plot(${stemplot}) + + if not ${legend}: + self.${id}.disable_legend() + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + styles = [${style1}, ${style2}, ${style3}, ${style4}, ${style5}, + ${style6}, ${style7}, ${style8}, ${style9}, ${style10}] + markers = [${marker1}, ${marker2}, ${marker3}, ${marker4}, ${marker5}, + ${marker6}, ${marker7}, ${marker8}, ${marker9}, ${marker10}] + + + % if type.endswith('complex'): + for i in range(${2 if type.startswith('msg') else 2*nconnections}): + if len(labels[i]) == 0: + if (i % 2 == 0): + self.${id}.set_line_label(i, "Re{{Data {0}}}".format(i/2)) + else: + self.${id}.set_line_label(i, "Im{{Data {0}}}".format(i/2)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id].set_line_width(i, widths[i]) + self.${id].set_line_color(i, colors[i]) + self.${id].set_line_style(i, styles[i]) + self.${id].set_line_marker(i, markers[i]) + self.${id].set_line_alpha(i, alphas[i]) + % endif + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_time_sink_x.xml b/gr-qtgui/grc/qtgui_time_sink_x.xml deleted file mode 100644 index 7358c78856..0000000000 --- a/gr-qtgui/grc/qtgui_time_sink_x.xml +++ /dev/null @@ -1,966 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Time Sink</name> - <key>qtgui_time_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $size, \#size - $srate, \#samp_rate - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) - -self.$(id).set_y_label($ylabel, $yunit) - -self.$(id).enable_tags(-1, $entags) -self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_delay, $tr_chan, $tr_tag) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) -self.$(id).enable_control_panel($ctrlpanel) -self.$(id).enable_stem_plot($stemplot) - -if not $legend: - self.$(id).disable_legend() - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -styles = [$style1, $style2, $style3, $style4, $style5, - $style6, $style7, $style8, $style9, $style10] -markers = [$marker1, $marker2, $marker3, $marker4, $marker5, - $marker6, $marker7, $marker8, $marker9, $marker10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] - -#if ($type() == 'complex' or $type() == 'msg_complex') -for i in xrange(#if $type.t == 'message' then 2 else 2*$nconnections()#): - if len(labels[i]) == 0: - if(i % 2 == 0): - self.$(id).set_line_label(i, "Re{{Data {0}}}".format(i/2)) - else: - self.$(id).set_line_label(i, "Im{{Data {0}}}".format(i/2)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) -#else -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_style(i, styles[i]) - self.$(id).set_line_marker(i, markers[i]) - self.$(id).set_line_alpha(i, alphas[i]) -#end if - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_time_domain_axis($min, $max)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_y_axis($ymin, $ymax)</callback> - <callback>set_samp_rate($srate)</callback> - <callback>self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_delay, $tr_chan, $tr_tag)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Trigger</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:time_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:time_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:time_sink_c</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:time_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Y Axis Label</name> - <key>ylabel</key> - <value>Amplitude</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Y Axis Unit</name> - <key>yunit</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Points</name> - <key>size</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Sample Rate</name> - <key>srate</key> - <value>samp_rate</value> - <type>float</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-1</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Y max</name> - <key>ymax</key> - <value>1</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Disp. Tags</name> - <key>entags</key> - <value>True</value> - <type>enum</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - - <param> - <name>Trigger Mode</name> - <key>tr_mode</key> - <value>qtgui.TRIG_MODE_FREE</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Free</name> - <key>qtgui.TRIG_MODE_FREE</key> - </option> - <option> - <name>Auto</name> - <key>qtgui.TRIG_MODE_AUTO</key> - </option> - <option> - <name>Normal</name> - <key>qtgui.TRIG_MODE_NORM</key> - </option> - <option> - <name>Tag</name> - <key>qtgui.TRIG_MODE_TAG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Slope</name> - <key>tr_slope</key> - <value>qtgui.TRIG_MODE_POS</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Positive</name> - <key>qtgui.TRIG_SLOPE_POS</key> - </option> - <option> - <name>Negative</name> - <key>qtgui.TRIG_SLOPE_NEG</key> - </option> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Level</name> - <key>tr_level</key> - <value>0.0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Delay</name> - <key>tr_delay</key> - <value>0</value> - <type>float</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Channel</name> - <key>tr_chan</key> - <value>0</value> - <type>int</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - <param> - <name>Trigger Tag Key</name> - <key>tr_tag</key> - <value>""</value> - <type>string</type> - <hide>part</hide> - <tab>Trigger</tab> - </param> - - - - <!-- Begin Config Tab items --> - - <param> - <name>Control Panel</name> - <key>ctrlpanel</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Stem Plot</name> - <key>stemplot</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"Dark Blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Style</name> - <key>style1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Solid</name> - <key>1</key> - </option> - <option> - <name>Dash</name> - <key>2</key> - </option> - <option> - <name>Dots</name> - <key>3</key> - </option> - <option> - <name>Dash-Dot</name> - <key>4</key> - </option> - <option> - <name>Dash-Dot-Dot</name> - <key>5</key> - </option> - <option> - <name>None</name> - <key>0</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Marker</name> - <key>marker1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>None</name> - <key>-1</key> - </option> - <option> - <name>Circle</name> - <key>0</key> - </option> - <option> - <name>Rectangle</name> - <key>1</key> - </option> - <option> - <name>Diamond</name> - <key>2</key> - </option> - <option> - <name>Triangle</name> - <key>3</key> - </option> - <option> - <name>Down Triangle</name> - <key>4</key> - </option> - <option> - <name>Left Triangle</name> - <key>6</key> - </option> - <option> - <name>Right Triangle</name> - <key>7</key> - </option> - <option> - <name>Cross</name> - <key>8</key> - </option> - <option> - <name>X-Cross</name> - <key>9</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 2 Style</name> - <key>style2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 2 Marker</name> - <key>marker2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if (int($nconnections()) >= 2 or ($type() == "complex" and int($nconnections()) >= 1) or ($type() == "msg_complex")) and (not $type() == "msg_float") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 3 Style</name> - <key>style3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 3 Marker</name> - <key>marker3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if ((int($nconnections()) >= 3 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 4 Style</name> - <key>style4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 4 Marker</name> - <key>marker4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if ((int($nconnections()) >= 4 or ($type() == "complex" and int($nconnections()) >= 2)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 5 Style</name> - <key>style5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 5 Marker</name> - <key>marker5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if ((int($nconnections()) >= 5 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 6 Style</name> - <key>style6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 6 Marker</name> - <key>marker6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if ((int($nconnections()) >= 6 or ($type() == "complex" and int($nconnections()) >= 3)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 7 Style</name> - <key>style7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 7 Marker</name> - <key>marker7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if ((int($nconnections()) >= 7 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 8 Style</name> - <key>style8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 8 Marker</name> - <key>marker8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if ((int($nconnections()) >= 8 or ($type() == "complex" and int($nconnections()) >= 4)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 9 Style</name> - <key>style9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 9 Marker</name> - <key>marker9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if ((int($nconnections()) >= 9 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>style1</base_key> - <name>Line 10 Style</name> - <key>style10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>marker1</base_key> - <name>Line 10 Marker</name> - <key>marker10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide> - </param> - - <check>$nconnections <= #if $type() == "complex" then 5 else 10#</check> - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_vector_sink_f.block.yml b/gr-qtgui/grc/qtgui_vector_sink_f.block.yml new file mode 100644 index 0000000000..d2fb1a7d5d --- /dev/null +++ b/gr-qtgui/grc/qtgui_vector_sink_f.block.yml @@ -0,0 +1,352 @@ +id: qtgui_vector_sink_f +label: QT GUI Vector Sink + +parameters: +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: vlen + label: Vector Size + dtype: int + default: '1024' + hide: ${ 'part' if vlen == 1 else 'none' } +- id: x_start + label: X-Axis Start Value + dtype: real + default: '0' +- id: x_step + label: X-Axis Step Value + dtype: real + default: '1.0' +- id: x_axis_label + label: X-Axis Label + dtype: string + default: '"x-Axis"' + hide: ${ ('none' if (len(x_axis_label) > 0 and x_axis_label != "x-Axis") else + 'part') } +- id: y_axis_label + label: Y-Axis Label + dtype: string + default: '"y-Axis"' + hide: ${ ('none' if (len(y_axis_label) > 0 and y_axis_label != "y-Axis") else + 'part') } +- id: x_units + label: X-Axis Units + dtype: string + default: '""' + hide: '''part''' +- id: y_units + label: Y-Axis Units + dtype: string + default: '""' + hide: '''part''' +- id: ref_level + label: Ref Level + dtype: real + default: '0' +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: autoscale + label: Autoscale + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: average + label: Average + dtype: enum + default: 'False' + options: ['1.0', '0.2', '0.1', '0.05'] + option_labels: [None, Low, Medium, High] + hide: part +- id: ymin + label: Y min + dtype: real + default: '-140' + hide: part +- id: ymax + label: Y max + dtype: real + default: '10' + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: part +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: width1 + label: Line 1 Width + category: Config + dtype: int + default: '1' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['"blue"', '"red"', '"green"', '"black"', '"cyan"', '"magenta"', '"yellow"', + '"dark red"', '"dark green"', '"dark blue"'] + option_labels: [Blue, Red, Green, Black, Cyan, Magenta, Yellow, Dark Red, Dark + Green, Dark Blue] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: width2 + label: Line 2 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + default: '"red"' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: width3 + label: Line 3 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + default: '"green"' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: width4 + label: Line 4 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + default: '"black"' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: width5 + label: Line 5 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + default: '"cyan"' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: width6 + label: Line 6 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + default: '"magenta"' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: width7 + label: Line 7 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + default: '"yellow"' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: width8 + label: Line 8 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + default: '"dark red"' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: width9 + label: Line 9 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + default: '"dark green"' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: width10 + label: Line 10 Width + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + default: '"dark blue"' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: float + vlen: ${ vlen } + multiplicity: ${ nconnections } + +outputs: +- domain: message + id: xval + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + import sip + callbacks: + - set_update_time(${update_time}) + - set_title(${title}) + - set_color(${which}, ${color}) + - set_x_axis(${x_start}, ${x_step}) + - set_y_axis(${ymin}, ${ymax}) + - set_ref_level(${ref_level}) + - set_x_axis_units(${x_units}) + - set_y_axis_units(${y_units}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.vector_sink_f( + ${vlen}, + ${x_start}, + ${x_step}, + ${x_axis_label}, + ${y_axis_label}, + ${name}, + ${nconnections} # Number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.set_y_axis(${ymin}, ${ymax}) + self.${id}.enable_autoscale(${autoscale}) + self.${id}.enable_grid(${grid}) + self.${id}.set_x_axis_units(${x_units}) + self.${id}.set_y_axis_units(${y_units}) + self.${id}.set_ref_level(${ref_level}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + widths = [${width1}, ${width2}, ${width3}, ${width4}, ${width5}, + ${width6}, ${width7}, ${width8}, ${width9}, ${width10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_line_width(i, widths[i]) + self.${id}.set_line_color(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_vector_sink_f.xml b/gr-qtgui/grc/qtgui_vector_sink_f.xml deleted file mode 100644 index 0f456323bf..0000000000 --- a/gr-qtgui/grc/qtgui_vector_sink_f.xml +++ /dev/null @@ -1,603 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Vector Sink</name> - <key>qtgui_vector_sink_f</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.vector_sink_f( - $vlen, - $x_start, - $x_step, - $x_axis_label, - $y_axis_label, - $name, - $nconnections \# Number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).set_y_axis($ymin, $ymax) -self.$(id).enable_autoscale($autoscale) -self.$(id).enable_grid($grid) -self.$(id).set_x_axis_units($x_units) -self.$(id).set_y_axis_units($y_units) -self.$(id).set_ref_level($ref_level) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -widths = [$width1, $width2, $width3, $width4, $width5, - $width6, $width7, $width8, $width9, $width10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange($nconnections): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_line_width(i, widths[i]) - self.$(id).set_line_color(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_update_time($update_time)</callback> - <callback>set_title($title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_x_axis($x_start, $x_step)</callback> - <callback>set_y_axis($ymin, $ymax)</callback> - <callback>set_ref_level($ref_level)</callback> - <callback>set_x_axis_units($x_units)</callback> - <callback>set_y_axis_units($y_units)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>Vector Size</name> - <key>vlen</key> - <value>1024</value> - <type>int</type> - </param> - - <param> - <name>X-Axis Start Value</name> - <key>x_start</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>X-Axis Step Value</name> - <key>x_step</key> - <value>1.0</value> - <type>real</type> - </param> - - <param> - <name>X-Axis Label</name> - <key>x_axis_label</key> - <value>"x-Axis"</value> - <type>string</type> - <hide>#if (len($x_axis_label()) > 0 and $x_axis_label != "x-Axis") then 'none' else 'part'#</hide> - </param> - - <param> - <name>Y-Axis Label</name> - <key>y_axis_label</key> - <value>"y-Axis"</value> - <type>string</type> - <hide>#if (len($y_axis_label()) > 0 and $y_axis_label != "y-Axis") then 'none' else 'part'#</hide> - </param> - - <param> - <name>X-Axis Units</name> - <key>x_units</key> - <value>""</value> - <type>string</type> - <hide>'part'</hide> - </param> - - <param> - <name>Y-Axis Units</name> - <key>y_units</key> - <value>""</value> - <type>string</type> - <hide>'part'</hide> - </param> - - <param> - <name>Ref Level</name> - <key>ref_level</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Autoscale</name> - <key>autoscale</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Average</name> - <key>average</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>None</name> - <key>1.0</key> - </option> - <option> - <name>Low</name> - <key>0.2</key> - </option> - <option> - <name>Medium</name> - <key>0.1</key> - </option> - <option> - <name>High</name> - <key>0.05</key> - </option> - </param> - - <param> - <name>Y min</name> - <key>ymin</key> - <value>-140</value> - <type>real</type> - <hide>part</hide> - </param> - <param> - <name>Y max</name> - <key>ymax</key> - <value>10</value> - <type>real</type> - <hide>part</hide> - </param> - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>part</hide> - </param> - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Width</name> - <key>width1</key> - <value>1</value> - <type>int</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Blue</name> - <key>"blue"</key> - </option> - <option> - <name>Red</name> - <key>"red"</key> - </option> - <option> - <name>Green</name> - <key>"green"</key> - </option> - <option> - <name>Black</name> - <key>"black"</key> - </option> - <option> - <name>Cyan</name> - <key>"cyan"</key> - </option> - <option> - <name>Magenta</name> - <key>"magenta"</key> - </option> - <option> - <name>Yellow</name> - <key>"yellow"</key> - </option> - <option> - <name>Dark Red</name> - <key>"dark red"</key> - </option> - <option> - <name>Dark Green</name> - <key>"dark green"</key> - </option> - <option> - <name>Dark Blue</name> - <key>"dark blue"</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 2 Width</name> - <key>width2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <value>"red"</value> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 3 Width</name> - <key>width3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <value>"green"</value> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 4 Width</name> - <key>width4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <value>"black"</value> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 5 Width</name> - <key>width5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <value>"cyan"</value> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 6 Width</name> - <key>width6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <value>"magenta"</value> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 7 Width</name> - <key>width7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <value>"yellow"</value> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 8 Width</name> - <key>width8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <value>"dark red"</value> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 9 Width</name> - <key>width9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <value>"dark green"</value> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>width1</base_key> - <name>Line 10 Width</name> - <key>width10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <value>"dark blue"</value> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <sink> - <name>in</name> - <type>float</type> - <vlen>$vlen</vlen> - <nports>$nconnections</nports> - </sink> - - <source> - <name>xval</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml b/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml new file mode 100644 index 0000000000..45fc6c41fd --- /dev/null +++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.block.yml @@ -0,0 +1,303 @@ +id: qtgui_waterfall_sink_x +label: QT GUI Waterfall Sink + +parameters: +- id: type + label: Type + dtype: enum + default: complex + options: [complex, float, msg_complex, msg_float] + option_labels: [Complex, Float, Complex Message, Float Message] + option_attributes: + fcn: [waterfall_sink_c, waterfall_sink_f, waterfall_sink_c, waterfall_sink_f] + t: [complex, float, message, message] + hide: part +- id: name + label: Name + dtype: string + default: '""' + hide: ${ ('none' if len(name) > 0 else 'part') } +- id: fftsize + label: FFT Size + dtype: int + default: '1024' + hide: ${ ('all' if type.startswith('msg') else 'none') } +- id: freqhalf + label: Spectrum Width + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: [Full, Half] + hide: ${ ('part' if type == "float" or type == "msg_float" else 'all') } +- id: wintype + label: Window Type + dtype: int + default: firdes.WIN_BLACKMAN_hARRIS + options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN, + firdes.WIN_RECTANGULAR, firdes.WIN_KAISER, firdes.WIN_FLATTOP] + option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser, + Flat-top] + hide: part +- id: fc + label: Center Frequency (Hz) + dtype: real + default: '0' +- id: bw + label: Bandwidth (Hz) + dtype: real + default: samp_rate +- id: int_min + label: Intensity Min + dtype: float + default: '-140' + hide: part +- id: int_max + label: Intensity Max + dtype: float + default: '10' + hide: part +- id: grid + label: Grid + dtype: enum + default: 'False' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: nconnections + label: Number of Inputs + dtype: int + default: '1' + hide: ${ ('all' if type.startswith('msg') else 'part') } +- id: update_time + label: Update Period + dtype: real + default: '0.10' + hide: part +- id: gui_hint + label: GUI Hint + dtype: gui_hint + hide: part +- id: showports + label: Show Msg Ports + dtype: enum + default: 'True' + options: ['False', 'True'] + option_labels: ['Yes', 'No'] + hide: part +- id: legend + label: Legend + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: label1 + label: Line 1 Label + category: Config + dtype: string + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: axislabels + label: Axis Labels + category: Config + dtype: enum + default: 'True' + options: ['True', 'False'] + option_labels: ['Yes', 'No'] + hide: part +- id: color1 + label: Line 1 Color + category: Config + dtype: enum + options: ['0', '1', '2', '3', '5', '6'] + option_labels: [Multi Color, White Hot, Black Hot, Incandescent, Sunset, Cool] + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: alpha1 + label: Line 1 Alpha + category: Config + dtype: float + default: '1.0' + hide: ${ ('part' if int(nconnections) >= 1 else 'all') } +- id: label2 + label: Line 2 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: color2 + label: Line 2 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: alpha2 + label: Line 2 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 2 else 'all') } +- id: label3 + label: Line 3 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: color3 + label: Line 3 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: alpha3 + label: Line 3 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 3 else 'all') } +- id: label4 + label: Line 4 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: color4 + label: Line 4 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: alpha4 + label: Line 4 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 4 else 'all') } +- id: label5 + label: Line 5 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: color5 + label: Line 5 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: alpha5 + label: Line 5 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 5 else 'all') } +- id: label6 + label: Line 6 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: color6 + label: Line 6 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: alpha6 + label: Line 6 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 6 else 'all') } +- id: label7 + label: Line 7 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: color7 + label: Line 7 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: alpha7 + label: Line 7 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 7 else 'all') } +- id: label8 + label: Line 8 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: color8 + label: Line 8 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: alpha8 + label: Line 8 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 8 else 'all') } +- id: label9 + label: Line 9 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: color9 + label: Line 9 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: alpha9 + label: Line 9 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 9 else 'all') } +- id: label10 + label: Line 10 Label + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: color10 + label: Line 10 Color + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } +- id: alpha10 + label: Line 10 Alpha + dtype: '' + hide: ${ ('part' if int(nconnections) >= 10 else 'all') } + +inputs: +- domain: stream + dtype: ${ type.t } + multiplicity: ${ (0 if type.startswith('msg') else nconnections) } + optional: true +- domain: message + id: freq + optional: true + hide: ${ showports } + +outputs: +- domain: message + id: freq + optional: true + hide: ${ showports } + +templates: + imports: |- + from PyQt5 import Qt + from gnuradio import qtgui + from gnuradio.filter import firdes + import sip + callbacks: + - set_frequency_range(${fc}, ${bw}) + - set_update_time(${update_time}) + - set_title(${which}, ${title}) + - set_color(${which}, ${color}) + - set_intensity_range(${int_min}, ${int_max}) + make: |- + <% + win = 'self._%s_win'%id + %>\ + qtgui.${type.fcn}( + ${fftsize}, #size + ${wintype}, #wintype + ${fc}, #fc + ${bw}, #bw + ${name}, #name + ${ (0 if type.startswith('msg') else nconnections) } #number of inputs + ) + self.${id}.set_update_time(${update_time}) + self.${id}.enable_grid(${grid}) + self.${id}.enable_axis_labels(${axislabels}) + + if not ${legend}: + self.${id}.disable_legend() + + if "${type}" == "float" or "${type}" == "msg_float": + self.${id}.set_plot_pos_half(not ${freqhalf}) + + labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5}, + ${label6}, ${label7}, ${label8}, ${label9}, ${label10}] + colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5}, + ${color6}, ${color7}, ${color8}, ${color9}, ${color10}] + alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5}, + ${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}] + + for i in range(${1 if type.startswith('msg') else nconnections}): + if len(labels[i]) == 0: + self.${id}.set_line_label(i, "Data {0}".format(i)) + else: + self.${id}.set_line_label(i, labels[i]) + self.${id}.set_color_map(i, colors[i]) + self.${id}.set_line_alpha(i, alphas[i]) + + self.${id}.set_intensity_range(${int_min}, ${int_max}) + + ${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget) + ${gui_hint() % win} + +documentation: |- + The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional. + +file_format: 1 diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml deleted file mode 100644 index a684492246..0000000000 --- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml +++ /dev/null @@ -1,557 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##QT GUI Sink -################################################### - --> -<block> - <name>QT GUI Waterfall Sink</name> - <key>qtgui_waterfall_sink_x</key> - <import>from PyQt5 import Qt</import> - <import>from gnuradio import qtgui</import> - <import>from gnuradio.filter import firdes</import> - <import>import sip</import> - <make>#set $win = 'self._%s_win'%$id -qtgui.$(type.fcn)( - $fftsize, \#size - $wintype, \#wintype - $fc, \#fc - $bw, \#bw - $name, \#name - #if $type.t == 'message' then 0 else $nconnections# \#number of inputs -) -self.$(id).set_update_time($update_time) -self.$(id).enable_grid($grid) -self.$(id).enable_axis_labels($axislabels) - -if not $legend: - self.$(id).disable_legend() - -if "$type" == "float" or "$type" == "msg_float": - self.$(id).set_plot_pos_half(not $freqhalf) - -labels = [$label1, $label2, $label3, $label4, $label5, - $label6, $label7, $label8, $label9, $label10] -colors = [$color1, $color2, $color3, $color4, $color5, - $color6, $color7, $color8, $color9, $color10] -alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, - $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] -for i in xrange(#if $type.t == 'message' then 1 else $nconnections#): - if len(labels[i]) == 0: - self.$(id).set_line_label(i, "Data {0}".format(i)) - else: - self.$(id).set_line_label(i, labels[i]) - self.$(id).set_color_map(i, colors[i]) - self.$(id).set_line_alpha(i, alphas[i]) - -self.$(id).set_intensity_range($int_min, $int_max) - -self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) -$(gui_hint()($win))</make> - <callback>set_frequency_range($fc, $bw)</callback> - <callback>set_update_time($update_time)</callback> - <callback>set_title($which, $title)</callback> - <callback>set_color($which, $color)</callback> - <callback>set_intensity_range($int_min, $int_max)</callback> - - <param_tab_order> - <tab>General</tab> - <tab>Config</tab> - </param_tab_order> - - <param> - <name>Type</name> - <key>type</key> - <value>complex</value> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:waterfall_sink_c</opt> - <opt>t:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:waterfall_sink_f</opt> - <opt>t:float</opt> - </option> - <option> - <name>Complex Message</name> - <key>msg_complex</key> - <opt>fcn:waterfall_sink_c</opt> - <opt>t:message</opt> - </option> - <option> - <name>Float Message</name> - <key>msg_float</key> - <opt>fcn:waterfall_sink_f</opt> - <opt>t:message</opt> - </option> - </param> - - <param> - <name>Name</name> - <key>name</key> - <value>""</value> - <type>string</type> - <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> - </param> - - <param> - <name>FFT Size</name> - <key>fftsize</key> - <value>1024</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'none'#</hide> - </param> - - <param> - <name>Spectrum Width</name> - <key>freqhalf</key> - <value>True</value> - <type>enum</type> - <hide>#if $type() == "float" or $type() == "msg_float" then 'part' else 'all'#</hide> - <option> - <name>Full</name> - <key>True</key> - </option> - <option> - <name>Half</name> - <key>False</key> - </option> - </param> - - <param> - <name>Window Type</name> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - <type>int</type> - <hide>part</hide> - <option> - <name>Blackman-harris</name> - <key>firdes.WIN_BLACKMAN_hARRIS</key> - </option> - <option> - <name>Hamming</name> - <key>firdes.WIN_HAMMING</key> - </option> - <option> - <name>Hann</name> - <key>firdes.WIN_HANN</key> - </option> - <option> - <name>Blackman</name> - <key>firdes.WIN_BLACKMAN</key> - </option> - <option> - <name>Rectangular</name> - <key>firdes.WIN_RECTANGULAR</key> - </option> - <option> - <name>Kaiser</name> - <key>firdes.WIN_KAISER</key> - </option> - <option> - <name>Flat-top</name> - <key>firdes.WIN_FLATTOP</key> - </option> - </param> - - <param> - <name>Center Frequency (Hz)</name> - <key>fc</key> - <value>0</value> - <type>real</type> - </param> - - <param> - <name>Bandwidth (Hz)</name> - <key>bw</key> - <value>samp_rate</value> - <type>real</type> - </param> - - <param> - <name>Intensity Min</name> - <key>int_min</key> - <value>-140</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Intensity Max</name> - <key>int_max</key> - <value>10</value> - <type>float</type> - <hide>part</hide> - </param> - - <param> - <name>Grid</name> - <key>grid</key> - <value>False</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - - <param> - <name>Number of Inputs</name> - <key>nconnections</key> - <value>1</value> - <type>int</type> - <hide>#if $type.t == 'message' then 'all' else 'part'#</hide> - </param> - - <param> - <name>Update Period</name> - <key>update_time</key> - <value>0.10</value> - <type>real</type> - <hide>part</hide> - </param> - - <param> - <name>GUI Hint</name> - <key>gui_hint</key> - <value></value> - <type>gui_hint</type> - <hide>part</hide> - </param> - - <param> - <name>Show Msg Ports</name> - <key>showports</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>False</key> - </option> - <option> - <name>No</name> - <key>True</key> - </option> - </param> - - - <!-- Begin Config Tab items --> - <param> - <name>Legend</name> - <key>legend</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Label</name> - <key>label1</key> - <type>string</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - <param> - <name>Axis Labels</name> - <key>axislabels</key> - <value>True</value> - <type>enum</type> - <hide>part</hide> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Color</name> - <key>color1</key> - <type>enum</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <option> - <name>Multi Color</name> - <key>0</key> - </option> - <option> - <name>White Hot</name> - <key>1</key> - </option> - <option> - <name>Black Hot</name> - <key>2</key> - </option> - <option> - <name>Incandescent</name> - <key>3</key> - </option> - <option> - <name>Sunset</name> - <key>5</key> - </option> - <option> - <name>Cool</name> - <key>6</key> - </option> - <tab>Config</tab> - </param> - - <param> - <name>Line 1 Alpha</name> - <key>alpha1</key> - <value>1.0</value> - <type>float</type> - <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide> - <tab>Config</tab> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 2 Label</name> - <key>label2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 2 Color</name> - <key>color2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 2 Alpha</name> - <key>alpha2</key> - <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 3 Label</name> - <key>label3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 3 Color</name> - <key>color3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 3 Alpha</name> - <key>alpha3</key> - <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 4 Label</name> - <key>label4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 4 Color</name> - <key>color4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 4 Alpha</name> - <key>alpha4</key> - <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 5 Label</name> - <key>label5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 5 Color</name> - <key>color5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 5 Alpha</name> - <key>alpha5</key> - <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 6 Label</name> - <key>label6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 6 Color</name> - <key>color6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 6 Alpha</name> - <key>alpha6</key> - <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 7 Label</name> - <key>label7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 7 Color</name> - <key>color7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 7 Alpha</name> - <key>alpha7</key> - <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 8 Label</name> - <key>label8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 8 Color</name> - <key>color8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 8 Alpha</name> - <key>alpha8</key> - <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 9 Label</name> - <key>label9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 9 Color</name> - <key>color9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 9 Alpha</name> - <key>alpha9</key> - <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide> - </param> - - - <param> - <base_key>label1</base_key> - <name>Line 10 Label</name> - <key>label10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>color1</base_key> - <name>Line 10 Color</name> - <key>color10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - <param> - <base_key>alpha1</base_key> - <name>Line 10 Alpha</name> - <key>alpha10</key> - <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide> - </param> - - - <sink> - <name>in</name> - <type>$type.t</type> - <nports>#if $type.t == 'message' then 0 else $nconnections#</nports> - <optional>1</optional> - </sink> - - <sink> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </sink> - - <source> - <name>freq</name> - <type>message</type> - <optional>1</optional> - <hide>$showports</hide> - </source> - - <doc> -The GUI hint can be used to position the widget within the application. \ -The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ -Both the tab specification and the grid position are optional. - </doc> -</block> diff --git a/gr-qtgui/python/qtgui/CMakeLists.txt b/gr-qtgui/python/qtgui/CMakeLists.txt index 5df3a7d91b..f3fc70351d 100644 --- a/gr-qtgui/python/qtgui/CMakeLists.txt +++ b/gr-qtgui/python/qtgui/CMakeLists.txt @@ -51,6 +51,6 @@ if(ENABLE_TESTING) file(GLOB py_qa_test_files "qa_*.py") foreach(py_qa_test_file ${py_qa_test_files}) get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) + GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} -B ${py_qa_test_file}) endforeach(py_qa_test_file) endif(ENABLE_TESTING) diff --git a/gr-qtgui/python/qtgui/__init__.py b/gr-qtgui/python/qtgui/__init__.py index 8b60dc6dbe..c5527410aa 100644 --- a/gr-qtgui/python/qtgui/__init__.py +++ b/gr-qtgui/python/qtgui/__init__.py @@ -22,17 +22,18 @@ ''' Provides a GUI interface using the QT backend. ''' +from __future__ import unicode_literals # The presence of this file turns this directory into a Python package import os try: - from qtgui_swig import * + from .qtgui_swig import * except ImportError: dirname, filename = os.path.split(os.path.abspath(__file__)) __path__.append(os.path.join(dirname, "..", "..", "swig")) - from qtgui_swig import * + from .qtgui_swig import * -from range import Range, RangeWidget -import util +from .range import Range, RangeWidget +from . import util diff --git a/gr-qtgui/python/qtgui/qa_qtgui.py b/gr-qtgui/python/qtgui/qa_qtgui.py index d98cf1fc28..e46301071b 100755..100644 --- a/gr-qtgui/python/qtgui/qa_qtgui.py +++ b/gr-qtgui/python/qtgui/qa_qtgui.py @@ -20,6 +20,7 @@ # Boston, MA 02110-1301, USA. # + from gnuradio import gr, gr_unittest, qtgui class test_qtgui(gr_unittest.TestCase): diff --git a/gr-qtgui/python/qtgui/range.py.cmakein b/gr-qtgui/python/qtgui/range.py.cmakein index 9ed7706195..70d0045383 100755 --- a/gr-qtgui/python/qtgui/range.py.cmakein +++ b/gr-qtgui/python/qtgui/range.py.cmakein @@ -22,7 +22,7 @@ # @PY_QT_IMPORT@ -import util +from .util import check_set_qss class Range(object): def __init__(self, minv, maxv, step, default, min_length): @@ -33,7 +33,7 @@ class Range(object): self.min_length = min_length self.find_precision() self.find_nsteps() - util.check_set_qss() + check_set_qss() def find_precision(self): # Get the decimal part of the step diff --git a/gr-qtgui/python/qtgui/util.py.cmakein b/gr-qtgui/python/qtgui/util.py.cmakein index ec654d9ba2..4014fc1db1 100644 --- a/gr-qtgui/python/qtgui/util.py.cmakein +++ b/gr-qtgui/python/qtgui/util.py.cmakein @@ -21,7 +21,10 @@ # Boston, MA 02110-1301, USA. # +from __future__ import print_function + @PY_QT_IMPORT@ + from gnuradio import gr def check_set_qss(): @@ -31,4 +34,4 @@ def check_set_qss(): try: app.setStyleSheet(open(qssfile).read()) except: - print "WARNING: bad QSS file, %s"%(qssfile) + print("WARNING: bad QSS file, %s"%(qssfile)) |