[PATCH] fix osmocom_fft for current main-3.9 gnuradio

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Stefan `Sec` Zehl sec at 42.org
Sun Oct 10 12:48:25 UTC 2021


Hi,

The commit 86b5fb30182c69ec38490346a4269d1ffce9ffb4 in gnuradio broke
osmocom_fft due to removing/renaming the pyqwidget wrapper.

This patch tries to fix that in a backwards-compatible manner.

>From 645240939b50dc6f4cebd277c6a690a919f67fb5 Mon Sep 17 00:00:00 2001
From: Stefan `Sec` Zehl <sec at 42.org>
Date: Sun, 10 Oct 2021 14:31:23 +0200
Subject: [PATCH 1/3] follow pyqwidget rename in gnuradio
 86b5fb30182c69ec38490346a4269d1ffce9ffb4

---
 apps/osmocom_fft | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/apps/osmocom_fft b/apps/osmocom_fft
index b23124a96f..6e072f8c6c 100755
--- a/apps/osmocom_fft
+++ b/apps/osmocom_fft
@@ -242,7 +242,10 @@ class app_top_block(gr.top_block, Qt.QMainWindow):
             from gnuradio import fosphor
             self.scope = fosphor.qt_sink_c()
             self.scope.set_frequency_range(0, input_rate)
-            self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            if hasattr(self.scope,'pyqwidget'):
+                self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            else:
+                self.scope_win = sip.wrapinstance(self.scope.qwidget(), Qt.QWidget)
             self.scope_win.setMinimumSize(800, 300)
         elif options.waterfall:
             self.scope = qtgui.waterfall_sink_c(
@@ -256,7 +259,10 @@ class app_top_block(gr.top_block, Qt.QMainWindow):
             self.scope.enable_grid(False)
             self.scope.enable_axis_labels(True)
             self.scope.set_intensity_range(-100, 20)
-            self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            if hasattr(self.scope,'pyqwidget'):
+                self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            else:
+                self.scope_win = sip.wrapinstance(self.scope.qwidget(), Qt.QWidget)
             self.scope_win.setMinimumSize(800, 420)
 
         elif options.oscilloscope:
@@ -266,7 +272,10 @@ class app_top_block(gr.top_block, Qt.QMainWindow):
                 name="",
                 nconnections=1
             )
-            self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            if hasattr(self.scope,'pyqwidget'):
+                self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            else:
+                self.scope_win = sip.wrapinstance(self.scope.qwidget(), Qt.QWidget)
             self.scope_win.setMinimumSize(800, 600)
 
         elif options.qtgui:
@@ -281,7 +290,10 @@ class app_top_block(gr.top_block, Qt.QMainWindow):
                 plottime=True,
                 plotconst=True
             )
-            self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            if hasattr(self.scope,'pyqwidget'):
+                self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            else:
+                self.scope_win = sip.wrapinstance(self.scope.qwidget(), Qt.QWidget)
             self.scope.set_update_time(1.0/10)
             self.scope_win.setMinimumSize(800, 600)
 
@@ -294,7 +306,10 @@ class app_top_block(gr.top_block, Qt.QMainWindow):
                 name="",
                 nconnections=1
             )
-            self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            if hasattr(self.scope,'pyqwidget'):
+                self.scope_win = sip.wrapinstance(self.scope.pyqwidget(), Qt.QWidget)
+            else:
+                self.scope_win = sip.wrapinstance(self.scope.qwidget(), Qt.QWidget)
             self.scope.disable_legend()
             self.scope_win.setMinimumSize(800, 420)
 
-- 
2.30.2

CU,
    Sec
-- 
Cooking without animal products is like doing sysadmin work without vi.



More information about the osmocom-sdr mailing list