Skip to content

Commit

Permalink
Migration of flow_graph to top_block
Browse files Browse the repository at this point in the history
Initial patch to make gsm-tvoid and gssm work with current
gnuradio svn (which has various API changes)
  • Loading branch information
laf0rge committed Jun 30, 2010
1 parent 69103ce commit 714da0d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions gsm-tvoid/src/python/gsm_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
if extdir not in sys.path:
sys.path.append(extdir)

from gnuradio import gr, gru, blks
from gnuradio import gr, gru, blks2
from gnuradio import usrp
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import stdgui, fftsink, waterfallsink, scopesink, form, slider
from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
from optparse import OptionParser
from math import pi
import wx
Expand Down Expand Up @@ -161,10 +161,10 @@ def get_arfcn_from_freq(freq,region):
return arfcn

####################
class app_flow_graph(stdgui.gui_flow_graph):
class app_flow_graph(stdgui2.std_top_block):

def __init__(self, frame, panel, vbox, argv):
stdgui.gui_flow_graph.__init__(self)
stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)

self.frame = frame
self.panel = panel
Expand Down Expand Up @@ -460,31 +460,31 @@ def setup_c_flowgraph(self):
def setup_scopes(self):
#Input FFT
if self.scopes.count("I"):
self.input_fft_scope = fftsink.fft_sink_c (self, self.panel, fft_size=1024, sample_rate=self.input_rate)
self.input_fft_scope = fftsink2.fft_sink_c (self.panel, fft_size=1024, sample_rate=self.input_rate)
self.connect(self.source, self.input_fft_scope)

#Filter FFT
if self.scopes.count("F"):
self.filter_fft_scope = fftsink.fft_sink_c (self, self.panel, fft_size=1024, sample_rate=self.input_rate)
self.filter_fft_scope = fftsink2.fft_sink_c (self.panel, fft_size=1024, sample_rate=self.input_rate)
self.connect(self.filter, self.filter_fft_scope)

#Burst Scope
if self.scopes.count("b"):
self.burst_scope = scopesink.scope_sink_f(self, self.panel, sample_rate=self.gsm_symb_rate,v_scale=1)
self.burst_scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.gsm_symb_rate,v_scale=1)
self.connect(self.v2s, self.burst_scope)

#burst_f options
if self.options.decoder.count("f"):
if self.scopes.count("d"):
self.demod_scope = scopesink.scope_sink_f(self, self.panel, sample_rate=self.input_rate)
self.demod_scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.input_rate)
self.connect(self.demod, self.demod_scope)

if self.scopes.count("c"):
#f_flowgraph
self.clocked_scope = scopesink.scope_sink_f(self, self.panel, sample_rate=self.gsm_symb_rate,v_scale=1)
self.clocked_scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.gsm_symb_rate,v_scale=1)
self.connect(self.clocker, self.clocked_scope)
#for testing: f_flowgraph2
#self.clocked_scope = scopesink.scope_sink_c(self, self.panel, sample_rate=self.gsm_symb_rate,v_scale=1)
#self.clocked_scope = scopesink2.scope_sink_c(self.panel, sample_rate=self.gsm_symb_rate,v_scale=1)
#self.connect(self.clocker, self.clocked_scope)
#self.connect((self.clocker,1),(self.clocked_scope,1))

Expand Down Expand Up @@ -723,7 +723,7 @@ def on_idle(self, event):

####################
def main():
app = stdgui.stdapp(app_flow_graph, "GSM Scanner", nstatus=1)
app = stdgui2.stdapp(app_flow_graph, "GSM Scanner", nstatus=1)
app.MainLoop()

####################
Expand Down
2 changes: 1 addition & 1 deletion gsm-tvoid/src/python/qa_gsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class qa_gsm (gr_unittest.TestCase):

def setUp (self):
self.fg = gr.flow_graph ()
self.fg = gr.top_block ()

def tearDown (self):
self.fg = None
Expand Down
8 changes: 4 additions & 4 deletions gssm/src/python/gssm_usrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# $Id: gssm_usrp.py,v 1.2 2007-07-07 16:31:44 jl Exp $

from gnuradio import gr, usrp, db_dbs_rx, blks
from gnuradio.blksimpl import gmsk
from gnuradio import gr, usrp, db_dbs_rx, blks2
from gnuradio.blks2impl import gmsk
from usrpm import usrp_dbid
import gssm
import sys
Expand All @@ -21,9 +21,9 @@
# experimental constant
default_usrp_offset = 12e3

class gssm_flow_graph(gr.flow_graph):
class gssm_flow_graph(gr.top_block):
def __init__(self, usrp_offset):
gr.flow_graph.__init__(self)
gr.top_block.__init__(self)

u = usrp.source_c(decim_rate = decim)
s = usrp.pick_subdev(u, (usrp_dbid.DBS_RX,))
Expand Down

0 comments on commit 714da0d

Please sign in to comment.