diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/blocks/Makefile.am | 2 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 2 | ||||
-rw-r--r-- | grc/blocks/gr_additive_scrambler_bb.xml | 44 | ||||
-rw-r--r-- | grc/blocks/gr_dd_mpsk_sync_cc.xml | 65 | ||||
-rw-r--r-- | grc/blocks/gr_udp_sink.xml | 32 | ||||
-rw-r--r-- | grc/blocks/gr_udp_source.xml | 20 | ||||
-rw-r--r-- | grc/blocks/usrp_dual_source_x.xml | 36 | ||||
-rw-r--r-- | grc/freedesktop/Makefile.am | 2 | ||||
-rw-r--r-- | grc/freedesktop/gnuradio-gnuradio-companion.desktop (renamed from grc/freedesktop/gnuradio-grc.desktop) | 2 | ||||
-rw-r--r-- | grc/freedesktop/grc_setup_freedesktop.in | 2 | ||||
-rw-r--r-- | grc/grc_gnuradio/usrp/dual_usrp.py | 8 | ||||
-rw-r--r-- | grc/gui/DrawingArea.py | 12 | ||||
-rw-r--r-- | grc/gui/FlowGraph.py | 41 | ||||
-rw-r--r-- | grc/gui/Param.py | 15 | ||||
-rw-r--r-- | grc/python/Generator.py | 7 | ||||
-rw-r--r-- | grc/python/Param.py | 32 | ||||
-rw-r--r-- | grc/python/Platform.py | 4 | ||||
-rw-r--r-- | grc/scripts/Makefile.am | 4 | ||||
-rwxr-xr-x | grc/scripts/gnuradio-companion (renamed from grc/scripts/grc) | 0 |
19 files changed, 200 insertions, 130 deletions
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index a284d6d85..2596eae45 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -67,6 +67,7 @@ dist_ourdata_DATA = \ const_source_x.xml \ gr_add_const_vxx.xml \ gr_add_xx.xml \ + gr_additive_scrambler_bb.xml \ gr_agc2_xx.xml \ gr_agc_xx.xml \ gr_and_xx.xml \ @@ -90,7 +91,6 @@ dist_ourdata_DATA = \ gr_correlate_access_code_bb.xml \ gr_costas_loop_cc.xml \ gr_cpfsk_bc.xml \ - gr_dd_mpsk_sync_cc.xml \ gr_decode_ccsds_27_fb.xml \ gr_deinterleave.xml \ gr_delay.xml \ diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index ba597756f..8d91258e5 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -130,7 +130,6 @@ <block>gr_pfb_clock_sync_xxx</block> <block>gr_costas_loop_cc</block> - <block>gr_dd_mpsk_sync_cc</block> <block>gr_mpsk_sync_cc</block> <block>gr_mpsk_receiver_cc</block> @@ -259,6 +258,7 @@ <name>Line Coding</name> <block>gr_scrambler_bb</block> <block>gr_descrambler_bb</block> + <block>gr_additive_scrambler_bb</block> </cat> <cat> <name>Vocoders</name> diff --git a/grc/blocks/gr_additive_scrambler_bb.xml b/grc/blocks/gr_additive_scrambler_bb.xml new file mode 100644 index 000000000..a15d6eefb --- /dev/null +++ b/grc/blocks/gr_additive_scrambler_bb.xml @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<!-- +################################################### +## Additive Scrambler +################################################### + --> +<block> + <name>Additive Scrambler</name> + <key>gr_additive_scrambler_bb</key> + <import>from gnuradio import gr</import> + <make>gr.additive_scrambler_bb($mask, $seed, $len, $count)</make> + <param> + <name>Mask</name> + <key>mask</key> + <value>0x8A</value> + <type>hex</type> + </param> + <param> + <name>Seed</name> + <key>seed</key> + <value>0x7F</value> + <type>hex</type> + </param> + <param> + <name>Length</name> + <key>len</key> + <value>7</value> + <type>int</type> + </param> + <param> + <name>Count</name> + <key>count</key> + <value>0</value> + <type>int</type> + </param> + <sink> + <name>in</name> + <type>byte</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> +</block> diff --git a/grc/blocks/gr_dd_mpsk_sync_cc.xml b/grc/blocks/gr_dd_mpsk_sync_cc.xml deleted file mode 100644 index aed0e8d31..000000000 --- a/grc/blocks/gr_dd_mpsk_sync_cc.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##DD MPSK Sync -################################################### - --> -<block> - <name>DD MPSK Sync</name> - <key>gr_dd_mpsk_sync_cc</key> - <import>from gnuradio import gr</import> - <make>gr.dd_mpsk_sync_cc($alpha, $beta, $max_freq, $min_freq, $ref_phase, $omega, $gain_omega, $mu, $gain_mu)</make> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <param> - <name>Beta</name> - <key>beta</key> - <type>real</type> - </param> - <param> - <name>Max Freq</name> - <key>max_freq</key> - <type>real</type> - </param> - <param> - <name>Min Freq</name> - <key>min_freq</key> - <type>real</type> - </param> - <param> - <name>Reference Phase</name> - <key>ref_phase</key> - <type>real</type> - </param> - <param> - <name>Omega</name> - <key>omega</key> - <type>real</type> - </param> - <param> - <name>Gain Omega</name> - <key>gain_omega</key> - <type>real</type> - </param> - <param> - <name>Mu</name> - <key>mu</key> - <type>real</type> - </param> - <param> - <name>Gain Mu</name> - <key>gain_mu</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/blocks/gr_udp_sink.xml b/grc/blocks/gr_udp_sink.xml index e9f6c2be8..45f81075f 100644 --- a/grc/blocks/gr_udp_sink.xml +++ b/grc/blocks/gr_udp_sink.xml @@ -8,7 +8,7 @@ <name>UDP Sink</name> <key>gr_udp_sink</key> <import>from gnuradio import gr</import> - <make>gr.udp_sink($type.size*$vlen, $ipaddr_local, $port_local, $ipaddr_remote, $port_remote, $mtu)</make> + <make>gr.udp_sink($type.size*$vlen, $ipaddr, $port, $psize, $eof)</make> <callback>set_mtu($mtu)</callback> <param> <name>Input Type</name> @@ -41,34 +41,26 @@ </option> </param> <param> - <name>Local IP Address</name> - <key>ipaddr_local</key> - <value>127.0.0.1</value> + <name>Destination IP Address</name> + <key>ipaddr</key> <type>string</type> </param> <param> - <name>Local Port</name> - <key>port_local</key> - <value>0</value> + <name>Destination Port</name> + <key>port</key> <type>int</type> </param> <param> - <name>Remote IP Address</name> - <key>ipaddr_remote</key> - <value>127.0.0.1</value> - <type>string</type> - </param> - <param> - <name>Remote Port</name> - <key>port_remote</key> - <value>1234</value> + <name>Payload Size</name> + <key>psize</key> + <value>1472</value> <type>int</type> </param> <param> - <name>MTU</name> - <key>mtu</key> - <value>1024</value> - <type>int</type> + <name>Send Null Pkt as EOF</name> + <key>eof</key> + <value>True</value> + <type>bool</type> </param> <param> <name>Vec Length</name> diff --git a/grc/blocks/gr_udp_source.xml b/grc/blocks/gr_udp_source.xml index f03adf802..a1b961651 100644 --- a/grc/blocks/gr_udp_source.xml +++ b/grc/blocks/gr_udp_source.xml @@ -8,7 +8,7 @@ <name>UDP Source</name> <key>gr_udp_source</key> <import>from gnuradio import gr</import> - <make>gr.udp_source($type.size*$vlen, $ipaddr, $port, $mtu)</make> + <make>gr.udp_source($type.size*$vlen, $ipaddr, $port, $psize, $eof, $wait)</make> <callback>set_mtu($mtu)</callback> <param> <name>Output Type</name> @@ -53,12 +53,24 @@ <type>int</type> </param> <param> - <name>MTU</name> - <key>mtu</key> - <value>1024</value> + <name>Payload Size</name> + <key>psize</key> + <value>1472</value> <type>int</type> </param> <param> + <name>Null Pkt is EOF</name> + <key>eof</key> + <value>True</value> + <type>bool</type> + </param> + <param> + <name>Wait for Data</name> + <key>wait</key> + <value>True</value> + <type>bool</type> + </param> + <param> <name>Vec Length</name> <key>vlen</key> <value>1</value> diff --git a/grc/blocks/usrp_dual_source_x.xml b/grc/blocks/usrp_dual_source_x.xml index ad9a860ac..07d3174bb 100644 --- a/grc/blocks/usrp_dual_source_x.xml +++ b/grc/blocks/usrp_dual_source_x.xml @@ -8,7 +8,11 @@ <name>USRP Dual Source</name> <key>usrp_dual_source_x</key> <import>from grc_gnuradio import usrp as grc_usrp</import> - <make>grc_usrp.dual_source_$(type.fcn)(which=$which, rx_ant_a=$rx_ant_a, rx_ant_b=$rx_ant_b) + <make>grc_usrp.dual_source_$(type.fcn)( + which=$which, + rx_ant_a=$rx_ant_a, rx_ant_b=$rx_ant_b, + rx_source_a=$rx_source_a, rx_source_b=$rx_source_b, +) #if $format() self.$(id).set_format(width=$format.width, shift=$format.shift) #end if @@ -189,6 +193,36 @@ self.$(id).set_gain_b($gain_b)</make> <key>RX2</key> </option> </param> + <param> + <name>RX Source A</name> + <key>rx_source_a</key> + <value>A</value> + <type>string</type> + <hide>#if $rx_source_a() == 'A' then 'part' else 'none'#</hide> + <option> + <name>Side A</name> + <key>A</key> + </option> + <option> + <name>Side B</name> + <key>B</key> + </option> + </param> + <param> + <name>RX Source B</name> + <key>rx_source_b</key> + <value>B</value> + <type>string</type> + <hide>#if $rx_source_b() == 'B' then 'part' else 'none'#</hide> + <option> + <name>Side A</name> + <key>A</key> + </option> + <option> + <name>Side B</name> + <key>B</key> + </option> + </param> <source> <name>Aout</name> <type>$type</type> diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am index bfbdee940..23bb70bf5 100644 --- a/grc/freedesktop/Makefile.am +++ b/grc/freedesktop/Makefile.am @@ -30,7 +30,7 @@ dist_ourdata_DATA = \ grc-icon-48.png \ grc-icon-32.png \ gnuradio-grc.xml \ - gnuradio-grc.desktop \ + gnuradio-gnuradio-companion.desktop \ gnuradio-usrp2_probe.desktop \ gnuradio-usrp_probe.desktop diff --git a/grc/freedesktop/gnuradio-grc.desktop b/grc/freedesktop/gnuradio-gnuradio-companion.desktop index d9c70ca92..5fd049780 100644 --- a/grc/freedesktop/gnuradio-grc.desktop +++ b/grc/freedesktop/gnuradio-gnuradio-companion.desktop @@ -2,7 +2,7 @@ Version=1.0 Type=Application Name=GRC -Exec=grc %F +Exec=gnuradio-companion %F Categories=Development; MimeType=application/gnuradio-grc; Icon=gnuradio-grc diff --git a/grc/freedesktop/grc_setup_freedesktop.in b/grc/freedesktop/grc_setup_freedesktop.in index db6506452..a0c5ac193 100644 --- a/grc/freedesktop/grc_setup_freedesktop.in +++ b/grc/freedesktop/grc_setup_freedesktop.in @@ -8,7 +8,7 @@ ################################################## ICON_SIZES="32 48 64 128 256" -MENU_ITEMS="grc usrp2_probe usrp_probe" +MENU_ITEMS="gnuradio-companion usrp2_probe usrp_probe" if [ -n "$2" ]; then SRCDIR="$2" else diff --git a/grc/grc_gnuradio/usrp/dual_usrp.py b/grc/grc_gnuradio/usrp/dual_usrp.py index b26dbddd4..66b76b2df 100644 --- a/grc/grc_gnuradio/usrp/dual_usrp.py +++ b/grc/grc_gnuradio/usrp/dual_usrp.py @@ -1,4 +1,4 @@ -# Copyright 2009 Free Software Foundation, Inc. +# Copyright 2009, 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -27,7 +27,7 @@ from gnuradio import gr class _dual_source(gr.hier_block2): """A dual usrp source of IO type short or complex.""" - def __init__(self, which, rx_ant_a='RXA', rx_ant_b='RXA'): + def __init__(self, which, rx_ant_a='RXA', rx_ant_b='RXA', rx_source_a='A', rx_source_b='B'): """ USRP dual source contructor. @param which the unit number @@ -42,8 +42,8 @@ class _dual_source(gr.hier_block2): ) #create usrp object self._make_usrp(which=which, nchan=2) - subdev_spec_a = common.to_spec('A', rx_ant_a) - subdev_spec_b = common.to_spec('B', rx_ant_b) + subdev_spec_a = common.to_spec(rx_source_a, rx_ant_a) + subdev_spec_b = common.to_spec(rx_source_b, rx_ant_b) self._get_u().set_mux(self._get_u().determine_rx_mux_value(subdev_spec_a, subdev_spec_b)) self._subdev_a = self._get_u().selected_subdev(subdev_spec_a) self._subdev_b = self._get_u().selected_subdev(subdev_spec_b) diff --git a/grc/gui/DrawingArea.py b/grc/gui/DrawingArea.py index b70468ed0..790df7c3f 100644 --- a/grc/gui/DrawingArea.py +++ b/grc/gui/DrawingArea.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -82,19 +82,21 @@ class DrawingArea(gtk.DrawingArea): Forward button click information to the flow graph. """ self.ctrl_mask = event.state & gtk.gdk.CONTROL_MASK - self._flow_graph.handle_mouse_button_press( - left_click=(event.button == 1), + if event.button == 1: self._flow_graph.handle_mouse_selector_press( double_click=(event.type == gtk.gdk._2BUTTON_PRESS), coordinate=(event.x, event.y), ) + if event.button == 3: self._flow_graph.handle_mouse_context_press( + coordinate=(event.x, event.y), + event=event, + ) def _handle_mouse_button_release(self, widget, event): """ Forward button release information to the flow graph. """ self.ctrl_mask = event.state & gtk.gdk.CONTROL_MASK - self._flow_graph.handle_mouse_button_release( - left_click=(event.button == 1), + if event.button == 1: self._flow_graph.handle_mouse_selector_release( coordinate=(event.x, event.y), ) diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py index 5adecccc1..897145a1d 100644 --- a/grc/gui/FlowGraph.py +++ b/grc/gui/FlowGraph.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -51,6 +51,19 @@ class FlowGraph(Element): #selected ports self._old_selected_port = None self._new_selected_port = None + #context menu + self._context_menu = gtk.Menu() + for action in [ + Actions.BLOCK_CUT, + Actions.BLOCK_COPY, + Actions.BLOCK_PASTE, + Actions.ELEMENT_DELETE, + Actions.BLOCK_ROTATE_CCW, + Actions.BLOCK_ROTATE_CW, + Actions.BLOCK_ENABLE, + Actions.BLOCK_DISABLE, + Actions.BLOCK_PARAM_MODIFY, + ]: self._context_menu.append(action.create_menu_item()) ########################################################################### # Access Drawing Area @@ -425,14 +438,27 @@ class FlowGraph(Element): ########################################################################## ## Event Handlers ########################################################################## - def handle_mouse_button_press(self, left_click, double_click, coordinate): + def handle_mouse_context_press(self, coordinate, event): """ - A mouse button is pressed, only respond to left clicks. + The context mouse button was pressed: + If no elements were selected, perform re-selection at this coordinate. + Then, show the context menu at the mouse click location. + """ + selections = self.what_is_selected(coordinate) + if not set(selections).intersection(self.get_selected_elements()): + self.set_coordinate(coordinate) + self.mouse_pressed = True + self.update_selected_elements() + self.mouse_pressed = False + self._context_menu.popup(None, None, None, event.button, event.time) + + def handle_mouse_selector_press(self, double_click, coordinate): + """ + The selector mouse button was pressed: Find the selected element. Attempt a new connection if possible. Open the block params window on a double click. Update the selection state of the flow graph. """ - if not left_click: return self.press_coor = coordinate self.set_coordinate(coordinate) self.time = 0 @@ -444,11 +470,12 @@ class FlowGraph(Element): self.mouse_pressed = False Actions.BLOCK_PARAM_MODIFY() - def handle_mouse_button_release(self, left_click, coordinate): + def handle_mouse_selector_release(self, coordinate): """ - A mouse button is released, record the state. + The selector mouse button was released: + Update the state, handle motion (dragging). + And update the selected flowgraph elements. """ - if not left_click: return self.set_coordinate(coordinate) self.time = 0 self.mouse_pressed = False diff --git a/grc/gui/Param.py b/grc/gui/Param.py index b3018dab2..7c00c1b67 100644 --- a/grc/gui/Param.py +++ b/grc/gui/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -135,10 +135,21 @@ PARAM_LABEL_MARKUP_TMPL="""\ <span underline="$underline" foreground="$foreground" font_desc="Sans 9">$encode($param.get_name())</span>""" TIP_MARKUP_TMPL="""\ +######################################## +#def truncate(string) + #set $max_len = 100 + #set $string = str($string) + #if len($string) > $max_len +$('%s...%s'%($string[:$max_len/2], $string[-$max_len/2:]))#slurp + #else +$string#slurp + #end if +#end def +######################################## Key: $param.get_key() Type: $param.get_type() #if $param.is_valid() -Value: $param.get_evaluated() +Value: $truncate($param.get_evaluated()) #elif len($param.get_error_messages()) == 1 Error: $(param.get_error_messages()[0]) #else diff --git a/grc/python/Generator.py b/grc/python/Generator.py index ed7995716..acd98ef84 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA import os import subprocess +import tempfile from Cheetah.Template import Template import expr_utils from Constants import \ @@ -45,6 +46,10 @@ class Generator(object): else: self._mode = TOP_BLOCK_FILE_MODE dirname = os.path.dirname(file_path) + #handle the case where the directory is read-only + #in this case, use the system's temp directory + if not os.access(dirname, os.W_OK): + dirname = tempfile.gettempdir() filename = self._flow_graph.get_option('id') + '.py' self._file_path = os.path.join(dirname, filename) diff --git a/grc/python/Param.py b/grc/python/Param.py index e04bc8fcb..6dd008d1d 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -108,7 +108,23 @@ class Param(_Param, _GUIParam): Get the repr (nice string format) for this param. @return the string representation """ - if not self.is_valid(): return self.get_value() + ################################################## + # truncate helper method + ################################################## + def _truncate(string, style=0): + max_len = max(27 - len(self.get_name()), 3) + if len(string) > max_len: + if style < 0: #front truncate + string = '...' + string[3-max_len:] + elif style == 0: #center truncate + string = string[:max_len/2 -3] + '...' + string[-max_len/2:] + elif style > 0: #rear truncate + string = string[:max_len-3] + '...' + return string + ################################################## + # simple conditions + ################################################## + if not self.is_valid(): return _truncate(self.get_value()) if self.get_value() in self.get_option_keys(): return self.get_option(self.get_value()).get_name() ################################################## # display logic for numbers @@ -126,7 +142,6 @@ class Param(_Param, _GUIParam): # split up formatting by type ################################################## truncate = 0 #default center truncate - max_len = max(27 - len(self.get_name()), 3) e = self.get_evaluated() t = self.get_type() if isinstance(e, bool): return str(e) @@ -141,16 +156,9 @@ class Param(_Param, _GUIParam): truncate = -1 else: dt_str = str(e) #other types ################################################## - # truncate + # done ################################################## - if len(dt_str) > max_len: - if truncate < 0: #front truncate - dt_str = '...' + dt_str[3-max_len:] - elif truncate == 0: #center truncate - dt_str = dt_str[:max_len/2 -3] + '...' + dt_str[-max_len/2:] - elif truncate > 0: #rear truncate - dt_str = dt_str[:max_len-3] + '...' - return dt_str + return _truncate(dt_str, truncate) def get_input(self, *args, **kwargs): if self.get_type() in ('file_open', 'file_save'): return FileParam(self, *args, **kwargs) diff --git a/grc/python/Platform.py b/grc/python/Platform.py index bb56d361b..04db0b9b0 100644 --- a/grc/python/Platform.py +++ b/grc/python/Platform.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -64,7 +64,7 @@ class Platform(_Platform, _GUIPlatform): version=gr.version(), key='grc', license=__doc__.strip(), - website='http://gnuradio.org/trac/wiki/GNURadioCompanion', + website='http://gnuradio.org/redmine/wiki/gnuradio/GNURadioCompanion', block_paths=block_paths, block_dtd=BLOCK_DTD, default_flow_graph=DEFAULT_FLOW_GRAPH, diff --git a/grc/scripts/Makefile.am b/grc/scripts/Makefile.am index e24f88800..9019ec5cc 100644 --- a/grc/scripts/Makefile.am +++ b/grc/scripts/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,4 +21,4 @@ include $(top_srcdir)/Makefile.common -dist_bin_SCRIPTS = grc usrp2_probe usrp_probe +dist_bin_SCRIPTS = gnuradio-companion usrp2_probe usrp_probe diff --git a/grc/scripts/grc b/grc/scripts/gnuradio-companion index a4115c39f..a4115c39f 100755 --- a/grc/scripts/grc +++ b/grc/scripts/gnuradio-companion |