[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6211 - in grc/trunk/src: . SignalBlockDefs
From: |
jblum |
Subject: |
[Commit-gnuradio] r6211 - in grc/trunk/src: . SignalBlockDefs |
Date: |
Wed, 29 Aug 2007 15:29:50 -0600 (MDT) |
Author: jblum
Date: 2007-08-29 15:29:49 -0600 (Wed, 29 Aug 2007)
New Revision: 6211
Modified:
grc/trunk/src/ActionHandler.py
grc/trunk/src/ExecFlowGraph.py
grc/trunk/src/ExecFlowGraphGUI.py
grc/trunk/src/ExecFlowGraphXMLRPC.py
grc/trunk/src/SignalBlockDefs/Filters.py
grc/trunk/src/SignalBlockDefs/GraphicalSinks.py
grc/trunk/src/SignalBlockDefs/Misc.py
grc/trunk/src/SignalBlockDefs/Modulators.py
grc/trunk/src/SignalBlockDefs/Packet.py
Log:
fix for incompadible hier2 changes
Modified: grc/trunk/src/ActionHandler.py
===================================================================
--- grc/trunk/src/ActionHandler.py 2007-08-29 20:44:39 UTC (rev 6210)
+++ grc/trunk/src/ActionHandler.py 2007-08-29 21:29:49 UTC (rev 6211)
@@ -161,7 +161,8 @@
): get_action_from_name(action).set_sensitive(True)
if not self.init_file_paths and
Preferences.restore_files(): self.init_file_paths = Preferences.files_open()
if not self.init_file_paths: self.init_file_paths = ['']
- for file_path in self.init_file_paths:
self.main_window.new_page(file_path)
+ for file_path in self.init_file_paths:
self.main_window.new_page(file_path) #load pages from file paths
+ if not self.main_window.get_page():
self.main_window.new_page() #ensure that at least a blank page exists
elif state == APPLICATION_QUIT:
if self.main_window.close_pages():
Preferences.save(self.main_window)
Modified: grc/trunk/src/ExecFlowGraph.py
===================================================================
--- grc/trunk/src/ExecFlowGraph.py 2007-08-29 20:44:39 UTC (rev 6210)
+++ grc/trunk/src/ExecFlowGraph.py 2007-08-29 21:29:49 UTC (rev 6211)
@@ -43,35 +43,19 @@
self.callbacks_locked = list()
self.callbacks_cond = list()
self.var_keys = list()
- self.runtime = gr.runtime(self)
self.started = False
#build the flow graph
self._parse_nested_data(ParseXML.from_xml(ParseXML.from_file(file_path)))
- def start(self):
+ def _start(self):
"""Start the flow graph."""
- self.runtime.start()
+ self.start()
self.started = True
- def stop(self):
+ def _stop(self):
"""Stop the flow graph."""
- self.runtime.stop()
+ self.stop()
self.started = False
-
- def connect(self, *points):
- """!
- Override connect so that we can connect internal hier blocks.
- @param points the blocks to connect.
- """
- points2 = [(points[i], points[i+1]) for i in
range(len(points)-1)]
- for source,sink in points2:
- if hasattr(source, "__getitem__") and len(source) == 2:
source,i = source
- else: i = 0
- if hasattr(sink, "__getitem__") and len(sink) == 2:
sink,j = sink
- else: j = 0
- while hasattr(source, 'tail'): source = source.tail
- while hasattr(sink, 'head'): sink = sink.head
- gr.hier_block2.connect(self, (source, i), (sink, j))
def add_window(self, *args):
"""Empty method for adding a window in the GUI flow graph."""
@@ -127,17 +111,17 @@
"""For each call back, parse all of the data and
call the registered callback function on that data."""
#MUTEX.lock()
- #print "***\n\nCallback Time BEGIN\n\n***"
+ print "***\n\nCallback Time BEGIN\n\n***"
if self.started:
if self.callbacks: #parse regular callbacks
for function, data_type_params in
self.callbacks:
self._parse_callback(function,
*data_type_params)
if self.callbacks_locked: #parse locked callbacks
and conditional callbacks
- self._hb.lock()
+ self.lock()
for function, data_type_params in
self.callbacks_locked + self.callbacks_cond:
self._parse_callback(function,
*data_type_params)
- self._hb.unlock()
- #print "***\n\nCallback Time END\n\n***"
+ self.unlock()
+ print "***\n\nCallback Time END\n\n***"
#MUTEX.unlock()
def _parse_nested_data(self, nested_data):
Modified: grc/trunk/src/ExecFlowGraphGUI.py
===================================================================
--- grc/trunk/src/ExecFlowGraphGUI.py 2007-08-29 20:44:39 UTC (rev 6210)
+++ grc/trunk/src/ExecFlowGraphGUI.py 2007-08-29 21:29:49 UTC (rev 6211)
@@ -162,11 +162,11 @@
for key in sorted(self.sink_windows.keys()):
graphs_box.Add(self.sink_windows[key], 0, wx.EXPAND)
self.SetSizerAndFit(main_box)
self.Show()
- self.start() #start the flow graph
+ self._start() #start the flow graph
def _quit(self, event):
"""Exit the application."""
- self.stop() #stop the flow graph
+ self._stop() #stop the flow graph
self.Destroy() #destroy the wx frame
def add_window(self, window, type='', title=''):
Modified: grc/trunk/src/ExecFlowGraphXMLRPC.py
===================================================================
--- grc/trunk/src/ExecFlowGraphXMLRPC.py 2007-08-29 20:44:39 UTC (rev
6210)
+++ grc/trunk/src/ExecFlowGraphXMLRPC.py 2007-08-29 21:29:49 UTC (rev
6211)
@@ -84,9 +84,9 @@
server.register_function(lambda key: str(Variables.get_value(key)),
"get_var")
server.register_function(fg.get_var_range, "get_var_range")
server.register_function(fg.set_var, "set_var")
- server.register_function(fg.start, "start_fg")
- server.register_function(fg.stop, "stop_fg")
- fg.start() #start the flow graph
+ server.register_function(fg._start, "start_fg")
+ server.register_function(fg._stop, "stop_fg")
+ fg._start() #start the flow graph
print 'Starting XMLRPC server on address: "%s" and port:
"%d"'%(options.addr, options.port)
server.serve_forever() #start the xmlrpc server
Modified: grc/trunk/src/SignalBlockDefs/Filters.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/Filters.py 2007-08-29 20:44:39 UTC (rev
6210)
+++ grc/trunk/src/SignalBlockDefs/Filters.py 2007-08-29 21:29:49 UTC (rev
6211)
@@ -21,7 +21,7 @@
address@hidden Josh Blum
from DataTypes import *
-from gnuradio import gr,gru,blks
+from gnuradio import gr,gru,blks2
from SignalBlockConstants import default_samp_rate,all_choices
###########################################################################
@@ -139,7 +139,7 @@
return sb, lambda fg, taps: fcn(taps.parse())
def ChannelModel(sb):
- fcn = blks.channel_model
+ fcn = blks2.channel_model
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Complex())
sb.add_param('Noise Voltage', Float(0.0))
@@ -148,7 +148,7 @@
sb.add_param('Taps', ComplexVector('1.0,0.0'))
sb.set_docs('''Simulate channel distortion.''')
def make(fg, noise_voltage, frequency_offset, epsilon, taps):
- return fcn(fg, noise_voltage.parse(), frequency_offset.parse(),
epsilon.parse(), taps.parse())
+ return fcn(noise_voltage.parse(), frequency_offset.parse(),
epsilon.parse(), taps.parse())
return sb, make
###########################################################################
@@ -442,8 +442,8 @@
def FractionalResampler(sb):
lcm = gru.lcm
filters = Enum([
- ('Complex', (blks.rational_resampler_ccc, Complex())),
- ('Float', (blks.rational_resampler_fff, Float())),
+ ('Complex', (blks2.rational_resampler_ccc, Complex())),
+ ('Float', (blks2.rational_resampler_fff, Float())),
], 1)
sb.add_input_socket('in', Variable(filters, index=1))
sb.add_output_socket('out', Variable(filters, index=1))
@@ -460,7 +460,7 @@
out_rate = outrate.parse()
interp = int(lcm(in_rate, out_rate)/in_rate)
decim = int(lcm(in_rate, out_rate)/out_rate)
- return filter_type.parse()[0](fg, interp, decim, taps=None,
fractional_bw=fractional_bw.parse())
+ return filter_type.parse()[0](interp, decim, taps=None,
fractional_bw=fractional_bw.parse())
return sb, make
def FractionalInterpolator(sb):
Modified: grc/trunk/src/SignalBlockDefs/GraphicalSinks.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/GraphicalSinks.py 2007-08-29 20:44:39 UTC
(rev 6210)
+++ grc/trunk/src/SignalBlockDefs/GraphicalSinks.py 2007-08-29 21:29:49 UTC
(rev 6211)
@@ -31,10 +31,10 @@
waterfall_display_priority = 4
def FFTSink(sb):
- from gnuradio.wxgui import fftsink
+ from gnuradio.wxgui import fftsink2
type = Enum([
- ('Complex', (fftsink.fft_sink_c, Complex())),
- ('Float', (fftsink.fft_sink_f, Float())),
+ ('Complex', (fftsink2.fft_sink_c, Complex())),
+ ('Float', (fftsink2.fft_sink_f, Float())),
], 1)
sb.add_input_socket('in', Variable(type, index=1))
sb.add_param('Type', type, False, type=True)
@@ -50,7 +50,7 @@
options = options.parse()
peak_hold = (options == 2)
average = (options == 1)
- block = type.parse()[0](fg, fg.get_panel(),
title=title.parse(), y_per_div=y_per_div.parse(),
+ block = type.parse()[0](fg.get_panel(), title=title.parse(),
y_per_div=y_per_div.parse(),
ref_level=ref_lvl.parse(), fft_size=fft_size.parse(),
sample_rate=samp_rate.parse(),
fft_rate=fft_rate.parse())
block.set_peak_hold(peak_hold) #set the peak hold option
outside the contructor
@@ -64,10 +64,10 @@
return sb, make
def WaterfallSink(sb):
- from gnuradio.wxgui import waterfallsink
+ from gnuradio.wxgui import waterfallsink2
type = Enum([
- ('Complex', (waterfallsink.waterfall_sink_c, Complex())),
- ('Float', (waterfallsink.waterfall_sink_f, Float())),
+ ('Complex', (waterfallsink2.waterfall_sink_c, Complex())),
+ ('Float', (waterfallsink2.waterfall_sink_f, Float())),
], 1)
sb.add_input_socket('in', Variable(type, index=1))
sb.add_param('Type', type, False, type=True)
@@ -83,7 +83,7 @@
def make(fg, type, title, samp_rate, baseband_freq, y_per_div, ref_lvl,
fft_size, fft_rate, options):
options = options.parse()
average = (options == 1)
- block = type.parse()[0](fg, fg.get_panel(),
title=title.parse(), y_per_div=y_per_div.parse(),
+ block = type.parse()[0](fg.get_panel(), title=title.parse(),
y_per_div=y_per_div.parse(),
ref_level=ref_lvl.parse(), fft_size=fft_size.parse(),
sample_rate=samp_rate.parse(),
baseband_freq=baseband_freq.parse(),
fft_rate=fft_rate.parse())
block.set_average(average) #set the
average option outside the contructor
@@ -95,10 +95,10 @@
return sb, make
def ScopeSink(sb):
- from gnuradio.wxgui import scopesink
+ from gnuradio.wxgui import scopesink2
type = Enum([
- ('Complex', (scopesink.scope_sink_c, Complex())),
- ('Float', (scopesink.scope_sink_f, Float())),
+ ('Complex', (scopesink2.scope_sink_c, Complex())),
+ ('Float', (scopesink2.scope_sink_f, Float())),
], 1)
sb.add_input_socket('in', Variable(type, index=1))
sb.add_param('Type', type, False, type=True)
@@ -114,7 +114,7 @@
def make(fg, type, title, samp_rate, frame_decim, v_scale, t_scale):
v_scale = v_scale.parse()
if v_scale == 0: v_scale = None # v_scale = None means
auto-scale
- block = type.parse()[0](fg, fg.get_panel(),
title=title.parse(),
+ block = type.parse()[0](fg.get_panel(), title=title.parse(),
sample_rate=samp_rate.parse(),
frame_decim=frame_decim.parse(),
v_scale=v_scale, t_scale=t_scale.parse())
fg.add_window(block.win, scope_display_priority, title.parse())
@@ -124,8 +124,8 @@
return sb, make
def ConstellationSink(sb):
- from gnuradio.wxgui import scopesink
- fcn = scopesink.scope_sink_c #dont tell anyone that its really a
scope sink
+ from gnuradio.wxgui import scopesink2
+ fcn = scopesink2.scope_sink_c #dont tell anyone that its really a
scope sink
sb.add_input_socket('in', Complex())
sb.add_param('Title', String('Constellation'))
sb.add_param('Sampling Rate', Int(default_samp_rate))
@@ -134,7 +134,7 @@
sb.set_docs('''\
The constellation sink has a throttle automatically attatched to it at runtime
to save the CPU. ''')
def make(fg, title, samp_rate, frame_decim, marker):
- block = fcn(fg, fg.get_panel(), title=title.parse(),
+ block = fcn(fg.get_panel(), title=title.parse(),
sample_rate=samp_rate.parse(),
frame_decim=frame_decim.parse())
block.win.info.xy = True #true for X:Y
marker = marker.parse()
@@ -148,10 +148,10 @@
return sb, make
def NumericalSink(sb):
- from gnuradio.wxgui import numbersink
+ from gnuradio.wxgui import numbersink2
type = Enum([
- ('Complex', (numbersink.number_sink_c, Complex())),
- ('Float', (numbersink.number_sink_f, Float())),
+ ('Complex', (numbersink2.number_sink_c, Complex())),
+ ('Float', (numbersink2.number_sink_f, Float())),
], 1)
sb.add_input_socket('in', Variable(type, index=1))
sb.add_param('Type', type, False, type=True)
@@ -173,7 +173,7 @@
options = options.parse()
peak_hold = (options == 2)
average = (options == 1)
- block = type.parse()[0](fg, fg.get_panel(), unit=unit.parse(),
+ block = type.parse()[0](fg.get_panel(), unit=unit.parse(),
base_value=base.parse(), minval=min.parse(),
maxval=max.parse(), factor=factor.parse(),
decimal_places=decimals.parse(),
ref_level=ref_lvl.parse(), sample_rate=samp_rate.parse(), #number_size=512,
number_rate=num_rate.parse(), label=label.parse())
Modified: grc/trunk/src/SignalBlockDefs/Misc.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/Misc.py 2007-08-29 20:44:39 UTC (rev
6210)
+++ grc/trunk/src/SignalBlockDefs/Misc.py 2007-08-29 21:29:49 UTC (rev
6211)
@@ -158,11 +158,11 @@
@param input_index the new input index
"""
if self.input_index != input_index:
- self._hb.lock()
+ self.lock()
self._disconnect_current()
self.input_index = input_index
self._connect_current()
- self._hb.unlock()
+ self.unlock()
def set_output_index(self, output_index):
"""!
@@ -170,11 +170,11 @@
@param output_index the new output index
"""
if self.output_index != output_index:
- self._hb.lock()
+ self.lock()
self._disconnect_current()
self.output_index = output_index
self._connect_current()
- self._hb.unlock()
+ self.unlock()
def Selector(sb):
type = Enum(all_choices, 1)
Modified: grc/trunk/src/SignalBlockDefs/Modulators.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/Modulators.py 2007-08-29 20:44:39 UTC (rev
6210)
+++ grc/trunk/src/SignalBlockDefs/Modulators.py 2007-08-29 21:29:49 UTC (rev
6211)
@@ -21,7 +21,7 @@
address@hidden Josh Blum
from DataTypes import *
-from gnuradio import gr
+from gnuradio import gr,blks2
def FrequencyMod(sb):
fcn = gr.frequency_modulator_fc
@@ -49,8 +49,7 @@
###########################################################################
def WFMReceive(sb):
- from gnuradio import blks
- fcn = blks.wfm_rcv
+ fcn = blks2.wfm_rcv
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Float())
sb.add_param('Quad Rate', Float(100e3))
@@ -58,11 +57,10 @@
sb.set_docs('''\
Wide Band FM Receiver.
The audio rate is the quad rate/audio decimation.''')
- return sb, lambda fg, quad_rate, audio_dec: fcn(fg, quad_rate.parse(),
audio_dec.parse())
+ return sb, lambda fg, quad_rate, audio_dec: fcn(quad_rate.parse(),
audio_dec.parse())
def WFMTransmit(sb):
- from gnuradio import blks
- fcn = blks.wfm_tx
+ fcn = blks2.wfm_tx
sb.add_input_socket('in', Float())
sb.add_output_socket('out', Complex())
sb.add_param('Quad Rate', Int(100e3))
@@ -78,12 +76,11 @@
# make sure that the quad rate is an integer multiple of
the audio rate #
audio_rate = quad_rate/audio_decimation
quad_rate = audio_decimation * (quad_rate/audio_decimation)
- return fcn(fg, audio_rate, quad_rate, tau.parse(),
max_dev.parse())
+ return fcn(audio_rate, quad_rate, tau.parse(), max_dev.parse())
return sb, make
def NBFMReceive(sb):
- from gnuradio import blks
- fcn = blks.nbfm_rx
+ fcn = blks2.nbfm_rx
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Float())
sb.add_param('Quad Rate', Int(100e3))
@@ -99,12 +96,11 @@
# make sure that the quad rate is an integer multiple of
the audio rate #
audio_rate = quad_rate/audio_decimation
quad_rate = audio_decimation * (quad_rate/audio_decimation)
- return fcn(fg, audio_rate, quad_rate, tau.parse(),
max_dev.parse())
+ return fcn(audio_rate, quad_rate, tau.parse(), max_dev.parse())
return sb, make
def NBFMTransmit(sb):
- from gnuradio import blks
- fcn = blks.nbfm_tx
+ fcn = blks2.nbfm_tx
sb.add_input_socket('in', Float())
sb.add_output_socket('out', Complex())
sb.add_param('Quad Rate', Int(100e3))
@@ -120,7 +116,7 @@
# make sure that the quad rate is an integer multiple of
the audio rate #
audio_rate = quad_rate/audio_decimation
quad_rate = audio_decimation * (quad_rate/audio_decimation)
- return fcn(fg, audio_rate, quad_rate, tau.parse(),
max_dev.parse())
+ return fcn(audio_rate, quad_rate, tau.parse(), max_dev.parse())
return sb, make
###########################################################################
@@ -128,19 +124,17 @@
###########################################################################
def AMDemod(sb):
- from gnuradio import blks
- fcn = blks.am_demod_cf
+ fcn = blks2.am_demod_cf
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Float())
sb.add_param('Channel Rate', Int(100e3))
sb.add_param('Audio Decimation', Int(1, min=1))
sb.add_param('Audio Passband (Hz)', Float(5e3))
sb.add_param('Audio Stopband (Hz)', Float(5.5e3))
- return sb, lambda fg, *args: fcn(fg, *map(lambda a: a.parse(), args))
+ return sb, lambda fg, *args: fcn(*map(lambda a: a.parse(), args))
def FMDemod(sb):
- from gnuradio import blks
- fcn = blks.fm_demod_cf
+ fcn = blks2.fm_demod_cf
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Float())
sb.add_param('Channel Rate', Int(100e3))
@@ -150,34 +144,32 @@
sb.add_param('Audio Stopband (Hz)', Float(4e3))
sb.add_param('Gain', Float(1))
sb.add_param('Tau', Float(75e-6))
- return sb, lambda fg, *args: fcn(fg, *map(lambda a: a.parse(), args))
+ return sb, lambda fg, *args: fcn(*map(lambda a: a.parse(), args))
###########################################################################
# Phase shift keying
###########################################################################
def PSKMod(sb):
- from gnuradio import blks
sb.add_input_socket('in', Byte())
sb.add_output_socket('out', Complex())
sb.add_param('Type', Enum([
- ('DBPSK', blks.dbpsk_mod),
- ('DQPSK', blks.dqpsk_mod),
- ('D8PSK', blks.d8psk_mod),
+ ('DBPSK', blks2.dbpsk_mod),
+ ('DQPSK', blks2.dqpsk_mod),
+ ('D8PSK', blks2.d8psk_mod),
]), type=True)
sb.add_param('Samples/Symbol', Int(2, min=2))
sb.add_param('Excess BW', Float(0.35))
sb.add_param('Use Gray Code', Bool(true='Yes', false='No',
default=True))
- return sb, lambda fg, type, *args: type.parse()(fg, *map(lambda a:
a.parse(), args))
+ return sb, lambda fg, type, *args: type.parse()(*map(lambda a:
a.parse(), args))
def PSKDemod(sb):
- from gnuradio import blks
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Byte())
sb.add_param('Type', Enum([
- ('DBPSK', blks.dbpsk_demod),
- ('DQPSK', blks.dqpsk_demod),
- ('D8PSK', blks.d8psk_demod),
+ ('DBPSK', blks2.dbpsk_demod),
+ ('DQPSK', blks2.dqpsk_demod),
+ ('D8PSK', blks2.d8psk_demod),
]), type=True)
sb.add_param('Samples/Symbol', Int(2, min=2))
sb.add_param('Excess BW', Float(0.35))
@@ -186,24 +178,22 @@
sb.add_param('Mu', Float(0.005))
sb.add_param('Omega Relative Limit', Float(0.05))
sb.add_param('Use Gray Code', Bool(true='Yes', false='No',
default=True))
- return sb, lambda fg, type, *args: type.parse()(fg, *map(lambda a:
a.parse(), args))
+ return sb, lambda fg, type, *args: type.parse()(*map(lambda a:
a.parse(), args))
###########################################################################
# Gaussian minimum shift keying
###########################################################################
def GMSKMod(sb):
- from gnuradio import blks
- fcn = blks.gmsk_mod
+ fcn = blks2.gmsk_mod
sb.add_input_socket('in', Byte())
sb.add_output_socket('out', Complex())
sb.add_param('Samples/Symbol', Int(2, min=2))
sb.add_param('Filter BW', Float(0.35))
- return sb, lambda fg, *args: fcn(fg, *map(lambda a: a.parse(), args))
+ return sb, lambda fg, *args: fcn(*map(lambda a: a.parse(), args))
def GMSKDemod(sb):
- from gnuradio import blks
- fcn = blks.gmsk_demod
+ fcn = blks2.gmsk_demod
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Byte())
sb.add_param('Samples/Symbol', Int(2, min=2))
@@ -212,34 +202,32 @@
sb.add_param('Omega Relative Limit', Float(0.005))
sb.add_param('Frequency Error', Float(0))
sb.set_docs('''Mu is the fractional delay between 0 and 1''')
- return sb, lambda fg, *args: fcn(fg, *map(lambda a: a.parse(), args))
+ return sb, lambda fg, *args: fcn(*map(lambda a: a.parse(), args))
###########################################################################
# Quadrature amplitude modulation
###########################################################################
def QAMMod(sb):
- from gnuradio import blks
sb.add_input_socket('in', Byte())
sb.add_output_socket('out', Complex())
sb.add_param('Type', Enum([
- ('QAM 8', blks.qam8_mod),
- ('QAM 64', blks.qam64_mod),
- ('QAM 256', blks.qam256_mod),
+ ('QAM 8', blks2.qam8_mod),
+ ('QAM 64', blks2.qam64_mod),
+ ('QAM 256', blks2.qam256_mod),
]), type=True)
sb.add_param('Samples/Symbol', Int(2, min=2))
sb.add_param('Excess BW', Float(0.35))
sb.add_param('Use Gray Code', Bool(true='Yes', false='No',
default=True))
- return sb, lambda fg, type, *args: type.parse()(fg, *map(lambda a:
a.parse(), args))
+ return sb, lambda fg, type, *args: type.parse()(*map(lambda a:
a.parse(), args))
def QAMDemod(sb):
- from gnuradio import blks
sb.add_input_socket('in', Complex())
sb.add_output_socket('out', Byte())
sb.add_param('Type', Enum([
- ('QAM 8', blks.qam8_demod),
- ('QAM 64', blks.qam64_demod),
- ('QAM 256', blks.qam256_demod),
+ ('QAM 8', blks2.qam8_demod),
+ ('QAM 64', blks2.qam64_demod),
+ ('QAM 256', blks2.qam256_demod),
]), type=True)
sb.add_param('Samples/Symbol', Int(2, min=2))
sb.add_param('Excess BW', Float(0.35))
@@ -248,7 +236,7 @@
sb.add_param('Mu', Float(0.005))
sb.add_param('Omega Relative Limit', Float(0.05))
sb.add_param('Use Gray Code', Bool(true='Yes', false='No',
default=True))
- return sb, lambda fg, type, *args: type.parse()(fg, *map(lambda a:
a.parse(), args))
+ return sb, lambda fg, type, *args: type.parse()(*map(lambda a:
a.parse(), args))
###########################################################################
# Phase Locked Loops
Modified: grc/trunk/src/SignalBlockDefs/Packet.py
===================================================================
--- grc/trunk/src/SignalBlockDefs/Packet.py 2007-08-29 20:44:39 UTC (rev
6210)
+++ grc/trunk/src/SignalBlockDefs/Packet.py 2007-08-29 21:29:49 UTC (rev
6211)
@@ -71,7 +71,7 @@
class PacketModHelper(gr.hier_block2):
"""Forward data from the gr data stream to the mod packet."""
- def __init__(self, item_size, packet_length, samples_per_symbol,
bits_per_symbol, access_code, pad_for_usrp, use_whitener_offset):
+ def __init__(self, item_size, packet_length, samples_per_symbol,
bits_per_symbol, access_code, pad_for_usrp):
"""!
PacketModHelper constructor.
@param item_size the size in bytes of the input data stream
@@ -90,12 +90,11 @@
modulator.bits_per_symbol = lambda: bits_per_symbol
#create the packet modulator (handles the output data stream)
self.packet_mod = blks.mod_pkts(
- fg=self,
+ fg=self,
modulator=modulator,
access_code=access_code,
msgq_limit=DEFAULT_QUEUE_LIMIT,
pad_for_usrp=pad_for_usrp,
- use_whitener_offset=use_whitener_offset,
)
#the message sink (handles the input data stream)
self.msgq = gr.msg_queue(DEFAULT_QUEUE_LIMIT)
@@ -105,14 +104,6 @@
self.connect(self, msg_sink)
#create/start the thread
PacketModThread(self.msgq, self.packet_mod.send_pkt,
packet_length)
-
- def flush(self):
- """
- Flush the message queues.
- Special locked callback to avoid thread lockup.
- """
- self.msgq.flush()
- self.packet_mod._pkt_input.msgq().flush()
class PacketDemodHelper(gr.hier_block2):
"""Forward data from demod packet to the gr data stream."""
@@ -138,7 +129,7 @@
demodulator = gr.skiphead(Byte().get_num_bytes(), 0)
#create the packet demodulator (handles the input data stream)
packet_demod = blks.demod_pkts(
- fg=self,
+ fg=self,
demodulator=demodulator,
access_code=access_code,
callback=callback,
@@ -171,7 +162,6 @@
sb.add_param('Packet Length', Int(DEFAULT_PACKET_LENGTH, min=1,
max=MAX_PACKET_LENGTH))
sb.add_param('Access Code', String('', max=MAX_ACCESS_CODE_LENGTH))
sb.add_param('Pad for USRP', Bool(true='Yes', false='No', default=True))
- sb.add_param('Use Whitener Offset', Bool(true='Yes', false='No',
default=False))
sb.set_docs('''\
The packet modulator wraps a data stream into packets.
---
@@ -186,7 +176,7 @@
Use whitener offset: If true, start of whitener XOR string is incremented each
packet.
'''%(MAX_PACKET_LENGTH, MAX_ACCESS_CODE_LENGTH))
- def make(fg, type, mod_type, samples_per_symbol, packet_length,
access_code, pad_for_usrp, use_whitener_offset):
+ def make(fg, type, mod_type, samples_per_symbol, packet_length,
access_code, pad_for_usrp):
access_code = access_code.parse()
if access_code == '': access_code = None #access code
should be None if blank
item_size = type.parse().get_num_bytes()
@@ -200,9 +190,7 @@
bits_per_symbol=mod_type.parse().bits_per_symbol(),
access_code=access_code,
pad_for_usrp=pad_for_usrp.parse(),
- use_whitener_offset=use_whitener_offset.parse(),
) #build packet modulator
- fg.add_callback_cond(block.flush)
return block
return sb, make
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6211 - in grc/trunk/src: . SignalBlockDefs,
jblum <=