diff options
Diffstat (limited to 'grc')
26 files changed, 1113 insertions, 530 deletions
diff --git a/grc/.gitignore b/grc/.gitignore deleted file mode 100644 index 8e70007d6..000000000 --- a/grc/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/grc.conf -/Makefile -/Makefile.in diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt index 997aa56b1..8be5d7fbc 100644 --- a/grc/CMakeLists.txt +++ b/grc/CMakeLists.txt @@ -121,5 +121,6 @@ add_subdirectory(grc_gnuradio) add_subdirectory(gui) add_subdirectory(python) add_subdirectory(scripts) +add_subdirectory(examples) endif(ENABLE_GRC) diff --git a/grc/Makefile.am b/grc/Makefile.am deleted file mode 100644 index addefcf36..000000000 --- a/grc/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2008-2011 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)/Makefile.common - -if PYTHON -SUBDIRS = \ - base \ - blocks \ - freedesktop \ - grc_gnuradio \ - gui \ - python \ - scripts - -ourpythondir = $(pkgpythondir)/grc -ourpython_PYTHON = __init__.py - -etcdir = $(gr_prefsdir) -dist_etc_DATA = grc.conf - -EXTRA_DIST += $(srcdir)/grc.conf.in - -BUILT_SOURCES += grc.conf - -grc.conf: $(srcdir)/grc.conf.in Makefile - sed \ - -e 's|@blocksdir[@]|$(grc_blocksdir)|g' \ - $< > $@ - -endif diff --git a/grc/base/.gitignore b/grc/base/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/grc/base/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/grc/base/Makefile.am b/grc/base/Makefile.am deleted file mode 100644 index 6a95e33b9..000000000 --- a/grc/base/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright 2008, 2009 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)/Makefile.common - -ourpythondir = $(pkgpythondir)/grc/base -ourpython_PYTHON = \ - odict.py \ - ParseXML.py \ - Block.py \ - Connection.py \ - Constants.py \ - Element.py \ - FlowGraph.py \ - Param.py \ - Platform.py \ - Port.py \ - __init__.py - -ourdatadir = $(pkgpythondir)/grc/base -dist_ourdata_DATA = \ - block_tree.dtd \ - flow_graph.dtd diff --git a/grc/blocks/.gitignore b/grc/blocks/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/grc/blocks/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am deleted file mode 100644 index 37f493ce5..000000000 --- a/grc/blocks/Makefile.am +++ /dev/null @@ -1,200 +0,0 @@ -# -# Copyright 2008-2011 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)/Makefile.common - -ourdatadir = $(grc_blocksdir) -dist_ourdata_DATA = \ - block_tree.xml \ - band_pass_filter.xml \ - band_reject_filter.xml \ - blks2_am_demod_cf.xml \ - blks2_analysis_filterbank.xml \ - blks2_error_rate.xml \ - blks2_fm_deemph.xml \ - blks2_fm_demod_cf.xml \ - blks2_fm_preemph.xml \ - blks2_logpwrfft_x.xml \ - blks2_nbfm_rx.xml \ - blks2_nbfm_tx.xml \ - blks2_packet_decoder.xml \ - blks2_packet_encoder.xml \ - blks2_pfb_arb_resampler.xml \ - blks2_pfb_channelizer.xml \ - blks2_rational_resampler_xxx.xml \ - blks2_selector.xml \ - blks2_standard_squelch.xml \ - blks2_stream_to_vector_decimator.xml \ - blks2_synthesis_filterbank.xml \ - blks2_tcp_sink.xml \ - blks2_tcp_source.xml \ - blks2_valve.xml \ - blks2_wfm_rcv.xml \ - blks2_wfm_rcv_pll.xml \ - blks2_wfm_tx.xml \ - 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 \ - gr_and_const_xx.xml \ - gr_argmax_xx.xml \ - gr_channel_model.xml \ - gr_char_to_float.xml \ - gr_char_to_short.xml \ - gr_chunks_to_symbols.xml \ - gr_complex_to_arg.xml \ - gr_complex_to_float.xml \ - gr_complex_to_imag.xml \ - gr_complex_to_interleaved_short.xml \ - gr_complex_to_mag.xml \ - gr_complex_to_mag_squared.xml \ - gr_complex_to_real.xml \ - gr_conjugate_cc.xml \ - gr_copy.xml \ - gr_cpfsk_bc.xml \ - gr_ctcss_squelch_ff.xml \ - gr_dc_blocker.xml \ - gr_decode_ccsds_27_fb.xml \ - gr_deinterleave.xml \ - gr_delay.xml \ - gr_descrambler_bb.xml \ - gr_diff_decoder_bb.xml \ - gr_diff_encoder_bb.xml \ - gr_diff_phasor_cc.xml \ - gr_divide_xx.xml \ - gr_dpll_bb.xml \ - gr_encode_ccsds_27_bb.xml \ - gr_feedforward_agc_cc.xml \ - gr_fft_filter_xxx.xml \ - gr_fft_vxx.xml \ - gr_file_sink.xml \ - gr_file_source.xml \ - gr_filter_delay_fc.xml \ - gr_fir_filter_xxx.xml \ - gr_float_to_char.xml \ - gr_float_to_complex.xml \ - gr_float_to_int.xml \ - gr_float_to_short.xml \ - gr_float_to_uchar.xml \ - gr_fractional_interpolator_xx.xml \ - gr_freq_xlating_fir_filter_xxx.xml \ - gr_frequency_modulator_fc.xml \ - gr_glfsr_source_x.xml \ - gr_goertzel_fc.xml \ - gr_head.xml \ - gr_hilbert_fc.xml \ - gr_iir_filter_ffd.xml \ - gr_int_to_float.xml \ - gr_integrate_xx.xml \ - gr_interleave.xml \ - gr_interleaved_short_to_complex.xml \ - gr_interp_fir_filter_xxx.xml \ - gr_iqcomp_cc.xml \ - gr_keep_one_in_n.xml \ - gr_kludge_copy.xml \ - gr_map_bb.xml \ - gr_max_xx.xml \ - gr_message_sink.xml \ - gr_message_source.xml \ - gr_moving_average_xx.xml \ - gr_mpsk_sync_cc.xml \ - gr_multiply_const_vxx.xml \ - gr_multiply_xx.xml \ - gr_mute_xx.xml \ - gr_nlog10_ff.xml \ - gr_noise_source_x.xml \ - gr_nop.xml \ - gr_not_xx.xml \ - gr_null_sink.xml \ - gr_null_source.xml \ - gr_or_xx.xml \ - gr_packed_to_unpacked_xx.xml \ - gr_peak_detector2_fb.xml \ - gr_peak_detector_xb.xml \ - gr_pfb_clock_sync.xml \ - gr_pfb_synthesis_filterbank.xml \ - gr_phase_modulator_fc.xml \ - gr_pll_carriertracking_cc.xml \ - gr_pll_freqdet_cf.xml \ - gr_pll_refout_cc.xml \ - gr_pn_correlator_cc.xml \ - gr_probe_avg_mag_sqrd_x.xml \ - gr_probe_density_b.xml \ - gr_probe_mpsk_snr_c.xml \ - gr_probe_signal_f.xml \ - gr_pwr_squelch_xx.xml \ - gr_quadrature_demod_cf.xml \ - gr_rational_resampler_base_xxx.xml \ - gr_repeat.xml \ - gr_rms_xx.xml \ - gr_sample_and_hold_xx.xml \ - gr_scrambler_bb.xml \ - gr_short_to_float.xml \ - gr_short_to_char.xml \ - gr_sig_source_x.xml \ - gr_simple_correlator.xml \ - gr_simple_framer.xml \ - gr_simple_squelch_cc.xml \ - gr_single_pole_iir_filter_xx.xml \ - gr_skiphead.xml \ - gr_stream_mux.xml \ - gr_stream_to_streams.xml \ - gr_stream_to_vector.xml \ - gr_streams_to_stream.xml \ - gr_streams_to_vector.xml \ - gr_burst_tagger.xml \ - gr_sub_xx.xml \ - gr_threshold_ff.xml \ - gr_throttle.xml \ - gr_transcendental.xml \ - gr_uchar_to_float.xml \ - gr_udp_sink.xml \ - gr_udp_source.xml \ - gr_unpack_k_bits_bb.xml \ - gr_unpacked_to_packed_xx.xml \ - gr_vco_f.xml \ - gr_vector_sink_x.xml \ - gr_vector_source_x.xml \ - gr_vector_to_stream.xml \ - gr_vector_to_streams.xml \ - gr_wavfile_sink.xml \ - gr_wavfile_source.xml \ - gr_xor_xx.xml \ - high_pass_filter.xml \ - import.xml \ - low_pass_filter.xml \ - note.xml \ - options.xml \ - pad_sink.xml \ - pad_source.xml \ - parameter.xml \ - random_source_x.xml \ - root_raised_cosine_filter.xml \ - variable.xml \ - variable_config.xml \ - variable_function_probe.xml \ - virtual_sink.xml \ - virtual_source.xml \ - xmlrpc_client.xml \ - xmlrpc_server.xml diff --git a/grc/blocks/blks2_pfb_channelizer.xml b/grc/blocks/blks2_pfb_channelizer.xml index aee9dd512..0dba6108b 100644 --- a/grc/blocks/blks2_pfb_channelizer.xml +++ b/grc/blocks/blks2_pfb_channelizer.xml @@ -14,10 +14,13 @@ $taps, $osr, $atten) +self.$(id).set_channel_map($ch_map) </make> <!-- Set taps not implemented yet <callback>set_taps($taps)</callback> --> + <callback>set_channel_map($ch_map)</callback> + <param> <name>Channels</name> <key>nchans</key> @@ -41,6 +44,12 @@ <value>100</value> <type>real</type> </param> + <param> + <name>Channel Map</name> + <key>ch_map</key> + <value>[]</value> + <type>int_vector</type> + </param> <sink> <name>in</name> <type>complex</type> diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 42187585e..18bc050ba 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -174,7 +174,7 @@ <!-- Polyphase filters --> <block>blks2_pfb_arb_resampler_ccf</block> <block>blks2_pfb_channelizer_ccf</block> - <block>gr_pfb_synthesis_filterbank_ccf</block> + <block>gr_pfb_synthesizer_ccf</block> <!-- Other filters --> <block>gr_single_pole_iir_filter_xx</block> <block>gr_hilbert_fc</block> @@ -231,7 +231,6 @@ <name>Probes</name> <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_density_b</block> - <block>gr_probe_mpsk_snr_c</block> <block>gr_probe_signal_f</block> </cat> <cat> diff --git a/grc/blocks/gr_pfb_synthesis_filterbank.xml b/grc/blocks/gr_pfb_synthesizer.xml index a8b944c6a..49e5cb032 100644 --- a/grc/blocks/gr_pfb_synthesis_filterbank.xml +++ b/grc/blocks/gr_pfb_synthesizer.xml @@ -5,14 +5,16 @@ ################################################### --> <block> - <name>Polyphase Synthesis Filterbank</name> - <key>gr_pfb_synthesis_filterbank_ccf</key> + <name>Polyphase Synthesizer</name> + <key>gr_pfb_synthesizer_ccf</key> <import>from gnuradio import gr</import> <import>from gnuradio.gr import firdes</import> - <make>gr.pfb_synthesis_filterbank_ccf( - $numchans, $taps) + <make>gr.pfb_synthesizer_ccf( + $numchans, $taps, $twox) +self.$(id).set_channel_map($ch_map) </make> <callback>set_taps($taps)</callback> + <callback>set_channel_map($ch_map)</callback> <param> <name>Channels</name> @@ -31,6 +33,18 @@ <key>taps</key> <type>real_vector</type> </param> + <param> + <name>2x Sample Rate</name> + <key>twox</key> + <value>False</value> + <type>bool</type> + </param> + <param> + <name>Channel Map</name> + <key>ch_map</key> + <value>[]</value> + <type>int_vector</type> + </param> <sink> <name>in</name> <type>complex</type> diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml deleted file mode 100644 index 5687e867d..000000000 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Probe MPSK SNR -################################################### - --> -<block> - <name>Probe MPSK SNR</name> - <key>gr_probe_mpsk_snr_c</key> - <import>from gnuradio import gr</import> - <make>gr.probe_mpsk_snr_c($alpha)</make> - <callback>set_alpha($alpha)</callback> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>1</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <doc> -Available functions to probe: signal_mean(), noise_variance() - -Use with the function probe block. - </doc> -</block> diff --git a/grc/scripts/Makefile.am b/grc/examples/CMakeLists.txt index 84e2759dc..acb65dbdc 100644 --- a/grc/scripts/Makefile.am +++ b/grc/examples/CMakeLists.txt @@ -1,5 +1,4 @@ -# -# Copyright 2008-2011 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,8 +16,22 @@ # 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)/Makefile.common +# SIMPLE +install( + FILES + simple/variable_config.grc + DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/simple + COMPONENT "grc" +) -dist_bin_SCRIPTS = gnuradio-companion +# XMLRPC +install( + FILES + xmlrpc/readme.txt + xmlrpc/xmlrpc_client.grc + xmlrpc/xmlrpc_client_script.py + xmlrpc/xmlrpc_server.grc + DESTINATION ${GR_PKG_DATA_DIR}/examples/grc/xmlrpc + COMPONENT "grc" +) 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/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 diff --git a/grc/freedesktop/.gitignore b/grc/freedesktop/.gitignore deleted file mode 100644 index ff07a101f..000000000 --- a/grc/freedesktop/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/grc_setup_freedesktop -/Makefile -/Makefile.in diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am deleted file mode 100644 index f89a344f7..000000000 --- a/grc/freedesktop/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2008-2011 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)/Makefile.common - -ourdatadir = $(pkgdatadir)/grc/freedesktop -dist_ourdata_DATA = \ - grc-icon-256.png \ - grc-icon-128.png \ - grc-icon-64.png \ - grc-icon-48.png \ - grc-icon-32.png \ - gnuradio-grc.xml \ - gnuradio-grc.desktop - -pkglibexecdir = $(libexecdir)/$(PACKAGE) -dist_pkglibexec_SCRIPTS = grc_setup_freedesktop - -grc_setup_freedesktop: $(srcdir)/grc_setup_freedesktop.in Makefile - sed -e 's|@SRCDIR[@]|$(ourdatadir)|g' $< > $@ - -EXTRA_DIST += $(srcdir)/grc_setup_freedesktop.in -BUILT_SOURCES += grc_setup_freedesktop - -if XDG_UTILS -install-data-hook: - @printf "\n*** GRC Post-Install Message ***\ - \nTo install icons, mime type, and menu items\ - \nfor a freedesktop.org system (Gnome/KDE/Xfce):\ - \n >>> sudo $(pkglibexecdir)/grc_setup_freedesktop install\n\n" - -uninstall-hook: - @printf "\n*** GRC Post-Uninstall Message ***\ - \nTo uninstall icons, mime type, and menu items\ - \nfor a freedesktop.org system (Gnome/KDE/Xfce):\ - \n >>> sudo $(pkglibexecdir)/grc_setup_freedesktop uninstall\n\n" -endif diff --git a/grc/grc_gnuradio/.gitignore b/grc/grc_gnuradio/.gitignore deleted file mode 100644 index 908cf90b8..000000000 --- a/grc/grc_gnuradio/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/Makefile -/Makefile.in -/Constants.py diff --git a/grc/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am deleted file mode 100644 index af1d86be9..000000000 --- a/grc/grc_gnuradio/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright 2008-2011 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)/Makefile.common - -grc_gnuradio_prefix = $(pythondir)/grc_gnuradio - -root_pythondir = $(grc_gnuradio_prefix) -root_python_PYTHON = __init__.py - -blks2_pythondir = $(grc_gnuradio_prefix)/blks2 -blks2_python_PYTHON = \ - blks2/__init__.py \ - blks2/error_rate.py \ - blks2/packet.py \ - blks2/selector.py \ - blks2/tcp.py diff --git a/grc/gui/.gitignore b/grc/gui/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/grc/gui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/grc/gui/Makefile.am b/grc/gui/Makefile.am deleted file mode 100644 index a73b6855d..000000000 --- a/grc/gui/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2008, 2009 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)/Makefile.common - -ourpythondir = $(pkgpythondir)/grc/gui -ourpython_PYTHON = \ - Block.py \ - Colors.py \ - Constants.py \ - Connection.py \ - Element.py \ - FlowGraph.py \ - Param.py \ - Platform.py \ - Port.py \ - Utils.py \ - ActionHandler.py \ - Actions.py \ - Bars.py \ - BlockTreeWindow.py \ - Dialogs.py \ - DrawingArea.py \ - FileDialogs.py \ - MainWindow.py \ - Messages.py \ - NotebookPage.py \ - PropsDialog.py \ - Preferences.py \ - StateCache.py \ - __init__.py diff --git a/grc/python/.gitignore b/grc/python/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/grc/python/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/grc/python/Makefile.am b/grc/python/Makefile.am deleted file mode 100644 index eb35b6fc1..000000000 --- a/grc/python/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright 2008, 2009 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)/Makefile.common - -ourpythondir = $(pkgpythondir)/grc/python -ourpython_PYTHON = \ - convert_hier.py \ - expr_utils.py \ - extract_docs.py \ - Block.py \ - Connection.py \ - Constants.py \ - FlowGraph.py \ - Generator.py \ - Param.py \ - Platform.py \ - Port.py \ - __init__.py - -ourdatadir = $(pkgpythondir)/grc/python -dist_ourdata_DATA = \ - block.dtd \ - default_flow_graph.grc \ - flow_graph.tmpl diff --git a/grc/scripts/.gitignore b/grc/scripts/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/grc/scripts/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in |