summaryrefslogtreecommitdiff
path: root/gr-qtgui/examples/pyqt_time_raster_b.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/examples/pyqt_time_raster_b.py')
-rw-r--r--gr-qtgui/examples/pyqt_time_raster_b.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/gr-qtgui/examples/pyqt_time_raster_b.py b/gr-qtgui/examples/pyqt_time_raster_b.py
index 712fe39567..25c283385b 100644
--- a/gr-qtgui/examples/pyqt_time_raster_b.py
+++ b/gr-qtgui/examples/pyqt_time_raster_b.py
@@ -21,25 +21,28 @@ except ImportError:
print("Error: Program requires PyQt5 and gr-qtgui.")
sys.exit(1)
+
class dialog_box(QtWidgets.QWidget):
def __init__(self, display):
QtWidgets.QWidget.__init__(self, None)
self.setWindowTitle('PyQt Test GUI')
- self.boxlayout = QtWidgets.QBoxLayout(QtWidgets.QBoxLayout.LeftToRight, self)
+ self.boxlayout = QtWidgets.QBoxLayout(
+ QtWidgets.QBoxLayout.LeftToRight, self)
self.boxlayout.addWidget(display, 1)
self.resize(800, 500)
+
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
self.qapp = QtWidgets.QApplication(sys.argv)
- data0 = 10*[0,] + 40*[1,0] + 10*[0,]
- data0 += 10*[0,] + 40*[0,1] + 10*[0,]
- data1 = 20*[0,] + [0,0,0,1,1,1,0,0,0,0] + 70*[0,]
+ data0 = 10 * [0, ] + 40 * [1, 0] + 10 * [0, ]
+ data0 += 10 * [0, ] + 40 * [0, 1] + 10 * [0, ]
+ data1 = 20 * [0, ] + [0, 0, 0, 1, 1, 1, 0, 0, 0, 0] + 70 * [0, ]
# Adjust these to change the layout of the plot.
# Can be set to fractions.
@@ -49,7 +52,7 @@ class my_top_block(gr.top_block):
fs = 200
src0 = blocks.vector_source_b(data0, True)
src1 = blocks.vector_source_b(data1, True)
- thr = blocks.throttle(gr.sizeof_char, 50000)
+ thr = blocks.throttle(gr.sizeof_char, 50000)
head = blocks.head(gr.sizeof_char, 10000000)
self.snk1 = qtgui.time_raster_sink_b(fs, nrows, ncols, [], [],
"Time Raster Example", 2, None)
@@ -67,8 +70,9 @@ class my_top_block(gr.top_block):
self.main_box = dialog_box(pyWin)
self.main_box.show()
+
if __name__ == "__main__":
- tb = my_top_block();
+ tb = my_top_block()
tb.start()
tb.qapp.exec_()
tb.stop()