From 2d8f91fd39c48501b75e5afa03235e0f975f81df Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 31 Dec 2012 11:42:26 -0800 Subject: [PATCH] Updated scripts to work with GNU Radio 3.6 or 3.7 --- apps/modes_gui | 16 ++++++++++++++-- apps/modes_rx | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/apps/modes_gui b/apps/modes_gui index 5287579..ae571eb 100755 --- a/apps/modes_gui +++ b/apps/modes_gui @@ -22,8 +22,20 @@ import os, sys, time, threading, datetime, math, csv from PyQt4 import QtCore,QtGui from PyQt4.Qwt5 import Qwt -from gnuradio import gr, gru, optfir, eng_notation, blks2 + +from gnuradio import gr, gru, eng_notation import gnuradio.gr.gr_threading as _threading + +try: + from gnuradio import optfir +except ImportError: + from gnuradio.filter import optfir + +try: + from gnuradio.blks2 import rational_resampler_ccf +except ImportError: + from gnuradio.filter import rational_resampler_ccf + import air_modes from air_modes.exceptions import * from air_modes.modes_rx_ui import Ui_MainWindow @@ -428,7 +440,7 @@ class adsb_rx_block (gr.top_block): if use_resampler: self.lpfiltcoeffs = gr.firdes.low_pass(1, 5*3.2e6, 1.6e6, 300e3) - self.resample = blks2.rational_resampler_ccf(interpolation=5, decimation=4, taps=self.lpfiltcoeffs) + self.resample = rational_resampler_ccf(interpolation=5, decimation=4, taps=self.lpfiltcoeffs) self.connect(self.u, self.resample, self.rx_path) else: self.connect(self.u, self.rx_path) diff --git a/apps/modes_rx b/apps/modes_rx index 550ffcb..c981bd8 100755 --- a/apps/modes_rx +++ b/apps/modes_rx @@ -21,13 +21,24 @@ my_position = None -from gnuradio import gr, gru, optfir, eng_notation, blks2 +from gnuradio import gr, gru, eng_notation from gnuradio.eng_option import eng_option +import gnuradio.gr.gr_threading as _threading + +try: + from gnuradio import optfir +except ImportError: + from gnuradio.filter import optfir + +try: + from gnuradio.blks2 import rational_resampler_ccf +except ImportError: + from gnuradio.filter import rational_resampler_ccf + from optparse import OptionParser import time, os, sys, threading from string import split, join import air_modes -import gnuradio.gr.gr_threading as _threading import csv from air_modes.exceptions import * @@ -114,7 +125,7 @@ class adsb_rx_block (gr.top_block): if use_resampler: self.lpfiltcoeffs = gr.firdes.low_pass(1, 5*3.2e6, 1.6e6, 300e3) - self.resample = blks2.rational_resampler_ccf(interpolation=5, decimation=4, taps=self.lpfiltcoeffs) + self.resample = rational_resampler_ccf(interpolation=5, decimation=4, taps=self.lpfiltcoeffs) self.connect(self.u, self.resample, self.rx_path) else: self.connect(self.u, self.rx_path)