summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/grc_grc.m428
-rw-r--r--gr-wxgui/src/python/forms/converters.py17
-rw-r--r--gr-wxgui/src/python/forms/forms.py2
-rw-r--r--grc/Makefile.am38
-rw-r--r--grc/Makefile.inc5
-rw-r--r--grc/__init__.py.in (renamed from grc/src/gui/Constants.py)33
-rw-r--r--grc/base/Block.py (renamed from grc/src/platforms/base/Block.py)24
-rw-r--r--grc/base/Connection.py (renamed from grc/src/platforms/base/Connection.py)7
-rw-r--r--grc/base/Constants.py (renamed from grc/src/platforms/base/Constants.py.in)11
-rw-r--r--grc/base/Element.py (renamed from grc/src/platforms/base/Element.py)45
-rw-r--r--grc/base/FlowGraph.py (renamed from grc/src/platforms/base/FlowGraph.py)15
-rw-r--r--grc/base/Makefile.am (renamed from grc/src/platforms/gui/Makefile.am)16
-rw-r--r--grc/base/Param.py (renamed from grc/src/platforms/base/Param.py)44
-rw-r--r--grc/base/ParseXML.py (renamed from grc/src/utils/ParseXML.py)2
-rw-r--r--grc/base/Platform.py (renamed from grc/src/platforms/base/Platform.py)111
-rw-r--r--grc/base/Port.py (renamed from grc/src/platforms/base/Port.py)5
-rw-r--r--grc/base/__init__.py (renamed from grc/src/utils/__init__.py)0
-rw-r--r--grc/base/block_tree.dtd (renamed from grc/data/platforms/base/block_tree.dtd)0
-rw-r--r--grc/base/flow_graph.dtd (renamed from grc/data/platforms/base/flow_graph.dtd)0
-rw-r--r--grc/base/odict.py (renamed from grc/src/utils/odict.py)0
-rw-r--r--grc/blocks/Makefile.am (renamed from grc/data/platforms/python/blocks/Makefile.am)10
-rw-r--r--grc/blocks/audio_sink.xml (renamed from grc/data/platforms/python/blocks/audio_sink.xml)0
-rw-r--r--grc/blocks/audio_source.xml (renamed from grc/data/platforms/python/blocks/audio_source.xml)0
-rw-r--r--grc/blocks/band_pass_filter.xml (renamed from grc/data/platforms/python/blocks/band_pass_filter.xml)56
-rw-r--r--grc/blocks/band_reject_filter.xml (renamed from grc/data/platforms/python/blocks/band_reject_filter.xml)12
-rw-r--r--grc/blocks/blks2_am_demod_cf.xml (renamed from grc/data/platforms/python/blocks/blks2_am_demod_cf.xml)0
-rw-r--r--grc/blocks/blks2_analysis_filterbank.xml (renamed from grc/data/platforms/python/blocks/blks2_analysis_filterbank.xml)0
-rw-r--r--grc/blocks/blks2_dxpsk_demod.xml (renamed from grc/data/platforms/python/blocks/blks2_dxpsk_demod.xml)32
-rw-r--r--grc/blocks/blks2_dxpsk_mod.xml (renamed from grc/data/platforms/python/blocks/blks2_dxpsk_mod.xml)32
-rw-r--r--grc/blocks/blks2_error_rate.xml (renamed from grc/data/platforms/python/blocks/blks2_error_rate.xml)0
-rw-r--r--grc/blocks/blks2_fm_deemph.xml (renamed from grc/data/platforms/python/blocks/blks2_fm_deemph.xml)0
-rw-r--r--grc/blocks/blks2_fm_demod_cf.xml (renamed from grc/data/platforms/python/blocks/blks2_fm_demod_cf.xml)0
-rw-r--r--grc/blocks/blks2_fm_preemph.xml (renamed from grc/data/platforms/python/blocks/blks2_fm_preemph.xml)0
-rw-r--r--grc/blocks/blks2_gmsk_demod.xml (renamed from grc/data/platforms/python/blocks/blks2_gmsk_demod.xml)32
-rw-r--r--grc/blocks/blks2_gmsk_mod.xml (renamed from grc/data/platforms/python/blocks/blks2_gmsk_mod.xml)32
-rw-r--r--grc/blocks/blks2_logpwrfft_x.xml (renamed from grc/data/platforms/python/blocks/blks2_logpwrfft_x.xml)15
-rw-r--r--grc/blocks/blks2_nbfm_rx.xml (renamed from grc/data/platforms/python/blocks/blks2_nbfm_rx.xml)0
-rw-r--r--grc/blocks/blks2_nbfm_tx.xml (renamed from grc/data/platforms/python/blocks/blks2_nbfm_tx.xml)0
-rw-r--r--grc/blocks/blks2_ofdm_demod.xml (renamed from grc/data/platforms/python/blocks/blks2_ofdm_demod.xml)0
-rw-r--r--grc/blocks/blks2_ofdm_mod.xml (renamed from grc/data/platforms/python/blocks/blks2_ofdm_mod.xml)0
-rw-r--r--grc/blocks/blks2_packet_decoder.xml (renamed from grc/data/platforms/python/blocks/blks2_packet_decoder.xml)0
-rw-r--r--grc/blocks/blks2_packet_encoder.xml (renamed from grc/data/platforms/python/blocks/blks2_packet_encoder.xml)0
-rw-r--r--grc/blocks/blks2_qamx_demod.xml (renamed from grc/data/platforms/python/blocks/blks2_qamx_demod.xml)32
-rw-r--r--grc/blocks/blks2_qamx_mod.xml (renamed from grc/data/platforms/python/blocks/blks2_qamx_mod.xml)32
-rw-r--r--grc/blocks/blks2_rational_resampler_xxx.xml (renamed from grc/data/platforms/python/blocks/blks2_rational_resampler_xxx.xml)0
-rw-r--r--grc/blocks/blks2_selector.xml (renamed from grc/data/platforms/python/blocks/blks2_selector.xml)0
-rw-r--r--grc/blocks/blks2_standard_squelch.xml (renamed from grc/data/platforms/python/blocks/blks2_standard_squelch.xml)0
-rw-r--r--grc/blocks/blks2_stream_to_vector_decimator.xml (renamed from grc/data/platforms/python/blocks/blks2_stream_to_vector_decimator.xml)0
-rw-r--r--grc/blocks/blks2_synthesis_filterbank.xml (renamed from grc/data/platforms/python/blocks/blks2_synthesis_filterbank.xml)0
-rw-r--r--grc/blocks/blks2_tcp_sink.xml (renamed from grc/data/platforms/python/blocks/blks2_tcp_sink.xml)0
-rw-r--r--grc/blocks/blks2_tcp_source.xml (renamed from grc/data/platforms/python/blocks/blks2_tcp_source.xml)0
-rw-r--r--grc/blocks/blks2_valve.xml (renamed from grc/data/platforms/python/blocks/blks2_valve.xml)0
-rw-r--r--grc/blocks/blks2_variable_sink_x.xml (renamed from grc/data/platforms/python/blocks/blks2_variable_sink_x.xml)0
-rw-r--r--grc/blocks/blks2_wfm_rcv.xml (renamed from grc/data/platforms/python/blocks/blks2_wfm_rcv.xml)0
-rw-r--r--grc/blocks/blks2_wfm_rcv_pll.xml (renamed from grc/data/platforms/python/blocks/blks2_wfm_rcv_pll.xml)0
-rw-r--r--grc/blocks/blks2_wfm_tx.xml (renamed from grc/data/platforms/python/blocks/blks2_wfm_tx.xml)0
-rw-r--r--grc/blocks/block_tree.xml (renamed from grc/data/platforms/python/block_tree.xml)4
-rw-r--r--grc/blocks/const_source_x.xml (renamed from grc/data/platforms/python/blocks/const_source_x.xml)0
-rw-r--r--grc/blocks/gr_add_const_vxx.xml (renamed from grc/data/platforms/python/blocks/gr_add_const_vxx.xml)0
-rw-r--r--grc/blocks/gr_add_xx.xml (renamed from grc/data/platforms/python/blocks/gr_add_xx.xml)0
-rw-r--r--grc/blocks/gr_agc2_xx.xml (renamed from grc/data/platforms/python/blocks/gr_agc2_xx.xml)0
-rw-r--r--grc/blocks/gr_agc_xx.xml (renamed from grc/data/platforms/python/blocks/gr_agc_xx.xml)0
-rw-r--r--grc/blocks/gr_and_xx.xml (renamed from grc/data/platforms/python/blocks/gr_and_xx.xml)0
-rw-r--r--grc/blocks/gr_argmax_xx.xml (renamed from grc/data/platforms/python/blocks/gr_argmax_xx.xml)0
-rw-r--r--grc/blocks/gr_binary_slicer_fb.xml (renamed from grc/data/platforms/python/blocks/gr_binary_slicer_fb.xml)0
-rw-r--r--grc/blocks/gr_channel_model.xml (renamed from grc/data/platforms/python/blocks/gr_channel_model.xml)0
-rw-r--r--grc/blocks/gr_char_to_float.xml (renamed from grc/data/platforms/python/blocks/gr_char_to_float.xml)0
-rw-r--r--grc/blocks/gr_chunks_to_symbols.xml (renamed from grc/data/platforms/python/blocks/gr_chunks_to_symbols.xml)0
-rw-r--r--grc/blocks/gr_clock_recovery_mm_xx.xml (renamed from grc/data/platforms/python/blocks/gr_clock_recovery_mm_xx.xml)0
-rw-r--r--grc/blocks/gr_cma_equalizer_cc.xml (renamed from grc/data/platforms/python/blocks/gr_cma_equalizer_cc.xml)0
-rw-r--r--grc/blocks/gr_complex_to_arg.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_arg.xml)0
-rw-r--r--grc/blocks/gr_complex_to_float.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_float.xml)0
-rw-r--r--grc/blocks/gr_complex_to_imag.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_imag.xml)0
-rw-r--r--grc/blocks/gr_complex_to_interleaved_short.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_interleaved_short.xml)0
-rw-r--r--grc/blocks/gr_complex_to_mag.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_mag.xml)0
-rw-r--r--grc/blocks/gr_complex_to_mag_squared.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_mag_squared.xml)0
-rw-r--r--grc/blocks/gr_complex_to_real.xml (renamed from grc/data/platforms/python/blocks/gr_complex_to_real.xml)0
-rw-r--r--grc/blocks/gr_conjugate_cc.xml (renamed from grc/data/platforms/python/blocks/gr_conjugate_cc.xml)0
-rw-r--r--grc/blocks/gr_constellation_decoder_cb.xml (renamed from grc/data/platforms/python/blocks/gr_constellation_decoder_cb.xml)0
-rw-r--r--grc/blocks/gr_correlate_access_code_bb.xml (renamed from grc/data/platforms/python/blocks/gr_correlate_access_code_bb.xml)0
-rw-r--r--grc/blocks/gr_costas_loop_cc.xml (renamed from grc/data/platforms/python/blocks/gr_costas_loop_cc.xml)0
-rw-r--r--grc/blocks/gr_cpfsk_bc.xml (renamed from grc/data/platforms/python/blocks/gr_cpfsk_bc.xml)0
-rw-r--r--grc/blocks/gr_dd_mpsk_sync_cc.xml (renamed from grc/data/platforms/python/blocks/gr_dd_mpsk_sync_cc.xml)0
-rw-r--r--grc/blocks/gr_decode_ccsds_27_fb.xml (renamed from grc/data/platforms/python/blocks/gr_decode_ccsds_27_fb.xml)0
-rw-r--r--grc/blocks/gr_deinterleave.xml (renamed from grc/data/platforms/python/blocks/gr_deinterleave.xml)0
-rw-r--r--grc/blocks/gr_delay.xml (renamed from grc/data/platforms/python/blocks/gr_delay.xml)0
-rw-r--r--grc/blocks/gr_descrambler_bb.xml (renamed from grc/data/platforms/python/blocks/gr_descrambler_bb.xml)0
-rw-r--r--grc/blocks/gr_diff_decoder_bb.xml (renamed from grc/data/platforms/python/blocks/gr_diff_decoder_bb.xml)0
-rw-r--r--grc/blocks/gr_diff_encoder_bb.xml (renamed from grc/data/platforms/python/blocks/gr_diff_encoder_bb.xml)0
-rw-r--r--grc/blocks/gr_diff_phasor_cc.xml (renamed from grc/data/platforms/python/blocks/gr_diff_phasor_cc.xml)0
-rw-r--r--grc/blocks/gr_divide_xx.xml (renamed from grc/data/platforms/python/blocks/gr_divide_xx.xml)0
-rw-r--r--grc/blocks/gr_dpll_bb.xml (renamed from grc/data/platforms/python/blocks/gr_dpll_bb.xml)0
-rw-r--r--grc/blocks/gr_encode_ccsds_27_bb.xml (renamed from grc/data/platforms/python/blocks/gr_encode_ccsds_27_bb.xml)0
-rw-r--r--grc/blocks/gr_feedforward_agc_cc.xml (renamed from grc/data/platforms/python/blocks/gr_feedforward_agc_cc.xml)0
-rw-r--r--grc/blocks/gr_fft_filter_xxx.xml (renamed from grc/data/platforms/python/blocks/gr_fft_filter_xxx.xml)0
-rw-r--r--grc/blocks/gr_fft_vxx.xml (renamed from grc/data/platforms/python/blocks/gr_fft_vxx.xml)0
-rw-r--r--grc/blocks/gr_file_sink.xml (renamed from grc/data/platforms/python/blocks/gr_file_sink.xml)0
-rw-r--r--grc/blocks/gr_file_source.xml (renamed from grc/data/platforms/python/blocks/gr_file_source.xml)0
-rw-r--r--grc/blocks/gr_filter_delay_fc.xml (renamed from grc/data/platforms/python/blocks/gr_filter_delay_fc.xml)0
-rw-r--r--grc/blocks/gr_fir_filter_xxx.xml (renamed from grc/data/platforms/python/blocks/gr_fir_filter_xxx.xml)0
-rw-r--r--grc/blocks/gr_float_to_char.xml (renamed from grc/data/platforms/python/blocks/gr_float_to_char.xml)0
-rw-r--r--grc/blocks/gr_float_to_complex.xml (renamed from grc/data/platforms/python/blocks/gr_float_to_complex.xml)0
-rw-r--r--grc/blocks/gr_float_to_short.xml (renamed from grc/data/platforms/python/blocks/gr_float_to_short.xml)0
-rw-r--r--grc/blocks/gr_float_to_uchar.xml (renamed from grc/data/platforms/python/blocks/gr_float_to_uchar.xml)0
-rw-r--r--grc/blocks/gr_fractional_interpolator_xx.xml (renamed from grc/data/platforms/python/blocks/gr_fractional_interpolator_xx.xml)0
-rw-r--r--grc/blocks/gr_freq_xlating_fir_filter_xxx.xml (renamed from grc/data/platforms/python/blocks/gr_freq_xlating_fir_filter_xxx.xml)0
-rw-r--r--grc/blocks/gr_frequency_modulator_fc.xml (renamed from grc/data/platforms/python/blocks/gr_frequency_modulator_fc.xml)0
-rw-r--r--grc/blocks/gr_glfsr_source_x.xml (renamed from grc/data/platforms/python/blocks/gr_glfsr_source_x.xml)0
-rw-r--r--grc/blocks/gr_goertzel_fc.xml (renamed from grc/data/platforms/python/blocks/gr_goertzel_fc.xml)0
-rw-r--r--grc/blocks/gr_head.xml (renamed from grc/data/platforms/python/blocks/gr_head.xml)0
-rw-r--r--grc/blocks/gr_hilbert_fc.xml (renamed from grc/data/platforms/python/blocks/gr_hilbert_fc.xml)0
-rw-r--r--grc/blocks/gr_iir_filter_ffd.xml (renamed from grc/data/platforms/python/blocks/gr_iir_filter_ffd.xml)0
-rw-r--r--grc/blocks/gr_integrate_xx.xml (renamed from grc/data/platforms/python/blocks/gr_integrate_xx.xml)0
-rw-r--r--grc/blocks/gr_interleave.xml (renamed from grc/data/platforms/python/blocks/gr_interleave.xml)0
-rw-r--r--grc/blocks/gr_interleaved_short_to_complex.xml (renamed from grc/data/platforms/python/blocks/gr_interleaved_short_to_complex.xml)0
-rw-r--r--grc/blocks/gr_interp_fir_filter_xxx.xml (renamed from grc/data/platforms/python/blocks/gr_interp_fir_filter_xxx.xml)0
-rw-r--r--grc/blocks/gr_iqcomp_cc.xml (renamed from grc/data/platforms/python/blocks/gr_iqcomp_cc.xml)0
-rw-r--r--grc/blocks/gr_keep_one_in_n.xml (renamed from grc/data/platforms/python/blocks/gr_keep_one_in_n.xml)0
-rw-r--r--grc/blocks/gr_kludge_copy.xml (renamed from grc/data/platforms/python/blocks/gr_kludge_copy.xml)0
-rw-r--r--grc/blocks/gr_map_bb.xml (renamed from grc/data/platforms/python/blocks/gr_map_bb.xml)0
-rw-r--r--grc/blocks/gr_max_xx.xml (renamed from grc/data/platforms/python/blocks/gr_max_xx.xml)0
-rw-r--r--grc/blocks/gr_moving_average_xx.xml (renamed from grc/data/platforms/python/blocks/gr_moving_average_xx.xml)0
-rw-r--r--grc/blocks/gr_mpsk_receiver_cc.xml (renamed from grc/data/platforms/python/blocks/gr_mpsk_receiver_cc.xml)0
-rw-r--r--grc/blocks/gr_mpsk_sync_cc.xml (renamed from grc/data/platforms/python/blocks/gr_mpsk_sync_cc.xml)0
-rw-r--r--grc/blocks/gr_multiply_const_vxx.xml (renamed from grc/data/platforms/python/blocks/gr_multiply_const_vxx.xml)0
-rw-r--r--grc/blocks/gr_multiply_xx.xml (renamed from grc/data/platforms/python/blocks/gr_multiply_xx.xml)0
-rw-r--r--grc/blocks/gr_mute_xx.xml (renamed from grc/data/platforms/python/blocks/gr_mute_xx.xml)0
-rw-r--r--grc/blocks/gr_nlog10_ff.xml (renamed from grc/data/platforms/python/blocks/gr_nlog10_ff.xml)0
-rw-r--r--grc/blocks/gr_noise_source_x.xml (renamed from grc/data/platforms/python/blocks/gr_noise_source_x.xml)0
-rw-r--r--grc/blocks/gr_nop.xml (renamed from grc/data/platforms/python/blocks/gr_nop.xml)0
-rw-r--r--grc/blocks/gr_not_xx.xml (renamed from grc/data/platforms/python/blocks/gr_not_xx.xml)0
-rw-r--r--grc/blocks/gr_null_sink.xml (renamed from grc/data/platforms/python/blocks/gr_null_sink.xml)0
-rw-r--r--grc/blocks/gr_null_source.xml (renamed from grc/data/platforms/python/blocks/gr_null_source.xml)0
-rw-r--r--grc/blocks/gr_or_xx.xml (renamed from grc/data/platforms/python/blocks/gr_or_xx.xml)0
-rw-r--r--grc/blocks/gr_packed_to_unpacked_xx.xml (renamed from grc/data/platforms/python/blocks/gr_packed_to_unpacked_xx.xml)0
-rw-r--r--grc/blocks/gr_peak_detector2_fb.xml (renamed from grc/data/platforms/python/blocks/gr_peak_detector2_fb.xml)0
-rw-r--r--grc/blocks/gr_peak_detector_xb.xml (renamed from grc/data/platforms/python/blocks/gr_peak_detector_xb.xml)0
-rw-r--r--grc/blocks/gr_phase_modulator_fc.xml (renamed from grc/data/platforms/python/blocks/gr_phase_modulator_fc.xml)0
-rw-r--r--grc/blocks/gr_pll_carriertracking_cc.xml (renamed from grc/data/platforms/python/blocks/gr_pll_carriertracking_cc.xml)0
-rw-r--r--grc/blocks/gr_pll_freqdet_cf.xml (renamed from grc/data/platforms/python/blocks/gr_pll_freqdet_cf.xml)0
-rw-r--r--grc/blocks/gr_pll_refout_cc.xml (renamed from grc/data/platforms/python/blocks/gr_pll_refout_cc.xml)0
-rw-r--r--grc/blocks/gr_pn_correlator_cc.xml (renamed from grc/data/platforms/python/blocks/gr_pn_correlator_cc.xml)0
-rw-r--r--grc/blocks/gr_probe_avg_mag_sqrd_x.xml (renamed from grc/data/platforms/python/blocks/gr_probe_avg_mag_sqrd_x.xml)0
-rw-r--r--grc/blocks/gr_probe_density_b.xml (renamed from grc/data/platforms/python/blocks/gr_probe_density_b.xml)0
-rw-r--r--grc/blocks/gr_probe_mpsk_snr_c.xml (renamed from grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml)0
-rw-r--r--grc/blocks/gr_pwr_squelch_xx.xml (renamed from grc/data/platforms/python/blocks/gr_pwr_squelch_xx.xml)0
-rw-r--r--grc/blocks/gr_quadrature_demod_cf.xml (renamed from grc/data/platforms/python/blocks/gr_quadrature_demod_cf.xml)0
-rw-r--r--grc/blocks/gr_rational_resampler_base_xxx.xml (renamed from grc/data/platforms/python/blocks/gr_rational_resampler_base_xxx.xml)0
-rw-r--r--grc/blocks/gr_repeat.xml (renamed from grc/data/platforms/python/blocks/gr_repeat.xml)0
-rw-r--r--grc/blocks/gr_rms_xx.xml (renamed from grc/data/platforms/python/blocks/gr_rms_xx.xml)0
-rw-r--r--grc/blocks/gr_sample_and_hold_xx.xml (renamed from grc/data/platforms/python/blocks/gr_sample_and_hold_xx.xml)0
-rw-r--r--grc/blocks/gr_scrambler_bb.xml (renamed from grc/data/platforms/python/blocks/gr_scrambler_bb.xml)0
-rw-r--r--grc/blocks/gr_short_to_float.xml (renamed from grc/data/platforms/python/blocks/gr_short_to_float.xml)0
-rw-r--r--grc/blocks/gr_sig_source_x.xml (renamed from grc/data/platforms/python/blocks/gr_sig_source_x.xml)0
-rw-r--r--grc/blocks/gr_simple_correlator.xml (renamed from grc/data/platforms/python/blocks/gr_simple_correlator.xml)0
-rw-r--r--grc/blocks/gr_simple_framer.xml (renamed from grc/data/platforms/python/blocks/gr_simple_framer.xml)0
-rw-r--r--grc/blocks/gr_simple_squelch_cc.xml (renamed from grc/data/platforms/python/blocks/gr_simple_squelch_cc.xml)0
-rw-r--r--grc/blocks/gr_single_pole_iir_filter_xx.xml (renamed from grc/data/platforms/python/blocks/gr_single_pole_iir_filter_xx.xml)0
-rw-r--r--grc/blocks/gr_skiphead.xml (renamed from grc/data/platforms/python/blocks/gr_skiphead.xml)0
-rw-r--r--grc/blocks/gr_stream_to_streams.xml (renamed from grc/data/platforms/python/blocks/gr_stream_to_streams.xml)0
-rw-r--r--grc/blocks/gr_stream_to_vector.xml (renamed from grc/data/platforms/python/blocks/gr_stream_to_vector.xml)0
-rw-r--r--grc/blocks/gr_streams_to_stream.xml (renamed from grc/data/platforms/python/blocks/gr_streams_to_stream.xml)0
-rw-r--r--grc/blocks/gr_streams_to_vector.xml (renamed from grc/data/platforms/python/blocks/gr_streams_to_vector.xml)0
-rw-r--r--grc/blocks/gr_sub_xx.xml (renamed from grc/data/platforms/python/blocks/gr_sub_xx.xml)0
-rw-r--r--grc/blocks/gr_threshold_ff.xml (renamed from grc/data/platforms/python/blocks/gr_threshold_ff.xml)0
-rw-r--r--grc/blocks/gr_throttle.xml (renamed from grc/data/platforms/python/blocks/gr_throttle.xml)0
-rw-r--r--grc/blocks/gr_uchar_to_float.xml (renamed from grc/data/platforms/python/blocks/gr_uchar_to_float.xml)0
-rw-r--r--grc/blocks/gr_udp_sink.xml (renamed from grc/data/platforms/python/blocks/gr_udp_sink.xml)0
-rw-r--r--grc/blocks/gr_udp_source.xml (renamed from grc/data/platforms/python/blocks/gr_udp_source.xml)0
-rw-r--r--grc/blocks/gr_unpack_k_bits_bb.xml (renamed from grc/data/platforms/python/blocks/gr_unpack_k_bits_bb.xml)0
-rw-r--r--grc/blocks/gr_unpacked_to_packed_xx.xml (renamed from grc/data/platforms/python/blocks/gr_unpacked_to_packed_xx.xml)0
-rw-r--r--grc/blocks/gr_vco_f.xml (renamed from grc/data/platforms/python/blocks/gr_vco_f.xml)0
-rw-r--r--grc/blocks/gr_vector_sink_x.xml (renamed from grc/data/platforms/python/blocks/gr_vector_sink_x.xml)0
-rw-r--r--grc/blocks/gr_vector_source_x.xml (renamed from grc/data/platforms/python/blocks/gr_vector_source_x.xml)0
-rw-r--r--grc/blocks/gr_vector_to_stream.xml (renamed from grc/data/platforms/python/blocks/gr_vector_to_stream.xml)0
-rw-r--r--grc/blocks/gr_vector_to_streams.xml (renamed from grc/data/platforms/python/blocks/gr_vector_to_streams.xml)0
-rw-r--r--grc/blocks/gr_wavfile_sink.xml (renamed from grc/data/platforms/python/blocks/gr_wavfile_sink.xml)0
-rw-r--r--grc/blocks/gr_wavfile_source.xml (renamed from grc/data/platforms/python/blocks/gr_wavfile_source.xml)0
-rw-r--r--grc/blocks/gr_xor_xx.xml (renamed from grc/data/platforms/python/blocks/gr_xor_xx.xml)0
-rw-r--r--grc/blocks/high_pass_filter.xml (renamed from grc/data/platforms/python/blocks/high_pass_filter.xml)12
-rw-r--r--grc/blocks/import.xml (renamed from grc/data/platforms/python/blocks/import.xml)0
-rw-r--r--grc/blocks/low_pass_filter.xml (renamed from grc/data/platforms/python/blocks/low_pass_filter.xml)12
-rw-r--r--grc/blocks/note.xml (renamed from grc/data/platforms/python/blocks/note.xml)0
-rw-r--r--grc/blocks/options.xml (renamed from grc/data/platforms/python/blocks/options.xml)37
-rw-r--r--grc/blocks/pad_sink.xml (renamed from grc/data/platforms/python/blocks/pad_sink.xml)0
-rw-r--r--grc/blocks/pad_source.xml (renamed from grc/data/platforms/python/blocks/pad_source.xml)0
-rw-r--r--grc/blocks/parameter.xml (renamed from grc/data/platforms/python/blocks/parameter.xml)1
-rw-r--r--grc/blocks/probe_function.xml (renamed from grc/data/platforms/python/blocks/probe_function.xml)0
-rw-r--r--grc/blocks/random_source_x.xml (renamed from grc/data/platforms/python/blocks/random_source_x.xml)0
-rw-r--r--grc/blocks/root_raised_cosine_filter.xml101
-rw-r--r--grc/blocks/trellis_encoder_xx.xml (renamed from grc/data/platforms/python/blocks/trellis_encoder_xx.xml)0
-rw-r--r--grc/blocks/trellis_metrics_x.xml (renamed from grc/data/platforms/python/blocks/trellis_metrics_x.xml)0
-rw-r--r--grc/blocks/trellis_permutation.xml (renamed from grc/data/platforms/python/blocks/trellis_permutation.xml)0
-rw-r--r--grc/blocks/trellis_siso_combined_f.xml (renamed from grc/data/platforms/python/blocks/trellis_siso_combined_f.xml)0
-rw-r--r--grc/blocks/trellis_siso_f.xml (renamed from grc/data/platforms/python/blocks/trellis_siso_f.xml)0
-rw-r--r--grc/blocks/trellis_viterbi_combined_xx.xml (renamed from grc/data/platforms/python/blocks/trellis_viterbi_combined_xx.xml)0
-rw-r--r--grc/blocks/trellis_viterbi_x.xml (renamed from grc/data/platforms/python/blocks/trellis_viterbi_x.xml)0
-rw-r--r--grc/blocks/usrp2_probe.xml (renamed from grc/data/platforms/python/blocks/usrp2_probe.xml)0
-rw-r--r--grc/blocks/usrp2_sink_xxxx.xml (renamed from grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml)0
-rw-r--r--grc/blocks/usrp2_source_xxxx.xml (renamed from grc/data/platforms/python/blocks/usrp2_source_xxxx.xml)0
-rw-r--r--grc/blocks/usrp_dual_sink_x.xml (renamed from grc/data/platforms/python/blocks/usrp_dual_sink_x.xml)0
-rw-r--r--grc/blocks/usrp_dual_source_x.xml (renamed from grc/data/platforms/python/blocks/usrp_dual_source_x.xml)0
-rw-r--r--grc/blocks/usrp_probe.xml (renamed from grc/data/platforms/python/blocks/usrp_probe.xml)0
-rw-r--r--grc/blocks/usrp_simple_sink_x.xml (renamed from grc/data/platforms/python/blocks/usrp_simple_sink_x.xml)0
-rw-r--r--grc/blocks/usrp_simple_source_x.xml (renamed from grc/data/platforms/python/blocks/usrp_simple_source_x.xml)0
-rw-r--r--grc/blocks/variable.xml (renamed from grc/data/platforms/python/blocks/variable.xml)4
-rw-r--r--grc/blocks/variable_check_box.xml75
-rw-r--r--grc/blocks/variable_chooser.xml (renamed from grc/data/platforms/python/blocks/variable_chooser.xml)16
-rw-r--r--grc/blocks/variable_config.xml86
-rw-r--r--grc/blocks/variable_slider.xml (renamed from grc/data/platforms/python/blocks/variable_slider.xml)29
-rw-r--r--grc/blocks/variable_static_text.xml88
-rw-r--r--grc/blocks/variable_text_box.xml (renamed from grc/data/platforms/python/blocks/variable_text_box.xml)29
-rw-r--r--grc/blocks/wxgui_constellationsink2.xml (renamed from grc/data/platforms/python/blocks/wxgui_constellationsink2.xml)0
-rw-r--r--grc/blocks/wxgui_fftsink2.xml (renamed from grc/data/platforms/python/blocks/wxgui_fftsink2.xml)0
-rw-r--r--grc/blocks/wxgui_histosink2.xml (renamed from grc/data/platforms/python/blocks/wxgui_histosink2.xml)0
-rw-r--r--grc/blocks/wxgui_numbersink2.xml (renamed from grc/data/platforms/python/blocks/wxgui_numbersink2.xml)0
-rw-r--r--grc/blocks/wxgui_scopesink2.xml (renamed from grc/data/platforms/python/blocks/wxgui_scopesink2.xml)0
-rw-r--r--grc/blocks/wxgui_waterfallsink2.xml (renamed from grc/data/platforms/python/blocks/wxgui_waterfallsink2.xml)0
-rw-r--r--grc/blocks/xmlrpc_client.xml (renamed from grc/data/platforms/python/blocks/xmlrpc_client.xml)0
-rw-r--r--grc/blocks/xmlrpc_server.xml (renamed from grc/data/platforms/python/blocks/xmlrpc_server.xml)0
-rw-r--r--grc/cpp/README5
-rw-r--r--grc/data/Makefile.am24
-rw-r--r--grc/data/platforms/Makefile.am24
-rw-r--r--grc/data/platforms/base/Makefile.am28
-rw-r--r--grc/data/platforms/python/Makefile.am32
-rw-r--r--grc/grc.conf.in9
-rw-r--r--grc/grc_gnuradio/Makefile.am (renamed from grc/src/Makefile.am)33
-rw-r--r--grc/grc_gnuradio/README14
-rw-r--r--grc/grc_gnuradio/__init__.py (renamed from grc/src/__init__.py)0
-rw-r--r--grc/grc_gnuradio/blks2/__init__.py (renamed from grc/src/grc_gnuradio/blks2/__init__.py)0
-rw-r--r--grc/grc_gnuradio/blks2/error_rate.py (renamed from grc/src/grc_gnuradio/blks2/error_rate.py)0
-rw-r--r--grc/grc_gnuradio/blks2/packet.py (renamed from grc/src/grc_gnuradio/blks2/packet.py)0
-rw-r--r--grc/grc_gnuradio/blks2/probe.py (renamed from grc/src/grc_gnuradio/blks2/probe.py)0
-rw-r--r--grc/grc_gnuradio/blks2/selector.py (renamed from grc/src/grc_gnuradio/blks2/selector.py)0
-rw-r--r--grc/grc_gnuradio/blks2/tcp.py (renamed from grc/src/grc_gnuradio/blks2/tcp.py)0
-rw-r--r--grc/grc_gnuradio/blks2/variable_sink.py (renamed from grc/src/grc_gnuradio/blks2/variable_sink.py)0
-rw-r--r--grc/grc_gnuradio/usrp/__init__.py (renamed from grc/src/grc_gnuradio/usrp/__init__.py)0
-rw-r--r--grc/grc_gnuradio/usrp/common.py (renamed from grc/src/grc_gnuradio/usrp/common.py)0
-rw-r--r--grc/grc_gnuradio/usrp/dual_usrp.py (renamed from grc/src/grc_gnuradio/usrp/dual_usrp.py)0
-rw-r--r--grc/grc_gnuradio/usrp/simple_usrp.py (renamed from grc/src/grc_gnuradio/usrp/simple_usrp.py)0
-rw-r--r--grc/grc_gnuradio/wxgui/__init__.py (renamed from grc/src/grc_gnuradio/wxgui/__init__.py)0
-rw-r--r--grc/grc_gnuradio/wxgui/top_block_gui.py (renamed from grc/src/grc_gnuradio/wxgui/top_block_gui.py)15
-rw-r--r--grc/gui/ActionHandler.py (renamed from grc/src/gui/ActionHandler.py)11
-rw-r--r--grc/gui/Actions.py (renamed from grc/src/gui/Actions.py)2
-rw-r--r--grc/gui/Bars.py (renamed from grc/src/gui/Bars.py)1
-rw-r--r--grc/gui/Block.py (renamed from grc/src/platforms/gui/Block.py)2
-rw-r--r--grc/gui/BlockTreeWindow.py (renamed from grc/src/gui/BlockTreeWindow.py)2
-rw-r--r--grc/gui/Colors.py (renamed from grc/src/platforms/gui/Colors.py)0
-rw-r--r--grc/gui/Connection.py (renamed from grc/src/platforms/gui/Connection.py)0
-rw-r--r--grc/gui/Constants.py (renamed from grc/src/platforms/gui/Constants.py)39
-rw-r--r--grc/gui/Dialogs.py (renamed from grc/src/gui/Dialogs.py)57
-rw-r--r--grc/gui/DrawingArea.py (renamed from grc/src/gui/DrawingArea.py)0
-rw-r--r--grc/gui/Element.py (renamed from grc/src/platforms/gui/Element.py)0
-rw-r--r--grc/gui/FileDialogs.py (renamed from grc/src/gui/FileDialogs.py)21
-rw-r--r--grc/gui/FlowGraph.py (renamed from grc/src/platforms/gui/FlowGraph.py)5
-rw-r--r--grc/gui/MainWindow.py (renamed from grc/src/gui/MainWindow.py)57
-rw-r--r--grc/gui/Makefile.am (renamed from grc/src/gui/Makefile.am)13
-rw-r--r--grc/gui/Messages.py (renamed from grc/src/gui/Messages.py)5
-rw-r--r--grc/gui/NotebookPage.py (renamed from grc/src/gui/NotebookPage.py)21
-rw-r--r--grc/gui/Param.py (renamed from grc/src/platforms/gui/Param.py)3
-rw-r--r--grc/gui/ParamsDialog.py (renamed from grc/src/gui/ParamsDialog.py)1
-rw-r--r--grc/gui/Platform.py (renamed from grc/src/platforms/gui/Platform.py)0
-rw-r--r--grc/gui/Port.py (renamed from grc/src/platforms/gui/Port.py)0
-rw-r--r--grc/gui/Preferences.py (renamed from grc/src/gui/Preferences.py)0
-rw-r--r--grc/gui/StateCache.py (renamed from grc/src/gui/StateCache.py)0
-rw-r--r--grc/gui/Utils.py (renamed from grc/src/platforms/gui/Utils.py)0
-rw-r--r--grc/gui/__init__.py (renamed from grc/src/grc_gnuradio/__init__.py)0
-rw-r--r--grc/python/Block.py (renamed from grc/src/platforms/python/Block.py)33
-rw-r--r--grc/python/Connection.py (renamed from grc/src/platforms/python/Connection.py)4
-rw-r--r--grc/python/Constants.py (renamed from grc/src/platforms/python/Constants.py.in)23
-rw-r--r--grc/python/FlowGraph.py (renamed from grc/src/platforms/python/FlowGraph.py)41
-rw-r--r--grc/python/Generator.py (renamed from grc/src/platforms/python/Generator.py)41
-rw-r--r--grc/python/Makefile.am (renamed from grc/src/platforms/python/utils/Makefile.am)19
-rw-r--r--grc/python/Param.py (renamed from grc/src/platforms/python/Param.py)160
-rw-r--r--grc/python/Platform.py (renamed from grc/src/platforms/python/Platform.py)38
-rw-r--r--grc/python/Port.py (renamed from grc/src/platforms/python/Port.py)8
-rw-r--r--grc/python/__init__.py (renamed from grc/src/gui/__init__.py)0
-rw-r--r--grc/python/block.dtd (renamed from grc/data/platforms/python/block.dtd)3
-rw-r--r--grc/python/convert_hier.py (renamed from grc/src/platforms/python/utils/convert_hier.py)9
-rw-r--r--grc/python/default_flow_graph.grc (renamed from grc/data/platforms/python/default_flow_graph.grc)0
-rw-r--r--grc/python/expr_utils.py (renamed from grc/src/platforms/python/utils/expr_utils.py)10
-rw-r--r--grc/python/extract_docs.py (renamed from grc/src/platforms/python/utils/extract_docs.py)8
-rw-r--r--grc/python/flow_graph.tmpl (renamed from grc/data/platforms/python/flow_graph.tmpl)50
-rwxr-xr-xgrc/scripts/grc11
-rwxr-xr-xgrc/scripts/usrp2_probe6
-rwxr-xr-xgrc/scripts/usrp_probe6
-rw-r--r--grc/src/grc_gnuradio/Makefile.am31
-rw-r--r--grc/src/grc_gnuradio/blks2/Makefile.am33
-rw-r--r--grc/src/grc_gnuradio/usrp/Makefile.am30
-rw-r--r--grc/src/grc_gnuradio/wxgui/Makefile.am27
-rw-r--r--grc/src/platforms/Makefile.am31
-rw-r--r--grc/src/platforms/__init__.py1
-rw-r--r--grc/src/platforms/base/Makefile.am46
-rw-r--r--grc/src/platforms/base/__init__.py1
-rw-r--r--grc/src/platforms/gui/__init__.py1
-rw-r--r--grc/src/platforms/python/Makefile.am48
-rw-r--r--grc/src/platforms/python/__init__.py1
-rw-r--r--grc/src/platforms/python/utils/__init__.py1
-rw-r--r--grc/src/utils/Makefile.am30
-rw-r--r--grc/src/utils/converter.py248
-rw-r--r--grc/todo.txt30
301 files changed, 1397 insertions, 1238 deletions
diff --git a/config/grc_grc.m4 b/config/grc_grc.m4
index d8bc02a24..ce23e3c25 100644
--- a/config/grc_grc.m4
+++ b/config/grc_grc.m4
@@ -1,4 +1,4 @@
-dnl Copyright 2008 Free Software Foundation, Inc.
+dnl Copyright 2008, 2009 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -47,27 +47,15 @@ AC_DEFUN([GRC_GRC],[
AC_SUBST(PYTHONW)
AC_CONFIG_FILES([ \
- grc/src/grc_gnuradio/Makefile \
- grc/src/grc_gnuradio/wxgui/Makefile \
- grc/src/grc_gnuradio/blks2/Makefile \
- grc/src/grc_gnuradio/usrp/Makefile \
- grc/src/Makefile \
- grc/src/platforms/Makefile \
- grc/src/platforms/base/Makefile \
- grc/src/platforms/python/Makefile \
- grc/src/platforms/python/utils/Makefile \
- grc/src/platforms/gui/Makefile \
- grc/src/utils/Makefile \
- grc/src/gui/Makefile \
- grc/examples/Makefile \
grc/Makefile \
- grc/data/Makefile \
- grc/data/platforms/Makefile \
- grc/data/platforms/base/Makefile \
- grc/data/platforms/python/Makefile \
- grc/data/platforms/python/blocks/Makefile \
- grc/scripts/Makefile \
+ grc/base/Makefile \
+ grc/blocks/Makefile \
+ grc/examples/Makefile \
grc/freedesktop/Makefile \
+ grc/grc_gnuradio/Makefile \
+ grc/gui/Makefile \
+ grc/python/Makefile \
+ grc/scripts/Makefile \
])
GRC_BUILD_CONDITIONAL(grc)
diff --git a/gr-wxgui/src/python/forms/converters.py b/gr-wxgui/src/python/forms/converters.py
index 123aefeb0..e535cb2dd 100644
--- a/gr-wxgui/src/python/forms/converters.py
+++ b/gr-wxgui/src/python/forms/converters.py
@@ -85,22 +85,28 @@ class eval_converter(abstract_converter):
Possible uses, set a complex number, constellation points.
Used in text box.
"""
- def external_to_internal(self, s):
- return str(s)
+ def __init__(self, formatter=lambda x: '%s'%(x)):
+ self._formatter = formatter
+ def external_to_internal(self, v):
+ return self._formatter(v)
def internal_to_external(self, s):
return eval(s)
def help(self):
return "Value must be evaluatable by python's eval."
class str_converter(abstract_converter):
+ def __init__(self, formatter=lambda x: '%s'%(x)):
+ self._formatter = formatter
def external_to_internal(self, v):
- return str(v)
+ return self._formatter(v)
def internal_to_external(self, s):
return str(s)
class int_converter(abstract_converter):
+ def __init__(self, formatter=lambda x: '%d'%round(x)):
+ self._formatter = formatter
def external_to_internal(self, v):
- return str(int(round(v)))
+ return self._formatter(v)
def internal_to_external(self, s):
return int(s, 0)
def help(self):
@@ -127,7 +133,8 @@ class slider_converter(abstract_converter):
self._scaler = float(maximum - minimum)/num_steps
self._cast = cast
def external_to_internal(self, v):
- return (v - self._offset)/self._scaler
+ #slider's internal representation is an integer
+ return int(round((v - self._offset)/self._scaler))
def internal_to_external(self, v):
return self._cast(v*self._scaler + self._offset)
def help(self):
diff --git a/gr-wxgui/src/python/forms/forms.py b/gr-wxgui/src/python/forms/forms.py
index 10f6a4823..c69315b03 100644
--- a/gr-wxgui/src/python/forms/forms.py
+++ b/gr-wxgui/src/python/forms/forms.py
@@ -115,7 +115,6 @@ class _form_base(pubsub, wx.BoxSizer):
self.subscribe(INT_KEY, update)
self.subscribe(INT_KEY, self._translate_internal_to_external)
self.subscribe(EXT_KEY, self._translate_external_to_internal)
- if self._callback: self.subscribe(EXT_KEY, self._callback)
def _translate_external_to_internal(self, external):
try:
@@ -134,6 +133,7 @@ class _form_base(pubsub, wx.BoxSizer):
except Exception, e:
self._err_msg(internal, e)
self[EXT_KEY] = self[EXT_KEY] #reset to last good setting
+ if self._callback: self._callback(self[EXT_KEY])
def _err_msg(self, value, e):
print >> sys.stderr, self, 'Error translating value: "%s"\n\t%s\n\t%s'%(value, e, self._converter.help())
diff --git a/grc/Makefile.am b/grc/Makefile.am
index 0583e88bf..a921fdd35 100644
--- a/grc/Makefile.am
+++ b/grc/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -23,13 +23,43 @@ include $(top_srcdir)/grc/Makefile.inc
if PYTHON
SUBDIRS = \
- data \
+ base \
+ blocks \
examples \
- scripts \
- src
+ grc_gnuradio \
+ gui \
+ python \
+ scripts
## append freedesktop to the list of subdirs when xdg utils are present
if XDG_UTILS
SUBDIRS += freedesktop
endif
+
+ourpythondir = $(grc_src_prefix)
+ourpython_PYTHON = __init__.py
+
+etcdir = $(gr_sysconfdir)
+dist_etc_DATA = grc.conf
+
+EXTRA_DIST = \
+ $(srcdir)/__init__.py.in \
+ $(srcdir)/grc.conf.in
+
+BUILT_SOURCES = \
+ __init__.py \
+ grc.conf
+
+__init__.py: $(srcdir)/__init__.py.in Makefile
+ sed \
+ -e 's|@VERSION[@]|$(VERSION)|g' \
+ $< > $@
+
+grc.conf: $(srcdir)/grc.conf.in Makefile
+ sed \
+ -e 's|@pythonw[@]|$(PYTHONW)|g' \
+ -e 's|@blocksdir[@]|$(grc_blocksdir)|g' \
+ -e 's|@docdir[@]|$(gr_docdir)|g' \
+ $< > $@
+
endif
diff --git a/grc/Makefile.inc b/grc/Makefile.inc
index c400e532f..96ee11b67 100644
--- a/grc/Makefile.inc
+++ b/grc/Makefile.inc
@@ -20,8 +20,5 @@
#
include $(top_srcdir)/Makefile.common
-grc_gnuradio_prefix = $(pythondir)/grc_gnuradio
grc_src_prefix = $(pythondir)/gnuradio/grc
-grc_base_data_reldir = grc/base
-grc_python_data_reldir = grc/python
-grc_blocks_data_reldir = grc/blocks
+grc_blocksdir = $(pkgdatadir)/grc/blocks
diff --git a/grc/src/gui/Constants.py b/grc/__init__.py.in
index f23ab8b13..4c146f95f 100644
--- a/grc/src/gui/Constants.py
+++ b/grc/__init__.py.in
@@ -1,5 +1,5 @@
"""
-Copyright 2008, 2009 Free Software Foundation, Inc.
+Copyright 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -17,32 +17,5 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-import pygtk
-pygtk.require('2.0')
-import gtk
-import os
-
-##default path for the open/save dialogs
-DEFAULT_FILE_PATH = os.getcwd()
-
-##file extensions
-IMAGE_FILE_EXTENSION = '.png'
-
-##name for new/unsaved flow graphs
-NEW_FLOGRAPH_TITLE = 'untitled'
-
-##main window constraints
-MIN_WINDOW_WIDTH = 600
-MIN_WINDOW_HEIGHT = 400
-##dialog constraints
-MIN_DIALOG_WIDTH = 500
-MIN_DIALOG_HEIGHT = 500
-##default sizes
-DEFAULT_BLOCKS_WINDOW_WIDTH = 100
-DEFAULT_REPORTS_WINDOW_WIDTH = 100
-
-##The size of the state saving cache in the flow graph (for undo/redo functionality)
-STATE_CACHE_SIZE = 42
-
-##Shared targets for drag and drop of blocks
-DND_TARGETS = [('STRING', gtk.TARGET_SAME_APP, 0)]
+#package and version constants
+VERSION = '@VERSION@'
diff --git a/grc/src/platforms/base/Block.py b/grc/base/Block.py
index 25688472c..867a14f57 100644
--- a/grc/src/platforms/base/Block.py
+++ b/grc/base/Block.py
@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from ... utils import odict
+from . import odict
from Element import Element
from Param import Param
from Port import Port
@@ -44,7 +44,7 @@ class TemplateArg(UserDict):
return str(self._param.to_code())
def __call__(self):
- return self._param.evaluate()
+ return self._param.get_evaluated()
class Block(Element):
@@ -89,8 +89,8 @@ class Block(Element):
for param in map(lambda n: self.get_parent().get_parent().Param(self, n), params):
key = param.get_key()
#test against repeated keys
- try: assert(key not in self.get_param_keys())
- except AssertionError: self._exit_with_error('Key "%s" already exists in params'%key)
+ try: assert key not in self.get_param_keys()
+ except AssertionError: raise Exception, 'Key "%s" already exists in params'%key
#store the param
self._params[key] = param
#create the source objects
@@ -98,8 +98,8 @@ class Block(Element):
for source in map(lambda n: self.get_parent().get_parent().Source(self, n), sources):
key = source.get_key()
#test against repeated keys
- try: assert(key not in self.get_source_keys())
- except AssertionError: self._exit_with_error('Key "%s" already exists in sources'%key)
+ try: assert key not in self.get_source_keys()
+ except AssertionError: raise Exception, 'Key "%s" already exists in sources'%key
#store the port
self._sources[key] = source
#create the sink objects
@@ -107,8 +107,8 @@ class Block(Element):
for sink in map(lambda n: self.get_parent().get_parent().Sink(self, n), sinks):
key = sink.get_key()
#test against repeated keys
- try: assert(key not in self.get_sink_keys())
- except AssertionError: self._exit_with_error('Key "%s" already exists in sinks'%key)
+ try: assert key not in self.get_sink_keys()
+ except AssertionError: raise Exception, 'Key "%s" already exists in sinks'%key
#store the port
self._sinks[key] = sink
#begin the testing
@@ -141,11 +141,14 @@ class Block(Element):
All ports and params must be valid.
All checks must evaluate to true.
"""
+ Element.validate(self)
for c in self.get_params() + self.get_ports() + self.get_connections():
- try: assert(c.is_valid())
+ try:
+ c.validate()
+ assert c.is_valid()
except AssertionError:
for msg in c.get_error_messages():
- self._add_error_message('>>> %s:\n\t%s'%(c, msg))
+ self.add_error_message('>>> %s:\n\t%s'%(c, msg))
def __str__(self): return 'Block - %s - %s(%s)'%(self.get_id(), self.get_name(), self.get_key())
@@ -256,4 +259,3 @@ class Block(Element):
#the key must exist in this block's params
if key in self.get_param_keys():
self.get_param(key).set_value(value)
- self.validate()
diff --git a/grc/src/platforms/base/Connection.py b/grc/base/Connection.py
index b8b75ac13..94d4751b2 100644
--- a/grc/src/platforms/base/Connection.py
+++ b/grc/base/Connection.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from Element import Element
-from ... utils import odict
+from . import odict
class Connection(Element):
@@ -59,10 +59,11 @@ class Connection(Element):
Validate the connections.
The ports must match in type.
"""
+ Element.validate(self)
source_type = self.get_source().get_type()
sink_type = self.get_sink().get_type()
try: assert source_type == sink_type
- except AssertionError: self._add_error_message('Source type "%s" does not match sink type "%s".'%(source_type, sink_type))
+ except AssertionError: self.add_error_message('Source type "%s" does not match sink type "%s".'%(source_type, sink_type))
def get_enabled(self):
"""
diff --git a/grc/src/platforms/base/Constants.py.in b/grc/base/Constants.py
index da958a6f4..ef45be8df 100644
--- a/grc/src/platforms/base/Constants.py.in
+++ b/grc/base/Constants.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -19,12 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import os
-#package and version constants
-PACKAGE = '@PACKAGE@'
-VERSION = '@VERSION@'
-
-#setup paths
-PKG_DIR = os.environ.get('GR_DATADIR', '@pkgdatadir@')
-DATA_DIR = os.path.join(PKG_DIR, '@reldatadir@')
+#data files
+DATA_DIR = os.path.dirname(__file__)
FLOW_GRAPH_DTD = os.path.join(DATA_DIR, 'flow_graph.dtd')
BLOCK_TREE_DTD = os.path.join(DATA_DIR, 'block_tree.dtd')
diff --git a/grc/src/platforms/base/Element.py b/grc/base/Element.py
index a16be9127..16000c46c 100644
--- a/grc/src/platforms/base/Element.py
+++ b/grc/base/Element.py
@@ -21,7 +21,6 @@ class Element(object):
def __init__(self, parent=None):
self._parent = parent
- self._error_messages = []
self.flag()
def test(self):
@@ -31,45 +30,17 @@ class Element(object):
"""
pass
- def validate(self):
- """
- Validate the data in this element.
- Set the error message non blank for errors.
- Overload this method in sub-classes.
- """
- pass
-
- def is_valid(self):
- self._error_messages = []#reset err msgs
- if self.get_enabled():
- try: self.validate()
- except: pass
- return not self.get_error_messages()
+ ##################################################
+ # Element Validation API
+ ##################################################
+ def validate(self): self._error_messages = list()
+ def is_valid(self): return not self.get_error_messages() or not self.get_enabled()
+ def add_error_message(self, msg): self._error_messages.append(msg)
+ def get_error_messages(self): return self._error_messages
def get_enabled(self): return True
- def _add_error_message(self, msg):
- self._error_messages.append(msg)
-
- def get_error_messages(self):
- return self._error_messages
-
- def get_parent(self):
- return self._parent
-
- def _exit_with_error(self, error):
- parent = self
- #build hier list of elements
- elements = list()
- while(parent):
- elements.insert(0, parent)
- parent = parent.get_parent()
- #build error string
- err_str = ">>> Error:"
- for i, element in enumerate(elements + [error]):
- err_str = err_str + '\n' + ''.join(' '*(i+2)) + str(element)
- err_str = err_str + '\n'
- exit(err_str)
+ def get_parent(self): return self._parent
##############################################
## Update flagging
diff --git a/grc/src/platforms/base/FlowGraph.py b/grc/base/FlowGraph.py
index 6aeef2fa7..ea489e948 100644
--- a/grc/src/platforms/base/FlowGraph.py
+++ b/grc/base/FlowGraph.py
@@ -17,11 +17,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from ... utils import odict
+from . import odict
from Element import Element
from Block import Block
from Connection import Connection
-from ... gui import Messages
+from .. gui import Messages
class FlowGraph(Element):
@@ -58,7 +58,7 @@ class FlowGraph(Element):
@param key the param key for the options block
@return the value held by that param
"""
- return self._options_block.get_param(key).evaluate()
+ return self._options_block.get_param(key).get_evaluated()
def is_flow_graph(self): return True
@@ -152,9 +152,12 @@ class FlowGraph(Element):
Validate the flow graph.
All connections and blocks must be valid.
"""
+ Element.validate(self)
for c in self.get_elements():
- try: assert c.is_valid()
- except AssertionError: self._add_error_message('Element "%s" is not valid.'%c)
+ try:
+ c.validate()
+ assert c.is_valid()
+ except AssertionError: self.add_error_message('Element "%s" is not valid.'%c)
##############################################
## Import/Export Methods
@@ -195,6 +198,7 @@ class FlowGraph(Element):
#only load the block when the block key was valid
if block: block.import_data(block_n)
else: Messages.send_error_load('Block key "%s" not found in %s'%(key, self.get_parent()))
+ self.validate() #validate all blocks before connections are made (in case of nports)
#build the connections
for connection_n in connections_n:
#try to make the connection
@@ -221,4 +225,3 @@ class FlowGraph(Element):
#build the connection
self.connect(source, sink)
except AssertionError: Messages.send_error_load('Connection between %s(%s) and %s(%s) could not be made.'%(source_block_id, source_key, sink_block_id, sink_key))
- self.validate()
diff --git a/grc/src/platforms/gui/Makefile.am b/grc/base/Makefile.am
index 2e3972ef3..e489601db 100644
--- a/grc/src/platforms/gui/Makefile.am
+++ b/grc/base/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,17 +21,21 @@
include $(top_srcdir)/grc/Makefile.inc
-ourpythondir = $(grc_src_prefix)/platforms/gui
-
+ourpythondir = $(grc_src_prefix)/base
ourpython_PYTHON = \
+ odict.py \
+ ParseXML.py \
Block.py \
- Colors.py \
- Constants.py \
Connection.py \
+ Constants.py \
Element.py \
FlowGraph.py \
Param.py \
Platform.py \
Port.py \
- Utils.py \
__init__.py
+
+ourdatadir = $(grc_src_prefix)/base
+dist_ourdata_DATA = \
+ block_tree.dtd \
+ flow_graph.dtd
diff --git a/grc/src/platforms/base/Param.py b/grc/base/Param.py
index 81783c791..8166d54ec 100644
--- a/grc/src/platforms/base/Param.py
+++ b/grc/base/Param.py
@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from ... utils import odict
+from . import odict
from Element import Element
import pygtk
pygtk.require('2.0')
@@ -98,15 +98,15 @@ class Option(Element):
opts = n.findall('opt')
#test against opts when non enum
try: assert self.get_parent().is_enum() or not opts
- except AssertionError: self._exit_with_error('Options for non-enum types cannot have sub-options')
+ except AssertionError: raise Exception, 'Options for non-enum types cannot have sub-options'
#extract opts
for opt in opts:
#separate the key:value
try: key, value = opt.split(':')
- except: self._exit_with_error('Error separating "%s" into key:value'%opt)
+ except: raise Exception, 'Error separating "%s" into key:value'%opt
#test against repeated keys
try: assert not self._opts.has_key(key)
- except AssertionError: self._exit_with_error('Key "%s" already exists in option'%key)
+ except AssertionError: raise Exception, 'Key "%s" already exists in option'%key
#store the option
self._opts[key] = value
@@ -146,24 +146,24 @@ class Param(Element):
for option in map(lambda o: Option(self, o), n.findall('option')):
key = option.get_key()
#test against repeated keys
- try: assert(key not in self.get_option_keys())
- except AssertionError: self._exit_with_error('Key "%s" already exists in options'%key)
+ try: assert key not in self.get_option_keys()
+ except AssertionError: raise Exception, 'Key "%s" already exists in options'%key
#store the option
self._options[key] = option
#test the enum options
if self.is_enum():
#test against options with identical keys
- try: assert(len(set(self.get_option_keys())) == len(self._options))
- except AssertionError: self._exit_with_error('Options keys "%s" are not unique.'%self.get_option_keys())
+ try: assert len(set(self.get_option_keys())) == len(self._options)
+ except AssertionError: raise Exception, 'Options keys "%s" are not unique.'%self.get_option_keys()
#test against inconsistent keys in options
opt_keys = self._options.values()[0].get_opt_keys()
for option in self._options.values():
- try: assert(set(opt_keys) == set(option.get_opt_keys()))
- except AssertionError: self._exit_with_error('Opt keys "%s" are not identical across all options.'%opt_keys)
+ try: assert set(opt_keys) == set(option.get_opt_keys())
+ except AssertionError: raise Exception, 'Opt keys "%s" are not identical across all options.'%opt_keys
#if a value is specified, it must be in the options keys
self._value = value or self.get_option_keys()[0]
- try: assert(self.get_value() in self.get_option_keys())
- except AssertionError: self._exit_with_error('The value "%s" is not in the possible values of "%s".'%(self.get_value(), self.get_option_keys()))
+ try: assert self.get_value() in self.get_option_keys()
+ except AssertionError: raise Exception, 'The value "%s" is not in the possible values of "%s".'%(self.get_value(), self.get_option_keys())
else: self._value = value or ''
def test(self):
@@ -177,21 +177,11 @@ class Param(Element):
Validate the param.
The value must be evaluated and type must a possible type.
"""
- try:
- assert(self.get_type() in self.TYPES)
- try: self.evaluate()
- except:
- #if the evaluate failed but added no error messages, add the generic one below
- if not self.get_error_messages():
- self._add_error_message('Value "%s" cannot be evaluated.'%self.get_value())
- except AssertionError: self._add_error_message('Type "%s" is not a possible type.'%self.get_type())
-
- def evaluate(self):
- """
- Evaluate the value of this param.
- @throw NotImplementedError
- """
- raise NotImplementedError
+ Element.validate(self)
+ try: assert self.get_type() in self.TYPES
+ except AssertionError: self.add_error_message('Type "%s" is not a possible type.'%self.get_type())
+
+ def get_evaluated(self): raise NotImplementedError
def to_code(self):
"""
diff --git a/grc/src/utils/ParseXML.py b/grc/base/ParseXML.py
index d05b7b8b5..078ebd078 100644
--- a/grc/src/utils/ParseXML.py
+++ b/grc/base/ParseXML.py
@@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from lxml import etree
-from .. utils import odict
+from . import odict
class XMLSyntaxError(Exception):
def __init__(self, error_log):
diff --git a/grc/src/platforms/base/Platform.py b/grc/base/Platform.py
index 35227d99f..6cbe741dd 100644
--- a/grc/src/platforms/base/Platform.py
+++ b/grc/base/Platform.py
@@ -18,69 +18,97 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
import os
-from ... utils import ParseXML
+import sys
+from .. base import ParseXML
from Element import Element as _Element
from FlowGraph import FlowGraph as _FlowGraph
from Connection import Connection as _Connection
from Block import Block as _Block
from Port import Port as _Port
from Param import Param as _Param
-from Constants import BLOCK_TREE_DTD
+from Constants import BLOCK_TREE_DTD, FLOW_GRAPH_DTD
class Platform(_Element):
- def __init__(self, name, key, block_paths, block_dtd, block_tree, default_flow_graph, generator):
+ def __init__(self, name, version, key,
+ block_paths, block_dtd, default_flow_graph, generator,
+ license='', website=None, colors=[]):
"""
Make a platform from the arguments.
@param name the platform name
+ @param version the version string
@param key the unique platform key
@param block_paths the file paths to blocks in this platform
@param block_dtd the dtd validator for xml block wrappers
- @param block_tree the nested tree of block keys and categories
@param default_flow_graph the default flow graph file path
- @param load_one a single file to load into this platform or None
+ @param generator the generator class for this platform
+ @param colors a list of title, color_spec tuples
+ @param license a multi-line license (first line is copyright)
+ @param website the website url for this platform
@return a platform object
"""
_Element.__init__(self)
self._name = name
+ self._version = version
self._key = key
+ self._license = license
+ self._website = website
self._block_paths = block_paths
self._block_dtd = block_dtd
- self._block_tree = block_tree
self._default_flow_graph = default_flow_graph
self._generator = generator
+ self._colors = colors
#create a dummy flow graph for the blocks
self._flow_graph = _Element(self)
- #load the blocks
- self._blocks = dict()
- self._blocks_n = dict()
+ #search for *.xml files in the given search path
+ xml_files = list()
for block_path in self._block_paths:
- if os.path.isfile(block_path): self._load_blocks(block_path)
+ if os.path.isfile(block_path): xml_files.append(block_path)
elif os.path.isdir(block_path):
for dirpath, dirnames, filenames in os.walk(block_path):
for filename in filter(lambda f: f.endswith('.xml'), filenames):
- self._load_blocks(os.path.join(dirpath, filename))
-
- def _load_blocks(self, f):
+ xml_files.append(os.path.join(dirpath, filename))
+ #load the blocks
+ self._blocks = dict()
+ self._blocks_n = dict()
+ self._block_tree_files = list()
+ for xml_file in xml_files:
+ try: #try to add the xml file as a block wrapper
+ ParseXML.validate_dtd(xml_file, self._block_dtd)
+ n = ParseXML.from_file(xml_file).find('block')
+ #inject block wrapper path
+ n['block_wrapper_path'] = xml_file
+ block = self.Block(self._flow_graph, n)
+ key = block.get_key()
+ #test against repeated keys
+ try:
+ assert key not in self.get_block_keys()
+ #store the block
+ self._blocks[key] = block
+ self._blocks_n[key] = n
+ except AssertionError:
+ print >> sys.stderr, 'Warning: Block with key "%s" already exists.\n\tIgnoring: %s'%(key, xml_file)
+ except ParseXML.XMLSyntaxError, e:
+ try: #try to add the xml file as a block tree
+ ParseXML.validate_dtd(xml_file, BLOCK_TREE_DTD)
+ self._block_tree_files.append(xml_file)
+ except ParseXML.XMLSyntaxError, e:
+ print >> sys.stderr, 'Warning: Block validation failed:\n\t%s\n\tIgnoring: %s'%(e, xml_file)
+ except Exception, e:
+ print >> sys.stderr, 'Warning: Block loading failed:\n\t%s\n\tIgnoring: %s'%(e, xml_file)
+
+ def parse_flow_graph(self, flow_graph_file):
"""
- Load the block wrappers from the file path.
- The block wrapper must pass validation.
- If any of the checks fail, exit with error.
- @param f the file path
+ Parse a saved flow graph file.
+ Ensure that the file exists, and passes the dtd check.
+ @param flow_graph_file the flow graph file
+ @return nested data
+ @throws exception if the validation fails
"""
- try: ParseXML.validate_dtd(f, self._block_dtd)
- except ParseXML.XMLSyntaxError, e: self._exit_with_error('Block definition "%s" failed: \n\t%s'%(f, e))
- n = ParseXML.from_file(f).find('block')
- #inject block wrapper path
- n['block_wrapper_path'] = f
- block = self.Block(self._flow_graph, n)
- key = block.get_key()
- #test against repeated keys
- try: assert(key not in self.get_block_keys())
- except AssertionError: self._exit_with_error('Key "%s" already exists in blocks'%key)
- #store the block
- self._blocks[key] = block
- self._blocks_n[key] = n
+ flow_graph_file = flow_graph_file or self._default_flow_graph
+ open(flow_graph_file, 'r') #test open
+ ParseXML.validate_dtd(flow_graph_file, FLOW_GRAPH_DTD)
+ return ParseXML.from_file(flow_graph_file)
def load_block_tree(self, block_tree):
"""
@@ -98,17 +126,19 @@ class Platform(_Element):
map(lambda c: load_category(c, parent), cat_n.findall('cat'))
#add blocks in this category
for block_key in cat_n.findall('block'):
+ if block_key not in self.get_block_keys():
+ print >> sys.stderr, 'Warning: Block key "%s" not found when loading category tree.'%(block_key)
+ continue
block_tree.add_block(parent, self.get_block(block_key))
#load the block tree
- f = self._block_tree
- try: ParseXML.validate_dtd(f, BLOCK_TREE_DTD)
- except ParseXML.XMLSyntaxError, e: self._exit_with_error('Block tree "%s" failed: \n\t%s'%(f, e))
- #add all blocks in the tree
- load_category(ParseXML.from_file(f).find('cat'))
- #add all other blocks, use the catgory
+ for block_tree_file in self._block_tree_files:
+ #recursivly add all blocks in the tree
+ load_category(ParseXML.from_file(block_tree_file).find('cat'))
+ #add all other blocks, use the catgory tag
for block in self.get_blocks():
#blocks with empty categories are in the xml block tree or hidden
- if block.get_category(): block_tree.add_block(block.get_category(), block)
+ if not block.get_category(): continue
+ block_tree.add_block(block.get_category(), block)
def __str__(self): return 'Platform - %s(%s)'%(self.get_key(), self.get_name())
@@ -116,8 +146,6 @@ class Platform(_Element):
def get_new_flow_graph(self): return self.FlowGraph(self)
- def get_default_flow_graph(self): return self._default_flow_graph
-
def get_generator(self): return self._generator
##############################################
@@ -129,8 +157,11 @@ class Platform(_Element):
def get_new_block(self, flow_graph, key): return self.Block(flow_graph, n=self._blocks_n[key])
def get_name(self): return self._name
-
+ def get_version(self): return self._version
def get_key(self): return self._key
+ def get_license(self): return self._license
+ def get_website(self): return self._website
+ def get_colors(self): return self._colors
##############################################
# Constructors
diff --git a/grc/src/platforms/base/Port.py b/grc/base/Port.py
index f46a81195..f4e8e5e1f 100644
--- a/grc/src/platforms/base/Port.py
+++ b/grc/base/Port.py
@@ -46,8 +46,9 @@ class Port(Element):
Validate the port.
The port must be non-empty and type must a possible type.
"""
- try: assert(self.get_type() in self.TYPES)
- except AssertionError: self._add_error_message('Type "%s" is not a possible type.'%self.get_type())
+ Element.validate(self)
+ try: assert self.get_type() in self.TYPES
+ except AssertionError: self.add_error_message('Type "%s" is not a possible type.'%self.get_type())
def __str__(self):
if self.is_source():
diff --git a/grc/src/utils/__init__.py b/grc/base/__init__.py
index 2682db812..2682db812 100644
--- a/grc/src/utils/__init__.py
+++ b/grc/base/__init__.py
diff --git a/grc/data/platforms/base/block_tree.dtd b/grc/base/block_tree.dtd
index be1524a38..be1524a38 100644
--- a/grc/data/platforms/base/block_tree.dtd
+++ b/grc/base/block_tree.dtd
diff --git a/grc/data/platforms/base/flow_graph.dtd b/grc/base/flow_graph.dtd
index 904147b37..904147b37 100644
--- a/grc/data/platforms/base/flow_graph.dtd
+++ b/grc/base/flow_graph.dtd
diff --git a/grc/src/utils/odict.py b/grc/base/odict.py
index ac3cb2070..ac3cb2070 100644
--- a/grc/src/utils/odict.py
+++ b/grc/base/odict.py
diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/blocks/Makefile.am
index d3b3564cd..d6df9fca4 100644
--- a/grc/data/platforms/python/blocks/Makefile.am
+++ b/grc/blocks/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,9 +21,9 @@
include $(top_srcdir)/grc/Makefile.inc
-ourdatadir = $(pkgdatadir)/$(grc_blocks_data_reldir)
-
+ourdatadir = $(grc_blocksdir)
dist_ourdata_DATA = \
+ block_tree.xml \
audio_sink.xml \
audio_source.xml \
band_pass_filter.xml \
@@ -191,6 +191,7 @@ dist_ourdata_DATA = \
parameter.xml \
probe_function.xml \
random_source_x.xml \
+ root_raised_cosine_filter.xml \
trellis_encoder_xx.xml \
trellis_metrics_x.xml \
trellis_permutation.xml \
@@ -207,8 +208,11 @@ dist_ourdata_DATA = \
usrp_simple_sink_x.xml \
usrp_simple_source_x.xml \
variable.xml \
+ variable_check_box.xml \
variable_chooser.xml \
+ variable_config.xml \
variable_slider.xml \
+ variable_static_text.xml \
variable_text_box.xml \
wxgui_constellationsink2.xml \
wxgui_fftsink2.xml \
diff --git a/grc/data/platforms/python/blocks/audio_sink.xml b/grc/blocks/audio_sink.xml
index 75d583470..75d583470 100644
--- a/grc/data/platforms/python/blocks/audio_sink.xml
+++ b/grc/blocks/audio_sink.xml
diff --git a/grc/data/platforms/python/blocks/audio_source.xml b/grc/blocks/audio_source.xml
index 1f5d1033e..1f5d1033e 100644
--- a/grc/data/platforms/python/blocks/audio_source.xml
+++ b/grc/blocks/audio_source.xml
diff --git a/grc/data/platforms/python/blocks/band_pass_filter.xml b/grc/blocks/band_pass_filter.xml
index 2dac2960e..e2e9acf4e 100644
--- a/grc/data/platforms/python/blocks/band_pass_filter.xml
+++ b/grc/blocks/band_pass_filter.xml
@@ -9,36 +9,70 @@
<key>band_pass_filter</key>
<import>from gnuradio import gr</import>
<import>from gnuradio.gr import firdes</import>
- <make>gr.$(type)($decim, firdes.band_pass(
+ <make>gr.$(type)(#if str($type).startswith('interp') then $interp else $decim#, firdes.$(type.fcn)(
$gain, $samp_rate, $low_cutoff_freq, $high_cutoff_freq, $width, firdes.$window, $beta))</make>
- <callback>set_taps(firdes.band_pass($gain, $samp_rate, $low_cutoff_freq, $high_cutoff_freq, $width, firdes.$window, $beta))</callback>
+ <callback>set_taps(firdes.$(type.fcn)($gain, $samp_rate, $low_cutoff_freq, $high_cutoff_freq, $width, firdes.$window, $beta))</callback>
<param>
<name>FIR Type</name>
<key>type</key>
<type>enum</type>
+ <!-- Real Band Pass Taps -->
<option>
- <name>Complex->Complex (Decimating)</name>
+ <name>Complex->Complex (Real Taps) (Decim)</name>
<key>fir_filter_ccf</key>
<opt>input:complex</opt>
<opt>output:complex</opt>
+ <opt>fcn:band_pass</opt>
</option>
<option>
- <name>Complex->Complex (Interpolating)</name>
+ <name>Complex->Complex (Real Taps) (Interp)</name>
<key>interp_fir_filter_ccf</key>
<opt>input:complex</opt>
<opt>output:complex</opt>
+ <opt>fcn:band_pass</opt>
</option>
<option>
- <name>Float->Float (Decimating)</name>
+ <name>Float->Float (Real Taps) (Decim)</name>
<key>fir_filter_fff</key>
<opt>input:float</opt>
<opt>output:float</opt>
+ <opt>fcn:band_pass</opt>
</option>
<option>
- <name>Float->Float (Interpolating)</name>
+ <name>Float->Float (Real Taps) (Interp)</name>
<key>interp_fir_filter_fff</key>
<opt>input:float</opt>
<opt>output:float</opt>
+ <opt>fcn:band_pass</opt>
+ </option>
+ <!-- Complex Band Pass Taps -->
+ <option>
+ <name>Complex->Complex (Complex Taps) (Decim)</name>
+ <key>fir_filter_ccc</key>
+ <opt>input:complex</opt>
+ <opt>output:complex</opt>
+ <opt>fcn:complex_band_pass</opt>
+ </option>
+ <option>
+ <name>Complex->Complex (Complex Taps) (Interp)</name>
+ <key>interp_fir_filter_ccc</key>
+ <opt>input:complex</opt>
+ <opt>output:complex</opt>
+ <opt>fcn:complex_band_pass</opt>
+ </option>
+ <option>
+ <name>Float->Complex (Complex Taps) (Decim)</name>
+ <key>fir_filter_fcc</key>
+ <opt>input:float</opt>
+ <opt>output:complex</opt>
+ <opt>fcn:complex_band_pass</opt>
+ </option>
+ <option>
+ <name>Float->Complex (Complex Taps) (Interp)</name>
+ <key>interp_fir_filter_fcc</key>
+ <opt>input:float</opt>
+ <opt>output:complex</opt>
+ <opt>fcn:complex_band_pass</opt>
</option>
</param>
<param>
@@ -46,6 +80,14 @@
<key>decim</key>
<value>1</value>
<type>int</type>
+ <hide>#if str($type).startswith('interp') then 'all' else 'none'#</hide>
+ </param>
+ <param>
+ <name>Interpolation</name>
+ <key>interp</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>#if str($type).startswith('interp') then 'none' else 'all'#</hide>
</param>
<param>
<name>Gain</name>
@@ -116,8 +158,6 @@
<doc>
This filter is a convenience wrapper for an fir filter and a firdes taps generating function.
-The decimation paramater becomes interpolation when the filter type is set to interpolating.
-
Sample rate, cutoff frequency, and transition width are in Hertz.
The beta paramater only applies to the Kaiser window.
diff --git a/grc/data/platforms/python/blocks/band_reject_filter.xml b/grc/blocks/band_reject_filter.xml
index ed6a5fa88..3b58f0b51 100644
--- a/grc/data/platforms/python/blocks/band_reject_filter.xml
+++ b/grc/blocks/band_reject_filter.xml
@@ -9,7 +9,7 @@
<key>band_reject_filter</key>
<import>from gnuradio import gr</import>
<import>from gnuradio.gr import firdes</import>
- <make>gr.$(type)($decim, firdes.band_reject(
+ <make>gr.$(type)(#if str($type).startswith('interp') then $interp else $decim#, firdes.band_reject(
$gain, $samp_rate, $low_cutoff_freq, $high_cutoff_freq, $width, firdes.$window, $beta))</make>
<callback>set_taps(firdes.band_reject($gain, $samp_rate, $low_cutoff_freq, $high_cutoff_freq, $width, firdes.$window, $beta))</callback>
<param>
@@ -46,6 +46,14 @@
<key>decim</key>
<value>1</value>
<type>int</type>
+ <hide>#if str($type).startswith('interp') then 'all' else 'none'#</hide>
+ </param>
+ <param>
+ <name>Interpolation</name>
+ <key>interp</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>#if str($type).startswith('interp') then 'none' else 'all'#</hide>
</param>
<param>
<name>Gain</name>
@@ -116,8 +124,6 @@
<doc>
This filter is a convenience wrapper for an fir filter and a firdes taps generating function.
-The decimation paramater becomes interpolation when the filter type is set to interpolating.
-
Sample rate, cutoff frequency, and transition width are in Hertz.
The beta paramater only applies to the Kaiser window.
diff --git a/grc/data/platforms/python/blocks/blks2_am_demod_cf.xml b/grc/blocks/blks2_am_demod_cf.xml
index 898c613be..898c613be 100644
--- a/grc/data/platforms/python/blocks/blks2_am_demod_cf.xml
+++ b/grc/blocks/blks2_am_demod_cf.xml
diff --git a/grc/data/platforms/python/blocks/blks2_analysis_filterbank.xml b/grc/blocks/blks2_analysis_filterbank.xml
index 93cfa30af..93cfa30af 100644
--- a/grc/data/platforms/python/blocks/blks2_analysis_filterbank.xml
+++ b/grc/blocks/blks2_analysis_filterbank.xml
diff --git a/grc/data/platforms/python/blocks/blks2_dxpsk_demod.xml b/grc/blocks/blks2_dxpsk_demod.xml
index 20c7bd7f7..4c13b3415 100644
--- a/grc/data/platforms/python/blocks/blks2_dxpsk_demod.xml
+++ b/grc/blocks/blks2_dxpsk_demod.xml
@@ -16,6 +16,8 @@
mu=$mu,
omega_relative_limit=$omega_relative_limit,
gray_code=$gray_code,
+ verbose=$verbose,
+ log=$log,
)</make>
<param>
<name>Type</name>
@@ -84,6 +86,36 @@
<key>False</key>
</option>
</param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>complex</type>
diff --git a/grc/data/platforms/python/blocks/blks2_dxpsk_mod.xml b/grc/blocks/blks2_dxpsk_mod.xml
index e165fe9b7..28fd742fa 100644
--- a/grc/data/platforms/python/blocks/blks2_dxpsk_mod.xml
+++ b/grc/blocks/blks2_dxpsk_mod.xml
@@ -12,6 +12,8 @@
samples_per_symbol=$samples_per_symbol,
excess_bw=$excess_bw,
gray_code=$gray_code,
+ verbose=$verbose,
+ log=$log,
)</make>
<param>
<name>Type</name>
@@ -56,6 +58,36 @@
<key>False</key>
</option>
</param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>byte</type>
diff --git a/grc/data/platforms/python/blocks/blks2_error_rate.xml b/grc/blocks/blks2_error_rate.xml
index 91a303206..91a303206 100644
--- a/grc/data/platforms/python/blocks/blks2_error_rate.xml
+++ b/grc/blocks/blks2_error_rate.xml
diff --git a/grc/data/platforms/python/blocks/blks2_fm_deemph.xml b/grc/blocks/blks2_fm_deemph.xml
index 6f38dab6d..6f38dab6d 100644
--- a/grc/data/platforms/python/blocks/blks2_fm_deemph.xml
+++ b/grc/blocks/blks2_fm_deemph.xml
diff --git a/grc/data/platforms/python/blocks/blks2_fm_demod_cf.xml b/grc/blocks/blks2_fm_demod_cf.xml
index 2ce1fb973..2ce1fb973 100644
--- a/grc/data/platforms/python/blocks/blks2_fm_demod_cf.xml
+++ b/grc/blocks/blks2_fm_demod_cf.xml
diff --git a/grc/data/platforms/python/blocks/blks2_fm_preemph.xml b/grc/blocks/blks2_fm_preemph.xml
index 672a7a7b2..672a7a7b2 100644
--- a/grc/data/platforms/python/blocks/blks2_fm_preemph.xml
+++ b/grc/blocks/blks2_fm_preemph.xml
diff --git a/grc/data/platforms/python/blocks/blks2_gmsk_demod.xml b/grc/blocks/blks2_gmsk_demod.xml
index c81039815..13ecb3344 100644
--- a/grc/data/platforms/python/blocks/blks2_gmsk_demod.xml
+++ b/grc/blocks/blks2_gmsk_demod.xml
@@ -14,6 +14,8 @@
mu=$mu,
omega_relative_limit=$omega_relative_limit,
freq_error=$freq_error,
+ verbose=$verbose,
+ log=$log,
)</make>
<param>
<name>Samples/Symbol</name>
@@ -45,6 +47,36 @@
<value>0.0</value>
<type>real</type>
</param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>complex</type>
diff --git a/grc/data/platforms/python/blocks/blks2_gmsk_mod.xml b/grc/blocks/blks2_gmsk_mod.xml
index ab57357eb..e80264f11 100644
--- a/grc/data/platforms/python/blocks/blks2_gmsk_mod.xml
+++ b/grc/blocks/blks2_gmsk_mod.xml
@@ -11,6 +11,8 @@
<make>blks2.gmsk_mod(
samples_per_symbol=$samples_per_symbol,
bt=$bt,
+ verbose=$verbose,
+ log=$log,
)</make>
<param>
<name>Samples/Symbol</name>
@@ -24,6 +26,36 @@
<value>0.35</value>
<type>real</type>
</param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>byte</type>
diff --git a/grc/data/platforms/python/blocks/blks2_logpwrfft_x.xml b/grc/blocks/blks2_logpwrfft_x.xml
index ef49c443e..79a3bfc4b 100644
--- a/grc/data/platforms/python/blocks/blks2_logpwrfft_x.xml
+++ b/grc/blocks/blks2_logpwrfft_x.xml
@@ -18,6 +18,7 @@
)</make>
<callback>set_sample_rate($sample_rate)</callback>
<callback>set_avg_alpha($avg_alpha)</callback>
+ <callback>set_average($average)</callback>
<param>
<name>Input Type</name>
<key>type</key>
@@ -58,16 +59,10 @@
<type>real</type>
</param>
<param>
- <name>Average Alpha</name>
- <key>avg_alpha</key>
- <value>1.0</value>
- <type>real</type>
- </param>
- <param>
<name>Average</name>
<key>average</key>
<value>False</value>
- <type>enum</type>
+ <type>bool</type>
<option>
<name>On</name>
<key>True</key>
@@ -77,6 +72,12 @@
<key>False</key>
</option>
</param>
+ <param>
+ <name>Average Alpha</name>
+ <key>avg_alpha</key>
+ <value>1.0</value>
+ <type>real</type>
+ </param>
<sink>
<name>in</name>
<type>$type</type>
diff --git a/grc/data/platforms/python/blocks/blks2_nbfm_rx.xml b/grc/blocks/blks2_nbfm_rx.xml
index d332b9a6b..d332b9a6b 100644
--- a/grc/data/platforms/python/blocks/blks2_nbfm_rx.xml
+++ b/grc/blocks/blks2_nbfm_rx.xml
diff --git a/grc/data/platforms/python/blocks/blks2_nbfm_tx.xml b/grc/blocks/blks2_nbfm_tx.xml
index 3aa7ede0e..3aa7ede0e 100644
--- a/grc/data/platforms/python/blocks/blks2_nbfm_tx.xml
+++ b/grc/blocks/blks2_nbfm_tx.xml
diff --git a/grc/data/platforms/python/blocks/blks2_ofdm_demod.xml b/grc/blocks/blks2_ofdm_demod.xml
index ac5ee4795..ac5ee4795 100644
--- a/grc/data/platforms/python/blocks/blks2_ofdm_demod.xml
+++ b/grc/blocks/blks2_ofdm_demod.xml
diff --git a/grc/data/platforms/python/blocks/blks2_ofdm_mod.xml b/grc/blocks/blks2_ofdm_mod.xml
index 2c54d10f4..2c54d10f4 100644
--- a/grc/data/platforms/python/blocks/blks2_ofdm_mod.xml
+++ b/grc/blocks/blks2_ofdm_mod.xml
diff --git a/grc/data/platforms/python/blocks/blks2_packet_decoder.xml b/grc/blocks/blks2_packet_decoder.xml
index 07b0d1f2e..07b0d1f2e 100644
--- a/grc/data/platforms/python/blocks/blks2_packet_decoder.xml
+++ b/grc/blocks/blks2_packet_decoder.xml
diff --git a/grc/data/platforms/python/blocks/blks2_packet_encoder.xml b/grc/blocks/blks2_packet_encoder.xml
index b184ebd31..b184ebd31 100644
--- a/grc/data/platforms/python/blocks/blks2_packet_encoder.xml
+++ b/grc/blocks/blks2_packet_encoder.xml
diff --git a/grc/data/platforms/python/blocks/blks2_qamx_demod.xml b/grc/blocks/blks2_qamx_demod.xml
index 93dbe4bb0..e332495ae 100644
--- a/grc/data/platforms/python/blocks/blks2_qamx_demod.xml
+++ b/grc/blocks/blks2_qamx_demod.xml
@@ -16,6 +16,8 @@
mu=$mu,
omega_relative_limit=$omega_relative_limit,
gray_code=$gray_code,
+ verbose=$verbose,
+ log=$log,
)</make>
<param>
<name>Type</name>
@@ -88,6 +90,36 @@
<key>False</key>
</option>
</param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>complex</type>
diff --git a/grc/data/platforms/python/blocks/blks2_qamx_mod.xml b/grc/blocks/blks2_qamx_mod.xml
index 25a9fb240..69a2e9e75 100644
--- a/grc/data/platforms/python/blocks/blks2_qamx_mod.xml
+++ b/grc/blocks/blks2_qamx_mod.xml
@@ -12,6 +12,8 @@
samples_per_symbol=$samples_per_symbol,
excess_bw=$excess_bw,
gray_code=$gray_code,
+ verbose=$verbose,
+ log=$log,
)</make>
<param>
<name>Type</name>
@@ -60,6 +62,36 @@
<key>False</key>
</option>
</param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>byte</type>
diff --git a/grc/data/platforms/python/blocks/blks2_rational_resampler_xxx.xml b/grc/blocks/blks2_rational_resampler_xxx.xml
index b92ec8ec2..b92ec8ec2 100644
--- a/grc/data/platforms/python/blocks/blks2_rational_resampler_xxx.xml
+++ b/grc/blocks/blks2_rational_resampler_xxx.xml
diff --git a/grc/data/platforms/python/blocks/blks2_selector.xml b/grc/blocks/blks2_selector.xml
index 2d89df186..2d89df186 100644
--- a/grc/data/platforms/python/blocks/blks2_selector.xml
+++ b/grc/blocks/blks2_selector.xml
diff --git a/grc/data/platforms/python/blocks/blks2_standard_squelch.xml b/grc/blocks/blks2_standard_squelch.xml
index fc60a31e8..fc60a31e8 100644
--- a/grc/data/platforms/python/blocks/blks2_standard_squelch.xml
+++ b/grc/blocks/blks2_standard_squelch.xml
diff --git a/grc/data/platforms/python/blocks/blks2_stream_to_vector_decimator.xml b/grc/blocks/blks2_stream_to_vector_decimator.xml
index 25f8f7a62..25f8f7a62 100644
--- a/grc/data/platforms/python/blocks/blks2_stream_to_vector_decimator.xml
+++ b/grc/blocks/blks2_stream_to_vector_decimator.xml
diff --git a/grc/data/platforms/python/blocks/blks2_synthesis_filterbank.xml b/grc/blocks/blks2_synthesis_filterbank.xml
index 5979ed3f7..5979ed3f7 100644
--- a/grc/data/platforms/python/blocks/blks2_synthesis_filterbank.xml
+++ b/grc/blocks/blks2_synthesis_filterbank.xml
diff --git a/grc/data/platforms/python/blocks/blks2_tcp_sink.xml b/grc/blocks/blks2_tcp_sink.xml
index cfe7b42d8..cfe7b42d8 100644
--- a/grc/data/platforms/python/blocks/blks2_tcp_sink.xml
+++ b/grc/blocks/blks2_tcp_sink.xml
diff --git a/grc/data/platforms/python/blocks/blks2_tcp_source.xml b/grc/blocks/blks2_tcp_source.xml
index 6bf742aa0..6bf742aa0 100644
--- a/grc/data/platforms/python/blocks/blks2_tcp_source.xml
+++ b/grc/blocks/blks2_tcp_source.xml
diff --git a/grc/data/platforms/python/blocks/blks2_valve.xml b/grc/blocks/blks2_valve.xml
index 47c553523..47c553523 100644
--- a/grc/data/platforms/python/blocks/blks2_valve.xml
+++ b/grc/blocks/blks2_valve.xml
diff --git a/grc/data/platforms/python/blocks/blks2_variable_sink_x.xml b/grc/blocks/blks2_variable_sink_x.xml
index 5709c9f76..5709c9f76 100644
--- a/grc/data/platforms/python/blocks/blks2_variable_sink_x.xml
+++ b/grc/blocks/blks2_variable_sink_x.xml
diff --git a/grc/data/platforms/python/blocks/blks2_wfm_rcv.xml b/grc/blocks/blks2_wfm_rcv.xml
index 37fb3ba8c..37fb3ba8c 100644
--- a/grc/data/platforms/python/blocks/blks2_wfm_rcv.xml
+++ b/grc/blocks/blks2_wfm_rcv.xml
diff --git a/grc/data/platforms/python/blocks/blks2_wfm_rcv_pll.xml b/grc/blocks/blks2_wfm_rcv_pll.xml
index 2771350cf..2771350cf 100644
--- a/grc/data/platforms/python/blocks/blks2_wfm_rcv_pll.xml
+++ b/grc/blocks/blks2_wfm_rcv_pll.xml
diff --git a/grc/data/platforms/python/blocks/blks2_wfm_tx.xml b/grc/blocks/blks2_wfm_tx.xml
index cff92d819..cff92d819 100644
--- a/grc/data/platforms/python/blocks/blks2_wfm_tx.xml
+++ b/grc/blocks/blks2_wfm_tx.xml
diff --git a/grc/data/platforms/python/block_tree.xml b/grc/blocks/block_tree.xml
index 074b7976a..4f9b1cd2e 100644
--- a/grc/data/platforms/python/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -162,6 +162,7 @@
<block>high_pass_filter</block>
<block>band_pass_filter</block>
<block>band_reject_filter</block>
+ <block>root_raised_cosine_filter</block>
<!-- Filters that take taps as aruments -->
<block>gr_fir_filter_xxx</block>
<block>gr_interp_fir_filter_xxx</block>
@@ -265,7 +266,10 @@
<block>variable</block>
<block>variable_slider</block>
<block>variable_chooser</block>
+ <block>variable_check_box</block>
<block>variable_text_box</block>
+ <block>variable_static_text</block>
+ <block>variable_config</block>
<block>parameter</block>
</cat>
<cat>
diff --git a/grc/data/platforms/python/blocks/const_source_x.xml b/grc/blocks/const_source_x.xml
index fe8e56ec4..fe8e56ec4 100644
--- a/grc/data/platforms/python/blocks/const_source_x.xml
+++ b/grc/blocks/const_source_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_add_const_vxx.xml b/grc/blocks/gr_add_const_vxx.xml
index 9f1c545ab..9f1c545ab 100644
--- a/grc/data/platforms/python/blocks/gr_add_const_vxx.xml
+++ b/grc/blocks/gr_add_const_vxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_add_xx.xml b/grc/blocks/gr_add_xx.xml
index 97ed9283c..97ed9283c 100644
--- a/grc/data/platforms/python/blocks/gr_add_xx.xml
+++ b/grc/blocks/gr_add_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_agc2_xx.xml b/grc/blocks/gr_agc2_xx.xml
index fb3ae5704..fb3ae5704 100644
--- a/grc/data/platforms/python/blocks/gr_agc2_xx.xml
+++ b/grc/blocks/gr_agc2_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_agc_xx.xml b/grc/blocks/gr_agc_xx.xml
index c87d239ed..c87d239ed 100644
--- a/grc/data/platforms/python/blocks/gr_agc_xx.xml
+++ b/grc/blocks/gr_agc_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_and_xx.xml b/grc/blocks/gr_and_xx.xml
index 9ed006090..9ed006090 100644
--- a/grc/data/platforms/python/blocks/gr_and_xx.xml
+++ b/grc/blocks/gr_and_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_argmax_xx.xml b/grc/blocks/gr_argmax_xx.xml
index e3e4e3ead..e3e4e3ead 100644
--- a/grc/data/platforms/python/blocks/gr_argmax_xx.xml
+++ b/grc/blocks/gr_argmax_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_binary_slicer_fb.xml b/grc/blocks/gr_binary_slicer_fb.xml
index 85d71e709..85d71e709 100644
--- a/grc/data/platforms/python/blocks/gr_binary_slicer_fb.xml
+++ b/grc/blocks/gr_binary_slicer_fb.xml
diff --git a/grc/data/platforms/python/blocks/gr_channel_model.xml b/grc/blocks/gr_channel_model.xml
index e23062dff..e23062dff 100644
--- a/grc/data/platforms/python/blocks/gr_channel_model.xml
+++ b/grc/blocks/gr_channel_model.xml
diff --git a/grc/data/platforms/python/blocks/gr_char_to_float.xml b/grc/blocks/gr_char_to_float.xml
index 9ab778051..9ab778051 100644
--- a/grc/data/platforms/python/blocks/gr_char_to_float.xml
+++ b/grc/blocks/gr_char_to_float.xml
diff --git a/grc/data/platforms/python/blocks/gr_chunks_to_symbols.xml b/grc/blocks/gr_chunks_to_symbols.xml
index b54e710ef..b54e710ef 100644
--- a/grc/data/platforms/python/blocks/gr_chunks_to_symbols.xml
+++ b/grc/blocks/gr_chunks_to_symbols.xml
diff --git a/grc/data/platforms/python/blocks/gr_clock_recovery_mm_xx.xml b/grc/blocks/gr_clock_recovery_mm_xx.xml
index 613cc23bf..613cc23bf 100644
--- a/grc/data/platforms/python/blocks/gr_clock_recovery_mm_xx.xml
+++ b/grc/blocks/gr_clock_recovery_mm_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_cma_equalizer_cc.xml b/grc/blocks/gr_cma_equalizer_cc.xml
index 142fb6d81..142fb6d81 100644
--- a/grc/data/platforms/python/blocks/gr_cma_equalizer_cc.xml
+++ b/grc/blocks/gr_cma_equalizer_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_arg.xml b/grc/blocks/gr_complex_to_arg.xml
index a7bbacd74..a7bbacd74 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_arg.xml
+++ b/grc/blocks/gr_complex_to_arg.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_float.xml b/grc/blocks/gr_complex_to_float.xml
index 5b02c3d34..5b02c3d34 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_float.xml
+++ b/grc/blocks/gr_complex_to_float.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_imag.xml b/grc/blocks/gr_complex_to_imag.xml
index 7c120eedd..7c120eedd 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_imag.xml
+++ b/grc/blocks/gr_complex_to_imag.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_interleaved_short.xml b/grc/blocks/gr_complex_to_interleaved_short.xml
index 5e999599a..5e999599a 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_interleaved_short.xml
+++ b/grc/blocks/gr_complex_to_interleaved_short.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_mag.xml b/grc/blocks/gr_complex_to_mag.xml
index adc95f207..adc95f207 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_mag.xml
+++ b/grc/blocks/gr_complex_to_mag.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_mag_squared.xml b/grc/blocks/gr_complex_to_mag_squared.xml
index cd23bfb5c..cd23bfb5c 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_mag_squared.xml
+++ b/grc/blocks/gr_complex_to_mag_squared.xml
diff --git a/grc/data/platforms/python/blocks/gr_complex_to_real.xml b/grc/blocks/gr_complex_to_real.xml
index ae9ec7b14..ae9ec7b14 100644
--- a/grc/data/platforms/python/blocks/gr_complex_to_real.xml
+++ b/grc/blocks/gr_complex_to_real.xml
diff --git a/grc/data/platforms/python/blocks/gr_conjugate_cc.xml b/grc/blocks/gr_conjugate_cc.xml
index 0b4deb347..0b4deb347 100644
--- a/grc/data/platforms/python/blocks/gr_conjugate_cc.xml
+++ b/grc/blocks/gr_conjugate_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_constellation_decoder_cb.xml b/grc/blocks/gr_constellation_decoder_cb.xml
index 99d897a3a..99d897a3a 100644
--- a/grc/data/platforms/python/blocks/gr_constellation_decoder_cb.xml
+++ b/grc/blocks/gr_constellation_decoder_cb.xml
diff --git a/grc/data/platforms/python/blocks/gr_correlate_access_code_bb.xml b/grc/blocks/gr_correlate_access_code_bb.xml
index e13d2d070..e13d2d070 100644
--- a/grc/data/platforms/python/blocks/gr_correlate_access_code_bb.xml
+++ b/grc/blocks/gr_correlate_access_code_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_costas_loop_cc.xml b/grc/blocks/gr_costas_loop_cc.xml
index e0db8bc5d..e0db8bc5d 100644
--- a/grc/data/platforms/python/blocks/gr_costas_loop_cc.xml
+++ b/grc/blocks/gr_costas_loop_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_cpfsk_bc.xml b/grc/blocks/gr_cpfsk_bc.xml
index d5549d933..d5549d933 100644
--- a/grc/data/platforms/python/blocks/gr_cpfsk_bc.xml
+++ b/grc/blocks/gr_cpfsk_bc.xml
diff --git a/grc/data/platforms/python/blocks/gr_dd_mpsk_sync_cc.xml b/grc/blocks/gr_dd_mpsk_sync_cc.xml
index aed0e8d31..aed0e8d31 100644
--- a/grc/data/platforms/python/blocks/gr_dd_mpsk_sync_cc.xml
+++ b/grc/blocks/gr_dd_mpsk_sync_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_decode_ccsds_27_fb.xml b/grc/blocks/gr_decode_ccsds_27_fb.xml
index 03b31db83..03b31db83 100644
--- a/grc/data/platforms/python/blocks/gr_decode_ccsds_27_fb.xml
+++ b/grc/blocks/gr_decode_ccsds_27_fb.xml
diff --git a/grc/data/platforms/python/blocks/gr_deinterleave.xml b/grc/blocks/gr_deinterleave.xml
index a7482978c..a7482978c 100644
--- a/grc/data/platforms/python/blocks/gr_deinterleave.xml
+++ b/grc/blocks/gr_deinterleave.xml
diff --git a/grc/data/platforms/python/blocks/gr_delay.xml b/grc/blocks/gr_delay.xml
index 64a774def..64a774def 100644
--- a/grc/data/platforms/python/blocks/gr_delay.xml
+++ b/grc/blocks/gr_delay.xml
diff --git a/grc/data/platforms/python/blocks/gr_descrambler_bb.xml b/grc/blocks/gr_descrambler_bb.xml
index 5cfbcc203..5cfbcc203 100644
--- a/grc/data/platforms/python/blocks/gr_descrambler_bb.xml
+++ b/grc/blocks/gr_descrambler_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_diff_decoder_bb.xml b/grc/blocks/gr_diff_decoder_bb.xml
index ea7cf1734..ea7cf1734 100644
--- a/grc/data/platforms/python/blocks/gr_diff_decoder_bb.xml
+++ b/grc/blocks/gr_diff_decoder_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_diff_encoder_bb.xml b/grc/blocks/gr_diff_encoder_bb.xml
index 21241eac2..21241eac2 100644
--- a/grc/data/platforms/python/blocks/gr_diff_encoder_bb.xml
+++ b/grc/blocks/gr_diff_encoder_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_diff_phasor_cc.xml b/grc/blocks/gr_diff_phasor_cc.xml
index 2b2d7e372..2b2d7e372 100644
--- a/grc/data/platforms/python/blocks/gr_diff_phasor_cc.xml
+++ b/grc/blocks/gr_diff_phasor_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_divide_xx.xml b/grc/blocks/gr_divide_xx.xml
index 04667bc2a..04667bc2a 100644
--- a/grc/data/platforms/python/blocks/gr_divide_xx.xml
+++ b/grc/blocks/gr_divide_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_dpll_bb.xml b/grc/blocks/gr_dpll_bb.xml
index 044d398ff..044d398ff 100644
--- a/grc/data/platforms/python/blocks/gr_dpll_bb.xml
+++ b/grc/blocks/gr_dpll_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_encode_ccsds_27_bb.xml b/grc/blocks/gr_encode_ccsds_27_bb.xml
index f31e6b6c8..f31e6b6c8 100644
--- a/grc/data/platforms/python/blocks/gr_encode_ccsds_27_bb.xml
+++ b/grc/blocks/gr_encode_ccsds_27_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_feedforward_agc_cc.xml b/grc/blocks/gr_feedforward_agc_cc.xml
index 24e80953f..24e80953f 100644
--- a/grc/data/platforms/python/blocks/gr_feedforward_agc_cc.xml
+++ b/grc/blocks/gr_feedforward_agc_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_fft_filter_xxx.xml b/grc/blocks/gr_fft_filter_xxx.xml
index c1633094b..c1633094b 100644
--- a/grc/data/platforms/python/blocks/gr_fft_filter_xxx.xml
+++ b/grc/blocks/gr_fft_filter_xxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_fft_vxx.xml b/grc/blocks/gr_fft_vxx.xml
index d398486ef..d398486ef 100644
--- a/grc/data/platforms/python/blocks/gr_fft_vxx.xml
+++ b/grc/blocks/gr_fft_vxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_file_sink.xml b/grc/blocks/gr_file_sink.xml
index 880dc2759..880dc2759 100644
--- a/grc/data/platforms/python/blocks/gr_file_sink.xml
+++ b/grc/blocks/gr_file_sink.xml
diff --git a/grc/data/platforms/python/blocks/gr_file_source.xml b/grc/blocks/gr_file_source.xml
index fcc7a7040..fcc7a7040 100644
--- a/grc/data/platforms/python/blocks/gr_file_source.xml
+++ b/grc/blocks/gr_file_source.xml
diff --git a/grc/data/platforms/python/blocks/gr_filter_delay_fc.xml b/grc/blocks/gr_filter_delay_fc.xml
index 30d65bf82..30d65bf82 100644
--- a/grc/data/platforms/python/blocks/gr_filter_delay_fc.xml
+++ b/grc/blocks/gr_filter_delay_fc.xml
diff --git a/grc/data/platforms/python/blocks/gr_fir_filter_xxx.xml b/grc/blocks/gr_fir_filter_xxx.xml
index c4de8f539..c4de8f539 100644
--- a/grc/data/platforms/python/blocks/gr_fir_filter_xxx.xml
+++ b/grc/blocks/gr_fir_filter_xxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_float_to_char.xml b/grc/blocks/gr_float_to_char.xml
index 907de7743..907de7743 100644
--- a/grc/data/platforms/python/blocks/gr_float_to_char.xml
+++ b/grc/blocks/gr_float_to_char.xml
diff --git a/grc/data/platforms/python/blocks/gr_float_to_complex.xml b/grc/blocks/gr_float_to_complex.xml
index a1644efd7..a1644efd7 100644
--- a/grc/data/platforms/python/blocks/gr_float_to_complex.xml
+++ b/grc/blocks/gr_float_to_complex.xml
diff --git a/grc/data/platforms/python/blocks/gr_float_to_short.xml b/grc/blocks/gr_float_to_short.xml
index cb2bcd4be..cb2bcd4be 100644
--- a/grc/data/platforms/python/blocks/gr_float_to_short.xml
+++ b/grc/blocks/gr_float_to_short.xml
diff --git a/grc/data/platforms/python/blocks/gr_float_to_uchar.xml b/grc/blocks/gr_float_to_uchar.xml
index aa804d7d9..aa804d7d9 100644
--- a/grc/data/platforms/python/blocks/gr_float_to_uchar.xml
+++ b/grc/blocks/gr_float_to_uchar.xml
diff --git a/grc/data/platforms/python/blocks/gr_fractional_interpolator_xx.xml b/grc/blocks/gr_fractional_interpolator_xx.xml
index 8d65ff8bf..8d65ff8bf 100644
--- a/grc/data/platforms/python/blocks/gr_fractional_interpolator_xx.xml
+++ b/grc/blocks/gr_fractional_interpolator_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_freq_xlating_fir_filter_xxx.xml b/grc/blocks/gr_freq_xlating_fir_filter_xxx.xml
index e3ee66977..e3ee66977 100644
--- a/grc/data/platforms/python/blocks/gr_freq_xlating_fir_filter_xxx.xml
+++ b/grc/blocks/gr_freq_xlating_fir_filter_xxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_frequency_modulator_fc.xml b/grc/blocks/gr_frequency_modulator_fc.xml
index f18d9f1e1..f18d9f1e1 100644
--- a/grc/data/platforms/python/blocks/gr_frequency_modulator_fc.xml
+++ b/grc/blocks/gr_frequency_modulator_fc.xml
diff --git a/grc/data/platforms/python/blocks/gr_glfsr_source_x.xml b/grc/blocks/gr_glfsr_source_x.xml
index 88fb66797..88fb66797 100644
--- a/grc/data/platforms/python/blocks/gr_glfsr_source_x.xml
+++ b/grc/blocks/gr_glfsr_source_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_goertzel_fc.xml b/grc/blocks/gr_goertzel_fc.xml
index 2105445d1..2105445d1 100644
--- a/grc/data/platforms/python/blocks/gr_goertzel_fc.xml
+++ b/grc/blocks/gr_goertzel_fc.xml
diff --git a/grc/data/platforms/python/blocks/gr_head.xml b/grc/blocks/gr_head.xml
index e5ff7f6aa..e5ff7f6aa 100644
--- a/grc/data/platforms/python/blocks/gr_head.xml
+++ b/grc/blocks/gr_head.xml
diff --git a/grc/data/platforms/python/blocks/gr_hilbert_fc.xml b/grc/blocks/gr_hilbert_fc.xml
index 165e8da23..165e8da23 100644
--- a/grc/data/platforms/python/blocks/gr_hilbert_fc.xml
+++ b/grc/blocks/gr_hilbert_fc.xml
diff --git a/grc/data/platforms/python/blocks/gr_iir_filter_ffd.xml b/grc/blocks/gr_iir_filter_ffd.xml
index 9799150e8..9799150e8 100644
--- a/grc/data/platforms/python/blocks/gr_iir_filter_ffd.xml
+++ b/grc/blocks/gr_iir_filter_ffd.xml
diff --git a/grc/data/platforms/python/blocks/gr_integrate_xx.xml b/grc/blocks/gr_integrate_xx.xml
index d0ebd42e2..d0ebd42e2 100644
--- a/grc/data/platforms/python/blocks/gr_integrate_xx.xml
+++ b/grc/blocks/gr_integrate_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_interleave.xml b/grc/blocks/gr_interleave.xml
index 3db16ab55..3db16ab55 100644
--- a/grc/data/platforms/python/blocks/gr_interleave.xml
+++ b/grc/blocks/gr_interleave.xml
diff --git a/grc/data/platforms/python/blocks/gr_interleaved_short_to_complex.xml b/grc/blocks/gr_interleaved_short_to_complex.xml
index e3023e499..e3023e499 100644
--- a/grc/data/platforms/python/blocks/gr_interleaved_short_to_complex.xml
+++ b/grc/blocks/gr_interleaved_short_to_complex.xml
diff --git a/grc/data/platforms/python/blocks/gr_interp_fir_filter_xxx.xml b/grc/blocks/gr_interp_fir_filter_xxx.xml
index 55375ae02..55375ae02 100644
--- a/grc/data/platforms/python/blocks/gr_interp_fir_filter_xxx.xml
+++ b/grc/blocks/gr_interp_fir_filter_xxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_iqcomp_cc.xml b/grc/blocks/gr_iqcomp_cc.xml
index 1603bdc42..1603bdc42 100644
--- a/grc/data/platforms/python/blocks/gr_iqcomp_cc.xml
+++ b/grc/blocks/gr_iqcomp_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_keep_one_in_n.xml b/grc/blocks/gr_keep_one_in_n.xml
index 21595b755..21595b755 100644
--- a/grc/data/platforms/python/blocks/gr_keep_one_in_n.xml
+++ b/grc/blocks/gr_keep_one_in_n.xml
diff --git a/grc/data/platforms/python/blocks/gr_kludge_copy.xml b/grc/blocks/gr_kludge_copy.xml
index 3c817c572..3c817c572 100644
--- a/grc/data/platforms/python/blocks/gr_kludge_copy.xml
+++ b/grc/blocks/gr_kludge_copy.xml
diff --git a/grc/data/platforms/python/blocks/gr_map_bb.xml b/grc/blocks/gr_map_bb.xml
index 20d6bd2b4..20d6bd2b4 100644
--- a/grc/data/platforms/python/blocks/gr_map_bb.xml
+++ b/grc/blocks/gr_map_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_max_xx.xml b/grc/blocks/gr_max_xx.xml
index 9dbbe60e5..9dbbe60e5 100644
--- a/grc/data/platforms/python/blocks/gr_max_xx.xml
+++ b/grc/blocks/gr_max_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_moving_average_xx.xml b/grc/blocks/gr_moving_average_xx.xml
index b70943c78..b70943c78 100644
--- a/grc/data/platforms/python/blocks/gr_moving_average_xx.xml
+++ b/grc/blocks/gr_moving_average_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_mpsk_receiver_cc.xml b/grc/blocks/gr_mpsk_receiver_cc.xml
index 843c3a4c1..843c3a4c1 100644
--- a/grc/data/platforms/python/blocks/gr_mpsk_receiver_cc.xml
+++ b/grc/blocks/gr_mpsk_receiver_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_mpsk_sync_cc.xml b/grc/blocks/gr_mpsk_sync_cc.xml
index fd08f8340..fd08f8340 100644
--- a/grc/data/platforms/python/blocks/gr_mpsk_sync_cc.xml
+++ b/grc/blocks/gr_mpsk_sync_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_multiply_const_vxx.xml b/grc/blocks/gr_multiply_const_vxx.xml
index 1309d75cd..1309d75cd 100644
--- a/grc/data/platforms/python/blocks/gr_multiply_const_vxx.xml
+++ b/grc/blocks/gr_multiply_const_vxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_multiply_xx.xml b/grc/blocks/gr_multiply_xx.xml
index 60f65c274..60f65c274 100644
--- a/grc/data/platforms/python/blocks/gr_multiply_xx.xml
+++ b/grc/blocks/gr_multiply_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_mute_xx.xml b/grc/blocks/gr_mute_xx.xml
index a9a857c6a..a9a857c6a 100644
--- a/grc/data/platforms/python/blocks/gr_mute_xx.xml
+++ b/grc/blocks/gr_mute_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_nlog10_ff.xml b/grc/blocks/gr_nlog10_ff.xml
index 935078236..935078236 100644
--- a/grc/data/platforms/python/blocks/gr_nlog10_ff.xml
+++ b/grc/blocks/gr_nlog10_ff.xml
diff --git a/grc/data/platforms/python/blocks/gr_noise_source_x.xml b/grc/blocks/gr_noise_source_x.xml
index 4fcef5148..4fcef5148 100644
--- a/grc/data/platforms/python/blocks/gr_noise_source_x.xml
+++ b/grc/blocks/gr_noise_source_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_nop.xml b/grc/blocks/gr_nop.xml
index 127a78a55..127a78a55 100644
--- a/grc/data/platforms/python/blocks/gr_nop.xml
+++ b/grc/blocks/gr_nop.xml
diff --git a/grc/data/platforms/python/blocks/gr_not_xx.xml b/grc/blocks/gr_not_xx.xml
index 7af7e4b6b..7af7e4b6b 100644
--- a/grc/data/platforms/python/blocks/gr_not_xx.xml
+++ b/grc/blocks/gr_not_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_null_sink.xml b/grc/blocks/gr_null_sink.xml
index ed106b495..ed106b495 100644
--- a/grc/data/platforms/python/blocks/gr_null_sink.xml
+++ b/grc/blocks/gr_null_sink.xml
diff --git a/grc/data/platforms/python/blocks/gr_null_source.xml b/grc/blocks/gr_null_source.xml
index 6132eae3c..6132eae3c 100644
--- a/grc/data/platforms/python/blocks/gr_null_source.xml
+++ b/grc/blocks/gr_null_source.xml
diff --git a/grc/data/platforms/python/blocks/gr_or_xx.xml b/grc/blocks/gr_or_xx.xml
index b374aa22a..b374aa22a 100644
--- a/grc/data/platforms/python/blocks/gr_or_xx.xml
+++ b/grc/blocks/gr_or_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_packed_to_unpacked_xx.xml b/grc/blocks/gr_packed_to_unpacked_xx.xml
index 5fd9729a4..5fd9729a4 100644
--- a/grc/data/platforms/python/blocks/gr_packed_to_unpacked_xx.xml
+++ b/grc/blocks/gr_packed_to_unpacked_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_peak_detector2_fb.xml b/grc/blocks/gr_peak_detector2_fb.xml
index 128c6244f..128c6244f 100644
--- a/grc/data/platforms/python/blocks/gr_peak_detector2_fb.xml
+++ b/grc/blocks/gr_peak_detector2_fb.xml
diff --git a/grc/data/platforms/python/blocks/gr_peak_detector_xb.xml b/grc/blocks/gr_peak_detector_xb.xml
index 394b0697f..394b0697f 100644
--- a/grc/data/platforms/python/blocks/gr_peak_detector_xb.xml
+++ b/grc/blocks/gr_peak_detector_xb.xml
diff --git a/grc/data/platforms/python/blocks/gr_phase_modulator_fc.xml b/grc/blocks/gr_phase_modulator_fc.xml
index 758c50863..758c50863 100644
--- a/grc/data/platforms/python/blocks/gr_phase_modulator_fc.xml
+++ b/grc/blocks/gr_phase_modulator_fc.xml
diff --git a/grc/data/platforms/python/blocks/gr_pll_carriertracking_cc.xml b/grc/blocks/gr_pll_carriertracking_cc.xml
index 5b876b259..5b876b259 100644
--- a/grc/data/platforms/python/blocks/gr_pll_carriertracking_cc.xml
+++ b/grc/blocks/gr_pll_carriertracking_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_pll_freqdet_cf.xml b/grc/blocks/gr_pll_freqdet_cf.xml
index 8ec1fb3bb..8ec1fb3bb 100644
--- a/grc/data/platforms/python/blocks/gr_pll_freqdet_cf.xml
+++ b/grc/blocks/gr_pll_freqdet_cf.xml
diff --git a/grc/data/platforms/python/blocks/gr_pll_refout_cc.xml b/grc/blocks/gr_pll_refout_cc.xml
index 64cf2bfb6..64cf2bfb6 100644
--- a/grc/data/platforms/python/blocks/gr_pll_refout_cc.xml
+++ b/grc/blocks/gr_pll_refout_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_pn_correlator_cc.xml b/grc/blocks/gr_pn_correlator_cc.xml
index 094f46cdf..094f46cdf 100644
--- a/grc/data/platforms/python/blocks/gr_pn_correlator_cc.xml
+++ b/grc/blocks/gr_pn_correlator_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml
index eb855956a..eb855956a 100644
--- a/grc/data/platforms/python/blocks/gr_probe_avg_mag_sqrd_x.xml
+++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml
index 74d3b0a2b..74d3b0a2b 100644
--- a/grc/data/platforms/python/blocks/gr_probe_density_b.xml
+++ b/grc/blocks/gr_probe_density_b.xml
diff --git a/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml
index 7f562d2f3..7f562d2f3 100644
--- a/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml
+++ b/grc/blocks/gr_probe_mpsk_snr_c.xml
diff --git a/grc/data/platforms/python/blocks/gr_pwr_squelch_xx.xml b/grc/blocks/gr_pwr_squelch_xx.xml
index 08d621177..08d621177 100644
--- a/grc/data/platforms/python/blocks/gr_pwr_squelch_xx.xml
+++ b/grc/blocks/gr_pwr_squelch_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_quadrature_demod_cf.xml b/grc/blocks/gr_quadrature_demod_cf.xml
index a0e630c7e..a0e630c7e 100644
--- a/grc/data/platforms/python/blocks/gr_quadrature_demod_cf.xml
+++ b/grc/blocks/gr_quadrature_demod_cf.xml
diff --git a/grc/data/platforms/python/blocks/gr_rational_resampler_base_xxx.xml b/grc/blocks/gr_rational_resampler_base_xxx.xml
index 4b7720173..4b7720173 100644
--- a/grc/data/platforms/python/blocks/gr_rational_resampler_base_xxx.xml
+++ b/grc/blocks/gr_rational_resampler_base_xxx.xml
diff --git a/grc/data/platforms/python/blocks/gr_repeat.xml b/grc/blocks/gr_repeat.xml
index ba652a4d7..ba652a4d7 100644
--- a/grc/data/platforms/python/blocks/gr_repeat.xml
+++ b/grc/blocks/gr_repeat.xml
diff --git a/grc/data/platforms/python/blocks/gr_rms_xx.xml b/grc/blocks/gr_rms_xx.xml
index 1e0947192..1e0947192 100644
--- a/grc/data/platforms/python/blocks/gr_rms_xx.xml
+++ b/grc/blocks/gr_rms_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_sample_and_hold_xx.xml b/grc/blocks/gr_sample_and_hold_xx.xml
index bfe66bb00..bfe66bb00 100644
--- a/grc/data/platforms/python/blocks/gr_sample_and_hold_xx.xml
+++ b/grc/blocks/gr_sample_and_hold_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_scrambler_bb.xml b/grc/blocks/gr_scrambler_bb.xml
index d079c4015..d079c4015 100644
--- a/grc/data/platforms/python/blocks/gr_scrambler_bb.xml
+++ b/grc/blocks/gr_scrambler_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_short_to_float.xml b/grc/blocks/gr_short_to_float.xml
index 8dac97c09..8dac97c09 100644
--- a/grc/data/platforms/python/blocks/gr_short_to_float.xml
+++ b/grc/blocks/gr_short_to_float.xml
diff --git a/grc/data/platforms/python/blocks/gr_sig_source_x.xml b/grc/blocks/gr_sig_source_x.xml
index c329dba67..c329dba67 100644
--- a/grc/data/platforms/python/blocks/gr_sig_source_x.xml
+++ b/grc/blocks/gr_sig_source_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_simple_correlator.xml b/grc/blocks/gr_simple_correlator.xml
index 820523a64..820523a64 100644
--- a/grc/data/platforms/python/blocks/gr_simple_correlator.xml
+++ b/grc/blocks/gr_simple_correlator.xml
diff --git a/grc/data/platforms/python/blocks/gr_simple_framer.xml b/grc/blocks/gr_simple_framer.xml
index 2a0295c41..2a0295c41 100644
--- a/grc/data/platforms/python/blocks/gr_simple_framer.xml
+++ b/grc/blocks/gr_simple_framer.xml
diff --git a/grc/data/platforms/python/blocks/gr_simple_squelch_cc.xml b/grc/blocks/gr_simple_squelch_cc.xml
index 5c0727f5f..5c0727f5f 100644
--- a/grc/data/platforms/python/blocks/gr_simple_squelch_cc.xml
+++ b/grc/blocks/gr_simple_squelch_cc.xml
diff --git a/grc/data/platforms/python/blocks/gr_single_pole_iir_filter_xx.xml b/grc/blocks/gr_single_pole_iir_filter_xx.xml
index 50cf4a82d..50cf4a82d 100644
--- a/grc/data/platforms/python/blocks/gr_single_pole_iir_filter_xx.xml
+++ b/grc/blocks/gr_single_pole_iir_filter_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_skiphead.xml b/grc/blocks/gr_skiphead.xml
index 0849ad298..0849ad298 100644
--- a/grc/data/platforms/python/blocks/gr_skiphead.xml
+++ b/grc/blocks/gr_skiphead.xml
diff --git a/grc/data/platforms/python/blocks/gr_stream_to_streams.xml b/grc/blocks/gr_stream_to_streams.xml
index 82542b8d4..82542b8d4 100644
--- a/grc/data/platforms/python/blocks/gr_stream_to_streams.xml
+++ b/grc/blocks/gr_stream_to_streams.xml
diff --git a/grc/data/platforms/python/blocks/gr_stream_to_vector.xml b/grc/blocks/gr_stream_to_vector.xml
index 296d786f8..296d786f8 100644
--- a/grc/data/platforms/python/blocks/gr_stream_to_vector.xml
+++ b/grc/blocks/gr_stream_to_vector.xml
diff --git a/grc/data/platforms/python/blocks/gr_streams_to_stream.xml b/grc/blocks/gr_streams_to_stream.xml
index 7aadd7eef..7aadd7eef 100644
--- a/grc/data/platforms/python/blocks/gr_streams_to_stream.xml
+++ b/grc/blocks/gr_streams_to_stream.xml
diff --git a/grc/data/platforms/python/blocks/gr_streams_to_vector.xml b/grc/blocks/gr_streams_to_vector.xml
index 4ecdcb2d4..4ecdcb2d4 100644
--- a/grc/data/platforms/python/blocks/gr_streams_to_vector.xml
+++ b/grc/blocks/gr_streams_to_vector.xml
diff --git a/grc/data/platforms/python/blocks/gr_sub_xx.xml b/grc/blocks/gr_sub_xx.xml
index f1f4797e0..f1f4797e0 100644
--- a/grc/data/platforms/python/blocks/gr_sub_xx.xml
+++ b/grc/blocks/gr_sub_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_threshold_ff.xml b/grc/blocks/gr_threshold_ff.xml
index 740ce5794..740ce5794 100644
--- a/grc/data/platforms/python/blocks/gr_threshold_ff.xml
+++ b/grc/blocks/gr_threshold_ff.xml
diff --git a/grc/data/platforms/python/blocks/gr_throttle.xml b/grc/blocks/gr_throttle.xml
index ab8506f55..ab8506f55 100644
--- a/grc/data/platforms/python/blocks/gr_throttle.xml
+++ b/grc/blocks/gr_throttle.xml
diff --git a/grc/data/platforms/python/blocks/gr_uchar_to_float.xml b/grc/blocks/gr_uchar_to_float.xml
index 0a5f7f96a..0a5f7f96a 100644
--- a/grc/data/platforms/python/blocks/gr_uchar_to_float.xml
+++ b/grc/blocks/gr_uchar_to_float.xml
diff --git a/grc/data/platforms/python/blocks/gr_udp_sink.xml b/grc/blocks/gr_udp_sink.xml
index e9f6c2be8..e9f6c2be8 100644
--- a/grc/data/platforms/python/blocks/gr_udp_sink.xml
+++ b/grc/blocks/gr_udp_sink.xml
diff --git a/grc/data/platforms/python/blocks/gr_udp_source.xml b/grc/blocks/gr_udp_source.xml
index f03adf802..f03adf802 100644
--- a/grc/data/platforms/python/blocks/gr_udp_source.xml
+++ b/grc/blocks/gr_udp_source.xml
diff --git a/grc/data/platforms/python/blocks/gr_unpack_k_bits_bb.xml b/grc/blocks/gr_unpack_k_bits_bb.xml
index 9917644ab..9917644ab 100644
--- a/grc/data/platforms/python/blocks/gr_unpack_k_bits_bb.xml
+++ b/grc/blocks/gr_unpack_k_bits_bb.xml
diff --git a/grc/data/platforms/python/blocks/gr_unpacked_to_packed_xx.xml b/grc/blocks/gr_unpacked_to_packed_xx.xml
index f7457eb5c..f7457eb5c 100644
--- a/grc/data/platforms/python/blocks/gr_unpacked_to_packed_xx.xml
+++ b/grc/blocks/gr_unpacked_to_packed_xx.xml
diff --git a/grc/data/platforms/python/blocks/gr_vco_f.xml b/grc/blocks/gr_vco_f.xml
index e49c53965..e49c53965 100644
--- a/grc/data/platforms/python/blocks/gr_vco_f.xml
+++ b/grc/blocks/gr_vco_f.xml
diff --git a/grc/data/platforms/python/blocks/gr_vector_sink_x.xml b/grc/blocks/gr_vector_sink_x.xml
index 3bd998698..3bd998698 100644
--- a/grc/data/platforms/python/blocks/gr_vector_sink_x.xml
+++ b/grc/blocks/gr_vector_sink_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_vector_source_x.xml b/grc/blocks/gr_vector_source_x.xml
index 7a6a3aeff..7a6a3aeff 100644
--- a/grc/data/platforms/python/blocks/gr_vector_source_x.xml
+++ b/grc/blocks/gr_vector_source_x.xml
diff --git a/grc/data/platforms/python/blocks/gr_vector_to_stream.xml b/grc/blocks/gr_vector_to_stream.xml
index d56d34067..d56d34067 100644
--- a/grc/data/platforms/python/blocks/gr_vector_to_stream.xml
+++ b/grc/blocks/gr_vector_to_stream.xml
diff --git a/grc/data/platforms/python/blocks/gr_vector_to_streams.xml b/grc/blocks/gr_vector_to_streams.xml
index 86cb56813..86cb56813 100644
--- a/grc/data/platforms/python/blocks/gr_vector_to_streams.xml
+++ b/grc/blocks/gr_vector_to_streams.xml
diff --git a/grc/data/platforms/python/blocks/gr_wavfile_sink.xml b/grc/blocks/gr_wavfile_sink.xml
index f2c8a009f..f2c8a009f 100644
--- a/grc/data/platforms/python/blocks/gr_wavfile_sink.xml
+++ b/grc/blocks/gr_wavfile_sink.xml
diff --git a/grc/data/platforms/python/blocks/gr_wavfile_source.xml b/grc/blocks/gr_wavfile_source.xml
index 433bb0af2..433bb0af2 100644
--- a/grc/data/platforms/python/blocks/gr_wavfile_source.xml
+++ b/grc/blocks/gr_wavfile_source.xml
diff --git a/grc/data/platforms/python/blocks/gr_xor_xx.xml b/grc/blocks/gr_xor_xx.xml
index c014cbe57..c014cbe57 100644
--- a/grc/data/platforms/python/blocks/gr_xor_xx.xml
+++ b/grc/blocks/gr_xor_xx.xml
diff --git a/grc/data/platforms/python/blocks/high_pass_filter.xml b/grc/blocks/high_pass_filter.xml
index 0673fd124..5be916fa9 100644
--- a/grc/data/platforms/python/blocks/high_pass_filter.xml
+++ b/grc/blocks/high_pass_filter.xml
@@ -9,7 +9,7 @@
<key>high_pass_filter</key>
<import>from gnuradio import gr</import>
<import>from gnuradio.gr import firdes</import>
- <make>gr.$(type)($decim, firdes.high_pass(
+ <make>gr.$(type)(#if str($type).startswith('interp') then $interp else $decim#, firdes.high_pass(
$gain, $samp_rate, $cutoff_freq, $width, firdes.$window, $beta))</make>
<callback>set_taps(firdes.high_pass($gain, $samp_rate, $cutoff_freq, $width, firdes.$window, $beta))</callback>
<param>
@@ -46,6 +46,14 @@
<key>decim</key>
<value>1</value>
<type>int</type>
+ <hide>#if str($type).startswith('interp') then 'all' else 'none'#</hide>
+ </param>
+ <param>
+ <name>Interpolation</name>
+ <key>interp</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>#if str($type).startswith('interp') then 'none' else 'all'#</hide>
</param>
<param>
<name>Gain</name>
@@ -111,8 +119,6 @@
<doc>
This filter is a convenience wrapper for an fir filter and a firdes taps generating function.
-The decimation paramater becomes interpolation when the filter type is set to interpolating.
-
Sample rate, cutoff frequency, and transition width are in Hertz.
The beta paramater only applies to the Kaiser window.
diff --git a/grc/data/platforms/python/blocks/import.xml b/grc/blocks/import.xml
index feea052d3..feea052d3 100644
--- a/grc/data/platforms/python/blocks/import.xml
+++ b/grc/blocks/import.xml
diff --git a/grc/data/platforms/python/blocks/low_pass_filter.xml b/grc/blocks/low_pass_filter.xml
index 1e8802c80..27120c047 100644
--- a/grc/data/platforms/python/blocks/low_pass_filter.xml
+++ b/grc/blocks/low_pass_filter.xml
@@ -9,7 +9,7 @@
<key>low_pass_filter</key>
<import>from gnuradio import gr</import>
<import>from gnuradio.gr import firdes</import>
- <make>gr.$(type)($decim, firdes.low_pass(
+ <make>gr.$(type)(#if str($type).startswith('interp') then $interp else $decim#, firdes.low_pass(
$gain, $samp_rate, $cutoff_freq, $width, firdes.$window, $beta))</make>
<callback>set_taps(firdes.low_pass($gain, $samp_rate, $cutoff_freq, $width, firdes.$window, $beta))</callback>
<param>
@@ -46,6 +46,14 @@
<key>decim</key>
<value>1</value>
<type>int</type>
+ <hide>#if str($type).startswith('interp') then 'all' else 'none'#</hide>
+ </param>
+ <param>
+ <name>Interpolation</name>
+ <key>interp</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>#if str($type).startswith('interp') then 'none' else 'all'#</hide>
</param>
<param>
<name>Gain</name>
@@ -111,8 +119,6 @@
<doc>
This filter is a convenience wrapper for an fir filter and a firdes taps generating function.
-The decimation paramater becomes interpolation when the filter type is set to interpolating.
-
Sample rate, cutoff frequency, and transition width are in Hertz.
The beta paramater only applies to the Kaiser window.
diff --git a/grc/data/platforms/python/blocks/note.xml b/grc/blocks/note.xml
index db6687c03..db6687c03 100644
--- a/grc/data/platforms/python/blocks/note.xml
+++ b/grc/blocks/note.xml
diff --git a/grc/data/platforms/python/blocks/options.xml b/grc/blocks/options.xml
index 82f309027..06ede76f0 100644
--- a/grc/data/platforms/python/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -20,23 +20,27 @@ from gnuradio.eng_option import eng_option
#end if
</import>
<make></make>
+ <callback>self.start($autostart)</callback>
<param>
<name>Title</name>
<key>title</key>
- <value>untitled</value>
+ <value></value>
<type>string</type>
+ <hide>#if $title() then 'none' else 'part'#</hide>
</param>
<param>
<name>Author</name>
<key>author</key>
- <value>unknown</value>
+ <value></value>
<type>string</type>
+ <hide>#if $author() then 'none' else 'part'#</hide>
</param>
<param>
<name>Description</name>
<key>description</key>
- <value>gnuradio flow graph</value>
+ <value></value>
<type>string</type>
+ <hide>#if $description() then 'none' else 'part'#</hide>
</param>
<param>
<name>Window Size</name>
@@ -50,6 +54,7 @@ from gnuradio.eng_option import eng_option
<key>generate_options</key>
<value>wx_gui</value>
<type>enum</type>
+ <hide>#if $generate_options() == 'wx_gui' then 'part' else 'none'#</hide>
<option>
<name>WX GUI</name>
<key>wx_gui</key>
@@ -71,6 +76,29 @@ from gnuradio.eng_option import eng_option
<hide>#if $generate_options() == 'hb' then 'none' else 'all'#</hide>
</param>
<param>
+ <name>Autostart</name>
+ <key>autostart</key>
+ <value>True</value>
+ <type>bool</type>
+ <hide>#if $generate_options() == 'wx_gui'
+ #if str($autostart) == 'True'
+part#slurp
+ #else
+none#slurp
+ #end if
+#else
+all#slurp
+#end if</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
<name>Realtime Scheduling</name>
<key>realtime_scheduling</key>
<value></value>
@@ -106,6 +134,9 @@ The window size (width, height) must be between (300, 300) and (4096, 4096).
The generate options controls the type of code generated. \
Non-graphical flow graphs should avoid using graphical sinks or graphical variable controls.
+In a graphical application, \
+autostart can be controlled by a variable to start and stop the flowgraph at runtime.
+
The id of this block determines the name of the generated file and the name of the class. \
For example, an id of my_block will generate the file my_block.py and class my_block(gr....
diff --git a/grc/data/platforms/python/blocks/pad_sink.xml b/grc/blocks/pad_sink.xml
index 477f2ad13..477f2ad13 100644
--- a/grc/data/platforms/python/blocks/pad_sink.xml
+++ b/grc/blocks/pad_sink.xml
diff --git a/grc/data/platforms/python/blocks/pad_source.xml b/grc/blocks/pad_source.xml
index b6ef2c55d..b6ef2c55d 100644
--- a/grc/data/platforms/python/blocks/pad_source.xml
+++ b/grc/blocks/pad_source.xml
diff --git a/grc/data/platforms/python/blocks/parameter.xml b/grc/blocks/parameter.xml
index e7bf61564..d3bab94c3 100644
--- a/grc/data/platforms/python/blocks/parameter.xml
+++ b/grc/blocks/parameter.xml
@@ -7,6 +7,7 @@
<block>
<name>Parameter</name>
<key>parameter</key>
+ <var_make>self.$(id) = $(id)</var_make>
<make>$value</make>
<param>
<name>Label</name>
diff --git a/grc/data/platforms/python/blocks/probe_function.xml b/grc/blocks/probe_function.xml
index ac0b3dcde..ac0b3dcde 100644
--- a/grc/data/platforms/python/blocks/probe_function.xml
+++ b/grc/blocks/probe_function.xml
diff --git a/grc/data/platforms/python/blocks/random_source_x.xml b/grc/blocks/random_source_x.xml
index 800bae716..800bae716 100644
--- a/grc/data/platforms/python/blocks/random_source_x.xml
+++ b/grc/blocks/random_source_x.xml
diff --git a/grc/blocks/root_raised_cosine_filter.xml b/grc/blocks/root_raised_cosine_filter.xml
new file mode 100644
index 000000000..81688d297
--- /dev/null
+++ b/grc/blocks/root_raised_cosine_filter.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Root Raised Cosine Filter: Custom wrapper
+###################################################
+ -->
+<block>
+ <name>Root Raised Cosine Filter</name>
+ <key>root_raised_cosine_filter</key>
+ <import>from gnuradio import gr</import>
+ <import>from gnuradio.gr import firdes</import>
+ <make>gr.$(type)(#if str($type).startswith('interp') then $interp else $decim#, firdes.root_raised_cosine(
+ $gain, $samp_rate, $sym_rate, $alpha, $ntaps))</make>
+ <callback>set_taps(firdes.root_raised_cosine($gain, $samp_rate, $sym_rate, $alpha, $ntaps))</callback>
+ <param>
+ <name>FIR Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex->Complex (Decimating)</name>
+ <key>fir_filter_ccf</key>
+ <opt>input:complex</opt>
+ <opt>output:complex</opt>
+ </option>
+ <option>
+ <name>Complex->Complex (Interpolating)</name>
+ <key>interp_fir_filter_ccf</key>
+ <opt>input:complex</opt>
+ <opt>output:complex</opt>
+ </option>
+ <option>
+ <name>Float->Float (Decimating)</name>
+ <key>fir_filter_fff</key>
+ <opt>input:float</opt>
+ <opt>output:float</opt>
+ </option>
+ <option>
+ <name>Float->Float (Interpolating)</name>
+ <key>interp_fir_filter_fff</key>
+ <opt>input:float</opt>
+ <opt>output:float</opt>
+ </option>
+ </param>
+ <param>
+ <name>Decimation</name>
+ <key>decim</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>#if str($type).startswith('interp') then 'all' else 'none'#</hide>
+ </param>
+ <param>
+ <name>Interpolation</name>
+ <key>interp</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>#if str($type).startswith('interp') then 'none' else 'all'#</hide>
+ </param>
+ <param>
+ <name>Gain</name>
+ <key>gain</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Sample Rate</name>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Symbol Rate</name>
+ <key>sym_rate</key>
+ <value>1.0</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Alpha</name>
+ <key>alpha</key>
+ <value>0.35</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Num Taps</name>
+ <key>ntaps</key>
+ <value>11*samp_rate</value>
+ <type>int</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>$type.input</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$type.output</type>
+ </source>
+ <doc>
+This filter is a convenience wrapper for an fir filter and a firdes taps generating function.
+
+Sample rate in Hertz.
+ </doc>
+</block>
diff --git a/grc/data/platforms/python/blocks/trellis_encoder_xx.xml b/grc/blocks/trellis_encoder_xx.xml
index 74a8cc346..74a8cc346 100644
--- a/grc/data/platforms/python/blocks/trellis_encoder_xx.xml
+++ b/grc/blocks/trellis_encoder_xx.xml
diff --git a/grc/data/platforms/python/blocks/trellis_metrics_x.xml b/grc/blocks/trellis_metrics_x.xml
index 2016a34c2..2016a34c2 100644
--- a/grc/data/platforms/python/blocks/trellis_metrics_x.xml
+++ b/grc/blocks/trellis_metrics_x.xml
diff --git a/grc/data/platforms/python/blocks/trellis_permutation.xml b/grc/blocks/trellis_permutation.xml
index 7721cc71d..7721cc71d 100644
--- a/grc/data/platforms/python/blocks/trellis_permutation.xml
+++ b/grc/blocks/trellis_permutation.xml
diff --git a/grc/data/platforms/python/blocks/trellis_siso_combined_f.xml b/grc/blocks/trellis_siso_combined_f.xml
index 98874d7f4..98874d7f4 100644
--- a/grc/data/platforms/python/blocks/trellis_siso_combined_f.xml
+++ b/grc/blocks/trellis_siso_combined_f.xml
diff --git a/grc/data/platforms/python/blocks/trellis_siso_f.xml b/grc/blocks/trellis_siso_f.xml
index 2b9cfe5f7..2b9cfe5f7 100644
--- a/grc/data/platforms/python/blocks/trellis_siso_f.xml
+++ b/grc/blocks/trellis_siso_f.xml
diff --git a/grc/data/platforms/python/blocks/trellis_viterbi_combined_xx.xml b/grc/blocks/trellis_viterbi_combined_xx.xml
index 33dcaaf73..33dcaaf73 100644
--- a/grc/data/platforms/python/blocks/trellis_viterbi_combined_xx.xml
+++ b/grc/blocks/trellis_viterbi_combined_xx.xml
diff --git a/grc/data/platforms/python/blocks/trellis_viterbi_x.xml b/grc/blocks/trellis_viterbi_x.xml
index 84b39677c..84b39677c 100644
--- a/grc/data/platforms/python/blocks/trellis_viterbi_x.xml
+++ b/grc/blocks/trellis_viterbi_x.xml
diff --git a/grc/data/platforms/python/blocks/usrp2_probe.xml b/grc/blocks/usrp2_probe.xml
index cc3f9c2fd..cc3f9c2fd 100644
--- a/grc/data/platforms/python/blocks/usrp2_probe.xml
+++ b/grc/blocks/usrp2_probe.xml
diff --git a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml b/grc/blocks/usrp2_sink_xxxx.xml
index 639f96cf4..639f96cf4 100644
--- a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml
+++ b/grc/blocks/usrp2_sink_xxxx.xml
diff --git a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml b/grc/blocks/usrp2_source_xxxx.xml
index 6c776d0ad..6c776d0ad 100644
--- a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml
+++ b/grc/blocks/usrp2_source_xxxx.xml
diff --git a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml b/grc/blocks/usrp_dual_sink_x.xml
index 8f418becd..8f418becd 100644
--- a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml
+++ b/grc/blocks/usrp_dual_sink_x.xml
diff --git a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml b/grc/blocks/usrp_dual_source_x.xml
index 740895d42..740895d42 100644
--- a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
+++ b/grc/blocks/usrp_dual_source_x.xml
diff --git a/grc/data/platforms/python/blocks/usrp_probe.xml b/grc/blocks/usrp_probe.xml
index ee207c28d..ee207c28d 100644
--- a/grc/data/platforms/python/blocks/usrp_probe.xml
+++ b/grc/blocks/usrp_probe.xml
diff --git a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml b/grc/blocks/usrp_simple_sink_x.xml
index f3ccf1263..f3ccf1263 100644
--- a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml
+++ b/grc/blocks/usrp_simple_sink_x.xml
diff --git a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml b/grc/blocks/usrp_simple_source_x.xml
index 1a777bd63..1a777bd63 100644
--- a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
+++ b/grc/blocks/usrp_simple_source_x.xml
diff --git a/grc/data/platforms/python/blocks/variable.xml b/grc/blocks/variable.xml
index d620e1607..afee0f5d4 100644
--- a/grc/data/platforms/python/blocks/variable.xml
+++ b/grc/blocks/variable.xml
@@ -7,7 +7,9 @@
<block>
<name>Variable</name>
<key>variable</key>
- <make>$value</make>
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make></make>
+ <callback>self.set_$(id)($value)</callback>
<param>
<name>Value</name>
<key>value</key>
diff --git a/grc/blocks/variable_check_box.xml b/grc/blocks/variable_check_box.xml
new file mode 100644
index 000000000..59ace503b
--- /dev/null
+++ b/grc/blocks/variable_check_box.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Variable Check Box:
+## a gui check box form
+###################################################
+ -->
+<block>
+ <name>Variable Check Box</name>
+ <key>variable_check_box</key>
+ <import>from gnuradio.wxgui import forms</import>
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>self.$(id)_check_box = forms.check_box(
+ parent=self.GetWin(),
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ true=$true,
+ false=$false,
+)
+#set $grid_pos = $grid_pos()
+#if not grid_pos
+self.Add(self.$(id)_check_box)
+#else
+self.GridAdd(self.$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+#end if</make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self.$(id)_check_box.set_value($id)</callback>
+ <param>
+ <name>Label</name>
+ <key>label</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $label() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Default Value</name>
+ <key>value</key>
+ <value>True</value>
+ <type>raw</type>
+ </param>
+ <param>
+ <name>True</name>
+ <key>true</key>
+ <value>True</value>
+ <type>raw</type>
+ </param>
+ <param>
+ <name>False</name>
+ <key>false</key>
+ <value>False</value>
+ <type>raw</type>
+ </param>
+ <param>
+ <name>Grid Position</name>
+ <key>grid_pos</key>
+ <value></value>
+ <type>grid_pos</type>
+ </param>
+ <check>$value in ($true, $false)</check>
+ <doc>
+This block creates a variable with a check box form. \
+Leave the label blank to use the variable id as the label.
+
+A check box form can switch between two states; \
+the default being True and False. \
+Override True and False to use alternative states.
+
+Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
+ </doc>
+</block>
diff --git a/grc/data/platforms/python/blocks/variable_chooser.xml b/grc/blocks/variable_chooser.xml
index 3ca33045a..2f0e9bbf3 100644
--- a/grc/data/platforms/python/blocks/variable_chooser.xml
+++ b/grc/blocks/variable_chooser.xml
@@ -10,13 +10,11 @@
<name>Variable Chooser</name>
<key>variable_chooser</key>
<import>from gnuradio.wxgui import forms</import>
- <make>$value
-self['$id'] = $id
-self.subscribe('$id', self.set_$(id))
-self._$(id)_control = forms.$(type)(
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>self.$(id)_chooser = forms.$(type)(
parent=self.GetWin(),
- ps=self,
- key='$id',
+ value=self.$id,
+ callback=self.set_$(id),
#if $label()
label=$label,
#else
@@ -30,10 +28,12 @@ self._$(id)_control = forms.$(type)(
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self._$(id)_control)
+self.Add(self.$(id)_chooser)
#else
-self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(self.$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self.$(id)_chooser.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
diff --git a/grc/blocks/variable_config.xml b/grc/blocks/variable_config.xml
new file mode 100644
index 000000000..f62a3def1
--- /dev/null
+++ b/grc/blocks/variable_config.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Variable Config block:
+## a variable that reads and writes to a config file
+###################################################
+ -->
+<block>
+ <name>Variable Config</name>
+ <key>variable_config</key>
+ <import>import ConfigParser</import>
+ <var_make>self._$(id)_config = ConfigParser.ConfigParser()
+self._$(id)_config.read($config_file)
+if not self._$(id)_config.has_section($section):
+ self._$(id)_config.add_section($section)
+try: $(id) = self._$(id)_config.$(type.get)($section, $option)
+except: $(id) = $value
+self.$(id) = $(id)</var_make>
+ <make></make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self._$(id)_config.set($section, $option, str($writeback))
+self._$(id)_config.write(open($config_file, 'w'))</callback>
+ <param>
+ <name>Default Value</name>
+ <key>value</key>
+ <value>0</value>
+ <type>$type</type>
+ </param>
+ <param>
+ <name>Type</name>
+ <key>type</key>
+ <value>real</value>
+ <type>enum</type>
+ <option>
+ <name>Float</name>
+ <key>real</key>
+ <opt>get:getfloat</opt>
+ </option>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>get:getint</opt>
+ </option>
+ <option>
+ <name>Bool</name>
+ <key>bool</key>
+ <opt>get:getbool</opt>
+ </option>
+ <option>
+ <name>String</name>
+ <key>string</key>
+ <opt>get:get</opt>
+ </option>
+ </param>
+ <param>
+ <name>Config File</name>
+ <key>config_file</key>
+ <value>default</value>
+ <type>file_open</type>
+ </param>
+ <param>
+ <name>Section</name>
+ <key>section</key>
+ <value>main</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Option</name>
+ <key>option</key>
+ <value>key</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>WriteBack</name>
+ <key>writeback</key>
+ <value>None</value>
+ <type>raw</type>
+ </param>
+ <doc>
+This block represents a variable that can be read from a config file.
+
+To save the value back into the config file: \
+enter the name of another variable into the writeback param. \
+When the other variable is changed at runtime, the config file will be re-written.
+ </doc>
+</block>
diff --git a/grc/data/platforms/python/blocks/variable_slider.xml b/grc/blocks/variable_slider.xml
index f8a5543f0..6a7c400ea 100644
--- a/grc/data/platforms/python/blocks/variable_slider.xml
+++ b/grc/blocks/variable_slider.xml
@@ -9,15 +9,13 @@
<name>Variable Slider</name>
<key>variable_slider</key>
<import>from gnuradio.wxgui import forms</import>
- <make>$value
-self['$id'] = $id
-self.subscribe('$id', self.set_$(id))
-self._$(id)_sizer = wx.BoxSizer(wx.VERTICAL)
-forms.text_box(
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>_$(id)_sizer = wx.BoxSizer(wx.VERTICAL)
+self.$(id)_text_box = forms.text_box(
parent=self.GetWin(),
- sizer=self._$(id)_sizer,
- ps=self,
- key='$id',
+ sizer=_$(id)_sizer,
+ value=self.$id,
+ callback=self.set_$(id),
#if $label()
label=$label,
#else
@@ -26,11 +24,11 @@ forms.text_box(
converter=forms.$(converver)(),
proportion=0,
)
-forms.slider(
+self.$(id)_slider = forms.slider(
parent=self.GetWin(),
- sizer=self._$(id)_sizer,
- ps=self,
- key='$id',
+ sizer=_$(id)_sizer,
+ value=self.$id,
+ callback=self.set_$(id),
minimum=$min,
maximum=$max,
num_steps=$num_steps,
@@ -40,10 +38,13 @@ forms.slider(
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self._$(id)_sizer)
+self.Add(_$(id)_sizer)
#else
-self.GridAdd(self._$(id)_sizer, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(_$(id)_sizer, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self.$(id)_slider.set_value($id)</callback>
+ <callback>self.$(id)_text_box.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
diff --git a/grc/blocks/variable_static_text.xml b/grc/blocks/variable_static_text.xml
new file mode 100644
index 000000000..0179eb6e3
--- /dev/null
+++ b/grc/blocks/variable_static_text.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Variable Static Text:
+## a gui static text form
+###################################################
+ -->
+<block>
+ <name>Variable Static Text</name>
+ <key>variable_static_text</key>
+ <import>from gnuradio.wxgui import forms</import>
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>self.$(id)_static_text = forms.static_text(
+ parent=self.GetWin(),
+ value=self.$id,
+ callback=self.set_$(id),
+ #if $label()
+ label=$label,
+ #else
+ label='$id',
+ #end if
+ #if $formatter()
+ converter=forms.$(converver)(formatter=$formatter),
+ #else
+ converter=forms.$(converver)(),
+ #end if
+)
+#set $grid_pos = $grid_pos()
+#if not grid_pos
+self.Add(self.$(id)_static_text)
+#else
+self.GridAdd(self.$(id)_static_text, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+#end if</make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self.$(id)_static_text.set_value($id)</callback>
+ <param>
+ <name>Label</name>
+ <key>label</key>
+ <value></value>
+ <type>string</type>
+ <hide>#if $label() then 'none' else 'part'#</hide>
+ </param>
+ <param>
+ <name>Default Value</name>
+ <key>value</key>
+ <value>0</value>
+ <type>raw</type>
+ </param>
+ <param>
+ <name>Converter</name>
+ <key>converver</key>
+ <value>float_converter</value>
+ <type>enum</type>
+ <option>
+ <name>Float</name>
+ <key>float_converter</key>
+ </option>
+ <option>
+ <name>Integer</name>
+ <key>int_converter</key>
+ </option>
+ <option>
+ <name>String</name>
+ <key>str_converter</key>
+ </option>
+ </param>
+ <param>
+ <name>Formatter</name>
+ <key>formatter</key>
+ <value>None</value>
+ <type>raw</type>
+ <hide>part</hide>
+ </param>
+ <param>
+ <name>Grid Position</name>
+ <key>grid_pos</key>
+ <value></value>
+ <type>grid_pos</type>
+ </param>
+ <doc>
+This block creates a variable with a static text form. \
+Leave the label blank to use the variable id as the label.
+
+Format should be a function/lambda that converts a value into a string or None for the default formatter.
+
+Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
+ </doc>
+</block>
diff --git a/grc/data/platforms/python/blocks/variable_text_box.xml b/grc/blocks/variable_text_box.xml
index b5acd9d2e..2bcb680f2 100644
--- a/grc/data/platforms/python/blocks/variable_text_box.xml
+++ b/grc/blocks/variable_text_box.xml
@@ -9,26 +9,30 @@
<name>Variable Text Box</name>
<key>variable_text_box</key>
<import>from gnuradio.wxgui import forms</import>
- <make>$value
-self['$id'] = $id
-self.subscribe('$id', self.set_$(id))
-self._$(id)_control = forms.text_box(
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>self.$(id)_text_box = forms.text_box(
parent=self.GetWin(),
- ps=self,
- key='$id',
+ value=self.$id,
+ callback=self.set_$(id),
#if $label()
label=$label,
#else
label='$id',
#end if
+ #if $formatter()
+ converter=forms.$(converver)(formatter=$formatter),
+ #else
converter=forms.$(converver)(),
+ #end if
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self._$(id)_control)
+self.Add(self.$(id)_text_box)
#else
-self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(self.$(id)_text_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
+ <callback>self.set_$(id)($value)</callback>
+ <callback>self.$(id)_text_box.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
@@ -65,6 +69,13 @@ self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $gri
</option>
</param>
<param>
+ <name>Formatter</name>
+ <key>formatter</key>
+ <value>None</value>
+ <type>raw</type>
+ <hide>part</hide>
+ </param>
+ <param>
<name>Grid Position</name>
<key>grid_pos</key>
<value></value>
@@ -74,6 +85,8 @@ self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $gri
This block creates a variable with a text box. \
Leave the label blank to use the variable id as the label.
+Format should be a function/lambda that converts a value into a string or None for the default formatter.
+
Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
</doc>
</block>
diff --git a/grc/data/platforms/python/blocks/wxgui_constellationsink2.xml b/grc/blocks/wxgui_constellationsink2.xml
index 471c9f4a8..471c9f4a8 100644
--- a/grc/data/platforms/python/blocks/wxgui_constellationsink2.xml
+++ b/grc/blocks/wxgui_constellationsink2.xml
diff --git a/grc/data/platforms/python/blocks/wxgui_fftsink2.xml b/grc/blocks/wxgui_fftsink2.xml
index d7763cb25..d7763cb25 100644
--- a/grc/data/platforms/python/blocks/wxgui_fftsink2.xml
+++ b/grc/blocks/wxgui_fftsink2.xml
diff --git a/grc/data/platforms/python/blocks/wxgui_histosink2.xml b/grc/blocks/wxgui_histosink2.xml
index 4de57b1c4..4de57b1c4 100644
--- a/grc/data/platforms/python/blocks/wxgui_histosink2.xml
+++ b/grc/blocks/wxgui_histosink2.xml
diff --git a/grc/data/platforms/python/blocks/wxgui_numbersink2.xml b/grc/blocks/wxgui_numbersink2.xml
index 7cc90b697..7cc90b697 100644
--- a/grc/data/platforms/python/blocks/wxgui_numbersink2.xml
+++ b/grc/blocks/wxgui_numbersink2.xml
diff --git a/grc/data/platforms/python/blocks/wxgui_scopesink2.xml b/grc/blocks/wxgui_scopesink2.xml
index 78c39f80d..78c39f80d 100644
--- a/grc/data/platforms/python/blocks/wxgui_scopesink2.xml
+++ b/grc/blocks/wxgui_scopesink2.xml
diff --git a/grc/data/platforms/python/blocks/wxgui_waterfallsink2.xml b/grc/blocks/wxgui_waterfallsink2.xml
index 6d76ee867..6d76ee867 100644
--- a/grc/data/platforms/python/blocks/wxgui_waterfallsink2.xml
+++ b/grc/blocks/wxgui_waterfallsink2.xml
diff --git a/grc/data/platforms/python/blocks/xmlrpc_client.xml b/grc/blocks/xmlrpc_client.xml
index dc4d154d1..dc4d154d1 100644
--- a/grc/data/platforms/python/blocks/xmlrpc_client.xml
+++ b/grc/blocks/xmlrpc_client.xml
diff --git a/grc/data/platforms/python/blocks/xmlrpc_server.xml b/grc/blocks/xmlrpc_server.xml
index 6c31bd1a9..6c31bd1a9 100644
--- a/grc/data/platforms/python/blocks/xmlrpc_server.xml
+++ b/grc/blocks/xmlrpc_server.xml
diff --git a/grc/cpp/README b/grc/cpp/README
new file mode 100644
index 000000000..3eccc5dbf
--- /dev/null
+++ b/grc/cpp/README
@@ -0,0 +1,5 @@
+GRC could be used to generate c++ based flowgraphs:
+
+* A few base and gui classes would be overridden.
+* Block info could be extracted from the doxygen xml.
+* New flowgraph templates would be designed.
diff --git a/grc/data/Makefile.am b/grc/data/Makefile.am
deleted file mode 100644
index 961c183fb..000000000
--- a/grc/data/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.inc
-
-SUBDIRS = platforms
diff --git a/grc/data/platforms/Makefile.am b/grc/data/platforms/Makefile.am
deleted file mode 100644
index d26abd9ba..000000000
--- a/grc/data/platforms/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.inc
-
-SUBDIRS = base python
diff --git a/grc/data/platforms/base/Makefile.am b/grc/data/platforms/base/Makefile.am
deleted file mode 100644
index d323a1441..000000000
--- a/grc/data/platforms/base/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# 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.inc
-
-ourdatadir = $(pkgdatadir)/$(grc_base_data_reldir)
-
-dist_ourdata_DATA = \
- block_tree.dtd \
- flow_graph.dtd
diff --git a/grc/data/platforms/python/Makefile.am b/grc/data/platforms/python/Makefile.am
deleted file mode 100644
index 3b056b3f2..000000000
--- a/grc/data/platforms/python/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# 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.inc
-
-SUBDIRS = blocks
-
-ourdatadir = $(pkgdatadir)/$(grc_python_data_reldir)
-
-dist_ourdata_DATA = \
- block.dtd \
- block_tree.xml \
- default_flow_graph.grc \
- flow_graph.tmpl
diff --git a/grc/grc.conf.in b/grc/grc.conf.in
new file mode 100644
index 000000000..37a049971
--- /dev/null
+++ b/grc/grc.conf.in
@@ -0,0 +1,9 @@
+# This file contains system wide configuration data for GNU Radio.
+# You may override any setting on a per-user basis by editing
+# ~/.gnuradio/config.conf
+
+[grc]
+pythonw = @pythonw@
+doc_dir = @docdir@
+global_blocks_path = @blocksdir@
+local_blocks_path =
diff --git a/grc/src/Makefile.am b/grc/grc_gnuradio/Makefile.am
index a726d4935..9a15eb0ec 100644
--- a/grc/src/Makefile.am
+++ b/grc/grc_gnuradio/Makefile.am
@@ -19,14 +19,31 @@
# Boston, MA 02110-1301, USA.
#
-include $(top_srcdir)/grc/Makefile.inc
+include $(top_srcdir)/Makefile.common
-SUBDIRS = \
- platforms \
- grc_gnuradio \
- gui \
- utils
+grc_gnuradio_prefix = $(pythondir)/grc_gnuradio
-ourpythondir = $(grc_src_prefix)
+rootpythondir = $(grc_gnuradio_prefix)
+rootpython_PYTHON = __init__.py
-ourpython_PYTHON = __init__.py
+blks2pythondir = $(grc_gnuradio_prefix)/blks2
+blks2python_PYTHON = \
+ blks2/__init__.py \
+ blks2/error_rate.py \
+ blks2/packet.py \
+ blks2/probe.py \
+ blks2/selector.py \
+ blks2/tcp.py \
+ blks2/variable_sink.py
+
+usrppythondir = $(grc_gnuradio_prefix)/usrp
+usrppython_PYTHON = \
+ usrp/__init__.py \
+ usrp/common.py \
+ usrp/dual_usrp.py \
+ usrp/simple_usrp.py
+
+wxguipythondir = $(grc_gnuradio_prefix)/wxgui
+wxguipython_PYTHON = \
+ wxgui/__init__.py \
+ wxgui/top_block_gui.py
diff --git a/grc/grc_gnuradio/README b/grc/grc_gnuradio/README
new file mode 100644
index 000000000..5a89da54a
--- /dev/null
+++ b/grc/grc_gnuradio/README
@@ -0,0 +1,14 @@
+This is the grc_gnuradio module.
+It contains supplemental python modules that grc uses at runtime.
+The supplemental modules are meant to mimic modules in gnuradio.
+These will be phased-out as new functionaility is merged into gnuradio.
+
+The blk2s module wraps many blocks in blks2 and gives them streaming outputs.
+Will be phased-out by new message passing implementations.
+Other blks2 blocks will hopefully make their way into blks2impl.
+
+The usrp module contains the simple and dual usrp wrappers.
+Will be phased-out by generic usrp and/or new usrp api.
+
+The wxgui module contains a top_block + wxgui frame.
+Will be phased-out by gui.py in wxgui and a new top block template.
diff --git a/grc/src/__init__.py b/grc/grc_gnuradio/__init__.py
index 8b1378917..8b1378917 100644
--- a/grc/src/__init__.py
+++ b/grc/grc_gnuradio/__init__.py
diff --git a/grc/src/grc_gnuradio/blks2/__init__.py b/grc/grc_gnuradio/blks2/__init__.py
index cb1196f25..cb1196f25 100644
--- a/grc/src/grc_gnuradio/blks2/__init__.py
+++ b/grc/grc_gnuradio/blks2/__init__.py
diff --git a/grc/src/grc_gnuradio/blks2/error_rate.py b/grc/grc_gnuradio/blks2/error_rate.py
index 9b2df58ef..9b2df58ef 100644
--- a/grc/src/grc_gnuradio/blks2/error_rate.py
+++ b/grc/grc_gnuradio/blks2/error_rate.py
diff --git a/grc/src/grc_gnuradio/blks2/packet.py b/grc/grc_gnuradio/blks2/packet.py
index 50de99ac9..50de99ac9 100644
--- a/grc/src/grc_gnuradio/blks2/packet.py
+++ b/grc/grc_gnuradio/blks2/packet.py
diff --git a/grc/src/grc_gnuradio/blks2/probe.py b/grc/grc_gnuradio/blks2/probe.py
index 8db81f057..8db81f057 100644
--- a/grc/src/grc_gnuradio/blks2/probe.py
+++ b/grc/grc_gnuradio/blks2/probe.py
diff --git a/grc/src/grc_gnuradio/blks2/selector.py b/grc/grc_gnuradio/blks2/selector.py
index f0f6d5dd7..f0f6d5dd7 100644
--- a/grc/src/grc_gnuradio/blks2/selector.py
+++ b/grc/grc_gnuradio/blks2/selector.py
diff --git a/grc/src/grc_gnuradio/blks2/tcp.py b/grc/grc_gnuradio/blks2/tcp.py
index c6739b711..c6739b711 100644
--- a/grc/src/grc_gnuradio/blks2/tcp.py
+++ b/grc/grc_gnuradio/blks2/tcp.py
diff --git a/grc/src/grc_gnuradio/blks2/variable_sink.py b/grc/grc_gnuradio/blks2/variable_sink.py
index cad3b8b04..cad3b8b04 100644
--- a/grc/src/grc_gnuradio/blks2/variable_sink.py
+++ b/grc/grc_gnuradio/blks2/variable_sink.py
diff --git a/grc/src/grc_gnuradio/usrp/__init__.py b/grc/grc_gnuradio/usrp/__init__.py
index 1956bbd5b..1956bbd5b 100644
--- a/grc/src/grc_gnuradio/usrp/__init__.py
+++ b/grc/grc_gnuradio/usrp/__init__.py
diff --git a/grc/src/grc_gnuradio/usrp/common.py b/grc/grc_gnuradio/usrp/common.py
index 65c1e7e29..65c1e7e29 100644
--- a/grc/src/grc_gnuradio/usrp/common.py
+++ b/grc/grc_gnuradio/usrp/common.py
diff --git a/grc/src/grc_gnuradio/usrp/dual_usrp.py b/grc/grc_gnuradio/usrp/dual_usrp.py
index 1ecf7c47f..1ecf7c47f 100644
--- a/grc/src/grc_gnuradio/usrp/dual_usrp.py
+++ b/grc/grc_gnuradio/usrp/dual_usrp.py
diff --git a/grc/src/grc_gnuradio/usrp/simple_usrp.py b/grc/grc_gnuradio/usrp/simple_usrp.py
index 9065c7fe9..9065c7fe9 100644
--- a/grc/src/grc_gnuradio/usrp/simple_usrp.py
+++ b/grc/grc_gnuradio/usrp/simple_usrp.py
diff --git a/grc/src/grc_gnuradio/wxgui/__init__.py b/grc/grc_gnuradio/wxgui/__init__.py
index 94a0adb8a..94a0adb8a 100644
--- a/grc/src/grc_gnuradio/wxgui/__init__.py
+++ b/grc/grc_gnuradio/wxgui/__init__.py
diff --git a/grc/src/grc_gnuradio/wxgui/top_block_gui.py b/grc/grc_gnuradio/wxgui/top_block_gui.py
index f3305d7c5..97bed04a5 100644
--- a/grc/src/grc_gnuradio/wxgui/top_block_gui.py
+++ b/grc/grc_gnuradio/wxgui/top_block_gui.py
@@ -21,11 +21,10 @@
import wx
import sys, os
from gnuradio import gr
-from gnuradio.gr.pubsub import pubsub
default_gui_size = (200, 100)
-class top_block_gui(gr.top_block, pubsub):
+class top_block_gui(gr.top_block):
"""gr top block with wx gui app and grid sizer."""
def __init__(self, title='', size=default_gui_size, icon=None):
@@ -38,7 +37,6 @@ class top_block_gui(gr.top_block, pubsub):
"""
#initialize
gr.top_block.__init__(self)
- pubsub.__init__(self)
self._size = size
#set the icon
if icon and os.path.isfile(icon): self._icon = icon
@@ -74,7 +72,14 @@ class top_block_gui(gr.top_block, pubsub):
"""
self._wx_grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND)
- def Run(self):
+ def start(self, start=True):
+ if start:
+ gr.top_block.start(self)
+ else:
+ gr.top_block.stop(self)
+ gr.top_block.wait(self)
+
+ def Run(self, autostart=True):
"""
Setup the wx gui elements.
Start the gr top block.
@@ -95,6 +100,6 @@ class top_block_gui(gr.top_block, pubsub):
self._wx_frame.Show()
self._wx_app.SetTopWindow(self._wx_frame)
#start flow graph
- gr.top_block.start(self)
+ self.start(autostart)
#blocking main loop
self._wx_app.MainLoop()
diff --git a/grc/src/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 06e998b31..2c411a175 100644
--- a/grc/src/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -28,9 +28,9 @@ import gobject
import Preferences
from threading import Thread
import Messages
-from .. utils import ParseXML
+from .. base import ParseXML
import random
-from .. platforms.gui.Platform import Platform
+from Platform import Platform
from MainWindow import MainWindow
from ParamsDialog import ParamsDialog
import Dialogs
@@ -64,7 +64,7 @@ class ActionHandler:
self.get_focus_flag = self.main_window.get_focus_flag
#setup the messages
Messages.register_messenger(self.main_window.add_report_line)
- Messages.send_init()
+ Messages.send_init(platform)
#initialize
self.init_file_paths = file_paths
self.handle_states(Actions.APPLICATION_INITIALIZE)
@@ -133,6 +133,7 @@ class ActionHandler:
Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS,
Actions.FLOW_GRAPH_CLOSE, Actions.ABOUT_WINDOW_DISPLAY,
Actions.FLOW_GRAPH_SCREEN_CAPTURE, Actions.HELP_WINDOW_DISPLAY,
+ Actions.COLORS_WINDOW_DISPLAY,
): Actions.get_action_from_name(action).set_sensitive(True)
if not self.init_file_paths:
self.init_file_paths = Preferences.files_open()
@@ -233,9 +234,11 @@ class ActionHandler:
# Window stuff
##################################################
elif state == Actions.ABOUT_WINDOW_DISPLAY:
- Dialogs.AboutDialog()
+ Dialogs.AboutDialog(self.get_flow_graph().get_parent())
elif state == Actions.HELP_WINDOW_DISPLAY:
Dialogs.HelpDialog()
+ elif state == Actions.COLORS_WINDOW_DISPLAY:
+ Dialogs.ColorsDialog(self.get_flow_graph().get_parent())
##################################################
# Param Modifications
##################################################
diff --git a/grc/src/gui/Actions.py b/grc/gui/Actions.py
index 9b687df7e..3695e09ef 100644
--- a/grc/src/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -57,6 +57,7 @@ FLOW_GRAPH_KILL = 'flow graph kill'
FLOW_GRAPH_SCREEN_CAPTURE = 'flow graph screen capture'
ABOUT_WINDOW_DISPLAY = 'about window display'
HELP_WINDOW_DISPLAY = 'help window display'
+COLORS_WINDOW_DISPLAY = 'colors window display'
######################################################################################################
# Action Key Map
@@ -131,6 +132,7 @@ _actions_list = (
gtk.Action(BLOCK_PASTE, '_Paste', 'Paste', gtk.STOCK_PASTE),
gtk.Action(ABOUT_WINDOW_DISPLAY, '_About', 'About this program', gtk.STOCK_ABOUT),
gtk.Action(HELP_WINDOW_DISPLAY, '_Help', 'Usage Tips', gtk.STOCK_HELP),
+ gtk.Action(COLORS_WINDOW_DISPLAY, '_Colors', 'Color Mapping', gtk.STOCK_DIALOG_INFO),
gtk.Action(FLOW_GRAPH_GEN, '_Generate', 'Generate the flow graph', gtk.STOCK_CONVERT),
gtk.Action(FLOW_GRAPH_EXEC, '_Execute', 'Execute the flow graph', gtk.STOCK_EXECUTE),
gtk.Action(FLOW_GRAPH_KILL, '_Kill', 'Kill the flow graph', gtk.STOCK_STOP),
diff --git a/grc/src/gui/Bars.py b/grc/gui/Bars.py
index 52e7ba1f8..e0c547eba 100644
--- a/grc/src/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -88,6 +88,7 @@ MENU_BAR_LIST = (
]),
(gtk.Action('Help', '_Help', None, None), [
Actions.HELP_WINDOW_DISPLAY,
+ Actions.COLORS_WINDOW_DISPLAY,
None,
Actions.ABOUT_WINDOW_DISPLAY,
]),
diff --git a/grc/src/platforms/gui/Block.py b/grc/gui/Block.py
index 862a59393..0496f0a28 100644
--- a/grc/src/platforms/gui/Block.py
+++ b/grc/gui/Block.py
@@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
from Element import Element
import Utils
import Colors
-from ... utils import odict
+from .. base import odict
from Constants import BORDER_PROXIMITY_SENSITIVITY
from Constants import \
BLOCK_LABEL_PADDING, \
diff --git a/grc/src/gui/BlockTreeWindow.py b/grc/gui/BlockTreeWindow.py
index 99056252c..379c4a6a2 100644
--- a/grc/src/gui/BlockTreeWindow.py
+++ b/grc/gui/BlockTreeWindow.py
@@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from Constants import DEFAULT_BLOCKS_WINDOW_WIDTH, DND_TARGETS
-from .. platforms.gui import Utils
+import Utils
import pygtk
pygtk.require('2.0')
import gtk
diff --git a/grc/src/platforms/gui/Colors.py b/grc/gui/Colors.py
index f0b989b37..f0b989b37 100644
--- a/grc/src/platforms/gui/Colors.py
+++ b/grc/gui/Colors.py
diff --git a/grc/src/platforms/gui/Connection.py b/grc/gui/Connection.py
index 013bcb00f..013bcb00f 100644
--- a/grc/src/platforms/gui/Connection.py
+++ b/grc/gui/Connection.py
diff --git a/grc/src/platforms/gui/Constants.py b/grc/gui/Constants.py
index 90c8c1c38..7fabcfc0a 100644
--- a/grc/src/platforms/gui/Constants.py
+++ b/grc/gui/Constants.py
@@ -17,28 +17,67 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
+import pygtk
+pygtk.require('2.0')
+import gtk
+import os
+
+##default path for the open/save dialogs
+DEFAULT_FILE_PATH = os.getcwd()
+
+##file extensions
+IMAGE_FILE_EXTENSION = '.png'
+
+##name for new/unsaved flow graphs
+NEW_FLOGRAPH_TITLE = 'untitled'
+
+##main window constraints
+MIN_WINDOW_WIDTH = 600
+MIN_WINDOW_HEIGHT = 400
+##dialog constraints
+MIN_DIALOG_WIDTH = 500
+MIN_DIALOG_HEIGHT = 500
+##default sizes
+DEFAULT_BLOCKS_WINDOW_WIDTH = 100
+DEFAULT_REPORTS_WINDOW_WIDTH = 100
+
+##The size of the state saving cache in the flow graph (for undo/redo functionality)
+STATE_CACHE_SIZE = 42
+
+##Shared targets for drag and drop of blocks
+DND_TARGETS = [('STRING', gtk.TARGET_SAME_APP, 0)]
+
#label constraint dimensions
LABEL_SEPARATION = 3
BLOCK_LABEL_PADDING = 7
PORT_LABEL_PADDING = 2
+
#port constraint dimensions
PORT_SEPARATION = 17
PORT_BORDER_SEPARATION = 9
PORT_MIN_WIDTH = 20
+
#minimal length of connector
CONNECTOR_EXTENSION_MINIMAL = 11
+
#increment length for connector
CONNECTOR_EXTENSION_INCREMENT = 11
+
#connection arrow dimensions
CONNECTOR_ARROW_BASE = 13
CONNECTOR_ARROW_HEIGHT = 17
+
#possible rotations in degrees
POSSIBLE_ROTATIONS = (0, 90, 180, 270)
+
#How close can the mouse get to the window border before mouse events are ignored.
BORDER_PROXIMITY_SENSITIVITY = 50
+
#How close the mouse can get to the edge of the visible window before scrolling is invoked.
SCROLL_PROXIMITY_SENSITIVITY = 30
+
#When the window has to be scrolled, move it this distance in the required direction.
SCROLL_DISTANCE = 15
+
#How close the mouse click can be to a line and register a connection select.
LINE_SELECT_SENSITIVITY = 5
diff --git a/grc/src/gui/Dialogs.py b/grc/gui/Dialogs.py
index d526b97b4..8d764e28e 100644
--- a/grc/src/gui/Dialogs.py
+++ b/grc/gui/Dialogs.py
@@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import pygtk
pygtk.require('2.0')
import gtk
-from .. platforms.base.Constants import PACKAGE, VERSION
import Preferences
+import Utils
class TextDisplay(gtk.TextView):
"""A non editable gtk text view."""
@@ -51,8 +51,8 @@ def MessageDialogHelper(type, buttons, title=None, markup=None):
@return the gtk response from run()
"""
message_dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, type, buttons)
- if title != None: message_dialog.set_title(title)
- if markup != None: message_dialog.set_markup(markup)
+ if title: message_dialog.set_title(title)
+ if markup: message_dialog.set_markup(markup)
response = message_dialog.run()
message_dialog.destroy()
return response
@@ -60,34 +60,22 @@ def MessageDialogHelper(type, buttons, title=None, markup=None):
class AboutDialog(gtk.AboutDialog):
"""A cute little about dialog."""
- def __init__(self):
+ def __init__(self, platform):
"""AboutDialog constructor."""
gtk.AboutDialog.__init__(self)
- self.set_name(PACKAGE)
- self.set_version(VERSION)
- self.set_license(__doc__)
- self.set_copyright(__doc__.strip().splitlines()[0])
- self.set_website('http://gnuradio.org/trac/wiki/GNURadioCompanion')
- self.set_comments("""\
-Thank you to all those from the mailing list who tested GNU Radio Companion and offered advice.
------
-Special Thanks:
-A. Brinton Cooper -> starting the project
-Patrick Mulligan -> starting the project
-CER Technology Fellowship Grant -> initial funding
-William R. Kenan Jr. Fund -> usrp & computers
-Patrick Strasser -> the GRC icon
-Achilleas Anastasopoulos -> trellis support
------""")
+ self.set_name(platform.get_name())
+ self.set_version(platform.get_version())
+ self.set_license(platform.get_license())
+ self.set_copyright(platform.get_license().splitlines()[0])
+ self.set_website(platform.get_website())
self.run()
self.destroy()
-def HelpDialog():
- MessageDialogHelper(
- type=gtk.MESSAGE_INFO,
- buttons=gtk.BUTTONS_CLOSE,
- title='Help',
- markup="""\
+def HelpDialog(): MessageDialogHelper(
+ type=gtk.MESSAGE_INFO,
+ buttons=gtk.BUTTONS_CLOSE,
+ title='Help',
+ markup="""\
<b>Usage Tips</b>
<u>Add block</u>: drag and drop or double click a block in the block selection window.
@@ -98,3 +86,20 @@ def HelpDialog():
<u>Remove connection</u>: select the connection and press delete, or drag the connection.
* See the menu for other keyboard shortcuts.""")
+
+COLORS_DIALOG_MARKUP_TMPL = """\
+<b>Color Mapping</b>
+
+#if $colors
+ #set $max_len = max([len(color[0]) for color in $colors]) + 10
+ #for $title, $color_spec in $colors
+<span background="$color_spec"><tt>$($encode($title).center($max_len))</tt></span>
+ #end for
+#end if
+"""
+
+def ColorsDialog(platform): MessageDialogHelper(
+ type=gtk.MESSAGE_INFO,
+ buttons=gtk.BUTTONS_CLOSE,
+ title='Colors',
+ markup=Utils.parse_template(COLORS_DIALOG_MARKUP_TMPL, colors=platform.get_colors()))
diff --git a/grc/src/gui/DrawingArea.py b/grc/gui/DrawingArea.py
index 6f90049c5..6f90049c5 100644
--- a/grc/src/gui/DrawingArea.py
+++ b/grc/gui/DrawingArea.py
diff --git a/grc/src/platforms/gui/Element.py b/grc/gui/Element.py
index 315191723..315191723 100644
--- a/grc/src/platforms/gui/Element.py
+++ b/grc/gui/Element.py
diff --git a/grc/src/gui/FileDialogs.py b/grc/gui/FileDialogs.py
index 7c10d9844..3b210c33f 100644
--- a/grc/src/gui/FileDialogs.py
+++ b/grc/gui/FileDialogs.py
@@ -26,17 +26,29 @@ from Constants import \
NEW_FLOGRAPH_TITLE
import Preferences
from os import path
+import Utils
+##################################################
+# Constants
+##################################################
OPEN_FLOW_GRAPH = 'open flow graph'
SAVE_FLOW_GRAPH = 'save flow graph'
SAVE_IMAGE = 'save image'
+FILE_OVERWRITE_MARKUP_TMPL="""\
+File <b>$encode($filename)</b> Exists!\nWould you like to overwrite the existing file?"""
+
+FILE_DNE_MARKUP_TMPL="""\
+File <b>$encode($filename)</b> Does not Exist!"""
+
+##################################################
+# File Filters
+##################################################
##the filter for flow graph files
def get_flow_graph_files_filter():
filter = gtk.FileFilter()
filter.set_name('Flow Graph Files')
filter.add_pattern('*'+Preferences.file_extension())
- filter.add_pattern('*.xml') #TEMP
return filter
##the filter for image files
@@ -53,6 +65,9 @@ def get_all_files_filter():
filter.add_pattern('*')
return filter
+##################################################
+# File Dialogs
+##################################################
class FileDialogHelper(gtk.FileChooserDialog):
"""
A wrapper class for the gtk file chooser dialog.
@@ -129,7 +144,7 @@ class FileDialog(FileDialogHelper):
if path.exists(filename): #ask the user to confirm overwrite
if MessageDialogHelper(
gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, 'Confirm Overwrite!',
- 'File <b>"%s"</b> Exists!\nWould you like to overwrite the existing file?'%filename,
+ Utils.parse_template(FILE_OVERWRITE_MARKUP_TMPL, filename=filename),
) == gtk.RESPONSE_NO: return self.get_rectified_filename()
return filename
#############################################
@@ -141,7 +156,7 @@ class FileDialog(FileDialogHelper):
if not path.exists(filename): #show a warning and re-run
MessageDialogHelper(
gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, 'Cannot Open!',
- 'File <b>"%s"</b> Does not Exist!'%filename,
+ Utils.parse_template(FILE_DNE_MARKUP_TMPL, filename=filename),
)
return self.get_rectified_filename()
return filenames
diff --git a/grc/src/platforms/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index 40f391811..26544faab 100644
--- a/grc/src/platforms/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from Constants import SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE
-from ... gui.Actions import \
+from Actions import \
ELEMENT_CREATE, ELEMENT_SELECT, \
BLOCK_PARAM_MODIFY, BLOCK_MOVE, \
ELEMENT_DELETE
@@ -30,7 +30,7 @@ import pygtk
pygtk.require('2.0')
import gtk
import random
-from ... gui import Messages
+import Messages
class FlowGraph(Element):
"""
@@ -289,6 +289,7 @@ class FlowGraph(Element):
"""
Call update on all elements.
"""
+ self.validate()
for element in self.get_elements(): element.update()
##########################################################################
diff --git a/grc/src/gui/MainWindow.py b/grc/gui/MainWindow.py
index bd5f73a80..6d36f4cf7 100644
--- a/grc/src/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -31,8 +31,35 @@ from Dialogs import TextDisplay, MessageDialogHelper
from NotebookPage import NotebookPage
import Preferences
import Messages
+import Utils
import os
+MAIN_WINDOW_TITLE_TMPL = """\
+#if not $saved
+*#slurp
+#end if
+#if $basename
+$basename#slurp
+#else
+$new_flowgraph_title#slurp
+#end if
+#if $read_only
+ (read only)#slurp
+#end if
+#if $dirname
+ - $dirname#slurp
+#end if
+ - $platform_name#slurp
+"""
+
+PAGE_TITLE_MARKUP_TMPL = """\
+#set $foreground = $saved and 'black' or 'red'
+<span foreground="$foreground">$encode($title or $new_flowgraph_title)</span>#slurp
+#if $read_only
+ (ro)#slurp
+#end if
+"""
+
############################################################
# Main window
############################################################
@@ -218,26 +245,24 @@ class MainWindow(gtk.Window):
Show/hide the reports window.
@param title the window title
"""
- title = ''.join((
- self._platform.get_name(),
- ' - Editing: ',
- (self.get_page().get_file_path() or NEW_FLOGRAPH_TITLE),
- (self.get_page().get_saved() and ' ' or '*'), #blank must be non empty
- (self.get_page().get_read_only() and ' (read-only)' or ''),
+ gtk.Window.set_title(self, Utils.parse_template(MAIN_WINDOW_TITLE_TMPL,
+ basename=os.path.basename(self.get_page().get_file_path()),
+ dirname=os.path.dirname(self.get_page().get_file_path()),
+ new_flowgraph_title=NEW_FLOGRAPH_TITLE,
+ read_only=self.get_page().get_read_only(),
+ saved=self.get_page().get_saved(),
+ platform_name=self._platform.get_name(),
)
)
- gtk.Window.set_title(self, title)
#set tab titles
- for page in self._get_pages():
- #get filename and strip out file extension
- title = os.path.splitext(os.path.basename(page.get_file_path()))[0]
- page.set_text(''.join((
- (title or NEW_FLOGRAPH_TITLE),
- (page.get_saved() and ' ' or '*'), #blank must be non empty
- (page.get_read_only() and ' (ro)' or ''),
- )
- )
+ for page in self._get_pages(): page.set_markup(
+ Utils.parse_template(PAGE_TITLE_MARKUP_TMPL,
+ #get filename and strip out file extension
+ title=os.path.splitext(os.path.basename(page.get_file_path()))[0],
+ read_only=page.get_read_only(), saved=page.get_saved(),
+ new_flowgraph_title=NEW_FLOGRAPH_TITLE,
)
+ )
#show/hide notebook tabs
self.notebook.set_show_tabs(len(self._get_pages()) > 1)
diff --git a/grc/src/gui/Makefile.am b/grc/gui/Makefile.am
index a6639af44..c31bc5f61 100644
--- a/grc/src/gui/Makefile.am
+++ b/grc/gui/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,8 +22,17 @@
include $(top_srcdir)/grc/Makefile.inc
ourpythondir = $(grc_src_prefix)/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 \
diff --git a/grc/src/gui/Messages.py b/grc/gui/Messages.py
index e8939402d..80057e0ba 100644
--- a/grc/src/gui/Messages.py
+++ b/grc/gui/Messages.py
@@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from .. platforms.base.Constants import PACKAGE, VERSION
import traceback
import sys
@@ -44,8 +43,8 @@ register_messenger(sys.stdout.write)
###########################################################################
# Special functions for specific program functionalities
###########################################################################
-def send_init():
- send("""<<< Welcome to %s %s >>>\n"""%(PACKAGE, VERSION))
+def send_init(platform):
+ send("""<<< Welcome to %s %s >>>\n"""%(platform.get_name(), platform.get_version()))
def send_page_switch(file_path):
send('\nShowing: "%s"\n'%file_path)
diff --git a/grc/src/gui/NotebookPage.py b/grc/gui/NotebookPage.py
index a3ec5b4e2..cb6b7ed30 100644
--- a/grc/src/gui/NotebookPage.py
+++ b/grc/gui/NotebookPage.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -21,9 +21,7 @@ from Actions import FLOW_GRAPH_CLOSE
import pygtk
pygtk.require('2.0')
import gtk
-from .. utils import ParseXML
from StateCache import StateCache
-from .. platforms.base.Constants import FLOW_GRAPH_DTD
from Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT
from DrawingArea import DrawingArea
import os
@@ -46,14 +44,7 @@ class NotebookPage(gtk.HBox):
#import the file
self.main_window = main_window
self.set_file_path(file_path)
- file_path = file_path or flow_graph.get_parent().get_default_flow_graph()
- open(file_path, 'r') #test open
- ############################################################
- from .. utils import converter
- converter.convert(file_path, flow_graph.get_parent())
- ############################################################
- ParseXML.validate_dtd(file_path, FLOW_GRAPH_DTD)
- initial_state = ParseXML.from_file(file_path)
+ initial_state = flow_graph.get_parent().parse_flow_graph(file_path)
self.state_cache = StateCache(initial_state)
self.set_saved(True)
#import the data to the flow graph
@@ -115,12 +106,12 @@ class NotebookPage(gtk.HBox):
self.main_window.page_to_be_closed = self
self.main_window.handle_states(FLOW_GRAPH_CLOSE)
- def set_text(self, text):
+ def set_markup(self, markup):
"""
- Set the text in this label.
- @param text the new text
+ Set the markup in this label.
+ @param markup the new markup text
"""
- self.label.set_text(text)
+ self.label.set_markup(markup)
def get_tab(self):
"""
diff --git a/grc/src/platforms/gui/Param.py b/grc/gui/Param.py
index 33a9b1f52..3029569b4 100644
--- a/grc/src/platforms/gui/Param.py
+++ b/grc/gui/Param.py
@@ -37,7 +37,7 @@ TIP_MARKUP_TMPL="""\
Key: $param.get_key()
Type: $param.get_type()
#if $param.is_valid()
-Value: $param.evaluate()
+Value: $param.get_evaluated()
#elif len($param.get_error_messages()) == 1
Error: $(param.get_error_messages()[0])
#else
@@ -75,6 +75,7 @@ class Param(Element):
Finish by calling the exteral callback.
"""
self.set_value(self._input.get_text())
+ self.validate()
#is param is involved in a callback? #FIXME: messy
has_cb = \
hasattr(self.get_parent(), 'get_callbacks') and \
diff --git a/grc/src/gui/ParamsDialog.py b/grc/gui/ParamsDialog.py
index 6cc42e8fc..ccf19d1a2 100644
--- a/grc/src/gui/ParamsDialog.py
+++ b/grc/gui/ParamsDialog.py
@@ -91,6 +91,7 @@ class ParamsDialog(gtk.Dialog):
Update the documentation block.
Hide the box if there are no docs.
"""
+ self.block.validate()
#update the errors box
if self.block.is_valid(): self._error_box.hide()
else: self._error_box.show()
diff --git a/grc/src/platforms/gui/Platform.py b/grc/gui/Platform.py
index a32b0209f..a32b0209f 100644
--- a/grc/src/platforms/gui/Platform.py
+++ b/grc/gui/Platform.py
diff --git a/grc/src/platforms/gui/Port.py b/grc/gui/Port.py
index d1f36f8b9..d1f36f8b9 100644
--- a/grc/src/platforms/gui/Port.py
+++ b/grc/gui/Port.py
diff --git a/grc/src/gui/Preferences.py b/grc/gui/Preferences.py
index 1d89920dd..1d89920dd 100644
--- a/grc/src/gui/Preferences.py
+++ b/grc/gui/Preferences.py
diff --git a/grc/src/gui/StateCache.py b/grc/gui/StateCache.py
index 04b18b18a..04b18b18a 100644
--- a/grc/src/gui/StateCache.py
+++ b/grc/gui/StateCache.py
diff --git a/grc/src/platforms/gui/Utils.py b/grc/gui/Utils.py
index ee6dc6cdc..ee6dc6cdc 100644
--- a/grc/src/platforms/gui/Utils.py
+++ b/grc/gui/Utils.py
diff --git a/grc/src/grc_gnuradio/__init__.py b/grc/gui/__init__.py
index 8b1378917..8b1378917 100644
--- a/grc/src/grc_gnuradio/__init__.py
+++ b/grc/gui/__init__.py
diff --git a/grc/src/platforms/python/Block.py b/grc/python/Block.py
index 341e5fdc3..a9e999491 100644
--- a/grc/src/platforms/python/Block.py
+++ b/grc/python/Block.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from .. base.Block import Block as _Block
-from utils import extract_docs
+import extract_docs
class Block(_Block):
@@ -35,22 +35,18 @@ class Block(_Block):
@return block a new block
"""
#grab the data
- doc = n.find('doc') or ''
- imports = map(lambda i: i.strip(), n.findall('import'))
- make = n.find('make')
- checks = n.findall('check')
- callbacks = n.findall('callback')
+ self._doc = n.find('doc') or ''
+ self._imports = map(lambda i: i.strip(), n.findall('import'))
+ self._make = n.find('make')
+ self._var_make = n.find('var_make')
+ self._checks = n.findall('check')
+ self._callbacks = n.findall('callback')
#build the block
_Block.__init__(
self,
flow_graph=flow_graph,
n=n,
)
- self._doc = doc
- self._imports = imports
- self._make = make
- self._callbacks = callbacks
- self._checks = checks
def validate(self):
"""
@@ -66,8 +62,8 @@ class Block(_Block):
try:
check_eval = self.get_parent().evaluate(check_res)
try: assert check_eval
- except AssertionError: self._add_error_message('Check "%s" failed.'%check)
- except: self._add_error_message('Check "%s" did not evaluate.'%check)
+ except AssertionError: self.add_error_message('Check "%s" failed.'%check)
+ except: self.add_error_message('Check "%s" did not evaluate.'%check)
#adjust nports
for ports, Port in (
(self._sources, self.get_parent().get_parent().Source),
@@ -119,7 +115,7 @@ class Block(_Block):
if param.is_enum() or param.get_key() not in nports_str: continue
#try to increment the port controller by direction
try:
- value = param.evaluate()
+ value = param.get_evaluated()
value = value + direction
assert 0 < value
param.set_value(value)
@@ -143,10 +139,15 @@ class Block(_Block):
return filter(lambda i: i, sum(map(lambda i: self.resolve_dependencies(i).split('\n'), self._imports), []))
def get_make(self): return self.resolve_dependencies(self._make)
+ def get_var_make(self): return self.resolve_dependencies(self._var_make)
def get_callbacks(self):
"""
Get a list of function callbacks for this block.
@return a list of strings
"""
- return map(lambda c: self.get_id() + '.' + self.resolve_dependencies(c), self._callbacks)
+ def make_callback(callback):
+ callback = self.resolve_dependencies(callback)
+ if callback.startswith('self.'): return callback
+ return 'self.%s.%s'%(self.get_id(), callback)
+ return map(make_callback, self._callbacks)
diff --git a/grc/src/platforms/python/Connection.py b/grc/python/Connection.py
index f742ff63d..d8a894bb1 100644
--- a/grc/src/platforms/python/Connection.py
+++ b/grc/python/Connection.py
@@ -30,5 +30,5 @@ class Connection(_Connection):
#check vector length
source_vlen = self.get_source().get_vlen()
sink_vlen = self.get_sink().get_vlen()
- try: assert(source_vlen == sink_vlen)
- except AssertionError: self._add_error_message('Source vector length "%s" does not match sink vector length "%s".'%(source_vlen, sink_vlen))
+ try: assert source_vlen == sink_vlen
+ except AssertionError: self.add_error_message('Source vector length "%s" does not match sink vector length "%s".'%(source_vlen, sink_vlen))
diff --git a/grc/src/platforms/python/Constants.py.in b/grc/python/Constants.py
index 4a43147fa..5f203237f 100644
--- a/grc/src/platforms/python/Constants.py.in
+++ b/grc/python/Constants.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -20,24 +20,32 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import os
import sys
import stat
-from .. base.Constants import PKG_DIR
+from gnuradio import gr
-PYEXEC = '@PYTHONW@'
+_gr_prefs = gr.prefs()
+
+PYEXEC = os.environ.get('PYTHONW', _gr_prefs.get_string('grc', 'pythonw', ''))
#setup paths
-DOCS_DIR = os.path.join(os.environ.get('GR_DOCDIR', '@docdir@'), 'xml')
-DATA_DIR = os.path.join(PKG_DIR, '@reldatadir@')
-BLOCKS_DIR = os.path.join(PKG_DIR, '@relblocksdir@')
+PATH_SEP = ':'
+DOCS_DIR = os.environ.get('GR_DOC_DIR', _gr_prefs.get_string('grc', 'doc_dir', ''))
HIER_BLOCKS_LIB_DIR = os.path.join(os.path.expanduser('~'), '.grc_gnuradio')
+BLOCKS_DIRS = filter( #filter blank strings
+ lambda x: x, PATH_SEP.join([
+ os.environ.get('GRC_BLOCKS_PATH', ''),
+ _gr_prefs.get_string('grc', 'local_blocks_path', ''),
+ _gr_prefs.get_string('grc', 'global_blocks_path', ''),
+ ]).split(PATH_SEP),
+) + [HIER_BLOCKS_LIB_DIR]
#file creation modes
TOP_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH
HIER_BLOCK_FILE_MODE = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH
#data files
+DATA_DIR = os.path.dirname(__file__)
FLOW_GRAPH_TEMPLATE = os.path.join(DATA_DIR, 'flow_graph.tmpl')
BLOCK_DTD = os.path.join(DATA_DIR, 'block.dtd')
-BLOCK_TREE = os.path.join(DATA_DIR, 'block_tree.xml')
DEFAULT_FLOW_GRAPH = os.path.join(DATA_DIR, 'default_flow_graph.grc')
#coloring
@@ -52,3 +60,4 @@ INT_VECTOR_COLOR_SPEC = '#00CC99'
SHORT_VECTOR_COLOR_SPEC = '#CCCC33'
BYTE_VECTOR_COLOR_SPEC = '#CC66CC'
ID_COLOR_SPEC = '#DDDDDD'
+WILDCARD_COLOR_SPEC = '#FFFFFF'
diff --git a/grc/src/platforms/python/FlowGraph.py b/grc/python/FlowGraph.py
index d0b997a58..47089a305 100644
--- a/grc/src/platforms/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -17,33 +17,27 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from utils import expr_utils
+import expr_utils
from .. base.FlowGraph import FlowGraph as _FlowGraph
from Block import Block
from Connection import Connection
+import re
-def _get_value_expr(variable_block):
- """
- Get the expression to evaluate from the value param.
- Parameter blocks need to be evaluated so the stringify flag can be determined.
- @param variable_block the variable or parameter block
- @return the expression string
- """
- value_param = variable_block.get_param('value')
- if variable_block.get_key() == 'parameter': value_param.evaluate()
- return value_param.to_code()
+_variable_matcher = re.compile('^(variable\w*)$')
+_parameter_matcher = re.compile('^(parameter)$')
class FlowGraph(_FlowGraph):
_eval_cache = dict()
- def _eval(self, code, namespace):
+ def _eval(self, code, namespace, namespace_hash):
"""
Evaluate the code with the given namespace.
@param code a string with python code
@param namespace a dict representing the namespace
+ @param namespace_hash a unique hash for the namespace
@return the resultant object
"""
- my_hash = hash(code + str(namespace))
+ my_hash = hash(code) ^ namespace_hash
#cache if does not exist
if not self._eval_cache.has_key(my_hash):
self._eval_cache[my_hash] = eval(code, namespace, namespace)
@@ -67,9 +61,9 @@ class FlowGraph(_FlowGraph):
pad = pads[0] #take only the first, user should not have more than 1
#load io signature
return {
- 'nports': str(pad.get_param('nports').evaluate()),
- 'type': str(pad.get_param('type').evaluate()),
- 'vlen': str(pad.get_param('vlen').evaluate()),
+ 'nports': str(pad.get_param('nports').get_evaluated()),
+ 'type': str(pad.get_param('type').get_evaluated()),
+ 'vlen': str(pad.get_param('vlen').get_evaluated()),
'size': pad.get_param('type').get_opt('size'),
}
@@ -104,14 +98,12 @@ class FlowGraph(_FlowGraph):
Exclude paramterized variables.
@return a sorted list of variable blocks in order of dependency (indep -> dep)
"""
- variables = filter(lambda b: b.get_key() in (
- 'variable', 'variable_slider', 'variable_chooser', 'variable_text_box'
- ), self.get_enabled_blocks())
+ variables = filter(lambda b: _variable_matcher.match(b.get_key()), self.get_enabled_blocks())
#map var id to variable block
id2var = dict([(var.get_id(), var) for var in variables])
#map var id to variable code
#variable code is a concatenation of all param code (without the id param)
- id2expr = dict([(var.get_id(), var.get_param('value').get_value()) for var in variables])
+ id2expr = dict([(var.get_id(), var.get_var_make()) for var in variables])
#sort according to dependency
sorted_ids = expr_utils.sort_variables(id2expr)
#create list of sorted variable blocks
@@ -123,7 +115,7 @@ class FlowGraph(_FlowGraph):
Get a list of all paramterized variables in this flow graph namespace.
@return a list of paramterized variables
"""
- parameters = filter(lambda b: b.get_key() == 'parameter', self.get_enabled_blocks())
+ parameters = filter(lambda b: _parameter_matcher.match(b.get_key()), self.get_enabled_blocks())
return parameters
def evaluate(self, expr):
@@ -145,18 +137,19 @@ class FlowGraph(_FlowGraph):
np = dict()
for parameter in self.get_parameters():
try:
- e = self._eval(_get_value_expr(parameter), n)
+ e = eval(parameter.get_param('value').to_code(), n, n)
np[parameter.get_id()] = e
except: pass
n.update(np) #merge param namespace
#load variables
for variable in self.get_variables():
try:
- e = self._eval(_get_value_expr(variable), n)
+ e = eval(variable.get_param('value').to_code(), n, n)
n[variable.get_id()] = e
except: pass
#make namespace public
self.n = n
+ self.n_hash = hash(str(n))
#evaluate
- e = self._eval(expr, self.n)
+ e = self._eval(expr, self.n, self.n_hash)
return e
diff --git a/grc/src/platforms/python/Generator.py b/grc/python/Generator.py
index 93321404a..cde7dc3d4 100644
--- a/grc/src/platforms/python/Generator.py
+++ b/grc/python/Generator.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -20,13 +20,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import os
import subprocess
from Cheetah.Template import Template
-from utils import expr_utils
+import expr_utils
from Constants import \
TOP_BLOCK_FILE_MODE, HIER_BLOCK_FILE_MODE, \
HIER_BLOCKS_LIB_DIR, PYEXEC, \
FLOW_GRAPH_TEMPLATE
-from utils import convert_hier
-from ... gui import Messages
+import convert_hier
+from .. gui import Messages
class Generator(object):
@@ -81,11 +81,12 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
Convert the flow graph to python code.
@return a string of python code
"""
+ title = self._flow_graph.get_option('title') or self._flow_graph.get_option('id').replace('_', ' ').title()
imports = self._flow_graph.get_imports()
variables = self._flow_graph.get_variables()
parameters = self._flow_graph.get_parameters()
#list of variables with controls
- controls = filter(lambda v: v.get_key().startswith('variable_'), variables)
+ controls = filter(lambda v: v.get_make(), variables)
#list of blocks not including variables and imports and parameters and disabled
blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id()))
probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list
@@ -94,37 +95,21 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
connections = self._flow_graph.get_enabled_connections()
#list of variable names
var_ids = [var.get_id() for var in parameters + variables]
- #list of callbacks (prepend self.)
+ #prepend self.
+ replace_dict = dict([(var_id, 'self.%s'%var_id) for var_id in var_ids])
+ #list of callbacks
callbacks = [
- expr_utils.expr_prepend(cb, var_ids, 'self.')
+ expr_utils.expr_replace(cb, replace_dict)
for cb in sum([block.get_callbacks() for block in self._flow_graph.get_enabled_blocks()], [])
]
- #map var id to the expression (prepend self.)
- var_id2expr = dict(
- [(var.get_id(), expr_utils.expr_prepend(var.get_make().split('\n')[0], var_ids, 'self.'))
- for var in parameters + variables]
- )
- #create graph structure for variables
- variable_graph = expr_utils.get_graph(var_id2expr)
- #map var id to direct dependents
- #for each var id, make a list of all 2nd order edges
- #use all edges of that id that are not also 2nd order edges
- #meaning: list variables the ONLY depend directly on this variable
- #and not variables that also depend indirectly on this variable
- var_id2deps = dict(
- [(var_id, filter(lambda e: e not in sum([list(variable_graph.get_edges(edge))
- for edge in variable_graph.get_edges(var_id)], []), variable_graph.get_edges(var_id)
- )
- )
- for var_id in var_ids]
- )
#map var id to callbacks
var_id2cbs = dict(
- [(var_id, filter(lambda c: var_id in expr_utils.expr_split(c), callbacks))
+ [(var_id, filter(lambda c: expr_utils.get_variable_dependencies(c, [var_id]), callbacks))
for var_id in var_ids]
)
#load the namespace
namespace = {
+ 'title': title,
'imports': imports,
'flow_graph': self._flow_graph,
'variables': variables,
@@ -133,8 +118,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
'blocks': blocks,
'connections': connections,
'generate_options': self._generate_options,
- 'var_id2expr': var_id2expr,
- 'var_id2deps': var_id2deps,
'var_id2cbs': var_id2cbs,
}
#build the template
diff --git a/grc/src/platforms/python/utils/Makefile.am b/grc/python/Makefile.am
index b12e51d8e..e6d253f5c 100644
--- a/grc/src/platforms/python/utils/Makefile.am
+++ b/grc/python/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,10 +21,23 @@
include $(top_srcdir)/grc/Makefile.inc
-ourpythondir = $(grc_src_prefix)/platforms/python/utils
-
+ourpythondir = $(grc_src_prefix)/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 = $(grc_src_prefix)/python
+dist_ourdata_DATA = \
+ block.dtd \
+ default_flow_graph.grc \
+ flow_graph.tmpl
diff --git a/grc/src/platforms/python/Param.py b/grc/python/Param.py
index e5ac1dcf6..8b5efc97f 100644
--- a/grc/src/platforms/python/Param.py
+++ b/grc/python/Param.py
@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from utils import expr_utils
+import expr_utils
from .. base.Param import Param as _Param, EntryParam
import Constants
import numpy
@@ -26,6 +26,11 @@ import pygtk
pygtk.require('2.0')
import gtk
from gnuradio import eng_notation
+import re
+from gnuradio import gr
+
+_check_id_matcher = re.compile('^[a-z|A-Z]\w*$')
+_show_id_matcher = re.compile('^(variable\w*|parameter|options)$')
class FileParam(EntryParam):
"""Provide an entry box for filename and a button to browse for a file."""
@@ -42,7 +47,7 @@ class FileParam(EntryParam):
Replace the text in the entry with the new filename from the file dialog.
"""
#get the paths
- file_path = self.param.is_valid() and self.param.evaluate() or ''
+ file_path = self.param.is_valid() and self.param.get_evaluated() or ''
(dirname, basename) = os.path.isfile(file_path) and os.path.split(file_path) or (file_path, '')
if not os.path.exists(dirname): dirname = os.getcwd() #fix bad paths
#build the dialog
@@ -65,7 +70,8 @@ class FileParam(EntryParam):
#blacklist certain ids, its not complete, but should help
import __builtin__
-ID_BLACKLIST = ['options', 'gr', 'blks2', 'wxgui', 'wx', 'math', 'forms', 'firdes'] + dir(__builtin__)
+ID_BLACKLIST = ['self', 'options', 'gr', 'blks2', 'wxgui', 'wx', 'math', 'forms', 'firdes'] + \
+ filter(lambda x: not x.startswith('_'), dir(gr.top_block())) + dir(__builtin__)
#define types, native python + numpy
VECTOR_TYPES = (tuple, list, set, numpy.ndarray)
COMPLEX_TYPES = [complex, numpy.complex, numpy.complex64, numpy.complex128]
@@ -86,7 +92,7 @@ class Param(_Param):
TYPES = _Param.TYPES + [
'complex', 'real', 'int',
'complex_vector', 'real_vector', 'int_vector',
- 'hex', 'string',
+ 'hex', 'string', 'bool',
'file_open', 'file_save',
'id',
'grid_pos', 'import',
@@ -115,9 +121,10 @@ class Param(_Param):
##################################################
truncate = 0 #default center truncate
max_len = max(27 - len(self.get_name()), 3)
- e = self.evaluate()
+ e = self.get_evaluated()
t = self.get_type()
- if isinstance(e, COMPLEX_TYPES): dt_str = num_to_str(e)
+ if isinstance(e, bool): return str(e)
+ elif isinstance(e, COMPLEX_TYPES): dt_str = num_to_str(e)
elif isinstance(e, VECTOR_TYPES): #vector types
if len(e) > 8:
dt_str = self.get_value() #large vectors use code
@@ -159,10 +166,12 @@ class Param(_Param):
'real_vector': Constants.FLOAT_VECTOR_COLOR_SPEC,
'int_vector': Constants.INT_VECTOR_COLOR_SPEC,
#special
+ 'bool': Constants.INT_COLOR_SPEC,
'hex': Constants.INT_COLOR_SPEC,
'string': Constants.BYTE_VECTOR_COLOR_SPEC,
'id': Constants.ID_COLOR_SPEC,
'grid_pos': Constants.INT_VECTOR_COLOR_SPEC,
+ 'raw': Constants.WILDCARD_COLOR_SPEC,
}[self.get_type()]
except: return _Param.get_color(self)
@@ -178,9 +187,7 @@ class Param(_Param):
hide = _Param.get_hide(self)
if hide: return hide
#hide ID in non variable blocks
- if self.get_key() == 'id' and self.get_parent().get_key() not in (
- 'variable', 'variable_slider', 'variable_chooser', 'variable_text_box', 'parameter', 'options'
- ): return 'part'
+ if self.get_key() == 'id' and not _show_id_matcher.match(self.get_parent().get_key()): return 'part'
#hide port controllers for type and nports
if self.get_key() in ' '.join(map(
lambda p: ' '.join([p._type, p._nports]), self.get_parent().get_ports())
@@ -190,18 +197,31 @@ class Param(_Param):
lambda p: p._vlen, self.get_parent().get_ports())
):
try:
- assert int(self.evaluate()) == 1
+ assert int(self.get_evaluated()) == 1
return 'part'
except: pass
#hide empty grid positions
if self.get_key() == 'grid_pos' and not self.get_value(): return 'part'
return hide
+ def validate(self):
+ """
+ Validate the param.
+ A test evaluation is performed
+ """
+ _Param.validate(self) #checks type
+ self._evaluated = None
+ try: self._evaluated = self.evaluate()
+ except Exception, e: self.add_error_message(str(e))
+
+ def get_evaluated(self): return self._evaluated
+
def evaluate(self):
"""
Evaluate the value.
@return evaluated type
"""
+ self._init = True
self._lisitify_flag = False
self._stringify_flag = False
self._hostage_cells = list()
@@ -222,31 +242,23 @@ class Param(_Param):
#########################
# Numeric Types
#########################
- elif t in ('raw', 'complex', 'real', 'int', 'complex_vector', 'real_vector', 'int_vector', 'hex'):
+ elif t in ('raw', 'complex', 'real', 'int', 'complex_vector', 'real_vector', 'int_vector', 'hex', 'bool'):
#raise exception if python cannot evaluate this value
try: e = self.get_parent().get_parent().evaluate(v)
- except Exception, e:
- self._add_error_message('Value "%s" cannot be evaluated: %s'%(v, e))
- raise Exception
+ except Exception, e: raise Exception, 'Value "%s" cannot be evaluated: %s'%(v, e)
#raise an exception if the data is invalid
if t == 'raw': return e
elif t == 'complex':
- try: assert(isinstance(e, COMPLEX_TYPES))
- except AssertionError:
- self._add_error_message('Expression "%s" is invalid for type complex.'%str(e))
- raise Exception
+ try: assert isinstance(e, COMPLEX_TYPES)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type complex.'%str(e)
return e
elif t == 'real':
- try: assert(isinstance(e, REAL_TYPES))
- except AssertionError:
- self._add_error_message('Expression "%s" is invalid for type real.'%str(e))
- raise Exception
+ try: assert isinstance(e, REAL_TYPES)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type real.'%str(e)
return e
elif t == 'int':
- try: assert(isinstance(e, INT_TYPES))
- except AssertionError:
- self._add_error_message('Expression "%s" is invalid for type integer.'%str(e))
- raise Exception
+ try: assert isinstance(e, INT_TYPES)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type integer.'%str(e)
return e
#########################
# Numeric Vector Types
@@ -256,36 +268,30 @@ class Param(_Param):
self._lisitify_flag = True
e = [e]
try:
- for ei in e:
- assert(isinstance(ei, COMPLEX_TYPES))
- except AssertionError:
- self._add_error_message('Expression "%s" is invalid for type complex vector.'%str(e))
- raise Exception
+ for ei in e: assert isinstance(ei, COMPLEX_TYPES)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type complex vector.'%str(e)
return e
elif t == 'real_vector':
if not isinstance(e, VECTOR_TYPES):
self._lisitify_flag = True
e = [e]
try:
- for ei in e:
- assert(isinstance(ei, REAL_TYPES))
- except AssertionError:
- self._add_error_message('Expression "%s" is invalid for type real vector.'%str(e))
- raise Exception
+ for ei in e: assert isinstance(ei, REAL_TYPES)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type real vector.'%str(e)
return e
elif t == 'int_vector':
if not isinstance(e, VECTOR_TYPES):
self._lisitify_flag = True
e = [e]
try:
- for ei in e:
- assert(isinstance(ei, INT_TYPES))
- except AssertionError:
- self._add_error_message('Expression "%s" is invalid for type integer vector.'%str(e))
- raise Exception
+ for ei in e: assert isinstance(ei, INT_TYPES)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type integer vector.'%str(e)
+ return e
+ elif t == 'hex': return hex(e)
+ elif t == 'bool':
+ try: assert isinstance(e, bool)
+ except AssertionError: raise Exception, 'Expression "%s" is invalid for type bool.'%str(e)
return e
- elif t == 'hex':
- return hex(e)
else: raise TypeError, 'Type "%s" not handled'%t
#########################
# String Types
@@ -299,23 +305,14 @@ class Param(_Param):
#########################
elif t == 'id':
#can python use this as a variable?
- try:
- assert(len(v) > 0)
- assert(v[0].isalpha())
- for c in v: assert(c.isalnum() or c in ('_',))
- except AssertionError:
- self._add_error_message('ID "%s" must be alpha-numeric or underscored, and begin with a letter.'%v)
- raise Exception
+ try: assert _check_id_matcher.match(v)
+ except AssertionError: raise Exception, 'ID "%s" must begin with a letter and may contain letters, numbers, and underscores.'%v
params = self.get_all_params('id')
keys = [param.get_value() for param in params]
try: assert keys.count(v) <= 1 #id should only appear once, or zero times if block is disabled
- except:
- self._add_error_message('ID "%s" is not unique.'%v)
- raise Exception
+ except: raise Exception, 'ID "%s" is not unique.'%v
try: assert v not in ID_BLACKLIST
- except:
- self._add_error_message('ID "%s" is blacklisted.'%v)
- raise Exception
+ except: raise Exception, 'ID "%s" is blacklisted.'%v
return v
#########################
# Grid Position Type
@@ -324,22 +321,16 @@ class Param(_Param):
if not v: return '' #allow for empty grid pos
e = self.get_parent().get_parent().evaluate(v)
try:
- assert(isinstance(e, (list, tuple)) and len(e) == 4)
- for ei in e: assert(isinstance(ei, int))
- except AssertionError:
- self._add_error_message('A grid position must be a list of 4 integers.')
- raise Exception
+ assert isinstance(e, (list, tuple)) and len(e) == 4
+ for ei in e: assert isinstance(ei, int)
+ except AssertionError: raise Exception, 'A grid position must be a list of 4 integers.'
row, col, row_span, col_span = e
#check row, col
- try: assert(row >= 0 and col >= 0)
- except AssertionError:
- self._add_error_message('Row and column must be non-negative.')
- raise Exception
+ try: assert row >= 0 and col >= 0
+ except AssertionError: raise Exception, 'Row and column must be non-negative.'
#check row span, col span
- try: assert(row_span > 0 and col_span > 0)
- except AssertionError:
- self._add_error_message('Row and column span must be greater than zero.')
- raise Exception
+ try: assert row_span > 0 and col_span > 0
+ except AssertionError: raise Exception, 'Row and column span must be greater than zero.'
#calculate hostage cells
for r in range(row_span):
for c in range(col_span):
@@ -348,9 +339,7 @@ class Param(_Param):
params = filter(lambda p: p is not self, self.get_all_params('grid_pos'))
for param in params:
for cell in param._hostage_cells:
- if cell in self._hostage_cells:
- self._add_error_message('Another graphical element is using cell "%s".'%str(cell))
- raise Exception
+ if cell in self._hostage_cells: raise Exception, 'Another graphical element is using cell "%s".'%str(cell)
return e
#########################
# Import Type
@@ -358,12 +347,8 @@ class Param(_Param):
elif t == 'import':
n = dict() #new namespace
try: exec v in n
- except ImportError:
- self._add_error_message('Import "%s" failed.'%v)
- raise Exception
- except Exception:
- self._add_error_message('Bad import syntax: "%s".'%v)
- raise Exception
+ except ImportError: raise Exception, 'Import "%s" failed.'%v
+ except Exception: raise Exception, 'Bad import syntax: "%s".'%v
return filter(lambda k: str(k) != '__builtins__', n.keys())
#########################
else: raise TypeError, 'Type "%s" not handled'%t
@@ -375,23 +360,16 @@ class Param(_Param):
"""
#run init tasks in evaluate
#such as setting flags
- if not self._init:
- self.evaluate()
- self._init = True
+ if not self._init: self.evaluate()
v = self.get_value()
t = self.get_type()
if t in ('string', 'file_open', 'file_save'): #string types
- if self._stringify_flag:
- return '"%s"'%v.replace('"', '\"')
- else:
- return v
+ if self._stringify_flag: return '"%s"'%v.replace('"', '\"')
+ else: return v
elif t in ('complex_vector', 'real_vector', 'int_vector'): #vector types
- if self._lisitify_flag:
- return '(%s, )'%v
- else:
- return '(%s)'%v
- else:
- return v
+ if self._lisitify_flag: return '(%s, )'%v
+ else: return '(%s)'%v
+ else: return v
def get_all_params(self, type):
"""
diff --git a/grc/src/platforms/python/Platform.py b/grc/python/Platform.py
index d2bb4627e..8718fe955 100644
--- a/grc/src/platforms/python/Platform.py
+++ b/grc/python/Platform.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
import os
+from .. import VERSION #TEMP: until gnuradio has __version__
from .. base.Platform import Platform as _Platform
from FlowGraph import FlowGraph as _FlowGraph
from Connection import Connection as _Connection
@@ -27,35 +28,46 @@ from Param import Param as _Param
from Generator import Generator
from Constants import \
HIER_BLOCKS_LIB_DIR, BLOCK_DTD, \
- BLOCK_TREE, DEFAULT_FLOW_GRAPH, \
- BLOCKS_DIR
+ DEFAULT_FLOW_GRAPH, BLOCKS_DIRS
+import Constants
-_critical_blocks_only = map(lambda b: os.path.join(BLOCKS_DIR, b), ['options.xml', 'usrp_probe.xml', 'usrp2_probe.xml'])
+COLORS = (#title, #color spec
+ ('Complex', Constants.COMPLEX_COLOR_SPEC),
+ ('Float', Constants.FLOAT_COLOR_SPEC),
+ ('Integer', Constants.INT_COLOR_SPEC),
+ ('Short', Constants.SHORT_COLOR_SPEC),
+ ('Byte', Constants.BYTE_COLOR_SPEC),
+ ('Complex Vector', Constants.COMPLEX_VECTOR_COLOR_SPEC),
+ ('Float Vector', Constants.FLOAT_VECTOR_COLOR_SPEC),
+ ('Integer Vector', Constants.INT_VECTOR_COLOR_SPEC),
+ ('Short Vector', Constants.SHORT_VECTOR_COLOR_SPEC),
+ ('Byte Vector', Constants.BYTE_VECTOR_COLOR_SPEC),
+ ('Wildcard Type', Constants.WILDCARD_COLOR_SPEC),
+)
class Platform(_Platform):
- def __init__(self, extra_blocks=[], critical_only=False):
+ def __init__(self):
"""
Make a platform for gnuradio.
- @param extra_blocks a list of block paths to load in addition to main block library
- @param critical_only only load critical blocks (used only for usrp probe scripts to speed up load time)
"""
#ensure hier dir
if not os.path.exists(HIER_BLOCKS_LIB_DIR): os.mkdir(HIER_BLOCKS_LIB_DIR)
- if critical_only: block_paths = _critical_blocks_only
- else: block_paths = extra_blocks + [HIER_BLOCKS_LIB_DIR, BLOCKS_DIR]
- #convert block paths to absolute paths, ensure uniqueness
- block_paths = set(map(os.path.abspath, block_paths))
+ #convert block paths to absolute paths
+ block_paths = set(map(os.path.abspath, BLOCKS_DIRS))
#init
_Platform.__init__(
self,
- name='GRC',
+ name='GNU Radio Companion',
+ version=VERSION,
key='grc',
+ license=__doc__.strip(),
+ website='http://gnuradio.org/trac/wiki/GNURadioCompanion',
block_paths=block_paths,
block_dtd=BLOCK_DTD,
- block_tree=BLOCK_TREE,
default_flow_graph=DEFAULT_FLOW_GRAPH,
generator=Generator,
+ colors=COLORS,
)
##############################################
diff --git a/grc/src/platforms/python/Port.py b/grc/python/Port.py
index b5bc9696b..5a2b047f0 100644
--- a/grc/src/platforms/python/Port.py
+++ b/grc/python/Port.py
@@ -47,10 +47,10 @@ class Port(_Port):
def validate(self):
_Port.validate(self)
- try: assert(self.get_enabled_connections() or self.get_optional())
- except AssertionError: self._add_error_message('Port is not connected.')
- try: assert(self.is_source() or len(self.get_enabled_connections()) <= 1)
- except AssertionError: self._add_error_message('Port has too many connections.')
+ try: assert self.get_enabled_connections() or self.get_optional()
+ except AssertionError: self.add_error_message('Port is not connected.')
+ try: assert self.is_source() or len(self.get_enabled_connections()) <= 1
+ except AssertionError: self.add_error_message('Port has too many connections.')
def get_vlen(self):
"""
diff --git a/grc/src/gui/__init__.py b/grc/python/__init__.py
index 8b1378917..8b1378917 100644
--- a/grc/src/gui/__init__.py
+++ b/grc/python/__init__.py
diff --git a/grc/data/platforms/python/block.dtd b/grc/python/block.dtd
index d892b1287..7c6c39811 100644
--- a/grc/data/platforms/python/block.dtd
+++ b/grc/python/block.dtd
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Top level element.
A block contains a name, ...parameters list, and list of IO ports.
-->
-<!ELEMENT block (name, key, category?, import*, make, callback*, param*, check*, sink*, source*, doc?)>
+<!ELEMENT block (name, key, category?, import*, var_make?, make, callback*, param*, check*, sink*, source*, doc?)>
<!--
Sub level elements.
-->
@@ -48,6 +48,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
<!ELEMENT hide (#PCDATA)>
<!ELEMENT vlen (#PCDATA)>
<!ELEMENT nports (#PCDATA)>
+<!ELEMENT var_make (#PCDATA)>
<!ELEMENT make (#PCDATA)>
<!ELEMENT value (#PCDATA)>
<!ELEMENT callback (#PCDATA)>
diff --git a/grc/src/platforms/python/utils/convert_hier.py b/grc/python/convert_hier.py
index 495358984..bdafbcbc1 100644
--- a/grc/src/platforms/python/utils/convert_hier.py
+++ b/grc/python/convert_hier.py
@@ -17,9 +17,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from .. Constants import BLOCK_DTD
-from .... utils import ParseXML
-from .... utils import odict
+from Constants import BLOCK_DTD
+from .. base import ParseXML
+from .. base import odict
def convert_hier(flow_graph, python_file):
#extract info from the flow graph
@@ -38,10 +38,11 @@ def convert_hier(flow_graph, python_file):
block_n['category'] = block_category
block_n['import'] = 'execfile("%s")'%python_file
#make data
- block_n['make'] = '%s(\n\t%s,\n)'%(
+ if parameters: block_n['make'] = '%s(\n\t%s,\n)'%(
block_key,
',\n\t'.join(['%s=$%s'%(param.get_id(), param.get_id()) for param in parameters]),
)
+ else: block_n['make'] = '%s()'%block_key
#callback data
block_n['callback'] = ['set_%s($%s)'%(param.get_id(), param.get_id()) for param in parameters]
#param data
diff --git a/grc/data/platforms/python/default_flow_graph.grc b/grc/python/default_flow_graph.grc
index dea26f3a5..dea26f3a5 100644
--- a/grc/data/platforms/python/default_flow_graph.grc
+++ b/grc/python/default_flow_graph.grc
diff --git a/grc/src/platforms/python/utils/expr_utils.py b/grc/python/expr_utils.py
index 40700993d..1880c8f9c 100644
--- a/grc/src/platforms/python/utils/expr_utils.py
+++ b/grc/python/expr_utils.py
@@ -75,17 +75,17 @@ def expr_split(expr):
toks.append(tok)
return filter(lambda t: t, toks)
-def expr_prepend(expr, vars, prepend):
+def expr_replace(expr, replace_dict):
"""
Search for vars in the expression and add the prepend.
@param expr an expression string
- @param vars a list of variable names
- @param prepend the prepend string
+ @param replace_dict a dict of find:replace
@return a new expression with the prepend
"""
expr_splits = expr_split(expr)
for i, es in enumerate(expr_splits):
- if es in vars: expr_splits[i] = prepend + es
+ if es in replace_dict.keys():
+ expr_splits[i] = replace_dict[es]
return ''.join(expr_splits)
def get_variable_dependencies(expr, vars):
@@ -110,7 +110,7 @@ def get_graph(exprs):
for var in vars: var_graph.add_node(var)
for var, expr in exprs.iteritems():
for dep in get_variable_dependencies(expr, vars):
- var_graph.add_edge(dep, var)
+ if dep != var: var_graph.add_edge(dep, var)
return var_graph
def sort_variables(exprs):
diff --git a/grc/src/platforms/python/utils/extract_docs.py b/grc/python/extract_docs.py
index 523519f97..fa9140bdf 100644
--- a/grc/src/platforms/python/utils/extract_docs.py
+++ b/grc/python/extract_docs.py
@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from .. Constants import DOCS_DIR
+from Constants import DOCS_DIR
from lxml import etree
import os
import re
@@ -48,10 +48,8 @@ def _extract(key):
@param key the block key
@return a string with documentation
"""
- UBUNTU_DOCS_DIR = '/usr/share/doc/gnuradio-doc/xml'
- if os.path.exists(DOCS_DIR): docs_dir = DOCS_DIR
- elif os.path.exists(UBUNTU_DOCS_DIR): docs_dir = UBUNTU_DOCS_DIR
- else: return ''
+ docs_dir = os.path.join(DOCS_DIR, 'xml')
+ if not os.path.exists(docs_dir): return ''
#extract matches
pattern = key.replace('_', '_*').replace('x', '\w')
prog = re.compile('^class%s\..*$'%pattern)
diff --git a/grc/data/platforms/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 4c481dce4..a45a918d0 100644
--- a/grc/data/platforms/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -10,17 +10,23 @@
##@param blocks the signal blocks
##@param connections the connections
##@param generate_options the type of flow graph
-##@param var_id2expr variable id map to expression
-##@param var_id2deps variable id map to direct dependencies
##@param var_id2cbs variable id map to callback strings
########################################################
+#def indent($code)
+#set $code = '\n\t\t'.join(str($code).splitlines())
+$code#slurp
+#end def
#import time
#set $DIVIDER = '#'*50
$DIVIDER
# Gnuradio Python Flow Graph
-# Title: $flow_graph.get_option('title')
+# Title: $title
+#if $flow_graph.get_option('author')
# Author: $flow_graph.get_option('author')
+#end if
+#if $flow_graph.get_option('description')
# Description: $flow_graph.get_option('description')
+#end if
# Generated: $time.ctime()
$DIVIDER
@@ -39,15 +45,16 @@ $imp
## Setup the IO signature (hier block only).
########################################################
#set $class_name = $flow_graph.get_option('id')
+#set $param_str = ', '.join(['self'] + ['%s=%s'%(param.get_id(), param.get_make()) for param in $parameters])
#if $generate_options == 'wx_gui'
#import gtk
#set $icon = gtk.IconTheme().lookup_icon('gnuradio-grc', 32, 0)
class $(class_name)(grc_wxgui.top_block_gui):
- def __init__(self, options):
+ def __init__($param_str):
grc_wxgui.top_block_gui.__init__(
self,
- title="$flow_graph.get_parent().get_name() - Executing: $flow_graph.get_option('title')",
+ title="$title",
#if $icon
icon="$icon.get_filename()",
#end if
@@ -55,18 +62,17 @@ class $(class_name)(grc_wxgui.top_block_gui):
#elif $generate_options == 'no_gui'
class $(class_name)(gr.top_block):
- def __init__(self, options):
- gr.top_block.__init__(self, "$flow_graph.get_option('title')")
+ def __init__($param_str):
+ gr.top_block.__init__(self, "$title")
#elif $generate_options == 'hb'
#set $in_sig = $flow_graph.get_input_signature()
#set $out_sig = $flow_graph.get_output_signature()
- #set $param_str = ', '.join(['self'] + ['%s=%s'%(param.get_id(), param.get_make()) for param in $parameters])
class $(class_name)(gr.hier_block2):
def __init__($param_str):
gr.hier_block2.__init__(
self,
- "$flow_graph.get_option('title')",
+ "$title",
gr.io_signature($in_sig.nports, $in_sig.nports, $in_sig.size*$in_sig.vlen),
gr.io_signature($out_sig.nports, $out_sig.nports, $out_sig.size*$out_sig.vlen),
)
@@ -82,11 +88,7 @@ class $(class_name)(gr.hier_block2):
$DIVIDER
#end if
#for $param in $parameters
- #if $generate_options != 'hb'
- self.$param.get_id() = $param.get_id() = options.$param.get_id()
- #else
- self.$param.get_id() = $param.get_id()
- #end if
+ $indent($param.get_var_make())
#end for
########################################################
##Create Variables
@@ -100,8 +102,7 @@ class $(class_name)(gr.hier_block2):
$DIVIDER
#end if
#for $var in $variables
- #set $code = $var.get_make().splitlines()[0]
- self.$var.get_id() = $var.get_id() = $code
+ $indent($var.get_var_make())
#end for
########################################################
##Create Controls
@@ -115,8 +116,7 @@ class $(class_name)(gr.hier_block2):
$DIVIDER
#end if
#for $ctrl in $controls
- #set $code = '\n\t\t'.join($ctrl.get_make().splitlines()[1:])
- $code
+ $indent($ctrl.get_make())
#end for
########################################################
##Create Blocks
@@ -129,8 +129,7 @@ class $(class_name)(gr.hier_block2):
$DIVIDER
#end if
#for $blk in filter(lambda b: b.get_make(), $blocks)
- #set $code = '\n\t\t'.join($blk.get_make().splitlines())
- self.$blk.get_id() = $code
+ self.$blk.get_id() = $indent($blk.get_make())
#end for
########################################################
##Create Connections
@@ -168,11 +167,8 @@ class $(class_name)(gr.hier_block2):
#set $id = $var.get_id()
def set_$(id)(self, $id):
self.$id = $id
- #for $dep in $var_id2deps[$id]
- self.set_$(dep)($var_id2expr[$dep])
- #end for
#for $callback in $var_id2cbs[$id]
- self.$callback
+ $indent($callback)
#end for
#end for
@@ -184,9 +180,11 @@ class $(class_name)(gr.hier_block2):
#if $generate_options != 'hb'
if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
+ #set $params_eq_list = list()
#for $param in $parameters
#set $type = $param.get_param('type').get_value()
#if $type
+ #silent $params_eq_list.append('%s=options.%s'%($param.get_id(), $param.get_id()))
parser.add_option("--$param.get_id()", dest="$param.get_id()", type="$type", default=$param.get_make())
#end if
#end for
@@ -195,9 +193,9 @@ if __name__ == '__main__':
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Error: failed to enable realtime scheduling."
#end if
- tb = $(class_name)(options)
+ tb = $(class_name)($(', '.join($params_eq_list)))
#if $generate_options == 'wx_gui'
- tb.Run()
+ tb.Run($flow_graph.get_option('autostart'))
#elif $generate_options == 'no_gui'
tb.start()
raw_input('Press Enter to quit: ')
diff --git a/grc/scripts/grc b/grc/scripts/grc
index a2e3bc28a..8a6cc0af4 100755
--- a/grc/scripts/grc
+++ b/grc/scripts/grc
@@ -18,8 +18,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-import os
-
import pygtk
pygtk.require('2.0')
import gtk
@@ -32,7 +30,7 @@ Cannot import gnuradio. Are your PYTHONPATH and LD_LIBRARY_PATH set correctly?""
d.run()
exit(-1)
-from gnuradio.grc.platforms.base.Constants import VERSION
+from gnuradio.grc import VERSION
from optparse import OptionParser
if __name__ == "__main__":
@@ -47,13 +45,10 @@ and you are welcome to redistribute it.
"""%VERSION
parser = OptionParser(usage=usage, version=version)
(options, args) = parser.parse_args()
- from gnuradio.grc.platforms.python.Platform import Platform
+ from gnuradio.grc.python.Platform import Platform
from gnuradio.grc.gui.ActionHandler import ActionHandler
#setup icon using icon theme
try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
except: pass
- #extract extra block paths from environment variable, separated by semicolon
- try: extra_blocks = os.environ['GRC_BLOCKS_PATH'].split(';')
- except: extra_blocks = list()
- ActionHandler(args, Platform(extra_blocks=extra_blocks))
+ ActionHandler(args, Platform())
diff --git a/grc/scripts/usrp2_probe b/grc/scripts/usrp2_probe
index fac2427de..00d4366dd 100755
--- a/grc/scripts/usrp2_probe
+++ b/grc/scripts/usrp2_probe
@@ -29,10 +29,10 @@ import gobject
from gnuradio.grc.gui.Dialogs import TextDisplay
-from gnuradio.grc.platforms.python.Platform import Platform
-platform = Platform(critical_only=True)
+from gnuradio.grc.python.Platform import Platform
+platform = Platform()
-from gnuradio.grc.platforms.gui.Platform import Platform
+from gnuradio.grc.gui.Platform import Platform
platform = Platform(platform)
flow_graph = platform.get_new_flow_graph()
diff --git a/grc/scripts/usrp_probe b/grc/scripts/usrp_probe
index 3eb3de58e..6565612c1 100755
--- a/grc/scripts/usrp_probe
+++ b/grc/scripts/usrp_probe
@@ -27,10 +27,10 @@ import gtk
from gnuradio.grc.gui.Dialogs import TextDisplay
-from gnuradio.grc.platforms.python.Platform import Platform
-platform = Platform(critical_only=True)
+from gnuradio.grc.python.Platform import Platform
+platform = Platform()
-from gnuradio.grc.platforms.gui.Platform import Platform
+from gnuradio.grc.gui.Platform import Platform
platform = Platform(platform)
flow_graph = platform.get_new_flow_graph()
diff --git a/grc/src/grc_gnuradio/Makefile.am b/grc/src/grc_gnuradio/Makefile.am
deleted file mode 100644
index 767e8f670..000000000
--- a/grc/src/grc_gnuradio/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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.inc
-
-SUBDIRS = \
- blks2 \
- usrp \
- wxgui
-
-ourpythondir = $(grc_gnuradio_prefix)
-
-ourpython_PYTHON = __init__.py
diff --git a/grc/src/grc_gnuradio/blks2/Makefile.am b/grc/src/grc_gnuradio/blks2/Makefile.am
deleted file mode 100644
index 89889605b..000000000
--- a/grc/src/grc_gnuradio/blks2/Makefile.am
+++ /dev/null
@@ -1,33 +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)/grc/Makefile.inc
-
-ourpythondir = $(grc_gnuradio_prefix)/blks2
-
-ourpython_PYTHON = \
- __init__.py \
- error_rate.py \
- packet.py \
- probe.py \
- selector.py \
- tcp.py \
- variable_sink.py
diff --git a/grc/src/grc_gnuradio/usrp/Makefile.am b/grc/src/grc_gnuradio/usrp/Makefile.am
deleted file mode 100644
index 136a5dacd..000000000
--- a/grc/src/grc_gnuradio/usrp/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# 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.inc
-
-ourpythondir = $(grc_gnuradio_prefix)/usrp
-
-ourpython_PYTHON = \
- __init__.py \
- common.py \
- dual_usrp.py \
- simple_usrp.py
diff --git a/grc/src/grc_gnuradio/wxgui/Makefile.am b/grc/src/grc_gnuradio/wxgui/Makefile.am
deleted file mode 100644
index 2e5e7ebd0..000000000
--- a/grc/src/grc_gnuradio/wxgui/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# 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.inc
-
-ourpythondir = $(grc_gnuradio_prefix)/wxgui
-ourpython_PYTHON = \
- __init__.py \
- top_block_gui.py
diff --git a/grc/src/platforms/Makefile.am b/grc/src/platforms/Makefile.am
deleted file mode 100644
index 1d3c385c2..000000000
--- a/grc/src/platforms/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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.inc
-
-SUBDIRS = \
- base \
- gui \
- python
-
-ourpythondir = $(grc_src_prefix)/platforms
-
-ourpython_PYTHON = __init__.py
diff --git a/grc/src/platforms/__init__.py b/grc/src/platforms/__init__.py
deleted file mode 100644
index 8b1378917..000000000
--- a/grc/src/platforms/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/grc/src/platforms/base/Makefile.am b/grc/src/platforms/base/Makefile.am
deleted file mode 100644
index 805c7b2b3..000000000
--- a/grc/src/platforms/base/Makefile.am
+++ /dev/null
@@ -1,46 +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)/grc/Makefile.inc
-
-ourpythondir = $(grc_src_prefix)/platforms/base
-
-ourpython_PYTHON = \
- Block.py \
- Connection.py \
- Constants.py \
- Element.py \
- FlowGraph.py \
- Param.py \
- Platform.py \
- Port.py \
- __init__.py
-
-Constants.py: $(srcdir)/Constants.py.in Makefile
- sed \
- -e 's|@PACKAGE[@]|$(PACKAGE)|g' \
- -e 's|@VERSION[@]|$(VERSION)|g' \
- -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
- -e 's|@reldatadir[@]|$(grc_base_data_reldir)|g' \
- $< > $@
-
-EXTRA_DIST = $(srcdir)/Constants.py.in
-BUILT_SOURCES = Constants.py
diff --git a/grc/src/platforms/base/__init__.py b/grc/src/platforms/base/__init__.py
deleted file mode 100644
index 8b1378917..000000000
--- a/grc/src/platforms/base/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/grc/src/platforms/gui/__init__.py b/grc/src/platforms/gui/__init__.py
deleted file mode 100644
index 8b1378917..000000000
--- a/grc/src/platforms/gui/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/grc/src/platforms/python/Makefile.am b/grc/src/platforms/python/Makefile.am
deleted file mode 100644
index c23d14792..000000000
--- a/grc/src/platforms/python/Makefile.am
+++ /dev/null
@@ -1,48 +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)/grc/Makefile.inc
-
-SUBDIRS = utils
-
-ourpythondir = $(grc_src_prefix)/platforms/python
-
-ourpython_PYTHON = \
- Block.py \
- Connection.py \
- Constants.py \
- FlowGraph.py \
- Generator.py \
- Param.py \
- Platform.py \
- Port.py \
- __init__.py
-
-Constants.py: $(srcdir)/Constants.py.in Makefile
- sed \
- -e 's|@PYTHONW[@]|$(PYTHONW)|g' \
- -e 's|@reldatadir[@]|$(grc_python_data_reldir)|g' \
- -e 's|@relblocksdir[@]|$(grc_blocks_data_reldir)|g' \
- -e 's|@docdir[@]|$(gr_docdir)|g' \
- $< > $@
-
-EXTRA_DIST = $(srcdir)/Constants.py.in
-BUILT_SOURCES = Constants.py
diff --git a/grc/src/platforms/python/__init__.py b/grc/src/platforms/python/__init__.py
deleted file mode 100644
index 8b1378917..000000000
--- a/grc/src/platforms/python/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/grc/src/platforms/python/utils/__init__.py b/grc/src/platforms/python/utils/__init__.py
deleted file mode 100644
index 8b1378917..000000000
--- a/grc/src/platforms/python/utils/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/grc/src/utils/Makefile.am b/grc/src/utils/Makefile.am
deleted file mode 100644
index a48904796..000000000
--- a/grc/src/utils/Makefile.am
+++ /dev/null
@@ -1,30 +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)/grc/Makefile.inc
-
-ourpythondir = $(grc_src_prefix)/utils
-
-ourpython_PYTHON = \
- converter.py \
- odict.py \
- ParseXML.py \
- __init__.py
diff --git a/grc/src/utils/converter.py b/grc/src/utils/converter.py
deleted file mode 100644
index 34fc438fd..000000000
--- a/grc/src/utils/converter.py
+++ /dev/null
@@ -1,248 +0,0 @@
-"""
-Copyright 2008 Free Software Foundation, Inc.
-This file is part of GNU Radio
-
-GNU Radio Companion 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 2
-of the License, or (at your option) any later version.
-
-GNU Radio Companion 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 this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-"""
-
-from .. platforms.base.Constants import FLOW_GRAPH_DTD
-import ParseXML
-from .. import utils
-from .. utils import odict
-from lxml import etree
-import difflib
-import os
-
-def _make_param(key, value):
- """
- Make a paramater dict from the key/value pair.
- @param key the key
- @param value the value
- @return a dictionary object
- """
- param = odict()
- param['key'] = key
- param['value'] = value
- return param
-
-def _get_blocks(blocks, tag):
- """
- Get a list of blocks with the tag.
- @param blocks the old block list
- @param tag the tag name
- @retun a list of matching blocks
- """
- return filter(lambda b: b['tag'] == tag, blocks)
-
-def _get_params(block):
- """
- Get a list of params.
- @param block the old block
- @retun a list of params
- """
- params = utils.exists_or_else(block, 'params', {}) or {}
- params = utils.listify(params, 'param')
- return params
-
-def _convert_id(id):
- """
- Convert an old id to a new safe id.
- Replace spaces with underscores.
- Lower case the odl id.
- @return the reformatted id
- """
- return id.lower().replace(' ', '_')
-
-def convert(file_path, platform):
- """
- Convert the flow graph to the new format.
- Make a backup of the old file.
- Save a reformated flow graph to the file path.
- If this is a new format flow graph, do nothing.
- @param file_path the path to the saved flow graph
- @param platform the grc gnuradio platform
- """
- try: #return if file passes validation
- ParseXML.validate_dtd(file_path, FLOW_GRAPH_DTD)
- try:
- changed = False
- #convert instances of gui_coordinate and gui_rotation
- xml = etree.parse(file_path)
- for find, replace in (
- ('gr_add_vxx', 'gr_add_xx'),
- ('gr_multiply_vxx', 'gr_multiply_xx'),
- ):
- keys = xml.xpath('/flow_graph/block[key="%s"]/key'%find)
- for key in keys:
- key.text = replace
- changed = True
- if not changed: return
- #backup after successful conversion
- os.rename(file_path, file_path+'.bak')
- #save new flow graph to file path
- xml.write(file_path, xml_declaration=True, pretty_print=True)
- except Exception, e: print e
- return
- except: pass #convert
- ############################################################
- # extract window size, variables, blocks, and connections
- ############################################################
- old_n = ParseXML.from_file(file_path)['flow_graph']
- try: window_width = min(3*int(old_n['window_width'])/2, 2048)
- except: window_width = 2048
- try: window_height = min(3*int(old_n['window_height'])/2, 2048)
- except: window_height = 2048
- window_size = '%d, %d'%(window_width, window_height)
- variables = utils.exists_or_else(old_n, 'vars', {}) or {}
- variables = utils.listify(variables, 'var')
- blocks = utils.exists_or_else(old_n, 'signal_blocks', {}) or {}
- blocks = utils.listify(blocks, 'signal_block')
- connections = utils.exists_or_else(old_n, 'connections', {}) or {}
- connections = utils.listify(connections, 'connection')
- #initialize new nested data
- new_n = odict()
- new_n['block'] = list()
- new_n['connection'] = list()
- ############################################################
- # conversion - options block
- ############################################################
- #get name
- about_blocks = _get_blocks(blocks, 'About')
- if about_blocks: title = _get_params(about_blocks[0])[0]
- else: title = 'Untitled'
- #get author
- if about_blocks: author = _get_params(about_blocks[0])[1]
- else: author = ''
- #get desc
- note_blocks = _get_blocks(blocks, 'Note')
- if note_blocks: desc = _get_params(note_blocks[0])[0]
- else: desc = ''
- #create options block
- options_block = odict()
- options_block['key'] = 'options'
- options_block['param'] = [
- _make_param('id', 'top_block'),
- _make_param('title', title),
- _make_param('author', author),
- _make_param('description', desc),
- _make_param('window_size', window_size),
- _make_param('_coordinate', '(10, 10)'),
- ]
- #append options block
- new_n['block'].append(options_block)
- ############################################################
- # conversion - variables
- ############################################################
- x = 100
- for variable in variables:
- key = variable['key']
- value = variable['value']
- minimum = utils.exists_or_else(variable, 'min', '')
- maximum = utils.exists_or_else(variable, 'max', '')
- step = utils.exists_or_else(variable, 'step', '')
- x = x + 150
- coor = '(%d, %d)'%(x, 10)
- var_block = odict()
- if minimum and maximum: #slider varible
- #determine num steps
- try: num_steps = str(int((float(maximum) - float(minimum))/float(step)))
- except: num_steps = '100'
- var_block['key'] = 'variable_slider'
- var_block['param'] = [
- _make_param('id', key),
- _make_param('value', value),
- _make_param('min', minimum),
- _make_param('max', maximum),
- _make_param('num_steps', num_steps),
- _make_param('_coordinate', coor),
- ]
- else: #regular variable
- var_block['key'] = 'variable'
- var_block['param'] = [
- _make_param('id', key),
- _make_param('value', value),
- _make_param('_coordinate', coor),
- ]
- #append variable block
- new_n['block'].append(var_block)
- ############################################################
- # conversion - blocks
- ############################################################
- #create name to key map for all blocks in platform
- name_to_key = dict((b.get_name(), b.get_key()) for b in platform.get_blocks())
- for block in blocks:
- #extract info
- tag = block['tag']
- #ignore list
- if tag in ('Note', 'About'): continue
- id = _convert_id(block['id'])
- coor = '(%s, %s + 100)'%(
- utils.exists_or_else(block, 'x_coordinate', '0'),
- utils.exists_or_else(block, 'y_coordinate', '0'),
- )
- rot = utils.exists_or_else(block, 'rotation', '0')
- params = _get_params(block)
- #new block
- new_block = odict()
- matches = difflib.get_close_matches(tag, name_to_key.keys(), 1)
- if not matches: continue
- #match found
- key = name_to_key[matches[0]]
- new_block['key'] = key
- new_block['param'] = [
- _make_param('id', id),
- _make_param('_coordinate', coor),
- _make_param('_rotation', rot),
- ]
- #handle specific blocks
- if key == 'wxgui_fftsink2':
- params = params[0:3] + ['0'] + params[3:4] + ['8'] + params[4:]
- #append params
- for i, param in enumerate(params):
- platform_block = platform.get_block(key)
- try: platform_param = platform_block.get_params()[i+2]
- except IndexError: break
- if platform_param.is_enum():
- try: param_value = platform_param.get_option_keys()[int(param)]
- except: param_value = platform_param.get_option_keys()[0]
- else:
- param_value = param.replace('$', '').replace('^', '**')
- new_block['param'].append(_make_param(platform_param.get_key(), param_value))
- #append block
- new_n['block'].append(new_block)
- ############################################################
- # conversion - connections
- ############################################################
- for connection in connections:
- #extract info
- input_signal_block_id = connection['input_signal_block_id']
- input_socket_index = connection['input_socket_index']
- output_signal_block_id = connection['output_signal_block_id']
- output_socket_index = connection['output_socket_index']
- #new connection
- new_conn = odict()
- new_conn['source_block_id'] = _convert_id(output_signal_block_id)
- new_conn['sink_block_id'] = _convert_id(input_signal_block_id)
- new_conn['source_key'] = output_socket_index
- new_conn['sink_key'] = input_socket_index
- #append connection
- new_n['connection'].append(new_conn)
- ############################################################
- # backup and replace
- ############################################################
- #backup after successful conversion
- os.rename(file_path, file_path+'.bak')
- #save new flow graph to file path
- ParseXML.to_file({'flow_graph': new_n}, file_path)
diff --git a/grc/todo.txt b/grc/todo.txt
index b4f020c0f..ad7e62ff6 100644
--- a/grc/todo.txt
+++ b/grc/todo.txt
@@ -1,10 +1,19 @@
##################################################
+# Examples
+##################################################
+* Push-to-Talk example
+* Variable Config usage example
+* Start/Stop the flow graph
+
+##################################################
# Blocks
##################################################
* probe: also non-float outputs
* log slider gui control
* generic usrp (when its ready)
* packet mod: whitening offset
+* wx min window size in options block
+* gr_adaptive_fir_ccf
##################################################
# Features
@@ -20,7 +29,18 @@
* separate generated code into top block and gui class
* use gui.py in gr-wxgui and remove custom top_block_gui
* configuration option for adding block paths
-* data types guide/colors for the help menu
+* orientations for ports (top, right, bottom, left)
+ * source defaults to right, sink defaults to left
+* grid params take a notebook argument
+ * add a wx notebook block
+* separation of variables and gui controls
+* speedup w/ background layer and animation layer
+* multiple doxygen directories (doc_dir becomes doc_path)
+* use pango markup in tooltips for params
+* use get_var_make to determine if it is a variable, not regexp
+* concept of a project, or project flow graph
+ * collection of blocks, hier and top
+ * system-wide, default/work, and user created
##################################################
# Problems
@@ -34,12 +54,14 @@
* threads dont die on exit in probe and variable sink
* overloaded gui classes for each platform, move param input objects into overloaded
* align param titles in paramsdialog
+* better error for blank string params
+* weird grid params misbehaving
+* params dialog needs to dynamically update for all params
+ * will not update for non-enum params
+ * needs to account for added or removed params
##################################################
# Future
##################################################
* require pygtk 2.12 for treeview tooltips
* remove try/except in BlockTreeWindow.py
-* remove support for saved flow graphs ending in .xml
-* remove converter script for previous format
-* reorganize module structure