From 7a6d8fc1da77e11decd341e81ab6d65e46ae2eed Mon Sep 17 00:00:00 2001 From: tvoid Date: Mon, 7 Apr 2008 17:50:59 -0600 Subject: working callback --- gsm-tvoid/src/python/gsm_scan.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'gsm-tvoid/src/python/gsm_scan.py') diff --git a/gsm-tvoid/src/python/gsm_scan.py b/gsm-tvoid/src/python/gsm_scan.py index 432b16e..dc3894b 100755 --- a/gsm-tvoid/src/python/gsm_scan.py +++ b/gsm-tvoid/src/python/gsm_scan.py @@ -26,6 +26,23 @@ from math import pi import wx import gsm + +#class gsm_tuner(gsm.gsm_tuner_callback): +class tune(gr.feval_ll): + def __init__(self, fg): + gr.feval_dd.__init__(self) + self.fg = fg + + def eval(self, x): + try: + #print "tune: ", x, "\n"; + self.fg.cb_count += 1 + return 0 + + except Exception, e: + print "tune: Exception: ", e + + def pick_subdevice(u): if u.db[0][0].dbid() >= 0: return (0, 0) @@ -69,21 +86,6 @@ def get_freq_from_arfcn(chan,region): return freq * 1e6 -#class gsm_tuner(gsm.gsm_tuner_callback): -class gsm_tuner(gr.feval_dd): - def __init__(self, fg): - gr.feval_dd.__init__(self) - self.fg = fg - - def eval(self, x): - try: - print "tune: ", x, "\n"; - fg.cb_count += 1 - return 0.0 - - except Exception, e: - print "tune: Exception: ", e - class app_flow_graph(stdgui.gui_flow_graph): def __init__(self, frame, panel, vbox, argv): @@ -236,7 +238,8 @@ class app_flow_graph(stdgui.gui_flow_graph): self.connect(self.u, self.input_fft_scope) #create a tuner callback - self.tuner = gsm_tuner(self) + self.tuner = tune(self) + #self._tuner = tune() # Setup flow based on decoder selection if options.decoder.count("c"): -- cgit v1.2.3