diff options
Diffstat (limited to 'grc/examples')
-rw-r--r-- | grc/examples/Makefile.am | 28 | ||||
-rw-r--r-- | grc/examples/audio/Makefile.am | 26 | ||||
-rw-r--r-- | grc/examples/audio/dial_tone.grc | 375 | ||||
-rw-r--r-- | grc/examples/simple/Makefile.am | 26 | ||||
-rw-r--r-- | grc/examples/simple/ber_simulation.grc | 540 | ||||
-rw-r--r-- | grc/examples/usrp/Makefile.am | 28 | ||||
-rw-r--r-- | grc/examples/usrp/usrp_two_tone_loopback.grc | 675 | ||||
-rw-r--r-- | grc/examples/usrp/usrp_wbfm_receive.grc | 454 | ||||
-rw-r--r-- | grc/examples/xmlrpc/Makefile.am | 30 | ||||
-rw-r--r-- | grc/examples/xmlrpc/readme.txt | 18 | ||||
-rw-r--r-- | grc/examples/xmlrpc/xmlrpc_client.grc | 312 | ||||
-rw-r--r-- | grc/examples/xmlrpc/xmlrpc_client_script.py | 23 | ||||
-rw-r--r-- | grc/examples/xmlrpc/xmlrpc_server.grc | 384 |
13 files changed, 2919 insertions, 0 deletions
diff --git a/grc/examples/Makefile.am b/grc/examples/Makefile.am new file mode 100644 index 000000000..9bba14bc9 --- /dev/null +++ b/grc/examples/Makefile.am @@ -0,0 +1,28 @@ +# +# Copyright 2008 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/grc/Makefile.common + +SUBDIRS = \ + audio \ + simple \ + usrp \ + xmlrpc diff --git a/grc/examples/audio/Makefile.am b/grc/examples/audio/Makefile.am new file mode 100644 index 000000000..78800edcc --- /dev/null +++ b/grc/examples/audio/Makefile.am @@ -0,0 +1,26 @@ +# +# Copyright 2008 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/grc/Makefile.common + +datadir = $(grc_examples_prefix)/audio + +EXTRA_DIST = dial_tone.grc diff --git a/grc/examples/audio/dial_tone.grc b/grc/examples/audio/dial_tone.grc new file mode 100644 index 000000000..6f96d9748 --- /dev/null +++ b/grc/examples/audio/dial_tone.grc @@ -0,0 +1,375 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jul 24 14:27:48 2008</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>dial_tone</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Dial Tone</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>example flow graph</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>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_vxx</key> + <param> + <key>id</key> + <value>gr_add_vxx</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>3</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(513, 277)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>audio_sink</key> + <param> + <key>id</key> + <value>audio_sink</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>samp_rate</key> + <value>32000</value> + </param> + <param> + <key>device_name</key> + <value/> + </param> + <param> + <key>ok_to_block</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(699, 112)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(238, 380)</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</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>440</value> + </param> + <param> + <key>amp</key> + <value>ampl</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(240, 208)</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_x0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>350</value> + </param> + <param> + <key>amp</key> + <value>ampl</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(240, 38)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>ampl</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Volume</value> + </param> + <param> + <key>value</key> + <value>.4</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>.5</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(634, 413)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>noise</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Noise</value> + </param> + <param> + <key>value</key> + <value>.005</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>.2</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(443, 412)</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>(11, 171)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>gr_sig_source_x0</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sig_source_x</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>2</sink_key> + </connection> + <connection> + <source_block_id>gr_add_vxx</source_block_id> + <sink_block_id>audio_sink</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph>
\ No newline at end of file diff --git a/grc/examples/simple/Makefile.am b/grc/examples/simple/Makefile.am new file mode 100644 index 000000000..a2fcd614e --- /dev/null +++ b/grc/examples/simple/Makefile.am @@ -0,0 +1,26 @@ +# +# Copyright 2008 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/grc/Makefile.common + +datadir = $(grc_examples_prefix)/simple + +EXTRA_DIST = ber_simulation.grc diff --git a/grc/examples/simple/ber_simulation.grc b/grc/examples/simple/ber_simulation.grc new file mode 100644 index 000000000..0e4ce64ed --- /dev/null +++ b/grc/examples/simple/ber_simulation.grc @@ -0,0 +1,540 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jul 24 14:28:06 2008</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>ber_sim</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>BER Simulation</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>Adjust the noise and constellation... see what happens!</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>_coordinate</key> + <value>(16, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_vxx</key> + <param> + <key>id</key> + <value>gr_add_vxx</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(652, 395)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_constellationsink2</key> + <param> + <key>id</key> + <value>wxgui_constellationsink2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>"Constellation: "+str(const)</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>frame_decim</key> + <value>15</value> + </param> + <param> + <key>marker</key> + <value>set_format_plus</value> + </param> + <param> + <key>grid_pos</key> + <value>2, 0, 1, 1</value> + </param> + <param> + <key>_coordinate</key> + <value>(907, 334)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(235, 379)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>gr_chunks_to_symbols_xx</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>byte</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>const</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(360, 237)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_numbersink2</key> + <param> + <key>id</key> + <value>wxgui_numbersink2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>BER</value> + </param> + <param> + <key>units</key> + <value>%</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>base_value</key> + <value>0.0</value> + </param> + <param> + <key>min_value</key> + <value>0.0</value> + </param> + <param> + <key>max_value</key> + <value>1.0</value> + </param> + <param> + <key>factor</key> + <value>100</value> + </param> + <param> + <key>decimal_places</key> + <value>4</value> + </param> + <param> + <key>ref_level</key> + <value>0</value> + </param> + <param> + <key>number_rate</key> + <value>15</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>options</key> + <value>none</value> + </param> + <param> + <key>show_gauge</key> + <value>False</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 1</value> + </param> + <param> + <key>_coordinate</key> + <value>(1062, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</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>(397, 27)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blks2_error_rate</key> + <param> + <key>id</key> + <value>blks2_error_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>"BER"</value> + </param> + <param> + <key>win_size</key> + <value>1000000</value> + </param> + <param> + <key>bits_per_symbol</key> + <value>int(math.log(len(const))/math.log(2))</value> + </param> + <param> + <key>_coordinate</key> + <value>(670, 41)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_constellation_decoder_cb</key> + <param> + <key>id</key> + <value>gr_constellation_decoder_cb</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>sym_position</key> + <value>const</value> + </param> + <param> + <key>sym_value_out</key> + <value>range(len(const))</value> + </param> + <param> + <key>_coordinate</key> + <value>(708, 224)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>random_source_x</key> + <param> + <key>id</key> + <value>random_source_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>len(const)</value> + </param> + <param> + <key>num_samps</key> + <value>1000000</value> + </param> + <param> + <key>repeat</key> + <value>False</value> + </param> + <param> + <key>_coordinate</key> + <value>(15, 244)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noise</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>.25</value> + </param> + <param> + <key>_coordinate</key> + <value>(18, 386)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>const</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1+1j, 1-1j, -1-1j, -1+1j</value> + </param> + <param> + <key>_coordinate</key> + <value>(16, 461)</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>50e3</value> + </param> + <param> + <key>_coordinate</key> + <value>(20, 168)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>import</key> + <param> + <key>id</key> + <value>import</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>import</key> + <value>import math</value> + </param> + <param> + <key>_coordinate</key> + <value>(138, 168)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blks2_error_rate</source_block_id> + <sink_block_id>wxgui_numbersink2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle</source_block_id> + <sink_block_id>blks2_error_rate</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_constellation_decoder_cb</source_block_id> + <sink_block_id>blks2_error_rate</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_add_vxx</source_block_id> + <sink_block_id>gr_constellation_decoder_cb</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_chunks_to_symbols_xx</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_add_vxx</source_block_id> + <sink_block_id>wxgui_constellationsink2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x</source_block_id> + <sink_block_id>gr_throttle</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>random_source_x</source_block_id> + <sink_block_id>gr_chunks_to_symbols_xx</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph>
\ No newline at end of file diff --git a/grc/examples/usrp/Makefile.am b/grc/examples/usrp/Makefile.am new file mode 100644 index 000000000..9ad96c915 --- /dev/null +++ b/grc/examples/usrp/Makefile.am @@ -0,0 +1,28 @@ +# +# Copyright 2008 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/grc/Makefile.common + +datadir = $(grc_examples_prefix)/usrp + +EXTRA_DIST = \ + usrp_two_tone_loopback.grc \ + usrp_wbfm_receive.grc diff --git a/grc/examples/usrp/usrp_two_tone_loopback.grc b/grc/examples/usrp/usrp_two_tone_loopback.grc new file mode 100644 index 000000000..ccbe190ec --- /dev/null +++ b/grc/examples/usrp/usrp_two_tone_loopback.grc @@ -0,0 +1,675 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jul 24 14:27:46 2008</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>top_block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>USRP Loopback - 2 Tone</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>Loopback test with basic rx and basic tx</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>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>usrp_simple_source_x</key> + <param> + <key>id</key> + <value>usrp_simple_source_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>number</key> + <value>0</value> + </param> + <param> + <key>subdev_spec</key> + <value>None</value> + </param> + <param> + <key>frequency</key> + <value>tun_freq</value> + </param> + <param> + <key>decimation</key> + <value>200</value> + </param> + <param> + <key>gain</key> + <value>20</value> + </param> + <param> + <key>mux</key> + <value>0x0</value> + </param> + <param> + <key>auto_tr</key> + <value>None</value> + </param> + <param> + <key>rx_ant</key> + <value>None</value> + </param> + <param> + <key>_coordinate</key> + <value>(578, 319)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>wxgui_fftsink2</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>8</value> + </param> + <param> + <key>ref_level</key> + <value>100</value> + </param> + <param> + <key>fft_size</key> + <value>512*2</value> + </param> + <param> + <key>fft_rate</key> + <value>15</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 2, 2, 4</value> + </param> + <param> + <key>_coordinate</key> + <value>(845, 228)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>tone2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Tone 2</value> + </param> + <param> + <key>value</key> + <value>75e3</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>150000</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 4, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(397, 478)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>tone1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Tone 1</value> + </param> + <param> + <key>value</key> + <value>50e3</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>150000</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 2, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(220, 475)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>noise_ampl</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Noise Ampl</value> + </param> + <param> + <key>value</key> + <value>2000</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>5000</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>vertical</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 1, 2, 1</value> + </param> + <param> + <key>_coordinate</key> + <value>(20, 243)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>tone_ampl</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Tone Ampl</value> + </param> + <param> + <key>value</key> + <value>5000</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>5000</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>vertical</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 2, 1</value> + </param> + <param> + <key>_coordinate</key> + <value>(21, 422)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>usrp_simple_sink_x</key> + <param> + <key>id</key> + <value>usrp_simple_sink_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>number</key> + <value>0</value> + </param> + <param> + <key>subdev_spec</key> + <value>None</value> + </param> + <param> + <key>frequency</key> + <value>tun_freq</value> + </param> + <param> + <key>interpolation</key> + <value>400</value> + </param> + <param> + <key>gain</key> + <value>0</value> + </param> + <param> + <key>mux</key> + <value>0x0</value> + </param> + <param> + <key>auto_tr</key> + <value>None</value> + </param> + <param> + <key>tx_enb</key> + <value>None</value> + </param> + <param> + <key>_coordinate</key> + <value>(835, 5)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_float_to_complex</key> + <param> + <key>id</key> + <value>gr_float_to_complex</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>_coordinate</key> + <value>(634, 226)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_vxx</key> + <param> + <key>id</key> + <value>gr_add_vxx</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>3</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(528, 78)</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</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>tone1</value> + </param> + <param> + <key>amp</key> + <value>tone_ampl</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(258, 20)</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_x0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>tone2</value> + </param> + <param> + <key>amp</key> + <value>tone_ampl</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(255, 179)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_noise_source_x</key> + <param> + <key>id</key> + <value>gr_noise_source_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>gr.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise_ampl</value> + </param> + <param> + <key>seed</key> + <value>42</value> + </param> + <param> + <key>_coordinate</key> + <value>(257, 337)</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>64e6/200</value> + </param> + <param> + <key>_coordinate</key> + <value>(9, 166)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>tun_freq</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>int(100e6)</value> + </param> + <param> + <key>_coordinate</key> + <value>(116, 166)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>gr_sig_source_x</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_sig_source_x0</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_noise_source_x</source_block_id> + <sink_block_id>gr_add_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>2</sink_key> + </connection> + <connection> + <source_block_id>usrp_simple_source_x</source_block_id> + <sink_block_id>wxgui_fftsink2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_float_to_complex</source_block_id> + <sink_block_id>usrp_simple_sink_x</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_vxx</source_block_id> + <sink_block_id>gr_float_to_complex</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_add_vxx</source_block_id> + <sink_block_id>gr_float_to_complex</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> +</flow_graph>
\ No newline at end of file diff --git a/grc/examples/usrp/usrp_wbfm_receive.grc b/grc/examples/usrp/usrp_wbfm_receive.grc new file mode 100644 index 000000000..7fb621241 --- /dev/null +++ b/grc/examples/usrp/usrp_wbfm_receive.grc @@ -0,0 +1,454 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jul 24 14:27:45 2008</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>top_block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>USRP WBFM Receive</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>WBFM Receive with Basic RX or TV RX</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>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>usrp_simple_source_x</key> + <param> + <key>id</key> + <value>usrp_simple_source_x</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>number</key> + <value>0</value> + </param> + <param> + <key>subdev_spec</key> + <value>None</value> + </param> + <param> + <key>frequency</key> + <value>(freq+fine)*1e6</value> + </param> + <param> + <key>decimation</key> + <value>decim</value> + </param> + <param> + <key>gain</key> + <value>20</value> + </param> + <param> + <key>mux</key> + <value>0x0</value> + </param> + <param> + <key>auto_tr</key> + <value>None</value> + </param> + <param> + <key>rx_ant</key> + <value>None</value> + </param> + <param> + <key>_coordinate</key> + <value>(277, 29)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>fine</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Fine Freq</value> + </param> + <param> + <key>value</key> + <value>0</value> + </param> + <param> + <key>min</key> + <value>-.1</value> + </param> + <param> + <key>max</key> + <value>.1</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 2, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(275, 246)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blks2_wfm_rcv</key> + <param> + <key>id</key> + <value>blks2_wfm_rcv</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>quad_rate</key> + <value>64e6/decim</value> + </param> + <param> + <key>audio_decimation</key> + <value>10</value> + </param> + <param> + <key>_coordinate</key> + <value>(510, 37)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>audio_sink</key> + <param> + <key>id</key> + <value>audio_sink</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>samp_rate</key> + <value>32000</value> + </param> + <param> + <key>device_name</key> + <value/> + </param> + <param> + <key>ok_to_block</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(703, 241)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>const</key> + <value>volume</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(764, 55)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>wxgui_fftsink2</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>64e6/decim</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>8</value> + </param> + <param> + <key>ref_level</key> + <value>50</value> + </param> + <param> + <key>fft_size</key> + <value>512</value> + </param> + <param> + <key>fft_rate</key> + <value>15</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>grid_pos</key> + <value>2, 0, 2, 4</value> + </param> + <param> + <key>_coordinate</key> + <value>(512, 191)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>volume</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Volume</value> + </param> + <param> + <key>value</key> + <value>1</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>10</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 1, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(991, 40)</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</value> + </param> + <param> + <key>value</key> + <value>100</value> + </param> + <param> + <key>min</key> + <value>87.5</value> + </param> + <param> + <key>max</key> + <value>108.0</value> + </param> + <param> + <key>num_steps</key> + <value>1000</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(104, 243)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>decim</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>200</value> + </param> + <param> + <key>_coordinate</key> + <value>(14, 173)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>usrp_simple_source_x</source_block_id> + <sink_block_id>blks2_wfm_rcv</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>usrp_simple_source_x</source_block_id> + <sink_block_id>wxgui_fftsink2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blks2_wfm_rcv</source_block_id> + <sink_block_id>gr_multiply_const_vxx</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_multiply_const_vxx</source_block_id> + <sink_block_id>audio_sink</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph>
\ No newline at end of file diff --git a/grc/examples/xmlrpc/Makefile.am b/grc/examples/xmlrpc/Makefile.am new file mode 100644 index 000000000..68ecbdd9b --- /dev/null +++ b/grc/examples/xmlrpc/Makefile.am @@ -0,0 +1,30 @@ +# +# Copyright 2008 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/grc/Makefile.common + +datadir = $(grc_examples_prefix)/xmlrpc + +EXTRA_DIST = \ + readme.txt \ + xmlrpc_client.grc \ + xmlrpc_client_script.py\ + xmlrpc_server.grc diff --git a/grc/examples/xmlrpc/readme.txt b/grc/examples/xmlrpc/readme.txt new file mode 100644 index 000000000..c1f87c1cb --- /dev/null +++ b/grc/examples/xmlrpc/readme.txt @@ -0,0 +1,18 @@ +################################################## +# XMLRPC example +################################################## + +XMLRPC allows software to make remote function calls over http. +In the case of GRC, one can use XMLRPC to modify variables in a running flow graph. +See http://www.xmlrpc.com/ + +--- Server Example --- +Place an "XMLRPC Server" block inside of any flow graph. +The server will provide set functions for every variable in the flow graph. +If a variable is called "freq", the server will provide a function set_freq(new_freq). +Run the server example and experiment with the example client script. + +-- Client Example -- +The "XMLRPC Client" block will give a variable control over one remove function. +In the example client, there is one client block and gui control per variable. +This technique can be used to remotely control a flow graph, perhaps running on a non-gui machine. diff --git a/grc/examples/xmlrpc/xmlrpc_client.grc b/grc/examples/xmlrpc/xmlrpc_client.grc new file mode 100644 index 000000000..3bb4e7ed3 --- /dev/null +++ b/grc/examples/xmlrpc/xmlrpc_client.grc @@ -0,0 +1,312 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jul 24 14:27:44 2008</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>client_block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>XMLRPC Client</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>example flow graph</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>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>xmlrpc_client</key> + <param> + <key>id</key> + <value>xmlrpc_client0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>addr</key> + <value>localhost</value> + </param> + <param> + <key>port</key> + <value>1234</value> + </param> + <param> + <key>callback</key> + <value>set_ampl</value> + </param> + <param> + <key>variable</key> + <value>ampl</value> + </param> + <param> + <key>_coordinate</key> + <value>(409, 35)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>xmlrpc_client</key> + <param> + <key>id</key> + <value>xmlrpc_client</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>addr</key> + <value>localhost</value> + </param> + <param> + <key>port</key> + <value>1234</value> + </param> + <param> + <key>callback</key> + <value>set_freq</value> + </param> + <param> + <key>variable</key> + <value>freq</value> + </param> + <param> + <key>_coordinate</key> + <value>(222, 34)</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>1000</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>5000</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(207, 162)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_slider</key> + <param> + <key>id</key> + <value>ampl</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Amplitude</value> + </param> + <param> + <key>value</key> + <value>1</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>2</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>slider_type</key> + <value>horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(397, 167)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_chooser</key> + <param> + <key>id</key> + <value>offset</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Offset</value> + </param> + <param> + <key>value_index</key> + <value>1</value> + </param> + <param> + <key>choices</key> + <value>[-1, 0, 1]</value> + </param> + <param> + <key>labels</key> + <value>["neg", "zero", "pos"]</value> + </param> + <param> + <key>chooser_type</key> + <value>radio_buttons_horizontal</value> + </param> + <param> + <key>grid_pos</key> + <value>2, 0, 1, 2</value> + </param> + <param> + <key>_coordinate</key> + <value>(596, 177)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>xmlrpc_client</key> + <param> + <key>id</key> + <value>xmlrpc_client1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>addr</key> + <value>localhost</value> + </param> + <param> + <key>port</key> + <value>1234</value> + </param> + <param> + <key>callback</key> + <value>set_offset</value> + </param> + <param> + <key>variable</key> + <value>offset*ampl</value> + </param> + <param> + <key>_coordinate</key> + <value>(608, 39)</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>(13, 172)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> +</flow_graph>
\ No newline at end of file diff --git a/grc/examples/xmlrpc/xmlrpc_client_script.py b/grc/examples/xmlrpc/xmlrpc_client_script.py new file mode 100644 index 000000000..956fa07fb --- /dev/null +++ b/grc/examples/xmlrpc/xmlrpc_client_script.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +import time +import random +import xmlrpclib + +#create server object +s = xmlrpclib.Server("http://localhost:1234") + +#randomly change parameters of the sinusoid +for i in range(10): + #generate random values + new_freq = random.uniform(0, 5000) + new_ampl = random.uniform(0, 2) + new_offset = random.uniform(-1, 1) + #set new values + time.sleep(1) + s.set_freq(new_freq) + time.sleep(1) + s.set_ampl(new_ampl) + time.sleep(1) + s.set_offset(new_offset) + diff --git a/grc/examples/xmlrpc/xmlrpc_server.grc b/grc/examples/xmlrpc/xmlrpc_server.grc new file mode 100644 index 000000000..dc539ef1b --- /dev/null +++ b/grc/examples/xmlrpc/xmlrpc_server.grc @@ -0,0 +1,384 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Thu Jul 24 14:27:42 2008</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>server_block</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>XMLRPC Server</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>example flow graph</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>_coordinate</key> + <value>(10, 10)</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</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>ampl</value> + </param> + <param> + <key>offset</key> + <value>offset</value> + </param> + <param> + <key>_coordinate</key> + <value>(162, 200)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>offset</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(12, 390)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>xmlrpc_server</key> + <param> + <key>id</key> + <value>xmlrpc_server</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>addr</key> + <value>localhost</value> + </param> + <param> + <key>port</key> + <value>1234</value> + </param> + <param> + <key>_coordinate</key> + <value>(395, 240)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>(386, 93)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_scopesink2</key> + <param> + <key>id</key> + <value>wxgui_scopesink2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Scope Plot</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>frame_decim</key> + <value>15</value> + </param> + <param> + <key>v_scale</key> + <value>0</value> + </param> + <param> + <key>t_scale</key> + <value>.001</value> + </param> + <param> + <key>marker</key> + <value>set_format_line</value> + </param> + <param> + <key>num_inputs</key> + <value>1</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 2, 4</value> + </param> + <param> + <key>_coordinate</key> + <value>(623, 28)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>wxgui_fftsink2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</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>8</value> + </param> + <param> + <key>ref_level</key> + <value>50</value> + </param> + <param> + <key>fft_size</key> + <value>512</value> + </param> + <param> + <key>fft_rate</key> + <value>15</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>grid_pos</key> + <value>2, 0, 2, 4</value> + </param> + <param> + <key>_coordinate</key> + <value>(630, 233)</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>(11, 160)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>freq</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>_coordinate</key> + <value>(11, 237)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>ampl</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(13, 315)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>gr_sig_source_x</source_block_id> + <sink_block_id>gr_throttle</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle</source_block_id> + <sink_block_id>wxgui_scopesink2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle</source_block_id> + <sink_block_id>wxgui_fftsink2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph>
\ No newline at end of file |