commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11283 - in gnuradio/trunk/grc: . examples examples/si


From: jblum
Subject: [Commit-gnuradio] r11283 - in gnuradio/trunk/grc: . examples examples/simple gui
Date: Thu, 25 Jun 2009 11:59:26 -0600 (MDT)

Author: jblum
Date: 2009-06-25 11:59:26 -0600 (Thu, 25 Jun 2009)
New Revision: 11283

Added:
   gnuradio/trunk/grc/examples/simple/variable_config.grc
Modified:
   gnuradio/trunk/grc/examples/Makefile.am
   gnuradio/trunk/grc/gui/FlowGraph.py
   gnuradio/trunk/grc/todo.txt
Log:
better fix for selected ports, added variable config example to examples

Modified: gnuradio/trunk/grc/examples/Makefile.am
===================================================================
--- gnuradio/trunk/grc/examples/Makefile.am     2009-06-25 17:36:36 UTC (rev 
11282)
+++ gnuradio/trunk/grc/examples/Makefile.am     2009-06-25 17:59:26 UTC (rev 
11283)
@@ -31,6 +31,7 @@
 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

Added: gnuradio/trunk/grc/examples/simple/variable_config.grc
===================================================================
--- gnuradio/trunk/grc/examples/simple/variable_config.grc                      
        (rev 0)
+++ gnuradio/trunk/grc/examples/simple/variable_config.grc      2009-06-25 
17:59:26 UTC (rev 11283)
@@ -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>

Modified: gnuradio/trunk/grc/gui/FlowGraph.py
===================================================================
--- gnuradio/trunk/grc/gui/FlowGraph.py 2009-06-25 17:36:36 UTC (rev 11282)
+++ gnuradio/trunk/grc/gui/FlowGraph.py 2009-06-25 17:59:26 UTC (rev 11283)
@@ -281,10 +281,10 @@
                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)

Modified: gnuradio/trunk/grc/todo.txt
===================================================================
--- gnuradio/trunk/grc/todo.txt 2009-06-25 17:36:36 UTC (rev 11282)
+++ gnuradio/trunk/grc/todo.txt 2009-06-25 17:59:26 UTC (rev 11283)
@@ -2,7 +2,6 @@
 # Examples
 ##################################################
 * Push-to-Talk example
-* Variable Config usage example
 * Start/Stop the flow graph
 
 ##################################################





reply via email to

[Prev in Thread] Current Thread [Next in Thread]