diff options
author | jblum | 2009-06-25 17:59:26 +0000 |
---|---|---|
committer | jblum | 2009-06-25 17:59:26 +0000 |
commit | deb7e98d2c413869e6615fb011f24c2a9944c6d3 (patch) | |
tree | abce58b2fbbcbddfc4bceefda1401b3ead72716a /grc | |
parent | 636a8cae9b5fd9cdc1e45f7a630068b905713057 (diff) | |
download | gnuradio-deb7e98d2c413869e6615fb011f24c2a9944c6d3.tar.gz gnuradio-deb7e98d2c413869e6615fb011f24c2a9944c6d3.tar.bz2 gnuradio-deb7e98d2c413869e6615fb011f24c2a9944c6d3.zip |
better fix for selected ports, added variable config example to examples
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11283 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc')
-rw-r--r-- | grc/examples/Makefile.am | 1 | ||||
-rw-r--r-- | grc/examples/simple/variable_config.grc | 329 | ||||
-rw-r--r-- | grc/gui/FlowGraph.py | 8 | ||||
-rw-r--r-- | grc/todo.txt | 1 |
4 files changed, 334 insertions, 5 deletions
diff --git a/grc/examples/Makefile.am b/grc/examples/Makefile.am index 95f352a64..969485c0d 100644 --- a/grc/examples/Makefile.am +++ b/grc/examples/Makefile.am @@ -31,6 +31,7 @@ simpledatadir = $(grc_examples_prefix)/simple dist_simpledata_DATA = \ simple/ber_simulation.grc \ simple/dpsk_loopback.grc \ + simple/variable_config.grc \ simple/var_sink_taps.grc trellisdatadir = $(grc_examples_prefix)/trellis diff --git a/grc/examples/simple/variable_config.grc b/grc/examples/simple/variable_config.grc new file mode 100644 index 000000000..95c287cce --- /dev/null +++ b/grc/examples/simple/variable_config.grc @@ -0,0 +1,329 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jun 25 10:56:04 2009</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>variable_config_demo</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Variable Config Block Demonstration</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>Save/Load freq from a config file.</value> + </param> + <param> + <key>window_size</key> + <value>1280, 1024</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>autostart</key> + <value>True</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>32000</value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 170)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_config</key> + <param> + <key>id</key> + <value>freq_init</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>type</key> + <value>real</value> + </param> + <param> + <key>config_file</key> + <value>config.conf</value> + </param> + <param> + <key>section</key> + <value>main</value> + </param> + <param> + <key>option</key> + <value>freq</value> + </param> + <param> + <key>writeback</key> + <value>freq</value> + </param> + <param> + <key>_coordinate</key> + <value>(255, 17)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>freq</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frequency (Hz)</value> + </param> + <param> + <key>value</key> + <value>freq_init</value> + </param> + <param> + <key>min</key> + <value>-samp_rate/2</value> + </param> + <param> + <key>max</key> + <value>samp_rate/2</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(429, 24)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(392, 233)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_sig_source_x</key> + <param> + <key>id</key> + <value>gr_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>waveform</key> + <value>gr.GR_COS_WAVE</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>amp</key> + <value>1</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(148, 233)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>wxgui_fftsink2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>title</key> + <value>FFT Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>baseband_freq</key> + <value>0</value> + </param> + <param> + <key>y_per_div</key> + <value>10</value> + </param> + <param> + <key>y_divs</key> + <value>10</value> + </param> + <param> + <key>ref_level</key> + <value>50</value> + </param> + <param> + <key>fft_size</key> + <value>1024</value> + </param> + <param> + <key>fft_rate</key> + <value>30</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(671, 233)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>gr_sig_source_x_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>wxgui_fftsink2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py index 63f289027..f8028f199 100644 --- a/grc/gui/FlowGraph.py +++ b/grc/gui/FlowGraph.py @@ -281,10 +281,10 @@ class FlowGraph(Element): for selected in selected_elements: if selected in elements: continue selected_elements.remove(selected) - if self._old_selected_port not in elements: - self._old_selected_port = None - if self._new_selected_port not in elements: - self._new_selected_port = None + try: assert self._old_selected_port.get_parent() in elements + except: self._old_selected_port = None + try: assert self._new_selected_port.get_parent() in elements + except: self._new_selected_port = None #update highlighting for element in elements: element.set_highlighted(element in selected_elements) diff --git a/grc/todo.txt b/grc/todo.txt index 4c6471c76..3f47a1bfc 100644 --- a/grc/todo.txt +++ b/grc/todo.txt @@ -2,7 +2,6 @@ # Examples ################################################## * Push-to-Talk example -* Variable Config usage example * Start/Stop the flow graph ################################################## |