]> git.gag.com Git - debian/gnuradio/commitdiff
Merge commit 'v3.3.1' into try-3.3.1
authorBdale Garbee <bdale@gag.com>
Fri, 4 Mar 2011 18:33:36 +0000 (11:33 -0700)
committerBdale Garbee <bdale@gag.com>
Fri, 4 Mar 2011 18:33:36 +0000 (11:33 -0700)
461 files changed:
Makefile.common
config.guess [changed mode: 0755->0644]
config.sub [changed mode: 0755->0644]
config/gr_python.m4
config/grc_gr_qtgui.m4
config/usrp_libusb.m4 [changed mode: 0755->0644]
dtools/bin/fix-copyright-years [new file with mode: 0755]
dtools/bin/get-config-files
gcell/apps/test_all.cc
gcell/lib/runtime/Makefile.am
gnuradio-core/src/lib/filter/.gitignore
gnuradio-core/src/lib/filter/Makefile.am
gnuradio-core/src/lib/filter/Makefile.gen
gnuradio-core/src/lib/filter/filter.i
gnuradio-core/src/lib/filter/generate_all.py
gnuradio-core/src/lib/filter/generate_gri_fir_filter_with_buffer_XXX.py [new file with mode: 0755]
gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc
gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc
gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc
gnuradio-core/src/lib/filter/gr_filter_delay_fc.cc
gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t
gnuradio-core/src/lib/filter/gr_fractional_interpolator_cc.cc
gnuradio-core/src/lib/filter/gr_fractional_interpolator_ff.cc
gnuradio-core/src/lib/filter/gr_freq_xlating_fir_filter_XXX.cc.t
gnuradio-core/src/lib/filter/gr_goertzel_fc.cc
gnuradio-core/src/lib/filter/gr_goertzel_fc.h
gnuradio-core/src/lib/filter/gr_goertzel_fc.i
gnuradio-core/src/lib/filter/gr_hilbert_fc.cc
gnuradio-core/src/lib/filter/gr_iir_filter_ffd.cc
gnuradio-core/src/lib/filter/gr_interp_fir_filter_XXX.cc.t
gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc
gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.cc
gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc
gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.cc
gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h [new file with mode: 0644]
gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.i [new file with mode: 0644]
gnuradio-core/src/lib/filter/gr_rational_resampler_base_XXX.cc.t
gnuradio-core/src/lib/filter/gr_sincos.c
gnuradio-core/src/lib/filter/gr_single_pole_iir.h
gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_cc.cc
gnuradio-core/src/lib/filter/gr_single_pole_iir_filter_ff.cc
gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.cc.t [new file with mode: 0644]
gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.h.t [new file with mode: 0644]
gnuradio-core/src/lib/filter/gri_goertzel.cc
gnuradio-core/src/lib/filter/gri_goertzel.h
gnuradio-core/src/lib/filter/qa_filter.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.h [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.h [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.h [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.h [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.h [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc [new file with mode: 0644]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.h [new file with mode: 0644]
gnuradio-core/src/lib/general/gr_additive_scrambler_bb.cc
gnuradio-core/src/lib/general/gr_agc2_cc.cc
gnuradio-core/src/lib/general/gr_agc2_ff.cc
gnuradio-core/src/lib/general/gr_agc_cc.cc
gnuradio-core/src/lib/general/gr_agc_ff.cc
gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.cc
gnuradio-core/src/lib/general/gr_bin_statistics_f.cc
gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc
gnuradio-core/src/lib/general/gr_bytes_to_syms.cc
gnuradio-core/src/lib/general/gr_char_to_float.cc
gnuradio-core/src/lib/general/gr_check_counting_s.cc
gnuradio-core/src/lib/general/gr_check_lfsr_32k_s.cc
gnuradio-core/src/lib/general/gr_circular_file.cc
gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc
gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc
gnuradio-core/src/lib/general/gr_complex_to_interleaved_short.cc
gnuradio-core/src/lib/general/gr_complex_to_xxx.cc
gnuradio-core/src/lib/general/gr_conjugate_cc.cc
gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
gnuradio-core/src/lib/general/gr_costas_loop_cc.cc
gnuradio-core/src/lib/general/gr_cpfsk_bc.cc
gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc
gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
gnuradio-core/src/lib/general/gr_deinterleave.cc
gnuradio-core/src/lib/general/gr_delay.cc
gnuradio-core/src/lib/general/gr_descrambler_bb.cc
gnuradio-core/src/lib/general/gr_diff_decoder_bb.cc
gnuradio-core/src/lib/general/gr_diff_encoder_bb.cc
gnuradio-core/src/lib/general/gr_diff_phasor_cc.cc
gnuradio-core/src/lib/general/gr_dpll_bb.cc
gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc
gnuradio-core/src/lib/general/gr_fake_channel_coder_pp.cc
gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc
gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc
gnuradio-core/src/lib/general/gr_fft_vfc.cc
gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc
gnuradio-core/src/lib/general/gr_float_to_char.cc
gnuradio-core/src/lib/general/gr_float_to_complex.cc
gnuradio-core/src/lib/general/gr_float_to_short.cc
gnuradio-core/src/lib/general/gr_float_to_uchar.cc
gnuradio-core/src/lib/general/gr_fmdet_cf.cc
gnuradio-core/src/lib/general/gr_framer_sink_1.cc
gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
gnuradio-core/src/lib/general/gr_glfsr_source_b.cc
gnuradio-core/src/lib/general/gr_glfsr_source_f.cc
gnuradio-core/src/lib/general/gr_interleave.cc
gnuradio-core/src/lib/general/gr_interleaved_short_to_complex.cc
gnuradio-core/src/lib/general/gr_iqcomp_cc.cc
gnuradio-core/src/lib/general/gr_keep_one_in_n.cc
gnuradio-core/src/lib/general/gr_lfsr_32k_source_s.cc
gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc
gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc
gnuradio-core/src/lib/general/gr_map_bb.cc
gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
gnuradio-core/src/lib/general/gr_nlog10_ff.cc
gnuradio-core/src/lib/general/gr_nop.cc
gnuradio-core/src/lib/general/gr_null_sink.cc
gnuradio-core/src/lib/general/gr_null_source.cc
gnuradio-core/src/lib/general/gr_ofdm_bpsk_demapper.cc
gnuradio-core/src/lib/general/gr_ofdm_cyclic_prefixer.cc
gnuradio-core/src/lib/general/gr_ofdm_frame_acquisition.cc
gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
gnuradio-core/src/lib/general/gr_ofdm_insert_preamble.cc
gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
gnuradio-core/src/lib/general/gr_ofdm_sampler.cc
gnuradio-core/src/lib/general/gr_pa_2x2_phase_combiner.cc
gnuradio-core/src/lib/general/gr_packet_sink.cc
gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc
gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc
gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
gnuradio-core/src/lib/general/gr_pn_correlator_cc.cc
gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc
gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc
gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc
gnuradio-core/src/lib/general/gr_probe_density_b.cc
gnuradio-core/src/lib/general/gr_probe_mpsk_snr_c.cc
gnuradio-core/src/lib/general/gr_probe_signal_f.cc
gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc
gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc
gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc
gnuradio-core/src/lib/general/gr_rail_ff.cc
gnuradio-core/src/lib/general/gr_regenerate_bb.cc
gnuradio-core/src/lib/general/gr_repeat.cc
gnuradio-core/src/lib/general/gr_rms_cf.cc
gnuradio-core/src/lib/general/gr_rms_ff.cc
gnuradio-core/src/lib/general/gr_scrambler_bb.cc
gnuradio-core/src/lib/general/gr_short_to_float.cc
gnuradio-core/src/lib/general/gr_simple_correlator.cc
gnuradio-core/src/lib/general/gr_simple_framer.cc
gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc
gnuradio-core/src/lib/general/gr_skiphead.cc
gnuradio-core/src/lib/general/gr_skiphead.h
gnuradio-core/src/lib/general/gr_skiphead.i
gnuradio-core/src/lib/general/gr_squash_ff.cc
gnuradio-core/src/lib/general/gr_stream_mux.cc
gnuradio-core/src/lib/general/gr_stream_to_streams.cc
gnuradio-core/src/lib/general/gr_stream_to_vector.cc
gnuradio-core/src/lib/general/gr_streams_to_stream.cc
gnuradio-core/src/lib/general/gr_streams_to_vector.cc
gnuradio-core/src/lib/general/gr_stretch_ff.cc
gnuradio-core/src/lib/general/gr_test.cc
gnuradio-core/src/lib/general/gr_threshold_ff.cc
gnuradio-core/src/lib/general/gr_throttle.cc
gnuradio-core/src/lib/general/gr_uchar_to_float.cc
gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.cc
gnuradio-core/src/lib/general/gr_vco_f.cc
gnuradio-core/src/lib/general/gr_vector_to_stream.cc
gnuradio-core/src/lib/general/gr_vector_to_streams.cc
gnuradio-core/src/lib/general/gr_wavelet_ff.cc
gnuradio-core/src/lib/general/gr_wvps_ff.cc
gnuradio-core/src/lib/general/gri_agc2_cc.i
gnuradio-core/src/lib/general/gri_agc2_ff.i
gnuradio-core/src/lib/gengen/gr_add_XX.cc.t
gnuradio-core/src/lib/gengen/gr_add_const_XX.cc.t
gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t
gnuradio-core/src/lib/gengen/gr_and_XX.cc.t
gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t
gnuradio-core/src/lib/gengen/gr_chunks_to_symbols_XX.cc.t
gnuradio-core/src/lib/gengen/gr_divide_XX.cc.t
gnuradio-core/src/lib/gengen/gr_integrate_XX.cc.t
gnuradio-core/src/lib/gengen/gr_moving_average_XX.cc.t
gnuradio-core/src/lib/gengen/gr_multiply_XX.cc.t
gnuradio-core/src/lib/gengen/gr_multiply_const_XX.cc.t
gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t
gnuradio-core/src/lib/gengen/gr_mute_XX.cc.t
gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t
gnuradio-core/src/lib/gengen/gr_not_XX.cc.t
gnuradio-core/src/lib/gengen/gr_or_XX.cc.t
gnuradio-core/src/lib/gengen/gr_peak_detector_XX.cc.t
gnuradio-core/src/lib/gengen/gr_sample_and_hold_XX.cc.t
gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t
gnuradio-core/src/lib/gengen/gr_sub_XX.cc.t
gnuradio-core/src/lib/gengen/gr_vector_sink_X.cc.t
gnuradio-core/src/lib/gengen/gr_vector_source_X.cc.t
gnuradio-core/src/lib/gengen/gr_xor_XX.cc.t
gnuradio-core/src/lib/io/gr_file_descriptor_sink.cc
gnuradio-core/src/lib/io/gr_file_sink.cc
gnuradio-core/src/lib/io/gr_file_sink_base.cc
gnuradio-core/src/lib/io/gr_file_sink_base.h
gnuradio-core/src/lib/io/gr_file_sink_base.i
gnuradio-core/src/lib/io/gr_file_source.cc
gnuradio-core/src/lib/io/gr_histo_sink_f.cc
gnuradio-core/src/lib/io/gr_message_sink.cc
gnuradio-core/src/lib/io/gr_message_source.cc
gnuradio-core/src/lib/io/gr_oscope_guts.cc
gnuradio-core/src/lib/io/gr_oscope_sink_f.cc
gnuradio-core/src/lib/io/gr_trigger_mode.h
gnuradio-core/src/lib/io/gr_udp_sink.cc
gnuradio-core/src/lib/io/gr_udp_source.cc
gnuradio-core/src/lib/io/gr_wavfile_sink.cc
gnuradio-core/src/lib/io/gr_wavfile_source.cc
gnuradio-core/src/lib/runtime/Makefile.am
gnuradio-core/src/lib/runtime/gr_preferences.cc
gnuradio-core/src/lib/runtime/gr_sptr_magic.cc
gnuradio-core/src/lib/runtime/gr_unittests.h [new file with mode: 0644]
gnuradio-core/src/lib/swig/Makefile.am
gnuradio-core/src/lib/swig/gnuradio.i
gnuradio-core/src/python/gnuradio/Makefile.am
gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py
gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py
gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py
gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py
gnuradio-core/src/python/gnuradio/gr/qa_add_and_friends.py
gnuradio-core/src/python/gnuradio/gr/qa_add_v_and_friends.py
gnuradio-core/src/python/gnuradio/gr/qa_agc.py
gnuradio-core/src/python/gnuradio/gr/qa_argmax.py
gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py
gnuradio-core/src/python/gnuradio/gr/qa_boolean_operators.py
gnuradio-core/src/python/gnuradio/gr/qa_classify.py
gnuradio-core/src/python/gnuradio/gr/qa_cma_equalizer.py
gnuradio-core/src/python/gnuradio/gr/qa_complex_to_xxx.py
gnuradio-core/src/python/gnuradio/gr/qa_constellation_decoder_cb.py
gnuradio-core/src/python/gnuradio/gr/qa_copy.py
gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py
gnuradio-core/src/python/gnuradio/gr/qa_delay.py
gnuradio-core/src/python/gnuradio/gr/qa_diff_encoder.py
gnuradio-core/src/python/gnuradio/gr/qa_diff_phasor_cc.py
gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py
gnuradio-core/src/python/gnuradio/gr/qa_feval.py
gnuradio-core/src/python/gnuradio/gr/qa_fft.py
gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py
gnuradio-core/src/python/gnuradio/gr/qa_filter_delay_fc.py
gnuradio-core/src/python/gnuradio/gr/qa_fractional_interpolator.py
gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py
gnuradio-core/src/python/gnuradio/gr/qa_fsk_stuff.py
gnuradio-core/src/python/gnuradio/gr/qa_glfsr_source.py
gnuradio-core/src/python/gnuradio/gr/qa_goertzel.py
gnuradio-core/src/python/gnuradio/gr/qa_head.py
gnuradio-core/src/python/gnuradio/gr/qa_hier_block2.py
gnuradio-core/src/python/gnuradio/gr/qa_hilbert.py
gnuradio-core/src/python/gnuradio/gr/qa_iir.py
gnuradio-core/src/python/gnuradio/gr/qa_integrate.py
gnuradio-core/src/python/gnuradio/gr/qa_interleave.py
gnuradio-core/src/python/gnuradio/gr/qa_interp_fir_filter.py
gnuradio-core/src/python/gnuradio/gr/qa_kludge_copy.py
gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py
gnuradio-core/src/python/gnuradio/gr/qa_max.py
gnuradio-core/src/python/gnuradio/gr/qa_message.py
gnuradio-core/src/python/gnuradio/gr/qa_mute.py
gnuradio-core/src/python/gnuradio/gr/qa_nlog10.py
gnuradio-core/src/python/gnuradio/gr/qa_noise.py
gnuradio-core/src/python/gnuradio/gr/qa_ofdm_insert_preamble.py
gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py
gnuradio-core/src/python/gnuradio/gr/qa_pipe_fittings.py
gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py
gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py
gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py
gnuradio-core/src/python/gnuradio/gr/qa_pn_correlator_cc.py
gnuradio-core/src/python/gnuradio/gr/qa_rational_resampler.py
gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py
gnuradio-core/src/python/gnuradio/gr/qa_repeat.py
gnuradio-core/src/python/gnuradio/gr/qa_scrambler.py
gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py
gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir.py
gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir_cc.py
gnuradio-core/src/python/gnuradio/gr/qa_skiphead.py
gnuradio-core/src/python/gnuradio/gr/qa_stream_mux.py
gnuradio-core/src/python/gnuradio/gr/qa_udp_sink_source.py
gnuradio-core/src/python/gnuradio/gr/qa_unpack_k_bits.py
gnuradio-core/src/python/gnuradio/gr/qa_vector_sink_source.py
gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py
gnuradio-core/src/python/gnuradio/gr_unittest.py
gnuradio-core/src/python/gnuradio/gr_xmlrunner.py [new file with mode: 0644]
gnuradio-core/src/tests/test_all.cc
gnuradio-core/src/tests/test_atsc.cc
gnuradio-core/src/tests/test_filter.cc
gnuradio-core/src/tests/test_general.cc
gnuradio-core/src/tests/test_runtime.cc
gnuradio-examples/c++/dial_tone/Makefile.am
gnuradio-examples/python/pfb/channelize.py
gnuradio-examples/python/pfb/resampler.py [new file with mode: 0755]
gnuradio-examples/python/pfb/synth_filter.py [new file with mode: 0755]
gnuradio-examples/python/pfb/synth_to_chan.py [new file with mode: 0755]
gr-atsc/src/lib/atsc_bit_timing_loop.cc
gr-atsc/src/lib/atsc_deinterleaver.cc
gr-atsc/src/lib/atsc_depad.cc
gr-atsc/src/lib/atsc_derandomizer.cc
gr-atsc/src/lib/atsc_ds_to_softds.cc
gr-atsc/src/lib/atsc_equalizer.cc
gr-atsc/src/lib/atsc_field_sync_demux.cc
gr-atsc/src/lib/atsc_field_sync_mux.cc
gr-atsc/src/lib/atsc_fpll.cc
gr-atsc/src/lib/atsc_fs_checker.cc
gr-atsc/src/lib/atsc_interleaver.cc
gr-atsc/src/lib/atsc_pad.cc
gr-atsc/src/lib/atsc_randomizer.cc
gr-atsc/src/lib/atsc_rs_decoder.cc
gr-atsc/src/lib/atsc_rs_encoder.cc
gr-atsc/src/lib/atsc_trellis_encoder.cc
gr-atsc/src/lib/atsc_viterbi_decoder.cc
gr-atsc/src/lib/test_atsci.cc
gr-audio-alsa/src/audio_alsa_sink.cc
gr-audio-alsa/src/audio_alsa_sink.h
gr-audio-alsa/src/audio_alsa_source.cc
gr-audio-alsa/src/qa_alsa.py
gr-audio-jack/src/audio_jack_sink.cc
gr-audio-jack/src/audio_jack_source.cc
gr-audio-jack/src/qa_jack.py
gr-audio-oss/src/audio_oss_sink.cc
gr-audio-oss/src/audio_oss_source.cc
gr-audio-oss/src/qa_oss.py
gr-audio-osx/src/audio_osx_sink.cc
gr-audio-osx/src/audio_osx_source.cc
gr-audio-portaudio/src/audio_portaudio_sink.cc
gr-audio-portaudio/src/audio_portaudio_source.cc
gr-audio-portaudio/src/qa_portaudio.py
gr-audio-windows/src/audio_windows_sink.cc
gr-audio-windows/src/audio_windows_source.cc
gr-comedi/src/comedi_sink_s.cc
gr-comedi/src/comedi_source_s.cc
gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc
gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc
gr-cvsd-vocoder/src/python/qa_cvsd_vocoder.py
gr-gcell/src/Makefile.am
gr-gcell/src/gcell_fft_vcc.cc
gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.cc
gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.cc
gr-gsm-fr-vocoder/src/python/qa_gsm_full_rate.py
gr-howto-write-a-block/config.guess
gr-howto-write-a-block/config.sub
gr-howto-write-a-block/lib/howto_square2_ff.cc
gr-howto-write-a-block/lib/howto_square_ff.cc
gr-howto-write-a-block/lib/test_all.cc
gr-howto-write-a-block/version.sh
gr-msdd6000/src/msdd_rs_source_simple.cc
gr-msdd6000/src/msdd_source_simple.cc
gr-noaa/swig/Makefile.am
gr-pager/lib/pager_flex_deinterleave.cc
gr-pager/lib/pager_flex_parse.cc
gr-pager/lib/pager_flex_sync.cc
gr-pager/lib/pager_slicer_fb.cc
gr-pager/python/qa_pager.py
gr-pager/swig/Makefile.am
gr-qtgui/src/lib/.gitignore
gr-qtgui/src/lib/ConstellationDisplayPlot.cc
gr-qtgui/src/lib/FrequencyDisplayPlot.cc
gr-qtgui/src/lib/Makefile.am
gr-qtgui/src/lib/SpectrumGUIClass.cc
gr-qtgui/src/lib/SpectrumGUIClass.h
gr-qtgui/src/lib/TimeDomainDisplayPlot.cc
gr-qtgui/src/lib/Waterfall3DDisplayPlot.cc [deleted file]
gr-qtgui/src/lib/Waterfall3DDisplayPlot.h [deleted file]
gr-qtgui/src/lib/WaterfallDisplayPlot.cc
gr-qtgui/src/lib/highResTimeFunctions.h
gr-qtgui/src/lib/qtgui_sink_c.cc
gr-qtgui/src/lib/qtgui_sink_c.h
gr-qtgui/src/lib/qtgui_sink_f.cc
gr-qtgui/src/lib/qtgui_sink_f.h
gr-qtgui/src/lib/spectrumdisplayform.cc
gr-qtgui/src/lib/spectrumdisplayform.h
gr-qtgui/src/lib/spectrumdisplayform.ui
gr-qtgui/src/lib/waterfallGlobalData.cc
gr-qtgui/src/lib/waterfallGlobalData.h
gr-radio-astronomy/src/python/qa_ra.py
gr-trellis/src/lib/fsm.cc
gr-trellis/src/lib/interleaver.cc
gr-trellis/src/lib/trellis_encoder_XX.cc.t
gr-trellis/src/lib/trellis_metrics_X.cc.t
gr-trellis/src/lib/trellis_permutation.cc
gr-trellis/src/lib/trellis_siso_combined_f.cc
gr-trellis/src/lib/trellis_siso_f.cc
gr-trellis/src/lib/trellis_viterbi_X.cc.t
gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t
gr-trellis/src/python/qa_trellis.py
gr-usrp/apps/Makefile.am
gr-usrp/src/Makefile.am
gr-usrp/src/qa_usrp.py
gr-usrp/src/usrp_sink_c.cc
gr-usrp/src/usrp_sink_s.cc
gr-usrp/src/usrp_source_c.cc
gr-usrp/src/usrp_source_s.cc
gr-usrp2/src/Makefile.am
gr-usrp2/src/qa_usrp2.py
gr-usrp2/src/usrp2.i
gr-usrp2/src/usrp2_sink_16sc.cc
gr-usrp2/src/usrp2_sink_32fc.cc
gr-usrp2/src/usrp2_sink_base.cc
gr-usrp2/src/usrp2_sink_base.h
gr-utils/src/python/create-gnuradio-out-of-tree-project
gr-utils/src/python/gr_plot_const.py
gr-utils/src/python/gr_plot_fft.py
gr-utils/src/python/gr_plot_iq.py
gr-utils/src/python/gr_plot_psd.py
gr-utils/src/python/plot_data.py
gr-video-sdl/src/qa_video_sdl.py
gr-video-sdl/src/video_sdl_sink_s.cc
gr-video-sdl/src/video_sdl_sink_uc.cc
gr-wxgui/src/python/common.py
gr-wxgui/src/python/constants.py
gr-wxgui/src/python/fftsink_gl.py
gr-wxgui/src/python/plotter/gltext.py
gr-wxgui/src/python/scope_window.py
gr-wxgui/src/python/scopesink_gl.py
gr-wxgui/src/python/scopesink_nongl.py
gr-wxgui/src/python/waterfall_window.py
grc/blocks/Makefile.am
grc/blocks/block_tree.xml
grc/blocks/gr_agc2_xx.xml
grc/blocks/gr_and_const_xx.xml [new file with mode: 0644]
grc/blocks/gr_file_sink.xml
grc/blocks/gr_goertzel_fc.xml
grc/blocks/variable_config.xml
grc/blocks/wxgui_scopesink2.xml
grc/freedesktop/Makefile.am
grc/freedesktop/gnuradio-gnuradio-companion.desktop [deleted file]
grc/freedesktop/gnuradio-grc.desktop [new file with mode: 0644]
grc/freedesktop/grc_setup_freedesktop.in
grc/python/Block.py
grc/python/Port.py
gruel/src/include/gruel/pmt.h
gruel/src/lib/Makefile.am
gruel/src/lib/msg/Makefile.am
gruel/src/lib/pmt/Makefile.am
gruel/src/lib/pmt/pmt.cc
gruel/src/lib/pmt/pmt_int.h
gruel/src/lib/pmt/pmt_io.cc
gruel/src/lib/pmt/qa_pmt_prims.cc
gruel/src/lib/pmt/qa_pmt_prims.h
gruel/src/lib/test_gruel.cc
usrp/doc/Doxyfile.in
usrp/host/apps/burn-db-eeprom
usrp/host/include/usrp/db_flexrf.h
usrp/host/include/usrp/db_wbxng.h
usrp/host/lib/Makefile.am
usrp/host/lib/db_base.cc
usrp/host/lib/db_flexrf.cc
usrp/host/lib/db_wbxng.cc
usrp/host/lib/db_wbxng_adf4350.cc
usrp/host/lib/db_wbxng_adf4350.h
usrp/host/lib/db_wbxng_adf4350_regs.cc
usrp/host/lib/db_wbxng_adf4350_regs.h
usrp/host/lib/usrp_dbid.dat
usrp/host/swig/Makefile.am
usrp2/firmware/lib/db_rfx.c
usrp2/host/apps/Makefile.am
usrp2/host/lib/Makefile.am
usrp2/host/lib/usrp2.cc
version.sh

index fb83b9470d3640ed5793c2a5c378708d6448f6ba..9c36a496655b44954ff9fb4345e76b1ede259b6a 100644 (file)
@@ -57,8 +57,8 @@ libspudir = $(libdir)spu
 
 # This used to be set in configure.ac but is now defined here for all 
 # Makefiles when this fragment is included.
-STD_DEFINES_AND_INCLUDES = $(DEFINES) $(BOOST_CPPFLAGS) \
-       $(GNURADIO_INCLUDES) $(GRUEL_INCLUDES)
+STD_DEFINES_AND_INCLUDES = $(DEFINES) $(GNURADIO_INCLUDES) \
+       $(GRUEL_INCLUDES) $(BOOST_CPPFLAGS)
 
 # when including for compilation from pre-installed libraries and such,
 # need to make sure those are put last on the compile command
@@ -112,7 +112,8 @@ grc_blocksdir = $(pkgdatadir)/grc/blocks
 
 # Other common defines; use "+=" to add to these
 STAMPS =
-MOSTLYCLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc *.pyo *~ *.tmp *.loT
+MOSTLYCLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc *.pyo *~ *.tmp *.loT \
+       .unittests/* .unittests/python/*
 
 # Don't distribute the files defined in the variable 'no_dist_files'
 dist-hook:
old mode 100755 (executable)
new mode 100644 (file)
index f32079a..187cd54
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011 Free Software Foundation, Inc.
 
-timestamp='2008-01-23'
+timestamp='2011-02-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@ timestamp='2008-01-23'
 # the same distribution terms that you use for the rest of that program.
 
 
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -56,8 +56,9 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
                eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
+                       | grep -q __ELF__
                then
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
                    # Return netbsd for either.  FIX?
@@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                fi
                ;;
            *)
-               os=netbsd
+               os=netbsd
                ;;
        esac
        # The OS release
@@ -223,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
                ;;
        *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
                ;;
        esac
        # According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo s390-ibm-zvmoe
        exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+       echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
@@ -324,14 +328,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        case `/usr/bin/uname -p` in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
@@ -375,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+       exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-unknown-mint${UNAME_RELEASE}
+       exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
        exit ;;
@@ -461,8 +484,8 @@ EOF
        echo m88k-motorola-sysv3
        exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
        then
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -475,7 +498,7 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
        exit ;;
@@ -532,7 +555,7 @@ EOF
                echo rs6000-ibm-aix3.2
        fi
        exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
@@ -575,52 +598,52 @@ EOF
            9000/[678][0-9][0-9])
                if [ -x /usr/bin/getconf ]; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                   case "${sc_cpu_version}" in
+                     523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                     528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                     532)                      # CPU_PA_RISC2_0
+                       case "${sc_kernel_bits}" in
+                         32) HP_ARCH="hppa2.0n" ;;
+                         64) HP_ARCH="hppa2.0w" ;;
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+                       esac ;;
+                   esac
                fi
                if [ "${HP_ARCH}" = "" ]; then
                    eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
+                   sed 's/^            //' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
 EOF
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -640,7 +663,7 @@ EOF
            # => hppa64-hp-hpux11.23
 
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-               grep __LP64__ >/dev/null
+               grep -q __LP64__
            then
                HP_ARCH="hppa2.0w"
            else
@@ -711,22 +734,22 @@ EOF
        exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+       exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+       exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+       exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+       exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+       exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit ;;
@@ -750,14 +773,14 @@ EOF
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+       echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -785,18 +808,18 @@ EOF
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
     i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
        exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit ;;
-    *:Interix*:[3456]*)
-       case ${UNAME_MACHINE} in
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
            x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
-           EM64T | authenticamd)
+           authenticamd | genuineintel | EM64T)
                echo x86_64-unknown-interix${UNAME_RELEASE}
                exit ;;
            IA64)
@@ -806,6 +829,9 @@ EOF
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
        exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-pc-mks
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -835,6 +861,20 @@ EOF
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+       esac
+       objdump --private-headers /bin/sh | grep -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
     arm*:Linux:*:*)
        eval $set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -855,7 +895,18 @@ EOF
        echo crisv32-axis-linux-gnu
        exit ;;
     frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
+       echo frv-unknown-linux-gnu
+       exit ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
        exit ;;
     ia64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -866,74 +917,33 @@ EOF
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
-    mips:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips
-       #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    mips64:Linux:*:*)
+    mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
        #undef CPU
-       #undef mips64
-       #undef mips64el
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mips64el
+       CPU=${UNAME_MACHINE}el
        #else
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips64
+       CPU=${UNAME_MACHINE}
        #else
        CPU=
        #endif
        #endif
 EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     or32:Linux:*:*)
        echo or32-unknown-linux-gnu
        exit ;;
-    ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
-       exit ;;
-    ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
        exit ;;
-    alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-         EV5)   UNAME_MACHINE=alphaev5 ;;
-         EV56)  UNAME_MACHINE=alphaev56 ;;
-         PCA56) UNAME_MACHINE=alphapca56 ;;
-         PCA57) UNAME_MACHINE=alphapca56 ;;
-         EV6)   UNAME_MACHINE=alphaev6 ;;
-         EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
@@ -943,14 +953,17 @@ EOF
          *)    echo hppa-unknown-linux-gnu ;;
        esac
        exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-gnu
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -958,6 +971,9 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-tilera-linux-gnu
+       exit ;;
     vax:Linux:*:*)
        echo ${UNAME_MACHINE}-dec-linux-gnu
        exit ;;
@@ -965,71 +981,8 @@ EOF
        echo x86_64-unknown-linux-gnu
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
-    i*86:Linux:*:*)
-       # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us. cd to the root directory to prevent
-       # problems with other programs or directories called `ld' in the path.
-       # Set LC_ALL=C to ensure ld outputs messages in English.
-       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-                        | sed -ne '/supported targets:/!d
-                                   s/[         ][      ]*/ /g
-                                   s/.*supported targets: *//
-                                   s/ .*//
-                                   p'`
-        case "$ld_supported_targets" in
-         elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-               ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
-       esac
-       # Determine whether the default compiler is a.out or elf
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #ifdef __ELF__
-       # ifdef __GLIBC__
-       #  if __GLIBC__ >= 2
-       LIBC=gnu
-       #  else
-       LIBC=gnulibc1
-       #  endif
-       # else
-       LIBC=gnulibc1
-       # endif
-       #else
-       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-       #endif
-       #endif
-       #ifdef __dietlibc__
-       LIBC=dietlibc
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^LIBC/{
-               s: ::g
-               p
-           }'`"
-       test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-               exit
-       }
-       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-       ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
@@ -1037,11 +990,11 @@ EOF
        echo i386-sequent-sysv4
        exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+       # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
        exit ;;
     i*86:OS/2:*:*)
@@ -1058,7 +1011,7 @@ EOF
     i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
        exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     i*86:*DOS:*:*)
@@ -1073,7 +1026,7 @@ EOF
        fi
        exit ;;
     i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
@@ -1101,10 +1054,13 @@ EOF
        exit ;;
     pc:*:*:*)
        # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
-        exit ;;
+       # uname -m prints for DJGPP always 'pc', but it prints nothing about
+       # the processor, so we play safe by assuming i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
+       exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
        exit ;;
@@ -1139,8 +1095,18 @@ EOF
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
        exit ;;
@@ -1153,7 +1119,7 @@ EOF
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
        exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
@@ -1173,10 +1139,10 @@ EOF
                echo ns32k-sni-sysv
        fi
        exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
@@ -1202,11 +1168,11 @@ EOF
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv${UNAME_RELEASE}
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+       exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
        exit ;;
@@ -1216,6 +1182,9 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
        exit ;;
@@ -1243,6 +1212,16 @@ EOF
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
        case $UNAME_PROCESSOR in
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
            unknown) UNAME_PROCESSOR=powerpc ;;
        esac
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1258,6 +1237,9 @@ EOF
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
        exit ;;
@@ -1303,13 +1285,13 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux${UNAME_RELEASE}
        exit ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit ;;
     *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
@@ -1324,6 +1306,9 @@ EOF
     i*86:rdos:*:*)
        echo ${UNAME_MACHINE}-pc-rdos
        exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1346,11 +1331,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+       "4"
 #else
-         ""
+       ""
 #endif
-         ); exit (0);
+       ); exit (0);
 #endif
 #endif
 
old mode 100755 (executable)
new mode 100644 (file)
index 6759825..83da356
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011 Free Software Foundation, Inc.
 
-timestamp='2008-01-16'
+timestamp='2011-02-02'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@ timestamp='2008-01-16'
 
 
 # Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -72,8 +75,9 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,8 +124,10 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -148,10 +154,13 @@ case $os in
        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray)
+       -apple | -axis | -knuth | -cray | -microblaze)
                os=
                basic_machine=$1
                ;;
+       -bluegene*)
+               os=-cnk
+               ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
                basic_machine=$1
@@ -166,10 +175,10 @@ case $os in
                os=-chorusos
                basic_machine=$1
                ;;
-       -chorusrdb)
-               os=-chorusrdb
+       -chorusrdb)
+               os=-chorusrdb
                basic_machine=$1
-               ;;
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -249,13 +258,16 @@ case $basic_machine in
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep \
+       | maxq | mb | microblaze | mcore | mep | metag \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
-       | mips64vr | mips64vrel \
+       | mips64octeon | mips64octeonel \
        | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
@@ -268,28 +280,41 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
+       | moxie \
        | mt \
        | msp430 \
+       | nds32 | nds32le | nds32be \
        | nios | nios2 \
        | ns16k | ns32k \
        | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
+       | rx \
        | score \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
        | spu | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
+       | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
        | v850 | v850e \
        | we32k \
        | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k)
+       | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
                # Motorola 68HC11/12.
                basic_machine=$basic_machine-unknown
                os=-none
@@ -320,7 +345,7 @@ case $basic_machine in
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
        | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
@@ -329,14 +354,17 @@ case $basic_machine in
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
+       | mips64octeon-* | mips64octeonel-* \
        | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
@@ -351,27 +379,30 @@ case $basic_machine in
        | mmix-* \
        | mt-* \
        | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
        | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
-       | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile-* | tilegx-* \
        | tron-* \
+       | ubicom32-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-*)
+       | z8k-* | z80-*)
                ;;
        # Recognize the basic CPU types without company name, with glob match.
        xtensa*)
@@ -393,7 +424,7 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
-       abacus)
+       abacus)
                basic_machine=abacus-unknown
                ;;
        adobe68k)
@@ -439,6 +470,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-bsd
                ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -455,10 +490,27 @@ case $basic_machine in
                basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
                os=-linux
                ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
+       cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -487,7 +539,7 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16)
+       cr16 | cr16-*)
                basic_machine=cr16-unknown
                os=-elf
                ;;
@@ -526,6 +578,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
        djgpp)
                basic_machine=i586-pc
                os=-msdosdjgpp
@@ -699,6 +755,9 @@ case $basic_machine in
                basic_machine=ns32k-utek
                os=-sysv
                ;;
+       microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
        mingw32)
                basic_machine=i386-pc
                os=-mingw32
@@ -803,6 +862,12 @@ case $basic_machine in
        np1)
                basic_machine=np1-gould
                ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
@@ -1037,17 +1102,10 @@ case $basic_machine in
                basic_machine=t90-cray
                os=-unicos
                ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tic55x | c55x*)
-               basic_machine=tic55x-unknown
-               os=-coff
-               ;;
-       tic6x | c6x*)
-               basic_machine=tic6x-unknown
-               os=-coff
+       # This must be matched before tile*.
+       tilegx*)
+               basic_machine=tilegx-unknown
+               os=-linux-gnu
                ;;
        tile*)
                basic_machine=tile-unknown
@@ -1128,6 +1186,10 @@ case $basic_machine in
                basic_machine=z8k-unknown
                os=-sim
                ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1166,7 +1228,7 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1213,9 +1275,12 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+       # First match some system type aliases
+       # that might get confused with valid system types.
        # -solaris* is a basic system type, with this one exception.
+       -auroraux)
+               os=-auroraux
+               ;;
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
@@ -1236,10 +1301,11 @@ case $os in
        # Each alternative MUST END IN A *, to match a version number.
        # -sysv* is not here because it comes later, after sysvr4.
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
+             | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1248,9 +1314,10 @@ case $os in
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1258,7 +1325,7 @@ case $os in
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1297,7 +1364,7 @@ case $os in
        -opened*)
                os=-openedition
                ;;
-        -os400*)
+       -os400*)
                os=-os400
                ;;
        -wince*)
@@ -1346,7 +1413,7 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
-        -tpf*)
+       -tpf*)
                os=-tpf
                ;;
        -triton*)
@@ -1388,6 +1455,11 @@ case $os in
        -zvmoe)
                os=-zvmoe
                ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -nacl*)
+               ;;
        -none)
                ;;
        *)
@@ -1410,10 +1482,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+       score-*)
                os=-elf
                ;;
-        spu-*)
+       spu-*)
                os=-elf
                ;;
        *-acorn)
@@ -1425,8 +1497,17 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-        c4x-* | tic4x-*)
-               os=-coff
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
@@ -1453,7 +1534,7 @@ case $basic_machine in
        m68*-cisco)
                os=-aout
                ;;
-        mep-*)
+       mep-*)
                os=-elf
                ;;
        mips*-cisco)
@@ -1480,7 +1561,7 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
-       *-knuth)
+       *-knuth)
                os=-mmixware
                ;;
        *-wec)
@@ -1585,7 +1666,7 @@ case $basic_machine in
                        -sunos*)
                                vendor=sun
                                ;;
-                       -aix*)
+                       -cnk*|-aix*)
                                vendor=ibm
                                ;;
                        -beos*)
index 43ccfc01575f5e0c53cab03a12f603e92c10c64b..7aef1662e0a6fb787eb5ed5f7b1f317498e22413 100644 (file)
@@ -153,14 +153,16 @@ AC_DEFUN([PYTHON_CHECK_MODULE],[
 try:
     import $1
     assert $5
-except: exit(1)'
+except ImportError, AssertionError: exit(1)
+except: pass'
     dnl ########################################
     dnl # import checking only
     dnl ########################################
     else
         python_cmd='
 try: import $1
-except: exit(1)'
+except ImportError: exit(1)
+except: pass'
     fi
     if ! $PYTHON -c "$python_cmd" 2> /dev/null; then
         AC_MSG_RESULT([no])
index 84514d7ce9ad9f18091cc8f66201a336489737f1..4027bb332bd4f02cf9d40e7e7966f0ab3d6b85d3 100644 (file)
@@ -42,10 +42,9 @@ AC_DEFUN([GRC_GR_QTGUI],[
 #      QtGui
 #      QtCore
 #      qwt 
-#      qwtplot3d
 #      qt4
 
-# qt4-core, qt4-gui, qwt5-qt4, qwt5-qt4-dev, libqwtplot3d-qt4, libqwtplot3d-qt4-dev, qt4-dev-tools
+# qt4-core, qt4-gui, qwt5-qt4, qwt5-qt4-dev, qt4-dev-tools
 
     if test $passed = yes; then
         dnl Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
@@ -59,20 +58,15 @@ AC_DEFUN([GRC_GR_QTGUI],[
         dnl Fetch QWT variables
         GR_QWT([], [passed=no])
 
-        dnl Process QWT Plot3D only if QWT passed
-       if test "$passed" = "yes"; then
-            GR_QWTPLOT3D([], [passed=no])
-        fi
-
        dnl Export the include dirs and libraries (note: QTOPENGL_LIBS includes links
        dnl to QtCore and QtGui libraries)
-       QT_INCLUDES="$QWT_CFLAGS $QWTPLOT3D_CFLAGS $QTCORE_CFLAGS $QTGUI_CFLAGS"
-       QT_LIBS="$QWT_LIBS $QWTPLOT3D_LIBS $QTOPENGL_LIBS"
+       QT_INCLUDES="$QWT_CFLAGS $QTCORE_CFLAGS $QTGUI_CFLAGS"
+       QT_LIBS="$QWT_LIBS $QTOPENGL_LIBS"
 
         dnl Build an includes variable specifically for running qmake by extracting
-        dnl all includes from the QWT and QWTPLOT3D, without the -I;
+        dnl all includes from the QWT, without the -I;
         dnl qmake appends the -I when processing the project file INCLUDEPATH
-        for i in $QWT_CFLAGS $QWTPLOT3D_CFLAGS; do
+        for i in $QWT_CFLAGS; do
             QMAKE_INCLUDES="$QMAKE_INCLUDES ${i##-I}"
         done
 
old mode 100755 (executable)
new mode 100644 (file)
index 251f7df..cc3410f
@@ -24,68 +24,203 @@ dnl Boston, MA 02110-1301, USA.
 
 
 AC_DEFUN([USRP_LIBUSB], [
-  dnl Use PKGCONFIG to check for packages first, then check to
-  dnl make sure the USB_* variables work (whether from PKGCONFIG
-  dnl or overridden by the user)
-
-  libusbok=no
-  have_libusb1=no
-  LIBUSB_PKG_CONFIG_NAME=''
-  if test x$1 = xyes; then
-    PKG_CHECK_MODULES(USB, libusb-1.0, [
-      libusbok=yes
-      have_libusb1=yes
-      usb_header='libusb-1.0/libusb.h'
-      usb_lib_func='libusb_bulk_transfer'
-      usb_lib_name='usb-1.0'
-      LIBUSB_PKG_CONFIG_NAME='libusb-1.0'
-    ])
-  else
-    dnl not using libusb1 (for now); see if legacy version is found.
-    dnl it might be installed under the name either 'libusb' or
-    dnl 'libusb-legacy', or just available via the
-    dnl user's shell environment
-
-    dnl see if the pkgconfig module 'libusb' is available
-    PKG_CHECK_MODULES(USB, libusb, [
-      libusbok=yes
-      LIBUSB_PKG_CONFIG_NAME='libusb'
-      ], [libusbok=no])
-    dnl PKG_CHECK_MODULES does not work correctly when embedded
-    if test $libusbok = no; then
-      dnl if not, see if the pkgconfig module 'libusb-legacy' is available
-      PKG_CHECK_MODULES(USB, [libusb-legacy], [
+  dnl do not use LDFLAGS, except on Windows
+  saved_LDFLAGS=${LDFLAGS}
+  case "$host_os" in
+    cygwin* | mingw*)
+    ;;
+    *)
+      LDFLAGS=
+    ;;
+  esac
+
+  dnl this variable is set in usrp/usrp.pc.in as a requirement
+  dnl for libusrp; it is OK to be empty.
+  LIBUSB_PKG_CONFIG_NAME=
+
+  dnl for Windows (cygin, mingw), do not use PKGCONFIG since LIBUSB
+  dnl does not install a .pc file.  For all other OSs, use
+  dnl PKGCONFIG to check for various package names first.
+  libusb_list=''
+  case "$host_os" in
+    cygwin* | mingw*)
+      libusb_list='libusb'
+    ;;
+    *)
+      dnl create the list of libusb PKGCONFIG modules to test
+      if test x$1 = xyes; then
+        dnl libusb-1.0 was requested; just test for it
+        libusb_list="libusb-1.0"
+      else
+        dnl test for legacy libusb only
+        libusb_list="libusb libusb-legacy"
+      fi
+    ;;
+  esac
+
+  dnl loop over various possible 'libusb' names, and
+  dnl choose the first one that meets both the user's selection
+  dnl (via configure flags) as well as what is installed
+  for libusb_name in ${libusb_list}; do
+    dnl clear internal variables
+    libusbok=no
+    have_libusb1=no
+    usb_header=''
+    usb_lib_func=''
+    usb_lib_name=''
+
+    case "$host_os" in
+      cygwin* | mingw*)
+        USB_INCLUDEDIR=
+        USB_INCLUDES=
+        USB_LIBS=-lusb
+        usb_header='usb.h'
+        usb_lib_func='usb_bulk_write'
         libusbok=yes
-        LIBUSB_PKG_CONFIG_NAME='libusb-legacy'
-        ], [libusbok=no])
-    fi
-    dnl set variables for further testing
-    usb_header='usb.h'
-    usb_lib_func='usb_bulk_write'
-    usb_lib_name='usb'
-  fi
-  AC_SUBST(LIBUSB_PKG_CONFIG_NAME)
-  if test x$1 != xyes || test $have_libusb1 = yes; then
-    dnl Either (1) libusb1 was specified and found; or
-    dnl (2) libusb1 was not specified. Restart checking.
-    libusbok=yes
+      ;;
+      *)
+        dnl start checks
+        AC_MSG_NOTICE([Checking for LIBUSB version '${libusb_name}'])
+        if test ${libusb_name} = "libusb-1.0"; then
+          dnl see if the pkgconfig module is available
+          PKG_CHECK_MODULES(USB, ${libusb_name}, [
+            libusbok=yes
+            have_libusb1=yes
+            usb_header='libusb-1.0/libusb.h'
+            usb_lib_func='libusb_bulk_transfer'
+          ], [libusbok=no])
+        else
+          dnl see if the pkgconfig module is available
+          PKG_CHECK_MODULES(USB, ${libusb_name}, [
+            libusbok=yes
+            usb_header='usb.h'
+            usb_lib_func='usb_bulk_write'
+          ], [libusbok=no])
+        fi
+      ;;
+    esac
+    if test $libusbok = yes; then
+      dnl PKGCONFIG found a version of LIBUSB, or the info was
+      dnl provided by the user, or the OS is Windows.
 
-    dnl Verify that $usb_header is a valid header, and if so,
-    dnl then verify that $usb_lib_func can be found in the
-    dnl library $usb_lib_name.
+      dnl Check it to make sure it meets enough criteria:
+      dnl Verify that $usb_header is a valid header. If so, then
+      dnl verify that $usb_lib_func can be found in the library
+      dnl $usb_lib_name.  if so, verify that the symbol 'usb_debug' is
+      dnl found in the library if not using Windows.
 
-    dnl If PKGCONFIG found variable USB_INCLUDEDIR, and it is
-    dnl not empty, use it for checking for $usb_header.
-    dnl Otherwise, maybe the user's shell environment is already
-    dnl configured to find this header.
+      dnl Check for the header.  Similar to AC_CHECK_HEADERS,
+      dnl but doesn't append to known \#defines.
+      dnl If PKGCONFIG found variable USB_INCLUDEDIR, and it is
+      dnl not empty, use it for checking for $usb_header.
+      dnl Otherwise, maybe the user's shell environment is already
+      dnl configured to find this header.
+      AC_LANG_PUSH(C)
+      save_CPPFLAGS="$CPPFLAGS"
+      if test x$USB_INCLUDEDIR != x; then
+        USB_INCLUDES="-I$USB_INCLUDEDIR"
+        CPPFLAGS="$USB_INCLUDES"
+      fi
+      AC_MSG_CHECKING([$libusb_name for header $usb_header])
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+        #include "$usb_header"
+        ]], [])],
+        [libusbok=yes],[libusbok=no])
+      AC_MSG_RESULT([$libusbok])
+      CPPFLAGS="$save_CPPFLAGS"
+      AC_LANG_POP(C)
+
+      if test $libusbok = yes; then
+        dnl found the header; now make sure the library is OK
+        dnl On Darwin, need to include the IOKit library.     
+
+        AC_LANG_PUSH(C)
+        save_LIBS="$LIBS"
+        case "$host_os" in
+          darwin*)
+            USB_LIBS="$USB_LIBS -lIOKit"
+            ;;
+          *) ;;
+        esac
+        LIBS="$USB_LIBS"
+
+       dnl find the library link name
+        usb_lib_name=`echo $USB_LIBS | sed -e "s@.*-l\(usb[[^ ]]*\).*@\1@"`
+
+        dnl Check for the function in the library.  Similar to
+        dnl AC_CHECK_LIB, but doesn't append to known \#defines.
+        AC_MSG_CHECKING([$libusb_name for function $usb_lib_func in library $usb_lib_name])
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+          #ifdef __cplusplus
+          extern "C"
+          #endif
+          char $usb_lib_func ();
+          ]], [[return $usb_lib_func ();]])],
+          [libusbok=yes],[libusbok=no])
+        AC_MSG_RESULT([$libusbok])
+        LIBS="$save_LIBS"
+        AC_LANG_POP(C)
+
+        if test $libusbok = yes; then
+          if test ${libusb_name} != "libusb-1.0"; then
+            dnl PKGCONFIG found a legacy version of libusb; make sure the
+            dnl variable _usb_debug is available in the found library.
+           dnl Do not test on Windows, since that symbol is not defined.
+            case "$host_os" in
+              cygwin* | mingw*)
+              ;;
+            *)
+              AC_LANG_PUSH(C)
+              save_CPPFLAGS="$CPPFLAGS"
+              if test x$USB_INCLUDEDIR != x; then
+                CPPFLAGS="$USB_INCLUDES"
+              fi
+              save_LIBS="$LIBS"
+              LIBS="$USB_LIBS"
+              AC_MSG_CHECKING([$libusb_name for symbol usb_debug in library $usb_lib_name])
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+                extern int usb_debug;]],
+                [[usb_debug = 0;]])],
+                [libusbok=yes],[libusbok=no])
+              AC_MSG_RESULT([$libusbok])
+              LIBS="$save_LIBS"
+              CPPFLAGS="$save_CPPFLAGS"
+              AC_LANG_POP(C)
+              ;;
+            esac
+          fi
+        fi
+      fi
+    fi
+    dnl if everything checks out OK, finish up
+    if test $libusbok = yes; then
+      case "$host_os" in
+        cygwin* | mingw*)
+        ;;
+        *)
+          LIBUSB_PKG_CONFIG_NAME="${libusb_name}"
+        ;;
+      esac
+      break
+    else
+      dnl something wasn't found in this LIBUSB version.
+      dnl HACK: clear cache variables for header and library
+      unset USB_INCLUDEDIR
+      unset USB_INCLUDES
+      unset USB_LIBS
+      unset $as_ac_Header
+      unset $as_ac_Lib
+    fi
+  done
 
+  if test $libusbok = yes; then
+    dnl final error checking, mostly to create #define's
     AC_LANG_PUSH(C)
     save_CPPFLAGS="$CPPFLAGS"
     if test x$USB_INCLUDEDIR != x; then
-      USB_INCLUDES="-I$USB_INCLUDEDIR"
-      CPPFLAGS="$CPPFLAGS $USB_INCLUDES"
-      AC_SUBST(USB_INCLUDES)
+      CPPFLAGS="$USB_INCLUDES"
     fi
+    dnl Check for the header.
     AC_CHECK_HEADERS([$usb_header], [], [libusbok=no])
     CPPFLAGS="$save_CPPFLAGS"
     AC_LANG_POP(C)
@@ -93,40 +228,46 @@ AC_DEFUN([USRP_LIBUSB], [
     if test $libusbok = no; then
       AC_MSG_RESULT([USRP requires libusb header '$usb_header' which was not found or was not usable. See http://www.libusb.org])
     else
-
-      dnl found the header; now make sure the library is OK
-      dnl On Darwin, need to include the IOKit library.     
-
+      dnl check for the library (again)
       AC_LANG_PUSH(C)
+      save_CPPFLAGS="$CPPFLAGS"
+      if test x$USB_INCLUDEDIR != x; then
+        CPPFLAGS="$USB_INCLUDES"
+      fi
       save_LIBS="$LIBS"
-      LIBS=""
-      case "$host_os" in
-        darwin*)
-          USB_LIBS="$USB_LIBS -lIOKit"
-          LIBS="$USB_LIBS"
-          ;;
-        *) ;;
-      esac
+      LIBS="$USB_LIBS"
       AC_CHECK_LIB([$usb_lib_name], [$usb_lib_func], [], [
         libusbok=no
-        AC_MSG_RESULT([USRP requires library '$usb_lib_name' with function '$usb_lib_func', which was either not found or was not usable. See http://www.libusb.org])
-      ])
-      case "$host_os" in
-        cygwin* | mingw*)
-          USB_LIBS="$LIBS"
-          ;;
-        *) ;;
-      esac
+        AC_MSG_RESULT([USRP requires library '$usb_lib_name' with function '$usb_lib_func', which was either not found or was not usable. See http://www.libusb.org])])
+#      case "$host_os" in
+#        cygwin* | mingw*)
+#          USB_LIBS="$LIBS"
+#          ;;
+#        *) ;;
+#      esac
       LIBS="$save_LIBS"
+      CPPFLAGS="$save_CPPFLAGS"
       AC_LANG_POP(C)
     fi
   fi
+
   if test $libusbok = yes; then
-    AC_SUBST(USB_LIBS)
+    dnl success
+    AC_MSG_NOTICE([Using LIBUSB version '${libusb_name}'])
     ifelse([$2], , :, [$2])
   else
+    dnl not found; clear substitution variables
+    LIBUSB_PKG_CONFIG_NAME=
     USB_INCLUDES=
     USB_LIBS=
     ifelse([$3], , :, [$3])
   fi
+
+  dnl create substitution variables
+  AC_SUBST(USB_INCLUDES)
+  AC_SUBST(USB_LIBS)
+  AC_SUBST(LIBUSB_PKG_CONFIG_NAME)
+
+  dnl restore LDFLAGS
+  LDFLAGS=${saved_LDFLAGS}
 ])
diff --git a/dtools/bin/fix-copyright-years b/dtools/bin/fix-copyright-years
new file mode 100755 (executable)
index 0000000..bb0f300
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+
+import re
+import datetime
+import subprocess
+import multiprocessing
+
+def command(*args): return subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
+
+def is_gnuradio_co_source(lines):
+    for line in lines[:20]:
+        if 'GNU Radio is free software' in line: return True
+    return False
+
+def get_gnuradio_co_line(lines):
+    for i, line in enumerate(lines[:5]):
+        if 'Copyright' in line and 'Free Software Foundation' in line: return line, i
+    return None
+
+def fix_co_years(files):
+    for file in files:
+        print file
+        lines = open(file).readlines()
+        if not is_gnuradio_co_source(lines): continue
+
+        #extract the years from the git history
+        years = set(map(
+            lambda l: int(l.split()[-2]),
+            filter(
+                lambda l: l.startswith('Date'),
+                command('git', 'log', file).splitlines(),
+            ),
+        ))
+
+        #extract line and line number for co line
+        try: line, num = get_gnuradio_co_line(lines)
+        except: continue
+
+        #extract years from co string
+        try:
+            co_years_str = re.match('^.*Copyright (.*) Free Software Foundation.*$', line).groups()[0]
+            co_years = set(map(int, co_years_str.split(',')))
+        except: print '    format error on line %d: "%s"'%(num, line); continue
+
+        #update the years if missing any
+        all_years = co_years.union(years)
+        if all_years != co_years:
+            print '    missing years: %s'%(', '.join(map(str, sorted(all_years - co_years))))
+            all_years.add(datetime.datetime.now().year) #add the current year
+            all_years_str = ', '.join(map(str, sorted(all_years)))
+            new_text = ''.join(lines[:num] + [line.replace(co_years_str, all_years_str)] + lines[num+1:])
+            open(file, 'w').write(new_text)
+
+if __name__ == "__main__":
+    #get recursive list of files in the repo
+    files = command('git', 'ls-tree', '--name-only', 'HEAD', '-r').splitlines()
+
+    #start n+1 processes to handle the files
+    num_procs = multiprocessing.cpu_count()
+    procs = [multiprocessing.Process(
+        target=lambda *files: fix_co_years(files),
+        args=files[num::num_procs],
+    ) for num in range(num_procs)]
+    map(multiprocessing.Process.start, procs)
+    map(multiprocessing.Process.join, procs)
index d9e8811ac6d91c7f20553aba20ddee5091430aea..343bca26b1f7284b65a7c8f3f2f447861144822f 100755 (executable)
@@ -2,9 +2,5 @@
 
 # fetch latest config.guess and config.sub
 
-# They've moved...
-# wget -O config.guess 'http://savannah.gnu.org/cgi-bin/viewcvs/config/config/config.guess?rev=HEAD&content-type=text/plain'
-# wget -O config.sub 'http://savannah.gnu.org/cgi-bin/viewcvs/config/config/config.sub?rev=HEAD&content-type=text/plain'
-
-wget -O config.guess 'http://cvs.savannah.gnu.org/viewvc/*checkout*/config/config/config.guess?content-type=text%2Fplain&revision=HEAD'
-wget -O config.sub   'http://cvs.savannah.gnu.org/viewvc/*checkout*/config/config/config.sub?content-type=text%2Fplain&revision=HEAD'
+wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
+wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
index 9823960c4757a87ae28448d40cc9110d4fb3156f..0b608e13b90ae8e913806588d858d3753af81c1f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
 
+#include <gr_unittests.h>
 #include "../lib/runtime/qa_gcell_runtime.h"
 #include "../lib/wrapper/qa_gcell_wrapper.h"
 
 int 
 main(int argc, char **argv)
 {
-  
-  CppUnit::TextTestRunner      runner;
+  char path[200];
+  get_unittest_path ("gcell_all.xml", path, 200);
+
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest(qa_gcell_runtime::suite());
   runner.addTest(qa_gcell_wrapper::suite());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run("", false);
 
index 4d13790cd2df64b82df82ba709ec269cafbbf273..3ce637636230dcb7c44c8d105a5d2c5e2a3ae930 100644 (file)
@@ -23,8 +23,8 @@ include $(top_srcdir)/Makefile.common
 IBM_PPU_SYNC_INCLUDES = -I$(top_srcdir)/gcell/ibm/sync/ppu_source
 
 
-AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) \
-       $(GCELL_INCLUDES) $(IBM_PPU_SYNC_INCLUDES) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(DEFINES) $(GCELL_INCLUDES) $(IBM_PPU_SYNC_INCLUDES) \
+       $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
 
 
 dist_bin_SCRIPTS = gcell-embedspu-libtool
index 2d009f15451b06e8159c0fae0ae4d21ca635a26c..faaf02cb85243ae24d50bf52aa3f5023bffe8745 100644 (file)
 /gr_rational_resampler_base_scc.cc
 /gr_rational_resampler_base_scc.h
 /gr_rational_resampler_base_scc.i
+/gri_fir_filter_with_buffer_ccc.cc
+/gri_fir_filter_with_buffer_ccc.h
+/gri_fir_filter_with_buffer_ccf.cc
+/gri_fir_filter_with_buffer_ccf.h
+/gri_fir_filter_with_buffer_fcc.cc
+/gri_fir_filter_with_buffer_fcc.h
+/gri_fir_filter_with_buffer_fff.cc
+/gri_fir_filter_with_buffer_fff.h
+/gri_fir_filter_with_buffer_fsf.cc
+/gri_fir_filter_with_buffer_fsf.h
+/gri_fir_filter_with_buffer_scc.cc
+/gri_fir_filter_with_buffer_scc.h
 /stamp-*
index 23c1dadc3607d870d004ed2de1c66cfbb6f70a9e..6d2ec1c7e6dfec7af345dd1e2bd3262bed9ca2bd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
+# Copyright 2001,2002,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -44,6 +44,7 @@ code_generator =                                      \
        generate_gr_fir_sysconfig_generic.py            \
        generate_gr_fir_util.py                         \
        generate_gr_freq_xlating_fir_filter_XXX.py      \
+       generate_gri_fir_filter_with_buffer_XXX.py      \
        generate_utils.py                               \
        gr_fir_XXX.cc.t                                 \
        gr_fir_XXX.h.t                                  \
@@ -60,7 +61,10 @@ code_generator =                                     \
        gr_rational_resampler_base_XXX.i.t              \
        gr_freq_xlating_fir_filter_XXX.cc.t             \
        gr_freq_xlating_fir_filter_XXX.h.t              \
-       gr_freq_xlating_fir_filter_XXX.i.t
+       gr_freq_xlating_fir_filter_XXX.i.t              \
+       gri_fir_filter_with_buffer_XXX.cc.t             \
+       gri_fir_filter_with_buffer_XXX.h.t
+
 
 # Source built by Python into $(builddir)
 BUILT_SOURCES =                        \
@@ -205,6 +209,7 @@ libfilter_la_common_SOURCES =               \
        float_dotprod_generic.c         \
        short_dotprod_generic.c         \
        gr_pfb_channelizer_ccf.cc       \
+       gr_pfb_synthesis_filterbank_ccf.cc\
        gr_pfb_decimator_ccf.cc         \
        gr_pfb_interpolator_ccf.cc      \
        gr_pfb_arb_resampler_ccf.cc     \
@@ -220,7 +225,13 @@ libfilter_qa_la_common_SOURCES =   \
        qa_gr_fir_scc.cc                \
        qa_gr_rotator.cc                \
        qa_gri_mmse_fir_interpolator.cc \
-       qa_gri_mmse_fir_interpolator_cc.cc      
+       qa_gri_mmse_fir_interpolator_cc.cc \
+       qa_gri_fir_filter_with_buffer_ccf.cc \
+       qa_gri_fir_filter_with_buffer_ccc.cc \
+       qa_gri_fir_filter_with_buffer_fcc.cc \
+       qa_gri_fir_filter_with_buffer_fff.cc \
+       qa_gri_fir_filter_with_buffer_fsf.cc \
+       qa_gri_fir_filter_with_buffer_scc.cc
 
 if MD_CPU_generic
 libfilter_la_SOURCES = $(libfilter_la_common_SOURCES) $(generic_CODE)
@@ -288,6 +299,7 @@ grinclude_HEADERS =                         \
        short_dotprod_x86.h             \
        sse_debug.h                     \
        gr_pfb_channelizer_ccf.h        \
+       gr_pfb_synthesis_filterbank_ccf.h\
        gr_pfb_decimator_ccf.h          \
        gr_pfb_interpolator_ccf.h       \
        gr_pfb_arb_resampler_ccf.h      \
@@ -324,7 +336,13 @@ noinst_HEADERS =                   \
        qa_gr_fir_scc.h                 \
        qa_gr_rotator.h                 \
        qa_gri_mmse_fir_interpolator.h  \
-       qa_gri_mmse_fir_interpolator_cc.h       
+       qa_gri_mmse_fir_interpolator_cc.h \
+       qa_gri_fir_filter_with_buffer_ccf.h \
+       qa_gri_fir_filter_with_buffer_ccc.h \
+       qa_gri_fir_filter_with_buffer_fcc.h \
+       qa_gri_fir_filter_with_buffer_fff.h \
+       qa_gri_fir_filter_with_buffer_fsf.h \
+       qa_gri_fir_filter_with_buffer_scc.h
 
 
 if PYTHON
@@ -344,6 +362,7 @@ swiginclude_HEADERS =                       \
        gr_single_pole_iir_filter_ff.i  \
        gr_single_pole_iir_filter_cc.i  \
        gr_pfb_channelizer_ccf.i        \
+       gr_pfb_synthesis_filterbank_ccf.i\
        gr_pfb_decimator_ccf.i          \
        gr_pfb_interpolator_ccf.i       \
        gr_pfb_arb_resampler_ccf.i      \
index 6809274fa9328d57c32ce713aab7e3ecc75142ad..909899c054b06de1d24702f928397cc90ee10674 100644 (file)
@@ -40,7 +40,14 @@ GENERATED_H = \
        gr_rational_resampler_base_fcc.h \
        gr_rational_resampler_base_fff.h \
        gr_rational_resampler_base_fsf.h \
-       gr_rational_resampler_base_scc.h
+       gr_rational_resampler_base_scc.h \
+       gri_fir_filter_with_buffer_ccc.h \
+       gri_fir_filter_with_buffer_ccf.h \
+       gri_fir_filter_with_buffer_fcc.h \
+       gri_fir_filter_with_buffer_fff.h \
+       gri_fir_filter_with_buffer_fsf.h \
+       gri_fir_filter_with_buffer_scc.h
+
 
 GENERATED_I = \
        gr_fir_filter_ccc.i \
@@ -107,5 +114,11 @@ GENERATED_CC = \
        gr_rational_resampler_base_fcc.cc \
        gr_rational_resampler_base_fff.cc \
        gr_rational_resampler_base_fsf.cc \
-       gr_rational_resampler_base_scc.cc
+       gr_rational_resampler_base_scc.cc \
+       gri_fir_filter_with_buffer_ccc.cc \
+       gri_fir_filter_with_buffer_ccf.cc \
+       gri_fir_filter_with_buffer_fcc.cc \
+       gri_fir_filter_with_buffer_fff.cc \
+       gri_fir_filter_with_buffer_fsf.cc \
+       gri_fir_filter_with_buffer_scc.cc
 
index bdfb8fa8d2d20d342adbf745a8a2455cba74a811..645607cbada872443b53efb42bb874ca7a3e1920 100644 (file)
@@ -33,6 +33,7 @@
 #include <gr_goertzel_fc.h>
 #include <gr_cma_equalizer_cc.h>
 #include <gr_pfb_channelizer_ccf.h>
+#include <gr_pfb_synthesis_filterbank_ccf.h>
 #include <gr_pfb_decimator_ccf.h>
 #include <gr_pfb_interpolator_ccf.h>
 #include <gr_pfb_arb_resampler_ccf.h>
@@ -52,6 +53,7 @@
 %include "gr_goertzel_fc.i"
 %include "gr_cma_equalizer_cc.i"
 %include "gr_pfb_channelizer_ccf.i"
+%include "gr_pfb_synthesis_filterbank_ccf.i"
 %include "gr_pfb_decimator_ccf.i"
 %include "gr_pfb_interpolator_ccf.i"
 %include "gr_pfb_arb_resampler_ccf.i"
index b34e13c73e2ac4ccdc1ab42caa667184f486b97f..ceed2b8510d42349e8bd7a37a3849a6f5544f1e3 100755 (executable)
@@ -30,6 +30,7 @@ import generate_gr_fir_sysconfig_generic
 import generate_gr_fir_sysconfig
 import generate_gr_fir_util
 import generate_gr_fir_XXX
+import generate_gri_fir_filter_with_buffer_XXX
 
 def generate_all():
     generate_gr_fir_XXX.generate()
@@ -40,6 +41,7 @@ def generate_all():
     generate_gr_fir_sysconfig_generic.generate()
     generate_gr_fir_sysconfig.generate()
     generate_gr_fir_util.generate()
+    generate_gri_fir_filter_with_buffer_XXX.generate()
     output_glue('filter')
 
 if __name__ == '__main__':
diff --git a/gnuradio-core/src/lib/filter/generate_gri_fir_filter_with_buffer_XXX.py b/gnuradio-core/src/lib/filter/generate_gri_fir_filter_with_buffer_XXX.py
new file mode 100755 (executable)
index 0000000..f586b0c
--- /dev/null
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+# -*- python -*-
+#
+# Copyright 2010 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.
+# 
+
+import re
+from generate_utils import *
+
+roots = ['gri_fir_filter_with_buffer_XXX',]
+
+def code3_to_acc_code (code3):
+    if i_code (code3) == 'c' or o_code (code3) == 'c' or tap_code (code3) == 'c':
+        return 'c'
+    if i_code (code3) == 'f' or o_code (code3) == 'f' or tap_code (code3) == 'f':
+        return 'f'
+    if i_code (code3) == 'i' or o_code (code3) == 'i' or tap_code (code3) == 'i':
+        return 'i'
+    return 'i'                          # even short short short needs int accumulator
+
+def code3_to_input_cast (code3):
+    if i_code (code3) == 's' and o_code (code3) == 'c':
+        return '(float)'
+    return ''
+
+def expand_h_cc (root, code3):
+    d = init_dict (root, code3)
+    expand_template (d, root + '.h.t')
+    expand_template (d, root + '.cc.t')
+
+def init_dict (root, code3):
+    name = re.sub ('X+', code3, root)
+    d = standard_dict (name, code3)
+    d['INPUT_CAST'] = code3_to_input_cast (code3)
+    acc_code = code3_to_acc_code (code3)
+    d['ACC_TYPE'] = char_to_type[acc_code]
+    return d
+    
+
+def generate ():
+    for r in roots:
+        for s in fir_signatures:
+            expand_h_cc (r, s)
+
+
+if __name__ == '__main__':
+    generate ()
index 6a6fe1c265eb3f29a5ee209b805922e49d543153..8252509bbaf68a16a2ae16f57c2c95f27bd717d9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -29,7 +29,7 @@
 gr_cma_equalizer_cc_sptr
 gr_make_cma_equalizer_cc(int num_taps, float modulus, float mu)
 {
-  return gr_cma_equalizer_cc_sptr(new gr_cma_equalizer_cc(num_taps, modulus, mu));
+  return gnuradio::get_initial_sptr(new gr_cma_equalizer_cc(num_taps, modulus, mu));
 }
 
 gr_cma_equalizer_cc::gr_cma_equalizer_cc(int num_taps, float modulus, float mu)
index 4540c6e4ad00a4812e26d72d9b19e8cd290557cf..02bfaf105bf4af0030a277415ee16584d71dd261 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -45,7 +45,7 @@
 
 gr_fft_filter_ccc_sptr gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps)
 {
-  return gr_fft_filter_ccc_sptr (new gr_fft_filter_ccc (decimation, taps));
+  return gnuradio::get_initial_sptr(new gr_fft_filter_ccc (decimation, taps));
 }
 
 
index e8857fe8cfbd5d45fdfed39bbc95cd6c85e21f47..e5b218f20d8d60b85172be8538fd09a2b1937509 100644 (file)
@@ -37,7 +37,7 @@
 
 gr_fft_filter_fff_sptr gr_make_fft_filter_fff (int decimation, const std::vector<float> &taps)
 {
-  return gr_fft_filter_fff_sptr (new gr_fft_filter_fff (decimation, taps));
+  return gnuradio::get_initial_sptr(new gr_fft_filter_fff (decimation, taps));
 }
 
 
index 49a1e0eb34fed580361a3f0a41fe97cafa202582..7974da934d83a10ad5012921c1d6b5826d49e9d4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_filter_delay_fc_sptr 
 gr_make_filter_delay_fc (const std::vector<float> &taps) 
 {
-  return gr_filter_delay_fc_sptr (new gr_filter_delay_fc (taps));
+  return gnuradio::get_initial_sptr(new gr_filter_delay_fc (taps));
 }
 
 gr_filter_delay_fc::gr_filter_delay_fc (const std::vector<float> &taps)
index b99de507318ff468d6ac9d80ed91100ebc6209c9..29e3519252d1479d534440ebfe065a2efc3c482a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,7 +36,7 @@
 
 @SPTR_NAME@ gr_make_@BASE_NAME@ (int decimation, const std::vector<@TAP_TYPE@> &taps)
 {
-  return @SPTR_NAME@ (new @NAME@ (decimation, taps));
+  return gnuradio::get_initial_sptr (new @NAME@ (decimation, taps));
 }
 
 
index 56a1a31aa804a04c7ad7cd118a736dc29913c24d..500958e3da9dac9403b7ad43adf1b6407f0f4bee 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2007,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -32,7 +32,7 @@
 // Public constructor
 gr_fractional_interpolator_cc_sptr gr_make_fractional_interpolator_cc(float phase_shift, float interp_ratio)
 {
-  return gr_fractional_interpolator_cc_sptr(new gr_fractional_interpolator_cc(phase_shift, interp_ratio));
+  return gnuradio::get_initial_sptr(new gr_fractional_interpolator_cc(phase_shift, interp_ratio));
 }
 
 gr_fractional_interpolator_cc::gr_fractional_interpolator_cc(float phase_shift, float interp_ratio)
index 0e0fdad7f4c491227ee90cf407f179aec284ce4c..9cbe31635d570a5f5ee46ca09c0c0c32a58f237d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2007,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -32,7 +32,7 @@
 // Public constructor
 gr_fractional_interpolator_ff_sptr gr_make_fractional_interpolator_ff(float phase_shift, float interp_ratio)
 {
-  return gr_fractional_interpolator_ff_sptr(new gr_fractional_interpolator_ff(phase_shift, interp_ratio));
+  return gnuradio::get_initial_sptr(new gr_fractional_interpolator_ff(phase_shift, interp_ratio));
 }
 
 gr_fractional_interpolator_ff::gr_fractional_interpolator_ff(float phase_shift, float interp_ratio)
index f51e046afa185f0a6d357b35c4fee53d72e167c7..656b3402a9e57aa53a347759a5f18d50225e6c03 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -39,7 +39,7 @@
 gr_make_@BASE_NAME@ (int decimation, const std::vector<@TAP_TYPE@> &taps,
                     double center_freq, double sampling_freq)
 {
-  return @SPTR_NAME@ (new @NAME@ (decimation, taps, center_freq, sampling_freq));
+  return gnuradio::get_initial_sptr (new @NAME@ (decimation, taps, center_freq, sampling_freq));
 }
 
 
index aee8df844d5fd2eb7e060494ed450d4e72e3e4a9..938a522f40217494396fd29f291e0ddae2f36c03 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010,2011 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_goertzel_fc_sptr 
 gr_make_goertzel_fc(int rate, int len, float freq) 
 {
-  return gr_goertzel_fc_sptr (new gr_goertzel_fc(rate, len, freq));
+  return gnuradio::get_initial_sptr(new gr_goertzel_fc(rate, len, freq));
 }
 
 gr_goertzel_fc::gr_goertzel_fc(int rate, int len, float freq)
@@ -42,6 +42,8 @@ gr_goertzel_fc::gr_goertzel_fc(int rate, int len, float freq)
     d_goertzel(rate, len, freq)
 {
   d_len = len;
+  d_rate = rate;
+  d_freq = freq;
 }
 
 int gr_goertzel_fc::work(int noutput_items,
@@ -58,3 +60,17 @@ int gr_goertzel_fc::work(int noutput_items,
 
   return noutput_items;
 }
+
+void
+gr_goertzel_fc::set_freq(float freq)
+{
+  d_freq = freq;
+  d_goertzel.gri_setparms(d_rate, d_len, d_freq);
+}
+
+void
+gr_goertzel_fc::set_rate(int rate)
+{
+  d_rate = rate;
+  d_goertzel.gri_setparms(d_rate, d_len, d_freq);
+}
index 9518c5c927af0b9e7cfd916c122071b24fef2cb4..c60b63d882f6e56f7ab852103d0fe90bf9b59b29 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -44,11 +44,16 @@ private:
   gr_goertzel_fc(int rate, int len, float freq);
   gri_goertzel d_goertzel;
   int          d_len;
+  float               d_freq;
+  int          d_rate;
 
 public:
   int work(int noutput_items,
           gr_vector_const_void_star &input_items,
           gr_vector_void_star &output_items);
+
+  void set_freq (float freq);
+  void set_rate (int rate);
 };
 
 #endif /* INCLUDED_GR_GOERTZEL_FC_H */
index 4cbc1dece3e38863284fda81adf2e0092a363dad..775c78cc8e0a3458e89ad0cad7c668d3e127bc73 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -28,4 +28,8 @@ class gr_goertzel_fc : public gr_sync_decimator
 {
 private:
   gr_goertzel_fc();
+
+public:
+  void set_freq (float freq);
+  void set_rate (int rate);
 };
index 65343916cadc186b98b0348cf4c6fec16463eaf9..7445f051e66e6dd5aaafae5f7b54de3e3f0a3111 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 gr_hilbert_fc_sptr 
 gr_make_hilbert_fc (unsigned int ntaps)
 {
-  return gr_hilbert_fc_sptr (new gr_hilbert_fc (ntaps));
+  return gnuradio::get_initial_sptr(new gr_hilbert_fc (ntaps));
 }
 
 gr_hilbert_fc::gr_hilbert_fc (unsigned int ntaps)
index 0c2d386303bc8eb22af4e9d7826aa7ddf83228b3..a41a4f7dbace46e760d72d3c68b58f08184902c9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@ gr_iir_filter_ffd_sptr
 gr_make_iir_filter_ffd (const std::vector<double> &fftaps,
                        const std::vector<double> &fbtaps) throw (std::invalid_argument)
 {
-  return gr_iir_filter_ffd_sptr (new gr_iir_filter_ffd (fftaps, fbtaps));
+  return gnuradio::get_initial_sptr(new gr_iir_filter_ffd (fftaps, fbtaps));
 }
 
 gr_iir_filter_ffd::gr_iir_filter_ffd (const std::vector<double> &fftaps,
index 274aee7278973bec029cd5268998a683de7c86aa..b90450c65981c36e26d580a88a5cd17054cc2444 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -38,7 +38,7 @@
 
 @SPTR_NAME@ gr_make_@BASE_NAME@ (unsigned interpolation, const std::vector<@TAP_TYPE@> &taps)
 {
-  return @SPTR_NAME@ (new @NAME@ (interpolation, taps));
+  return gnuradio::get_initial_sptr (new @NAME@ (interpolation, taps));
 }
 
 
index 5a6e753ab4c2b45d61ee4e432fae921d0b9668d4..84b0c578f59bc12310a261e6391f2a20d7034c7f 100644 (file)
@@ -34,8 +34,8 @@ gr_pfb_arb_resampler_ccf_sptr gr_make_pfb_arb_resampler_ccf (float rate,
                                                             const std::vector<float> &taps,
                                                             unsigned int filter_size)
 {
-  return gr_pfb_arb_resampler_ccf_sptr (new gr_pfb_arb_resampler_ccf (rate, taps,
-                                                                     filter_size));
+  return gnuradio::get_initial_sptr(new gr_pfb_arb_resampler_ccf (rate, taps,
+                                                                 filter_size));
 }
 
 
@@ -71,7 +71,7 @@ gr_pfb_arb_resampler_ccf::gr_pfb_arb_resampler_ccf (float rate,
 
   // Create an FIR filter for each channel and zero out the taps
   std::vector<float> vtaps(0, d_int_rate);
-  for(int i = 0; i < d_int_rate; i++) {
+  for(unsigned int i = 0; i < d_int_rate; i++) {
     d_filters[i] = gr_fir_util::create_gr_fir_ccf(vtaps);
     d_diff_filters[i] = gr_fir_util::create_gr_fir_ccf(vtaps);
   }
@@ -81,6 +81,8 @@ gr_pfb_arb_resampler_ccf::gr_pfb_arb_resampler_ccf (float rate,
   create_diff_taps(taps, dtaps);
   create_taps(taps, d_taps, d_filters);
   create_taps(dtaps, d_dtaps, d_diff_filters);
+
+  set_relative_rate(rate);
 }
 
 gr_pfb_arb_resampler_ccf::~gr_pfb_arb_resampler_ccf ()
@@ -95,8 +97,6 @@ gr_pfb_arb_resampler_ccf::create_taps (const std::vector<float> &newtaps,
                                       std::vector< std::vector<float> > &ourtaps,
                                       std::vector<gr_fir_ccf*> &ourfilter)
 {
-  int i,j;
-
   unsigned int ntaps = newtaps.size();
   d_taps_per_filter = (unsigned int)ceil((double)ntaps/(double)d_int_rate);
 
@@ -112,10 +112,10 @@ gr_pfb_arb_resampler_ccf::create_taps (const std::vector<float> &newtaps,
   }
   
   // Partition the filter
-  for(i = 0; i < d_int_rate; i++) {
+  for(unsigned int i = 0; i < d_int_rate; i++) {
     // Each channel uses all d_taps_per_filter with 0's if not enough taps to fill out
     ourtaps[d_int_rate-1-i] = std::vector<float>(d_taps_per_filter, 0);
-    for(j = 0; j < d_taps_per_filter; j++) {
+    for(unsigned int j = 0; j < d_taps_per_filter; j++) {
       ourtaps[d_int_rate - 1 - i][j] = tmp_taps[i + j*d_int_rate];
     }
     
@@ -171,14 +171,16 @@ gr_pfb_arb_resampler_ccf::general_work (int noutput_items,
     return 0;               // history requirements may have changed.
   }
 
-  int i = 0, j, count = d_start_index;
+  int i = 0, count = d_start_index;
+  unsigned int j;
   gr_complex o0, o1;
 
   // Restore the last filter position
   j = d_last_filter;
 
   // produce output as long as we can and there are enough input samples
-  while((i < noutput_items) && (count < ninput_items[0]-1)) {
+  int max_input = ninput_items[0]-(int)d_taps_per_filter;
+  while((i < noutput_items) && (count < max_input)) {
 
     // start j by wrapping around mod the number of channels
     while((j < d_int_rate) && (i < noutput_items)) {
index 5fda47880f5cea77a62c54806f6bdd1c0a654468..db16a634b773af6774a160d630795c8eee6b5918 100644 (file)
@@ -36,7 +36,7 @@ gr_pfb_channelizer_ccf_sptr gr_make_pfb_channelizer_ccf (unsigned int numchans,
                                                         const std::vector<float> &taps,
                                                         float oversample_rate)
 {
-  return gr_pfb_channelizer_ccf_sptr (new gr_pfb_channelizer_ccf (numchans, taps,
+  return gnuradio::get_initial_sptr(new gr_pfb_channelizer_ccf (numchans, taps,
                                                                  oversample_rate));
 }
 
@@ -55,11 +55,12 @@ gr_pfb_channelizer_ccf::gr_pfb_channelizer_ccf (unsigned int numchans,
   // This tests the specified input sample rate to see if it conforms to this
   // requirement within a few significant figures.
   double intp = 0;
-  double x = (10000.0*rint(numchans / oversample_rate)) / 10000.0;
   double fltp = modf(numchans / oversample_rate, &intp);
   if(fltp != 0.0)
     throw std::invalid_argument("gr_pfb_channelizer: oversample rate must be N/i for i in [1, N]"); 
 
+  set_relative_rate(1.0/intp);
+
   d_filters = std::vector<gr_fir_ccf*>(d_numchans);
 
   // Create an FIR filter for each channel and zero out the taps
index ff4fb70a36eed08aa623374a0ccf3e2128c622f3..937899c0d0f98a4976e11f921f6463311cca0cfc 100644 (file)
@@ -39,7 +39,7 @@ gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain,
                                                       float init_phase,
                                                       float max_rate_deviation)
 {
-  return gr_pfb_clock_sync_ccf_sptr (new gr_pfb_clock_sync_ccf (sps, gain, taps,
+  return gnuradio::get_initial_sptr(new gr_pfb_clock_sync_ccf (sps, gain, taps,
                                                                filter_size,
                                                                init_phase,
                                                                max_rate_deviation));
index 86de3b5a1c17fe2ec3e3864a9344a1839e8a148e..5d7f7a0d0f947bfeb6e413aeeae68584a14774ad 100644 (file)
@@ -39,7 +39,7 @@ gr_pfb_clock_sync_fff_sptr gr_make_pfb_clock_sync_fff (double sps, float gain,
                                                       float init_phase,
                                                       float max_rate_deviation)
 {
-  return gr_pfb_clock_sync_fff_sptr (new gr_pfb_clock_sync_fff (sps, gain, taps,
+  return gnuradio::get_initial_sptr(new gr_pfb_clock_sync_fff (sps, gain, taps,
                                                                filter_size,
                                                                init_phase,
                                                                max_rate_deviation));
index e05e18ff2e0f04c38bd3ce6c152402e6876806d5..28c6a611a876fbaef9347bece131a9a3ca7ad9c4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,7 +36,7 @@ gr_pfb_decimator_ccf_sptr gr_make_pfb_decimator_ccf (unsigned int decim,
                                                     const std::vector<float> &taps,
                                                     unsigned int channel)
 {
-  return gr_pfb_decimator_ccf_sptr (new gr_pfb_decimator_ccf (decim, taps, channel));
+  return gnuradio::get_initial_sptr(new gr_pfb_decimator_ccf (decim, taps, channel));
 }
 
 
index 6a9598f344584b51ccb350d96ad5ead2a63143df..e20bc38bb1cb4efc198c17f4f886f8326b862a8b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 gr_pfb_interpolator_ccf_sptr gr_make_pfb_interpolator_ccf (unsigned int interp, 
                                                           const std::vector<float> &taps)
 {
-  return gr_pfb_interpolator_ccf_sptr (new gr_pfb_interpolator_ccf (interp, taps));
+  return gnuradio::get_initial_sptr(new gr_pfb_interpolator_ccf (interp, taps));
 }
 
 
@@ -132,7 +132,7 @@ gr_pfb_interpolator_ccf::work (int noutput_items,
   int i = 0, count = 0;
 
   while(i < noutput_items) {
-    for(int j = 0; j < d_rate; j++) {
+    for(unsigned int j = 0; j < d_rate; j++) {
       out[i] = d_filters[j]->filter(&in[count]);
       i++;
     }
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc
new file mode 100644 (file)
index 0000000..9fad1bd
--- /dev/null
@@ -0,0 +1,169 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_pfb_synthesis_filterbank_ccf.h>
+#include <gri_fft.h>
+#include <gr_io_signature.h>
+#include <cstdio>
+#include <cstring>
+
+gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf 
+    (unsigned int numchans, const std::vector<float> &taps)
+{
+  return gr_pfb_synthesis_filterbank_ccf_sptr 
+    (new gr_pfb_synthesis_filterbank_ccf (numchans, taps));
+}
+
+
+gr_pfb_synthesis_filterbank_ccf::gr_pfb_synthesis_filterbank_ccf
+    (unsigned int numchans, const std::vector<float> &taps)
+  : gr_sync_interpolator ("pfb_synthesis_filterbank_ccf",
+                         gr_make_io_signature (1, numchans, sizeof(gr_complex)),
+                         gr_make_io_signature (1, 1, sizeof(gr_complex)),
+                         numchans),
+    d_updated (false), d_numchans(numchans)
+{
+  d_filters = std::vector<gri_fir_filter_with_buffer_ccf*>(d_numchans);
+
+  // Create an FIR filter for each channel and zero out the taps
+  std::vector<float> vtaps(0, d_numchans);
+  for(unsigned int i = 0; i < d_numchans; i++) {
+    d_filters[i] = new gri_fir_filter_with_buffer_ccf(vtaps);
+  }
+
+  // Now, actually set the filters' taps
+  set_taps(taps);
+
+  // Create the IFFT to handle the input channel rotations
+  d_fft = new gri_fft_complex (d_numchans, true);
+}
+
+gr_pfb_synthesis_filterbank_ccf::~gr_pfb_synthesis_filterbank_ccf ()
+{
+  for(unsigned int i = 0; i < d_numchans; i++) {
+    delete d_filters[i];
+  }
+}
+
+void
+gr_pfb_synthesis_filterbank_ccf::set_taps (const std::vector<float> &taps)
+{
+  unsigned int i,j;
+
+  unsigned int ntaps = taps.size();
+  d_taps_per_filter = (unsigned int)ceil((double)ntaps/(double)d_numchans);
+
+  // Create d_numchan vectors to store each channel's taps
+  d_taps.resize(d_numchans);
+
+  // Make a vector of the taps plus fill it out with 0's to fill
+  // each polyphase filter with exactly d_taps_per_filter
+  std::vector<float> tmp_taps;
+  tmp_taps = taps;
+  while((float)(tmp_taps.size()) < d_numchans*d_taps_per_filter) {
+    tmp_taps.push_back(0.0);
+  }
+  // Partition the filter
+  for(i = 0; i < d_numchans; i++) {
+    // Each channel uses all d_taps_per_filter with 0's if not enough taps to fill out
+    d_taps[i] = std::vector<float>(d_taps_per_filter, 0);
+    for(j = 0; j < d_taps_per_filter; j++) {
+      d_taps[i][j] = tmp_taps[i + j*d_numchans];  // add taps to channels in reverse order
+    }
+    
+    // Build a filter for each channel and add it's taps to it
+    d_filters[i]->set_taps(d_taps[i]);
+  }
+
+  // Set the history to ensure enough input items for each filter
+  set_history (d_taps_per_filter+1);
+
+  d_updated = true;
+}
+
+void
+gr_pfb_synthesis_filterbank_ccf::print_taps()
+{
+  unsigned int i, j;
+  for(i = 0; i < d_numchans; i++) {
+    printf("filter[%d]: [", i);
+    for(j = 0; j < d_taps_per_filter; j++) {
+      printf(" %.4e", d_taps[i][j]);
+    }
+    printf("]\n\n");
+  }
+}
+
+
+int
+gr_pfb_synthesis_filterbank_ccf::work (int noutput_items,
+                                      gr_vector_const_void_star &input_items,
+                                      gr_vector_void_star &output_items)
+{
+  gr_complex *in = (gr_complex*) input_items[0];
+  gr_complex *out = (gr_complex *) output_items[0];
+  int numsigs = input_items.size();
+  int ndiff   = d_numchans - numsigs;
+  unsigned int nhalf = (unsigned int)ceil((float)numsigs/2.0f);
+
+  if (d_updated) {
+    d_updated = false;
+    return 0;               // history requirements may have changed.
+  }
+
+  unsigned int n, i;
+  for(n = 0; n < noutput_items/d_numchans; n++) {
+    // fill up the populated channels based on the 
+    // number of real input streams
+    for(i = 0; i < nhalf; i++) {
+      in = (gr_complex*)input_items[i];
+      d_fft->get_inbuf()[i] = (in+i)[n];
+    }
+
+    // Make the ndiff channels around N/2 0
+    for(; i < nhalf+ndiff; i++) {
+      d_fft->get_inbuf()[i] = gr_complex(0,0);
+    }
+
+    // Finish off channels with data
+    for(; i < d_numchans; i++) {
+      in = (gr_complex*)input_items[i-ndiff];
+      d_fft->get_inbuf()[i] = (in+i)[n];
+    }
+
+    // spin through IFFT
+    d_fft->execute();
+
+    for(i = 0; i < d_numchans; i++) {
+      out[d_numchans-i-1] = d_filters[d_numchans-i-1]->filter(d_fft->get_outbuf()[i]);
+    }
+    
+    out += d_numchans;
+  }
+
+  return noutput_items;
+}
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h
new file mode 100644 (file)
index 0000000..f5b1cbb
--- /dev/null
@@ -0,0 +1,98 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+
+#ifndef INCLUDED_GR_PFB_SYNTHESIS_FILTERBANK_CCF_H
+#define        INCLUDED_GR_PFB_SYNTHESIS_FILTERBANK_CCF_H
+
+#include <gr_sync_interpolator.h>
+#include <gri_fir_filter_with_buffer_ccf.h>
+
+class gr_pfb_synthesis_filterbank_ccf;
+typedef boost::shared_ptr<gr_pfb_synthesis_filterbank_ccf> gr_pfb_synthesis_filterbank_ccf_sptr;
+gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf 
+    (unsigned int numchans, const std::vector<float> &taps);
+
+class gri_fft_complex;
+
+
+/*!
+ * \class gr_pfb_synthesis_filterbank_ccf
+ *
+ * \brief Polyphase synthesis filterbank with 
+ *        gr_complex input, gr_complex output and float taps
+ *
+ * \ingroup filter_blk
+ */
+
+class gr_pfb_synthesis_filterbank_ccf : public gr_sync_interpolator
+{
+ private:
+  /*!
+   * Build the polyphase synthesis filterbank.
+   * \param numchans (unsigned integer) Specifies the number of 
+                     channels <EM>M</EM>
+   * \param taps    (vector/list of floats) The prototype filter to
+                    populate the filterbank.
+   */
+  friend gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf 
+      (unsigned int numchans, const std::vector<float> &taps);
+
+  bool                    d_updated;
+  unsigned int             d_numchans;
+  unsigned int             d_taps_per_filter;
+  gri_fft_complex         *d_fft;
+  std::vector< gri_fir_filter_with_buffer_ccf*> d_filters;
+  std::vector< std::vector<float> > d_taps;
+
+
+  /*!
+   * Build the polyphase synthesis filterbank.
+   * \param numchans (unsigned integer) Specifies the number of
+                     channels <EM>M</EM>
+   * \param taps    (vector/list of floats) The prototype filter
+                    to populate the filterbank.
+   */
+  gr_pfb_synthesis_filterbank_ccf (unsigned int numchans, 
+                                  const std::vector<float> &taps);
+  
+public:
+  ~gr_pfb_synthesis_filterbank_ccf ();
+  
+  /*!
+   * Resets the filterbank's filter taps with the new prototype filter
+   * \param taps    (vector/list of floats) The prototype filter to
+                    populate the filterbank.
+   */
+  void set_taps (const std::vector<float> &taps);
+
+  /*!
+   * Print all of the filterbank taps to screen.
+   */
+  void print_taps();
+  
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+};
+
+#endif
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.i b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.i
new file mode 100644 (file)
index 0000000..02a9f02
--- /dev/null
@@ -0,0 +1,38 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,pfb_synthesis_filterbank_ccf);
+
+gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf 
+    (unsigned int numchans, const std::vector<float> &taps);
+
+class gr_pfb_synthesis_filterbank_ccf : public gr_sync_interpolator
+{
+ private:
+  gr_pfb_synthesis_filterbank_ccf (unsigned int numchans,
+                                  const std::vector<float> &taps);
+
+ public:
+  ~gr_pfb_synthesis_filterbank_ccf ();
+
+  void set_taps (const std::vector<float> &taps);
+};
index 69276f58ee21d3a2bf34f2faa65dbbccb30d6592..3e9a34cdc15ca4ad62caa35d1b081f52803e8e98 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -42,7 +42,7 @@ gr_make_@BASE_NAME@ (unsigned interpolation,
                     unsigned decimation, 
                     const std::vector<@TAP_TYPE@> &taps)
 {
-  return @SPTR_NAME@ (new @NAME@ (interpolation, decimation, taps));
+  return gnuradio::get_initial_sptr (new @NAME@ (interpolation, decimation, taps));
 }
 
 @NAME@::@NAME@ (unsigned interpolation, unsigned decimation,
index 240a84852606fd6bad1d663fa9d3639c211b0a77..57b26b22fab5dac9bfc22bfb8358594b580f329d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -24,7 +24,9 @@
 #include "config.h"
 #endif
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE            // ask for GNU extensions if available
+#endif
 
 #include <gr_sincos.h>
 #include <math.h>
index bd59e53ace25b846d75559f3115bbb2bc837a9d4..da919b35c678a93bf4279f7669e3f4b657be4779 100644 (file)
@@ -71,12 +71,12 @@ public:
     d_prev_output = 0;
   }
 
-  tap_type prev_output () { return d_prev_output; }
+  o_type prev_output () { return d_prev_output; }
     
 protected:
   tap_type     d_alpha;
   tap_type     d_one_minus_alpha;
-  tap_type     d_prev_output;
+  o_type       d_prev_output;
 };
 
 
@@ -87,7 +87,7 @@ template<class o_type, class i_type, class tap_type>
 o_type
 gr_single_pole_iir<o_type, i_type, tap_type>::filter (const i_type input)
 {
-  tap_type     output;
+  o_type       output;
 
   output = d_alpha * input + d_one_minus_alpha * d_prev_output;
   d_prev_output = output;
index e4269798be3a01d33617dbea09b8e7786d0502a9..8f8efb7e6b788e9d8346e0d07027cd662f7327ff 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_single_pole_iir_filter_cc_sptr 
 gr_make_single_pole_iir_filter_cc (double alpha, unsigned int vlen)
 {
-  return gr_single_pole_iir_filter_cc_sptr(new gr_single_pole_iir_filter_cc(alpha, vlen));
+  return gnuradio::get_initial_sptr(new gr_single_pole_iir_filter_cc(alpha, vlen));
 }
 
 gr_single_pole_iir_filter_cc::gr_single_pole_iir_filter_cc (
index a71861ba8f487b494f33c6091bd3863c5954808b..3282f1fc37da1b0277e850ccb922262f6dc2ea8b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_single_pole_iir_filter_ff_sptr 
 gr_make_single_pole_iir_filter_ff (double alpha, unsigned int vlen)
 {
-  return gr_single_pole_iir_filter_ff_sptr(new gr_single_pole_iir_filter_ff(alpha, vlen));
+  return gnuradio::get_initial_sptr(new gr_single_pole_iir_filter_ff(alpha, vlen));
 }
 
 gr_single_pole_iir_filter_ff::gr_single_pole_iir_filter_ff (
diff --git a/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.cc.t b/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.cc.t
new file mode 100644 (file)
index 0000000..1540688
--- /dev/null
@@ -0,0 +1,121 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <@NAME@.h>
+
+@NAME@::@NAME@(const std::vector<@TAP_TYPE@> &taps)
+{
+  d_buffer = NULL;
+  set_taps(taps);
+}
+
+@NAME@::~@NAME@()
+{
+  if(d_buffer != NULL)
+    free(d_buffer);
+}
+
+void
+@NAME@::set_taps (const std::vector<@TAP_TYPE@> &taps)
+{
+  d_taps = gr_reverse(taps);
+  
+  if(d_buffer != NULL) {
+    free(d_buffer);
+    d_buffer = NULL;
+  }
+  
+  // FIXME: memalign this to 16-byte boundaries for SIMD later
+  size_t t = sizeof(@I_TYPE@) * 2 * d_taps.size();
+  d_buffer = (@I_TYPE@*)malloc(t);
+  memset(d_buffer, 0x00, t);
+  d_idx = 0;
+}
+
+@O_TYPE@
+@NAME@::filter (@I_TYPE@ input)
+{
+  unsigned int i;
+
+  d_buffer[d_idx] = input;
+  d_buffer[d_idx+ntaps()] = input;
+
+  // using the later for the case when ntaps=0;
+  // profiling shows this doesn't make a difference
+  //d_idx = (d_idx + 1) % ntaps();
+  d_idx++;
+  if(d_idx >= ntaps())
+    d_idx = 0;
+
+  @ACC_TYPE@ out = 0;
+  for(i = 0; i < ntaps(); i++) {
+    out += @INPUT_CAST@ d_buffer[d_idx + i] * d_taps[i];
+  }
+  return (@O_TYPE@)out;
+}
+
+@O_TYPE@
+@NAME@::filter (const @I_TYPE@ input[], unsigned long dec)
+{
+  unsigned int i;
+
+  for(i = 0; i < dec; i++) {
+    d_buffer[d_idx] = input[i];
+    d_buffer[d_idx+ntaps()] = input[i];
+    d_idx++;
+    if(d_idx >= ntaps())
+      d_idx = 0;
+  }
+
+  @ACC_TYPE@ out = 0;
+  for(i = 0; i < ntaps(); i++) {
+    out += @INPUT_CAST@ d_buffer[d_idx + i] * d_taps[i];
+  }
+  return (@O_TYPE@)out;
+}
+
+void
+@NAME@::filterN (@O_TYPE@ output[],
+                const @I_TYPE@ input[],
+                unsigned long n)
+{
+  for(unsigned long i = 0; i < n; i++) {
+    output[i] = filter(input[i]);
+  }
+}
+
+void
+@NAME@::filterNdec (@O_TYPE@ output[],
+                   const @I_TYPE@ input[],
+                   unsigned long n,
+                   unsigned long decimate)
+{
+  unsigned long j = 0;
+  for(unsigned long i = 0; i < n; i++) {
+    output[i] = filter(&input[j], decimate);
+    j += decimate;
+  }
+}
diff --git a/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.h.t b/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.h.t
new file mode 100644 (file)
index 0000000..23d64b6
--- /dev/null
@@ -0,0 +1,131 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+/*
+ * WARNING: This file is automatically generated by generate_gri_fir_XXX.py
+ * Any changes made to this file will be overwritten.
+ */
+
+
+#ifndef @GUARD_NAME@
+#define @GUARD_NAME@
+
+#include <vector>
+#include <gr_types.h>
+#include <gr_reverse.h>
+#include <string.h>
+#include <cstdio>
+
+/*!
+ * \brief FIR with internal buffer for @I_TYPE@ input, 
+          @O_TYPE@ output and @TAP_TYPE@ taps
+ * \ingroup filter
+ * 
+ */
+
+class @NAME@ {
+
+protected:
+  std::vector<@TAP_TYPE@>      d_taps;         // reversed taps
+  @I_TYPE@                     *d_buffer;
+  unsigned int                  d_idx;
+
+public:
+
+  // CONSTRUCTORS
+
+  /*!
+   * \brief construct new FIR with given taps.
+   *
+   * Note that taps must be in forward order, e.g., coefficient 0 is
+   * stored in new_taps[0], coefficient 1 is stored in
+   * new_taps[1], etc.
+   */
+  @NAME@ (const std::vector<@TAP_TYPE@> &taps);
+
+  ~@NAME@ ();
+
+  // MANIPULATORS
+
+  /*!
+   * \brief compute a single output value.
+   *
+   * \p input is a single input value of the filter type
+   *
+   * \returns the filtered input value.
+   */
+  @O_TYPE@ filter (@I_TYPE@ input);
+
+  
+  /*!
+   * \brief compute a single output value; designed for decimating filters.
+   *
+   * \p input is a single input value of the filter type. The value of dec is the
+   *    decimating value of the filter, so input[] must have dec valid values.
+   *    The filter pushes dec number of items onto the circ. buffer before computing
+   *    a single output.
+   *
+   * \returns the filtered input value.
+   */
+  @O_TYPE@ filter (const @I_TYPE@ input[], unsigned long dec);
+
+  /*!
+   * \brief compute an array of N output values.
+   *
+   * \p input must have (n - 1 + ntaps()) valid entries.
+   * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values.
+   */
+  void filterN (@O_TYPE@ output[], const @I_TYPE@ input[],
+               unsigned long n);
+
+  /*!
+   * \brief compute an array of N output values, decimating the input
+   *
+   * \p input must have (decimate * (n - 1) + ntaps()) valid entries.
+   * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to 
+   * compute the output values.
+   */
+  void filterNdec (@O_TYPE@ output[], const @I_TYPE@ input[],
+                  unsigned long n, unsigned long decimate);
+
+  /*!
+   * \brief install \p new_taps as the current taps.
+   */
+  void set_taps (const std::vector<@TAP_TYPE@> &taps);
+
+  // ACCESSORS
+
+  /*!
+   * \return number of taps in filter.
+   */
+  unsigned ntaps () const { return d_taps.size (); }
+
+  /*!
+   * \return current taps
+   */
+  const std::vector<@TAP_TYPE@> get_taps () const
+  {
+    return gr_reverse(d_taps);
+  }
+};
+
+#endif /* @GUARD_NAME@ */
index f0314e400449bdae5921e444db2688efdb5c29a0..85e66c069b43ddfac512acfffabd66c1bcfea46e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2011 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
 #include <gri_goertzel.h>
 
 gri_goertzel::gri_goertzel(int rate, int len, float freq)
+{
+  gri_setparms(rate, len, freq);
+}
+
+void
+gri_goertzel::gri_setparms(int rate, int len, float freq)
 {
   d_d1 = 0.0;
   d_d2 = 0.0;
@@ -32,9 +38,9 @@ gri_goertzel::gri_goertzel(int rate, int len, float freq)
   float w = 2.0*M_PI*freq/rate;
   d_wr = 2.0*std::cos(w);
   d_wi = std::sin(w);
-
   d_len = len;
   d_processed = 0;
+
 }
 
 gr_complex gri_goertzel::batch(float *in)
index 86d3d34d36111e2f8ad89d73c803a2ca7c2a2f94..e062f000e01c83e42c38948d195bd9c7a6c48b6b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,6 +34,7 @@ class gri_goertzel
 public:
   gri_goertzel() {}
   gri_goertzel(int rate, int len, float freq);
+  void gri_setparms(int rate, int len, float freq);
 
   // Process a input array
   gr_complex batch(float *in);
index 878d48023b717bad84eed436e57679841ab643e1..0d03cb0ee1a4cfce3a7f9ddc96177546b051a294 100644 (file)
 #include <qa_gri_mmse_fir_interpolator.h>
 #include <qa_gri_mmse_fir_interpolator_cc.h>
 #include <qa_gr_rotator.h>
+#include <qa_gri_fir_filter_with_buffer_ccf.h>
+#include <qa_gri_fir_filter_with_buffer_ccc.h>
+#include <qa_gri_fir_filter_with_buffer_fcc.h>
+#include <qa_gri_fir_filter_with_buffer_fff.h>
+#include <qa_gri_fir_filter_with_buffer_fsf.h>
+#include <qa_gri_fir_filter_with_buffer_scc.h>
 
 CppUnit::TestSuite *
 qa_filter::suite ()
@@ -51,6 +57,12 @@ qa_filter::suite ()
   s->addTest (qa_gri_mmse_fir_interpolator::suite ());
   s->addTest (qa_gri_mmse_fir_interpolator_cc::suite ());
   s->addTest (qa_gr_rotator::suite ());
+  s->addTest (qa_gri_fir_filter_with_buffer_ccf::suite ());
+  s->addTest (qa_gri_fir_filter_with_buffer_ccc::suite ());
+  s->addTest (qa_gri_fir_filter_with_buffer_fcc::suite ());
+  s->addTest (qa_gri_fir_filter_with_buffer_fff::suite ());
+  s->addTest (qa_gri_fir_filter_with_buffer_fsf::suite ());
+  s->addTest (qa_gri_fir_filter_with_buffer_scc::suite ());
 
   return s;
 }
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc
new file mode 100644 (file)
index 0000000..e87d93e
--- /dev/null
@@ -0,0 +1,160 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_types.h>
+#include <qa_gri_fir_filter_with_buffer_ccc.h>
+#include <gri_fir_filter_with_buffer_ccc.h>
+#include <string.h>
+#include <iostream>
+#include <cmath>
+#include <cppunit/TestAssert.h>
+#include <random.h>
+#include <malloc16.h>
+#include <string.h>
+
+typedef gr_complex     i_type;
+typedef gr_complex     o_type;
+typedef gr_complex     tap_type;
+typedef        gr_complex      acc_type;
+
+using std::vector;
+
+#define        ERR_DELTA       (1e-5)
+
+#define        NELEM(x) (sizeof (x) / sizeof (x[0]))
+
+static float
+uniform ()
+{
+  return 2.0 * ((float) random () / RANDOM_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_complex (gr_complex *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++){
+    float re = rint (uniform () * 32767);
+    float im = rint (uniform () * 32767);
+    buf[i] = gr_complex (re, im);
+  }
+}
+
+static o_type
+ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
+{
+  acc_type     sum = 0;
+  for (int i = 0; i < ntaps; i++) {
+    sum += input[i] * taps[i];
+  }
+      
+  return sum;
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccc::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccc::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccc::t3 ()
+{
+  test_decimate(5);
+}
+
+//
+// Test for ntaps in [0,9], and input lengths in [0,17].
+// This ensures that we are building the shifted taps correctly,
+// and exercises all corner cases on input alignment and length.
+//
+void
+qa_gri_fir_filter_with_buffer_ccc::test_decimate(unsigned int decimate)
+{
+  const int    MAX_TAPS        = 9;
+  const int    OUTPUT_LEN      = 17;
+  const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
+
+  // Mem aligned buffer not really necessary, but why not?
+  i_type       *input = (i_type *)malloc16Align(INPUT_LEN * sizeof(i_type));
+  i_type       *dline = (i_type*)malloc16Align(INPUT_LEN * sizeof(i_type));
+  o_type       expected_output[OUTPUT_LEN];
+  o_type       actual_output[OUTPUT_LEN];
+  tap_type     taps[MAX_TAPS];
+
+  srandom (0); // we want reproducibility
+  memset(dline, 0, INPUT_LEN*sizeof(i_type));
+
+  for (int n = 0; n <= MAX_TAPS; n++){
+    for (int ol = 0; ol <= OUTPUT_LEN; ol++){
+
+      // cerr << "@@@ n:ol " << n << ":" << ol << endl;
+
+      // build random test case
+      random_complex (input, INPUT_LEN);
+      random_complex (taps, MAX_TAPS);
+
+      // compute expected output values
+      memset(dline, 0, INPUT_LEN*sizeof(i_type));
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       // use an actual delay line for this test
+       for(int dd = 0; dd < (int)decimate; dd++) {
+         for(int oo = INPUT_LEN-1; oo > 0; oo--)
+           dline[oo] = dline[oo-1];
+         dline[0] = input[decimate*o+dd];
+       }
+       expected_output[o] = ref_dotprod (dline, taps, n);
+      }
+
+      // build filter
+      vector<tap_type> f1_taps(&taps[0], &taps[n]);
+      gri_fir_filter_with_buffer_ccc *f1 = new gri_fir_filter_with_buffer_ccc(f1_taps);
+
+      // zero the output, then do the filtering
+      memset (actual_output, 0, sizeof (actual_output));
+      f1->filterNdec (actual_output, input, ol/decimate, decimate);
+
+      // check results
+      //
+      // we use a sloppy error margin because on the x86 architecture,
+      // our reference implementation is using 80 bit floating point
+      // arithmetic, while the SSE version is using 32 bit float point
+      // arithmetic.
+      
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o],
+                                      abs (expected_output[o]) * ERR_DELTA);
+      }
+      delete f1;
+    }
+  }
+  free16Align(input);
+}
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.h b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.h
new file mode 100644 (file)
index 0000000..f9f206f
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+#ifndef _QA_GRI_FIR_FILTER_WITH_BUFFER_CCC_H_
+#define _QA_GRI_FIR_FILTER_WITH_BUFFER_CCC_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gri_fir_filter_with_buffer_ccc : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_ccc);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void test_decimate(unsigned int decimate);
+
+  void t1 ();
+  void t2 ();
+  void t3 ();
+
+};
+
+
+#endif /* _QA_GR_FIR_FILTER_WITH_BUFFER_CCC_H_ */
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.cc
new file mode 100644 (file)
index 0000000..c25853b
--- /dev/null
@@ -0,0 +1,167 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_types.h>
+#include <qa_gri_fir_filter_with_buffer_ccf.h>
+#include <gri_fir_filter_with_buffer_ccf.h>
+#include <string.h>
+#include <iostream>
+#include <cmath>
+#include <cppunit/TestAssert.h>
+#include <random.h>
+#include <malloc16.h>
+#include <string.h>
+
+typedef gr_complex     i_type;
+typedef gr_complex     o_type;
+typedef float          tap_type;
+typedef        gr_complex      acc_type;
+
+using std::vector;
+
+#define        ERR_DELTA       (1e-5)
+
+#define        NELEM(x) (sizeof (x) / sizeof (x[0]))
+
+static float
+uniform ()
+{
+  return 2.0 * ((float) random () / RANDOM_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_floats (float *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++)
+    buf[i] = (float) rint (uniform () * 32767);
+}
+
+static void
+random_complex (gr_complex *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++){
+    float re = rint (uniform () * 32767);
+    float im = rint (uniform () * 32767);
+    buf[i] = gr_complex (re, im);
+  }
+}
+
+static o_type
+ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
+{
+  acc_type     sum = 0;
+  for (int i = 0; i < ntaps; i++) {
+    sum += input[i] * taps[i];
+  }
+      
+  return sum;
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccf::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccf::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccf::t3 ()
+{
+  test_decimate(5);
+}
+
+//
+// Test for ntaps in [0,9], and input lengths in [0,17].
+// This ensures that we are building the shifted taps correctly,
+// and exercises all corner cases on input alignment and length.
+//
+void
+qa_gri_fir_filter_with_buffer_ccf::test_decimate (unsigned int decimate)
+{
+  const int    MAX_TAPS        = 9;
+  const int    OUTPUT_LEN      = 17;
+  const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
+
+  // Mem aligned buffer not really necessary, but why not?
+  i_type       *input = (i_type *)malloc16Align(INPUT_LEN * sizeof(i_type));
+  i_type       *dline = (i_type*)malloc16Align(INPUT_LEN * sizeof(i_type));
+  o_type       expected_output[OUTPUT_LEN];
+  o_type       actual_output[OUTPUT_LEN];
+  tap_type     taps[MAX_TAPS];
+
+  srandom (0); // we want reproducibility
+  memset(dline, 0, INPUT_LEN*sizeof(i_type));
+
+  for (int n = 0; n <= MAX_TAPS; n++){
+    for (int ol = 0; ol <= OUTPUT_LEN; ol++){
+
+      // cerr << "@@@ n:ol " << n << ":" << ol << endl;
+
+      // build random test case
+      random_complex (input, INPUT_LEN);
+      random_floats (taps, MAX_TAPS);
+
+      // compute expected output values
+      memset(dline, 0, INPUT_LEN*sizeof(i_type));
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       // use an actual delay line for this test
+       for(int dd = 0; dd < (int)decimate; dd++) {
+         for(int oo = INPUT_LEN-1; oo > 0; oo--)
+           dline[oo] = dline[oo-1];
+         dline[0] = input[decimate*o+dd];
+       }
+       expected_output[o] = ref_dotprod (dline, taps, n);
+      }
+
+      // build filter
+      vector<tap_type> f1_taps(&taps[0], &taps[n]);
+      gri_fir_filter_with_buffer_ccf *f1 = new gri_fir_filter_with_buffer_ccf(f1_taps);
+
+      // zero the output, then do the filtering
+      memset (actual_output, 0, sizeof (actual_output));
+      f1->filterNdec (actual_output, input, ol/decimate, decimate);
+
+      // check results
+      //
+      // we use a sloppy error margin because on the x86 architecture,
+      // our reference implementation is using 80 bit floating point
+      // arithmetic, while the SSE version is using 32 bit float point
+      // arithmetic.
+      
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o],
+                                      abs (expected_output[o]) * ERR_DELTA);
+      }
+      delete f1;
+    }
+  }
+  free16Align(input);
+}
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.h b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.h
new file mode 100644 (file)
index 0000000..924b4bc
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+#ifndef _QA_GRI_FIR_FILTER_WITH_BUFFER_CCF_H_
+#define _QA_GRI_FIR_FILTER_WITH_BUFFER_CCF_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gri_fir_filter_with_buffer_ccf : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_ccf);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void test_decimate(unsigned int decimate);
+
+  void t1 ();
+  void t2 ();
+  void t3 ();
+
+};
+
+
+#endif /* _QA_GR_FIR_FILTER_WITH_BUFFER_CCF_H_ */
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.cc
new file mode 100644 (file)
index 0000000..19f2702
--- /dev/null
@@ -0,0 +1,168 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_types.h>
+#include <qa_gri_fir_filter_with_buffer_fcc.h>
+#include <gri_fir_filter_with_buffer_fcc.h>
+#include <string.h>
+#include <iostream>
+#include <cmath>
+#include <cppunit/TestAssert.h>
+#include <random.h>
+#include <malloc16.h>
+#include <string.h>
+
+typedef float          i_type;
+typedef gr_complex     o_type;
+typedef gr_complex     tap_type;
+typedef        gr_complex      acc_type;
+
+using std::vector;
+
+#define        ERR_DELTA       (1e-5)
+
+#define        NELEM(x) (sizeof (x) / sizeof (x[0]))
+
+static float
+uniform ()
+{
+  return 2.0 * ((float) random () / RANDOM_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_floats (float *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++)
+    buf[i] = (float) rint (uniform () * 32767);
+}
+
+static void
+random_complex (gr_complex *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++){
+    float re = rint (uniform () * 32767);
+    float im = rint (uniform () * 32767);
+    buf[i] = gr_complex (re, im);
+  }
+}
+
+static o_type
+ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
+{
+  acc_type     sum = 0;
+  for (int i = 0; i < ntaps; i++) {
+    sum += input[i] * taps[i];
+  }
+      
+  return sum;
+}
+
+void
+qa_gri_fir_filter_with_buffer_fcc::t1()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fcc::t2()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fcc::t3()
+{
+  test_decimate(5);
+}
+
+
+//
+// Test for ntaps in [0,9], and input lengths in [0,17].
+// This ensures that we are building the shifted taps correctly,
+// and exercises all corner cases on input alignment and length.
+//
+void
+qa_gri_fir_filter_with_buffer_fcc::test_decimate(unsigned int decimate)
+{
+  const int    MAX_TAPS        = 9;
+  const int    OUTPUT_LEN      = 17;
+  const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
+
+  // Mem aligned buffer not really necessary, but why not?
+  i_type       *input = (i_type *)malloc16Align(INPUT_LEN * sizeof(i_type));
+  i_type       *dline = (i_type*)malloc16Align(INPUT_LEN * sizeof(i_type));
+  o_type       expected_output[OUTPUT_LEN];
+  o_type       actual_output[OUTPUT_LEN];
+  tap_type     taps[MAX_TAPS];
+
+  srandom (0); // we want reproducibility
+  memset(dline, 0, INPUT_LEN*sizeof(i_type));
+
+  for (int n = 0; n <= MAX_TAPS; n++){
+    for (int ol = 0; ol <= OUTPUT_LEN; ol++){
+
+      // cerr << "@@@ n:ol " << n << ":" << ol << endl;
+
+      // build random test case
+      random_floats (input, INPUT_LEN);
+      random_complex (taps, MAX_TAPS);
+
+      // compute expected output values
+      memset(dline, 0, INPUT_LEN*sizeof(i_type));
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       // use an actual delay line for this test
+       for(int dd = 0; dd < (int)decimate; dd++) {
+         for(int oo = INPUT_LEN-1; oo > 0; oo--)
+           dline[oo] = dline[oo-1];
+         dline[0] = input[decimate*o+dd];
+       }
+       expected_output[o] = ref_dotprod (dline, taps, n);
+      }
+
+      // build filter
+      vector<tap_type> f1_taps(&taps[0], &taps[n]);
+      gri_fir_filter_with_buffer_fcc *f1 = new gri_fir_filter_with_buffer_fcc(f1_taps);
+
+      // zero the output, then do the filtering
+      memset (actual_output, 0, sizeof (actual_output));
+      f1->filterNdec (actual_output, input, ol/decimate, decimate);
+
+      // check results
+      //
+      // we use a sloppy error margin because on the x86 architecture,
+      // our reference implementation is using 80 bit floating point
+      // arithmetic, while the SSE version is using 32 bit float point
+      // arithmetic.
+      
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o],
+                                      abs (expected_output[o]) * ERR_DELTA);
+      }
+      delete f1;
+    }
+  }
+  free16Align(input);
+}
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.h b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.h
new file mode 100644 (file)
index 0000000..6201800
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+#ifndef _QA_GRI_FIR_FILTER_WITH_BUFFER_FCC_H_
+#define _QA_GRI_FIR_FILTER_WITH_BUFFER_FCC_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gri_fir_filter_with_buffer_fcc : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_fcc);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void test_decimate(unsigned int decimate);
+
+  void t1 ();
+  void t2 ();
+  void t3 ();
+
+};
+
+
+#endif /* _QA_GR_FIR_FILTER_WITH_BUFFER_FCC_H_ */
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.cc
new file mode 100644 (file)
index 0000000..8401e48
--- /dev/null
@@ -0,0 +1,156 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_types.h>
+#include <qa_gri_fir_filter_with_buffer_fff.h>
+#include <gri_fir_filter_with_buffer_fff.h>
+#include <string.h>
+#include <iostream>
+#include <cmath>
+#include <cppunit/TestAssert.h>
+#include <random.h>
+#include <malloc16.h>
+#include <string.h>
+
+typedef float  i_type;
+typedef float  o_type;
+typedef float  tap_type;
+typedef        float   acc_type;
+
+using std::vector;
+
+#define        ERR_DELTA       (1e-5)
+
+#define        NELEM(x) (sizeof (x) / sizeof (x[0]))
+
+static float
+uniform ()
+{
+  return 2.0 * ((float) random () / RANDOM_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_floats (float *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++)
+    buf[i] = (float) rint (uniform () * 32767);
+}
+
+static o_type
+ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
+{
+  acc_type     sum = 0;
+  for (int i = 0; i < ntaps; i++) {
+    sum += input[i] * taps[i];
+  }
+  return sum;
+}
+
+void
+qa_gri_fir_filter_with_buffer_fff::t1 ()  
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fff::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fff::t3 ()
+{
+  test_decimate(5);
+}
+
+//
+// Test for ntaps in [0,9], and input lengths in [0,17].
+// This ensures that we are building the shifted taps correctly,
+// and exercises all corner cases on input alignment and length.
+//
+void
+qa_gri_fir_filter_with_buffer_fff::test_decimate(unsigned int decimate)
+{
+  const int    MAX_TAPS        = 9;
+  const int    OUTPUT_LEN      = 17;
+  const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
+
+  // Mem aligned buffer not really necessary, but why not?
+  i_type       *input = (i_type *)malloc16Align(INPUT_LEN * sizeof(i_type));
+  i_type       *dline = (i_type*)malloc16Align(INPUT_LEN * sizeof(i_type));
+  o_type       expected_output[OUTPUT_LEN];
+  o_type       actual_output[OUTPUT_LEN];
+  tap_type     taps[MAX_TAPS];
+
+  srandom (0); // we want reproducibility
+  memset(dline, 0, INPUT_LEN*sizeof(i_type));
+
+  for (int n = 0; n <= MAX_TAPS; n++){
+    for (int ol = 0; ol <= OUTPUT_LEN; ol++){
+
+      // cerr << "@@@ n:ol " << n << ":" << ol << endl;
+
+      // build random test case
+      random_floats (input, INPUT_LEN);
+      random_floats (taps, MAX_TAPS);
+
+      // compute expected output values
+      memset(dline, 0, INPUT_LEN*sizeof(i_type));
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       // use an actual delay line for this test
+       for(int dd = 0; dd < (int)decimate; dd++) {
+         for(int oo = INPUT_LEN-1; oo > 0; oo--)
+           dline[oo] = dline[oo-1];
+         dline[0] = input[decimate*o+dd];
+       }
+       expected_output[o] = ref_dotprod (dline, taps, n);
+      }
+
+      // build filter
+      vector<tap_type> f1_taps(&taps[0], &taps[n]);
+      gri_fir_filter_with_buffer_fff *f1 = new gri_fir_filter_with_buffer_fff(f1_taps);
+
+      // zero the output, then do the filtering
+      memset (actual_output, 0, sizeof (actual_output));
+      f1->filterNdec (actual_output, input, ol/decimate, decimate);
+
+      // check results
+      //
+      // we use a sloppy error margin because on the x86 architecture,
+      // our reference implementation is using 80 bit floating point
+      // arithmetic, while the SSE version is using 32 bit float point
+      // arithmetic.
+      
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       CPPUNIT_ASSERT_DOUBLES_EQUAL(expected_output[o], actual_output[o],
+                                    fabsf (expected_output[o]) * ERR_DELTA);
+      }
+      delete f1;
+    }
+  }
+  free16Align(input);
+}
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.h b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.h
new file mode 100644 (file)
index 0000000..54a9cdc
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+#ifndef _QA_GRI_FIR_FILTER_WITH_BUFFER_FFF_H_
+#define _QA_GRI_FIR_FILTER_WITH_BUFFER_FFF_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gri_fir_filter_with_buffer_fff : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_fff);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void test_decimate(unsigned int decimate);
+
+  void t1 ();
+  void t2 ();
+  void t3 ();
+
+};
+
+
+#endif /* _QA_GR_FIR_FILTER_WITH_BUFFER_FFF_H_ */
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc
new file mode 100644 (file)
index 0000000..0915053
--- /dev/null
@@ -0,0 +1,147 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_types.h>
+#include <qa_gri_fir_filter_with_buffer_fsf.h>
+#include <gri_fir_filter_with_buffer_fsf.h>
+#include <string.h>
+#include <iostream>
+#include <cmath>
+#include <cppunit/TestAssert.h>
+#include <random.h>
+#include <malloc16.h>
+#include <string.h>
+
+typedef float   i_type;
+typedef short  o_type;
+typedef float  tap_type;
+typedef        float   acc_type;
+
+using std::vector;
+
+#define        NELEM(x) (sizeof (x) / sizeof (x[0]))
+
+static float
+uniform ()
+{
+  return 2.0 * ((float) random () / RANDOM_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_floats (float *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++)
+    buf[i] = (float) rint (uniform () * 128);
+}
+
+static o_type
+ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
+{
+  acc_type     sum = 0;
+  for (int i = 0; i < ntaps; i++) {
+    sum += input[i] * taps[i];
+  }
+  return (o_type)sum;
+}
+
+void
+qa_gri_fir_filter_with_buffer_fsf::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fsf::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fsf::t3 ()
+{
+  test_decimate(5);
+}
+
+//
+// Test for ntaps in [0,9], and input lengths in [0,17].
+// This ensures that we are building the shifted taps correctly,
+// and exercises all corner cases on input alignment and length.
+//
+void
+qa_gri_fir_filter_with_buffer_fsf::test_decimate (unsigned int decimate)  
+{
+  const int    MAX_TAPS        = 9;
+  const int    OUTPUT_LEN      = 17;
+  const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
+
+  // Mem aligned buffer not really necessary, but why not?
+  i_type       *input = (i_type *)malloc16Align(INPUT_LEN * sizeof(i_type));
+  i_type       *dline = (i_type*)malloc16Align(INPUT_LEN * sizeof(i_type));
+  o_type       expected_output[OUTPUT_LEN];
+  o_type       actual_output[OUTPUT_LEN];
+  tap_type     taps[MAX_TAPS];
+
+  srandom (0); // we want reproducibility
+  memset(dline, 0, INPUT_LEN*sizeof(i_type));
+
+  for (int n = 0; n <= MAX_TAPS; n++){
+    for (int ol = 0; ol <= OUTPUT_LEN; ol++){
+
+      // cerr << "@@@ n:ol " << n << ":" << ol << endl;
+
+      // build random test case
+      random_floats (input, INPUT_LEN);
+      random_floats (taps, MAX_TAPS);
+
+      // compute expected output values
+      memset(dline, 0, INPUT_LEN*sizeof(i_type));
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       // use an actual delay line for this test
+       for(int dd = 0; dd < (int)decimate; dd++) {
+         for(int oo = INPUT_LEN-1; oo > 0; oo--)
+           dline[oo] = dline[oo-1];
+         dline[0] = input[decimate*o+dd];
+       }
+       expected_output[o] = ref_dotprod (dline, taps, n);
+      }
+
+      // build filter
+      vector<tap_type> f1_taps(&taps[0], &taps[n]);
+      gri_fir_filter_with_buffer_fsf *f1 = new gri_fir_filter_with_buffer_fsf(f1_taps);
+
+      // zero the output, then do the filtering
+      memset (actual_output, 0, sizeof (actual_output));
+      f1->filterNdec (actual_output, input, ol/decimate, decimate);
+
+      // check results
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       CPPUNIT_ASSERT_EQUAL(expected_output[o], actual_output[o]);
+      }
+      delete f1;
+    }
+  }
+  free16Align(input);
+}
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.h b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.h
new file mode 100644 (file)
index 0000000..9c90146
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+#ifndef _QA_GRI_FIR_FILTER_WITH_BUFFER_FSF_H_
+#define _QA_GRI_FIR_FILTER_WITH_BUFFER_FSF_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gri_fir_filter_with_buffer_fsf : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_fsf);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void test_decimate(unsigned int decimate);
+  
+  void t1 ();
+  void t2 ();
+  void t3 ();
+
+};
+
+
+#endif /* _QA_GR_FIR_FILTER_WITH_BUFFER_FSF_H_ */
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc
new file mode 100644 (file)
index 0000000..03cd710
--- /dev/null
@@ -0,0 +1,167 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gr_types.h>
+#include <qa_gri_fir_filter_with_buffer_scc.h>
+#include <gri_fir_filter_with_buffer_scc.h>
+#include <string.h>
+#include <iostream>
+#include <cmath>
+#include <cppunit/TestAssert.h>
+#include <random.h>
+#include <malloc16.h>
+#include <string.h>
+
+typedef short          i_type;
+typedef gr_complex     o_type;
+typedef gr_complex     tap_type;
+typedef        gr_complex      acc_type;
+
+using std::vector;
+
+#define        ERR_DELTA       (1e-5)
+
+#define        NELEM(x) (sizeof (x) / sizeof (x[0]))
+
+static float
+uniform ()
+{
+  return 2.0 * ((float) random () / RANDOM_MAX - 0.5); // uniformly (-1, 1)
+}
+
+static void
+random_shorts (short *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++)
+    buf[i] = (short) rint (uniform () * 16384);
+}
+
+static void
+random_complex (gr_complex *buf, unsigned n)
+{
+  for (unsigned i = 0; i < n; i++){
+    float re = rint (uniform () * 32767);
+    float im = rint (uniform () * 32767);
+    buf[i] = gr_complex (re, im);
+  }
+}
+
+static o_type
+ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
+{
+  acc_type     sum = 0;
+  for (int i = 0; i < ntaps; i++) {
+    sum += (float)input[i] * taps[i];
+  }
+      
+  return sum;
+}
+
+void
+qa_gri_fir_filter_with_buffer_scc::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_scc::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_scc::t3 ()
+{
+  test_decimate(5);
+}
+
+//
+// Test for ntaps in [0,9], and input lengths in [0,17].
+// This ensures that we are building the shifted taps correctly,
+// and exercises all corner cases on input alignment and length.
+//
+void
+qa_gri_fir_filter_with_buffer_scc::test_decimate (unsigned int decimate)
+{
+  const int    MAX_TAPS        = 9;
+  const int    OUTPUT_LEN      = 17;
+  const int    INPUT_LEN       = MAX_TAPS + OUTPUT_LEN;
+
+  // Mem aligned buffer not really necessary, but why not?
+  i_type       *input = (i_type *)malloc16Align(INPUT_LEN * sizeof(i_type));
+  i_type       *dline = (i_type*)malloc16Align(INPUT_LEN * sizeof(i_type));
+  o_type       expected_output[OUTPUT_LEN];
+  o_type       actual_output[OUTPUT_LEN];
+  tap_type     taps[MAX_TAPS];
+
+  srandom (0); // we want reproducibility
+  memset(dline, 0, INPUT_LEN*sizeof(i_type));
+
+  for (int n = 0; n <= MAX_TAPS; n++){
+    for (int ol = 0; ol <= OUTPUT_LEN; ol++){
+
+      // cerr << "@@@ n:ol " << n << ":" << ol << endl;
+
+      // build random test case
+      random_shorts (input, INPUT_LEN);
+      random_complex (taps, MAX_TAPS);
+
+      // compute expected output values
+      memset(dline, 0, INPUT_LEN*sizeof(i_type));
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       // use an actual delay line for this test
+       for(int dd = 0; dd < (int)decimate; dd++) {
+         for(int oo = INPUT_LEN-1; oo > 0; oo--)
+           dline[oo] = dline[oo-1];
+         dline[0] = input[decimate*o+dd];
+       }
+       expected_output[o] = ref_dotprod (dline, taps, n);
+      }
+
+      // build filter
+      vector<tap_type> f1_taps(&taps[0], &taps[n]);
+      gri_fir_filter_with_buffer_scc *f1 = new gri_fir_filter_with_buffer_scc(f1_taps);
+
+      // zero the output, then do the filtering
+      memset (actual_output, 0, sizeof (actual_output));
+      f1->filterNdec (actual_output, input, ol/decimate, decimate);
+
+      // check results
+      //
+      // we use a sloppy error margin because on the x86 architecture,
+      // our reference implementation is using 80 bit floating point
+      // arithmetic, while the SSE version is using 32 bit float point
+      // arithmetic.
+
+      for (int o = 0; o < (int)(ol/decimate); o++){
+       CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o],
+                                      abs (expected_output[o]) * ERR_DELTA);
+      }
+      delete f1;
+    }
+  }
+  free16Align(input);
+}
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.h b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.h
new file mode 100644 (file)
index 0000000..970ca37
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+#ifndef _QA_GRI_FIR_FILTER_WITH_BUFFER_SCC_H_
+#define _QA_GRI_FIR_FILTER_WITH_BUFFER_SCC_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_gri_fir_filter_with_buffer_scc : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_scc);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void test_decimate(unsigned int decimate);
+
+  void t1 ();
+  void t2 ();
+  void t3 ();
+
+};
+
+
+#endif /* _QA_GR_FIR_FILTER_WITH_BUFFER_SCC_H_ */
index 91e02c2d3e52bd5f6f05d355876326fa8c20f1c3..f390df6d5d9c386ab5de98b95d57d035180403bc 100644 (file)
@@ -30,7 +30,7 @@
 gr_additive_scrambler_bb_sptr
 gr_make_additive_scrambler_bb(int mask, int seed, int len, int count)
 {
-  return gr_additive_scrambler_bb_sptr(new gr_additive_scrambler_bb(mask, seed, len, count));
+  return gnuradio::get_initial_sptr(new gr_additive_scrambler_bb(mask, seed, len, count));
 }
 
 gr_additive_scrambler_bb::gr_additive_scrambler_bb(int mask, int seed, int len, int count)
index 175ca4ab236a9e8458c80418b48c47ef54b51dec..687f6c857155de361140201b24403562b3bb055d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@ gr_agc2_cc_sptr
 gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, 
                 float gain, float max_gain)
 {
-  return gr_agc2_cc_sptr (new gr_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain));
+  return gnuradio::get_initial_sptr(new gr_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain));
 }
 
 gr_agc2_cc::gr_agc2_cc (float attack_rate, float decay_rate, float reference, 
index a9f7fffab83bf086ee8355020fd94808729b0782..667e9d05d56c470b40c8fd77abbadfebc171cd22 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@ gr_agc2_ff_sptr
 gr_make_agc2_ff (float attack_rate, float decay_rate, float reference, 
                 float gain, float max_gain)
 {
-  return gr_agc2_ff_sptr (new gr_agc2_ff (attack_rate, decay_rate, reference, 
+  return gnuradio::get_initial_sptr(new gr_agc2_ff (attack_rate, decay_rate, reference, 
                                          gain, max_gain));
 }
 
index 3f48b55fee836eb4d002d3c74e76778a53d4303d..92cec00883d3aecd0c67e27645fc7094401c5c39 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@ gr_agc_cc_sptr
 gr_make_agc_cc (float rate, float reference, 
                float gain, float max_gain)
 {
-  return gr_agc_cc_sptr (new gr_agc_cc (rate, reference, gain, max_gain));
+  return gnuradio::get_initial_sptr(new gr_agc_cc (rate, reference, gain, max_gain));
 }
 
 gr_agc_cc::gr_agc_cc (float rate, float reference, 
index 9e74fed85037408965a6a3b02e697d3f388f3fce..45c86d898c9696f6ecd031e9dcf80a33d0802446 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_agc_ff_sptr
 gr_make_agc_ff (float rate, float reference, float gain, float max_gain)
 {
-  return gr_agc_ff_sptr (new gr_agc_ff (rate, reference, gain, max_gain));
+  return gnuradio::get_initial_sptr(new gr_agc_ff (rate, reference, gain, max_gain));
 }
 
 gr_agc_ff::gr_agc_ff (float rate, float reference, float gain, float max_gain)
index 241a33f5df8f70755dc0151208578dacfa107079..e11793fdd37d1476add4f8e5678a4e78487a418c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -48,7 +48,7 @@
 gr_align_on_samplenumbers_ss_sptr
 gr_make_align_on_samplenumbers_ss (int nchan, int align_interval)
 {
-  return gr_align_on_samplenumbers_ss_sptr (new gr_align_on_samplenumbers_ss (nchan,align_interval));
+  return gnuradio::get_initial_sptr(new gr_align_on_samplenumbers_ss (nchan,align_interval));
 }
 
 gr_align_on_samplenumbers_ss::gr_align_on_samplenumbers_ss (int nchan,int align_interval)
index 61abd72b86591ad364322a280e5117e8907c4760..435a660cd035b631873105d447340569bb61dadc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@ gr_make_bin_statistics_f(unsigned int vlen,
                        size_t tune_delay,
                        size_t dwell_delay)
 {
-  return gr_bin_statistics_f_sptr(new gr_bin_statistics_f(vlen,
+  return gnuradio::get_initial_sptr(new gr_bin_statistics_f(vlen,
                                                          msgq,
                                                          tune,
                                                          tune_delay,
index 69e85f0bc5b5d7febbd3c6dd6ca398e85f520b81..ae8903abbd636aa78410d6707dd1e5a1d9a8ecbc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_binary_slicer_fb_sptr
 gr_make_binary_slicer_fb ()
 {
-  return gr_binary_slicer_fb_sptr (new gr_binary_slicer_fb ());
+  return gnuradio::get_initial_sptr(new gr_binary_slicer_fb ());
 }
 
 gr_binary_slicer_fb::gr_binary_slicer_fb ()
index 2babe492f61e14ff1536f419a232d19d53da56fc..46044437932d9419760afb26c46bebd9f3f9dce6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@ static const int BITS_PER_BYTE = 8;
 gr_bytes_to_syms_sptr 
 gr_make_bytes_to_syms ()
 {
-  return gr_bytes_to_syms_sptr (new gr_bytes_to_syms ());
+  return gnuradio::get_initial_sptr(new gr_bytes_to_syms ());
 }
 
 gr_bytes_to_syms::gr_bytes_to_syms ()
index 2d3854873a1fb43d5bf9b7d435f7e9fc22c20438..e68f8d2085b956af81c13d187a98751473fff4f9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_char_to_float_sptr
 gr_make_char_to_float ()
 {
-  return gr_char_to_float_sptr (new gr_char_to_float ());
+  return gnuradio::get_initial_sptr(new gr_char_to_float ());
 }
 
 gr_char_to_float::gr_char_to_float ()
index 15c7b98e194e6e2f96e2b41cc12b3bd25fd8be74..bce3088145cde4770820d7d7fbb172ea57bce100 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_check_counting_s_sptr
 gr_make_check_counting_s (bool do_32bit)
 {
-  return gr_check_counting_s_sptr (new gr_check_counting_s (do_32bit));
+  return gnuradio::get_initial_sptr(new gr_check_counting_s (do_32bit));
 }
 
 gr_check_counting_s::gr_check_counting_s (bool do_32bit)
index c5f7bfc47e52e696df52df9a33d09a0b0affcc65..95c6c7da5fc4f998533cfe60d6f4db074f4aa4ad 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_check_lfsr_32k_s_sptr
 gr_make_check_lfsr_32k_s ()
 {
-  return gr_check_lfsr_32k_s_sptr (new gr_check_lfsr_32k_s ());
+  return gnuradio::get_initial_sptr(new gr_check_lfsr_32k_s ());
 }
 
 gr_check_lfsr_32k_s::gr_check_lfsr_32k_s ()
index 468b49a1087246ac2e2a1ddaa77bb3fa8a3ead9d..c9222597a873da93ca5f2081bc7f314d73a9a9d1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -66,7 +66,10 @@ gr_circular_file::gr_circular_file (const char *filename,
       exit (1);
     }
 #ifdef HAVE_MMAP       /* FIXME */
-    ftruncate (d_fd, size + HEADER_SIZE);
+    if(ftruncate (d_fd, size + HEADER_SIZE) != 0) {
+      perror (filename);
+      exit (1);
+    }
 #endif
   }
   else {
index 60e3dd13d59659b9f6623834e1d4f4fef03fd4b6..23bbf821fea3d32309507e4fb2784f6f1ddcc715 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -39,7 +39,7 @@ gr_clock_recovery_mm_cc_sptr
 gr_make_clock_recovery_mm_cc(float omega, float gain_omega, float mu, float gain_mu,
                             float omega_relative_limit)
 {
-  return gr_clock_recovery_mm_cc_sptr (new gr_clock_recovery_mm_cc (omega, 
+  return gnuradio::get_initial_sptr(new gr_clock_recovery_mm_cc (omega, 
                                                                    gain_omega, 
                                                                    mu,
                                                                    gain_mu,
index 2e9eea8e665f6a2aa94db12b88f327d75b9e793a..bb5a27071d85810327267abf5738d64bc3759dd3 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -37,7 +37,7 @@ gr_clock_recovery_mm_ff_sptr
 gr_make_clock_recovery_mm_ff(float omega, float gain_omega, float mu, float gain_mu,
                             float omega_relative_limit)
 {
-  return gr_clock_recovery_mm_ff_sptr (new gr_clock_recovery_mm_ff (omega,
+  return gnuradio::get_initial_sptr(new gr_clock_recovery_mm_ff (omega,
                                                                    gain_omega, 
                                                                    mu,
                                                                    gain_mu,
index fcecf0c8b35adca371b747e5aa7529840a72beeb..d198da0b038eb798b221aa706ca515db57dfc324 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2005 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_complex_to_interleaved_short_sptr
 gr_make_complex_to_interleaved_short ()
 {
-  return gr_complex_to_interleaved_short_sptr (new gr_complex_to_interleaved_short ());
+  return gnuradio::get_initial_sptr(new gr_complex_to_interleaved_short ());
 }
 
 gr_complex_to_interleaved_short::gr_complex_to_interleaved_short ()
index abffa4da13324a4b6dea4b62cfd3dfe5b3e5f2d3..a59c127f38bbf153d8194a88a33fc417ba7aac29 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 gr_complex_to_float_sptr
 gr_make_complex_to_float (unsigned int vlen)
 {
-  return gr_complex_to_float_sptr (new gr_complex_to_float (vlen));
+  return gnuradio::get_initial_sptr(new gr_complex_to_float (vlen));
 }
 
 gr_complex_to_float::gr_complex_to_float (unsigned int vlen)
@@ -81,7 +81,7 @@ gr_complex_to_float::work (int noutput_items,
 gr_complex_to_real_sptr
 gr_make_complex_to_real (unsigned int vlen)
 {
-  return gr_complex_to_real_sptr (new gr_complex_to_real (vlen));
+  return gnuradio::get_initial_sptr(new gr_complex_to_real (vlen));
 }
 
 gr_complex_to_real::gr_complex_to_real (unsigned int vlen)
@@ -112,7 +112,7 @@ gr_complex_to_real::work (int noutput_items,
 gr_complex_to_imag_sptr
 gr_make_complex_to_imag (unsigned int vlen)
 {
-  return gr_complex_to_imag_sptr (new gr_complex_to_imag (vlen));
+  return gnuradio::get_initial_sptr(new gr_complex_to_imag (vlen));
 }
 
 gr_complex_to_imag::gr_complex_to_imag (unsigned int vlen)
@@ -143,7 +143,7 @@ gr_complex_to_imag::work (int noutput_items,
 gr_complex_to_mag_sptr
 gr_make_complex_to_mag (unsigned int vlen)
 {
-  return gr_complex_to_mag_sptr (new gr_complex_to_mag (vlen));
+  return gnuradio::get_initial_sptr(new gr_complex_to_mag (vlen));
 }
 
 gr_complex_to_mag::gr_complex_to_mag (unsigned int vlen)
@@ -174,7 +174,7 @@ gr_complex_to_mag::work (int noutput_items,
 gr_complex_to_mag_squared_sptr
 gr_make_complex_to_mag_squared (unsigned int vlen)
 {
-  return gr_complex_to_mag_squared_sptr (new gr_complex_to_mag_squared (vlen));
+  return gnuradio::get_initial_sptr(new gr_complex_to_mag_squared (vlen));
 }
 
 gr_complex_to_mag_squared::gr_complex_to_mag_squared (unsigned int vlen)
@@ -207,7 +207,7 @@ gr_complex_to_mag_squared::work (int noutput_items,
 gr_complex_to_arg_sptr
 gr_make_complex_to_arg (unsigned int vlen)
 {
-  return gr_complex_to_arg_sptr (new gr_complex_to_arg (vlen));
+  return gnuradio::get_initial_sptr(new gr_complex_to_arg (vlen));
 }
 
 gr_complex_to_arg::gr_complex_to_arg (unsigned int vlen)
index f25ce1a5773b0f566e44c585048f63e680d6a8dd..59c3bae897832a6bd21e287b121128523d6f12c2 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_conjugate_cc_sptr
 gr_make_conjugate_cc ()
 {
-  return gr_conjugate_cc_sptr (new gr_conjugate_cc ());
+  return gnuradio::get_initial_sptr(new gr_conjugate_cc ());
 }
 
 gr_conjugate_cc::gr_conjugate_cc ()
index 43dae6c1a2dbd37ab5f0bb8ea76ab3fd4f080e87..15f67341118cccb8182e39e314035a4935bbfd23 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -37,7 +37,7 @@
 gr_correlate_access_code_bb_sptr
 gr_make_correlate_access_code_bb (const std::string &access_code, int threshold)
 {
-  return gr_correlate_access_code_bb_sptr (new gr_correlate_access_code_bb (access_code, threshold));
+  return gnuradio::get_initial_sptr(new gr_correlate_access_code_bb (access_code, threshold));
 }
 
 
index 4e0f7e067352941753b7d760280d5305fe7478f9..f3bfd095188792e6f92a97b93c3d88ed6e911904 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -38,7 +38,7 @@ gr_make_costas_loop_cc (float alpha, float beta,
                        int order
                        ) throw (std::invalid_argument)
 {
-  return gr_costas_loop_cc_sptr (new gr_costas_loop_cc (alpha, beta,
+  return gnuradio::get_initial_sptr(new gr_costas_loop_cc (alpha, beta,
                                                        max_freq, min_freq,
                                                        order));
 }
index 95d7c1753db588434c195128e7a15f753e704ead..f0b04ef974b6e5edf338d4513d06d8242c09fcf3 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * 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
@@ -31,7 +31,7 @@
 gr_cpfsk_bc_sptr 
 gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym)
 {
-  return gr_cpfsk_bc_sptr(new gr_cpfsk_bc(k, ampl, samples_per_sym));
+  return gnuradio::get_initial_sptr(new gr_cpfsk_bc(k, ampl, samples_per_sym));
 }
 
 gr_cpfsk_bc::gr_cpfsk_bc(float k, float ampl, int samples_per_sym)
index 59034ddc19beac1b2142e95155a7ac3569a319d7..6c1e98d47468ee43422f36e481e5bf3ee87166ec 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -38,7 +38,7 @@ static int max_tone_index = 37;
 gr_ctcss_squelch_ff_sptr
 gr_make_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate)
 {
-  return gr_ctcss_squelch_ff_sptr(new gr_ctcss_squelch_ff(rate, freq, level, len, ramp, gate));
+  return gnuradio::get_initial_sptr(new gr_ctcss_squelch_ff(rate, freq, level, len, ramp, gate));
 }
 
 int gr_ctcss_squelch_ff::find_tone(float freq)
index add036f2082a3d2777cfe5e298e6010b5b674743..d5425bfc841d56474d456960b3effca5f7b2c671 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * 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
@@ -28,7 +28,7 @@
 gr_decode_ccsds_27_fb_sptr 
 gr_make_decode_ccsds_27_fb()
 {
-  return gr_decode_ccsds_27_fb_sptr(new gr_decode_ccsds_27_fb());
+  return gnuradio::get_initial_sptr(new gr_decode_ccsds_27_fb());
 }
 
 gr_decode_ccsds_27_fb::gr_decode_ccsds_27_fb()
index 6530b9675c528e48b929c5079d2f22608a1cf59f..843275366430963754165a7a152fea8ae1658a63 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_deinterleave_sptr
 gr_make_deinterleave (size_t itemsize)
 {
-  return gr_deinterleave_sptr (new gr_deinterleave (itemsize));
+  return gnuradio::get_initial_sptr(new gr_deinterleave (itemsize));
 }
 
 gr_deinterleave::gr_deinterleave (size_t itemsize)
index d52faca39a58f45bd2419e045107f004cb513429..b06346f5959fb70b891f870ee3e9b1596181d4bc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_delay_sptr
 gr_make_delay (size_t itemsize, int delay)
 {
-  return gr_delay_sptr (new gr_delay (itemsize, delay));
+  return gnuradio::get_initial_sptr(new gr_delay (itemsize, delay));
 }
 
 gr_delay::gr_delay (size_t itemsize, int delay)
index e173a8a22598538ecb062978e396dc36871c69e8..b712e69edaa0b27928dd987098e3f6f8bce618fa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_descrambler_bb_sptr
 gr_make_descrambler_bb(int mask, int seed, int len)
 {
-  return gr_descrambler_bb_sptr(new gr_descrambler_bb(mask, seed, len));
+  return gnuradio::get_initial_sptr(new gr_descrambler_bb(mask, seed, len));
 }
 
 gr_descrambler_bb::gr_descrambler_bb(int mask, int seed, int len)
index 1802b3b7707cffb3f79a9b624e42745e3c5a003b..1b0bcfb967d15ce22fdfd5fe72a17ac779651b41 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_diff_decoder_bb_sptr
 gr_make_diff_decoder_bb (unsigned int modulus)
 {
-  return gr_diff_decoder_bb_sptr (new gr_diff_decoder_bb(modulus));
+  return gnuradio::get_initial_sptr(new gr_diff_decoder_bb(modulus));
 }
 
 gr_diff_decoder_bb::gr_diff_decoder_bb (unsigned int modulus)
index 3eb8e62cc4dff28d843ecc4f855ce63c5ad9c58e..7e67a718e04b89ebcbedf726b1ec2a3fce4c9ea4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_diff_encoder_bb_sptr
 gr_make_diff_encoder_bb (unsigned int modulus)
 {
-  return gr_diff_encoder_bb_sptr (new gr_diff_encoder_bb(modulus));
+  return gnuradio::get_initial_sptr(new gr_diff_encoder_bb(modulus));
 }
 
 gr_diff_encoder_bb::gr_diff_encoder_bb (unsigned int modulus)
index 003297ff8459667464aa7ff75d8db0f2a39f2a16..fb6a3a910ee5382b47b6c7c2b8b0f7b775972afc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_diff_phasor_cc_sptr
 gr_make_diff_phasor_cc ()
 {
-  return gr_diff_phasor_cc_sptr (new gr_diff_phasor_cc());
+  return gnuradio::get_initial_sptr(new gr_diff_phasor_cc());
 }
 
 gr_diff_phasor_cc::gr_diff_phasor_cc ()
index f24b2a88e33129f754bf8d1b0ddfa62594c8e994..fcaad21744b644f8e4e1369172f5e5f13cbb3032 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007,2009 Free Software Foundation, Inc.
+ * Copyright 2007,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_dpll_bb_sptr
 gr_make_dpll_bb (float period, float gain)
 {
-  return gr_dpll_bb_sptr (new gr_dpll_bb (period, gain));
+  return gnuradio::get_initial_sptr(new gr_dpll_bb (period, gain));
 }
 
 gr_dpll_bb::gr_dpll_bb (float period, float gain)
index 76b8091f71914b0bb2c752cd17efb99d117b7928..092e91d8b107273e49ce5f6bdbcf0d97699f63fa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * 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
@@ -32,7 +32,7 @@ extern "C" {
 gr_encode_ccsds_27_bb_sptr 
 gr_make_encode_ccsds_27_bb()
 {
-  return gr_encode_ccsds_27_bb_sptr(new gr_encode_ccsds_27_bb());
+  return gnuradio::get_initial_sptr(new gr_encode_ccsds_27_bb());
 }
 
 gr_encode_ccsds_27_bb::gr_encode_ccsds_27_bb()
index 02385c59e407de3fcfaa3720a51b026b4bacfc0b..24945cfd8a459ee5a9acefb8af17cf5ec0e6166e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@ static const int PAD_VAL = 0xAA;
 gr_fake_channel_encoder_pp_sptr
 gr_make_fake_channel_encoder_pp(int input_vlen, int output_vlen)
 {
-  return gr_fake_channel_encoder_pp_sptr(new gr_fake_channel_encoder_pp(input_vlen,
+  return gnuradio::get_initial_sptr(new gr_fake_channel_encoder_pp(input_vlen,
                                                                        output_vlen));
 }
 
@@ -77,7 +77,7 @@ gr_fake_channel_encoder_pp::work (int noutput_items,
 gr_fake_channel_decoder_pp_sptr
 gr_make_fake_channel_decoder_pp(int input_vlen, int output_vlen)
 {
-  return gr_fake_channel_decoder_pp_sptr(new gr_fake_channel_decoder_pp(input_vlen,
+  return gnuradio::get_initial_sptr(new gr_fake_channel_decoder_pp(input_vlen,
                                                                        output_vlen));
 }
 
index 53fb2a8199675970bd23ac1b6c6ffa240170e3a6..9046fcaa79603e7b32e7e1b9dff1fdf78e25cd81 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_feedforward_agc_cc_sptr
 gr_make_feedforward_agc_cc(int nsamples, float reference)
 {
-  return gr_feedforward_agc_cc_sptr(new gr_feedforward_agc_cc (nsamples, reference));
+  return gnuradio::get_initial_sptr(new gr_feedforward_agc_cc (nsamples, reference));
 }
 
 gr_feedforward_agc_cc::gr_feedforward_agc_cc (int nsamples, float reference)
index f69d2e84ebed8c8916caf7ce3f22e71131326f3a..3293e3ab8629b043054f1173ba96d1890901cb65 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2007,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2007,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 gr_fft_vcc_sptr
 gr_make_fft_vcc_fftw (int fft_size, bool forward, const std::vector<float> &window, bool shift)
 {
-  return gr_fft_vcc_sptr (new gr_fft_vcc_fftw (fft_size, forward, window, shift));
+  return gnuradio::get_initial_sptr(new gr_fft_vcc_fftw (fft_size, forward, window, shift));
 }
 
 gr_fft_vcc_fftw::gr_fft_vcc_fftw (int fft_size, bool forward,
index df68af7e1aa1d24ec1b653252fbdb41511266f43..608161efedf120a51869bb67fac58eaeb84b7e3c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -42,7 +42,7 @@
 gr_fft_vfc_sptr
 gr_make_fft_vfc (int fft_size, bool forward, const std::vector<float> window)
 {
-  return gr_fft_vfc_sptr (new gr_fft_vfc (fft_size, forward, window));
+  return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, window));
 }
 
 gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector<float> window)
index 7f2c468b724529107e916c0f4b7f6c476f870488..c32398e6d55ca2e29c16484d29a0c8b487db5a42 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -48,7 +48,7 @@ float sinc(float x)
 gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float samps_per_sym, float rolloff,
                                                   int filter_size, float gain_alpha, float gain_beta)
 {
-  return gr_fll_band_edge_cc_sptr (new gr_fll_band_edge_cc (samps_per_sym, rolloff,
+  return gnuradio::get_initial_sptr(new gr_fll_band_edge_cc (samps_per_sym, rolloff,
                                                            filter_size, gain_alpha, gain_beta));
 }
 
@@ -161,8 +161,9 @@ gr_fll_band_edge_cc::work (int noutput_items,
   const gr_complex *in  = (const gr_complex *) input_items[0];
   gr_complex *out = (gr_complex *) output_items[0];
 
-  float *frq, *phs;
-  gr_complex *err;
+  float *frq = NULL;
+  float *phs = NULL;
+  gr_complex *err = NULL;
   if(output_items.size() > 2) {
     frq = (float *) output_items[1];
     phs = (float *) output_items[2];
index ed6c41826c8b69730214972273a6a6d6642394a6..88b9d276e2bc7a615f93a69d964911f763ca43d1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_float_to_char_sptr
 gr_make_float_to_char ()
 {
-  return gr_float_to_char_sptr (new gr_float_to_char ());
+  return gnuradio::get_initial_sptr(new gr_float_to_char ());
 }
 
 gr_float_to_char::gr_float_to_char ()
index af878231a6a98617d928cdd8bdc2176e157fdde9..a392abd06e85118538f007891e2d29542a201a14 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004, 2009 Free Software Foundation, Inc.
+ * Copyright 2004, 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_float_to_complex_sptr
 gr_make_float_to_complex (size_t vlen)
 {
-  return gr_float_to_complex_sptr (new gr_float_to_complex (vlen));
+  return gnuradio::get_initial_sptr(new gr_float_to_complex (vlen));
 }
 
 gr_float_to_complex::gr_float_to_complex (size_t vlen)
@@ -52,12 +52,12 @@ gr_float_to_complex::work (int noutput_items,
 
   switch (input_items.size ()){
   case 1:
-    for (int j = 0; j < noutput_items*d_vlen; j++)
+    for (size_t j = 0; j < noutput_items*d_vlen; j++)
       out[j] = gr_complex (r[j], 0);
     break;
 
   case 2:
-    for (int j = 0; j < noutput_items*d_vlen; j++)
+    for (size_t j = 0; j < noutput_items*d_vlen; j++)
       out[j] = gr_complex (r[j], i[j]);
     break;
 
index ecb0fa0fc656f995ce51a090a5303853194ea25d..084f76f9c476b81f2f71376c96d8a1d4d8dd6db9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_float_to_short_sptr
 gr_make_float_to_short ()
 {
-  return gr_float_to_short_sptr (new gr_float_to_short ());
+  return gnuradio::get_initial_sptr(new gr_float_to_short ());
 }
 
 gr_float_to_short::gr_float_to_short ()
index 3776ac8979a597a5f429e0b55cdbbb2fd4437317..78369f8be6c23bdeb2c8337eeab1b78546378cb2 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_float_to_uchar_sptr
 gr_make_float_to_uchar ()
 {
-  return gr_float_to_uchar_sptr (new gr_float_to_uchar ());
+  return gnuradio::get_initial_sptr(new gr_float_to_uchar ());
 }
 
 gr_float_to_uchar::gr_float_to_uchar ()
index e2c7e7a7f9cb5588c28e6ceb0c7a0c8070972704..3d828124e6a41ddb5a78c2154230ef57f82da12f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@
 gr_fmdet_cf_sptr
 gr_make_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl)
 {
-  return gr_fmdet_cf_sptr (new gr_fmdet_cf (samplerate, freq_low, freq_high, scl));
+  return gnuradio::get_initial_sptr(new gr_fmdet_cf (samplerate, freq_low, freq_high, scl));
 }
 
 gr_fmdet_cf::gr_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl)
index 9da271bac716e8d89a603d5121b67896aab96ac1..c90b26c35616bfe835badb6c69f4b3f824cace32 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -69,7 +69,7 @@ gr_framer_sink_1::enter_have_header(int payload_len, int whitener_offset)
 gr_framer_sink_1_sptr
 gr_make_framer_sink_1(gr_msg_queue_sptr target_queue)
 {
-  return gr_framer_sink_1_sptr(new gr_framer_sink_1(target_queue));
+  return gnuradio::get_initial_sptr(new gr_framer_sink_1(target_queue));
 }
 
 
index 541f841f4cc7fd9680ba1a35cab1ff7de2bbd4bc..0f6f0d719f71d5a17de4cd1571518c2a3e202ad9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 
 gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity)
 {
-  return gr_frequency_modulator_fc_sptr (new gr_frequency_modulator_fc (sensitivity));
+  return gnuradio::get_initial_sptr(new gr_frequency_modulator_fc (sensitivity));
 }
 
 gr_frequency_modulator_fc::gr_frequency_modulator_fc (double sensitivity)
index 8fe616044ddd7d9f287632ece2c2f7058e369249..134f7a21a94e5450922531380428536468d376f2 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 gr_glfsr_source_b_sptr 
 gr_make_glfsr_source_b(int degree, bool repeat, int mask, int seed)
 {
-  return gr_glfsr_source_b_sptr(new gr_glfsr_source_b(degree, repeat, mask, seed));
+  return gnuradio::get_initial_sptr(new gr_glfsr_source_b(degree, repeat, mask, seed));
 }
 
 gr_glfsr_source_b::gr_glfsr_source_b(int degree, bool repeat, int mask, int seed)
index 8ef3a06cfbf8b9180a4d4fb7ad21aefc65c2c8c2..7ffcfbd2a06a57457c45f3c7dfe7719202211572 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 gr_glfsr_source_f_sptr 
 gr_make_glfsr_source_f(int degree, bool repeat, int mask, int seed)
 {
-  return gr_glfsr_source_f_sptr(new gr_glfsr_source_f(degree, repeat, mask, seed));
+  return gnuradio::get_initial_sptr(new gr_glfsr_source_f(degree, repeat, mask, seed));
 }
 
 gr_glfsr_source_f::gr_glfsr_source_f(int degree, bool repeat, int mask, int seed)
index 3c3ce8cc9ac392f724a16099392aaea29ce11795..d210cd5ed3c99ca7a54443e157cb89b6dd0c030b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_interleave_sptr
 gr_make_interleave (size_t itemsize)
 {
-  return gr_interleave_sptr (new gr_interleave (itemsize));
+  return gnuradio::get_initial_sptr(new gr_interleave (itemsize));
 }
 
 gr_interleave::gr_interleave (size_t itemsize)
index 74b8532072466e83636bbdbff69c75542369c75f..09aa91f4716f6e300fa593054a842944f9d7713c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_interleaved_short_to_complex_sptr
 gr_make_interleaved_short_to_complex ()
 {
-  return gr_interleaved_short_to_complex_sptr (new gr_interleaved_short_to_complex ());
+  return gnuradio::get_initial_sptr(new gr_interleaved_short_to_complex ());
 }
 
 gr_interleaved_short_to_complex::gr_interleaved_short_to_complex ()
index e0a2c08ae17e730f4015c05bc3e3895587fd7383..16a68337ff746654f09ddc1fb2d7acda56e71e05 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_iqcomp_cc_sptr
 gr_make_iqcomp_cc (float mu)
 {
-  return gr_iqcomp_cc_sptr (new gr_iqcomp_cc (mu));
+  return gnuradio::get_initial_sptr(new gr_iqcomp_cc (mu));
 }
 
 gr_iqcomp_cc::gr_iqcomp_cc (float mu)
index e38240a3f612491f0a2cba696710dd67d989f1c8..c07e177fe20823a6862ecc74b8e8f87beeec0f72 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_keep_one_in_n_sptr
 gr_make_keep_one_in_n (size_t item_size, int n)
 {
-  return gr_keep_one_in_n_sptr (new gr_keep_one_in_n (item_size, n));
+  return gnuradio::get_initial_sptr(new gr_keep_one_in_n (item_size, n));
 }
 
 gr_keep_one_in_n::gr_keep_one_in_n (size_t item_size, int n)
index b65e2b78af86c486c2425bbf6357370bf12f179e..e227f8b3ea37fb4012d49c087f69ca0a53729ff9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_lfsr_32k_source_s_sptr 
 gr_make_lfsr_32k_source_s ()
 {
-  return gr_lfsr_32k_source_s_sptr (new gr_lfsr_32k_source_s ());
+  return gnuradio::get_initial_sptr(new gr_lfsr_32k_source_s ());
 }
 
 
index f1eff05ccec0b587fae1bf7ece4649f39e04fbd9..8659386d504cb56ec6a9c6c60529992ed69069bf 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -67,7 +67,7 @@ gr_lms_dfe_cc_sptr
 gr_make_lms_dfe_cc (float lambda_ff, float lambda_fb, 
                    unsigned int num_fftaps, unsigned int num_fbtaps)
 {
-  return gr_lms_dfe_cc_sptr (new gr_lms_dfe_cc (lambda_ff, lambda_fb,
+  return gnuradio::get_initial_sptr(new gr_lms_dfe_cc (lambda_ff, lambda_fb,
                                                num_fftaps, num_fbtaps));
 }
 
index 2992dbf888e4e1f71b7ccd0f365a6ba8ef13ca98..8a5e22c2fecbed05b0c177a64275ac979bff7f82 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -42,7 +42,7 @@ gr_lms_dfe_ff_sptr
 gr_make_lms_dfe_ff (float lambda_ff, float lambda_fb, 
                    unsigned int num_fftaps, unsigned int num_fbtaps)
 {
-  return gr_lms_dfe_ff_sptr (new gr_lms_dfe_ff (lambda_ff,lambda_fb,num_fftaps,num_fbtaps));
+  return gnuradio::get_initial_sptr(new gr_lms_dfe_ff (lambda_ff,lambda_fb,num_fftaps,num_fbtaps));
 }
 
 gr_lms_dfe_ff::gr_lms_dfe_ff (float lambda_ff, float lambda_fb , 
index b10dfea36abd3b5740cfcff4919520cd7ee6215f..7762c7e35b35ba82e9a25e82b6e68eb670a95523 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006,2007 Free Software Foundation, Inc.
+ * Copyright 2006,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_map_bb_sptr
 gr_make_map_bb (const std::vector<int> &map)
 {
-  return gr_map_bb_sptr (new gr_map_bb (map));
+  return gnuradio::get_initial_sptr(new gr_map_bb (map));
 }
 
 gr_map_bb::gr_map_bb (const std::vector<int> &map)
index 1efa827035da7848338c24a982a46db2dcd61987..bc51c6769317457b52fb8511366ace95ef2e1a7b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2007,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -46,7 +46,7 @@ gr_make_mpsk_receiver_cc(unsigned int M, float theta,
                         float mu, float gain_mu, 
                         float omega, float gain_omega, float omega_rel)
 {
-  return gr_mpsk_receiver_cc_sptr (new gr_mpsk_receiver_cc (M, theta, 
+  return gnuradio::get_initial_sptr(new gr_mpsk_receiver_cc (M, theta, 
                                                            alpha, beta,
                                                            fmin, fmax,
                                                            mu, gain_mu, 
index 8175359b5a5624c11494a923d078fbcf814f668f..15d28d48415337c7bed1bc7a45e5e3a9ad8d85ff 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_nlog10_ff_sptr
 gr_make_nlog10_ff (float n, unsigned vlen, float k)
 {
-  return gr_nlog10_ff_sptr(new gr_nlog10_ff(n, vlen, k));
+  return gnuradio::get_initial_sptr(new gr_nlog10_ff(n, vlen, k));
 }
 
 gr_nlog10_ff::gr_nlog10_ff(float n, unsigned vlen, float k)
index b8d5cb3ac83bc2c2587f1734785a761dc2ef3e75..e69c8b340f943ddad3a2d2f486819bc80b000ccb 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,7 +36,7 @@ gr_nop::gr_nop (size_t sizeof_stream_item)
 gr_block_sptr
 gr_make_nop (size_t sizeof_stream_item)
 {
-  return gr_block_sptr (new gr_nop (sizeof_stream_item));
+  return gnuradio::get_initial_sptr (new gr_nop (sizeof_stream_item));
 }
 
 int
index ed9973a3a2f5213eb1ef6f180ded7bc7e446d85d..0b7f2d9e89ea9c0a89dc27bece667b768701ef99 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -37,7 +37,7 @@ gr_null_sink::gr_null_sink (size_t sizeof_stream_item)
 gr_block_sptr
 gr_make_null_sink (size_t sizeof_stream_item)
 {
-  return gr_block_sptr (new gr_null_sink (sizeof_stream_item));
+  return gnuradio::get_initial_sptr (new gr_null_sink (sizeof_stream_item));
 }
 
 int
index d11976e1b47e438c45d68b1673aef744a3ebdeef..b65c39035508d4450e7d935fbde111bf61482993 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -38,7 +38,7 @@ gr_null_source::gr_null_source (size_t sizeof_stream_item)
 gr_block_sptr
 gr_make_null_source (size_t sizeof_stream_item)
 {
-  return gr_block_sptr (new gr_null_source (sizeof_stream_item));
+  return gnuradio::get_initial_sptr (new gr_null_source (sizeof_stream_item));
 }
 
 int
index a01cf358a9a1e187dbfe9a2ac277962506547e93..bcb469651cf89a5f842d073f0aa241f97657b5aa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_ofdm_bpsk_demapper_sptr
 gr_make_ofdm_bpsk_demapper (unsigned int occupied_carriers)
 {
-  return gr_ofdm_bpsk_demapper_sptr (new gr_ofdm_bpsk_demapper (occupied_carriers));
+  return gnuradio::get_initial_sptr(new gr_ofdm_bpsk_demapper (occupied_carriers));
 }
 
 gr_ofdm_bpsk_demapper::gr_ofdm_bpsk_demapper (unsigned occupied_carriers)
index 5327c5707fe4f415f0d3c74cb4dc24358d79495b..fb40a3035fdf6169a150a6febf7f44ca6b94ce8a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_ofdm_cyclic_prefixer_sptr
 gr_make_ofdm_cyclic_prefixer (size_t input_size, size_t output_size)
 {
-  return gr_ofdm_cyclic_prefixer_sptr (new gr_ofdm_cyclic_prefixer (input_size, output_size));
+  return gnuradio::get_initial_sptr(new gr_ofdm_cyclic_prefixer (input_size, output_size));
 }
 
 gr_ofdm_cyclic_prefixer::gr_ofdm_cyclic_prefixer (size_t input_size, size_t output_size)
index fd27e6d48c4086144698c56c58d0cf110c212665..201375597a4127970b4d723b36bb6e3a59d68ae7 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006,2007,2008 Free Software Foundation, Inc.
+ * Copyright 2006,2007,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ gr_make_ofdm_frame_acquisition (unsigned int occupied_carriers, unsigned int fft
                                const std::vector<gr_complex> &known_symbol,
                                unsigned int max_fft_shift_len)
 {
-  return gr_ofdm_frame_acquisition_sptr (new gr_ofdm_frame_acquisition (occupied_carriers, fft_length, cplen,
+  return gnuradio::get_initial_sptr(new gr_ofdm_frame_acquisition (occupied_carriers, fft_length, cplen,
                                                                        known_symbol, max_fft_shift_len));
 }
 
index 26a5cf0fe16ad921c83613652f44bc73722cd4ef..3457370eb3cff784d59350998b9fd6fd0aa37140 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -184,7 +184,7 @@ gr_make_ofdm_frame_sink(const std::vector<gr_complex> &sym_position,
                        gr_msg_queue_sptr target_queue, unsigned int occupied_carriers,
                        float phase_gain, float freq_gain)
 {
-  return gr_ofdm_frame_sink_sptr(new gr_ofdm_frame_sink(sym_position, sym_value_out,
+  return gnuradio::get_initial_sptr(new gr_ofdm_frame_sink(sym_position, sym_value_out,
                                                        target_queue, occupied_carriers,
                                                        phase_gain, freq_gain));
 }
index 3706c36725d80af937dc5350c4609b267d9fa6e6..ed10c94a899c9ac5e8f0fada43a6cf5937be0a92 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@ gr_ofdm_insert_preamble_sptr
 gr_make_ofdm_insert_preamble(int fft_length,
                             const std::vector<std::vector<gr_complex> > &preamble)
 {
-  return gr_ofdm_insert_preamble_sptr(new gr_ofdm_insert_preamble(fft_length,
+  return gnuradio::get_initial_sptr(new gr_ofdm_insert_preamble(fft_length,
                                                                  preamble));
 }
 
index 02f09f5f25bf80ec2ae388f5b6d7a8fcc497b658..370b029cdf253b9eaccae7379149cb3e9baf3f37 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006,2007,2008 Free Software Foundation, Inc.
+ * Copyright 2006,2007,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,7 +34,7 @@ gr_ofdm_mapper_bcv_sptr
 gr_make_ofdm_mapper_bcv (const std::vector<gr_complex> &constellation, unsigned int msgq_limit, 
                         unsigned int occupied_carriers, unsigned int fft_length)
 {
-  return gr_ofdm_mapper_bcv_sptr (new gr_ofdm_mapper_bcv (constellation, msgq_limit, 
+  return gnuradio::get_initial_sptr(new gr_ofdm_mapper_bcv (constellation, msgq_limit, 
                                                          occupied_carriers, fft_length));
 }
 
index 7f6b2b01c984a6d5064a9d91fbdb5005146989e7..f9a53c87f26382c35b3a4e47f14969e4b7774d13 100644 (file)
@@ -34,7 +34,7 @@ gr_make_ofdm_sampler (unsigned int fft_length,
                      unsigned int symbol_length,
                      unsigned int timeout)
 {
-  return gr_ofdm_sampler_sptr (new gr_ofdm_sampler (fft_length, symbol_length, timeout));
+  return gnuradio::get_initial_sptr(new gr_ofdm_sampler (fft_length, symbol_length, timeout));
 }
 
 gr_ofdm_sampler::gr_ofdm_sampler (unsigned int fft_length, 
index c4498ed9345598d541fc47d1b351e701e3ce2566..a79e34be4a010ca5d20b4b87d854d74198b18987 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_pa_2x2_phase_combiner_sptr
 gr_make_pa_2x2_phase_combiner()
 {
-  return gr_pa_2x2_phase_combiner_sptr(new gr_pa_2x2_phase_combiner());
+  return gnuradio::get_initial_sptr(new gr_pa_2x2_phase_combiner());
 }
 
 gr_pa_2x2_phase_combiner::gr_pa_2x2_phase_combiner ()
index 0979f76d3d27d688c15280767886f23cdfaed4ba..d66d96839fdfa5ab0d5d7e414a8974c35c119ec9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -77,7 +77,7 @@ gr_packet_sink_sptr
 gr_make_packet_sink (const std::vector<unsigned char>& sync_vector,
                     gr_msg_queue_sptr target_queue, int threshold)
 {
-  return gr_packet_sink_sptr (new gr_packet_sink (sync_vector, target_queue, threshold));
+  return gnuradio::get_initial_sptr(new gr_packet_sink (sync_vector, target_queue, threshold));
 }
 
 
index 4f927bffe6b3a53927a57b083bdb5da88b97df80..2b1c5da61885e13d22e75c850bcf075b5a2f2d2c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@ gr_peak_detector2_fb_sptr
 gr_make_peak_detector2_fb (float threshold_factor_rise,
                           int look_ahead, float alpha)
 {
-  return gr_peak_detector2_fb_sptr (new gr_peak_detector2_fb (threshold_factor_rise, 
+  return gnuradio::get_initial_sptr(new gr_peak_detector2_fb (threshold_factor_rise, 
                                  look_ahead, alpha));
 }
 
index 9ee8d3f4db8e03f3e9ae9704b933177ff56b8f0d..c1a2e7da3da57b721f27fb1189b206c78aec6102 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 
 gr_phase_modulator_fc_sptr gr_make_phase_modulator_fc (double sensitivity)
 {
-  return gr_phase_modulator_fc_sptr (new gr_phase_modulator_fc (sensitivity));
+  return gnuradio::get_initial_sptr(new gr_phase_modulator_fc (sensitivity));
 }
 
 gr_phase_modulator_fc::gr_phase_modulator_fc (double sensitivity)
index 5f0e9a6921290d14b16573a0d6e396e29cb7ef07..19ab316a19d81b861a765ed4454a2d81d842a977 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@
 gr_pll_carriertracking_cc_sptr
 gr_make_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq)
 {
-  return gr_pll_carriertracking_cc_sptr (new gr_pll_carriertracking_cc (alpha, beta, max_freq, min_freq));
+  return gnuradio::get_initial_sptr(new gr_pll_carriertracking_cc (alpha, beta, max_freq, min_freq));
 }
 
 gr_pll_carriertracking_cc::gr_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq)
index c9fd9a71e8a4e4272aacd270804cee0a1102421d..1f17f2afc62646949520c2a722ea6779c07e505a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,7 +36,7 @@
 gr_pll_freqdet_cf_sptr
 gr_make_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq)
 {
-  return gr_pll_freqdet_cf_sptr (new gr_pll_freqdet_cf (alpha, beta, max_freq, min_freq));
+  return gnuradio::get_initial_sptr(new gr_pll_freqdet_cf (alpha, beta, max_freq, min_freq));
 }
 
 gr_pll_freqdet_cf::gr_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq)
index 5df822d3730378adc8f188abba9a708e6fc61ba6..8a7fbf88ba15bc9ddcc7c29ea7769b48537477de 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -37,7 +37,7 @@
 gr_pll_refout_cc_sptr
 gr_make_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq)
 {
-  return gr_pll_refout_cc_sptr (new gr_pll_refout_cc (alpha, beta, max_freq, min_freq));
+  return gnuradio::get_initial_sptr(new gr_pll_refout_cc (alpha, beta, max_freq, min_freq));
 }
 
 gr_pll_refout_cc::gr_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq)
index 2614c3a2d83dd9b6e94ebb19a3be4e1f5c2602d0..37e7b803ca902860c4b95ff9420cf3be9a146b15 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_pn_correlator_cc_sptr
 gr_make_pn_correlator_cc(int degree, int mask, int seed)
 {
-  return gr_pn_correlator_cc_sptr (new gr_pn_correlator_cc(degree, mask, seed));
+  return gnuradio::get_initial_sptr(new gr_pn_correlator_cc(degree, mask, seed));
 }
 
 gr_pn_correlator_cc::gr_pn_correlator_cc(int degree, int mask, int seed)
index 8af11ad220c0fa77f697428507dccaf3e234049d..c00eb5cdf9a99a1845dd29c27a15e23518d77cb9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_probe_avg_mag_sqrd_c_sptr
 gr_make_probe_avg_mag_sqrd_c(double threshold_db, double alpha)
 {
-  return gr_probe_avg_mag_sqrd_c_sptr(new gr_probe_avg_mag_sqrd_c(threshold_db, alpha));
+  return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_c(threshold_db, alpha));
 }
 
 gr_probe_avg_mag_sqrd_c::gr_probe_avg_mag_sqrd_c (double threshold_db, double alpha)
index 8b1c7cc5076f10cd2411e6ef9f3e25a1bd53ab74..5350028a75443964c8878f8795450b083d9d7119 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2007 Free Software Foundation, Inc.
+ * Copyright 2005,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_probe_avg_mag_sqrd_cf_sptr
 gr_make_probe_avg_mag_sqrd_cf(double threshold_db, double alpha)
 {
-  return gr_probe_avg_mag_sqrd_cf_sptr(new gr_probe_avg_mag_sqrd_cf(threshold_db, alpha));
+  return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_cf(threshold_db, alpha));
 }
 
 gr_probe_avg_mag_sqrd_cf::gr_probe_avg_mag_sqrd_cf (double threshold_db, double alpha)
index c39207d2c6d00d780061497bbb10cde48977473f..d3b0e2d37d5a238d26d090fa218b9c35d9881a06 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_probe_avg_mag_sqrd_f_sptr
 gr_make_probe_avg_mag_sqrd_f(double threshold_db, double alpha)
 {
-  return gr_probe_avg_mag_sqrd_f_sptr(new gr_probe_avg_mag_sqrd_f(threshold_db, alpha));
+  return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_f(threshold_db, alpha));
 }
 
 gr_probe_avg_mag_sqrd_f::gr_probe_avg_mag_sqrd_f (double threshold_db, double alpha)
index dae4eec74f024607d27d922752ffccaac3662ac7..70b03e881ce234f04f31127f025da506e16c3df3 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * 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
@@ -30,7 +30,7 @@
 gr_probe_density_b_sptr 
 gr_make_probe_density_b(double alpha)
 {
-  return gr_probe_density_b_sptr(new gr_probe_density_b(alpha));
+  return gnuradio::get_initial_sptr(new gr_probe_density_b(alpha));
 }
 
 gr_probe_density_b::gr_probe_density_b(double alpha)
index a0bb99ce14205f89454f5eb55ea6d3cc00a6311c..fed9ad66ee0234f366b5024bf55bc93afe3b083d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_probe_mpsk_snr_c_sptr
 gr_make_probe_mpsk_snr_c(double alpha)
 {
-  return gr_probe_mpsk_snr_c_sptr(new gr_probe_mpsk_snr_c(alpha));
+  return gnuradio::get_initial_sptr(new gr_probe_mpsk_snr_c(alpha));
 }
 
 gr_probe_mpsk_snr_c::gr_probe_mpsk_snr_c(double alpha)
index b67836682f1d791a1cfb439dbbb543ac19281331..ee1a18e8911dac43a151edbe32342a7269b39ca1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -29,7 +29,7 @@
 gr_probe_signal_f_sptr
 gr_make_probe_signal_f()
 {
-  return gr_probe_signal_f_sptr(new gr_probe_signal_f());
+  return gnuradio::get_initial_sptr(new gr_probe_signal_f());
 }
 
 gr_probe_signal_f::gr_probe_signal_f ()
index 1604972fd25fbe310b162c2ccd60c5581df4758e..d2fee1a573114735e9e8fe944a0e1e0cb11836dd 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -29,7 +29,7 @@
 gr_pwr_squelch_cc_sptr
 gr_make_pwr_squelch_cc(double threshold, double alpha, int ramp, bool gate)
 {
-  return gr_pwr_squelch_cc_sptr(new gr_pwr_squelch_cc(threshold, alpha, ramp, gate));
+  return gnuradio::get_initial_sptr(new gr_pwr_squelch_cc(threshold, alpha, ramp, gate));
 }
 
 gr_pwr_squelch_cc::gr_pwr_squelch_cc(double threshold, double alpha, int ramp, bool gate) : 
index 976b7a1059c9ffbc68368553a84fd8f5143cfc07..a689c407c6ab0d7e46116b03900af35837aaa85c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -29,7 +29,7 @@
 gr_pwr_squelch_ff_sptr
 gr_make_pwr_squelch_ff(double threshold, double alpha, int ramp, bool gate)
 {
-  return gr_pwr_squelch_ff_sptr(new gr_pwr_squelch_ff(threshold, alpha, ramp, gate));
+  return gnuradio::get_initial_sptr(new gr_pwr_squelch_ff(threshold, alpha, ramp, gate));
 }
 
 gr_pwr_squelch_ff::gr_pwr_squelch_ff(double threshold, double alpha, int ramp, bool gate) : 
index bae5a3857efa6a1b902ad69a1a3339845bacaf5f..8e59fbd71d64cbb1000dcda297e9d359b336442e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2005 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ gr_quadrature_demod_cf::gr_quadrature_demod_cf (float gain)
 gr_quadrature_demod_cf_sptr
 gr_make_quadrature_demod_cf (float gain)
 {
-  return gr_quadrature_demod_cf_sptr (new gr_quadrature_demod_cf (gain));
+  return gnuradio::get_initial_sptr(new gr_quadrature_demod_cf (gain));
 }
 
 int
index 9fd3af8dfceb8f711374f6bf3ba0df4803ebc765..2608971991ccdee8be656bb8e4bf1bacb0b129f2 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_rail_ff_sptr
 gr_make_rail_ff(float lo, float hi)
 {
-  return gr_rail_ff_sptr(new gr_rail_ff(lo, hi));
+  return gnuradio::get_initial_sptr(new gr_rail_ff(lo, hi));
 }
 
 gr_rail_ff::gr_rail_ff(float lo, float hi)
index 1836755204e2495347ff5ef0b536e9b9ff3dd643..3bb8be1057396bc136a37151e37dc76ead977fdc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_regenerate_bb_sptr
 gr_make_regenerate_bb (int period, unsigned int max_regen)
 {
-  return gr_regenerate_bb_sptr (new gr_regenerate_bb (period, max_regen));
+  return gnuradio::get_initial_sptr(new gr_regenerate_bb (period, max_regen));
 }
 
 gr_regenerate_bb::gr_regenerate_bb (int period, unsigned int max_regen)
index 70bb44e5a5d8460ce0b4045239e0032aabb99286..43ad50f52a708d476644e2c0ba95bfb5492e90d5 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_repeat_sptr 
 gr_make_repeat(size_t itemsize, int interp)
 {
-  return gr_repeat_sptr(new gr_repeat(itemsize, interp));
+  return gnuradio::get_initial_sptr(new gr_repeat(itemsize, interp));
 }
 
 gr_repeat::gr_repeat(size_t itemsize, int interp)  
index eab937e97a52a85ba7c9d4f5802c2dc63acd3428..a7b5d99f1ce9d6777d40dbeb147103b8d24c229f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_rms_cf_sptr
 gr_make_rms_cf(double alpha)
 {
-  return gr_rms_cf_sptr(new gr_rms_cf(alpha));
+  return gnuradio::get_initial_sptr(new gr_rms_cf(alpha));
 }
 
 gr_rms_cf::gr_rms_cf (double alpha)
index 604cb3c9b8650286787a00f8acf7b39c65048062..1ff4379f6311072aa36705427e2e6e0ea2b770fa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_rms_ff_sptr
 gr_make_rms_ff(double alpha)
 {
-  return gr_rms_ff_sptr(new gr_rms_ff(alpha));
+  return gnuradio::get_initial_sptr(new gr_rms_ff(alpha));
 }
 
 gr_rms_ff::gr_rms_ff (double alpha)
index 42f70901b3bde47261d8502e42088e9535073767..59bd1ca419a01123f86b5aed02b6a468edf20789 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_scrambler_bb_sptr
 gr_make_scrambler_bb(int mask, int seed, int len)
 {
-  return gr_scrambler_bb_sptr(new gr_scrambler_bb(mask, seed, len));
+  return gnuradio::get_initial_sptr(new gr_scrambler_bb(mask, seed, len));
 }
 
 gr_scrambler_bb::gr_scrambler_bb(int mask, int seed, int len)
index 09dad2ef28d83106ea9b5b8c301d384ef1275fae..7b80953ac11543321cc7c0137b3578abc6992b18 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_short_to_float_sptr
 gr_make_short_to_float ()
 {
-  return gr_short_to_float_sptr (new gr_short_to_float ());
+  return gnuradio::get_initial_sptr(new gr_short_to_float ());
 }
 
 gr_short_to_float::gr_short_to_float ()
index ebfbfa72e951b5a9c2df1b4d57baa476a696aca6..01c007122e5df4469de1a5e97a6d2c94e3bd1177 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -39,7 +39,7 @@ static const int THRESHOLD = 3;
 gr_simple_correlator_sptr
 gr_make_simple_correlator (int payload_bytesize)
 {
-  return gr_simple_correlator_sptr (new gr_simple_correlator (payload_bytesize));
+  return gnuradio::get_initial_sptr(new gr_simple_correlator (payload_bytesize));
 }
 
 gr_simple_correlator::gr_simple_correlator (int payload_bytesize)
index d2de0954627bcf886412ce81f810a47b8aba62fd..2a574a74e48a7af6fb918ed944bd0dfb391bc64e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@
 gr_simple_framer_sptr
 gr_make_simple_framer (int payload_bytesize)
 {
-  return gr_simple_framer_sptr (new gr_simple_framer (payload_bytesize));
+  return gnuradio::get_initial_sptr(new gr_simple_framer (payload_bytesize));
 }
 
 gr_simple_framer::gr_simple_framer (int payload_bytesize)
index 3900671a65d2247ef3114f8c4077bd711dad70f6..cdea8055b5d2243ad874ee1c03d4cb846a6c338f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_simple_squelch_cc_sptr
 gr_make_simple_squelch_cc(double threshold_db, double alpha)
 {
-  return gr_simple_squelch_cc_sptr(new gr_simple_squelch_cc(threshold_db, alpha));
+  return gnuradio::get_initial_sptr(new gr_simple_squelch_cc(threshold_db, alpha));
 }
 
 gr_simple_squelch_cc::gr_simple_squelch_cc (double threshold_db, double alpha)
index 45e3d5cb233903f9b6cb37fc84eb80891b096618..1670eb7cf38dd7bdcee413589e8655fd3a350d7b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2007 Free Software Foundation, Inc.
+ * Copyright 2005,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -27,7 +27,7 @@
 #include <gr_io_signature.h>
 #include <string.h>
 
-gr_skiphead::gr_skiphead (size_t itemsize, size_t nitems_to_skip)
+gr_skiphead::gr_skiphead (size_t itemsize, uint64_t nitems_to_skip)
   : gr_block ("skiphead",
              gr_make_io_signature(1, 1, itemsize),
              gr_make_io_signature(1, 1, itemsize)),
@@ -36,9 +36,9 @@ gr_skiphead::gr_skiphead (size_t itemsize, size_t nitems_to_skip)
 }
 
 gr_skiphead_sptr
-gr_make_skiphead (size_t itemsize, size_t nitems_to_skip)
+gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip)
 {
-  return gr_skiphead_sptr (new gr_skiphead (itemsize, nitems_to_skip));
+  return gnuradio::get_initial_sptr(new gr_skiphead (itemsize, nitems_to_skip));
 }
 
 int
@@ -55,11 +55,11 @@ gr_skiphead::general_work(int noutput_items,
 
   while (ii < ninput_items){
 
-    long long ni_total = ii + d_nitems;        // total items processed so far
+    uint64_t ni_total = ii + d_nitems;         // total items processed so far
     if (ni_total < d_nitems_to_skip){          // need to skip some more
 
       int n_to_skip = (int) std::min(d_nitems_to_skip - ni_total,
-                                    (long long)(ninput_items - ii));
+                                    (uint64_t)(ninput_items - ii));
       ii += n_to_skip;
     }
 
index 965feff9b2015a0aa159db7c95f36d8c09337f65..933c126e36dd40ca6a9626f8fba2ab619e28a39d 100644 (file)
@@ -39,11 +39,11 @@ typedef boost::shared_ptr<gr_skiphead> gr_skiphead_sptr;
 
 class gr_skiphead : public gr_block
 {
-  friend gr_skiphead_sptr gr_make_skiphead (size_t itemsize, size_t nitems_to_skip);
-  gr_skiphead (size_t itemsize, size_t nitems_to_skip);
+  friend gr_skiphead_sptr gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip);
+  gr_skiphead (size_t itemsize, uint64_t nitems_to_skip);
 
-  long long            d_nitems_to_skip;
-  long long            d_nitems;               // total items seen
+  uint64_t             d_nitems_to_skip;
+  uint64_t             d_nitems;               // total items seen
 
  public:
 
@@ -54,7 +54,7 @@ class gr_skiphead : public gr_block
 };
 
 gr_skiphead_sptr
-gr_make_skiphead (size_t itemsize, size_t nitems_to_skip);
+gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip);
 
 
 #endif /* INCLUDED_GR_SKIPHEAD_H */
index 52c0808f01350d195f47dc9f718001b43ee76b64..45cbd04372e499340bc32da7b6f3b1a64327d1b2 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2007 Free Software Foundation, Inc.
+ * Copyright 2005,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -22,9 +22,9 @@
 
 GR_SWIG_BLOCK_MAGIC(gr,skiphead);
 
-gr_skiphead_sptr gr_make_skiphead (size_t itemsize, size_t nitems_to_skip);
+gr_skiphead_sptr gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip);
 
 class gr_skiphead : public gr_block {
-  friend gr_skiphead_sptr gr_make_skiphead (size_t itemsize, size_t nitems_to_skip);
-  gr_skiphead (size_t itemsize, size_t nitems_to_skip);
+  friend gr_skiphead_sptr gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip);
+  gr_skiphead (size_t itemsize, uint64_t nitems_to_skip);
 };
index 05ad4a7eb6efaae8fe3736c4ba8ad7baa5019808..479204fdbf46296f071bdc7d75dba085ca40e5bc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@ gr_squash_ff_sptr
 gr_make_squash_ff(const std::vector<float> &igrid,
                  const std::vector<float> &ogrid)
 {
-  return gr_squash_ff_sptr(new gr_squash_ff(igrid, ogrid));
+  return gnuradio::get_initial_sptr(new gr_squash_ff(igrid, ogrid));
 }
 
 gr_squash_ff::gr_squash_ff(const std::vector<float> &igrid,
index 06556b583674214f9fd2157fb5211bdcf1df4397..7ef2bb3c7b95f30deec68028c0b86d8eaec4c16b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,7 +34,7 @@
 gr_stream_mux_sptr
 gr_make_stream_mux (size_t itemsize, const std::vector<int> &lengths)
 {
-  return gr_stream_mux_sptr (new gr_stream_mux (itemsize, lengths));
+  return gnuradio::get_initial_sptr(new gr_stream_mux (itemsize, lengths));
 }
 
 gr_stream_mux::gr_stream_mux (size_t itemsize, const std::vector<int> &lengths)
index b38a8d4d812830050f6539ca40a2e762e6e58066..3d34dbc43dc2f13631ae882b6b6247c2153caaba 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_stream_to_streams_sptr
 gr_make_stream_to_streams (size_t item_size, size_t nstreams)
 {
-  return gr_stream_to_streams_sptr (new gr_stream_to_streams (item_size, nstreams));
+  return gnuradio::get_initial_sptr(new gr_stream_to_streams (item_size, nstreams));
 }
 
 gr_stream_to_streams::gr_stream_to_streams (size_t item_size, size_t nstreams)
index fd233adca7ca58e6c9d20c7ed4714cb08ac67dfc..f218601d734e8b3ce491749b71501067daf21be1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2005 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_stream_to_vector_sptr
 gr_make_stream_to_vector (size_t item_size, size_t nitems_per_block)
 {
-  return gr_stream_to_vector_sptr (new gr_stream_to_vector (item_size, nitems_per_block));
+  return gnuradio::get_initial_sptr(new gr_stream_to_vector (item_size, nitems_per_block));
 }
 
 gr_stream_to_vector::gr_stream_to_vector (size_t item_size, size_t nitems_per_block)
index 6f6b49a82c81e4c29fc0d22608e237c58e01fc7c..ce4101089ddee7845e56014f9903fe071c4e0460 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_streams_to_stream_sptr
 gr_make_streams_to_stream (size_t item_size, size_t nstreams)
 {
-  return gr_streams_to_stream_sptr (new gr_streams_to_stream (item_size, nstreams));
+  return gnuradio::get_initial_sptr(new gr_streams_to_stream (item_size, nstreams));
 }
 
 gr_streams_to_stream::gr_streams_to_stream (size_t item_size, size_t nstreams)
index f3ee2c49aa4ed09707dc1a82c76dc7a16ddece23..e04fa4dcb504f0c64b9135ec3ed0de4df120f402 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2005 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_streams_to_vector_sptr
 gr_make_streams_to_vector (size_t item_size, size_t nstreams)
 {
-  return gr_streams_to_vector_sptr (new gr_streams_to_vector (item_size, nstreams));
+  return gnuradio::get_initial_sptr(new gr_streams_to_vector (item_size, nstreams));
 }
 
 gr_streams_to_vector::gr_streams_to_vector (size_t item_size, size_t nstreams)
index f1822dcb8bc907686a640d128bec9483d1d45b43..c6395798ad1ff95cb6b65608c45406d360dc4558 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 gr_stretch_ff_sptr
 gr_make_stretch_ff(float lo, size_t vlen)
 {
-  return gr_stretch_ff_sptr(new gr_stretch_ff(lo, vlen));
+  return gnuradio::get_initial_sptr(new gr_stretch_ff(lo, vlen));
 }
 
 gr_stretch_ff::gr_stretch_ff(float lo, size_t vlen)
index a04554ec4e243a6a5d7d83f1e563c78a55266478..077b397076ec3b5730667aa74deb8c58e2ed9132 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006,2008 Free Software Foundation, Inc.
+ * Copyright 2006,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,7 +36,7 @@ gr_test_sptr gr_make_test (const std::string &name,
         unsigned int history,unsigned int output_multiple,double relative_rate,
         bool fixed_rate,gr_consume_type_t cons_type, gr_produce_type_t prod_type)
 {
-  return gr_test_sptr (new gr_test (name, min_inputs,max_inputs,sizeof_input_item,
+  return gnuradio::get_initial_sptr(new gr_test (name, min_inputs,max_inputs,sizeof_input_item,
              min_outputs,max_outputs,sizeof_output_item,
              history,output_multiple,relative_rate,fixed_rate,cons_type, prod_type));
 }
index 9deb3e461ec88163acf8e0c6c2e84c1f544e1257..622fe1b45dedf278b03df34bea85cf4e16f1aae0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_threshold_ff_sptr
 gr_make_threshold_ff (float lo, float hi, float initial_state)
 {
-  return gr_threshold_ff_sptr (new gr_threshold_ff (lo, hi, initial_state));
+  return gnuradio::get_initial_sptr(new gr_threshold_ff (lo, hi, initial_state));
 }
 
 gr_threshold_ff::gr_threshold_ff (float lo, float hi, float initial_state)
index 88219c1c8031410c17353a569479864f6133acce..3189e01c0120ce97a5ef65be591a2bf964742fcc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -57,7 +57,7 @@ gr_nanosleep(struct timespec *ts)
 gr_throttle_sptr
 gr_make_throttle(size_t itemsize, double samples_per_sec)
 {
-  return gr_throttle_sptr(new gr_throttle(itemsize, samples_per_sec));
+  return gnuradio::get_initial_sptr(new gr_throttle(itemsize, samples_per_sec));
 }
 
 gr_throttle::gr_throttle(size_t itemsize, double samples_per_sec)
index 305052942dd7bc0d4ee7bb8ef8d8f1233af4a447..83616b42830676dc6312dfb9ac38343efc69199a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_uchar_to_float_sptr
 gr_make_uchar_to_float ()
 {
-  return gr_uchar_to_float_sptr (new gr_uchar_to_float ());
+  return gnuradio::get_initial_sptr(new gr_uchar_to_float ());
 }
 
 gr_uchar_to_float::gr_uchar_to_float ()
index 7c5fdb1d6d1bbfbf66d41e127c7dba36fb07f709..e33c3da9a513c3f3a7d15e9c6bafec2659b6243d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 
 gr_unpack_k_bits_bb_sptr gr_make_unpack_k_bits_bb (unsigned k)
 {
-  return gr_unpack_k_bits_bb_sptr (new gr_unpack_k_bits_bb (k));
+  return gnuradio::get_initial_sptr(new gr_unpack_k_bits_bb (k));
 }
 
 
index 342a880e45f9789b08cb00a55f4c0660a271a9d5..43a686327bba5f95e5001badb90c774342b4339f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_vco_f_sptr
 gr_make_vco_f(double sampling_rate, double sensitivity, double amplitude)
 {
-  return gr_vco_f_sptr(new gr_vco_f(sampling_rate, sensitivity, amplitude));
+  return gnuradio::get_initial_sptr(new gr_vco_f(sampling_rate, sensitivity, amplitude));
 }
 
 
index 149bc0d5bf14fafa9780d887a3743a8ce78218df..0a0788de678c638b5d69247e9f3bb754c56d2705 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_vector_to_stream_sptr
 gr_make_vector_to_stream (size_t item_size, size_t nitems_per_block)
 {
-  return gr_vector_to_stream_sptr (new gr_vector_to_stream (item_size, nitems_per_block));
+  return gnuradio::get_initial_sptr(new gr_vector_to_stream (item_size, nitems_per_block));
 }
 
 gr_vector_to_stream::gr_vector_to_stream (size_t item_size, size_t nitems_per_block)
index 19f15b1706383db4499ec050ac43de06f07be57c..cc32641525d99e6ccc4e47efcbc66300da142cd9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2005 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 gr_vector_to_streams_sptr
 gr_make_vector_to_streams (size_t item_size, size_t nstreams)
 {
-  return gr_vector_to_streams_sptr (new gr_vector_to_streams (item_size, nstreams));
+  return gnuradio::get_initial_sptr(new gr_vector_to_streams (item_size, nstreams));
 }
 
 gr_vector_to_streams::gr_vector_to_streams (size_t item_size, size_t nstreams)
index 6cbfa238186d717cfeb4b04deeebfc775deb033b..f77c96e9936bef3e4adfce1c875b18af82fd07fc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -38,7 +38,7 @@ gr_make_wavelet_ff(int size,
                   int order,
                   bool forward)
 {
-  return gr_wavelet_ff_sptr(new gr_wavelet_ff(size,
+  return gnuradio::get_initial_sptr(new gr_wavelet_ff(size,
                                              order,
                                              forward));
 }
index f814ba8fc450cccd2de94ea68d3d2cffeeb4e51d..8a8dc56acd50d75416208dac3a819d8001f89315 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -39,7 +39,7 @@ ceil_log2(int k)
 gr_wvps_ff_sptr
 gr_make_wvps_ff(int ilen)
 {
-  return gr_wvps_ff_sptr(new gr_wvps_ff(ilen));
+  return gnuradio::get_initial_sptr(new gr_wvps_ff(ilen));
 }
 
 gr_wvps_ff::gr_wvps_ff(int ilen)
index e7d6da97f3b96f2b4a42d97bb70fdf4a2a74622c..0f97f1d8e3799f2775932d5898bed9c27a44867d 100644 (file)
@@ -39,4 +39,9 @@ class gri_agc2_cc {
   float reference ();
   float gain ();
   float max_gain ();
+  void set_decay_rate (float rate);
+  void set_attack_rate (float rate);
+  void set_reference (float reference);
+  void set_gain (float gain);
+  void set_max_gain(float max_gain);
   };
index 3825ce225a1b29e756585ca7142cd8aa640443cd..d04b638a6edee55bbe87568108652ef5fce7740f 100644 (file)
@@ -34,4 +34,14 @@ class gri_agc2_ff {
  public:
   gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2,
               float reference = 1.0, float gain = 1.0, float max_gain = 0.0);
+  float attack_rate ();
+  float decay_rate ();
+  float reference ();
+  float gain ();
+  float max_gain ();
+  void set_attack_rate (float rate);
+  void set_decay_rate (float rate);
+  void set_reference (float reference);
+  void set_gain (float gain);
+  void set_max_gain (float max_gain);
   };
index 2e44c5ea78ab86446b7eb03f4d268a4c190a7179..0e8b23ee16c4167271a8fa8442b8d06eeb503417 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004, 2009 Free Software Foundation, Inc.
+ * Copyright 2004, 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (size_t vlen)
 {
-  return @SPTR_NAME@ (new @NAME@ (vlen));
+  return gnuradio::get_initial_sptr (new @NAME@ (vlen));
 }
 
 @NAME@::@NAME@ (size_t vlen)
@@ -52,7 +52,7 @@ int
 
   int ninputs = input_items.size ();
 
-  for (int i = 0; i < noutput_items*d_vlen; i++){
+  for (size_t i = 0; i < noutput_items*d_vlen; i++){
     @I_TYPE@ acc = ((@I_TYPE@ *) input_items[0])[i];
     for (int j = 1; j < ninputs; j++)
       acc += ((@I_TYPE@ *) input_items[j])[i];
index 3df3ea9c635465ba058e75d8cdd2a40c12cdfd3c..0d3034be7e8437f4f6226e18506cdecd273319b4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (@O_TYPE@ k)
 {
-  return @SPTR_NAME@ (new @NAME@ (k));
+  return gnuradio::get_initial_sptr (new @NAME@ (k));
 }
 
 @NAME@::@NAME@ (@O_TYPE@ k)
index 0e6588dc0b7db7647676708066b076d7b4d02b84..2a0a3ba3f9180397dac2c94b9fab5f15fe3718d9 100755 (executable)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k)
 {
-  return @SPTR_NAME@ (new @NAME@ (k));
+  return gnuradio::get_initial_sptr (new @NAME@ (k));
 }
 
 @NAME@::@NAME@ (const std::vector<@I_TYPE@> k)
index cef21d3330c9414ba9be865fc227c89a5dd481a3..150ef7f0dc64c9f0c3f72dcdd8d4f6ca78b42e8f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ ()
 {
-  return @SPTR_NAME@ (new @NAME@ ());
+  return gnuradio::get_initial_sptr (new @NAME@ ());
 }
 
 @NAME@::@NAME@ ()
index ec725b23dcd23e6bdd780fde7a9c83f9cd6bccdf..bd48788e639da05fa89e199612b579e5fa979249 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (@I_TYPE@ k)
 {
-  return @SPTR_NAME@ (new @NAME@ (k));
+  return gnuradio::get_initial_sptr (new @NAME@ (k));
 };
 
 @NAME@::@NAME@ (@I_TYPE@ k)
index ab61fb08d33e76ac6363344a89533279dc732db3..635d991ef56d15d44ec0f21742ed0ef81ee7e3aa 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (const std::vector<@O_TYPE@> &symbol_table, const int D)
 {
-  return @SPTR_NAME@ (new @NAME@ (symbol_table,D));
+  return gnuradio::get_initial_sptr (new @NAME@ (symbol_table,D));
 }
 
 @NAME@::@NAME@ (const std::vector<@O_TYPE@> &symbol_table, const int D)
index 2db490f135ad129849f4ecad57089f9778b22a9d..ea245b57bb1bd0e15cfbc5b583d890b1055b9234 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004, 2009 Free Software Foundation, Inc.
+ * Copyright 2004, 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (size_t vlen)
 {
-  return @SPTR_NAME@ (new @NAME@ (vlen));
+  return gnuradio::get_initial_sptr (new @NAME@ (vlen));
 }
 
 @NAME@::@NAME@ (size_t vlen)
@@ -53,13 +53,13 @@ int
   int ninputs = input_items.size ();
 
   if (ninputs == 1){           // compute reciprocal
-    for (int i = 0; i < noutput_items*d_vlen; i++)
+    for (size_t i = 0; i < noutput_items*d_vlen; i++)
       *optr++ = (@O_TYPE@) ((@O_TYPE@) 1 /
                            ((@I_TYPE@ *) input_items[0])[i]);
   }
 
   else {
-    for (int i = 0; i < noutput_items*d_vlen; i++){
+    for (size_t i = 0; i < noutput_items*d_vlen; i++){
       @I_TYPE@ acc = ((@I_TYPE@ *) input_items[0])[i];
       for (int j = 1; j < ninputs; j++)
        acc /= ((@I_TYPE@ *) input_items[j])[i];
index 0a62554bd1245406f8829ef402d12992a632ad8f..f6e38848c71bf5d12c04762c2216cb6e4f2ec02b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@ 
 gr_make_@BASE_NAME@ (int decim)
 {
-  return @SPTR_NAME@ (new @NAME@ (decim));
+  return gnuradio::get_initial_sptr (new @NAME@ (decim));
 }
 
 @NAME@::@NAME@ (int decim)
index 33a0acf9ce725d1856ab68b25a2e09975a8070cc..8d2370d3ba16becba7240e1f0002817049f417c4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@ 
 gr_make_@BASE_NAME@ (int length, @O_TYPE@ scale, int max_iter)
 {
-  return @SPTR_NAME@ (new @NAME@ (length, scale, max_iter));
+  return gnuradio::get_initial_sptr (new @NAME@ (length, scale, max_iter));
 }
 
 @NAME@::@NAME@ (int length, @O_TYPE@ scale, int max_iter)
index 000c5e0bd88f87309ebfd2a1e9428a452bd61476..5d270c763487b3ad58106b3ffb63654e7da600f4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004, 2009 Free Software Foundation, Inc.
+ * Copyright 2004, 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (size_t vlen)
 {
-  return @SPTR_NAME@ (new @NAME@ (vlen));
+  return gnuradio::get_initial_sptr (new @NAME@ (vlen));
 }
 
 @NAME@::@NAME@ (size_t vlen)
@@ -52,7 +52,7 @@ int
 
   int ninputs = input_items.size ();
 
-  for (int i = 0; i < noutput_items*d_vlen; i++){
+  for (size_t i = 0; i < noutput_items*d_vlen; i++){
     @I_TYPE@ acc = ((@I_TYPE@ *) input_items[0])[i];
     for (int j = 1; j < ninputs; j++)
       acc *= ((@I_TYPE@ *) input_items[j])[i];
index 715782dd188f50273e2c89278b85f441e0f4434d..09e658e90a1f4af7d53c1a52b1fb7112281f5366 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (@O_TYPE@ k)
 {
-  return @SPTR_NAME@ (new @NAME@ (k));
+  return gnuradio::get_initial_sptr (new @NAME@ (k));
 }
 
 @NAME@::@NAME@ (@O_TYPE@ k)
index 5b92ea8a120f14d969d7540ce39c90871e2e2789..8286453f1ee1cf7133e6768ea0527659191bbc1c 100755 (executable)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k)
 {
-  return @SPTR_NAME@ (new @NAME@ (k));
+  return gnuradio::get_initial_sptr (new @NAME@ (k));
 }
 
 @NAME@::@NAME@ (const std::vector<@I_TYPE@> k)
index ee49d97b4ed31d4d0809709de8eee4c43c919d88..62a8e63daf528e4ac488c1e096a768986f23e433 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,7 +34,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (bool mute)
 {
-  return @SPTR_NAME@ (new @NAME@ (mute));
+  return gnuradio::get_initial_sptr (new @NAME@ (mute));
 }
 
 @NAME@::@NAME@ (bool mute)
index 83be9aa18f13994972501878cccb8e27a5cc02f1..35f5fabd9f5018f44e892de0b3f0dbdaaeb48d1c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 @NAME@_sptr 
 gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed)
 {
-  return @NAME@_sptr (new @NAME@ (type, ampl, seed));
+  return gnuradio::get_initial_sptr(new @NAME@ (type, ampl, seed));
 }
 
 
index 272987411e0fa3a3c1e1810da9974bc091226c29..432938e67776f0b9765df0eb0d556e95ed6a84c8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ ()
 {
-  return @SPTR_NAME@ (new @NAME@ ());
+  return gnuradio::get_initial_sptr (new @NAME@ ());
 }
 
 @NAME@::@NAME@ ()
index e118cdbbb47badb174e165ee356e85c1086ed29c..07c759d73e106dcf255fcc01b7a9235d2849afee 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ ()
 {
-  return @SPTR_NAME@ (new @NAME@ ());
+  return gnuradio::get_initial_sptr (new @NAME@ ());
 }
 
 @NAME@::@NAME@ ()
index ce63169207a3a18a09a4bf2b7ea1a94b7314b9f6..1a4a2564b286a1d8c8226b5fd04265de660923c8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@ gr_make_@BASE_NAME@ (float threshold_factor_rise,
                     float threshold_factor_fall,
                     int look_ahead, float alpha)
 {
-  return @SPTR_NAME@ (new @NAME@ (threshold_factor_rise, 
+  return gnuradio::get_initial_sptr (new @NAME@ (threshold_factor_rise, 
                                  threshold_factor_fall,
                                  look_ahead, alpha));
 }
index 52538286e558214eefe5be8f95a3e15a6a24c013..b78c52857a0b3f03ba06524ddd04fbdc0aa58f4b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ ()
 {
-  return @SPTR_NAME@ (new @NAME@ ());
+  return gnuradio::get_initial_sptr (new @NAME@ ());
 }
 
 @NAME@::@NAME@ ()
index 0694df315c0f7138b78a6245832b94f1085c2524..9354eb93ca8772242708fecf75f115f8ed623337 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -47,7 +47,7 @@
 gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform,
                     double frequency, double ampl, @TYPE@ offset)
 {
-  return @NAME@_sptr (new @NAME@ (sampling_freq, waveform, frequency, ampl, offset));
+  return gnuradio::get_initial_sptr(new @NAME@ (sampling_freq, waveform, frequency, ampl, offset));
 }
 
 int
index c8bdabf9f659882856510acb11b60173b5fdbaba..1dcdf81ad5a311417e44f37fbaec7af10b37172c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004, 2009 Free Software Foundation, Inc.
+ * Copyright 2004, 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ (size_t vlen)
 {
-  return @SPTR_NAME@ (new @NAME@ (vlen));
+  return gnuradio::get_initial_sptr (new @NAME@ (vlen));
 }
 
 @NAME@::@NAME@ (size_t vlen)
@@ -53,12 +53,12 @@ int
   int ninputs = input_items.size ();
 
   if (ninputs == 1){           // negate
-    for (int i = 0; i < noutput_items*d_vlen; i++)
+    for (size_t i = 0; i < noutput_items*d_vlen; i++)
       *optr++ = (@O_TYPE@) -((@I_TYPE@ *) input_items[0])[i];
   }
 
   else {
-    for (int i = 0; i < noutput_items*d_vlen; i++){
+    for (size_t i = 0; i < noutput_items*d_vlen; i++){
       @I_TYPE@ acc = ((@I_TYPE@ *) input_items[0])[i];
       for (int j = 1; j < ninputs; j++)
        acc -= ((@I_TYPE@ *) input_items[j])[i];
index b2a6c4ac4e66d1e68f01031095c2f686ef6a42ca..f3466d46f856dda0103b1c3d24dc3532e85ddff6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -54,7 +54,7 @@ int
 @NAME@_sptr
 gr_make_@BASE_NAME@ (int vlen)
 {
-  return @NAME@_sptr (new @NAME@ (vlen));
+  return gnuradio::get_initial_sptr(new @NAME@ (vlen));
 }
 
 std::vector<@TYPE@>
index 889a6f22c27adb2a9b730ab79f422a2a20a00766..1fe5df5b531eafc0ee3d58d0d940301970739cc5 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -84,6 +84,6 @@ int
 @NAME@_sptr
 gr_make_@BASE_NAME@ (const std::vector<@TYPE@> &data, bool repeat, int vlen)
 {
-  return @NAME@_sptr (new @NAME@ (data, repeat, vlen));
+  return gnuradio::get_initial_sptr(new @NAME@ (data, repeat, vlen));
 }
 
index f64dd1c973b1321498ef27f96c8364b9ce64e98e..29230f7a6ea21e4c49950339318ae562b6bc0023 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 @SPTR_NAME@
 gr_make_@BASE_NAME@ ()
 {
-  return @SPTR_NAME@ (new @NAME@ ());
+  return gnuradio::get_initial_sptr (new @NAME@ ());
 }
 
 @NAME@::@NAME@ ()
index 2da66b7ae2827b98768af9d213d114bf3a437937..09fb6c826cd706366957daa131dcb4e163b022ef 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -46,7 +46,7 @@ gr_file_descriptor_sink::gr_file_descriptor_sink (size_t itemsize, int fd)
 gr_file_descriptor_sink_sptr
 gr_make_file_descriptor_sink (size_t itemsize, int fd)
 {
-  return gr_file_descriptor_sink_sptr (new gr_file_descriptor_sink (itemsize, fd));
+  return gnuradio::get_initial_sptr(new gr_file_descriptor_sink (itemsize, fd));
 }
 
 gr_file_descriptor_sink::~gr_file_descriptor_sink ()
index d40235fab9a39815321794e4be78f96b3bdd36e1..aab0158e7ba8bc7ee1b9eafce6045e88ceb3c3be 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_file_sink_sptr
 gr_make_file_sink (size_t itemsize, const char *filename)
 {
-  return gr_file_sink_sptr (new gr_file_sink (itemsize, filename));
+  return gnuradio::get_initial_sptr(new gr_file_sink (itemsize, filename));
 }
 
 gr_file_sink::gr_file_sink(size_t itemsize, const char *filename)
@@ -70,5 +70,8 @@ gr_file_sink::work (int noutput_items,
     nwritten += count;
     inbuf += count * d_itemsize;
   }
+  if (d_unbuffered)
+         fflush (d_fp);
+         
   return nwritten;
 }
index 5ddeeb4d5686fffc8aadfc0ca1e725ce95d03ffb..c43304b0d37f1d07859b53a85a45e54f27b5f263 100644 (file)
@@ -118,3 +118,9 @@ gr_file_sink_base::do_update()
     d_updated = false;
   }
 }  
+
+void
+gr_file_sink_base::set_unbuffered(bool unbuffered)
+{
+       d_unbuffered = unbuffered;
+}
index 0c028d7fd3adcf7413f688d68bf5e8aaca602321..7b96cdb7f3758bbe5ef2d1c578dc0d50d0e8fe10 100644 (file)
@@ -37,6 +37,7 @@ class gr_file_sink_base
   bool         d_updated;      // is there a new FILE pointer?
   bool         d_is_binary;
   boost::mutex d_mutex;
+  bool         d_unbuffered;
 
  protected:
   gr_file_sink_base(const char *filename, bool is_binary);
@@ -61,6 +62,12 @@ class gr_file_sink_base
    * \brief if we've had an update, do it now.
    */
   void do_update();
+  
+  
+  /*!
+   * \brief turn on unbuffered writes for slower outputs
+   */
+  void set_unbuffered(bool unbuffered);
 };
 
 
index 05a3353bb4e6010da558a1c599a062ad81874bc8..ed4342482ddef2c343a56edfec1a7ee58e750070 100644 (file)
@@ -43,4 +43,9 @@ class gr_file_sink_base
    * \brief if we've had an update, do it now.
    */
   void do_update();
+
+  /*!
+   *\brief turn on unbuffered mode for slow outputs
+   */
+  void set_unbuffered(bool unbuffered);
 };
index 5591826d0cd80c2488b5b5f1e2f4199cb1e80e0e..d045e26b3914cddbb7a6ce0b3a362c3814febd1c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -74,7 +74,7 @@ gr_file_source::gr_file_source (size_t itemsize, const char *filename, bool repe
 gr_file_source_sptr
 gr_make_file_source (size_t itemsize, const char *filename, bool repeat)
 {
-  return gr_file_source_sptr (new gr_file_source (itemsize, filename, repeat));
+  return gnuradio::get_initial_sptr(new gr_file_source (itemsize, filename, repeat));
 }
 
 gr_file_source::~gr_file_source ()
index 2885fe428a12575cfa04f4e59139b049885c763d..a37189c2406b9115e4bdab576aaa68529f174b5d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -46,7 +46,7 @@ static float get_clean_num(float num){
 gr_histo_sink_f_sptr
 gr_make_histo_sink_f (gr_msg_queue_sptr msgq)
 {
-  return gr_histo_sink_f_sptr (new gr_histo_sink_f (msgq));
+  return gnuradio::get_initial_sptr(new gr_histo_sink_f (msgq));
 }
 
 gr_histo_sink_f::gr_histo_sink_f (gr_msg_queue_sptr msgq)
index b9e0cc382fb513be2a4b8e8733b6c28405ca81e0..8881e97f4d7c1de5af3396ca88beb62c0ce63ef5 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@
 gr_message_sink_sptr 
 gr_make_message_sink (size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block)
 {
-  return gr_message_sink_sptr(new gr_message_sink(itemsize, msgq, dont_block));
+  return gnuradio::get_initial_sptr(new gr_message_sink(itemsize, msgq, dont_block));
 }
 
 gr_message_sink::gr_message_sink (size_t itemsize, gr_msg_queue_sptr msgq, bool dont_block)
index 3efc5b3216c2eebf28c61bd5507abd57b6e1219a..0fa24f2f9c758864e4defbdb5da29e2476560cdc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
 gr_message_source_sptr
 gr_make_message_source(size_t itemsize, int msgq_limit)
 {
-  return gr_message_source_sptr(new gr_message_source(itemsize, msgq_limit));
+  return gnuradio::get_initial_sptr(new gr_message_source(itemsize, msgq_limit));
 }
 
 // public constructor that takes existing message queue
 gr_message_source_sptr
 gr_make_message_source(size_t itemsize, gr_msg_queue_sptr msgq)
 {
-  return gr_message_source_sptr(new gr_message_source(itemsize, msgq));
+  return gnuradio::get_initial_sptr(new gr_message_source(itemsize, msgq));
 }
 
 gr_message_source::gr_message_source (size_t itemsize, int msgq_limit)
index 80f78240d3a052ec942f80ef4972da8756084f2b..ce7feca13c49178437f99c3fccbe6cb831847ef9 100644 (file)
@@ -104,34 +104,49 @@ gr_oscope_guts::process_sample (const float *channel_data)
 
   d_decimator_count = d_decimator_count_init;
   
-  for (int i = 0; i < d_nchannels; i++)
-    d_buffer[i][d_obi] = channel_data[i];                // copy data into buffer
-
-  switch (d_state){
-  case HOLD_OFF:
-    d_hold_off_count--;
-    if (d_hold_off_count <= 0)
-      enter_look_for_trigger ();
-    break;
-
-  case LOOK_FOR_TRIGGER:
-    if (found_trigger ())
-      enter_post_trigger ();
-    break;
-
-  case POST_TRIGGER:
-    d_post_trigger_count--;
-    if (d_post_trigger_count <= 0){
-      write_output_records ();
-      enter_hold_off ();
-    }
-    break;
-
-  default:
-    assert (0);
+  if (d_trigger_mode != gr_TRIG_MODE_STRIPCHART)
+  {
+         for (int i = 0; i < d_nchannels; i++)
+               d_buffer[i][d_obi] = channel_data[i];                // copy data into buffer
+
+         switch (d_state){
+         case HOLD_OFF:
+               d_hold_off_count--;
+               if (d_hold_off_count <= 0)
+                 enter_look_for_trigger ();
+               break;
+
+         case LOOK_FOR_TRIGGER:
+               if (found_trigger ())
+                 enter_post_trigger ();
+               break;
+
+         case POST_TRIGGER:
+               d_post_trigger_count--;
+               if (d_post_trigger_count <= 0){
+                 write_output_records ();
+                 enter_hold_off ();
+               }
+               break;
+
+         default:
+               assert (0);
+         }
+
+         d_obi = incr_bi (d_obi);
+  }
+  else
+  {
+         for (int i = 0; i < d_nchannels; i++)
+         {
+           for (int j = OUTPUT_RECORD_SIZE-1; j >= 0; j--)
+           {
+                       d_buffer[i][j] = d_buffer[i][j-1];
+               }
+               d_buffer[i][0] = channel_data[i];
+         }
+         write_output_records();
   }
-
-  d_obi = incr_bi (d_obi);
 }
 
 /*
index cb401699e9d50fd045a56f3e41ed3f13e8b55e5c..eca0f6dc61f5cd5b61e17887029dd7fb01861e29 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003,2004,2005 Free Software Foundation, Inc.
+ * Copyright 2003,2004,2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 gr_oscope_sink_f_sptr
 gr_make_oscope_sink_f (double sampling_rate, gr_msg_queue_sptr msgq)
 {
-  return gr_oscope_sink_f_sptr (new gr_oscope_sink_f (sampling_rate, msgq));
+  return gnuradio::get_initial_sptr(new gr_oscope_sink_f (sampling_rate, msgq));
 }
 
 
index 63f6b1c987f5fb4b6a9a115c3a6a4de2bd5146ae..8e1222856dd134737c6b4e48e30a99c2eddbea3d 100644 (file)
@@ -27,6 +27,7 @@ enum gr_trigger_mode {
   gr_TRIG_MODE_FREE,
   gr_TRIG_MODE_AUTO,
   gr_TRIG_MODE_NORM,
+  gr_TRIG_MODE_STRIPCHART,
 };
 
 enum gr_trigger_slope {
index 3084a848be7a78c537af79e069703ca404533052..36b4cbe36b9197aedd151e223dbeff2b2795efb1 100644 (file)
@@ -135,7 +135,7 @@ gr_make_udp_sink (size_t itemsize,
                  const char *host, unsigned short port,
                  int payload_size, bool eof)
 {
-  return gr_udp_sink_sptr (new gr_udp_sink (itemsize, 
+  return gnuradio::get_initial_sptr(new gr_udp_sink (itemsize, 
                                            host, port,
                                            payload_size, eof));
 }
index fea9a26ba40083c3fb25768ed08badae5763fc1b..ca31233de4ff93f71aa7dfaaa21c5003b97c5629 100644 (file)
@@ -189,7 +189,7 @@ gr_udp_source_sptr
 gr_make_udp_source (size_t itemsize, const char *ipaddr, 
                    unsigned short port, int payload_size, bool eof, bool wait)
 {
-  return gr_udp_source_sptr (new gr_udp_source (itemsize, ipaddr, 
+  return gnuradio::get_initial_sptr(new gr_udp_source (itemsize, ipaddr, 
                                                port, payload_size, eof, wait));
 }
 
index 72e4ef51e0721ccbd163e06ac577e3f5eaa91d30..b60a6e3abdd131e8297b53714351e94f5f7fd5e8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2007,2008,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -58,7 +58,7 @@ gr_make_wavfile_sink(const char *filename,
                     unsigned int sample_rate,
                     int bits_per_sample)
 {
-  return gr_wavfile_sink_sptr (new gr_wavfile_sink (filename,
+  return gnuradio::get_initial_sptr(new gr_wavfile_sink (filename,
                                                    n_channels,
                                                    sample_rate,
                                                    bits_per_sample));
index 900f84efd1bb2dc7fd34357fcef735132ebc54cf..d00dd3028917dd61b19e664dd55084464e4b791d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -52,7 +52,7 @@
 gr_wavfile_source_sptr
 gr_make_wavfile_source (const char *filename, bool repeat)
 {
-  return gr_wavfile_source_sptr (new gr_wavfile_source (filename, repeat));
+  return gnuradio::get_initial_sptr(new gr_wavfile_source (filename, repeat));
 }
 
 
index b0e80427700c649efbb25bf0e674a96be839e775..f67e8843d16518130f76296241b7ea80aa2a7ba2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2003,2004,2007,2008,2009 Free Software Foundation, Inc.
+# Copyright 2003,2004,2007,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,7 +21,7 @@
 
 include $(top_srcdir)/Makefile.common
 
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(GRUEL_INCLUDES) $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
 
 noinst_LTLIBRARIES = libruntime.la libruntime-qa.la
 
@@ -120,6 +120,7 @@ grinclude_HEADERS =                                 \
        gr_timer.h                              \
        gr_tmp_path.h                           \
        gr_types.h                              \
+       gr_unittests.h                          \
        gr_vmcircbuf.h                          
 
 noinst_HEADERS =                               \
index e0be2db62788b1681028121a3e6be2b21012fb7c..5f741224834e16fee6458cd1d5fa2b706565472d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2003 Free Software Foundation, Inc.
+ * Copyright 2003,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -77,11 +77,20 @@ gr_preferences::get (const char *key)
   static char buf[1024];
 
   FILE         *fp = fopen (pathname (key), "r");
-  if (fp == 0)
+  if (fp == 0) {
+    perror (pathname (key));
     return 0;
+  }
 
   memset (buf, 0, sizeof (buf));
-  fread (buf, 1, sizeof (buf) - 1, fp);
+  size_t ret = fread (buf, 1, sizeof (buf) - 1, fp);
+  if(ret == 0) {
+    if(ferror(fp) != 0) {
+      perror (pathname (key));
+      fclose (fp);
+      return 0;
+    }
+  }
   fclose (fp);
   return buf;
 }
@@ -97,6 +106,13 @@ gr_preferences::set (const char *key, const char *value)
     return;
   }
 
-  fwrite (value, 1, strlen (value), fp);
+  size_t ret = fwrite (value, 1, strlen (value), fp);
+  if(ret == 0) {
+    if(ferror(fp) != 0) {
+      perror (pathname (key));
+      fclose (fp);
+      return;
+    }
+  }
   fclose (fp);
 };
index 96ffae85fe9a5bcef671b62919ff1652facdd33f..b0351248c39063d24d1f6c8b34c33a05c11371bd 100644 (file)
@@ -39,7 +39,7 @@ namespace gnuradio {
   detail::sptr_magic::create_and_stash_initial_sptr(gr_hier_block2 *p)
   {
     gr_basic_block_sptr sptr(p);
-    gruel::scoped_lock guard();
+    gruel::scoped_lock guard(s_mutex);
     s_map.insert(sptr_map::value_type(static_cast<gr_basic_block *>(p), sptr));
   }
 
@@ -60,7 +60,7 @@ namespace gnuradio {
      * p is a subclass of gr_hier_block2, thus we've already created the shared pointer
      * and stashed it away.  Fish it out and return it.
      */
-    gruel::scoped_lock guard();
+    gruel::scoped_lock guard(s_mutex);
     sptr_map::iterator pos = s_map.find(static_cast<gr_basic_block *>(p));
     if (pos == s_map.end())
       throw std::invalid_argument("gr_sptr_magic: invalid pointer!");
diff --git a/gnuradio-core/src/lib/runtime/gr_unittests.h b/gnuradio-core/src/lib/runtime/gr_unittests.h
new file mode 100644 (file)
index 0000000..70aa6f2
--- /dev/null
@@ -0,0 +1,67 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+
+#ifdef MKDIR_TAKES_ONE_ARG
+#define gr_mkdir(pathname, mode) mkdir(pathname)
+#else
+#define gr_mkdir(pathname, mode) mkdir((pathname), (mode))
+#endif
+
+/*
+ * Mostly taken from gr_preferences.cc/h
+ * The simplest thing that could possibly work:
+ *  the key is the filename; the value is the file contents.
+ */
+
+static void
+ensure_unittest_path (const char *path)
+{
+  struct stat statbuf;
+  if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
+    return;
+
+  // blindly try to make it    // FIXME make this robust. C++ SUCKS!
+  gr_mkdir (path, 0750);
+}
+
+static void
+get_unittest_path (const char *filename, char *fullpath, size_t pathsize)
+{
+  char path[200];
+  snprintf (path, sizeof(path), "./.unittests");
+  snprintf (fullpath, pathsize, "%s/%s", path, filename);
+
+  ensure_unittest_path(path);
+}
+
index 242f27d9c0d7d9de79696ca4af39a3fc13f76ab2..1a50b8c8e90cde7fbf8ade5d4581c28fcf575de2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2001,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
+# Copyright 2001,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 include $(top_srcdir)/Makefile.common
 
 if PYTHON
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) -I$(srcdir) \
+AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
         $(WITH_INCLUDES)
 
 EXTRA_DIST = gen-swig-bug-fix
index 7d0241f1c237f22eccb83808cf4de7dc6c562e54..e15a0059c65f8ebef11b63429c902508e957cc77 100644 (file)
@@ -46,6 +46,8 @@
 
 typedef std::complex<float>            gr_complex;
 typedef std::complex<double>           gr_complexd;
+typedef unsigned long long              uint64_t;
+typedef long long                       int64_t;
 
 
 // instantiate the required template specializations
index f0516f2fd9e808387f6b687e50556b7ccca12c0a..a3f3518dee8d2a3d9593648f027de58cc821c439 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2007,2008,2009 Free Software Foundation, Inc.
+# Copyright 2004,2007,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -34,6 +34,7 @@ grpython_PYTHON =                     \
        ofdm_packet_utils.py            \
        packet_utils.py                 \
        gr_unittest.py                  \
+       gr_xmlrunner.py                 \
        optfir.py                       \
        usrp_options.py         \
        window.py
index e40d9636ad8fdf9fdfc9e75c3703d732a13297a4..5e4e06871411800a6f9a35d6ffa74f062d884f5a 100644 (file)
@@ -20,7 +20,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-from gnuradio import gr
+from gnuradio import gr, optfir
 
 class pfb_arb_resampler_ccf(gr.hier_block2):
     '''
@@ -31,15 +31,36 @@ class pfb_arb_resampler_ccf(gr.hier_block2):
     streams. This block is provided to be consistent with the interface to the
     other PFB block.
     '''
-    def __init__(self, rate, taps, flt_size=32):
+    def __init__(self, rate, taps=None, flt_size=32, atten=100):
        gr.hier_block2.__init__(self, "pfb_arb_resampler_ccf",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
                                gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
         
         self._rate = rate
-        self._taps = taps
         self._size = flt_size
 
+        if taps is not None:
+            self._taps = taps
+        else:
+            # Create a filter that covers the full bandwidth of the input signal
+            bw = 0.4
+            tb = 0.2
+            ripple = 0.1
+            #self._taps = gr.firdes.low_pass_2(self._size, self._size, bw, tb, atten)
+            made = False
+            while not made:
+                try:
+                    self._taps = optfir.low_pass(self._size, self._size, bw, bw+tb, ripple, atten)
+                    made = True
+                except RuntimeError:
+                    ripple += 0.01
+                    made = False
+                    print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
+
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.pfb = gr.pfb_arb_resampler_ccf(self._rate, self._taps, self._size)
 
         self.connect(self, self.pfb)
index a479ed48ea9a357800fccd03dde273fccc3b69d3..3ddc1749a7ba87c19e300d36feb61215cd506bfe 100644 (file)
@@ -20,7 +20,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-from gnuradio import gr
+from gnuradio import gr, optfir
 
 class pfb_channelizer_ccf(gr.hier_block2):
     '''
@@ -29,15 +29,35 @@ class pfb_channelizer_ccf(gr.hier_block2):
     This simplifies the interface by allowing a single input stream to connect to this block.
     It will then output a stream for each channel.
     '''
-    def __init__(self, numchans, taps, oversample_rate=1):
+    def __init__(self, numchans, taps=None, oversample_rate=1, atten=100):
        gr.hier_block2.__init__(self, "pfb_channelizer_ccf",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
                                gr.io_signature(numchans, numchans, gr.sizeof_gr_complex)) # Output signature
 
         self._numchans = numchans
-        self._taps = taps
         self._oversample_rate = oversample_rate
 
+        if taps is not None:
+            self._taps = taps
+        else:
+            # Create a filter that covers the full bandwidth of the input signal
+            bw = 0.4
+            tb = 0.2
+            ripple = 0.1
+            made = False
+            while not made:
+                try:
+                    self._taps = optfir.low_pass(1, self._numchans, bw, bw+tb, ripple, atten)
+                    made = True
+                except RuntimeError:
+                    ripple += 0.01
+                    made = False
+                    print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
+
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._numchans)
         self.pfb = gr.pfb_channelizer_ccf(self._numchans, self._taps,
                                           self._oversample_rate)
index 176d0473e898d856e46c70c3425063f3c003ff2a..2e36e7bc1d41d6b1f75e645a374656b7cf269e2b 100644 (file)
@@ -20,7 +20,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-from gnuradio import gr
+from gnuradio import gr, optfir
 
 class pfb_decimator_ccf(gr.hier_block2):
     '''
@@ -29,15 +29,35 @@ class pfb_decimator_ccf(gr.hier_block2):
     This simplifies the interface by allowing a single input stream to connect to this block.
     It will then output a stream that is the decimated output stream.
     '''
-    def __init__(self, decim, taps, channel=0):
+    def __init__(self, decim, taps=None, channel=0, atten=100):
        gr.hier_block2.__init__(self, "pfb_decimator_ccf",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
                                gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
 
         self._decim = decim
-        self._taps = taps
         self._channel = channel
 
+        if taps is not None:
+            self._taps = taps
+        else:
+            # Create a filter that covers the full bandwidth of the input signal
+            bw = 0.4
+            tb = 0.2
+            ripple = 0.1
+            made = False
+            while not made:
+                try:
+                    self._taps = optfir.low_pass(1, self._decim, bw, bw+tb, ripple, atten)
+                    made = True
+                except RuntimeError:
+                    ripple += 0.01
+                    made = False
+                    print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
+
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._decim)
         self.pfb = gr.pfb_decimator_ccf(self._decim, self._taps, self._channel)
 
index db294404246c8f535d2cad1b497e0d9d53801cd2..a6094f7f459f871352be2843a0ec8af54b2c0552 100644 (file)
@@ -20,7 +20,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-from gnuradio import gr
+from gnuradio import gr, optfir
 
 class pfb_interpolator_ccf(gr.hier_block2):
     '''
@@ -31,7 +31,7 @@ class pfb_interpolator_ccf(gr.hier_block2):
     streams. This block is provided to be consistent with the interface to the
     other PFB block.
     '''
-    def __init__(self, interp, taps):
+    def __init__(self, interp, taps=None, atten=100):
        gr.hier_block2.__init__(self, "pfb_interpolator_ccf",
                                gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
                                gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
@@ -39,6 +39,27 @@ class pfb_interpolator_ccf(gr.hier_block2):
         self._interp = interp
         self._taps = taps
 
+        if taps is not None:
+            self._taps = taps
+        else:
+            # Create a filter that covers the full bandwidth of the input signal
+            bw = 0.4
+            tb = 0.2
+            ripple = 0.99
+            made = False
+            while not made:
+                try:
+                    self._taps = optfir.low_pass(self._interp, self._interp, bw, bw+tb, ripple, atten)
+                    made = True
+                except RuntimeError:
+                    ripple += 0.01
+                    made = False
+                    print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
+
+                    # Build in an exit strategy; if we've come this far, it ain't working.
+                    if(ripple >= 1.0):
+                        raise RuntimeError("optfir could not generate an appropriate filter.")
+
         self.pfb = gr.pfb_interpolator_ccf(self._interp, self._taps)
 
         self.connect(self, self.pfb)
index 2fa97fad8d58c4ae118b92716640bee1ff33899e..8fb70fb3fd2fe65d696c3618eccdc806b5d02f94 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 
 from gnuradio import gr, gr_unittest
 
-class test_head (gr_unittest.TestCase):
+class test_add_and_friends (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -126,4 +126,4 @@ class test_head (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_add_and_friends, "test_add_and_friends.xml")
index 215e0cacedc431406d6e3a4b751281185e391768..90056e09feb11bec20a4263948d6a4bfcd3abd94 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -350,4 +350,4 @@ class test_add_v_and_friends(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_add_v_and_friends, "test_add_v_and_friends.xml")
index bb3ddb11ec19d8a08ee9a142f843df6f8b1a2fbd..c55d191e07814da46eb81c44ca51d3cb472f3c10 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -25,7 +25,7 @@ import math
 
 test_output = False
 
-class test_sig_source (gr_unittest.TestCase):
+class test_agc (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -430,4 +430,4 @@ class test_sig_source (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_agc, "test_agc.xml")
index 2e16d879b04abcffdf2043fbe3008b10cc61b869..a9db3295a8be1b97150e5ce564dc64b3f8e775ad 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -24,7 +24,7 @@ from gnuradio import gr, gr_unittest
 import math
 
 
-class test_sig_source (gr_unittest.TestCase):
+class test_arg_max (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -73,5 +73,5 @@ class test_sig_source (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_arg_max, "test_arg_max.xml")
 
index 29b9796cdc96be7883247c6837f8b042f140eb51..b8b718a09d391de0601cd0b13aaae15bdbeff8b6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -227,4 +227,4 @@ class xtest_bin_statistics(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-   gr_unittest.main ()
+   gr_unittest.run(xtest_bin_statistics, "test_bin_statistics.xml")
index ee9bae65bdcfbfafb197a5b20350a3ee5db467a6..8cfb6009988fbf17a4c045a3809c573965ad4180 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007,2008 Free Software Foundation, Inc.
+# Copyright 2004,2007,2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 
 from gnuradio import gr, gr_unittest
 
-class test_head (gr_unittest.TestCase):
+class test_boolean_operators (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -159,4 +159,4 @@ class test_head (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_boolean_operators, "test_boolean_operators.xml")
index ac17aff29c684aca03edf68f65000dfc22022ad4..ac5b53b577d0de042ba54d724a15e063b436c24e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -38,7 +38,7 @@ def np2(k):
     return m
 
 
-class qa_classify(gr_unittest.TestCase):
+class test_classify(gr_unittest.TestCase):
 
     def setUp(self):
         self.tb = gr.top_block()
@@ -178,5 +178,4 @@ class qa_classify(gr_unittest.TestCase):
         assert sum < 1e-6
 
 if __name__ == '__main__':
-    gr_unittest.main()
-    
+   gr_unittest.run(test_classify, "test_classify.xml")
index b1ab8f546a20c4eca925c4cf822efa0b06236ee1..79e9cd092f503f1f559cee0bb0c26b6e7fb35e07 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -46,4 +46,4 @@ class test_cma_equalizer_fir(gr_unittest.TestCase):
        self.assertComplexTuplesAlmostEqual(expected_data, result)
 
 if __name__ == "__main__":
-    gr_unittest.main()
\ No newline at end of file
+    gr_unittest.run(test_cma_equalizer_fir, "test_cma_equalizer_fir.xml")
index 10f3668798ea8739f00b59d4e311ce05840bd458..76627247b746b62ae057825cccdfd745d48830fd 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -138,5 +138,5 @@ class test_complex_ops (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_complex_ops, "test_complex_ops.xml")
 
index 13d2840a06e0bcd179e4de83146bc87ca3e60e1b..27e1802e0834db20e5ba2ed4663c229b424258c8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_head (gr_unittest.TestCase):
+class test_constellation_decoder (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -49,5 +49,5 @@ class test_head (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_constellation_decoder, "test_constellation_decoder.xml")
 
index 7f9f72a7bab330259ad71a1b319647d89238c698..e8ee480cc0adede464c6ce07ed2000eec986b2cb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -55,4 +55,4 @@ class test_copy(gr_unittest.TestCase):
     
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_copy, "test_copy.xml")
index a436c6ad6b7ecc25b52a1561a99b8a547b321289..b3575f4e6ba0785f012659c0cf6dec5917bff742 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -79,5 +79,5 @@ class test_correlate_access_code(gr_unittest.TestCase):
         
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_correlate_access_code, "test_correlate_access_code.xml")
         
index 8835cba5a2b00e0d1d4145d854266fdf8b7b2ba5..7cad0ae721eea11b4071597c9693ea259e5f131a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -62,4 +62,4 @@ class test_delay (gr_unittest.TestCase):
         self.assertEqual (expected_result, dst_data)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_delay, "test_delay.xml")
index 04c0e2a4963fc59e900cdd78a37d4dd4a212f7db..97e9e329a51e513c21fdf6250a9bf392803a2a58 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -31,7 +31,7 @@ def make_random_int_tuple(L, min, max):
     return tuple(result)
 
     
-class test_encoder (gr_unittest.TestCase):
+class test_diff_encoder (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -82,5 +82,5 @@ class test_encoder (gr_unittest.TestCase):
         self.assertEqual(expected_result, actual_result)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_diff_encoder, "test_diff_encoder.xml")
 
index 385ffa519a4ab736abb2ac9327c9e050e754bb44..5ac115e2051f5199e7be4d34ab7b84b21fc1764f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_complex_ops (gr_unittest.TestCase):
+class test_diff_phasor (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -46,5 +46,5 @@ class test_complex_ops (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_diff_phasor, "test_diff_phasor.xml")
 
index b0dc470617931f1268d22fe55ce45614be2e5fd1..caf3959f496f986619a55a801a5296c65ce8bc0a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -47,4 +47,4 @@ class test_ccsds_27 (gr_unittest.TestCase):
     
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_ccsds_27, "test_ccsds_27.xml")
index 64bbe45ce7635c928ee1b47b9162243ff1ab5bd9..a91409537620ca30beb06bee005a64b7204a2131 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -107,4 +107,4 @@ class test_feval(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_feval, "test_feval.xml")
index 412c4c48bda12a700dcf042e75e44e45344a56e9..98d80fbb03f240c77ea565eee9a5da912b5d7564 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -29,7 +29,7 @@ primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,
           227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311)
 
 
-class test_fft_filter(gr_unittest.TestCase):
+class test_fft(gr_unittest.TestCase):
 
     def setUp(self):
        pass
@@ -154,5 +154,5 @@ class test_fft_filter(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_fft, "test_fft.xml")
         
index d4106ee478ee9bf815777457d148509dcfa219f9..b3124ad2951f98f7606198b8141b9774ef41a874 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005,2007 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -275,5 +275,5 @@ class test_fft_filter(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_fft_filter, "test_fft_filter.xml")
         
index b92f143d59a7168d9f249e83783d79fcdacc2f7c..a25c65e5c176f5a2d2372ea75bc61df4fc30c3d2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class qa_filter_delay_fc (gr_unittest.TestCase):
+class test_filter_delay_fc (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -314,4 +314,4 @@ class qa_filter_delay_fc (gr_unittest.TestCase):
 
         
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_filter_delay_fc, "test_filter_delay_fc.xml")
index 4466e8aab6b1bb6d71bf424052b076654ee6e4ae..c9ba54164425251fa97050e84a0a24fe63275f17 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -35,5 +35,4 @@ class test_fractional_resampler (gr_unittest.TestCase):
         op2 = gr.fractional_interpolator_cc(0.0, 1.0)
         
 if __name__ == '__main__':
-    gr_unittest.main()
-        
+    gr_unittest.run(test_fractional_resampler, "test_fractional_resampler.xml")
index 53d1a89ba19b24495af0dfc322cb69de6e5ff0e2..829185c343b1064b5731faa7c785b5fa9be208cc 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -52,5 +52,5 @@ class test_frequency_modulator (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_frequency_modulator, "test_frequency_modulator.xml")
         
index b506e3ed4127c4cbab0027bf7b4cfa9c331ae7e0..429e57c32d7e691c594947a0c8e9feebf7bfb934 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -71,5 +71,5 @@ class test_bytes_to_syms (gr_unittest.TestCase):
         
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_bytes_to_syms, "test_bytes_to_syms.xml")
         
index fc211657f683a410de83a1bdae4d8449a6e69607..1665d9dd50869f1aa561dd1d86fa4c667282a0f5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -91,4 +91,4 @@ def auto_correlate(data):
     return R
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_glfsr_source, "test_glfsr_source.xml")
index d5dc595c9f442be05ab0fc633698a38a4accd3f3..dcb3d867e984792dcb52713e56b375bf95acdea3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -61,4 +61,4 @@ class test_goertzel(gr_unittest.TestCase):
        self.assertAlmostEqual(expected_result, actual_result, places=4)
 
 if __name__ == '__main__':
-    gr_unittest.main()
+    gr_unittest.run(test_goertzel, "test_goertzel.xml")
index b7a60597b218def0e142fbb898800c3c9b1f7916..aae233b56ed6741dec45f9b76712c249fbf99123 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -44,4 +44,4 @@ class test_head (gr_unittest.TestCase):
     
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_head, "test_head.xml")
index cc336a4d1b495ab271324b3ea2ab35232b48cde7..924a0fb52efb240300828f4c17852bfd0912b48f 100755 (executable)
@@ -366,4 +366,4 @@ class test_hier_block2(gr_unittest.TestCase):
         
     
 if __name__ == "__main__":
-    gr_unittest.main()
+    gr_unittest.run(test_hier_block2, "test_hier_block2.xml")
index 817ba94081d59674f7423c787f2d20b0098c3fb5..2235f28b1352c692bbced6e1162f545cd5ff3d04 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_sig_source (gr_unittest.TestCase):
+class test_hilbert (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -113,4 +113,4 @@ class test_sig_source (gr_unittest.TestCase):
         self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_hilbert, "test_hilbert.xml")
index 833285077aa5eb04757705f1e90f494d54d35ae5..0e522c16b153e8c8b00e25cf520b73bf34e8c59d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -155,5 +155,5 @@ class test_iir (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_iir, "test_iir.xml")
         
index fbd601e346636ba7186a87d5f59208933201c67d..501a89f84159234ab3f92619602e10551401dc59 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -72,4 +72,4 @@ class test_integrate (gr_unittest.TestCase):
        self.assertComplexTuplesAlmostEqual(dst_data, dst.data(), 6)    
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_integrate, "test_integrate.xml")
index 3e0b6c5fcb6fa3e14b25de1afdcb48d8ad5550b7..1320d0ec5bf41f7ab0d09ab549d98edaa353ed07 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -77,5 +77,5 @@ class test_interleave (gr_unittest.TestCase):
         self.assertFloatTuplesAlmostEqual (expected_result3, dst3.data ())
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_interleave, "test_interleave.xml")
         
index ea326ce4084fd886511e37443c9be3f0559f1356..9901b71b71c4eed1c9178351901246af852427f1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -50,5 +50,5 @@ class test_interp_fir_filter (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_interp_fir_filter, "test_interp_fir_filter.xml")
         
index cc25d180e5436d230c85113b48746d714764463b..2f0bbe33d30d366744ac881406df61f38faa586e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -87,5 +87,5 @@ class test_kludge_copy(gr_unittest.TestCase):
         self.assertRaises(ValueError, self.tb.run)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_kludge_copy, "test_kludge_copy.xml")
     
index 91ddf7cd701d11f99f5ee59aa5df7c8b8db766fa..7d29a950754db575f26ea32b2534eb0e75e8f97b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2008 Free Software Foundation, Inc.
+# Copyright 2005,2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 
 from gnuradio import gr, gr_unittest
 
-class test_head (gr_unittest.TestCase):
+class test_kludged_imports (gr_unittest.TestCase):
 
     def setUp(self):
         pass
@@ -40,4 +40,4 @@ class test_head (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_kludged_imports, "test_kludged_imports.xml")
index 0171c93db490d78b4c9e3a9162e6e26e6d560ad6..5aa231623dd87ee3acafe130a3b69cf3599f8bd4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -24,7 +24,7 @@ from gnuradio import gr, gr_unittest
 import math
 
 
-class test_sig_source (gr_unittest.TestCase):
+class test_max (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -66,5 +66,5 @@ class test_sig_source (gr_unittest.TestCase):
        self.assertEqual(expected_result, result_data)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_max, "test_max.xml")
 
index cb6c4c33c8fc3ac9835bbbbcf74ca8683e8d7364..e7f2778d16002388325f28c75e559cefd168e166 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -128,4 +128,4 @@ class test_message (gr_unittest.TestCase):
         self.assertEquals(tuple(map(ord, '0123456789')), dst.data())
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_message, "test_message.xml")
index 646f495c4a46e253e41281d7db6eb6865cd84c68..58c5062a5750fe29dcd91bcbda398e379ebee1cb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005,2007 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 
 from gnuradio import gr, gr_unittest
 
-class test_head (gr_unittest.TestCase):
+class test_mute (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -86,4 +86,4 @@ class test_head (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_mute, "test_mute.xml")
index 4dca67b22862be75f500197e930f577ef310d1b1..5a2e6a0d2692bf7a1de38928b5bfe1fdce1aec41 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 
 from gnuradio import gr, gr_unittest
 
-class test_single_pole_iir(gr_unittest.TestCase):
+class test_nlog10(gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -43,5 +43,5 @@ class test_single_pole_iir(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_nlog10, "test_nlog10.xml")
         
index f8ed739a9822ac5d5f6abfcb6642ca2bfac3ae1c..4a575f5d63436e410dd5518a4f34a3d31b5083f6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -35,5 +35,5 @@ class test_noise_source(gr_unittest.TestCase):
         op = gr.noise_source_f(gr.GR_GAUSSIAN, 10, 10)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_noise_source, "test_noise_source.xml")
         
index d45560d3c3c7aaea0dcf4ae5a1b352b7aee42d95..d69f5ca5ba725d8db977f777fd9878dea4501255 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 from pprint import pprint
 
-class testing (gr_unittest.TestCase):
+class test_ofdm_insert_preamble (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -176,4 +176,4 @@ class testing (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_ofdm_insert_preamble, "test_ofdm_insert_preamble.xml")
index b1b3a971db3f3231217415bc29ef32d71fcf521f..8833f755b9a71193e156fcbeb88c82e54b2cc500 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -401,5 +401,5 @@ class test_packing(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-   gr_unittest.main ()
+   gr_unittest.run(test_packing, "test_packing.xml")
         
index 533f4f05123292f18340aba5497ce829229aad9b..a6683c5c39cfadd494519fb37972a9f2f99a0c04 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -139,5 +139,5 @@ class test_pipe_fittings(gr_unittest.TestCase):
         self.assertEqual(expected_results, dst.data())
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_pipe_fittings, "test_pipe_fittings.xml")
         
index 4a109663c0b77002161e08b6e94a18ac7205e316..8e4a0eefa0f00df8ce2647a36ea764581355756c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_sig_source (gr_unittest.TestCase):
+class test_pll_carriertracking (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block()
@@ -155,4 +155,4 @@ class test_sig_source (gr_unittest.TestCase):
         self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_pll_carriertracking, "test_pll_carriertracking.xml")
index ac9c1844e8f6625bc47feeb41ee877357779c8d4..5225a9a3b6df2560f760960dc1ffa0041592bbee 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_sig_source (gr_unittest.TestCase):
+class test_pll_freqdet (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block()
@@ -158,4 +158,4 @@ class test_sig_source (gr_unittest.TestCase):
         self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 3)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_pll_freqdet, "test_pll_freqdet.xml")
index 9cafa61e3288a7f04830e2ea631bc1b3db3c7815..c40a885a8621b1162fc993838a1f4250cebb501d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_sig_source (gr_unittest.TestCase):
+class test_pll_refout (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block()
@@ -155,4 +155,4 @@ class test_sig_source (gr_unittest.TestCase):
         self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_pll_refout, "test_pll_refout.xml")
index 01d01bde02671271ab35a1cb27eb9f4f0bf83d64..fbdabb4cbd7b4ef69875781ced63006f5565b66f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -47,4 +47,4 @@ class test_pn_correlator_cc(gr_unittest.TestCase):
         self.assertEqual(data[-1], (1.0+0j))
         
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_pn_correlator_cc, "test_pn_correlator_cc.xml")
index f8bf4b121ceeab666a622ae6849f4b09725706e2..3bd6160df1e59411a8ba2d9de22c2690db55a570 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -294,5 +294,5 @@ class test_rational_resampler (gr_unittest.TestCase):
 if __name__ == '__main__':
     pass
     # FIXME: Disabled, see ticket:210
-    # gr_unittest.main()
+    # gr_unittest.run(test_rational_resampler, "test_rational_resampler.xml")
         
index 64e751189e0e6952376ab100ec665c7d178e6992..32ecc3776e5aef9fbc6a3eeb1a489cf2495ad35e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_sig_source (gr_unittest.TestCase):
+class test_regenerate (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -87,4 +87,4 @@ class test_sig_source (gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_regenerate, "test_regenerate.xml")
index 1ecc7ead31d97fe1b81689a32ea853250b4c7c41..2b1429980f0b3cca50e792ba69b6fd092e7bd4e5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -45,4 +45,4 @@ class test_repeat (gr_unittest.TestCase):
        self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6)      
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_repeat, "test_repeat.xml")
index aecf492933993e2836d4f4246f77be83b9d9f8da..241d8ec2a31a06e270fc143a2b68404f1aecb98e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -61,4 +61,4 @@ class test_scrambler(gr_unittest.TestCase):
         self.assertEqual(src_data, dst.data())                            
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_scrambler, "test_scrambler.xml")
index 058890c4fd022099e2a516bcfa64dd891661abb9..4bb58038f4fa8a19934eb38c31037fca0e43994b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -154,4 +154,4 @@ class test_sig_source (gr_unittest.TestCase):
         self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5)
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_sig_source, "test_sig_source.xml")
index 8ad0a9bb269522d2ff3e5684d4c1af0c7aed8d84..1d2e6595c40163f0ea7ad779f695b8caa2033abb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -68,5 +68,5 @@ class test_single_pole_iir(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_single_pole_iir, "test_single_pole_iir.xml")
         
index 865c7c9064f1e8eafa4153f8c7e27313322c029f..47b4948ba8abec443d7246267fa601bf3922379b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -68,5 +68,5 @@ class test_single_pole_iir_cc(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_single_pole_iir_cc, "test_single_pole_iir_cc.xml")
         
index 106e9731463b7ccbfdf3c07efedc6fcbe8c74f62..de2d8fc9532e257d637b72452495c91e46b19e75 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -99,4 +99,4 @@ class test_skiphead (gr_unittest.TestCase):
     
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_skiphead, "test_skiphead.xml")
index 8a76f8144d78e4945164560bfd9c1cd60459c638..7d6ddf81b9d3858cb113df9ff1fb7bec35c8bdbb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005,2007 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@
 
 from gnuradio import gr, gr_unittest
 
-class test_head (gr_unittest.TestCase):
+class test_stream_mux (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -165,4 +165,4 @@ class test_head (gr_unittest.TestCase):
         self.assertEqual (exp_data, result_data)
 
 if __name__ == '__main__':
-    gr_unittest.main()
+    gr_unittest.run(test_stream_mux, "test_stream_mux.xml")
index b00b26bbe7c47bf3fccfeaaeb69b0480e190cfd6..097e394c974980ff761e886ef4f6e4db861acca0 100755 (executable)
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 from threading import Timer
 
-class test_sink_source(gr_unittest.TestCase):
+class test_udp_sink_source(gr_unittest.TestCase):
 
     def setUp(self):
         self.tb_snd = gr.top_block()
@@ -95,5 +95,5 @@ class test_sink_source(gr_unittest.TestCase):
         #print "tb_rcv stopped by Timer"
         
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_udp_sink_source, "test_udp_sink_source.xml")
     
index edb263ade6eef7853a326348eb565f65863c8124..d1faf9d9e51ada7f7e2c8a0779877b8c9a17d693 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -53,5 +53,5 @@ class test_unpack(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-   gr_unittest.main ()
+   gr_unittest.run(test_unpack, "test_unpack.xml")
         
index 149c669038a26784f713ce1e6943c95da6149274..5d8d85c7ccc3614e913f42caf52a70e2eca0ed6a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import math
 
-class test_sink_source(gr_unittest.TestCase):
+class test_vector_sink_source(gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -61,5 +61,5 @@ class test_sink_source(gr_unittest.TestCase):
         self.assertRaises(ValueError, lambda : gr.vector_source_f(src_data, False, 3))
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_vector_sink_source, "test_vector_sink_source.xml")
 
index 3ba5dfbce68a28a69902db633207736105746c59..d9f38e3f1e885b019ece52e3d1cd3ee4d2a847d4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -27,7 +27,7 @@ from os.path import getsize
 
 g_in_file = os.path.join (os.getenv ("srcdir"), "test_16bit_1chunk.wav")
 
-class qa_wavefile(gr_unittest.TestCase):
+class test_wavefile(gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -66,4 +66,4 @@ class qa_wavefile(gr_unittest.TestCase):
 
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_wavefile, "test_wavefile.xml")
index a48343c6bf4970d7814b1277bec62aa7bbd6527f..c2c4df2ba5f7a0fd4d26bfe7bdd4cf5329299bb2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,7 +21,8 @@
 # 
 
 import unittest
-import sys
+import gr_xmlrunner
+import sys, os, stat
 
 class TestCase(unittest.TestCase):
     """A subclass of unittest.TestCase that adds additional assertions
@@ -37,7 +38,7 @@ class TestCase(unittest.TestCase):
 
            Note that decimal places (from zero) is usually not the same
            as significant digits (measured from the most signficant digit).
-        """
+       """
         if round(second.real-first.real, places) != 0:
             raise self.failureException, \
                   (msg or '%s != %s within %s places' % (`first`, `second`, `places` ))
@@ -106,6 +107,58 @@ TextTestRunner = unittest.TextTestRunner
 TestProgram = unittest.TestProgram
 main = TestProgram
 
+def run(PUT, filename=None):
+    ''' 
+    Runs the unittest on a TestCase and produces an optional XML report
+    PUT:      the program under test and should be a gr_unittest.TestCase
+    filename: an optional filename to save the XML report of the tests
+              this will live in ./.unittests/python
+    '''
+
+    # Run this is given a file name
+    if(filename is not None):
+        basepath = "./.unittests"
+        path = basepath + "/python"
+
+        if not os.path.exists(basepath):
+            os.makedirs(basepath, 0750)
+
+        xmlrunner = None
+        # only proceed if .unittests is writable
+        st = os.stat(basepath)[stat.ST_MODE]
+        if(st & stat.S_IWUSR > 0):
+            # Test if path exists; if not, build it
+            if not os.path.exists(path):
+                os.makedirs(path, 0750)
+
+            # Just for safety: make sure we can write here, too
+            st = os.stat(path)[stat.ST_MODE]
+            if(st & stat.S_IWUSR > 0):
+                # Create an XML runner to filename
+                fout = file(path+"/"+filename, "w")
+                xmlrunner = gr_xmlrunner.XMLTestRunner(fout)
+
+        txtrunner = TextTestRunner(verbosity=1)
+
+        # Run the test; runner also creates XML output file
+        # FIXME: make xmlrunner output to screen so we don't have to do run and main
+        suite = TestLoader().loadTestsFromTestCase(PUT)
+
+        # use the xmlrunner if we can write the the directory
+        if(xmlrunner is not None):
+            xmlrunner.run(suite)
+
+        main()
+        
+        # This will run and fail make check if problem
+        # but does not output to screen.
+        #main(testRunner = xmlrunner)
+
+    else:
+        # If no filename is given, just run the test
+        main()
+
+
 ##############################################################################
 # Executing this module from the command line
 ##############################################################################
diff --git a/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py b/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py
new file mode 100644 (file)
index 0000000..ded77f5
--- /dev/null
@@ -0,0 +1,385 @@
+"""
+XML Test Runner for PyUnit
+"""
+
+# Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in
+# the Public Domain. With contributions by Paolo Borelli and others.
+# Added to GNU Radio Oct. 3, 2010
+
+from __future__ import with_statement
+
+__version__ = "0.1"
+
+import os.path
+import re
+import sys
+import time
+import traceback
+import unittest
+from xml.sax.saxutils import escape
+
+try:
+    from StringIO import StringIO
+except ImportError:
+    from io import StringIO
+
+
+class _TestInfo(object):
+
+    """Information about a particular test.
+    
+    Used by _XMLTestResult.
+    
+    """
+
+    def __init__(self, test, time):
+        (self._class, self._method) = test.id().rsplit(".", 1)
+        self._time = time
+        self._error = None
+        self._failure = None
+
+    @staticmethod
+    def create_success(test, time):
+        """Create a _TestInfo instance for a successful test."""
+        return _TestInfo(test, time)
+
+    @staticmethod
+    def create_failure(test, time, failure):
+        """Create a _TestInfo instance for a failed test."""
+        info = _TestInfo(test, time)
+        info._failure = failure
+        return info
+
+    @staticmethod
+    def create_error(test, time, error):
+        """Create a _TestInfo instance for an erroneous test."""
+        info = _TestInfo(test, time)
+        info._error = error
+        return info
+
+    def print_report(self, stream):
+        """Print information about this test case in XML format to the
+        supplied stream.
+
+        """
+        stream.write('  <testcase classname="%(class)s" name="%(method)s" time="%(time).4f">' % \
+            {
+                "class": self._class,
+                "method": self._method,
+                "time": self._time,
+            })
+        if self._failure is not None:
+            self._print_error(stream, 'failure', self._failure)
+        if self._error is not None:
+            self._print_error(stream, 'error', self._error)
+        stream.write('</testcase>\n')
+
+    def _print_error(self, stream, tagname, error):
+        """Print information from a failure or error to the supplied stream."""
+        text = escape(str(error[1]))
+        stream.write('\n')
+        stream.write('    <%s type="%s">%s\n' \
+            % (tagname, _clsname(error[0]), text))
+        tb_stream = StringIO()
+        traceback.print_tb(error[2], None, tb_stream)
+        stream.write(escape(tb_stream.getvalue()))
+        stream.write('    </%s>\n' % tagname)
+        stream.write('  ')
+
+
+def _clsname(cls):
+    return cls.__module__ + "." + cls.__name__
+
+
+class _XMLTestResult(unittest.TestResult):
+
+    """A test result class that stores result as XML.
+
+    Used by XMLTestRunner.
+
+    """
+
+    def __init__(self, classname):
+        unittest.TestResult.__init__(self)
+        self._test_name = classname
+        self._start_time = None
+        self._tests = []
+        self._error = None
+        self._failure = None
+
+    def startTest(self, test):
+        unittest.TestResult.startTest(self, test)
+        self._error = None
+        self._failure = None
+        self._start_time = time.time()
+
+    def stopTest(self, test):
+        time_taken = time.time() - self._start_time
+        unittest.TestResult.stopTest(self, test)
+        if self._error:
+            info = _TestInfo.create_error(test, time_taken, self._error)
+        elif self._failure:
+            info = _TestInfo.create_failure(test, time_taken, self._failure)
+        else:
+            info = _TestInfo.create_success(test, time_taken)
+        self._tests.append(info)
+
+    def addError(self, test, err):
+        unittest.TestResult.addError(self, test, err)
+        self._error = err
+
+    def addFailure(self, test, err):
+        unittest.TestResult.addFailure(self, test, err)
+        self._failure = err
+
+    def print_report(self, stream, time_taken, out, err):
+        """Prints the XML report to the supplied stream.
+        
+        The time the tests took to perform as well as the captured standard
+        output and standard error streams must be passed in.a
+
+        """
+        stream.write('<testsuite errors="%(e)d" failures="%(f)d" ' % \
+            { "e": len(self.errors), "f": len(self.failures) })
+        stream.write('name="%(n)s" tests="%(t)d" time="%(time).3f">\n' % \
+            {
+                "n": self._test_name,
+                "t": self.testsRun,
+                "time": time_taken,
+            })
+        for info in self._tests:
+            info.print_report(stream)
+        stream.write('  <system-out><![CDATA[%s]]></system-out>\n' % out)
+        stream.write('  <system-err><![CDATA[%s]]></system-err>\n' % err)
+        stream.write('</testsuite>\n')
+
+
+class XMLTestRunner(object):
+
+    """A test runner that stores results in XML format compatible with JUnit.
+
+    XMLTestRunner(stream=None) -> XML test runner
+
+    The XML file is written to the supplied stream. If stream is None, the
+    results are stored in a file called TEST-<module>.<class>.xml in the
+    current working directory (if not overridden with the path property),
+    where <module> and <class> are the module and class name of the test class.
+
+    """
+
+    def __init__(self, stream=None):
+        self._stream = stream
+        self._path = "."
+
+    def run(self, test):
+        """Run the given test case or test suite."""
+        class_ = test.__class__
+        classname = class_.__module__ + "." + class_.__name__
+        if self._stream == None:
+            filename = "TEST-%s.xml" % classname
+            stream = file(os.path.join(self._path, filename), "w")
+            stream.write('<?xml version="1.0" encoding="utf-8"?>\n')
+        else:
+            stream = self._stream
+
+        result = _XMLTestResult(classname)
+        start_time = time.time()
+
+        with _fake_std_streams():
+            test(result)
+            try:
+                out_s = sys.stdout.getvalue()
+            except AttributeError:
+                out_s = ""
+            try:
+                err_s = sys.stderr.getvalue()
+            except AttributeError:
+                err_s = ""
+
+        time_taken = time.time() - start_time
+        result.print_report(stream, time_taken, out_s, err_s)
+        if self._stream is None:
+            stream.close()
+
+        return result
+
+    def _set_path(self, path):
+        self._path = path
+
+    path = property(lambda self: self._path, _set_path, None,
+            """The path where the XML files are stored.
+            
+            This property is ignored when the XML file is written to a file
+            stream.""")
+
+
+class _fake_std_streams(object):
+
+    def __enter__(self):
+        self._orig_stdout = sys.stdout
+        self._orig_stderr = sys.stderr
+        sys.stdout = StringIO()
+        sys.stderr = StringIO()
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        sys.stdout = self._orig_stdout
+        sys.stderr = self._orig_stderr
+
+
+class XMLTestRunnerTest(unittest.TestCase):
+
+    def setUp(self):
+        self._stream = StringIO()
+
+    def _try_test_run(self, test_class, expected):
+
+        """Run the test suite against the supplied test class and compare the
+        XML result against the expected XML string. Fail if the expected
+        string doesn't match the actual string. All time attributes in the
+        expected string should have the value "0.000". All error and failure
+        messages are reduced to "Foobar".
+
+        """
+
+        runner = XMLTestRunner(self._stream)
+        runner.run(unittest.makeSuite(test_class))
+
+        got = self._stream.getvalue()
+        # Replace all time="X.YYY" attributes by time="0.000" to enable a
+        # simple string comparison.
+        got = re.sub(r'time="\d+\.\d+"', 'time="0.000"', got)
+        # Likewise, replace all failure and error messages by a simple "Foobar"
+        # string.
+        got = re.sub(r'(?s)<failure (.*?)>.*?</failure>', r'<failure \1>Foobar</failure>', got)
+        got = re.sub(r'(?s)<error (.*?)>.*?</error>', r'<error \1>Foobar</error>', got)
+        # And finally Python 3 compatibility.
+        got = got.replace('type="builtins.', 'type="exceptions.')
+
+        self.assertEqual(expected, got)
+
+    def test_no_tests(self):
+        """Regression test: Check whether a test run without any tests
+        matches a previous run.
+        
+        """
+        class TestTest(unittest.TestCase):
+            pass
+        self._try_test_run(TestTest, """<testsuite errors="0" failures="0" name="unittest.TestSuite" tests="0" time="0.000">
+  <system-out><![CDATA[]]></system-out>
+  <system-err><![CDATA[]]></system-err>
+</testsuite>
+""")
+
+    def test_success(self):
+        """Regression test: Check whether a test run with a successful test
+        matches a previous run.
+        
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                pass
+        self._try_test_run(TestTest, """<testsuite errors="0" failures="0" name="unittest.TestSuite" tests="1" time="0.000">
+  <testcase classname="__main__.TestTest" name="test_foo" time="0.000"></testcase>
+  <system-out><![CDATA[]]></system-out>
+  <system-err><![CDATA[]]></system-err>
+</testsuite>
+""")
+
+    def test_failure(self):
+        """Regression test: Check whether a test run with a failing test
+        matches a previous run.
+        
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                self.assert_(False)
+        self._try_test_run(TestTest, """<testsuite errors="0" failures="1" name="unittest.TestSuite" tests="1" time="0.000">
+  <testcase classname="__main__.TestTest" name="test_foo" time="0.000">
+    <failure type="exceptions.AssertionError">Foobar</failure>
+  </testcase>
+  <system-out><![CDATA[]]></system-out>
+  <system-err><![CDATA[]]></system-err>
+</testsuite>
+""")
+
+    def test_error(self):
+        """Regression test: Check whether a test run with a erroneous test
+        matches a previous run.
+        
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                raise IndexError()
+        self._try_test_run(TestTest, """<testsuite errors="1" failures="0" name="unittest.TestSuite" tests="1" time="0.000">
+  <testcase classname="__main__.TestTest" name="test_foo" time="0.000">
+    <error type="exceptions.IndexError">Foobar</error>
+  </testcase>
+  <system-out><![CDATA[]]></system-out>
+  <system-err><![CDATA[]]></system-err>
+</testsuite>
+""")
+
+    def test_stdout_capture(self):
+        """Regression test: Check whether a test run with output to stdout
+        matches a previous run.
+        
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                sys.stdout.write("Test\n")
+        self._try_test_run(TestTest, """<testsuite errors="0" failures="0" name="unittest.TestSuite" tests="1" time="0.000">
+  <testcase classname="__main__.TestTest" name="test_foo" time="0.000"></testcase>
+  <system-out><![CDATA[Test
+]]></system-out>
+  <system-err><![CDATA[]]></system-err>
+</testsuite>
+""")
+
+    def test_stderr_capture(self):
+        """Regression test: Check whether a test run with output to stderr
+        matches a previous run.
+        
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                sys.stderr.write("Test\n")
+        self._try_test_run(TestTest, """<testsuite errors="0" failures="0" name="unittest.TestSuite" tests="1" time="0.000">
+  <testcase classname="__main__.TestTest" name="test_foo" time="0.000"></testcase>
+  <system-out><![CDATA[]]></system-out>
+  <system-err><![CDATA[Test
+]]></system-err>
+</testsuite>
+""")
+
+    class NullStream(object):
+        """A file-like object that discards everything written to it."""
+        def write(self, buffer):
+            pass
+
+    def test_unittests_changing_stdout(self):
+        """Check whether the XMLTestRunner recovers gracefully from unit tests
+        that change stdout, but don't change it back properly.
+
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                sys.stdout = XMLTestRunnerTest.NullStream()
+
+        runner = XMLTestRunner(self._stream)
+        runner.run(unittest.makeSuite(TestTest))
+
+    def test_unittests_changing_stderr(self):
+        """Check whether the XMLTestRunner recovers gracefully from unit tests
+        that change stderr, but don't change it back properly.
+
+        """
+        class TestTest(unittest.TestCase):
+            def test_foo(self):
+                sys.stderr = XMLTestRunnerTest.NullStream()
+
+        runner = XMLTestRunner(self._stream)
+        runner.run(unittest.makeSuite(TestTest))
+
+
+if __name__ == "__main__":
+    unittest.main()
index 6dc1a26f833c7f579ae877abc1b994e26dcfbccb..17ee32f34dc9d75a3d1b51c02ecad320c351a605 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -21,7 +21,9 @@
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
 
+#include <gr_unittests.h>
 #include <qa_runtime.h>
 #include <qa_general.h>
 #include <qa_filter.h>
 int 
 main (int argc, char **argv)
 {
-  
-  CppUnit::TextTestRunner      runner;
+  char path[200];
+  get_unittest_path ("gnuradio_core_all.xml", path, 200);
+
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest (qa_runtime::suite ());
   runner.addTest (qa_general::suite ());
   runner.addTest (qa_filter::suite ());
   // runner.addTest (qa_atsc::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run ("", false);
 
index f744d76e69485eb16a8af9e7f64f332b84da4891..51642f81a330e26b34baf88923c9d7d3aa02aca1 100644 (file)
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
+
+#include <gr_unittests.h>
 #include <qa_atsc.h>
 
 int 
 main (int argc, char **argv)
 {
+  char path[200];
+  get_unittest_path ("gnuradio_core_atsc.xml", path, 200);
   
-  CppUnit::TextTestRunner      runner;
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest (qa_atsc::suite ());
-  
+  runner.setOutputter(xmlout);
+
   bool was_successful = runner.run ("", false);
 
   return was_successful ? 0 : 1;
index 56e94523860df78abcbaf5d6d618729737b7b781..2781cfb3578a47c30b444df2b016586dc0d25a37 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
+
+#include <gr_unittests.h>
 #include <qa_filter.h>
 
 int 
 main (int argc, char **argv)
 {
+  char path[200];
+  get_unittest_path ("gnuradio_core_filter.xml", path, 200);
   
-  CppUnit::TextTestRunner      runner;
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest (qa_filter::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run ("", false);
 
index 063e2ee45caadb6d70e32566063a3724be2a7097..16ee9c3add1a6b0af88b24de403c0e1c8708fa91 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
+
+#include <gr_unittests.h>
 #include <qa_general.h>
 
 int 
 main (int argc, char **argv)
 {
-  
-  CppUnit::TextTestRunner      runner;
+  char path[200];
+  get_unittest_path ("gnuradio_core_general.xml", path, 200);
+
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest (qa_general::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run ("", false);
 
index 8549f2a9b8ca4a32b472d6dc9b458b32aa0b3763..c7983a23ef59b0df5632005b6f33237cfbcace28 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
+
+#include <gr_unittests.h>
 #include <qa_runtime.h>
 
 int 
 main (int argc, char **argv)
 {
+  char path[200];
+  get_unittest_path ("gnuradio_core_runtime.xml", path, 200);
   
-  CppUnit::TextTestRunner      runner;
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest (qa_runtime::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run ("", false);
 
index ea34beee865d8df781de72f3b6a18f17c7b85b95..188275fcaf43ab78cdbb1dc18bf6e412d7c68267 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2006,2008,2009 Free Software Foundation, Inc.
+# Copyright 2006,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 include $(top_srcdir)/Makefile.common
 
 # For compiling within the GNU Radio build tree
-AM_CPPFLAGS=$(STD_DEFINES_AND_INCLUDES) \
-         -I$(top_srcdir)/gr-audio-alsa/src \
-        $(WITH_INCLUDES)
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/gr-audio-alsa/src \
+       $(STD_DEFINES_AND_INCLUDES) \
+       $(WITH_INCLUDES)
 
 GR_AUDIO_ALSA_LA=$(top_builddir)/gr-audio-alsa/src/libgnuradio-audio-alsa.la
 
index 27d87e558b4ee37d2351423b0f8a3391eafc01d6..f845c05c6ff1ead9d36d144d537bc473b8df186b 100755 (executable)
@@ -36,7 +36,7 @@ class pfb_top_block(gr.top_block):
 
         # Create a set of taps for the PFB channelizer
         self._taps = gr.firdes.low_pass_2(1, self._fs, 475.50, 50, 
-                                          attenuation_dB=10, window=gr.firdes.WIN_BLACKMAN_hARRIS)
+                                          attenuation_dB=100, window=gr.firdes.WIN_BLACKMAN_hARRIS)
 
         # Calculate the number of taps per channel for our own information
         tpc = scipy.ceil(float(len(self._taps)) /  float(self._M))
diff --git a/gnuradio-examples/python/pfb/resampler.py b/gnuradio-examples/python/pfb/resampler.py
new file mode 100755 (executable)
index 0000000..6be7cf1
--- /dev/null
@@ -0,0 +1,95 @@
+#!/usr/bin/env python
+
+from gnuradio import gr, blks2
+import scipy, pylab
+
+class mytb(gr.top_block):
+    def __init__(self, fs_in, fs_out, fc, N=10000):
+        gr.top_block.__init__(self)
+        
+        rerate = float(fs_out) / float(fs_in)
+        print "Resampling from %f to %f by %f " %(fs_in, fs_out, rerate)
+
+        # Creating our own taps
+        taps = gr.firdes.low_pass_2(32, 32, 0.25, 0.1, 80)
+
+        self.src = gr.sig_source_c(fs_in, gr.GR_SIN_WAVE, fc, 1)
+        #self.src = gr.noise_source_c(gr.GR_GAUSSIAN, 1)
+        self.head = gr.head(gr.sizeof_gr_complex, N)
+
+        # A resampler with our taps
+        self.resamp_0 = blks2.pfb_arb_resampler_ccf(rerate, taps,
+                                                    flt_size=32)
+
+        # A resampler that just needs a resampling rate.
+        # Filter is created for us and designed to cover
+        # entire bandwidth of the input signal.
+        # An optional atten=XX rate can be used here to 
+        # specify the out-of-band rejection (default=80).
+        self.resamp_1 = blks2.pfb_arb_resampler_ccf(rerate)
+
+        self.snk_in = gr.vector_sink_c()
+        self.snk_0 = gr.vector_sink_c()
+        self.snk_1 = gr.vector_sink_c()
+
+        self.connect(self.src, self.head, self.snk_in)
+        self.connect(self.head, self.resamp_0, self.snk_0)
+        self.connect(self.head, self.resamp_1, self.snk_1)
+
+def main():
+    fs_in = 8000
+    fs_out = 20000
+    fc = 1000
+    N = 10000
+
+    tb = mytb(fs_in, fs_out, fc, N)
+    tb.run()
+
+
+    # Plot PSD of signals
+    nfftsize = 2048
+    fig1 = pylab.figure(1, figsize=(10,10), facecolor="w")
+    sp1 = fig1.add_subplot(2,1,1)
+    sp1.psd(tb.snk_in.data(), NFFT=nfftsize,
+            noverlap=nfftsize/4, Fs = fs_in)
+    sp1.set_title(("Input Signal at f_s=%.2f kHz" % (fs_in/1000.0)))
+    sp1.set_xlim([-fs_in/2, fs_in/2])
+
+    sp2 = fig1.add_subplot(2,1,2)
+    sp2.psd(tb.snk_0.data(), NFFT=nfftsize,
+            noverlap=nfftsize/4, Fs = fs_out,
+            label="With our filter")
+    sp2.psd(tb.snk_1.data(), NFFT=nfftsize,
+            noverlap=nfftsize/4, Fs = fs_out,
+            label="With auto-generated filter")
+    sp2.set_title(("Output Signals at f_s=%.2f kHz" % (fs_out/1000.0)))
+    sp2.set_xlim([-fs_out/2, fs_out/2])
+    sp2.legend()
+
+    # Plot signals in time
+    Ts_in = 1.0/fs_in
+    Ts_out = 1.0/fs_out
+    t_in = scipy.arange(0, len(tb.snk_in.data())*Ts_in, Ts_in)
+    t_out = scipy.arange(0, len(tb.snk_0.data())*Ts_out, Ts_out)
+
+    fig2 = pylab.figure(2, figsize=(10,10), facecolor="w")
+    sp21 = fig2.add_subplot(2,1,1)
+    sp21.plot(t_in, tb.snk_in.data())
+    sp21.set_title(("Input Signal at f_s=%.2f kHz" % (fs_in/1000.0)))
+    sp21.set_xlim([t_in[100], t_in[200]])
+
+    sp22 = fig2.add_subplot(2,1,2)
+    sp22.plot(t_out, tb.snk_0.data(),
+              label="With our filter")
+    sp22.plot(t_out, tb.snk_1.data(),
+              label="With auto-generated filter")
+    sp22.set_title(("Output Signals at f_s=%.2f kHz" % (fs_out/1000.0)))
+    r = float(fs_out)/float(fs_in)
+    sp22.set_xlim([t_out[r * 100], t_out[r * 200]])
+    sp22.legend()
+
+    pylab.show()
+
+if __name__ == "__main__":
+    main()
+
diff --git a/gnuradio-examples/python/pfb/synth_filter.py b/gnuradio-examples/python/pfb/synth_filter.py
new file mode 100755 (executable)
index 0000000..a1562f9
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 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.
+# 
+
+from gnuradio import gr, blks2
+import scipy, pylab
+
+def main():
+    N = 1000000
+    fs = 8000
+
+    freqs = [100, 200, 300, 400, 500]
+    nchans = 7
+
+    sigs = list()
+    for fi in freqs:
+        s = gr.sig_source_c(fs, gr.GR_SIN_WAVE, fi, 1)
+        sigs.append(s)
+
+    taps = gr.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 100, 100)
+    print "Num. Taps = %d (taps per filter = %d)" % (len(taps), 
+                                                     len(taps)/nchans)
+    filtbank = gr.pfb_synthesis_filterbank_ccf(nchans, taps)
+
+    head = gr.head(gr.sizeof_gr_complex, N)
+    snk = gr.vector_sink_c()
+
+    tb = gr.top_block()
+    tb.connect(filtbank, head, snk)
+
+    for i,si in enumerate(sigs):
+        tb.connect(si, (filtbank, i))
+    
+    tb.run()
+
+    if 1:
+        f1 = pylab.figure(1)
+        s1 = f1.add_subplot(1,1,1)
+        s1.plot(snk.data()[1000:])
+        
+        fftlen = 2048
+        f2 = pylab.figure(2)
+        s2 = f2.add_subplot(1,1,1)
+        winfunc = scipy.blackman
+        s2.psd(snk.data()[10000:], NFFT=fftlen,
+               Fs = nchans*fs,
+               noverlap=fftlen/4,
+               window = lambda d: d*winfunc(fftlen))
+
+        pylab.show()
+
+if __name__ == "__main__":
+    main()
diff --git a/gnuradio-examples/python/pfb/synth_to_chan.py b/gnuradio-examples/python/pfb/synth_to_chan.py
new file mode 100755 (executable)
index 0000000..1beda1a
--- /dev/null
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 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.
+# 
+
+from gnuradio import gr, blks2
+import scipy, pylab
+
+def main():
+    N = 1000000
+    fs = 8000
+
+    freqs = [100, 200, 300, 400, 500]
+    nchans = 7
+
+    sigs = list()
+    fmtx = list()
+    for fi in freqs:
+        s = gr.sig_source_f(fs, gr.GR_SIN_WAVE, fi, 1)
+        fm = blks2.nbfm_tx (fs, 4*fs, max_dev=10000, tau=75e-6)
+        sigs.append(s)
+        fmtx.append(fm)
+
+    syntaps = gr.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 100, 100)
+    print "Synthesis Num. Taps = %d (taps per filter = %d)" % (len(syntaps), 
+                                                               len(syntaps)/nchans)
+    chtaps = gr.firdes.low_pass_2(len(freqs), fs, fs/float(nchans)/2, 100, 100)
+    print "Channelizer Num. Taps = %d (taps per filter = %d)" % (len(chtaps), 
+                                                                 len(chtaps)/nchans)
+    filtbank = gr.pfb_synthesis_filterbank_ccf(nchans, syntaps)
+    channelizer = blks2.pfb_channelizer_ccf(nchans, chtaps)
+
+    noise_level = 0.01
+    head = gr.head(gr.sizeof_gr_complex, N)
+    noise = gr.noise_source_c(gr.GR_GAUSSIAN, noise_level)
+    addnoise = gr.add_cc()
+    snk_synth = gr.vector_sink_c()
+
+    tb = gr.top_block()
+
+    tb.connect(noise, (addnoise,0))
+    tb.connect(filtbank, head, (addnoise, 1))
+    tb.connect(addnoise, channelizer)
+    tb.connect(addnoise, snk_synth)
+
+    snk = list()
+    for i,si in enumerate(sigs):
+        tb.connect(si, fmtx[i], (filtbank, i))
+
+    for i in xrange(nchans):
+        snk.append(gr.vector_sink_c())
+        tb.connect((channelizer, i), snk[i])
+    
+    tb.run()
+
+    if 1:
+        channel = 1
+        data = snk[channel].data()[1000:]
+
+        f1 = pylab.figure(1)
+        s1 = f1.add_subplot(1,1,1)
+        s1.plot(data[10000:10200] )
+        s1.set_title(("Output Signal from Channel %d" % channel))
+        
+        fftlen = 2048
+        winfunc = scipy.blackman
+        #winfunc = scipy.hamming
+
+        f2 = pylab.figure(2)
+        s2 = f2.add_subplot(1,1,1)
+        s2.psd(data, NFFT=fftlen,
+               Fs = nchans*fs,
+               noverlap=fftlen/4,
+               window = lambda d: d*winfunc(fftlen))
+        s2.set_title(("Output PSD from Channel %d" % channel))
+
+        f3 = pylab.figure(3)
+        s3 = f3.add_subplot(1,1,1)
+        s3.psd(snk_synth.data()[1000:], NFFT=fftlen,
+               Fs = nchans*fs,
+               noverlap=fftlen/4,
+               window = lambda d: d*winfunc(fftlen))
+        s3.set_title("Output of Synthesis Filter")
+
+        pylab.show()
+
+if __name__ == "__main__":
+    main()
index a661e708bb3353c4d6ba1e1c31a800160e3d3538..d87a2c3fd218e2e16586ced692fe68078c2793e4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -37,7 +37,7 @@ double ratio_of_rx_clock_to_symbol_freq = input_rate / ATSC_SYMBOL_RATE;
 atsc_bit_timing_loop_sptr
 atsc_make_bit_timing_loop()
 {
-  return atsc_bit_timing_loop_sptr(new atsc_bit_timing_loop());
+  return gnuradio::get_initial_sptr(new atsc_bit_timing_loop());
 }
 
 
index af58777ddbc39d6b376c05629c87fb8a474629f8..aee9cd58b7ddf07f0243650189abcfd7796831b8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_deinterleaver_sptr
 atsc_make_deinterleaver()
 {
-  return atsc_deinterleaver_sptr(new atsc_deinterleaver());
+  return gnuradio::get_initial_sptr(new atsc_deinterleaver());
 }
 
 atsc_deinterleaver::atsc_deinterleaver()
index f1e8305686013d29f17e3f4704e767f1e003d368..5cf0c3de2bd2f6ebac7a16d6d38552b2ccf11b0d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006,2008 Free Software Foundation, Inc.
+ * Copyright 2006,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 atsc_depad_sptr
 atsc_make_depad()
 {
-  return atsc_depad_sptr(new atsc_depad());
+  return gnuradio::get_initial_sptr(new atsc_depad());
 }
 
 atsc_depad::atsc_depad()
index 361b781ad86b47d62fef5785748dfefd398d77b2..7dc4cf4c105238f61187f18aab3d32a5ccfdd6bb 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_derandomizer_sptr
 atsc_make_derandomizer()
 {
-  return atsc_derandomizer_sptr(new atsc_derandomizer());
+  return gnuradio::get_initial_sptr(new atsc_derandomizer());
 }
 
 atsc_derandomizer::atsc_derandomizer()
index 8d3fc338519d972816988f7e4b60fc71106c9fa1..c589bbb9f9279fae998b6ab7f2799c0eb96551c1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_ds_to_softds_sptr
 atsc_make_ds_to_softds()
 {
-  return atsc_ds_to_softds_sptr(new atsc_ds_to_softds());
+  return gnuradio::get_initial_sptr(new atsc_ds_to_softds());
 }
 
 atsc_ds_to_softds::atsc_ds_to_softds()
index 3053c00b829f28e57b76ceadb66aa9f2bfd570f8..3e68de9928084edcfe3426ffe6079cccaf63ba0d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,7 +34,7 @@
 atsc_equalizer_sptr
 atsc_make_equalizer()
 {
-  return atsc_equalizer_sptr(new atsc_equalizer());
+  return gnuradio::get_initial_sptr(new atsc_equalizer());
 }
 
 // had atsc_equalizer(atsci_equalizer *equalizer)
index b6195c6dfe1a90b263bf26e1f88e127ecb85e23d..3b321eae69aafcffb7f6e8fd404c2370fe1c00b4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -44,7 +44,7 @@ static const int        DEC = ATSC_DATA_SEGMENT_LENGTH; // nominal decimation fa
 atsc_field_sync_demux_sptr
 atsc_make_field_sync_demux()
 {
-  return atsc_field_sync_demux_sptr(new atsc_field_sync_demux());
+  return gnuradio::get_initial_sptr(new atsc_field_sync_demux());
 }
 
 atsc_field_sync_demux::atsc_field_sync_demux()
index 526599aed2bd77052eb4186f765a62ed7f6f9e2e..3d0e20a1c9e36cb9deba884e68de4a44e655f538 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 atsc_field_sync_mux_sptr
 atsc_make_field_sync_mux()
 {
-  return atsc_field_sync_mux_sptr(new atsc_field_sync_mux());
+  return gnuradio::get_initial_sptr(new atsc_field_sync_mux());
 }
 
 atsc_field_sync_mux::atsc_field_sync_mux()
index f5bf39d20ff8459d6e68841aeacaeae56e2405e0..676a7453ee55921b2181c1647d91ec0776127e15 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,7 +34,7 @@
 atsc_fpll_sptr
 atsc_make_fpll()
 {
-  return atsc_fpll_sptr(new atsc_fpll());
+  return gnuradio::get_initial_sptr(new atsc_fpll());
 }
 
 
index 69406650eec959b07d695811cc6b0e27817cf1a5..6162c9ef67f610ca59a846b86ebf859a0b14c3fb 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@
 atsc_fs_checker_sptr
 atsc_make_fs_checker()
 {
-  return atsc_fs_checker_sptr(new atsc_fs_checker());
+  return gnuradio::get_initial_sptr(new atsc_fs_checker());
 }
 
 atsc_fs_checker::atsc_fs_checker()
index d9fd98bb316d7c1fda2ac87b6ebdf779aebf02d8..a87091436805f862080396e1067edb13d4a63ca8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_interleaver_sptr
 atsc_make_interleaver()
 {
-  return atsc_interleaver_sptr(new atsc_interleaver());
+  return gnuradio::get_initial_sptr(new atsc_interleaver());
 }
 
 atsc_interleaver::atsc_interleaver()
index cd1353e266e54bf0cf195c45634aa058aadff7ce..8a36307afeff2c84e17155312ca5271efe6ee129 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@ static const int INTR = ATSC_MPEG_PKT_LENGTH;
 atsc_pad_sptr
 atsc_make_pad()
 {
-  return atsc_pad_sptr(new atsc_pad());
+  return gnuradio::get_initial_sptr(new atsc_pad());
 }
 
 atsc_pad::atsc_pad()
index e6756c6ed39e0cf422a17ae13c5348be02abe3b7..cd797b8f5e63e41a594816ea96b7d5a20086a9cc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_randomizer_sptr
 atsc_make_randomizer()
 {
-  return atsc_randomizer_sptr(new atsc_randomizer());
+  return gnuradio::get_initial_sptr(new atsc_randomizer());
 }
 
 atsc_randomizer::atsc_randomizer()
index 680d64e439ba90d662ba24ffbc802d097a345cfd..aa3f9369e5a4d7caa1030867fe20d8234c0bcdc8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_rs_decoder_sptr
 atsc_make_rs_decoder()
 {
-  return atsc_rs_decoder_sptr(new atsc_rs_decoder());
+  return gnuradio::get_initial_sptr(new atsc_rs_decoder());
 }
 
 atsc_rs_decoder::atsc_rs_decoder()
index faf9bfff31d2356935d4cc6884f140b4169a9a99..f98ff664c3bb131068a5f8d7ac7739e0c11609c6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_rs_encoder_sptr
 atsc_make_rs_encoder()
 {
-  return atsc_rs_encoder_sptr(new atsc_rs_encoder());
+  return gnuradio::get_initial_sptr(new atsc_rs_encoder());
 }
 
 atsc_rs_encoder::atsc_rs_encoder()
index efd08831035802338284be09a384c74139d9b941..4cf81a045df21840cd03f056d6e0e03cbcea0284 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 atsc_trellis_encoder_sptr
 atsc_make_trellis_encoder()
 {
-  return atsc_trellis_encoder_sptr(new atsc_trellis_encoder());
+  return gnuradio::get_initial_sptr(new atsc_trellis_encoder());
 }
 
 atsc_trellis_encoder::atsc_trellis_encoder()
index 9db04012166c8bd5dedc2680a0d9c303942ed142..81ad9178ac3d6a16780427a84efb64969f49ae8f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -35,7 +35,7 @@ using std::endl;
 atsc_viterbi_decoder_sptr
 atsc_make_viterbi_decoder()
 {
-  return atsc_viterbi_decoder_sptr(new atsc_viterbi_decoder());
+  return gnuradio::get_initial_sptr(new atsc_viterbi_decoder());
 }
 
 atsc_viterbi_decoder::atsc_viterbi_decoder()
index 5267e0d4fe5cd9e20c5255d39c92bbcf4fcebe45..184895a90d35333f6a29e11283beb64f7709ea54 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002,2006 Free Software Foundation, Inc.
+ * Copyright 2002,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  * Boston, MA 02110-1301, USA.
  */
 
+#include <gr_unittests.h>
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
 #include <qa_atsci.h>
 
 int 
 main (int argc, char **argv)
 {
-  
-  CppUnit::TextTestRunner      runner;
+  char path[200];
+  get_unittest_path ("gr_atsc.xml", path, 200);
+
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest (qa_atsc::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run ("", false);
 
index fe3f043bf6cfa07cbb7983edbb59dc21a103a7be..d44a93b3f37a44ccfb3635eeadf3419f6a8b9892 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -70,7 +70,7 @@ audio_alsa_make_sink (int sampling_rate,
                      const std::string dev,
                      bool ok_to_block)
 {
-  return audio_alsa_sink_sptr (new audio_alsa_sink (sampling_rate, dev,
+  return gnuradio::get_initial_sptr(new audio_alsa_sink (sampling_rate, dev,
                                                    ok_to_block));
 }
 
@@ -90,7 +90,7 @@ audio_alsa_sink::audio_alsa_sink (int sampling_rate,
     d_period_size (0),
     d_buffer_size_bytes (0), d_buffer (0),
     d_worker (0), d_special_case_mono_to_stereo (false),
-    d_nunderuns (0), d_nsuspends (0)
+    d_nunderuns (0), d_nsuspends (0), d_ok_to_block(ok_to_block)
 {
   CHATTY_DEBUG = gr_prefs::singleton()->get_bool("audio_alsa", "verbose", false);
 
@@ -100,6 +100,8 @@ audio_alsa_sink::audio_alsa_sink (int sampling_rate,
   // open the device for playback
   error = snd_pcm_open(&d_pcm_handle, d_device_name.c_str (),
                       SND_PCM_STREAM_PLAYBACK, 0);
+  if (ok_to_block == false)
+    snd_pcm_nonblock(d_pcm_handle, !ok_to_block);
   if (error < 0){
     fprintf (stderr, "audio_alsa_sink[%s]: %s\n",
             d_device_name.c_str(), snd_strerror(error));
@@ -219,9 +221,15 @@ audio_alsa_sink::check_topology (int ninputs, int noutputs)
   int nchan = ninputs;
   int err;
 
-  // FIXME check_topology may be called more than once.
+  // Check the state of the stream
   // Ensure that the pcm is in a state where we can still mess with the hw_params
-
+  snd_pcm_state_t state;
+  state=snd_pcm_state(d_pcm_handle);
+  if ( state== SND_PCM_STATE_RUNNING)
+    return true;  // If stream is running, don't change any parameters
+  else if(state == SND_PCM_STATE_XRUN )
+    snd_pcm_prepare ( d_pcm_handle ); // Prepare stream on underrun, and we can set parameters;
+  
   bool special_case = nchan == 1 && d_special_case_mono_to_stereo;
   if (special_case)
     nchan = 2;
@@ -287,7 +295,6 @@ audio_alsa_sink::check_topology (int ninputs, int noutputs)
   default:
     assert (0);
   }
-
   return true;
 }
 
@@ -489,7 +496,12 @@ audio_alsa_sink::write_buffer (const void *vbuffer,
   while (nframes > 0){
     int r = snd_pcm_writei (d_pcm_handle, buffer, nframes);
     if (r == -EAGAIN)
-      continue;                        // try again
+    {
+      if (d_ok_to_block == true)
+       continue;               // try again
+      
+      break;
+    }
 
     else if (r == -EPIPE){     // underrun
       d_nunderuns++;
index d4b540382e766d8568e65bd5f812aa33abe08250..f3007f60f8a0503040873966c613776feea07d45 100644 (file)
@@ -83,6 +83,7 @@ class audio_alsa_sink : public gr_sync_block {
   // random stats
   int                  d_nunderuns;            // count of underruns
   int                  d_nsuspends;            // count of suspends
+  bool                 d_ok_to_block;      // defaults to "true", controls blocking/non-block I/O
 
   void output_error_msg (const char *msg, int err);
   void bail (const char *msg, int err) throw (std::runtime_error);
index 381e553f54ccaa750c7405e2a4379b2b6a4bd8e1..7b3d91b9ddb42008128e1744e28fae2ed94f76a1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -68,7 +68,7 @@ audio_alsa_source_sptr
 audio_alsa_make_source (int sampling_rate, const std::string dev,
                        bool ok_to_block)
 {
-  return audio_alsa_source_sptr (new audio_alsa_source (sampling_rate, dev,
+  return gnuradio::get_initial_sptr(new audio_alsa_source (sampling_rate, dev,
                                                        ok_to_block));
 }
 
index f2a480a50beb8625f9f84c3cb5f9271ff644ec06..52dbfdc7a5f782023dce6942407c820e88ac281f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import audio_alsa
 
-class qa_alsa (gr_unittest.TestCase):
+class test_audio_alsa (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -37,4 +37,4 @@ class qa_alsa (gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_audio_alsa, "test_audio_alsa.xml")
index 9dfc46751fecc36906d528f0b95da9421beea5f8..f28fddc344c9e3bc9f971d3aad2b55ca386c67b8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -87,7 +87,7 @@ jack_sink_process (jack_nframes_t nframes, void *arg)
 audio_jack_sink_sptr
 audio_jack_make_sink(int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_jack_sink_sptr (new audio_jack_sink (sampling_rate, dev,
+  return gnuradio::get_initial_sptr(new audio_jack_sink (sampling_rate, dev,
                                                    ok_to_block));
 }
 
@@ -105,12 +105,17 @@ audio_jack_sink::audio_jack_sink (int sampling_rate,
     d_nunderuns (0)
 {
 #ifndef NO_PTHREAD
-    pthread_cond_init(&d_ringbuffer_ready, NULL);;
-    pthread_mutex_init(&d_jack_process_lock, NULL);
+  pthread_cond_init(&d_ringbuffer_ready, NULL);;
+  pthread_mutex_init(&d_jack_process_lock, NULL);
 #endif
-
+  
   // try to become a client of the JACK server
-  if ((d_jack_client = jack_client_new (d_device_name.c_str ())) == 0) {
+  jack_options_t options = JackNullOption;
+  jack_status_t status;
+  const char *server_name = NULL;
+  if ((d_jack_client = jack_client_open (d_device_name.c_str (),
+                                        options, &status,
+                                        server_name)) == NULL) {
     fprintf (stderr, "audio_jack_sink[%s]: jack server not running?\n",
             d_device_name.c_str());
     throw std::runtime_error ("audio_jack_sink");
index 392d246b427db229b45b75bf52fb5f65b9c45d69..a92e970f5825efb3febb2c5b2cf4f297fefdeb28 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -88,7 +88,7 @@ jack_source_process (jack_nframes_t nframes, void *arg)
 audio_jack_source_sptr
 audio_jack_make_source (int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_jack_source_sptr (new audio_jack_source (sampling_rate, dev, ok_to_block));
+  return gnuradio::get_initial_sptr(new audio_jack_source (sampling_rate, dev, ok_to_block));
 }
 
 audio_jack_source::audio_jack_source (int sampling_rate,
@@ -110,7 +110,12 @@ audio_jack_source::audio_jack_source (int sampling_rate,
 #endif
 
   // try to become a client of the JACK server
-  if ((d_jack_client = jack_client_new (d_device_name.c_str ())) == 0) {
+  jack_options_t options = JackNullOption;
+  jack_status_t status;
+  const char *server_name = NULL;
+  if ((d_jack_client = jack_client_open (d_device_name.c_str (),
+                                        options, &status,
+                                        server_name)) == NULL) {
     fprintf (stderr, "audio_jack_source[%s]: jack server not running?\n",
             d_device_name.c_str());
     throw std::runtime_error ("audio_jack_source");
index d8a3aba88b0f7e18e970620969b3a74749611d74..ad6bee27b36756dac137a0cd04b8dfec025ec686 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import audio_jack
 
-class qa_jack (gr_unittest.TestCase):
+class test_audio_jack (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -37,4 +37,4 @@ class qa_jack (gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_audio_jack, "test_audio_jack.xml")
index a14edc9d27b233182236adbe882ab68bb9e37ada..8230ab9b6460f55e08607516395ce3bbd886024f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -47,7 +47,7 @@ default_device_name ()
 audio_oss_sink_sptr
 audio_oss_make_sink (int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_oss_sink_sptr (new audio_oss_sink (sampling_rate, dev, ok_to_block));
+  return gnuradio::get_initial_sptr(new audio_oss_sink (sampling_rate, dev, ok_to_block));
 }
 
 audio_oss_sink::audio_oss_sink (int sampling_rate,
index 1df98a5eb729ab74bbc53b0184bd7f0814bc35fb..fbb898f8c09078dce1eeaebfcff875e561aecf45 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -47,7 +47,7 @@ default_device_name ()
 audio_oss_source_sptr
 audio_oss_make_source (int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_oss_source_sptr (new audio_oss_source (sampling_rate, dev, ok_to_block));
+  return gnuradio::get_initial_sptr(new audio_oss_source (sampling_rate, dev, ok_to_block));
 }
 
 
index 5427b50ec3f9932e33ca572a364f7b73edf2fefa..365dabc25e14f7ec907ceaa50068b6da3c6a9483 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import audio_oss
 
-class qa_oss (gr_unittest.TestCase):
+class test_audio_oss (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -37,4 +37,4 @@ class qa_oss (gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_audio_oss, "test_audio_oss.xml")
index 20fd895b989a4ef691746b32fbd64861f1c85bd4..ec9b024e836a91f741319af70caf9f2273908bd8 100644 (file)
@@ -267,7 +267,7 @@ audio_osx_make_sink (int sampling_freq,
                     int channel_config,
                     int max_sample_count)
 {
-  return audio_osx_sink_sptr (new audio_osx_sink (sampling_freq,
+  return gnuradio::get_initial_sptr(new audio_osx_sink (sampling_freq,
                                                  dev,
                                                  do_block,
                                                  channel_config,
index 538cfd8f695d2b1ff34dff444af762d701275237..757e65a9e20369850915a809475b65e32fdc40ae 100644 (file)
@@ -614,7 +614,7 @@ audio_osx_make_source (int sampling_freq,
                       int channel_config,
                       int max_sample_count)
 {
-  return audio_osx_source_sptr (new audio_osx_source (sampling_freq,
+  return gnuradio::get_initial_sptr(new audio_osx_source (sampling_freq,
                                                      device_name,
                                                      do_block,
                                                      channel_config,
index 65a38f9119011f4dc96bd66bc1a6a71e7bb08023..64e64ccf4536a3fdcb8b649ba0557234b41dd9e9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -102,7 +102,10 @@ portaudio_sink_callback (const void *inputBuffer,
 
   else {                       // underrun
     self->d_nunderuns++;
-    ::write(2, "aU", 2);       // FIXME change to non-blocking call
+    ssize_t r = ::write(2, "aU", 2);   // FIXME change to non-blocking call
+    if(r == -1) {
+      perror("audio_portaudio_source::portaudio_source_callback write error to stderr.");
+    }
 
     // FIXME we should transfer what we've got and pad the rest
     memset(outputBuffer, 0, nreqd_samples * sizeof(sample_t));
@@ -120,7 +123,7 @@ portaudio_sink_callback (const void *inputBuffer,
 audio_portaudio_sink_sptr
 audio_portaudio_make_sink (int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_portaudio_sink_sptr (new audio_portaudio_sink (sampling_rate,
+  return gnuradio::get_initial_sptr(new audio_portaudio_sink (sampling_rate,
                                                              dev, ok_to_block));
 }
 
index 484b7f1e541bb42c86d84937c801ec61319b8c2f..e508fda22f6d1aa8f708459465654b92439ac6e5 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -105,7 +105,10 @@ portaudio_source_callback (const void *inputBuffer,
 
   else {                       // overrun
     self->d_noverruns++;
-    ::write(2, "aO", 2);       // FIXME change to non-blocking call
+    ssize_t r = ::write(2, "aO", 2);   // FIXME change to non-blocking call
+    if(r == -1) {
+      perror("audio_portaudio_source::portaudio_source_callback write error to stderr.");
+    }
 
     self->d_ringbuffer_ready = false;
     self->d_ringbuffer_cond.notify_one();  // Tell the sink to get going!
@@ -119,7 +122,7 @@ portaudio_source_callback (const void *inputBuffer,
 audio_portaudio_source_sptr
 audio_portaudio_make_source (int sampling_rate, const std::string dev, bool ok_to_block)
 {
-  return audio_portaudio_source_sptr (new audio_portaudio_source (sampling_rate,
+  return gnuradio::get_initial_sptr(new audio_portaudio_source (sampling_rate,
                                                                  dev, ok_to_block));
 }
 
index f6a54061ead92be0120444f6ebb1bd0fa8f692c6..20731f38d49ba41c804eb28ee87d89032958c2fb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import audio_portaudio
 
-class qa_portaudio (gr_unittest.TestCase):
+class test_audio_portaudio (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -37,4 +37,4 @@ class qa_portaudio (gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_audio_portaudio, "test_audio_portaudio.xml")
index 1fa9150724aa5f6498b74dfd05f6d176b6910f89..a47871954a132be7ced74c4ec2ad385fc4277024 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
-* Copyright 2004 Free Software Foundation, Inc.
+* Copyright 2004,2010 Free Software Foundation, Inc.
 *
 * This file is part of GNU Radio
 *
@@ -81,8 +81,7 @@ audio_windows_sink::~audio_windows_sink ()
 audio_windows_sink_sptr
 audio_windows_make_sink (int sampling_freq, const std::string dev)
 {
-  return audio_windows_sink_sptr (new
-                                 audio_windows_sink (sampling_freq, dev));
+  return gnuradio::get_initial_sptr (new audio_windows_sink (sampling_freq, dev));
 }
 
 
index 5cdfb8c8462434702b16770c399cb70cc2b10877..a88923afde5b44b85b11faecb4fe301ed6fca27c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -128,9 +128,7 @@ audio_windows_source::~audio_windows_source ()
 audio_windows_source_sptr
 audio_windows_make_source (int sampling_freq, const std::string dev)
 {
-  return audio_windows_source_sptr (new
-                                   audio_windows_source (sampling_freq,
-                                                         dev));
+  return gnuradio::get_initial_sptr (new audio_windows_source (sampling_freq, dev));
 }
 
 
index 7f4c6d6aaf6264dd3a9bac63970407b1725bb0d7..d4a668758804a7bd89310ed3b2b943dc0a87e673 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -52,7 +52,7 @@ default_device_name ()
 comedi_sink_s_sptr
 comedi_make_sink_s (int sampling_freq, const std::string dev)
 {
-  return comedi_sink_s_sptr (new comedi_sink_s (sampling_freq, dev));
+  return gnuradio::get_initial_sptr(new comedi_sink_s (sampling_freq, dev));
 }
 
 comedi_sink_s::comedi_sink_s (int sampling_freq,
index 4e3980e760675dbee4a01d993d4b6e99a5224b68..a52d04e2a37bc03a75e5d661d535e780d5922183 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -49,7 +49,7 @@ default_device_name ()
 comedi_source_s_sptr
 comedi_make_source_s (int sampling_freq, const std::string dev)
 {
-  return comedi_source_s_sptr (new comedi_source_s (sampling_freq, dev));
+  return gnuradio::get_initial_sptr(new comedi_source_s (sampling_freq, dev));
 }
 
 comedi_source_s::comedi_source_s (int sampling_freq,
index 1dad15d430467dc9372889ccc37409234db83f80..26dcb29da5a51df194d8804792565d607d0b5990 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -42,7 +42,7 @@ cvsd_make_decode_bs (short min_step, short max_step, double step_decay,
                     double accum_decay,  int K, int J,
                     short pos_accum_max, short neg_accum_max)
 {
-  return cvsd_decode_bs_sptr (new cvsd_decode_bs (min_step, max_step,
+  return gnuradio::get_initial_sptr(new cvsd_decode_bs (min_step, max_step,
                                                  step_decay, accum_decay, K, J,
                                                  pos_accum_max, neg_accum_max));
 }
index 561b91c6863b24fd1065a837b995127042fe5785..df867f3ba871ab1a268fbb5afabe9e98019250a0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -42,7 +42,7 @@ cvsd_make_encode_sb (short min_step, short max_step, double step_decay,
                     double accum_decay,  int K, int J,
                     short pos_accum_max, short neg_accum_max)
 {
-  return cvsd_encode_sb_sptr (new cvsd_encode_sb (min_step, max_step,
+  return gnuradio::get_initial_sptr(new cvsd_encode_sb (min_step, max_step,
                                                  step_decay, accum_decay, K, J,
                                                  pos_accum_max, neg_accum_max));
 }
index 1a39f636e7baae326305aa9b5449aa208d1047e4..99a38d946c1f398dde4e02ee4227f783de3ecbfc 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest, blks2
 import cvsd_vocoder
 
-class qa_cvsd_test (gr_unittest.TestCase):
+class test_cvsd_vocoder (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block()
@@ -112,4 +112,4 @@ class qa_cvsd_test (gr_unittest.TestCase):
     """
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_cvsd_vocoder, "test_cvsd_vocoder.xml")
index 63dc156b1162722ce611b382a30617281072ed33..60ec6cc731ce9b785ec6b84f686f27fae40195b0 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common
 
 SUBDIRS = . examples
 
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(GCELL_INCLUDES) \
+AM_CPPFLAGS = $(GCELL_INCLUDES) $(STD_DEFINES_AND_INCLUDES) \
        $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
 # ----------------------------------------------------------------
index 8bbcfb2b9e8b10b549352b4ac2860928c7d6253b..ae40b6fad9bd8baea44e59fd3685c7eb76e363a6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2007,2008 Free Software Foundation, Inc.
+ * Copyright 2004,2007,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -71,7 +71,7 @@ gcell_make_fft_vcc(int fft_size, bool forward, const std::vector<float> &window,
 gcell_fft_vcc_sptr
 gcell_make_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift)
 {
-  return gcell_fft_vcc_sptr (new gcell_fft_vcc(fft_size, forward, window, shift));
+  return gnuradio::get_initial_sptr(new gcell_fft_vcc(fft_size, forward, window, shift));
 }
 
 #endif
index c4fc782fa145a7a317041e81ff564faa18770a6d..9b788dedfd5ad3f8abf08abe90b8ddc3afaefdb0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -34,7 +34,7 @@ extern "C"{
 gsm_fr_decode_ps_sptr
 gsm_fr_make_decode_ps ()
 {
-  return gsm_fr_decode_ps_sptr (new gsm_fr_decode_ps ());
+  return gnuradio::get_initial_sptr(new gsm_fr_decode_ps ());
 }
 
 gsm_fr_decode_ps::gsm_fr_decode_ps ()
index 3fd35db042a1be688d6ec2f340a75839ed2fb373..10bd1fef8504a56202e6c897b0c5e57218238eb7 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@ extern "C"{
 gsm_fr_encode_sp_sptr
 gsm_fr_make_encode_sp ()
 {
-  return gsm_fr_encode_sp_sptr (new gsm_fr_encode_sp ());
+  return gnuradio::get_initial_sptr(new gsm_fr_encode_sp ());
 }
 
 gsm_fr_encode_sp::gsm_fr_encode_sp ()
index ac508407288ef2ecfa4db2b81bc5be5685edc064..4164a1965ddea376a435bebd1b566a8b54c7328d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import gsm_full_rate
 
-class qa_howto (gr_unittest.TestCase):
+class test_gsm_vocoder (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -32,4 +32,4 @@ class qa_howto (gr_unittest.TestCase):
         self.tb = None
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_gsm_vocoder, "test_gsm_vocoder.xml")
index f32079abda668e5fc8f8de6f226e7b26384e8a03..e3a2116a7dcd3d282cd95263d96fcbc6f5f42c7d 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-23'
+timestamp='2009-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
                eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
+                       | grep -q __ELF__
                then
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
                    # Return netbsd for either.  FIX?
@@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        case `/usr/bin/uname -p` in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
@@ -331,7 +334,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
@@ -640,7 +656,7 @@ EOF
            # => hppa64-hp-hpux11.23
 
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-               grep __LP64__ >/dev/null
+               grep -q __LP64__
            then
                HP_ARCH="hppa2.0w"
            else
@@ -796,7 +812,7 @@ EOF
            x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
-           EM64T | authenticamd)
+           EM64T | authenticamd | genuineintel)
                echo x86_64-unknown-interix${UNAME_RELEASE}
                exit ;;
            IA64)
@@ -806,6 +822,9 @@ EOF
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
        exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-pc-mks
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -866,40 +885,17 @@ EOF
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
-    mips:Linux:*:*)
+    mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
        #undef CPU
-       #undef mips
-       #undef mipsel
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
+       CPU=${UNAME_MACHINE}el
        #else
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-           /^CPU/{
-               s: ::g
-               p
-           }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-    mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips64
-       #undef mips64el
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mips64el
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips64
+       CPU=${UNAME_MACHINE}
        #else
        CPU=
        #endif
@@ -931,10 +927,13 @@ EOF
          EV67)  UNAME_MACHINE=alphaev67 ;;
          EV68*) UNAME_MACHINE=alphaev68 ;;
         esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+       objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
        exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -982,17 +981,6 @@ EOF
          elf32-i386)
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
                ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
        esac
        # Determine whether the default compiler is a.out or elf
        eval $set_cc_for_build
@@ -1058,7 +1046,7 @@ EOF
     i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
        exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     i*86:*DOS:*:*)
@@ -1102,8 +1090,11 @@ EOF
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
+        # the processor, so we play safe by assuming i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
         exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
@@ -1141,6 +1132,16 @@ EOF
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
        exit ;;
@@ -1153,7 +1154,7 @@ EOF
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
        exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
@@ -1216,6 +1217,9 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
        exit ;;
@@ -1324,6 +1328,9 @@ EOF
     i*86:rdos:*:*)
        echo ${UNAME_MACHINE}-pc-rdos
        exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
index 6759825a5b7fcf64476b4398dc0e30b3090b925c..eb0389a693f35eb868f6b979d4ec781feda41d99 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-16'
+timestamp='2009-06-11'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -152,6 +153,9 @@ case $os in
                os=
                basic_machine=$1
                ;;
+        -bluegene*)
+               os=-cnk
+               ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
                basic_machine=$1
@@ -249,13 +253,16 @@ case $basic_machine in
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep \
+       | maxq | mb | microblaze | mcore | mep | metag \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
-       | mips64vr | mips64vrel \
+       | mips64octeon | mips64octeonel \
        | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
@@ -268,6 +275,7 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
+       | moxie \
        | mt \
        | msp430 \
        | nios | nios2 \
@@ -277,7 +285,7 @@ case $basic_machine in
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
        | score \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -286,7 +294,7 @@ case $basic_machine in
        | v850 | v850e \
        | we32k \
        | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k)
+       | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -329,14 +337,17 @@ case $basic_machine in
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
+       | mips64octeon-* | mips64octeonel-* \
        | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
@@ -358,20 +369,20 @@ case $basic_machine in
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-*)
+       | z8k-* | z80-*)
                ;;
        # Recognize the basic CPU types without company name, with glob match.
        xtensa*)
@@ -439,6 +450,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-bsd
                ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -455,10 +470,18 @@ case $basic_machine in
                basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
                os=-linux
                ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -526,6 +549,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
        djgpp)
                basic_machine=i586-pc
                os=-msdosdjgpp
@@ -1128,6 +1155,10 @@ case $basic_machine in
                basic_machine=z8k-unknown
                os=-sim
                ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1166,7 +1197,7 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1236,10 +1267,11 @@ case $os in
        # Each alternative MUST END IN A *, to match a version number.
        # -sysv* is not here because it comes later, after sysvr4.
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -kopensolaris* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
+             | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1248,7 +1280,7 @@ case $os in
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1388,6 +1420,9 @@ case $os in
        -zvmoe)
                os=-zvmoe
                ;;
+       -dicos*)
+               os=-dicos
+               ;;
        -none)
                ;;
        *)
@@ -1585,7 +1620,7 @@ case $basic_machine in
                        -sunos*)
                                vendor=sun
                                ;;
-                       -aix*)
+                       -cnk*|-aix*)
                                vendor=ibm
                                ;;
                        -beos*)
index e86db93dd2f34cd2bffbe8f69a19fd96d896eb6e..5e0fd7a436ffda7cf038356f447f168d6e7ddcb8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -39,7 +39,7 @@
 howto_square2_ff_sptr 
 howto_make_square2_ff ()
 {
-  return howto_square2_ff_sptr (new howto_square2_ff ());
+  return gnuradio::get_initial_sptr(new howto_square2_ff ());
 }
 
 /*
index 5ab45d1f21e43ec60ccd82c73d375615406cb63c..f1d5a784821f3051ff2c5502af6b2f3d7b577b25 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -39,7 +39,7 @@
 howto_square_ff_sptr 
 howto_make_square_ff ()
 {
-  return howto_square_ff_sptr (new howto_square_ff ());
+  return gnuradio::get_initial_sptr(new howto_square_ff ());
 }
 
 /*
index 192c537bc88b935b6a5df4e30ef836ba2db96967..ac1e83839a0fd3003f2aebddb9748eea85b224dc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
 
+#include <gr_unittests.h>
 #include <qa_howto.h>
 
 int 
 main (int argc, char **argv)
 {
-  
+  char path[200];
+  get_unittest_path ("gr_howto_write_a_block.xml", path, 200);
   CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest(qa_howto::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run("", false);
 
index 01a47b5d9233cedff83f6428b8f8d7130b2d4db2..724fe6c6145284e43195157ce4e58d62cc5a6fb3 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR_VERSION=3
 API_COMPAT=3
-MINOR_VERSION=0
+MINOR_VERSION=1
 MAINT_VERSION=0
index 2ffc64240ae1d18a4a443ad2fe7cd336bb9340cd..70e692d8321243913b63133413c34cb3b83784e0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008 Free Software Foundation, Inc.
+ * Copyright 2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 msdd_rs_source_simple_sptr
 msdd_rs_make_source_simple ( const char *src, unsigned short port_src) 
 {
-  return msdd_rs_source_simple_sptr (new msdd_rs_source_simple ( src, port_src)); 
+  return gnuradio::get_initial_sptr(new msdd_rs_source_simple ( src, port_src)); 
 }
 
 
@@ -64,7 +64,10 @@ msdd_rs_source_simple::work (int noutput_items,
        /* Read a buffer out -- looking at UDP payload at this point.*/
        rcv->read( &buffer[0], BUF_LEN );
        
-       int seq = *((int*) &buffer[2]);
+       //int seq = *((int*) &buffer[2]);
+       int seq;
+       memcpy(&seq, &buffer[2], 4*sizeof(char));
+
        char type = buffer[0];
        //printf("Sequence %d\n",seq);
        
index 0ee2505d488f6ddc48e7241385f15a202784200e..20b15c43d982f35890fe9255c5399a87b7412aa5 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008,2009 Free Software Foundation, Inc.
+ * Copyright 2008,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -31,7 +31,7 @@
 msdd_source_simple_sptr
 msdd_make_source_simple (const char *src, unsigned short port_src) 
 {
-  return msdd_source_simple_sptr (new msdd_source_simple ( src, port_src)); 
+  return gnuradio::get_initial_sptr(new msdd_source_simple ( src, port_src)); 
 }
 
 
@@ -64,7 +64,9 @@ msdd_source_simple::work (int noutput_items,
     char buffer[BUF_LEN];
     rcv->read( &buffer[0], BUF_LEN );
 
-    int seq = *((int*) &buffer[2]);
+    //int seq = *((int*) &buffer[2]);
+    int seq;
+    memcpy(&seq, &buffer[2], 4*sizeof(char));
 
     if(d_lastseq == -MSDD_COMPLEX_SAMPLES_PER_PACKET){
       // not started case
index 73645e92bf2ee16d5260c6d4cb5f49499ebaafa8..410b23fe603e038c76cc75d54374e0ef423cdc00 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005,2006,2008,2009 Free Software Foundation, Inc.
+# Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS = \
+       -I$(top_srcdir)/gr-noaa/lib \
        $(STD_DEFINES_AND_INCLUDES) \
        $(PYTHON_CPPFLAGS) \
-       $(WITH_INCLUDES) \
-       -I$(top_srcdir)/gr-noaa/lib
+       $(WITH_INCLUDES)
 
 if PYTHON
 # ----------------------------------------------------------------
index 25ea22e39182c65ddc87bf80d584afd08202ba45..a51670b22c9279f6d555ab63021082af31bb8c6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -30,7 +30,7 @@
 
 pager_flex_deinterleave_sptr pager_make_flex_deinterleave()
 {
-    return pager_flex_deinterleave_sptr(new pager_flex_deinterleave());
+    return gnuradio::get_initial_sptr(new pager_flex_deinterleave());
 }
 
 pager_flex_deinterleave::pager_flex_deinterleave() :
index 0819294daa6a1810ded2cffe58580de8da88530e..19d3d96c60fb2faf6f50356e69ae2959b7a53d6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 
 pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq)
 {
-    return pager_flex_parse_sptr(new pager_flex_parse(queue, freq));
+    return gnuradio::get_initial_sptr(new pager_flex_parse(queue, freq));
 }
 
 pager_flex_parse::pager_flex_parse(gr_msg_queue_sptr queue, float freq) :
index 6bcee8ede7b91744e6005337b9e29303b773fa10..61cf4ad3827f7485abba2a8c8879d7dbc2d0c76a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2006 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 
 pager_flex_sync_sptr pager_make_flex_sync()
 {
-    return pager_flex_sync_sptr(new pager_flex_sync());
+    return gnuradio::get_initial_sptr(new pager_flex_sync());
 }
 
 // FLEX sync block takes input from sliced baseband stream [0-3] at specified 
index d419db78a19cf06079a033d57d976de7af882df5..53ba7b9deba6eeaaacca579df864d6422266d537 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -28,7 +28,7 @@
 
 pager_slicer_fb_sptr pager_make_slicer_fb(float alpha)
 {
-    return pager_slicer_fb_sptr(new pager_slicer_fb(alpha));
+    return gnuradio::get_initial_sptr(new pager_slicer_fb(alpha));
 }
 
 pager_slicer_fb::pager_slicer_fb(float alpha) :
index 5bf72b5613d625cc3209b6041b03595c99ee41ae..12a45d4c3392db66ab6beefd651c19d830110901 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2006 Free Software Foundation, Inc.
+# Copyright 2004,2006,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import pager_swig
 
-class qa_pgr(gr_unittest.TestCase):
+class test_pager(gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -32,4 +32,4 @@ class qa_pgr(gr_unittest.TestCase):
         self.tb = None
 
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_pager, "test_pager.xml")
index 9e1a4521935ab1b6fb22e5355bd6cc6ef32a132f..c59bdb0f2ca27665bc12958bc0202c7fd51cef62 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005,2006,2008,2009 Free Software Foundation, Inc.
+# Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS = \
+       -I$(top_srcdir)/gr-pager/lib \
        $(STD_DEFINES_AND_INCLUDES) \
        $(PYTHON_CPPFLAGS) \
-       $(WITH_INCLUDES) \
-       -I$(top_srcdir)/gr-pager/lib
+       $(WITH_INCLUDES)
 
 ##############################
 # SWIG interface and library
index 58c8081e513d08af582f314c45d1bf216d8f3a98..11bb4342aca4b848f92371f7b1b9e25613dfa015 100644 (file)
@@ -4,10 +4,10 @@
 /.deps
 /qtgui.cc
 /qtgui.py
-/WaterfallDisplayPlot_moc.cc
-/Waterfall3DDisplayPlot_moc.cc
-/TimeDomainDisplayPlot_moc.cc
-/spectrumdisplayform_moc.cc
-/spectrumdisplayform_ui.h
-/FrequencyDisplayPlot_moc.cc
-/ConstellationDisplayPlot_moc.cc
+/WaterfallDisplayPlot.moc.cc
+/Waterfall3DDisplayPlot.moc.cc
+/TimeDomainDisplayPlot.moc.cc
+/spectrumdisplayform.moc.cc
+/spectrumdisplayform.ui.h
+/FrequencyDisplayPlot.moc.cc
+/ConstellationDisplayPlot.moc.cc
index e8e6288f5bf7c6924296e1473ba59ccd624a4c2c..9ad5bdd3c44215b94d90e84a447c00e8a0b6a3be 100644 (file)
@@ -24,6 +24,7 @@ public:
   }
 
 protected:
+  using QwtPlotZoomer::trackerText;
   virtual QwtText trackerText( const QwtDoublePoint& p ) const 
   {
     QwtText t(QString("(%1, %2)").arg(p.x(), 0, 'f', 4).
index f2cde322efd1569f2ccaf8d1a5c46bee6fdebb5a..d150e2e4ce19dec73b334f555ba3c4d78c74494b 100644 (file)
@@ -79,7 +79,8 @@ public:
   }
 
 protected:
-  virtual QwtText trackerText( const QwtDoublePoint& p ) const 
+  using QwtPlotZoomer::trackerText;
+  virtual QwtText trackerText( const QwtDoublePoint& p ) const
   {
     QwtText t(QString("%1 %2, %3 dB").
              arg(p.x(), 0, 'f', GetFrequencyPrecision()).
index 26b97d1d45f0f27426c6ed3bb74e6ec2ccff0a04..1ee3c8e3d282eebbfcc17e33f9e6c10db69838ae 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 
 include $(top_srcdir)/Makefile.common
 
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
-              $(QT_INCLUDES) -I. $(WITH_INCLUDES)
+AM_CPPFLAGS = -I. $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
+              $(QT_INCLUDES) $(WITH_INCLUDES)
 
 # Only include these files in the build if qtgui passes configure checks
 # This is mostly to help make distcheck pass
 QMAKE_SOURCES =                                \
-       spectrumdisplayform_moc.cc              \
-       FrequencyDisplayPlot_moc.cc             \
-       TimeDomainDisplayPlot_moc.cc            \
-       WaterfallDisplayPlot_moc.cc             \
-       Waterfall3DDisplayPlot_moc.cc           \
-       ConstellationDisplayPlot_moc.cc         \
-       spectrumdisplayform_ui.h
+       spectrumdisplayform.moc.cc              \
+       FrequencyDisplayPlot.moc.cc             \
+       TimeDomainDisplayPlot.moc.cc            \
+       WaterfallDisplayPlot.moc.cc             \
+       ConstellationDisplayPlot.moc.cc         \
+       spectrumdisplayform.ui.h
 
 EXTRA_DIST = spectrumdisplayform.ui
 
@@ -47,23 +46,22 @@ libgnuradio_qtgui_la_SOURCES =      \
        FrequencyDisplayPlot.cc                 \
        TimeDomainDisplayPlot.cc                \
        WaterfallDisplayPlot.cc                 \
-       Waterfall3DDisplayPlot.cc               \
        waterfallGlobalData.cc                  \
        ConstellationDisplayPlot.cc             \
        spectrumdisplayform.cc                  \
        SpectrumGUIClass.cc                     \
        spectrumUpdateEvents.cc                 \
        plot_waterfall.cc                       \
-       $(QMAKE_SOURCES)                        \
        qtgui_sink_c.cc                         \
        qtgui_sink_f.cc
 
+nodist_libgnuradio_qtgui_la_SOURCES=$(BUILT_SOURCES)
+
 # These headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                    \
        FrequencyDisplayPlot.h          \
        TimeDomainDisplayPlot.h         \
        WaterfallDisplayPlot.h          \
-       Waterfall3DDisplayPlot.h        \
        waterfallGlobalData.h           \
        ConstellationDisplayPlot.h      \
        highResTimeFunctions.h          \
@@ -75,10 +73,11 @@ grinclude_HEADERS =                 \
        qtgui_sink_c.h                  \
        qtgui_sink_f.h
 
-%_moc.cc : %.h
-       $(QT_MOC_EXEC) -DQT_SHARED -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -p $(srcdir) $< -o $@
+QT_MOC_FLAGS=-DQT_SHARED -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB
+%.moc.cc : %.h
+       $(QT_MOC_EXEC) $(QT_MOC_FLAGS) -p $(srcdir) $< -o $@
 
-%_ui.h : %.ui
+%.ui.h : %.ui
        $(QT_UIC_EXEC) $< -o $@
 
 # magic flags
index 8c1b3670300f16bc5ec230a11898c8482b07bcc2..563ed34bae4c874402b664b8eb109db4910a07a0 100644 (file)
@@ -61,8 +61,7 @@ SpectrumGUIClass::~SpectrumGUIClass()
 void
 SpectrumGUIClass::OpenSpectrumWindow(QWidget* parent,
                                     const bool frequency, const bool waterfall,
-                                    const bool waterfall3d, const bool time,
-                                    const bool constellation,
+                                    const bool time, const bool constellation,
                                     const bool use_openGL)
 {
   //_windowStateLock->Lock();
@@ -87,7 +86,6 @@ SpectrumGUIClass::OpenSpectrumWindow(QWidget* parent,
     // Toggle Windows on/off
     _spectrumDisplayForm->ToggleTabFrequency(frequency);
     _spectrumDisplayForm->ToggleTabWaterfall(waterfall);
-    _spectrumDisplayForm->ToggleTabWaterfall3D(waterfall3d);
     _spectrumDisplayForm->ToggleTabTime(time);
     _spectrumDisplayForm->ToggleTabConstellation(constellation);
 
index 17d3a54c1af48601a368a72b6e03de89a03f5fa7..63a340c3402d653dfb22bcf9016957752bb5deb2 100644 (file)
@@ -31,8 +31,7 @@ public:
 
   void OpenSpectrumWindow(QWidget*,
                          const bool frequency=true, const bool waterfall=true,
-                         const bool waterfall3d=true, const bool time=true,
-                         const bool constellation=true,
+                         const bool time=true, const bool constellation=true,
                          const bool use_openGL=true);
   void SetDisplayTitle(const std::string);
 
index c299f83a4a09ea56f6b39df9d039cbfc1c96c794..9c98cec5b037320e5bf4b5439ac1f8feea9f4af3 100644 (file)
@@ -56,6 +56,7 @@ public:
   }
 
 protected:
+  using QwtPlotZoomer::trackerText;
   virtual QwtText trackerText( const QwtDoublePoint& p ) const 
   {
     QwtText t(QString("%1 %2, %3 V").arg(p.x(), 0, 'f', GetTimePrecision()).
diff --git a/gr-qtgui/src/lib/Waterfall3DDisplayPlot.cc b/gr-qtgui/src/lib/Waterfall3DDisplayPlot.cc
deleted file mode 100644 (file)
index f676cb4..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-#ifndef WATERFALL_3D_DISPLAY_PLOT_C
-#define WATERFALL_3D_DISPLAY_PLOT_C
-
-#include <Waterfall3DDisplayPlot.h>
-
-#include <qwt3d_helper.h>
-#include <qapplication.h>
-
-Waterfall3DColorMap::Waterfall3DColorMap(): Qwt3D::Color(), QwtLinearColorMap(){
-  _interval.setInterval(0, 1.0);
-
-}
-
-Waterfall3DColorMap::~Waterfall3DColorMap(){
-
-}
-
-Qwt3D::RGBA
-Waterfall3DColorMap::operator()(double, double, double z) const
-{
-  return Qwt3D::RGBA(Qwt3D::Qt2GL(color(_interval, z)));
-}
-
-void
-Waterfall3DColorMap::SetInterval(const double minValue, const double maxValue)
-{
-  _interval.setInterval(minValue, maxValue);
-}
-
-Qwt3D::ColorVector&
-Waterfall3DColorMap::createVector(Qwt3D::ColorVector& vec)
-{
-  // Generate 100 interval values and then return those
-  Qwt3D::ColorVector colorVec;
-  for(unsigned int number = 0; number < 100; number++){
-    double value = (_interval.width() * (static_cast<double>(number) / 100.0)) + _interval.minValue();
-    colorVec.push_back(operator()(0,0,value));
-  }
-  vec = colorVec;
-  return vec; 
-}
-
-
-const int Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR;
-const int Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_WHITE_HOT;
-const int Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_BLACK_HOT;
-const int Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_INCANDESCENT;
-const int Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED;
-
-Waterfall3DDisplayPlot::Waterfall3DDisplayPlot(QWidget* parent):Qwt3D::SurfacePlot(parent)
-{
-  _startFrequency = 0;
-  _stopFrequency = 4000;
-
-  _createCoordinateSystemFlag = true;
-
-  _initialized = false;
-
-  _numPoints = 1024;
-
-  _displayIntervalTime = (1.0/5.0); // 1/5 of a second between updates
-
-  timespec_reset(&_lastReplot);
-
-  _useCenterFrequencyFlag = false;
-  _centerFrequency = 0.0;
-
-  _timePerFFT = 1.0;
-  timespec_reset(&_dataTimestamp);
-
-  coordinates()->setAutoScale(false);
-
-  _waterfallData = new Waterfall3DData(_startFrequency, _stopFrequency, _numPoints, 200);
-  _waterfallData->assign(this);
-  _waterfallData->create();
-
-  _intensityColorMapType = -1;
-  SetIntensityColorMapType(INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR, Qt::white, Qt::black, true, true);
-
-  legend()->setScale(Qwt3D::LINEARSCALE);
-  legend()->setTitleString("Intensity");
-
-  enableMouse(true);  
-}
-
-Waterfall3DDisplayPlot::~Waterfall3DDisplayPlot()
-{
-  delete _waterfallData;
-}
-
-void
-Waterfall3DDisplayPlot::Init()
-{
-  if(!_initialized && initializedGL()){
-    resize(parentWidget()->width(), parentWidget()->height());
-
-    // Attempting to prevent valgrind uninitialized variable errors in QwtPlot3d::Drawable class
-    glDisable(GL_POLYGON_OFFSET_FILL);
-    
-    setPlotStyle(Qwt3D::FILLED);
-    
-    setCoordinateStyle(Qwt3D::FRAME);
-    setFloorStyle(Qwt3D::FLOORDATA);
-    setOrtho(true);  
-
-    _initialized = true;
-  }
-}
-
-void
-Waterfall3DDisplayPlot::Reset()
-{
-  _waterfallData->ResizeData(_startFrequency, _stopFrequency, _numPoints);
-  _waterfallData->Reset();
-
-  if(initializedGL()){
-    setScale(1, static_cast<int>(((_stopFrequency - _startFrequency) / 200) ), 10);
-  }
-
-  _createCoordinateSystemFlag = true;
-
-  timespec_reset(&_dataTimestamp);
-  _timePerFFT = 1.0;
-}
-
-void
-Waterfall3DDisplayPlot::SetFrequencyRange(const double constStartFreq,
-                                         const double constStopFreq,
-                                         const double constCenterFreq,
-                                         const bool useCenterFrequencyFlag,
-                                         const double units,
-                                         const std::string &strunits)
-{
-  double startFreq = constStartFreq / units;
-  double stopFreq = constStopFreq / units;
-  double centerFreq = constCenterFreq / units;
-
-  if(stopFreq > startFreq) {
-    _startFrequency = startFreq;
-    _stopFrequency = stopFreq;
-
-    _useCenterFrequencyFlag = useCenterFrequencyFlag;
-    _centerFrequency = centerFreq;
-
-    Reset();
-
-    // Only replot if screen is visible
-    if(isVisible()){
-      replot();
-    }
-  }
-}
-
-bool
-Waterfall3DDisplayPlot::loadFromData(double** data, unsigned int columns, unsigned int rows
-                                    ,double minx, double maxx, double miny, double maxy)
-{
-
-  Qwt3D::GridData* gridPtr = (Qwt3D::GridData*)actualData_p;
-  
-  gridPtr->setPeriodic(false,false);
-  gridPtr->setSize(columns,rows);
-  readIn(*gridPtr,data,columns,rows,minx,maxx,miny,maxy);
-  calcNormals(*gridPtr);  
-  
-  updateData();
-  updateNormals();
-  
-  if( _createCoordinateSystemFlag ){
-    createCoordinateSystem();
-    
-    for (unsigned i=0; i!=coordinates()->axes.size(); ++i)
-      {
-       coordinates()->axes[i].setMajors(5);
-       coordinates()->axes[i].setMinors(3);
-      }
-    
-    coordinates()->axes[Qwt3D::Y1].setLabelString("Time");
-    coordinates()->axes[Qwt3D::Y2].setLabelString("Time");
-    coordinates()->axes[Qwt3D::Y3].setLabelString("Time");
-    coordinates()->axes[Qwt3D::Y4].setLabelString("Time");
-    coordinates()->axes[Qwt3D::Z1].setLabelString("Intensity (dB)");
-    coordinates()->axes[Qwt3D::Z2].setLabelString("Intensity (dB)");
-    coordinates()->axes[Qwt3D::Z3].setLabelString("Intensity (dB)");
-    coordinates()->axes[Qwt3D::Z4].setLabelString("Intensity (dB)");
-
-    coordinates()->axes[Qwt3D::X1].setLabelString((!_useCenterFrequencyFlag ? "Frequency (Hz)" : "Frequency (kHz)"));
-    coordinates()->axes[Qwt3D::X2].setLabelString((!_useCenterFrequencyFlag ? "Frequency (Hz)" : "Frequency (kHz)"));
-    coordinates()->axes[Qwt3D::X3].setLabelString((!_useCenterFrequencyFlag ? "Frequency (Hz)" : "Frequency (kHz)"));
-    coordinates()->axes[Qwt3D::X4].setLabelString((!_useCenterFrequencyFlag ? "Frequency (Hz)" : "Frequency (kHz)"));
-
-    // The QwtPlot3D Interface takes ownership of these items, so there is no need to delete them...
-    coordinates()->axes[Qwt3D::X1].setScale(new FrequencyScale(_useCenterFrequencyFlag, _centerFrequency));
-    coordinates()->axes[Qwt3D::X2].setScale(new FrequencyScale(_useCenterFrequencyFlag, _centerFrequency));
-    coordinates()->axes[Qwt3D::X3].setScale(new FrequencyScale(_useCenterFrequencyFlag, _centerFrequency));
-    coordinates()->axes[Qwt3D::X4].setScale(new FrequencyScale(_useCenterFrequencyFlag, _centerFrequency));
-
-    coordinates()->axes[Qwt3D::Y1].setScale(new TimeScale(this));
-    coordinates()->axes[Qwt3D::Y2].setScale(new TimeScale(this));
-    coordinates()->axes[Qwt3D::Y3].setScale(new TimeScale(this));
-    coordinates()->axes[Qwt3D::Y4].setScale(new TimeScale(this));
-
-    coordinates()->axes[Qwt3D::Z1].setScale(new IntensityScale(_waterfallData->GetFloorValue()));
-    coordinates()->axes[Qwt3D::Z2].setScale(new IntensityScale(_waterfallData->GetFloorValue()));
-    coordinates()->axes[Qwt3D::Z3].setScale(new IntensityScale(_waterfallData->GetFloorValue()));
-    coordinates()->axes[Qwt3D::Z4].setScale(new IntensityScale(_waterfallData->GetFloorValue()));
-
-    _createCoordinateSystemFlag = false;
-  }
-  
-  return true;
-}
-
-double
-Waterfall3DDisplayPlot::GetStartFrequency() const
-{
-  return _startFrequency;
-}
-
-double
-Waterfall3DDisplayPlot::GetStopFrequency() const
-{
-  return _stopFrequency;
-}
-
-void
-Waterfall3DDisplayPlot::PlotNewData(const double* dataPoints,
-                                   const int64_t numDataPoints,
-                                   const double timePerFFT,
-                                   const timespec timestamp,
-                                   const int droppedFrames)
-{
-  if(numDataPoints > 0){
-    if(numDataPoints != _numPoints){
-      _numPoints = numDataPoints;
-
-      Reset();
-
-      if(isVisible()){
-       replot();
-      }
-
-      _createCoordinateSystemFlag = true;
-
-      _lastReplot = get_highres_clock();
-    }
-
-    _dataTimestamp = timestamp;
-    _timePerFFT = timePerFFT;
-
-    _waterfallData->addFFTData(dataPoints, numDataPoints, droppedFrames);
-    _waterfallData->IncrementNumLinesToUpdate();
-  }
-
-  // Allow at least a 50% duty cycle
-  if(diff_timespec(get_highres_clock(), _lastReplot) > _displayIntervalTime){
-    // Only update when window is visible
-    if(isVisible()){
-      replot();
-    }
-
-    _lastReplot = get_highres_clock();
-  }
-}
-
-void
-Waterfall3DDisplayPlot::SetIntensityRange(const double minIntensity,
-                                         const double maxIntensity)
-{
-  _waterfallData->SetFloorValue(minIntensity);
-  _waterfallData->setMinZ(0);
-  _waterfallData->setMaxZ(maxIntensity-minIntensity);
-
-  _createCoordinateSystemFlag = true;
-
-  emit UpdatedLowerIntensityLevel(minIntensity);
-  emit UpdatedUpperIntensityLevel(maxIntensity);
-
-  SetIntensityColorMapType(_intensityColorMapType,
-                          _userDefinedLowIntensityColor,
-                          _userDefinedLowIntensityColor, true);
-}
-
-void
-Waterfall3DDisplayPlot::replot()
-{
-  if(!_initialized){
-    Init();
-  }
-  if(initializedGL()){
-    const timespec startTime = get_highres_clock();
-    
-    _waterfallData->create();
-    
-    legend()->setMajors(4);
-    legend()->setMinors(5);
-    double start, stop;
-    coordinates()->axes[Qwt3D::Z1].limits(start,stop);
-    legend()->setLimits( _waterfallData->GetFloorValue(), _waterfallData->GetFloorValue() + stop - start );
-
-    coordinates()->axes[Qwt3D::X1].limits(start,stop);
-
-    showColorLegend(true);
-
-    updateGL();
-
-    double differenceTime = (diff_timespec(get_highres_clock(), startTime));
-  
-    // Require at least a 20% duty cycle
-    differenceTime *= 4.0;
-    if(differenceTime > (1.0/5.0)){
-      _displayIntervalTime = differenceTime;
-    }
-  }
-}
-
-void
-Waterfall3DDisplayPlot::resizeSlot( QSize *s )
-{
-  resize(s->width(), s->height());
-}
-
-int
-Waterfall3DDisplayPlot::GetIntensityColorMapType() const
-{
-  return _intensityColorMapType;
-}
-
-void
-Waterfall3DDisplayPlot::SetIntensityColorMapType(const int newType,
-                                                const QColor lowColor,
-                                                const QColor highColor,
-                                                const bool forceFlag,
-                                                const bool noReplotFlag)
-{
-  if(((_intensityColorMapType != newType) || forceFlag) || 
-     ((newType == INTENSITY_COLOR_MAP_TYPE_USER_DEFINED) &&
-      (lowColor.isValid() && highColor.isValid()))){
-
-    Waterfall3DColorMap* colorMap = new Waterfall3DColorMap();
-    colorMap->SetInterval(_waterfallData->minZ(), _waterfallData->maxZ());
-
-    switch(newType){
-    case INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR:{
-      _intensityColorMapType = newType;
-      colorMap->setColorInterval(Qt::darkCyan, Qt::white);
-      colorMap->addColorStop(0.25, Qt::cyan);
-      colorMap->addColorStop(0.5, Qt::yellow);
-      colorMap->addColorStop(0.75, Qt::red);
-      setBackgroundColor(Qwt3D::Qt2GL(Qt::gray));
-      break;
-    }
-    case INTENSITY_COLOR_MAP_TYPE_WHITE_HOT:{
-      _intensityColorMapType = newType;
-      colorMap->setColorInterval(Qt::black, Qt::white);
-      setBackgroundColor(Qwt3D::Qt2GL(Qt::blue));
-      break;
-    }
-    case INTENSITY_COLOR_MAP_TYPE_BLACK_HOT:{
-      _intensityColorMapType = newType;
-      colorMap->setColorInterval(Qt::white, Qt::black);
-      setBackgroundColor(Qwt3D::Qt2GL(Qt::blue));
-      break;
-    }
-    case INTENSITY_COLOR_MAP_TYPE_INCANDESCENT:{
-      _intensityColorMapType = newType;
-      colorMap->setColorInterval(Qt::black, Qt::white);
-      colorMap->addColorStop(0.5, Qt::darkRed);
-      setBackgroundColor(Qwt3D::Qt2GL(Qt::gray));
-      break;
-    }
-    case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED:{
-      _userDefinedLowIntensityColor = lowColor;
-      _userDefinedHighIntensityColor = highColor;
-      _intensityColorMapType = newType;
-      colorMap->setColorInterval(_userDefinedLowIntensityColor, _userDefinedHighIntensityColor);
-      setBackgroundColor(Qwt3D::Qt2GL(Qt::white));
-      break;
-    }
-    default:
-      colorMap->setColorInterval(Qt::black, Qt::white);
-      break;
-    }
-
-    // Qwt3D takes over destruction of this object...
-    setDataColor(colorMap);
-
-    if(!noReplotFlag){
-      // Draw again
-      replot();
-      
-      // Update the last replot timer
-      _lastReplot = get_highres_clock();
-    }
-  }
-}
-
-const QColor
-Waterfall3DDisplayPlot::GetUserDefinedLowIntensityColor() const
-{
-  return _userDefinedLowIntensityColor;
-}
-
-const QColor
-Waterfall3DDisplayPlot::GetUserDefinedHighIntensityColor() const
-{
-  return _userDefinedHighIntensityColor;
-}
-
-#endif /* WATERFALL_3D_DISPLAY_PLOT_C */
diff --git a/gr-qtgui/src/lib/Waterfall3DDisplayPlot.h b/gr-qtgui/src/lib/Waterfall3DDisplayPlot.h
deleted file mode 100644 (file)
index 272bdf6..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-#ifndef WATERFALL_3D_DISPLAY_PLOT_HPP
-#define WATERFALL_3D_DISPLAY_PLOT_HPP
-
-#include <cstdio>
-#include <highResTimeFunctions.h>
-
-#include <waterfallGlobalData.h>
-#include <qwt3d_surfaceplot.h>
-
-#include <qwt3d_color.h>
-#include <qwt_color_map.h>
-
-class Waterfall3DColorMap: public Qwt3D::Color, public QwtLinearColorMap
-{
-public:
-  Waterfall3DColorMap();
-  virtual ~Waterfall3DColorMap();
-
-  virtual Qwt3D::RGBA operator()(double x, double y, double z)const;
-  virtual Qwt3D::ColorVector& createVector(Qwt3D::ColorVector& vec);
-
-  virtual void SetInterval(const double minValue, const double maxValue);
-
-protected:
-  
-private:
-  QwtDoubleInterval _interval;
-};
-
-class Waterfall3DDisplayPlot:public Qwt3D::SurfacePlot{
-  Q_OBJECT
-
-  protected:
-  class IntensityScale:public Qwt3D::LinearScale{
-
-  friend class Qwt3D::Axis;
-  friend class Qwt3D::qwt3d_ptr<Qwt3D::Scale>;
-
-  private:
-    double _floor;
-
-  public:
-    explicit IntensityScale(const double newFloor):_floor(newFloor){ }
-    virtual ~IntensityScale(){}
-
-    virtual QString ticLabel(unsigned int idx) const{
-      if (idx<majors_p.size())
-       {
-         return QString("%1").arg( majors_p[idx] + GetFloorValue(), 0, 'f', 0 );
-       }
-      return QString("");
-    }
-
-    virtual double GetFloorValue()const{ return _floor; }
-    virtual void SetFloorValue(const double newFloor){ _floor = newFloor; }
-
-    //! Returns a new heap based object utilized from qwt3d_ptr
-    Scale* clone() const {return new IntensityScale(*this);} 
-  };
-  
-  class TimeScale:public Qwt3D::LinearScale{
-
-    friend class Qwt3D::Axis;
-    friend class Qwt3D::qwt3d_ptr<Qwt3D::Scale>;
-    friend class Waterfall3DDisplayPlot;
-
-  private:
-    Waterfall3DDisplayPlot* _plot;
-
-  public:
-    TimeScale(Waterfall3DDisplayPlot* plot ):_plot(plot){
-    }
-    virtual ~TimeScale(){
-    }
-
-    virtual QString ticLabel(unsigned int idx) const{
-      if (idx<majors_p.size())
-       {
-         const timespec markerTime = timespec_add(_plot->_dataTimestamp,
-                                                  -(_plot->_timePerFFT) * majors_p[idx]);
-         struct tm timeTm;
-         gmtime_r(&markerTime.tv_sec, &timeTm);
-         
-         char* timeBuffer = new char[128];
-         snprintf(timeBuffer, 128, "%02d:%02d:%02d.%03ld", timeTm.tm_hour,
-                  timeTm.tm_min, timeTm.tm_sec, (markerTime.tv_nsec / 1000000));
-         QString returnBuffer(timeBuffer);
-         delete[] timeBuffer;
-         return returnBuffer;
-       }
-      return QString("");
-    }
-
-    //! Returns a new heap based object utilized from qwt3d_ptr
-    Scale* clone() const {return new TimeScale(*this);}
-  };
-
-  class FrequencyScale: public Qwt3D::LinearScale{
-
-    friend class Qwt3D::Axis;
-    friend class Qwt3D::qwt3d_ptr<Qwt3D::Scale>;
-  private:
-    double _centerFrequency;
-    bool _useCenterFrequencyFlag;
-  public:
-    FrequencyScale(bool useCenterFrequencyFlag, double centerFrequency)
-      : _centerFrequency(centerFrequency),_useCenterFrequencyFlag(useCenterFrequencyFlag)
-      {}
-
-    virtual ~FrequencyScale(){}
-
-    virtual QString ticLabel(unsigned int idx) const
-    {
-      if (idx<majors_p.size())
-       {
-         if(!_useCenterFrequencyFlag){
-           return QString("%1").arg(  majors_p[idx], 0, 'f', 0 );
-
-         }
-         else{
-           return QString("%1").arg(  (majors_p[idx] + _centerFrequency)/1000.0, 0, 'f', 3 );
-         }
-       }
-      return QString("");
-    }
-
-    //! Returns a new heap based object utilized from qwt3d_ptr
-    Scale* clone() const {return new FrequencyScale(*this);}
-  };
-
-public:
-  Waterfall3DDisplayPlot(QWidget*);
-  virtual ~Waterfall3DDisplayPlot();
-                                               
-  void Init();
-  void Reset();
-
-  bool loadFromData(double** data, unsigned int columns, unsigned int rows
-                   ,double minx, double maxx, double miny, double maxy);
-
-  void SetFrequencyRange(const double, const double,
-                        const double, const bool,
-                        const double units, const std::string &strunits);
-  double GetStartFrequency()const;
-  double GetStopFrequency()const;
-
-  void PlotNewData(const double* dataPoints, const int64_t numDataPoints,
-                  const double timePerFFT, const timespec timestamp,
-                  const int droppedFrames);
-
-  void SetIntensityRange(const double minIntensity, const double maxIntensity);
-
-  virtual void replot(void);
-
-  int GetIntensityColorMapType()const;
-  void SetIntensityColorMapType( const int, const QColor,
-                                const QColor, const bool forceFlag = false,
-                                const bool noReplotFlag = false );
-  const QColor GetUserDefinedLowIntensityColor()const;
-  const QColor GetUserDefinedHighIntensityColor()const;
-
-  static const int INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0;
-  static const int INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1;
-  static const int INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2;
-  static const int INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3;
-  static const int INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4;
-
-public slots:
-  void resizeSlot( QSize *s );
-
-
-signals:
-  void UpdatedLowerIntensityLevel(const double);
-  void UpdatedUpperIntensityLevel(const double);
-
-protected:
-
-  double _startFrequency;
-  double _stopFrequency;
-
-  Waterfall3DData* _waterfallData;
-
-  timespec _lastReplot;
-
-  int64_t _numPoints;
-
-  double _displayIntervalTime;
-
-  int _intensityColorMapType;
-  QColor _userDefinedLowIntensityColor;
-  QColor _userDefinedHighIntensityColor;
-
-  bool _useCenterFrequencyFlag;
-  double _centerFrequency;
-
-  timespec _dataTimestamp;
-  double _timePerFFT;
-  bool _initialized;
-
-  bool _createCoordinateSystemFlag;
-
-private:
-
-};
-
-#endif /* WATERFALL_3D_DISPLAY_PLOT_HPP */
index e0804fa64083bcbd379d81c1fa3fa8892d11a849..680c447565f392aac552d8c67e9774d108e8dc54 100644 (file)
@@ -186,6 +186,7 @@ public:
   }
 
 protected:
+  using QwtPlotZoomer::trackerText;
   virtual QwtText trackerText( const QwtDoublePoint& p ) const 
   {
     QString yLabel("");
index b85b1acadeefbf218d44f72f9a66464763df0a81..251bbad8b1cb414908e0636e668ed7ea706e54f2 100644 (file)
@@ -8,41 +8,74 @@
 
 static const long NSEC_PER_SEC = 1000000000L;
 
-static inline bool timespec_greater(const struct timespec* t1, const struct timespec* t0){
-  return ((t1->tv_sec > t0->tv_sec) || ((t1->tv_sec == t0->tv_sec) && (t1->tv_nsec > t0->tv_nsec)));
+static inline bool
+timespec_greater(const struct timespec* t1,
+                const struct timespec* t0)
+{
+  return ((t1->tv_sec > t0->tv_sec) ||
+         ((t1->tv_sec == t0->tv_sec) &&
+          (t1->tv_nsec > t0->tv_nsec)));
 }
 
-static inline bool timespec_greater(const struct timespec t1, const struct timespec t0){
-  return ((t1.tv_sec > t0.tv_sec) || ((t1.tv_sec == t0.tv_sec) && (t1.tv_nsec > t0.tv_nsec)));
+static inline bool
+timespec_greater(const struct timespec t1,
+                const struct timespec t0)
+{
+  return ((t1.tv_sec > t0.tv_sec) ||
+         ((t1.tv_sec == t0.tv_sec) &&
+          (t1.tv_nsec > t0.tv_nsec)));
 }
 
-static inline bool timespec_less(const struct timespec* t1, const struct timespec* t0){
-  return ((t1->tv_sec < t0->tv_sec) || ((t1->tv_sec == t0->tv_sec) && (t1->tv_nsec < t0->tv_nsec)));
+static inline bool
+timespec_less(const struct timespec* t1,
+             const struct timespec* t0)
+{
+  return ((t1->tv_sec < t0->tv_sec) ||
+         ((t1->tv_sec == t0->tv_sec) &&
+          (t1->tv_nsec < t0->tv_nsec)));
 }
 
-static inline bool timespec_less(const struct timespec t1, const struct timespec t0){
-  return ((t1.tv_sec < t0.tv_sec) || ((t1.tv_sec == t0.tv_sec) && (t1.tv_nsec < t0.tv_nsec)));
+static inline bool
+timespec_less(const struct timespec t1,
+             const struct timespec t0)
+{
+  return ((t1.tv_sec < t0.tv_sec) ||
+         ((t1.tv_sec == t0.tv_sec) &&
+          (t1.tv_nsec < t0.tv_nsec)));
 }
 
-static inline bool timespec_equal(const struct timespec* t1, const struct timespec* t0){
-  return ((t1->tv_sec == t0->tv_sec) && (t1->tv_nsec == t0->tv_nsec));
+static inline bool
+timespec_equal(const struct timespec* t1,
+              const struct timespec* t0)
+{
+  return ((t1->tv_sec == t0->tv_sec) &&
+         (t1->tv_nsec == t0->tv_nsec));
 }
 
-static inline bool timespec_equal(const struct timespec t1, const struct timespec t0){
-  return ((t1.tv_sec == t0.tv_sec) && (t1.tv_nsec == t0.tv_nsec));
+static inline bool
+timespec_equal(const struct timespec t1,
+              const struct timespec t0)
+{
+  return ((t1.tv_sec == t0.tv_sec) &&
+         (t1.tv_nsec == t0.tv_nsec));
 }
 
-static inline void timespec_reset(struct timespec* ret){
+static inline void
+timespec_reset(struct timespec* ret)
+{
   ret->tv_sec = 0;
   ret->tv_nsec = 0;
 }
 
-static inline void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec){
-  while (nsec > NSEC_PER_SEC){
+static inline void
+set_normalized_timespec(struct timespec *ts,
+                       time_t sec, long nsec)
+{
+  while (nsec > NSEC_PER_SEC) {
     nsec -= NSEC_PER_SEC;
     ++sec;
   }
-  while(nsec < 0){
+  while(nsec < 0) {
     nsec += NSEC_PER_SEC;
     --sec;
   }
@@ -50,10 +83,13 @@ static inline void set_normalized_timespec(struct timespec *ts, time_t sec, long
   ts->tv_nsec = nsec;
 }
 
-static inline struct timespec convert_to_timespec(const double timeValue){
+static inline struct timespec
+convert_to_timespec(const double timeValue)
+{
   struct timespec ret;
   double seconds = 0;
-  long nsec = static_cast<long>(modf(timeValue, &seconds) * static_cast<double>(NSEC_PER_SEC));
+  long nsec = static_cast<long>(modf(timeValue, &seconds) * 
+                               static_cast<double>(NSEC_PER_SEC));
   time_t sec = static_cast<time_t>(seconds);
 
   set_normalized_timespec(&ret, sec, nsec);
@@ -61,28 +97,46 @@ static inline struct timespec convert_to_timespec(const double timeValue){
   return ret;
 }
 
-static inline double convert_from_timespec(const timespec actual){
-  return (static_cast<double>(actual.tv_sec) + (static_cast<double>(actual.tv_nsec) / static_cast<double>(NSEC_PER_SEC)));
+static inline double
+convert_from_timespec(const timespec actual)
+{
+  return (static_cast<double>(actual.tv_sec) +
+         (static_cast<double>(actual.tv_nsec) /
+          static_cast<double>(NSEC_PER_SEC)));
 }
 
-static inline void timespec_add(struct timespec *ret, const struct timespec* t1, const struct timespec* t0){
+static inline void
+timespec_add(struct timespec *ret,
+            const struct timespec* t1,
+            const struct timespec* t0)
+{
   time_t sec = t1->tv_sec + t0->tv_sec;
   long nsec = t1->tv_nsec + t0->tv_nsec;
 
   set_normalized_timespec(ret, sec, nsec);
 }
 
-static inline void timespec_add(struct timespec *ret, const struct timespec t1, const struct timespec t0){
+static inline void
+timespec_add(struct timespec *ret,
+            const struct timespec t1,
+            const struct timespec t0)
+{
   return timespec_add(ret, &t1, &t0);
 }
 
-static inline struct timespec timespec_add(const struct timespec t1, const struct timespec t0){
+static inline struct timespec
+timespec_add(const struct timespec t1,
+            const struct timespec t0)
+{
   struct timespec ret;
   timespec_add(&ret, &t1, &t0);
   return ret;
 }
 
-static inline struct timespec timespec_add(const struct timespec t1, const double time0){
+static inline struct timespec
+timespec_add(const struct timespec t1,
+            const double time0)
+{
   struct timespec ret;
   struct timespec t0;
   t0 = convert_to_timespec(time0);
@@ -92,24 +146,38 @@ static inline struct timespec timespec_add(const struct timespec t1, const doubl
   return ret;
 }
 
-static inline void timespec_subtract(struct timespec *ret, const struct timespec* t1, const struct timespec* t0){
+static inline void
+timespec_subtract(struct timespec *ret,
+                 const struct timespec* t1,
+                 const struct timespec* t0)
+{
   time_t sec = t1->tv_sec - t0->tv_sec;
   long nsec = t1->tv_nsec - t0->tv_nsec;
 
   set_normalized_timespec(ret, sec, nsec);
 }
 
-static inline void timespec_subtract(struct timespec *ret, const struct timespec t1, const struct timespec t0){
+static inline void
+timespec_subtract(struct timespec *ret,
+                 const struct timespec t1,
+                 const struct timespec t0)
+{
   return timespec_subtract(ret, &t1, &t0);
 }
 
-static inline struct timespec timespec_subtract(const struct timespec t1, const struct timespec t0){
+static inline struct timespec
+timespec_subtract(const struct timespec t1,
+                 const struct timespec t0)
+{
   struct timespec ret;
   timespec_subtract(&ret, &t1, &t0);
   return ret;
 }
 
-static inline struct timespec timespec_subtract(const struct timespec t1, const double time0){
+static inline struct timespec
+timespec_subtract(const struct timespec t1,
+                 const double time0)
+{
   struct timespec ret;
   struct timespec t0;
   t0 = convert_to_timespec(time0);
@@ -119,7 +187,11 @@ static inline struct timespec timespec_subtract(const struct timespec t1, const
   return ret;
 }
 
-static inline double diff_timespec(struct timespec* ret, const struct timespec *t1, const struct timespec* t0){
+static inline double
+diff_timespec(struct timespec* ret,
+             const struct timespec *t1,
+             const struct timespec* t0)
+{
   struct timespec actual;
   time_t sec = 0;
   long nsec = 0;
@@ -141,7 +213,8 @@ static inline double diff_timespec(struct timespec* ret, const struct timespec *
     sec = t0->tv_sec - t1->tv_sec;
     nsec = t0->tv_nsec - t1->tv_nsec;
 
-    // Do nothing with the ret value as the ret value would have to store a negative, which it can't.
+    // Do nothing with the ret value as the ret value
+    // would have to store a negative, which it can't.
 
     set_normalized_timespec(&actual, sec, nsec);
     
@@ -149,23 +222,39 @@ static inline double diff_timespec(struct timespec* ret, const struct timespec *
   }
 }
 
-static inline double diff_timespec(struct timespec* ret, const struct timespec t1, const struct timespec t0){
+static inline double
+diff_timespec(struct timespec* ret,
+             const struct timespec t1,
+             const struct timespec t0)
+{
   return diff_timespec(ret, &t1, &t0);
 }
 
-static inline double diff_timespec(const struct timespec t1, const struct timespec t0){
+static inline double
+diff_timespec(const struct timespec t1,
+             const struct timespec t0)
+{
   return diff_timespec(NULL, &t1, &t0);
 }
 
 
-static inline double diff_timespec(const struct timespec* t1, const struct timespec* t0){
+static inline double
+diff_timespec(const struct timespec* t1,
+             const struct timespec* t0)
+{
   return diff_timespec(NULL, t1, t0);
 }
 
 
-static inline void get_highres_clock(struct timespec* ret){
+#ifdef CLOCK_REALTIME
+// If we can use clock_gettime, use it;
+// otherwise, use gettimeofday
+static inline void
+get_highres_clock(struct timespec* ret)
+{
   if(clock_gettime(CLOCK_REALTIME, ret) != 0){
-    // Unable to get high resolution time - fail over to low resolution time
+    // Unable to get high resolution time - 
+    // fail over to low resolution time
     timeval lowResTime;
     gettimeofday(&lowResTime, NULL);
     ret->tv_sec = lowResTime.tv_sec;
@@ -173,17 +262,37 @@ static inline void get_highres_clock(struct timespec* ret){
   }
 }
 
-static inline struct timespec get_highres_clock(){
+#else
+
+// Trick timer functions into thinking it has an nsec timer
+// but only use the low resolution (usec) timer.
+static inline void
+get_highres_clock(struct timespec* ret)
+{
+  timeval lowResTime;
+  gettimeofday(&lowResTime, NULL);
+  ret->tv_sec = lowResTime.tv_sec;
+  ret->tv_nsec = lowResTime.tv_usec*1000;
+}
+#endif
+
+static inline struct timespec
+get_highres_clock()
+{
   struct timespec ret;
   get_highres_clock(&ret);
   return ret;
 }
 
-static inline bool timespec_empty(const struct timespec* ret){
+static inline bool
+timespec_empty(const struct timespec* ret)
+{
   return ( (ret->tv_sec == 0 ) &&  (ret->tv_nsec == 0) );
 }
 
-static inline bool timespec_empty(const struct timespec ret){
+static inline bool
+timespec_empty(const struct timespec ret)
+{
   return timespec_empty(&ret);
 }
 
index a148cf50119343ad52b6ecbfa273890900cd01cc..c12c451b0034845bfcd0e22ac76f0e9ba8dffd3e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008,2009 Free Software Foundation, Inc.
+ * Copyright 2008,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ qtgui_make_sink_c (int fftsize, int wintype,
                   bool use_openGL,
                   QWidget *parent)
 {
-  return qtgui_sink_c_sptr (new qtgui_sink_c (fftsize, wintype,
+  return gnuradio::get_initial_sptr(new qtgui_sink_c (fftsize, wintype,
                                              fc, bw, name,
                                              plotfreq, plotwaterfall,
                                              plotwaterfall3d, plottime,
@@ -64,10 +64,13 @@ qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype,
     d_wintype((gr_firdes::win_type)(wintype)), 
     d_center_freq(fc), d_bandwidth(bw), d_name(name),
     d_plotfreq(plotfreq), d_plotwaterfall(plotwaterfall),
-    d_plotwaterfall3d(plotwaterfall3d), d_plottime(plottime),
-    d_plotconst(plotconst),
+    d_plottime(plottime), d_plotconst(plotconst),
     d_parent(parent)
 {
+  if(plotwaterfall3d == true) {
+    fprintf(stderr, "Warning: plotting Waterfall3D has been removed; enabling plotwaterfall3d has no effect.\n");
+  }
+
   d_main_gui = NULL;
   pthread_mutex_init(&d_pmutex, NULL);
   lock();
@@ -141,8 +144,7 @@ qtgui_sink_c::initialize(const bool opengl)
 
   d_main_gui->OpenSpectrumWindow(d_parent, 
                                 d_plotfreq, d_plotwaterfall,
-                                d_plotwaterfall3d, d_plottime,
-                                d_plotconst,
+                                d_plottime, d_plotconst,
                                 opengl);
 
   // initialize update time to 10 times a second
index 1f6c284738981bf6abe8225d8c7984d6ecd28dcc..9aee665031169d523bc13798f82af10ce260c89c 100644 (file)
 #ifndef INCLUDED_QTGUI_SINK_C_H
 #define INCLUDED_QTGUI_SINK_C_H
 
+#include <Python.h>
 #include <gr_block.h>
 #include <gr_firdes.h>
 #include <gri_fft.h>
 #include <qapplication.h>
 #include <qtgui.h>
-#include <Python.h>
 #include "SpectrumGUIClass.h"
 
 class qtgui_sink_c;
@@ -84,7 +84,7 @@ private:
   int d_index;
   gr_complex *d_residbuf;
 
-  bool d_plotfreq, d_plotwaterfall, d_plotwaterfall3d, d_plottime, d_plotconst;
+  bool d_plotfreq, d_plotwaterfall, d_plottime, d_plotconst;
   
   double d_update_time;
 
index 8eb0a0347ff65f07552e9251df9e05257d138975..ab4fd082d47c0a3520fb8a4a5f5003cbf69d2858 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2008,2009 Free Software Foundation, Inc.
+ * Copyright 2008,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ qtgui_make_sink_f (int fftsize, int wintype,
                   bool use_openGL,
                   QWidget *parent)
 {
-  return qtgui_sink_f_sptr (new qtgui_sink_f (fftsize, wintype,
+  return gnuradio::get_initial_sptr(new qtgui_sink_f (fftsize, wintype,
                                              fc, bw, name,
                                              plotfreq, plotwaterfall,
                                              plotwaterfall3d, plottime,
@@ -64,10 +64,13 @@ qtgui_sink_f::qtgui_sink_f (int fftsize, int wintype,
     d_wintype((gr_firdes::win_type)(wintype)),
     d_center_freq(fc), d_bandwidth(bw), d_name(name),
     d_plotfreq(plotfreq), d_plotwaterfall(plotwaterfall),
-    d_plotwaterfall3d(plotwaterfall3d), d_plottime(plottime),
-    d_plotconst(plotconst),
+    d_plottime(plottime), d_plotconst(plotconst),
     d_parent(parent)
 {
+  if(plotwaterfall3d == true) {
+    fprintf(stderr, "Warning: plotting Waterfall3D has been removed; enabling plotwaterfall3d has no effect.\n");
+  }
+
   d_main_gui = NULL;
   pthread_mutex_init(&d_pmutex, NULL);
   lock();
@@ -136,8 +139,7 @@ qtgui_sink_f::initialize(const bool opengl)
 
   d_main_gui->OpenSpectrumWindow(d_parent,
                                 d_plotfreq, d_plotwaterfall,
-                                d_plotwaterfall3d, d_plottime,
-                                d_plotconst,
+                                d_plottime, d_plotconst,
                                 opengl);
 
   // initialize update time to 10 times a second
index f603da7b6ac990f2e0b4756b9ca9d22653d3367f..0cac35d90cb8996197a1a109f8470f02d93b04fb 100644 (file)
 #ifndef INCLUDED_QTGUI_SINK_F_H
 #define INCLUDED_QTGUI_SINK_F_H
 
+#include <Python.h>
 #include <gr_block.h>
 #include <gr_firdes.h>
 #include <gri_fft.h>
 #include <qapplication.h>
 #include <qtgui.h>
-#include <Python.h>
 #include "SpectrumGUIClass.h"
 
 class qtgui_sink_f;
@@ -82,7 +82,7 @@ private:
   int d_index;
   float *d_residbuf;
 
-  bool d_plotfreq, d_plotwaterfall, d_plotwaterfall3d, d_plottime, d_plotconst;
+  bool d_plotfreq, d_plotwaterfall, d_plottime, d_plotconst;
 
   double d_update_time;
 
index f52a63d1f0a85c0ff555a8036b19fd0530e90567..e0509a294853715b0f44966a1106b9ffe01c3a06 100644 (file)
@@ -17,10 +17,6 @@ SpectrumDisplayForm::SpectrumDisplayForm(bool useOpenGL, QWidget* parent)
   _frequencyDisplayPlot = new FrequencyDisplayPlot(FrequencyPlotDisplayFrame);
   _waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame);
 
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    //_waterfall3DDisplayPlot = new Waterfall3DDisplayPlot(Waterfall3DPlotDisplayFrame);
-  }
-
   _timeDomainDisplayPlot = new TimeDomainDisplayPlot(TimeDomainDisplayFrame);
   _constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame);
   _numRealDataPoints = 1024;
@@ -38,14 +34,6 @@ SpectrumDisplayForm::SpectrumDisplayForm(bool useOpenGL, QWidget* parent)
   WaterfallMinimumIntensityWheel->setTickCnt(50);
   WaterfallMinimumIntensityWheel->setValue(-200);
   
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    Waterfall3DMaximumIntensityWheel->setRange(-200, 0);
-    Waterfall3DMaximumIntensityWheel->setTickCnt(50);
-    Waterfall3DMinimumIntensityWheel->setRange(-200, 0);
-    Waterfall3DMinimumIntensityWheel->setTickCnt(50);
-    Waterfall3DMinimumIntensityWheel->setValue(-200);
-  }
-
   _peakFrequency = 0;
   _peakAmplitude = -HUGE_VAL;
   
@@ -68,7 +56,6 @@ SpectrumDisplayForm::SpectrumDisplayForm(bool useOpenGL, QWidget* parent)
 
   ToggleTabFrequency(false);
   ToggleTabWaterfall(false);
-  ToggleTabWaterfall3D(false);
   ToggleTabTime(false);
   ToggleTabConstellation(false);
 
@@ -134,11 +121,11 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate
   const std::complex<float>* complexDataPointsPtr = complexDataPoints+numFFTDataPoints/2;
   double* realFFTDataPointsPtr = _realFFTDataPoints;
 
-  double sumMean, localPeakAmplitude, localPeakFrequency;
+  double sumMean = 0.0;
+  double localPeakAmplitude = -HUGE_VAL;
+  double localPeakFrequency = 0.0;
   const double fftBinSize = (_stopFrequency-_startFrequency) /
     static_cast<double>(numFFTDataPoints);
-  localPeakAmplitude = -HUGE_VAL;
-  sumMean = 0.0;
 
   // Run this twice to perform the fftshift operation on the data here as well
   std::complex<float> scaleFactor = std::complex<float>((float)numFFTDataPoints);
@@ -229,15 +216,6 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate
                                           d_update_time, dataTimestamp, 
                                           spectrumUpdateEvent->getDroppedFFTFrames());
       }
-      /*
-      if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-       if( _openGLWaterfall3DFlag == 1 && (tabindex == d_plot_waterfall3d)) {
-         _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints, 
-                                              d_update_time, dataTimestamp, 
-                                              spectrumUpdateEvent->getDroppedFFTFrames());
-       }
-      }
-      */
     }
 
     
@@ -265,12 +243,6 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e )
   s.setHeight(WaterfallPlotDisplayFrame->height());
   emit _waterfallDisplayPlot->resizeSlot(&s);
 
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    s.setWidth(Waterfall3DPlotDisplayFrame->width());
-    s.setHeight(Waterfall3DPlotDisplayFrame->height());
-    //emit _waterfall3DDisplayPlot->resizeSlot(&s);
-  }
-
   s.setWidth(ConstellationDisplayFrame->width());
   s.setHeight(ConstellationDisplayFrame->height());
   emit _constellationDisplayPlot->resizeSlot(&s);
@@ -289,32 +261,6 @@ SpectrumDisplayForm::customEvent( QEvent * e)
     waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value());
     waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value());
 
-    // If the video card doesn't support OpenGL then don't display the 3D Waterfall
-    if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-      waterfall3DMinimumIntensityChangedCB(Waterfall3DMinimumIntensityWheel->value());
-      waterfall3DMaximumIntensityChangedCB(Waterfall3DMaximumIntensityWheel->value());
-      
-      // Check for Hardware Acceleration of the OpenGL
-      /*
-      if(!_waterfall3DDisplayPlot->format().directRendering()){
-       // Only ask this once while the program is running...
-       if(_openGLWaterfall3DFlag == -1){
-         _openGLWaterfall3DFlag = 0;
-         if(QMessageBox::warning(this, "OpenGL Direct Rendering NOT Supported", "<center>The system's video card hardware or current drivers do not support direct hardware rendering of the OpenGL modules.</center><br><center>Software rendering is VERY processor intensive.</center><br><center>Do you want to use software rendering?</center>", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape) == QMessageBox::Yes){
-           _openGLWaterfall3DFlag = 1;
-         }
-       }
-      }
-      else{
-       _openGLWaterfall3DFlag = 1;
-      }
-      */
-    }
-    
-    if(_openGLWaterfall3DFlag != 1){
-      ToggleTabWaterfall3D(false);
-    }
-
     // Clear any previous display
     Reset();
   }
@@ -347,8 +293,6 @@ SpectrumDisplayForm::UpdateGuiTimer()
   // all of the plots.
   _frequencyDisplayPlot->canvas()->update();
   _waterfallDisplayPlot->canvas()->update();
-  //if((QGLFormat::hasOpenGL()) && (_useOpenGL))
-  //_waterfall3DDisplayPlot->canvas()->update();
   _timeDomainDisplayPlot->canvas()->update();
   _constellationDisplayPlot->canvas()->update();
 }
@@ -437,15 +381,6 @@ SpectrumDisplayForm::SetFrequencyRange(const double newCenterFrequency,
                                             _centerFrequency,
                                             UseRFFrequenciesCheckBox->isChecked(),
                                             units, strunits[iunit]);
-    if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-      /*
-      _waterfall3DDisplayPlot->SetFrequencyRange(_startFrequency,
-                                                _stopFrequency,
-                                                _centerFrequency,
-                                                UseRFFrequenciesCheckBox->isChecked(),
-                                                units, strunits[iunit]);
-      */
-    }
     _timeDomainDisplayPlot->SetSampleRate(_stopFrequency - _startFrequency,
                                          units, strtime[iunit]);
   }
@@ -536,9 +471,6 @@ SpectrumDisplayForm::Reset()
   AverageDataReset();
 
   _waterfallDisplayPlot->Reset();
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    //_waterfall3DDisplayPlot->Reset();
-  }
 }
 
 
@@ -613,44 +545,6 @@ SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue )
                                           WaterfallMaximumIntensityWheel->value());
 }
 
-void
-SpectrumDisplayForm::waterfall3DMaximumIntensityChangedCB( double newValue )
-{
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    if(newValue > Waterfall3DMinimumIntensityWheel->value()){
-      Waterfall3DMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
-    }
-    else{
-      Waterfall3DMaximumIntensityWheel->setValue(Waterfall3DMinimumIntensityWheel->value());
-    }
-
-    /*
-    _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(),
-                                              Waterfall3DMaximumIntensityWheel->value());
-    */
-  }
-}
-
-
-void
-SpectrumDisplayForm::waterfall3DMinimumIntensityChangedCB( double newValue )
-{
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    if(newValue < Waterfall3DMaximumIntensityWheel->value()){
-      Waterfall3DMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0));
-    }
-    else{
-      Waterfall3DMinimumIntensityWheel->setValue(Waterfall3DMaximumIntensityWheel->value());
-    }
-
-    /*
-    _waterfall3DDisplayPlot->SetIntensityRange(Waterfall3DMinimumIntensityWheel->value(),
-                                              Waterfall3DMaximumIntensityWheel->value());
-    */
-  }
-}
-
-
 void
 SpectrumDisplayForm::FFTComboBoxSelectedCB( const QString &fftSizeString )
 {
@@ -676,24 +570,6 @@ SpectrumDisplayForm::WaterfallAutoScaleBtnCB()
   waterfallMaximumIntensityChangedCB(maximumIntensity);
 }
 
-void
-SpectrumDisplayForm::Waterfall3DAutoScaleBtnCB()
-{
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    double minimumIntensity = _noiseFloorAmplitude - 5;
-    if(minimumIntensity < Waterfall3DMinimumIntensityWheel->minValue()){
-      minimumIntensity = Waterfall3DMinimumIntensityWheel->minValue();
-    }
-    Waterfall3DMinimumIntensityWheel->setValue(minimumIntensity);
-    double maximumIntensity = _peakAmplitude + 10;
-    if(maximumIntensity > Waterfall3DMaximumIntensityWheel->maxValue()){
-      maximumIntensity = Waterfall3DMaximumIntensityWheel->maxValue();
-    }
-    Waterfall3DMaximumIntensityWheel->setValue(maximumIntensity);
-    waterfallMaximumIntensityChangedCB(maximumIntensity);
-  }
-}
-
 void
 SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType )
 {
@@ -720,37 +596,6 @@ SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType )
   _waterfallDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor);
 }
 
-void
-SpectrumDisplayForm::Waterfall3DIntensityColorTypeChanged( int newType )
-{
-  if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-    QColor lowIntensityColor;
-    QColor highIntensityColor;
-    if(newType == Waterfall3DDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){
-      // Select the Low Intensity Color
-      lowIntensityColor = _waterfallDisplayPlot->GetUserDefinedLowIntensityColor();
-      if(!lowIntensityColor.isValid()){
-       lowIntensityColor = Qt::black;
-      }
-      QMessageBox::information(this, "Low Intensity Color Selection", "In the next window, select the low intensity color for the waterfall display",  QMessageBox::Ok);
-      lowIntensityColor = QColorDialog::getColor(lowIntensityColor, this);
-      
-      // Select the High Intensity Color
-      highIntensityColor = _waterfallDisplayPlot->GetUserDefinedHighIntensityColor();
-      if(!highIntensityColor.isValid()){
-       highIntensityColor = Qt::white;
-      }
-      QMessageBox::information(this, "High Intensity Color Selection", "In the next window, select the high intensity color for the waterfall display",  QMessageBox::Ok);
-      highIntensityColor = QColorDialog::getColor(highIntensityColor, this);
-    }
-    /*
-    _waterfall3DDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor,
-                                                     highIntensityColor);
-    */
-  }
-}
-
-
 void
 SpectrumDisplayForm::ToggleTabFrequency(const bool state)
 {
@@ -781,28 +626,6 @@ SpectrumDisplayForm::ToggleTabWaterfall(const bool state)
   }
 }
 
-void
-SpectrumDisplayForm::ToggleTabWaterfall3D(const bool state)
-{
-  if(state == true) {
-    /*
-    if((QGLFormat::hasOpenGL()) && (_useOpenGL)) {
-      if(d_plot_waterfall3d == -1) {
-       SpectrumTypeTab->addTab(Waterfall3DPage, "3D Waterfall Display");
-       d_plot_waterfall3d = SpectrumTypeTab->count()-1;
-      }
-    }
-    */
-    SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(Waterfall3DPage));
-    d_plot_waterfall3d = -1;
-    fprintf(stderr, "\nWARNING: The Waterfall3D plot has been disabled until we get it working.\n\n");
-  }
-  else {
-    SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(Waterfall3DPage));
-    d_plot_waterfall3d = -1;
-  }
-}
-
 void
 SpectrumDisplayForm::ToggleTabTime(const bool state)
 {
index bf2af703354439780aaa8f426b1eb22b6108a9cf..fbd08349bf8ee436f0ff8006b0fd5d1e6a58d1d9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SPECTRUM_DISPLAY_FORM_H
 #define SPECTRUM_DISPLAY_FORM_H
 
-#include "spectrumdisplayform_ui.h"
+#include "spectrumdisplayform.ui.h"
 
 class SpectrumGUIClass;
 #include <SpectrumGUIClass.h>
@@ -9,7 +9,6 @@ class SpectrumGUIClass;
 #include <SpectrumGUIClass.h>
 #include <FrequencyDisplayPlot.h>
 #include <WaterfallDisplayPlot.h>
-#include <Waterfall3DDisplayPlot.h>
 #include <TimeDomainDisplayPlot.h>
 #include <ConstellationDisplayPlot.h>
 #include <QValidator>
@@ -54,15 +53,10 @@ public slots:
   void waterfallMinimumIntensityChangedCB(double);
   void WaterfallIntensityColorTypeChanged(int);
   void WaterfallAutoScaleBtnCB();
-  void waterfall3DMaximumIntensityChangedCB(double);
-  void waterfall3DMinimumIntensityChangedCB(double);
-  void Waterfall3DIntensityColorTypeChanged(int);
-  void Waterfall3DAutoScaleBtnCB();
   void FFTComboBoxSelectedCB(const QString&);
 
   void ToggleTabFrequency(const bool state);
   void ToggleTabWaterfall(const bool state);
-  void ToggleTabWaterfall3D(const bool state);
   void ToggleTabTime(const bool state);
   void ToggleTabConstellation(const bool state);
 
@@ -92,7 +86,6 @@ private:
   QIntValidator* _intValidator;
   FrequencyDisplayPlot* _frequencyDisplayPlot;
   WaterfallDisplayPlot* _waterfallDisplayPlot;
-  Waterfall3DDisplayPlot* _waterfall3DDisplayPlot;
   TimeDomainDisplayPlot* _timeDomainDisplayPlot;
   ConstellationDisplayPlot* _constellationDisplayPlot;
   SpectrumGUIClass* _system;
index 0e652d8337d78b90a31f95c1c777a63df9455367..5a23bc8a9f17568a27f2a6d25c70fb1c366630b3 100644 (file)
        </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="Waterfall3DPage">
-      <attribute name="title">
-       <string>3D Waterfall Display</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_6">
-       <item row="0" column="0">
-        <widget class="QLabel" name="textLabel1_2">
-         <property name="minimumSize">
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>100</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Intensity Display:</string>
-         </property>
-         <property name="wordWrap">
-          <bool>false</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1">
-        <widget class="QComboBox" name="Waterfall3DIntensityComboBox">
-         <property name="maximumSize">
-          <size>
-           <width>100</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <item>
-          <property name="text">
-           <string>Color</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>White Hot</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Black Hot</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Incandescent</string>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>User Defined</string>
-          </property>
-         </item>
-        </widget>
-       </item>
-       <item row="0" column="2">
-        <widget class="QwtWheel" name="Waterfall3DMaximumIntensityWheel">
-         <property name="minimumSize">
-          <size>
-           <width>200</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="mouseTracking">
-          <bool>true</bool>
-         </property>
-         <property name="focusPolicy">
-          <enum>Qt::WheelFocus</enum>
-         </property>
-         <property name="valid">
-          <bool>true</bool>
-         </property>
-         <property name="totalAngle">
-          <double>200.000000000000000</double>
-         </property>
-         <property name="viewAngle">
-          <double>20.000000000000000</double>
-         </property>
-         <property name="mass">
-          <double>0.000000000000000</double>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="3">
-        <widget class="QLabel" name="Waterfall3DMaximumIntensityLabel">
-         <property name="maximumSize">
-          <size>
-           <width>100</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>100 dB</string>
-         </property>
-         <property name="wordWrap">
-          <bool>false</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0" colspan="4">
-        <widget class="QFrame" name="Waterfall3DPlotDisplayFrame">
-         <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0" colspan="2">
-        <widget class="QPushButton" name="Waterfall3DAutoScaleBtn">
-         <property name="minimumSize">
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>80</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="sizeIncrement">
-          <size>
-           <width>0</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="toolTip">
-          <string>Scales the Intensity to the current data extremes.</string>
-         </property>
-         <property name="text">
-          <string>Auto Scale</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="2">
-        <widget class="QwtWheel" name="Waterfall3DMinimumIntensityWheel">
-         <property name="minimumSize">
-          <size>
-           <width>200</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="valid">
-          <bool>true</bool>
-         </property>
-         <property name="totalAngle">
-          <double>200.000000000000000</double>
-         </property>
-         <property name="viewAngle">
-          <double>20.000000000000000</double>
-         </property>
-         <property name="mass">
-          <double>0.000000000000000</double>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="3">
-        <widget class="QLabel" name="Waterfall3DMinimumIntensityLabel">
-         <property name="maximumSize">
-          <size>
-           <width>100</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>-100 dB</string>
-         </property>
-         <property name="wordWrap">
-          <bool>false</bool>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
      <widget class="QWidget" name="TimeDomainPage">
       <attribute name="title">
        <string>Time Domain Display</string>
   <include location="global">SpectrumGUIClass.h</include>
   <include location="global">FrequencyDisplayPlot.h</include>
   <include location="global">WaterfallDisplayPlot.h</include>
-  <include location="global">Waterfall3DDisplayPlot.h</include>
   <include location="global">TimeDomainDisplayPlot.h</include>
   <include location="global">qvalidator.h</include>
   <include location="global">vector</include>
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>Waterfall3DMaximumIntensityWheel</sender>
-   <signal>valueChanged(double)</signal>
-   <receiver>SpectrumDisplayForm</receiver>
-   <slot>waterfall3DMaximumIntensityChangedCB(double)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>217</x>
-     <y>44</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>Waterfall3DMinimumIntensityWheel</sender>
-   <signal>valueChanged(double)</signal>
-   <receiver>SpectrumDisplayForm</receiver>
-   <slot>waterfall3DMinimumIntensityChangedCB(double)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>217</x>
-     <y>349</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
   <connection>
    <sender>FFTSizeComboBox</sender>
    <signal>activated(QString)</signal>
index 0cbef4ec37d4245e8a951a23b7e1aefc801cbe60..1ba153f0d2cc3cca374ee6f51d21e8208fbeff9c 100644 (file)
@@ -3,11 +3,13 @@
 
 #include <waterfallGlobalData.h>
 
-#include <Waterfall3DDisplayPlot.h>
-
-WaterfallData::WaterfallData(const double minimumFrequency, const double maximumFrequency, const uint64_t fftPoints, const unsigned int historyExtent):
-  QwtRasterData(QwtDoubleRect(minimumFrequency /* X START */,  0 /* Y START */, maximumFrequency - minimumFrequency /* WIDTH */,  static_cast<double>(historyExtent)/* HEIGHT */))
-
+WaterfallData::WaterfallData(const double minimumFrequency,
+                            const double maximumFrequency,
+                            const uint64_t fftPoints,
+                            const unsigned int historyExtent)
+  : QwtRasterData(QwtDoubleRect(minimumFrequency /* X START */,  0 /* Y START */, 
+                               maximumFrequency - minimumFrequency /* WIDTH */,  
+                               static_cast<double>(historyExtent)/* HEIGHT */))
 {
   _intensityRange = QwtDoubleInterval(-200.0, 0.0);
   
@@ -19,17 +21,20 @@ WaterfallData::WaterfallData(const double minimumFrequency, const double maximum
   Reset();
 }
 
-WaterfallData::~WaterfallData(){
+WaterfallData::~WaterfallData()
+{
   delete[] _spectrumData;
 }
 
-void WaterfallData::Reset(){
+void WaterfallData::Reset()
+{
   memset(_spectrumData, 0x0, _fftPoints*_historyLength*sizeof(double));
 
   _numLinesToUpdate = -1;
 }
 
-void WaterfallData::Copy(const WaterfallData* rhs){
+void WaterfallData::Copy(const WaterfallData* rhs)
+{
   if((_fftPoints != rhs->GetNumFFTPoints()) ||
      (boundingRect() != rhs->boundingRect()) ){
     _fftPoints = rhs->GetNumFFTPoints();
@@ -43,7 +48,10 @@ void WaterfallData::Copy(const WaterfallData* rhs){
   setRange(rhs->range());
 }
 
-void WaterfallData::ResizeData(const double startFreq, const double stopFreq, const uint64_t fftPoints){
+void WaterfallData::ResizeData(const double startFreq,
+                              const double stopFreq,
+                              const uint64_t fftPoints)
+{
   if((fftPoints != GetNumFFTPoints()) ||
      (boundingRect().width() != (stopFreq - startFreq)) ||
      (boundingRect().left() != startFreq)){
@@ -57,21 +65,27 @@ void WaterfallData::ResizeData(const double startFreq, const double stopFreq, co
   Reset();
 }
 
-QwtRasterData *WaterfallData::copy() const{
-  WaterfallData* returnData =  new WaterfallData(boundingRect().left(), boundingRect().right(), _fftPoints, _historyLength);
+QwtRasterData *WaterfallData::copy() const
+{
+  WaterfallData* returnData =  new WaterfallData(boundingRect().left(),
+                                                boundingRect().right(),
+                                                _fftPoints, _historyLength);
   returnData->Copy(this);
   return returnData;
 }
 
-QwtDoubleInterval WaterfallData::range() const{
+QwtDoubleInterval WaterfallData::range() const
+{
   return _intensityRange;
 }
 
-void WaterfallData::setRange(const QwtDoubleInterval& newRange){
+void WaterfallData::setRange(const QwtDoubleInterval& newRange)
+{
   _intensityRange = newRange;
 }
 
-double WaterfallData::value(double x, double y) const{
+double WaterfallData::value(double x, double y) const
+{
   double returnValue = 0.0;
 
   const unsigned int intY = static_cast<unsigned int>((1.0 - (y/boundingRect().height())) * 
@@ -87,11 +101,14 @@ double WaterfallData::value(double x, double y) const{
   return returnValue;
 }
 
-uint64_t WaterfallData::GetNumFFTPoints()const{
+uint64_t WaterfallData::GetNumFFTPoints() const
+{
   return _fftPoints;
 }
 
-void WaterfallData::addFFTData(const double* fftData, const uint64_t fftDataSize, const int droppedFrames){
+void WaterfallData::addFFTData(const double* fftData,
+                              const uint64_t fftDataSize,
+                              const int droppedFrames){
   if(fftDataSize == _fftPoints){
     int64_t heightOffset = _historyLength - 1 - droppedFrames;
     uint64_t drawingDroppedFrames = droppedFrames;
@@ -104,155 +121,44 @@ void WaterfallData::addFFTData(const double* fftData, const uint64_t fftDataSize
     
     // Copy the old data over if any available
     if(heightOffset > 0){
-      memmove( _spectrumData, &_spectrumData[(drawingDroppedFrames+1) * _fftPoints], heightOffset * _fftPoints * sizeof(double)) ;
+      memmove( _spectrumData, &_spectrumData[(drawingDroppedFrames+1) * _fftPoints],
+              heightOffset * _fftPoints * sizeof(double)) ;
     }
 
     if(drawingDroppedFrames > 0){
       // Fill in zeros data for dropped data
-      memset(&_spectrumData[heightOffset * _fftPoints], 0x00, static_cast<int64_t>(drawingDroppedFrames) * _fftPoints * sizeof(double));
+      memset(&_spectrumData[heightOffset * _fftPoints], 0x00,
+            static_cast<int64_t>(drawingDroppedFrames) * _fftPoints * sizeof(double));
     }
 
     // add the new buffer
     memcpy(&_spectrumData[(_historyLength - 1) * _fftPoints], fftData, _fftPoints*sizeof(double));
-
   }
 }
 
-double* WaterfallData::GetSpectrumDataBuffer()const{
+double* WaterfallData::GetSpectrumDataBuffer() const
+{
   return _spectrumData;
 }
 
-void WaterfallData::SetSpectrumDataBuffer(const double* newData){
+void WaterfallData::SetSpectrumDataBuffer(const double* newData)
+{
   memcpy(_spectrumData, newData, _fftPoints * _historyLength * sizeof(double));
 }
 
-int WaterfallData::GetNumLinesToUpdate()const{
+int WaterfallData::GetNumLinesToUpdate() const
+{
   return _numLinesToUpdate;
 }
 
-void WaterfallData::SetNumLinesToUpdate(const int newNum){
+void WaterfallData::SetNumLinesToUpdate(const int newNum)
+{
   _numLinesToUpdate = newNum;
 }
 
-void WaterfallData::IncrementNumLinesToUpdate(){
-  _numLinesToUpdate++;
-}
-
-Waterfall3DData::Waterfall3DData(const double minimumFrequency, const double maximumFrequency, const uint64_t fftPoints, const unsigned int historyExtent):
-  WaterfallData(minimumFrequency,  maximumFrequency, fftPoints, historyExtent), Qwt3D::Function(){
-
-  _floorValue = 0.0;
-  setMinZ(0.0);
-  setMaxZ(200.0);
-
-  // Create the dummy mesh data until _ResizeMesh is called
-  data = new double*[1];
-  data[0] = new double[1];
-  Qwt3D::Function::setMesh(1,1);
-
-  _ResizeMesh();
-}
-
-Waterfall3DData::~Waterfall3DData(){
-  for ( unsigned i = 0; i < umesh_p; i++){
-    delete[] data[i];
-  }
-  delete[] data;
-
-}
-
-void Waterfall3DData::ResizeData(const double startFreq, const double stopFreq, const uint64_t fftPoints){
-  if((fftPoints != GetNumFFTPoints()) ||
-     (boundingRect().width() != (stopFreq - startFreq)) ||
-     (boundingRect().left() != startFreq)){
-    WaterfallData::ResizeData(startFreq, stopFreq, fftPoints);
-    _ResizeMesh();
-  }
-   
-  Reset();
-}
-
-bool Waterfall3DData::create()
+void WaterfallData::IncrementNumLinesToUpdate()
 {
-  if ((umesh_p<=2) || (vmesh_p<=2) || !plotwidget_p)
-    return false;
-
-  // Almost the same as the old create, except that here we store our own data buffer in the class rather than re-creating it each time...
-
-  unsigned i,j;
-
-  /* get the data */
-  double dx = (maxu_p - minu_p) / (umesh_p - 1);
-  double dy = (maxv_p - minv_p) / (vmesh_p - 1);
-  
-  for (i = 0; i < umesh_p; ++i) 
-    {
-      for (j = 0; j < vmesh_p; ++j) 
-       {
-         data[i][j] = operator()(minu_p + i*dx, minv_p + j*dy);
-         
-         if (data[i][j] > range_p.maxVertex.z)
-           data[i][j] = range_p.maxVertex.z;
-         else if (data[i][j] < range_p.minVertex.z)
-           data[i][j] = range_p.minVertex.z;
-       }
-    }
-  
-  Q_ASSERT(plotwidget_p);
-  if (!plotwidget_p)
-    {
-      fprintf(stderr,"Function: no valid Plot3D Widget assigned");
-    }
-  else
-    {
-      ((Waterfall3DDisplayPlot*)plotwidget_p)->loadFromData(data, umesh_p, vmesh_p, minu_p, maxu_p, minv_p, maxv_p);
-    }
-  
-  return true;
-}
-
-double Waterfall3DData::operator()(double x, double y){
-  return value(x,y) - _floorValue;
-}
-
-double Waterfall3DData::GetFloorValue()const{
-  return _floorValue;
-}
-
-void Waterfall3DData::SetFloorValue(const double newValue){
-  _floorValue = newValue;
-}
-
-double Waterfall3DData::minZ()const{
-  return range_p.minVertex.z;
-}
-
-double Waterfall3DData::maxZ()const{
-  return range_p.maxVertex.z;
-}
-
-void Waterfall3DData::setMesh(unsigned int, unsigned int){
-  // Do Nothing
-  printf("Should Not Reach this Function\n");
-}
-
-void Waterfall3DData::_ResizeMesh(){
-  // Clear out the old mesh
-  for ( unsigned i = 0; i < umesh_p; i++){
-    delete[] data[i];
-  }
-  delete[] data;
-  
-  Qwt3D::Function::setMesh(static_cast<int>(boundingRect().width()/20.0), _historyLength);
-  setDomain( boundingRect().left(), static_cast<int>(boundingRect().right()), 0, _historyLength);
-
-  /* allocate some space for the mesh */
-  unsigned i;
-  data         = new double* [umesh_p] ;
-  for ( i = 0; i < umesh_p; i++) 
-    {
-      data[i]         = new double [vmesh_p];
-    }
+  _numLinesToUpdate++;
 }
 
 #endif /* WATERFALL_GLOBAL_DATA_CPP */
index 247e0ae91a5b733157a3cdfd844c9c8bfee9365e..51f65064c88f8e4d08af083542516421222037e7 100644 (file)
@@ -2,10 +2,8 @@
 #define WATERFALL_GLOBAL_DATA_HPP
 
 #include <qwt_raster_data.h>
-#include <qwt3d_function.h>
 #include <inttypes.h>
 
-class Waterfall3DDisplayPlot;
 
 class WaterfallData: public QwtRasterData
 {
@@ -46,34 +44,4 @@ private:
 
 };
 
-class Waterfall3DData: public WaterfallData, public Qwt3D::Function
-{
-public:
-  Waterfall3DData(const double, const double, const uint64_t, const unsigned int);
-  virtual ~Waterfall3DData();
-    
-  virtual void ResizeData(const double, const double, const uint64_t);
-
-  virtual bool create();
-  virtual void setMesh(unsigned int columns, unsigned int rows); //!< Sets number of rows and columns. 
-
-  virtual double operator()(double x, double y);
-
-  virtual double GetFloorValue()const;
-  virtual void SetFloorValue(const double);
-
-  virtual double minZ()const;
-  virtual double maxZ()const;
-
-protected:
-  void _ResizeMesh();
-
-  double** data;
-  double _floorValue;
-
-private:
-
-};
-
-
 #endif /* WATERFALL_GLOBAL_DATA_HPP */
index 1c44e23adaeb8445091c5dfedfcabeb0a92099c1..2cb0f42beae5c4a1dbed947b24ffe7eccf455fba 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2006 Free Software Foundation, Inc.
+# Copyright 2004,2006,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import ra
 
-class qa_ra (gr_unittest.TestCase):
+class test_radio_astronomy (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -35,4 +35,4 @@ class qa_ra (gr_unittest.TestCase):
         pass
         
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_radio_astronomy, "test_radio_astronomy.xml")
index c65b134562a8e17edd7671cf62a40129ec792ca6..5950b56b9d2ae612fad5597e66bf4e3d1707eab0 100644 (file)
@@ -86,16 +86,30 @@ fsm::fsm(const char *name)
   if((fsmfile=fopen(name,"r"))==NULL) 
     throw std::runtime_error ("fsm::fsm(const char *name): file open error\n");
     //printf("file open error in fsm()\n");
+
+  if(fscanf(fsmfile,"%d %d %d\n",&d_I,&d_S,&d_O) == EOF) {
+    if(ferror(fsmfile) != 0)
+      throw std::runtime_error ("fsm::fsm(const char *name): file read error\n");
+  }
   
-  fscanf(fsmfile,"%d %d %d\n",&d_I,&d_S,&d_O);
   d_NS.resize(d_I*d_S);
   d_OS.resize(d_I*d_S);
 
   for(int i=0;i<d_S;i++) {
-    for(int j=0;j<d_I;j++) fscanf(fsmfile,"%d",&(d_NS[i*d_I+j]));
+    for(int j=0;j<d_I;j++) {
+      if(fscanf(fsmfile,"%d",&(d_NS[i*d_I+j])) == EOF) {
+       if(ferror(fsmfile) != 0)
+         throw std::runtime_error ("fsm::fsm(const char *name): file read error\n");
+      }
+    }
   }
   for(int i=0;i<d_S;i++) {
-    for(int j=0;j<d_I;j++) fscanf(fsmfile,"%d",&(d_OS[i*d_I+j]));
+    for(int j=0;j<d_I;j++) {
+      if(fscanf(fsmfile,"%d",&(d_OS[i*d_I+j])) == EOF) {
+       if(ferror(fsmfile) != 0)
+         throw std::runtime_error ("fsm::fsm(const char *name): file read error\n");
+      }
+    }
   }
  
   generate_PS_PI();
index 077416f808715506ae5309ae8ad11a92f5463ef3..ff15eeadc8a974c03577acf170e5dbe79ff8a341 100644 (file)
@@ -75,11 +75,20 @@ interleaver::interleaver(const char *name)
     throw std::runtime_error ("file open error in interleaver()");
     //printf("file open error in interleaver()\n");
   
-  fscanf(interleaverfile,"%d\n",&d_K);
+  if(fscanf(interleaverfile,"%d\n",&d_K) == EOF) {
+    if(ferror(interleaverfile) != 0)
+      throw std::runtime_error ("interleaver::interleaver(const char *name): file read error\n");
+  }
+
   d_INTER.resize(d_K);
   d_DEINTER.resize(d_K);
 
-  for(int i=0;i<d_K;i++) fscanf(interleaverfile,"%d",&(d_INTER[i]));
+  for(int i=0;i<d_K;i++) {
+    if(fscanf(interleaverfile,"%d",&(d_INTER[i])) == EOF) {
+      if(ferror(interleaverfile) != 0)
+       throw std::runtime_error ("interleaver::interleaver(const char *name): file read error\n");
+    }
+  }
   
   // generate DEINTER table
   for(int i=0;i<d_K;i++) {
index 1985fa46a69ba618cfa1d5b2f889c90c7accc367..698a0b307dc9399ade46b1922279cfb61faa6260 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -33,7 +33,7 @@
 @SPTR_NAME@ 
 trellis_make_@BASE_NAME@ (const fsm &FSM, int ST)
 {
-  return @SPTR_NAME@ (new @NAME@ (FSM,ST));
+  return gnuradio::get_initial_sptr (new @NAME@ (FSM,ST));
 }
 
 @NAME@::@NAME@ (const fsm &FSM, int ST)
index bced13c0cf58ec7b88392c2bc0f7884f815d964d..4bdaabc22cab7bd4ac6fbce55a579758d6a8b297 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,7 +36,7 @@
 @SPTR_NAME@
 trellis_make_@BASE_NAME@ (int O, int D,  const std::vector<@I_TYPE@> &TABLE, trellis_metric_type_t TYPE)
 {
-  return @SPTR_NAME@ (new @NAME@ (O,D,TABLE,TYPE));
+  return gnuradio::get_initial_sptr (new @NAME@ (O,D,TABLE,TYPE));
 }
 
 
index c80d820cd18d187ff7bdc2f763a1bc4c75642dad..a32390742bcb86aedcab25d7199c2f6bb6376e00 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -32,7 +32,7 @@
 trellis_permutation_sptr 
 trellis_make_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t NBYTES_INOUT)
 {
-  return trellis_permutation_sptr (new trellis_permutation (K,TABLE,SYMS_PER_BLOCK,NBYTES_INOUT));
+  return gnuradio::get_initial_sptr(new trellis_permutation (K,TABLE,SYMS_PER_BLOCK,NBYTES_INOUT));
 }
 
 trellis_permutation::trellis_permutation (int K, const std::vector<int> &TABLE, int SYMS_PER_BLOCK, size_t NBYTES_INOUT)
index c8181d109695a442dc3f59394da53ed5e16232a0..708608b16a9b22b35a7a79e2fbdd11ef80952e84 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -45,7 +45,7 @@ trellis_make_siso_combined_f (
     const std::vector<float> &TABLE,
     trellis_metric_type_t TYPE)
 {
-  return trellis_siso_combined_f_sptr (new trellis_siso_combined_f (FSM,K,S0,SK,POSTI,POSTO,SISO_TYPE,D,TABLE,TYPE));
+  return gnuradio::get_initial_sptr(new trellis_siso_combined_f (FSM,K,S0,SK,POSTI,POSTO,SISO_TYPE,D,TABLE,TYPE));
 }
 
 trellis_siso_combined_f::trellis_siso_combined_f (
index ed9ebed61d108580191aed7ee33b5e6dea3ef4a6..c8fa8231dc6bfd5574cba31d0417a8b31c4bfc78 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -42,7 +42,7 @@ trellis_make_siso_f (
     bool POSTO,
     trellis_siso_type_t SISO_TYPE)
 {
-  return trellis_siso_f_sptr (new trellis_siso_f (FSM,K,S0,SK,POSTI,POSTO,SISO_TYPE));
+  return gnuradio::get_initial_sptr(new trellis_siso_f (FSM,K,S0,SK,POSTI,POSTO,SISO_TYPE));
 }
 
 trellis_siso_f::trellis_siso_f (
index d2ecfacff422be24acaf41fa71e3ec461c6eba27..178215362832c0ff0af1e374291bf5fb3c27fd57 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ trellis_make_@BASE_NAME@ (
     int S0,
     int SK)
 {
-  return @SPTR_NAME@ (new @NAME@ (FSM,K,S0,SK));
+  return gnuradio::get_initial_sptr (new @NAME@ (FSM,K,S0,SK));
 }
 
 @NAME@::@NAME@ (
index e343a4965a3fec1dcd6d661096f8b017c4e21adf..d365de75fcf2cf4d15df6ef6fd5d591d1dc8b88f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -43,7 +43,7 @@ trellis_make_@BASE_NAME@ (
     const std::vector<@I_TYPE@> &TABLE,
     trellis_metric_type_t TYPE)
 {
-  return @SPTR_NAME@ (new @NAME@ (FSM,K,S0,SK,D,TABLE,TYPE));
+  return gnuradio::get_initial_sptr (new @NAME@ (FSM,K,S0,SK,D,TABLE,TYPE));
 }
 
 @NAME@::@NAME@ (
index 306bf994df2259fa87811f4f87d1f2245e9a4c5f..cfeefea061371700dd587d50d703dd20273bbef2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import trellis
 
-class qa_trellis (gr_unittest.TestCase):
+class test_trellis (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -68,11 +68,5 @@ class qa_trellis (gr_unittest.TestCase):
         i = trellis.interleaver(K,IN)
         self.assertEqual((K,IN,DIN),(i.K(),i.INTER(),i.DEINTER()))
 
-
-
-
-
-
-
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_trellis, "test_trellis.xml")
index 92938061f6e1062ecdd876431d6ef303c0a1ce01..0f3a21bb4ed68e875a6a0aa3ed5df0c08cedc6c7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 include $(top_srcdir)/Makefile.common
 
 # For compiling within the GNU Radio build tree
-AM_CPPFLAGS=$(STD_DEFINES_AND_INCLUDES) \
-        -I$(top_srcdir)/gr-usrp/src \
-        $(USRP_INCLUDES) \
-        $(WITH_INCLUDES)
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/gr-usrp/src \
+       $(USRP_INCLUDES) \
+       $(STD_DEFINES_AND_INCLUDES) \
+       $(WITH_INCLUDES)
 
 GR_USRP_LA=$(top_builddir)/gr-usrp/src/libgnuradio-usrp.la
 
 # For compiling outside the tree, these will get fished out by pkgconfig
 
 LDADD = \
+       $(GR_USRP_LA) \
        $(BOOST_LDFLAGS) \
-       $(BOOST_PROGRAM_OPTIONS_LIB) \
-       $(GR_USRP_LA)
+       $(BOOST_PROGRAM_OPTIONS_LIB)
 
 noinst_PROGRAMS = \
        usrp_rx_cfile \
index 572a22485b89d7b8863bf215c8668f568c76b433..db5be4adedec59da85395fb6c32cb3cf3ab094c2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005,2006,2008,2009 Free Software Foundation, Inc.
+# Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -34,9 +34,9 @@ noinst_PYTHON =       qa_usrp.py
 # The straight C++ library
 
 AM_CPPFLAGS = \
+       $(USRP_INCLUDES) \
        $(STD_DEFINES_AND_INCLUDES) \
        $(PYTHON_CPPFLAGS) \
-       $(USRP_INCLUDES) \
        $(USB_INCLUDES) \
        $(WITH_INCLUDES)
 
index db2d32624ab0dcef8878438641aa246dcdf98b1e..06e630330aaf4feeeae139d54288620e69289d33 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import usrp_swig
 
-class qa_usrp (gr_unittest.TestCase):
+class test_usrp (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -37,4 +37,4 @@ class qa_usrp (gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_usrp, "test_usrp.xml")
index 40750b477d23360dd26b56138b36c649d30a7bad..7054158d8ab93dd1826f093482a8b92c9904a1ad 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ usrp_make_sink_c (int which_board,
                   const std::string firmware_filename
                   ) throw (std::runtime_error)
 {
-  return usrp_sink_c_sptr (new usrp_sink_c (which_board,
+  return gnuradio::get_initial_sptr(new usrp_sink_c (which_board,
                                              interp_rate,
                                              nchan,
                                              mux,
index 1f51da24db293c9918489938159e3e096c658bd6..1ffaeed963cd6fb4a4958e99ff10dcf0cc80e010 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -40,7 +40,7 @@ usrp_make_sink_s (int which_board,
                   const std::string firmware_filename
                   ) throw (std::runtime_error)
 {
-  return usrp_sink_s_sptr (new usrp_sink_s (which_board,
+  return gnuradio::get_initial_sptr(new usrp_sink_s (which_board,
                                              interp_rate,
                                              nchan,
                                              mux,
index 26d95dc1b36c1a5a9611bc9158b0ac9854b1d6bb..9055f3ee7692e4b1a79f802e2fbafd1ebcb30985 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -43,7 +43,7 @@ usrp_make_source_c (int which_board,
                     const std::string firmware_filename
                     ) throw (std::runtime_error)
 {
-  return usrp_source_c_sptr (new usrp_source_c (which_board,
+  return gnuradio::get_initial_sptr(new usrp_source_c (which_board,
                                                  decim_rate,
                                                  nchan,
                                                  mux,
index 88b8495d3679512f165491146c6b5055850ec10d..8e1c2f188bd4c439c84ecb0cd516dc6b52a50678 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -43,7 +43,7 @@ usrp_make_source_s (int which_board,
                     const std::string firmware_filename
                     ) throw (std::runtime_error)
 {
-  return usrp_source_s_sptr (new usrp_source_s (which_board,
+  return gnuradio::get_initial_sptr(new usrp_source_s (which_board,
                                                  decim_rate, 
                                                  nchan,
                                                  mux,
index 03b6d0dd9d15c0747c1ef32201efe66aca95031a..0d55d73ba6468c6ba5fc39955022984c04867b2c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005,2006,2008,2009 Free Software Foundation, Inc.
+# Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -42,10 +42,10 @@ DISTCLEANFILES = run_tests
 # libgr-usrp.so
 # ----------------------------------------------------------------------
 AM_CPPFLAGS = \
-       $(STD_DEFINES_AND_INCLUDES)  \
        $(GRUEL_INCLUDES) \
-       $(PYTHON_CPPFLAGS) \
        $(USRP2_INCLUDES) \
+       $(STD_DEFINES_AND_INCLUDES)  \
+       $(PYTHON_CPPFLAGS) \
        $(WITH_INCLUDES)
 
 lib_LTLIBRARIES = libgnuradio-usrp2.la
index bc6664a1ba42f72746c035e76e943812ca6625de..cc994b1e9dbcefe2aa3f92930891e0a38ebc4d43 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2008 Free Software Foundation, Inc.
+# Copyright 2005,2008,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import usrp2
 
-class qa_usrp2(gr_unittest.TestCase):
+class test_usrp2(gr_unittest.TestCase):
 
     def setUp(self):
         self.tb = gr.top_block()
@@ -37,4 +37,4 @@ class qa_usrp2(gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_usrp2, "test_usrp2.xml")
index d1fa091f73f6d8c69e5409dfe688899be207683e..2a79fad44b8f5831a4dee3e96b97b2740254000b 100644 (file)
@@ -32,6 +32,7 @@
 
 %include <usrp2/tune_result.h>
 %include <usrp2/mimo_config.h>
+%include <usrp2/metadata.h>
 
 %template(uint32_t_vector) std::vector<uint32_t>;
 
@@ -163,6 +164,7 @@ public:
   bool write_gpio(uint16_t value, uint16_t mask);
   %rename(_real_read_gpio) read_gpio;
   bool read_gpio(uint16_t *value);
+  bool start_streaming_at(usrp2::fpga_timestamp time);
 };
 
 // ----------------------------------------------------------------
index 1e7c54dcdb16d8c0cb62f0281c39af9303b0c3bf..75cc1f4a6bebb5857ce4fe1ee9df03f2f8680c5c 100644 (file)
@@ -67,12 +67,20 @@ usrp2_sink_16sc::work(int noutput_items,
     return 0;
 
   usrp2::tx_metadata metadata;
-  metadata.timestamp = -1;
-  metadata.send_now = 1;
+
+  // Set TX metadata to either start time or now
+  if (d_should_wait == true) {
+    metadata.timestamp = d_tx_time;
+    metadata.send_now = 0;
+    d_should_wait = false;
+  }
+  else {
+    metadata.timestamp = -1;
+    metadata.send_now = 1;
+  }
   metadata.start_of_burst = 1;
 
-  bool ok = d_u2->tx_16sc(0,  // FIXME: someday, streams will have channel numbers
-                         in, noutput_items, &metadata);
+  bool ok = d_u2->tx_16sc(0, in, noutput_items, &metadata);
   if (!ok){
     std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
     return -1; // say we're done
index b1e28a8297ee83468801a8ebd57a43e916d86938..fa75b380571dc960fe4ea56449917f2d5c295362 100644 (file)
@@ -67,12 +67,20 @@ usrp2_sink_32fc::work(int noutput_items,
     return 0;
 
   usrp2::tx_metadata metadata;
-  metadata.timestamp = -1;
-  metadata.send_now = 1;
+
+  // Set TX metadata to either start time or now
+  if (d_should_wait == true) {
+    metadata.timestamp = d_tx_time;
+    metadata.send_now = 0;
+    d_should_wait = false;
+  }
+  else {
+    metadata.timestamp = -1;
+    metadata.send_now = 1;
+  }
   metadata.start_of_burst = 1;
 
-  bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel numbers
-                         in, noutput_items, &metadata);
+  bool ok = d_u2->tx_32fc(0, in, noutput_items, &metadata);
   if (!ok){
     std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
     return -1; // say we're done
index ce473f2365e08b132237f219921d6d4b52c6d142..c9b34a54a93669974226ec79abba05bc87f7a132 100644 (file)
@@ -36,7 +36,9 @@ usrp2_sink_base::usrp2_sink_base(const char *name,
   : usrp2_base(name,
                input_signature,
               gr_make_io_signature(0, 0, 0),
-              ifc, mac)
+              ifc, mac),
+    d_should_wait(false),
+    d_tx_time(0)
 {
   // NOP
 }
@@ -155,3 +157,10 @@ bool usrp2_sink_base::read_gpio(uint16_t *value)
 {
   return d_u2->read_gpio(usrp2::GPIO_TX_BANK, value);
 }
+
+bool usrp2_sink_base::start_streaming_at(usrp2::fpga_timestamp time)
+{
+  d_should_wait = true;
+  d_tx_time = time;
+  return true;
+}
index 38dc4f2364a60fef6cbadc39c8394afcca9ed06a..d831d4df6951d4ee2e250e2f1059c610f820262b 100644 (file)
@@ -37,6 +37,9 @@ protected:
                  const std::string &mac)
     throw (std::runtime_error);
 
+  bool d_should_wait;
+  usrp2::fpga_timestamp d_tx_time;
+
 public:
   ~usrp2_sink_base();
 
@@ -139,6 +142,11 @@ public:
    * \brief Read daughterboard GPIO pin values
    */
   bool read_gpio(uint16_t *value);
+
+  /*!
+   * \brief First samples begin streaming to USRP2 at given time
+   */
+  bool start_streaming_at(usrp2::fpga_timestamp time);
 };
 
 #endif /* INCLUDED_USRP2_SINK_BASE_H */
index 1f512b2198b4e3a6040fe49a176b890ed1f213d2..d5e32c92b8451acdd0711f5090ba539b1ae937e0 100755 (executable)
@@ -52,8 +52,8 @@ def main():
 
     # rename file contents
     upper_module_name = module_name.upper()
-    sed_cmd = 'sed -i -e "s/howto/%s/g" -e "s/HOWTO/%s/g"' % (module_name,
-                                                                 upper_module_name)
+    sed_cmd = 'sed -i -e "s/howto-write-a-block/%s/g" -e "s/howto/%s/g" -e "s/HOWTO/%s/g"' % (module_name, module_name, \
+                                                                                               upper_module_name)
     os.system('find . -type f -print0 | xargs -0 ' + sed_cmd)
 
     sys.stdout.write("""
index ec2272c744f3b2dd712b8819dcf0b76e8feac475..5dd08c9a0dd4dcae424b18582ba0f58e497ca816 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2011 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -80,15 +80,15 @@ class draw_constellation:
 
     def get_data(self):
         self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//self.sizeof_data))
-        iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
-        #print "Read in %d items" % len(iq)
-        if(len(iq) == 0):
+        try:
+            iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
+        except MemoryError:
             print "End of File"
         else:
-            self.reals = [r.real for r in iq]
-            self.imags = [i.imag for i in iq]
+            self.reals = scipy.array([r.real for r in iq])
+            self.imags = scipy.array([i.imag for i in iq])
 
-            self.time = [i*(1/self.sample_rate) for i in range(len(self.reals))]
+            self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
             
     def make_plots(self):
         # if specified on the command-line, set file pointer
@@ -117,9 +117,9 @@ class draw_constellation:
         self.plot_const += self.sp_const.plot([self.reals[self.indx],], [self.imags[self.indx],], 'mo', ms=12)
 
         # Adjust axis
-        self.sp_iq.axis([min(self.time), max(self.time),
-                         1.5*min([min(self.reals), min(self.imags)]),
-                         1.5*max([max(self.reals), max(self.imags)])])
+        self.sp_iq.axis([self.time.min(), self.time.max(),
+                         1.5*min([self.reals.min(), self.imags.min()]),
+                         1.5*max([self.reals.max(), self.imags.max()])])
         self.sp_const.axis([-2, 2, -2, 2])
 
         draw()
@@ -127,9 +127,9 @@ class draw_constellation:
     def update_plots(self):
         self.plot_iq[0].set_data([self.time, self.reals])
         self.plot_iq[1].set_data([self.time, self.imags])
-        self.sp_iq.axis([min(self.time), max(self.time),
-                         1.5*min([min(self.reals), min(self.imags)]),
-                         1.5*max([max(self.reals), max(self.imags)])])
+        self.sp_iq.axis([self.time.min(), self.time.max(),
+                         1.5*min([self.reals.min(), self.imags.min()]),
+                         1.5*max([self.reals.max(), self.imags.max()])])
 
         self.plot_const[0].set_data([self.reals, self.imags])
         self.sp_const.axis([-2, 2, -2, 2])
@@ -138,7 +138,7 @@ class draw_constellation:
     def zoom(self, event):
         newxlim = scipy.array(self.sp_iq.get_xlim())
         curxlim = scipy.array(self.xlim)
-        if(newxlim.all() != curxlim.all()):
+        if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]):
             self.xlim = newxlim
             r = self.reals[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
             i = self.imags[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
index a9c1417f9b308993cfaa09ebc0a78c3461ef4118..ba3901e03c5351b2633976704c0d8e9849761a95 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2011 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -81,15 +81,16 @@ class gr_plot_fft:
     def get_data(self):
         self.position = self.hfile.tell()/self.sizeof_data
         self.text_file_pos.set_text("File Position: %d" % (self.position))
-        self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
-        #print "Read in %d items" % len(self.iq)
-        if(len(self.iq) == 0):
+        try:
+            self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
+        except MemoryError:
             print "End of File"
         else:
             self.iq_fft = self.dofft(self.iq)
             
             tstep = 1.0 / self.sample_rate
-            self.time = [tstep*(self.position + i) for i in xrange(len(self.iq))]
+            #self.time = scipy.array([tstep*(self.position + i) for i in xrange(len(self.iq))])
+            self.time = scipy.array([tstep*(i) for i in xrange(len(self.iq))])
 
             self.freq = self.calc_freq(self.time, self.sample_rate)
 
@@ -102,9 +103,9 @@ class gr_plot_fft:
 
     def calc_freq(self, time, sample_rate):
         N = len(time)
-        Fs = 1.0 / (max(time) - min(time))
+        Fs = 1.0 / (time.max() - time.min())
         Fn = 0.5 * sample_rate
-        freq = [-Fn + i*Fs for i in xrange(N)]
+        freq = scipy.array([-Fn + i*Fs for i in xrange(N)])
         return freq
         
     def make_plots(self):
@@ -139,14 +140,14 @@ class gr_plot_fft:
         imags = self.iq.imag
         self.plot_iq[0].set_data([self.time, reals])
         self.plot_iq[1].set_data([self.time, imags])
-        self.sp_iq.set_xlim(min(self.time), max(self.time))
-        self.sp_iq.set_ylim([1.5*min([min(reals), min(imags)]),
-                             1.5*max([max(reals), max(imags)])])
+        self.sp_iq.set_xlim(self.time.min(), self.time.max())
+        self.sp_iq.set_ylim([1.5*min([reals.min(), imags.min()]),
+                             1.5*max([reals.max(), imags.max()])])
 
     def draw_fft(self):
         self.plot_fft[0].set_data([self.freq, self.iq_fft])
-        self.sp_fft.set_xlim(min(self.freq), max(self.freq))
-        self.sp_fft.set_ylim([min(self.iq_fft)-10, max(self.iq_fft)+10])
+        self.sp_fft.set_xlim(self.freq.min(), self.freq.max())
+        self.sp_fft.set_ylim([self.iq_fft.min()-10, self.iq_fft.max()+10])
 
     def update_plots(self):
         self.draw_time()
@@ -158,10 +159,12 @@ class gr_plot_fft:
     def zoom(self, event):
         newxlim = scipy.array(self.sp_iq.get_xlim())
         curxlim = scipy.array(self.xlim)
-        if(newxlim.all() != curxlim.all()):
+        if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]):
             self.xlim = newxlim
-            xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position))))
-            xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq))
+            #xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position))))
+            #xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq))
+            xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0]))))
+            xmax = min(int(ceil(self.sample_rate*(self.xlim[1]))), len(self.iq))
 
             iq = self.iq[xmin : xmax]
             time = self.time[xmin : xmax]
@@ -170,8 +173,8 @@ class gr_plot_fft:
             freq = self.calc_freq(time, self.sample_rate)
             
             self.plot_fft[0].set_data(freq, iq_fft)
-            self.sp_fft.axis([min(freq), max(freq),
-                              min(iq_fft)-10, max(iq_fft)+10])
+            self.sp_fft.axis([freq.min(), freq.max(),
+                              iq_fft.min()-10, iq_fft.max()+10])
 
             draw()
 
index 371ce3b7991b55137c7cb177180a23494d608a3e..316e60a75744849b3c8cbd4bc3d934a180b35638 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2011 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -78,14 +78,14 @@ class draw_iq:
 
     def get_data(self):
         self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//self.sizeof_data))
-        self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
-        #print "Read in %d items" % len(self.iq)
-        if(len(self.iq) == 0):
+        try:
+            self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
+        except MemoryError:
             print "End of File"
         else:
-            self.reals = [r.real for r in self.iq]
-            self.imags = [i.imag for i in self.iq]
-            self.time = [i*(1/self.sample_rate) for i in range(len(self.reals))]
+            self.reals = scipy.array([r.real for r in self.iq])
+            self.imags = scipy.array([i.imag for i in self.iq])
+            self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
             
     def make_plots(self):
         # if specified on the command-line, set file pointer
@@ -99,16 +99,17 @@ class draw_iq:
         self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold")
         self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size, fontweight="bold")
         self.plot_iq = plot(self.time, self.reals, 'bo-', self.time, self.imags, 'ro-')
-        self.sp_iq.set_ylim([1.5*min([min(self.reals), min(self.imags)]),
-                             1.5*max([max(self.reals), max(self.imags)])])
-        
+        self.sp_iq.set_ylim([1.5*min([self.reals.min(), self.imags.min()]),
+                             1.5*max([self.reals.max(), self.imags.max()])])
+        self.sp_iq.set_xlim(self.time.min(), self.time.max())
         draw()
 
     def update_plots(self):
         self.plot_iq[0].set_data([self.time, self.reals])
         self.plot_iq[1].set_data([self.time, self.imags])
-        self.sp_iq.set_ylim([1.5*min([min(self.reals), min(self.imags)]),
-                             1.5*max([max(self.reals), max(self.imags)])])
+        self.sp_iq.set_ylim([1.5*min([self.reals.min(), self.imags.min()]),
+                             1.5*max([self.reals.max(), self.imags.max()])])
+        self.sp_iq.set_xlim(self.time.min(), self.time.max())
         draw()
         
     def click(self, event):
index 0e3dbecd944f583d126364d76f215f244063d57d..e88995b725c755dfc39255d509e5366a503b6249 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2011 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -60,8 +60,10 @@ class gr_plot_psd:
         rcParams['xtick.labelsize'] = self.axis_font_size
         rcParams['ytick.labelsize'] = self.axis_font_size
         
-        self.text_file     = figtext(0.10, 0.95, ("File: %s" % filename), weight="heavy", size=self.text_size)
-        self.text_file_pos = figtext(0.10, 0.92, "File Position: ", weight="heavy", size=self.text_size)
+        self.text_file     = figtext(0.10, 0.95, ("File: %s" % filename),
+                                     weight="heavy", size=self.text_size)
+        self.text_file_pos = figtext(0.10, 0.92, "File Position: ",
+                                     weight="heavy", size=self.text_size)
         self.text_block    = figtext(0.35, 0.92, ("Block Size: %d" % self.block_length),
                                      weight="heavy", size=self.text_size)
         self.text_sr       = figtext(0.60, 0.915, ("Sample Rate: %.2f" % self.sample_rate),
@@ -76,7 +78,7 @@ class gr_plot_psd:
         self.button_right = Button(self.button_right_axes, ">")
         self.button_right_callback = self.button_right.on_clicked(self.button_right_click)
 
-        self.xlim = self.sp_iq.get_xlim()
+        self.xlim = scipy.array(self.sp_iq.get_xlim())
 
         self.manager = get_current_fig_manager()
         connect('draw_event', self.zoom)
@@ -86,16 +88,17 @@ class gr_plot_psd:
     def get_data(self):
         self.position = self.hfile.tell()/self.sizeof_data
         self.text_file_pos.set_text("File Position: %d" % self.position)
-        self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
-        #print "Read in %d items" % len(self.iq)
-        if(len(self.iq) == 0):
+        try:
+            self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
+        except MemoryError:
             print "End of File"
         else:
             tstep = 1.0 / self.sample_rate
-            self.time = [tstep*(self.position + i) for i in xrange(len(self.iq))]
+            #self.time = scipy.array([tstep*(self.position + i) for i in xrange(len(self.iq))])
+            self.time = scipy.array([tstep*(i) for i in xrange(len(self.iq))])
 
             self.iq_psd, self.freq = self.dopsd(self.iq)
-            
+          
     def dopsd(self, iq):
         ''' Need to do this here and plot later so we can do the fftshift '''
         overlap = self.psdfftsize/4
@@ -130,10 +133,10 @@ class gr_plot_psd:
         
         self.plot_iq  = self.sp_iq.plot([], 'bo-') # make plot for reals
         self.plot_iq += self.sp_iq.plot([], 'ro-') # make plot for imags
-        self.draw_time()                           # draw the plot
+        self.draw_time(self.time, self.iq)         # draw the plot
 
         self.plot_psd = self.sp_psd.plot([], 'b')  # make plot for PSD
-        self.draw_psd()                            # draw the plot
+        self.draw_psd(self.freq, self.iq_psd)      # draw the plot
 
 
         if self.dospec:
@@ -143,57 +146,59 @@ class gr_plot_psd:
             self.sp_spec.set_xlabel("Time (s)", fontsize=self.label_font_size, fontweight="bold")
             self.sp_spec.set_ylabel("Frequency (Hz)", fontsize=self.label_font_size, fontweight="bold")
 
-            self.draw_spec()
+            self.draw_spec(self.time, self.iq)
         
         draw()
 
-    def draw_time(self):
-        reals = self.iq.real
-        imags = self.iq.imag
-        self.plot_iq[0].set_data([self.time, reals])
-        self.plot_iq[1].set_data([self.time, imags])
-        self.sp_iq.set_xlim(min(self.time), max(self.time))
-        self.sp_iq.set_ylim([1.5*min([min(reals), min(imags)]),
-                             1.5*max([max(reals), max(imags)])])
-
-    def draw_psd(self):
-        self.plot_psd[0].set_data([self.freq, self.iq_psd])
-        self.sp_psd.set_ylim([min(self.iq_psd)-10, max(self.iq_psd)+10])
-
-    def draw_spec(self):
+    def draw_time(self, t, iq):
+        reals = iq.real
+        imags = iq.imag
+        self.plot_iq[0].set_data([t, reals])
+        self.plot_iq[1].set_data([t, imags])
+        self.sp_iq.set_xlim(t.min(), t.max())
+        self.sp_iq.set_ylim([1.5*min([reals.min(), imags.min()]),
+                             1.5*max([reals.max(), imags.max()])])
+
+    def draw_psd(self, f, p):
+        self.plot_psd[0].set_data([f, p])
+        self.sp_psd.set_ylim([p.min()-10, p.max()+10])
+        self.sp_psd.set_xlim([f.min(), f.max()])
+
+    def draw_spec(self, t, s):
         overlap = self.specfftsize/4
         winfunc = scipy.blackman
         self.sp_spec.clear()
-        self.sp_spec.specgram(self.iq, self.specfftsize, self.sample_rate,
+        self.sp_spec.specgram(s, self.specfftsize, self.sample_rate,
                               window = lambda d: d*winfunc(self.specfftsize),
-                              noverlap = overlap, xextent=[min(self.time), max(self.time)])
+                              noverlap = overlap, xextent=[t.min(), t.max()])
 
     def update_plots(self):
-        self.draw_time()
-        self.draw_psd()
+        self.draw_time(self.time, self.iq)
+        self.draw_psd(self.freq, self.iq_psd)
 
         if self.dospec:
-            self.draw_spec()
+            self.draw_spec(self.time, self.iq)
 
-        self.xlim = self.sp_iq.get_xlim() # so zoom doesn't get called
+        self.xlim = scipy.array(self.sp_iq.get_xlim()) # so zoom doesn't get called
+        
         draw()
         
     def zoom(self, event):
         newxlim = scipy.array(self.sp_iq.get_xlim())
         curxlim = scipy.array(self.xlim)
-        if(newxlim.all() != curxlim.all()):
-            self.xlim = newxlim
-            xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position))))
-            xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq))
+        if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]):
+            #xmin = max(0, int(ceil(self.sample_rate*(newxlim[0] - self.position))))
+            #xmax = min(int(ceil(self.sample_rate*(newxlim[1] - self.position))), len(self.iq))
+            xmin = max(0, int(ceil(self.sample_rate*(newxlim[0]))))
+            xmax = min(int(ceil(self.sample_rate*(newxlim[1]))), len(self.iq))
 
             iq = self.iq[xmin : xmax]
             time = self.time[xmin : xmax]
 
             iq_psd, freq = self.dopsd(iq)
             
-            self.plot_psd[0].set_data(freq, iq_psd)
-            self.sp_psd.axis([min(freq), max(freq),
-                              min(iq_psd)-10, max(iq_psd)+10])
+            self.draw_psd(freq, iq_psd)
+            self.xlim = scipy.array(self.sp_iq.get_xlim())
 
             draw()
 
index 08cdd60306bfb0b20e69d24431fc1b9659212850..15012e5893614e64e37818091fdf4291ac8317bf 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007,2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2011 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -81,13 +81,13 @@ class plot_data:
         
     def get_data(self, hfile):
         self.text_file_pos.set_text("File Position: %d" % (hfile.tell()//self.sizeof_data))
-        f = scipy.fromfile(hfile, dtype=self.datatype, count=self.block_length)
-        #print "Read in %d items" % len(self.f)
-        if(len(f) == 0):
+        try:
+            f = scipy.fromfile(hfile, dtype=self.datatype, count=self.block_length)
+        except MemoryError:
             print "End of File"
         else:
-            self.f = f
-            self.time = [i*(1/self.sample_rate) for i in range(len(self.f))]
+            self.f = scipy.array(f)
+            self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.f))])
         
     def make_plots(self):
         self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.875, 0.6])
@@ -107,8 +107,8 @@ class plot_data:
         
             # Subplot for real and imaginary parts of signal
             self.plot_f += plot(self.time, self.f, 'o-')
-            maxval = max(maxval, max(self.f))
-            minval = min(minval, min(self.f))
+            maxval = max(maxval, self.f.max())
+            minval = min(minval, self.f.min())
 
         self.sp_f.set_ylim([1.5*minval, 1.5*maxval])
 
@@ -122,8 +122,8 @@ class plot_data:
         for hf,p in zip(self.hfile,self.plot_f):
             self.get_data(hf)
             p.set_data([self.time, self.f])
-            maxval = max(maxval, max(self.f))
-            minval = min(minval, min(self.f))
+            maxval = max(maxval, self.f.max())
+            minval = min(minval, self.f.min())
 
         self.sp_f.set_ylim([1.5*minval, 1.5*maxval])
         
index 98da85f6b32d552be2dc2cf93d422a71e39bef0a..8f82a60b1955f8f2b86d45fffa136acb17a599e8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,7 @@
 from gnuradio import gr, gr_unittest
 import video_sdl
 
-class qa_video_sdl (gr_unittest.TestCase):
+class test_video_sdl (gr_unittest.TestCase):
 
     def setUp (self):
         self.tb = gr.top_block ()
@@ -37,4 +37,4 @@ class qa_video_sdl (gr_unittest.TestCase):
         pass
     
 if __name__ == '__main__':
-    gr_unittest.main ()
+    gr_unittest.run(test_video_sdl, "test_video_sdl.xml")
index 825cd80cb079b9e22d5e4d39dc63d00f42721c28..2be3ff07226478fa569f3dc89133750ed5d9eac0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -118,7 +118,7 @@ video_sdl_sink_s::~video_sdl_sink_s ()
 video_sdl_sink_s_sptr
 video_sdl_make_sink_s (double framerate,int width, int height,unsigned int format,int dst_width,int dst_height)
 {
-  return video_sdl_sink_s_sptr (new video_sdl_sink_s (framerate, width, height,format,dst_width,dst_height));
+  return gnuradio::get_initial_sptr(new video_sdl_sink_s (framerate, width, height,format,dst_width,dst_height));
 }
 
 void
index 2d25399a89a329f580a29e157d8661bc30fdf4e3..58e4830e4a5403f363038678a68d3ce53e0b011d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -118,7 +118,7 @@ video_sdl_sink_uc::~video_sdl_sink_uc ()
 video_sdl_sink_uc_sptr
 video_sdl_make_sink_uc (double framerate,int width, int height,unsigned int format,int dst_width,int dst_height)
 {
-  return video_sdl_sink_uc_sptr (new video_sdl_sink_uc (framerate, width, height,format,dst_width,dst_height));
+  return gnuradio::get_initial_sptr(new video_sdl_sink_uc (framerate, width, height,format,dst_width,dst_height));
 }
 
 void
index 17a7dc0de550fa8ae5fa32da1f938d3f5fd7edd8..3641ae6448f7ff4f4203c82e2210ea135d8d4579 100644 (file)
@@ -25,6 +25,8 @@
 import wx
 from gnuradio import gr
 
+RUN_ALWAYS = gr.prefs().get_bool ('wxgui', 'run_always', False)
+
 class wxgui_hb(object):
        """
        The wxgui hier block helper/wrapper class:
@@ -47,7 +49,10 @@ class wxgui_hb(object):
                        assert points[0] == self or points[0][0] == self
                        copy = gr.copy(self._hb.input_signature().sizeof_stream_item(0))
                        handler = self._handler_factory(copy.set_enabled)
-                       handler(False) #initially disable the copy block
+                       if RUN_ALWAYS == False:
+                               handler(False) #initially disable the copy block
+                       else:
+                               handler(True) #initially enable the copy block
                        self._bind_to_visible_event(win=self.win, handler=handler)
                        points = list(points)
                        points.insert(1, copy) #insert the copy block into the chain
@@ -67,7 +72,10 @@ class wxgui_hb(object):
                        if cache[0] == visible: return
                        cache[0] = visible
                        #print visible, handler
-                       handler(visible)
+                       if RUN_ALWAYS == False:
+                               handler(visible)
+                       else:
+                               handler(True)
                return callback
 
        @staticmethod
index 9612f36ddec1f0679c72c8811181a45cd32582fe..070be0808bef962bf8abe2558497bf9ef6b6b090 100644 (file)
@@ -66,6 +66,7 @@ X_PER_DIV_KEY = 'x_per_div'
 Y_DIVS_KEY = 'y_divs'
 Y_OFF_KEY = 'y_off'
 Y_PER_DIV_KEY = 'y_per_div'
+Y_AXIS_LABEL = 'y_axis_label'
 MAXIMUM_KEY = 'maximum'
 MINIMUM_KEY = 'minimum'
 NUM_BINS_KEY = 'num_bins'
index e0306d919302caf335521bf810fbb3518d5a44d6..6cfaeff606b67f83ebc611a62fb82157f2c31f65 100644 (file)
@@ -19,6 +19,8 @@
 # Boston, MA 02110-1301, USA.
 #
 
+from __future__ import division
+
 ##################################################
 # Imports
 ##################################################
index 67f62ca566d53adb33319e0c013e9a457a867c58..1b3c047dceeeb35172818459bf55d97c14379c36 100644 (file)
@@ -193,7 +193,7 @@ class TextElement(object):
         img   = wx.ImageFromBitmap(bmp)\r
         alpha = img.GetData()\r
         \r
-        if isinstance(self._foreground, wx.Color):  \r
+        if isinstance(self._foreground, wx.Colour):\r
             """\r
             If we have a static color...  \r
             """    \r
index c03b71f1e0c84494791265be416f9eef29ea2d55..89a808cec055e9250ed2c0c46819747d5d69354c 100644 (file)
@@ -38,6 +38,7 @@ import forms
 DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'scope_rate', 30)
 PERSIST_ALPHA_MIN_EXP, PERSIST_ALPHA_MAX_EXP = -2, 0
 SLIDER_STEPS = 100
+DEFAULT_TRIG_MODE = gr.prefs().get_long('wxgui', 'trig_mode', gr.gr_TRIG_MODE_AUTO)
 DEFAULT_WIN_SIZE = (600, 300)
 COUPLING_MODES = (
        ('DC', False),
@@ -47,6 +48,7 @@ TRIGGER_MODES = (
        ('Freerun', gr.gr_TRIG_MODE_FREE),
        ('Auto', gr.gr_TRIG_MODE_AUTO),
        ('Normal', gr.gr_TRIG_MODE_NORM),
+       ('Stripchart', gr.gr_TRIG_MODE_STRIPCHART),
 )
 TRIGGER_SLOPES = (
        ('Pos +', gr.gr_TRIG_SLOPE_POS),
@@ -432,6 +434,8 @@ class scope_window(wx.Panel, pubsub.pubsub):
                msg_key,
                 use_persistence,
                 persist_alpha,
+               trig_mode,
+               y_axis_label,
        ):
                pubsub.pubsub.__init__(self)
                #check num inputs
@@ -468,14 +472,20 @@ class scope_window(wx.Panel, pubsub.pubsub):
                self[T_DIVS_KEY] = 8
                self[X_DIVS_KEY] = 8
                self[Y_DIVS_KEY] = 8
+               self[Y_AXIS_LABEL] = y_axis_label
                self[FRAME_RATE_KEY] = frame_rate
                self[TRIGGER_LEVEL_KEY] = 0
                self[TRIGGER_CHANNEL_KEY] = 0
-               self[TRIGGER_MODE_KEY] = gr.gr_TRIG_MODE_AUTO
+               self[TRIGGER_MODE_KEY] = trig_mode
+               
                self[TRIGGER_SLOPE_KEY] = gr.gr_TRIG_SLOPE_POS
                self[T_FRAC_OFF_KEY] = 0.5
                self[USE_PERSISTENCE_KEY] = use_persistence
                self[PERSIST_ALPHA_KEY] = persist_alpha
+               
+               if self[TRIGGER_MODE_KEY] == gr.gr_TRIG_MODE_STRIPCHART:
+                       self[T_FRAC_OFF_KEY] = 0.0
+
                for i in range(num_inputs):
                        self.proxy(common.index_key(AC_COUPLE_KEY, i), controller, common.index_key(ac_couple_key, i))
                #init panel and plot
@@ -668,7 +678,7 @@ class scope_window(wx.Panel, pubsub.pubsub):
                        self.plotter.set_x_label('Time', 's')
                        self.plotter.set_x_grid(self.get_t_min(), self.get_t_max(), self[T_PER_DIV_KEY], True)
                        #update the y axis
-                       self.plotter.set_y_label('Counts')
+                       self.plotter.set_y_label(self[Y_AXIS_LABEL])
                        self.plotter.set_y_grid(self.get_y_min(), self.get_y_max(), self[Y_PER_DIV_KEY])
                #redraw current sample
                self.handle_samples()
index ebf9b29398479ff260b7f72b089f77571f1ca37e..5ae897400b8f683d88a27b49c936993bb4562f5a 100644 (file)
@@ -76,6 +76,8 @@ class _scope_sink_base(gr.hier_block2, common.wxgui_hb):
                xy_mode=False,
                ac_couple=False,
                num_inputs=1,
+               trig_mode=scope_window.DEFAULT_TRIG_MODE,
+               y_axis_label='Counts',
                frame_rate=scope_window.DEFAULT_FRAME_RATE,
                 use_persistence=False,
                 persist_alpha=None,
@@ -132,6 +134,8 @@ class _scope_sink_base(gr.hier_block2, common.wxgui_hb):
                        v_scale=v_scale,
                        v_offset=v_offset,
                        xy_mode=xy_mode,
+                       trig_mode=trig_mode,
+                       y_axis_label=y_axis_label,
                        ac_couple_key=AC_COUPLE_KEY,
                        trigger_level_key=TRIGGER_LEVEL_KEY,
                        trigger_mode_key=TRIGGER_MODE_KEY,
index 5c1379ee643d9992e2446296b51183492b447ba0..bf2c5091759b97e879c4b4f1a64d7da36abb28f8 100644 (file)
@@ -217,13 +217,13 @@ class input_watcher (gru.msgq_runner):
                 chan_data = s[start:start+bytes_per_chan]
                 rec = numpy.fromstring (chan_data, numpy.float32)
                 records.append (rec)
-                
-                # print "nrecords = %d, reclen = %d" % (len (records),nsamples)
-                
-                de = DataEvent (records)
-                wx.PostEvent (self.event_receiver, de)
-                records = []
-                del de
+            
+            # print "nrecords = %d, reclen = %d" % (len (records),nsamples)
+            
+            de = DataEvent (records)
+            wx.PostEvent (self.event_receiver, de)
+            records = []
+            del de
 
         self.iscan -= 1
     
index b7904e4d9742412269345dd870c8bb6657c9f89f..6536ada10100287b3348c8e8b6bea7e0227a9c14 100644 (file)
@@ -38,6 +38,7 @@ import forms
 SLIDER_STEPS = 100
 AVG_ALPHA_MIN_EXP, AVG_ALPHA_MAX_EXP = -3, 0
 DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'waterfall_rate', 30)
+DEFAULT_COLOR_MODE = gr.prefs().get_string('wxgui', 'waterfall_color', 'rgb1')
 DEFAULT_WIN_SIZE = (600, 300)
 DIV_LEVELS = (1, 2, 5, 10, 20)
 MIN_DYNAMIC_RANGE, MAX_DYNAMIC_RANGE = 10, 200
@@ -156,6 +157,9 @@ class control_panel(wx.Panel):
        def _on_incr_time_scale(self, event):
                old_rate = self.parent[FRAME_RATE_KEY]
                self.parent[FRAME_RATE_KEY] *= 0.75
+               if self.parent[FRAME_RATE_KEY] < 1.0:
+                       self.parent[FRAME_RATE_KEY] = 1.0
+               
                if self.parent[FRAME_RATE_KEY] == old_rate:
                        self.parent[DECIMATION_KEY] += 1
        def _on_decr_time_scale(self, event):
@@ -217,6 +221,7 @@ class waterfall_window(wx.Panel, pubsub.pubsub):
                self[REF_LEVEL_KEY] = ref_level
                self[BASEBAND_FREQ_KEY] = baseband_freq
                self[COLOR_MODE_KEY] = COLOR_MODES[0][1]
+               self[COLOR_MODE_KEY] = DEFAULT_COLOR_MODE
                self[RUNNING_KEY] = True
                #setup the box with plot and controls
                self.control_panel = control_panel(self)
@@ -280,6 +285,8 @@ class waterfall_window(wx.Panel, pubsub.pubsub):
                #grid parameters
                sample_rate = self[SAMPLE_RATE_KEY]
                frame_rate = self[FRAME_RATE_KEY]
+               if frame_rate < 1.0 :
+                       frame_rate = 1.0
                baseband_freq = self[BASEBAND_FREQ_KEY]
                num_lines = self[NUM_LINES_KEY]
                y_divs = self[Y_DIVS_KEY]
index 2596eae45600c74013af035c18b07594c1368f67..18420a013320aa60aabe2adf9b87c72207486539 100644 (file)
@@ -71,6 +71,7 @@ dist_ourdata_DATA = \
        gr_agc2_xx.xml \
        gr_agc_xx.xml \
        gr_and_xx.xml \
+       gr_and_const_xx.xml \
        gr_argmax_xx.xml \
        gr_binary_slicer_fb.xml \
        gr_channel_model.xml \
index 8d91258e516f08417a64f361c0ff2007b57da3db..610a881026c12075b7c6ddfbb67bc42281cb990e 100644 (file)
@@ -58,6 +58,7 @@
 
                <block>gr_add_const_vxx</block>
                <block>gr_multiply_const_vxx</block>
+               <block>gr_and_const_xx</block>
 
                <block>gr_not_xx</block>
                <block>gr_and_xx</block>
index fb3ae57042dbe939ac4718eb74619218eae79552..55b20d4e82db2b051c5c673ba03731ad47c58ebb 100644 (file)
@@ -9,6 +9,11 @@
        <key>gr_agc2_xx</key>
        <import>from gnuradio import gr</import>
        <make>gr.agc2_$(type.fcn)($attack_rate, $decay_rate, $reference, $gain, $max_gain)</make>
+    <callback>set_attack_rate($attack_rate)</callback>
+    <callback>set_decay_rate($decay_rate)</callback>
+    <callback>set_reference($reference)</callback>
+    <callback>set_gain($gain)</callback>
+    <callback>set_max_gain($max_gain)</callback>
        <param>
                <name>Type</name>
                <key>type</key>
diff --git a/grc/blocks/gr_and_const_xx.xml b/grc/blocks/gr_and_const_xx.xml
new file mode 100644 (file)
index 0000000..dc96493
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## And Const Block:
+##     all types, 1 output, 1 input & const
+###################################################
+ -->
+<block>
+       <name>And Const</name>
+       <key>gr_and_const_xx</key>
+       <import>from gnuradio import gr</import>
+       <make>gr.and_const_$(type.fcn)($const)</make>
+       <callback>set_k($const)</callback>
+       <param>
+               <name>IO Type</name>
+               <key>type</key>
+               <type>enum</type>
+               <option>
+                       <name>Int</name>
+                       <key>int</key>
+                       <opt>fcn:ii</opt>
+               </option>
+               <option>
+                       <name>Short</name>
+                       <key>short</key>
+                       <opt>fcn:ss</opt>
+               </option>
+               <option>
+                       <name>Byte</name>
+                       <key>byte</key>
+                       <opt>fcn:bb</opt>
+               </option>
+       </param>
+       <param>
+               <name>Constant</name>
+               <key>const</key>
+               <value>0</value>
+               <type>int</type>
+       </param>
+       <sink>
+               <name>in</name>
+               <type>$type</type>
+       </sink>
+       <source>
+               <name>out</name>
+               <type>$type</type>
+       </source>
+</block>
index 880dc27590c013447038f718849701c334505ca6..0081c93f8f5a25c15582c0f2acc73acfe36415e7 100644 (file)
@@ -8,7 +8,9 @@
        <name>File Sink</name>
        <key>gr_file_sink</key>
        <import>from gnuradio import gr</import>
-       <make>gr.file_sink($type.size*$vlen, $file)</make>
+       <make>gr.file_sink($type.size*$vlen, $file)
+self.$(id).set_unbuffered($unbuffered)</make>
+       <callback>set_unbuffered($unbuffered)</callback>
        <param>
                <name>File</name>
                <key>file</key>
                <value>1</value>
                <type>int</type>
        </param>
+       <param>
+               <name>Unbuffered</name>
+               <key>unbuffered</key>
+               <value>False</value>
+               <type>bool</type>
+               <option>
+                               <name>Off</name>
+                               <key>False</key>
+               </option>
+               <option>
+                               <name>On</name>
+                               <key>True</key>
+               </option>
+       </param>
+
        <check>$vlen &gt; 0</check>
        <sink>
                <name>in</name>
index 2105445d117f9524eb327a75d45e4767c4d7b5a9..f27d9582ea07f7c0974491470fadeba8d0999706 100644 (file)
@@ -9,6 +9,8 @@
        <key>gr_goertzel_fc</key>
        <import>from gnuradio import gr</import>
        <make>gr.goertzel_fc($rate, $len, $freq)</make>
+        <callback>set_freq($freq)</callback>
+        <callback>set_rate($rate)</callback>
        <param>
                <name>Rate</name>
                <key>rate</key>
index 1c815c3470699f8900f087571f373cf1be289b9c..11bff9edc238354cf78a01b9f50f6da8ec8cd6b4 100644 (file)
@@ -46,7 +46,7 @@ self._$(id)_config.write(open($config_file, 'w'))</callback>
                <option>
                        <name>Bool</name>
                        <key>bool</key>
-                       <opt>get:getbool</opt>
+                       <opt>get:getboolean</opt>
                </option>
                <option>
                        <name>String</name>
index eba45f48981af825c5ec658017b3e221b2e00f43..ef037737396bc3cf804a2f61ab85bee0f2c726a7 100644 (file)
@@ -20,6 +20,8 @@ scopesink2.$(type.fcn)(
        ac_couple=$ac_couple,
        xy_mode=$xy_mode,
        num_inputs=$num_inputs,
+       trig_mode=$trig_mode,
+       y_axis_label=$y_axis_label,
 #if $win_size()
        size=$win_size,
 #end if
@@ -134,6 +136,33 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
                <value></value>
                <type>notebook</type>
        </param>
+       <param>
+               <name>Trigger Mode</name>
+               <key>trig_mode</key>
+               <type>enum</type>
+               <option>
+                       <name>Auto</name>
+                       <key>gr.gr_TRIG_MODE_AUTO</key>
+               </option>
+               <option>
+                       <name>Normal</name>
+                       <key>gr.gr_TRIG_MODE_NORM</key>
+               </option>
+               <option>
+                       <name>Freerun</name>
+                       <key>gr.gr_TRIG_MODE_FREE</key>
+               </option>
+               <option>
+                       <name>Stripchart</name>
+                       <key>gr.gr_TRIG_MODE_STRIPCHART</key>
+               </option>
+       </param>
+       <param>
+               <name>Y Axis Label</name>
+               <key>y_axis_label</key>
+               <value>Counts</value>
+               <type>string</type>
+       </param>
        <check>not $win_size or len($win_size) == 2</check>
        <check>not $xy_mode or '$type' == 'complex' or $num_inputs != 1</check>
        <sink>
index 23bb70bf54db8ef94a816e1b41e78cfdec70c40a..f6aa97a93ad63f94a37dd965a5beb3f3964451b1 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -22,7 +22,6 @@
 include $(top_srcdir)/Makefile.common
 
 ourdatadir = $(pkgdatadir)/grc/freedesktop
-
 dist_ourdata_DATA = \
        grc-icon-256.png \
        grc-icon-128.png \
@@ -30,11 +29,12 @@ dist_ourdata_DATA = \
        grc-icon-48.png \
        grc-icon-32.png \
        gnuradio-grc.xml \
-       gnuradio-gnuradio-companion.desktop \
+       gnuradio-grc.desktop \
        gnuradio-usrp2_probe.desktop \
        gnuradio-usrp_probe.desktop
 
-dist_bin_SCRIPTS = grc_setup_freedesktop
+pkglibexecdir = $(libexecdir)/$(PACKAGE)
+dist_pkglibexec_SCRIPTS = grc_setup_freedesktop
 
 grc_setup_freedesktop: $(srcdir)/grc_setup_freedesktop.in Makefile
        sed -e 's|@SRCDIR[@]|$(ourdatadir)|g' $< > $@
@@ -46,10 +46,10 @@ install-data-hook:
        @printf "\n*** GRC Post-Install Message ***\
        \nTo install icons, mime type, and menu items\
        \nfor a freedesktop.org system (Gnome/KDE/Xfce):\
-       \n  >>> sudo grc_setup_freedesktop install\n\n"
+       \n  >>> sudo $(pkglibexecdir)/grc_setup_freedesktop install\n\n"
 
 uninstall-hook:
        @printf "\n*** GRC Post-Uninstall Message ***\
        \nTo uninstall icons, mime type, and menu items\
        \nfor a freedesktop.org system (Gnome/KDE/Xfce):\
-       \n  >>> sudo grc_setup_freedesktop uninstall\n\n"
+       \n  >>> sudo $(pkglibexecdir)/grc_setup_freedesktop uninstall\n\n"
diff --git a/grc/freedesktop/gnuradio-gnuradio-companion.desktop b/grc/freedesktop/gnuradio-gnuradio-companion.desktop
deleted file mode 100644 (file)
index 5fd0497..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Type=Application
-Name=GRC
-Exec=gnuradio-companion %F
-Categories=Development;
-MimeType=application/gnuradio-grc;
-Icon=gnuradio-grc
diff --git a/grc/freedesktop/gnuradio-grc.desktop b/grc/freedesktop/gnuradio-grc.desktop
new file mode 100644 (file)
index 0000000..5fd0497
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=GRC
+Exec=gnuradio-companion %F
+Categories=Development;
+MimeType=application/gnuradio-grc;
+Icon=gnuradio-grc
index a0c5ac193bde67f06bf58ae60d6ea4564202d86f..ab4ce82ef883c20ee5238a3acca407b5a793b59c 100644 (file)
@@ -1,4 +1,24 @@
 #!/bin/bash
+#
+# Copyright 2008, 2009, 2010 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.
+#
 ##################################################
 # setup grc on a freedesktop platform
 # $1 should be install or uninstall
@@ -8,7 +28,7 @@
 ##################################################
 
 ICON_SIZES="32 48 64 128 256"
-MENU_ITEMS="gnuradio-companion usrp2_probe usrp_probe"
+MENU_ITEMS="grc usrp2_probe usrp_probe"
 if [ -n "$2" ]; then
        SRCDIR="$2"
 else
@@ -39,11 +59,12 @@ case "$1" in
        echo "Begin freedesktop uninstall..."
        for size in ${ICON_SIZES}; do \
                echo "Uninstall icon: ${size}x${size}"
-               xdg-icon-resource uninstall --context mimetypes --theme gnome --size ${size} application-gnuradio-grc; \
-               xdg-icon-resource uninstall --context mimetypes --size ${size} application-gnuradio-grc; \
-               xdg-icon-resource uninstall --context apps --theme gnome --size ${size} gnuradio-grc; \
-               xdg-icon-resource uninstall --context apps --size ${size} gnuradio-grc; \
+               xdg-icon-resource uninstall --noupdate --context mimetypes --theme gnome --size ${size} application-gnuradio-grc; \
+               xdg-icon-resource uninstall --noupdate --context mimetypes --size ${size} application-gnuradio-grc; \
+               xdg-icon-resource uninstall --noupdate --context apps --theme gnome --size ${size} gnuradio-grc; \
+               xdg-icon-resource uninstall --noupdate --context apps --size ${size} gnuradio-grc; \
        done
+       xdg-icon-resource forceupdate
        echo "Uninstall mime type"
        xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml
        echo "Uninstall menu items"
index dd39b095de5a0c14920ee1db2bed655c43e5ae1a..bd03eb5cdbfc7d078578a59fd8690be23e0fd4b4 100644 (file)
@@ -75,42 +75,48 @@ class Block(_Block, _GUIBlock):
                Add and remove ports to adjust for the nports.
                """
                _Block.rewrite(self)
+
+               def insert_port(get_ports, get_port, key):
+                       prev_port = get_port(str(int(key)-1))
+                       get_ports().insert(
+                               get_ports().index(prev_port)+1,
+                               prev_port.copy(new_key=key),
+                       )
+                       #restore integer contiguity after insertion
+                       for i, port in enumerate(get_ports()): port._key = str(i)
+
+               def remove_port(get_ports, get_port, key):
+                       port = get_port(key)
+                       for connection in port.get_connections():
+                               self.get_parent().remove_element(connection)
+                       get_ports().remove(port)
+                       #restore integer contiguity after insertion
+                       for i, port in enumerate(get_ports()): port._key = str(i)
+
                #adjust nports
                for get_ports, get_port in (
                        (self.get_sources, self.get_source),
                        (self.get_sinks, self.get_sink),
                ):
-                       #how many streaming (non-message) ports?
-                       num_ports = len(filter(lambda p: p.get_type() != 'msg', get_ports()))
-                       #do nothing for 0 ports
-                       if not num_ports: continue
-                       #get the nports setting
-                       port0 = get_port(str(0))
-                       nports = port0.get_nports()
-                       #do nothing for no nports
-                       if not nports: continue
-                       #do nothing if nports is already num ports
-                       if nports == num_ports: continue
-                       #remove excess ports and connections
-                       if nports < num_ports:
-                               #remove the connections
-                               for key in map(str, range(nports, num_ports)):
-                                       port = get_port(key)
-                                       for connection in port.get_connections():
-                                               self.get_parent().remove_element(connection)
-                               #remove the ports
-                               for key in map(str, range(nports, num_ports)):
-                                       get_ports().remove(get_port(key))
-                               continue
-                       #add more ports
-                       if nports > num_ports:
-                               for key in map(str, range(num_ports, nports)):
-                                       prev_port = get_port(str(int(key)-1))
-                                       get_ports().insert(
-                                               get_ports().index(prev_port)+1,
-                                               prev_port.copy(new_key=key),
-                                       )
-                               continue
+                       master_ports = filter(lambda p: p.get_nports(), get_ports())
+                       for i, master_port in enumerate(master_ports):
+                               nports = master_port.get_nports()
+                               index_first = get_ports().index(master_port)
+                               try: index_last = get_ports().index(master_ports[i+1])
+                               except IndexError: index_last = len(get_ports())
+                               num_ports = index_last - index_first
+                               #do nothing if nports is already num ports
+                               if nports == num_ports: continue
+                               #remove excess ports and connections
+                               if nports < num_ports:
+                                       for key in map(str, range(index_first+nports, index_first+num_ports)):
+                                               remove_port(get_ports, get_port, key)
+                                       continue
+                               #add more ports
+                               if nports > num_ports:
+                                       for key in map(str, range(index_first+num_ports, index_first+nports)):
+                                               insert_port(get_ports, get_port, key)
+                                       continue
 
        def port_controller_modify(self, direction):
                """
@@ -119,10 +125,8 @@ class Block(_Block, _GUIBlock):
                @return true for change
                """
                changed = False
-               #concat the nports string from the private nports settings of both port0
-               nports_str = \
-                       (self.get_sinks() and self.get_sinks()[0]._nports or '') + \
-                       (self.get_sources() and self.get_sources()[0]._nports or '')
+               #concat the nports string from the private nports settings of all ports
+               nports_str = ' '.join([port._nports for port in self.get_ports()])
                #modify all params whose keys appear in the nports string
                for param in self.get_params():
                        if param.is_enum() or param.get_key() not in nports_str: continue
index 6965371df8a9e922dbeb808d78da53bf93c81a59..6e5a5c59f2a24045750caa8598e120291dcecaa0 100644 (file)
@@ -167,5 +167,7 @@ class Port(_Port, _GUIPort):
 
        def copy(self, new_key=None):
                n = self._n.copy()
+               #remove nports from the key so the copy cannot be a duplicator
+               if n.has_key('nports'): n.pop('nports')
                if new_key: n['key'] = new_key
                return self.__class__(self.get_parent(), n, self._dir)
index c371b023b539b79ec257133efe28bb36b6e837c5..514b24d8b0f26b6a44aa2f24f6b3b7267f1af557 100644 (file)
@@ -163,6 +163,27 @@ pmt_t pmt_from_long(long x);
  */
 long pmt_to_long(pmt_t x);
 
+/*
+ * ------------------------------------------------------------------------
+ *                            uint64_t
+ * ------------------------------------------------------------------------
+ */
+
+//! Return true if \p x is an uint64 number, else false
+bool pmt_is_uint64(pmt_t x);
+
+//! Return the pmt value that represents the uint64 \p x.
+pmt_t pmt_from_uint64(uint64_t x);
+
+/*!
+ * \brief Convert pmt to uint64 if possible.
+ *
+ * When \p x represents an exact integer that fits in a uint64,
+ * return that uint64.  Else raise an exception, either wrong_type
+ * when x is not an exact uint64, or out_of_range when it doesn't fit.
+ */
+uint64_t pmt_to_uint64(pmt_t x);
+
 /*
  * ------------------------------------------------------------------------
  *                             Reals
index 1bcd26e90717feed2d578c59dcddcb7519d77adc..5c3302f199d53a1dca51fe9e2353b98e75e23742 100644 (file)
@@ -23,8 +23,8 @@ include $(top_srcdir)/Makefile.common
 
 SUBDIRS = pmt msg
 
-AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
-
+AM_CPPFLAGS = $(DEFINES) $(GRUEL_INCLUDES) $(BOOST_CPPFLAGS) \
+       $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
 
 TESTS = test_gruel
 
index 13a657067472865f3fec4a94ea7761740a6dcf97..9dbaf10f5323f9583dc754493a18d164644cadf1 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,7 +21,8 @@
 
 include $(top_srcdir)/Makefile.common
 
-AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(DEFINES) $(GRUEL_INCLUDES) \
+       $(BOOST_CPPFLAGS) $(WITH_INCLUDES)
 
 noinst_LTLIBRARIES = libmsg.la
 
index 8750cbdf8370788fdafbebbc6e9ef5d6efddd58e..d3efc1afa3093ae97ff15f3361809a821d453388 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,8 +21,8 @@
 
 include $(top_srcdir)/Makefile.common
 
-AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
-
+AM_CPPFLAGS = $(DEFINES) $(GRUEL_INCLUDES) $(BOOST_CPPFLAGS) \
+       $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
 
 noinst_LTLIBRARIES = libpmt.la
 
index aa1688d24a8b69f18fda47fb9393e3cb5b43f8a8..f9cf6b4bf681b3172786e6d4df0304d312f95023 100644 (file)
@@ -105,6 +105,12 @@ _integer(pmt_t x)
   return dynamic_cast<pmt_integer*>(x.get());
 }
 
+static pmt_uint64 *
+_uint64(pmt_t x)
+{
+  return dynamic_cast<pmt_uint64*>(x.get());
+}
+
 static pmt_real *
 _real(pmt_t x)
 {
@@ -304,6 +310,40 @@ pmt_to_long(pmt_t x)
   throw pmt_wrong_type("pmt_to_long", x);
 }
 
+////////////////////////////////////////////////////////////////////////////
+//                             Uint64
+////////////////////////////////////////////////////////////////////////////
+
+pmt_uint64::pmt_uint64(uint64_t value) : d_value(value) {}
+
+bool
+pmt_is_uint64(pmt_t x)
+{
+  return x->is_uint64();
+}
+
+
+pmt_t
+pmt_from_uint64(uint64_t x)
+{
+  return pmt_t(new pmt_uint64(x));
+}
+
+uint64_t
+pmt_to_uint64(pmt_t x)
+{
+  if(x->is_uint64())
+    return _uint64(x)->value();
+  if(x->is_integer())
+    {
+    long tmp = _integer(x)->value();
+    if(tmp >= 0)
+        return (uint64_t) tmp;
+    }
+
+  throw pmt_wrong_type("pmt_to_uint64", x);
+}
+
 ////////////////////////////////////////////////////////////////////////////
 //                              Real
 ////////////////////////////////////////////////////////////////////////////
@@ -929,6 +969,9 @@ pmt_eqv(const pmt_t& x, const pmt_t& y)
   if (x->is_integer() && y->is_integer())
     return _integer(x)->value() == _integer(y)->value();
 
+  if (x->is_uint64() && y->is_uint64())
+    return _uint64(x)->value() == _uint64(y)->value();
+
   if (x->is_real() && y->is_real())
     return _real(x)->value() == _real(y)->value();
 
@@ -947,6 +990,9 @@ pmt_eqv_raw(pmt_base *x, pmt_base *y)
   if (x->is_integer() && y->is_integer())
     return _integer(x)->value() == _integer(y)->value();
 
+  if (x->is_uint64() && y->is_uint64())
+    return _uint64(x)->value() == _uint64(y)->value();
+
   if (x->is_real() && y->is_real())
     return _real(x)->value() == _real(y)->value();
 
@@ -1328,6 +1374,7 @@ pmt_dump_sizeof()
   printf("sizeof(pmt_bool)           = %3zd\n", sizeof(pmt_bool));
   printf("sizeof(pmt_symbol)         = %3zd\n", sizeof(pmt_symbol));
   printf("sizeof(pmt_integer)        = %3zd\n", sizeof(pmt_integer));
+  printf("sizeof(pmt_uint64)         = %3zd\n", sizeof(pmt_uint64));
   printf("sizeof(pmt_real)           = %3zd\n", sizeof(pmt_real));
   printf("sizeof(pmt_complex)        = %3zd\n", sizeof(pmt_complex));
   printf("sizeof(pmt_null)           = %3zd\n", sizeof(pmt_null));
index 50683ffb525365ec10d6d39debe350be27d4c59b..ea28e37b41cc9630084947c1dd6c039ab8809216 100644 (file)
@@ -47,6 +47,7 @@ public:
   virtual bool is_symbol()  const { return false; }
   virtual bool is_number()  const { return false; }
   virtual bool is_integer() const { return false; }
+  virtual bool is_uint64()  const { return false; }
   virtual bool is_real()    const { return false; }
   virtual bool is_complex() const { return false; }
   virtual bool is_null()    const { return false; }
@@ -118,6 +119,19 @@ public:
   long value() const { return d_value; }
 };
 
+class pmt_uint64 : public pmt_base
+{
+public:
+  uint64_t             d_value;
+
+  pmt_uint64(uint64_t value);
+  //~pmt_uint64(){}
+
+  bool is_number()  const { return true; }
+  bool is_uint64() const { return true; }
+  uint64_t value() const { return d_value; }
+};
+
 class pmt_real : public pmt_base
 {
 public:
index 179e6b72cb4f0450bfde2ced2e9711e38d717b79..b909c1b64b8210f5f182ebd73baef4c7050d4fc3 100644 (file)
@@ -64,6 +64,8 @@ pmt_write(pmt_t obj, std::ostream &port)
   else if (pmt_is_number(obj)){
     if (pmt_is_integer(obj))
       port << pmt_to_long(obj);
+    else if (pmt_is_uint64(obj))
+      port << pmt_to_uint64(obj);
     else if (pmt_is_real(obj))
       port << pmt_to_double(obj);
     else if (pmt_is_complex(obj)){
index f2414c72cdc18528b9c3aebcf63298822473c573..985361f13f36e5fa7e0286703757b5b18eb07fe1 100644 (file)
@@ -103,6 +103,19 @@ qa_pmt_prims::test_integers()
   CPPUNIT_ASSERT_EQUAL(1L, pmt_to_long(p1));
 }
 
+void
+qa_pmt_prims::test_uint64s()
+{
+  pmt_t p1 = pmt_from_uint64((uint64_t)1);
+  pmt_t m1 = pmt_from_uint64((uint64_t)8589934592ULL);
+  CPPUNIT_ASSERT(!pmt_is_uint64(PMT_T));
+  CPPUNIT_ASSERT(pmt_is_uint64(p1));
+  CPPUNIT_ASSERT(pmt_is_uint64(m1));
+  CPPUNIT_ASSERT_THROW(pmt_to_uint64(PMT_T), pmt_wrong_type);
+  CPPUNIT_ASSERT_EQUAL((uint64_t)8589934592ULL, (uint64_t)pmt_to_uint64(m1));
+  CPPUNIT_ASSERT_EQUAL((uint64_t)1ULL, (uint64_t)pmt_to_uint64(p1));
+}
+
 void
 qa_pmt_prims::test_reals()
 {
index 29ba02f11cb28bcf50d0e547a4d46c593be9047d..efc5c6050650ecc04eba810570f135013872ec8e 100644 (file)
@@ -31,6 +31,7 @@ class qa_pmt_prims : public CppUnit::TestCase {
   CPPUNIT_TEST(test_symbols);
   CPPUNIT_TEST(test_booleans);
   CPPUNIT_TEST(test_integers);
+  CPPUNIT_TEST(test_uint64s);
   CPPUNIT_TEST(test_reals);
   CPPUNIT_TEST(test_complexes);
   CPPUNIT_TEST(test_pairs);
@@ -52,6 +53,7 @@ class qa_pmt_prims : public CppUnit::TestCase {
   void test_symbols();
   void test_booleans();
   void test_integers();
+  void test_uint64s();
   void test_reals();
   void test_complexes();
   void test_pairs();
index 669303447c6d5dad78831d363a495f5f33b40710..2c9528b0ab192905deb3da1189e47505e0ea97db 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006,2009 Free Software Foundation, Inc.
+ * Copyright 2006,2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  */
 
 #include <cppunit/TextTestRunner.h>
+#include <cppunit/XmlOutputter.h>
+
+#include <stdlib.h>
+#include <sys/stat.h>
+
 #include "pmt/qa_pmt.h"
 
+static void get_unittest_path (const char *filename, char *fullpath, size_t pathsize);
+
 int 
 main(int argc, char **argv)
 {
+  char path[200];
+  get_unittest_path ("gruel.xml", path, 200);
   
-  CppUnit::TextTestRunner      runner;
+  CppUnit::TextTestRunner runner;
+  std::ofstream xmlfile(path);
+  CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
 
   runner.addTest(qa_pmt::suite ());
+  runner.setOutputter(xmlout);
   
   bool was_successful = runner.run("", false);
 
   return was_successful ? 0 : 1;
 }
+
+
+// NOTE: These are defined in gr_unittest.h for the rest of the project;
+// rewriting here since we don't depend on gnuradio-core in gruel
+
+#ifdef MKDIR_TAKES_ONE_ARG
+#define gr_mkdir(pathname, mode) mkdir(pathname)
+#else
+#define gr_mkdir(pathname, mode) mkdir((pathname), (mode))
+#endif
+
+/*
+ * Mostly taken from gr_preferences.cc/h
+ * The simplest thing that could possibly work:
+ *  the key is the filename; the value is the file contents.
+ */
+
+static void
+ensure_unittest_path (const char *path)
+{
+  struct stat statbuf;
+  if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
+    return;
+
+  // blindly try to make it    // FIXME make this robust. C++ SUCKS!
+  gr_mkdir (path, 0750);
+}
+
+static void
+get_unittest_path (const char *filename, char *fullpath, size_t pathsize)
+{
+  char path[200];
+  snprintf (path, sizeof(path), "./.unittests");
+  snprintf (fullpath, pathsize, "%s/%s", path, filename);
+
+  ensure_unittest_path(path);
+}
+
index 5043b1471f9aa06b4b2937166e6113cd92c1c435..33c5bcf03d3daca1a7e2373822505e92ff7f184a 100644 (file)
@@ -73,16 +73,6 @@ CREATE_SUBDIRS         = NO
 
 OUTPUT_LANGUAGE        = English
 
-# This tag can be used to specify the encoding used in the generated output. 
-# The encoding is not always determined by the language that is chosen, 
-# but also whether or not the output is meant for Windows or non-Windows users. 
-# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
-# forces the Windows encoding (this is the default for the Windows binary), 
-# whereas setting the tag to NO uses a Unix-style encoding (the default for 
-# all platforms other than Windows).
-
-USE_WINDOWS_ENCODING   = NO
-
 # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
 # include brief member descriptions after the members that are listed in 
 # the file and class documentation (similar to JavaDoc). 
@@ -167,13 +157,6 @@ JAVADOC_AUTOBRIEF      = NO
 
 MULTILINE_CPP_IS_BRIEF = NO
 
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member 
-# documentation.
-
-DETAILS_AT_TOP         = YES
-
 # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
 # member inherits the documentation from any documented member that it 
 # re-implements.
@@ -1118,32 +1101,40 @@ DOT_PATH               =
 
 DOTFILE_DIRS           = 
 
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
-# large images.
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
 
-MAX_DOT_GRAPH_WIDTH    = 1024
+DOT_GRAPH_MAX_NODES    = 50
 
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
-# large images.
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
 
-MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
 
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes that 
-# lay further from the root node will be omitted. Note that setting this option to 
-# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
-# note that a graph may be further truncated if the graph's image dimensions are 
-# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
-# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
 
-MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = YES
 
 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
 # generate a legend page explaining the meaning of the various boxes and 
index 8fb9143eb7a25fcfbea75cbd3c5f4a03d2d9cf88..0c908e3d55b05ba688e8952da054d960b0d7ceab 100755 (executable)
@@ -65,6 +65,7 @@ daughterboards = {
     'rfx900_mimo_b'   : ((FLEX_900_TX_MIMO_B, 0x0000),     (FLEX_900_RX_MIMO_B, 0x0000)),
     'rfx1200_mimo_b'  : ((FLEX_1200_TX_MIMO_B, 0x0000),    (FLEX_1200_RX_MIMO_B, 0x0000)),
     'rfx1800_mimo_b'  : ((FLEX_1800_TX_MIMO_B, 0x0000),    (FLEX_1800_RX_MIMO_B, 0x0000)),
+    'rfx2200_mimo_b'  : ((FLEX_2200_TX_MIMO_B, 0x0000),    (FLEX_2200_RX_MIMO_B, 0x0000)),
     'rfx2400_mimo_b'  : ((FLEX_2400_TX_MIMO_B, 0x0000),    (FLEX_2400_RX_MIMO_B, 0x0000)),
     'lftx'            : ((LF_TX, 0x0000),           None),
     'lfrx'            : (None,                      (LF_RX, 0x0000)),
index 0c834402d0e44f8fa4f70bec409bc85672fef007..70a55514ee5188fa4c0938567577cb229b796805 100644 (file)
@@ -138,6 +138,18 @@ protected:
 
 //----------------------------------------------------------------------
 
+class _2200_common : public _AD4360_common
+{
+ public:
+  _2200_common();
+  ~_2200_common() {}
+  double freq_min();
+  double freq_max();
+};
+
+//----------------------------------------------------------------------
+
 class _2400_common : public _AD4360_common
 {
  public:
@@ -212,6 +224,34 @@ public:
 
 //------------------------------------------------------------    
 
+class db_flexrf_2200_tx : public flexrf_base_tx
+{
+ public:
+  db_flexrf_2200_tx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_2200_tx();
+
+  // Wrapper calls to d_common functions
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+class db_flexrf_2200_rx : public flexrf_base_rx
+{
+public:
+  db_flexrf_2200_rx(usrp_basic_sptr usrp, int which);
+  ~db_flexrf_2200_rx();
+  
+  float gain_min();
+  float gain_max();
+  float gain_db_per_step();
+  bool i_and_q_swapped();
+
+  bool _compute_regs(double freq, int &retR, int &retcontrol,
+                    int &retN, double &retfreq);
+};
+
+//------------------------------------------------------------    
+
 class db_flexrf_2400_tx : public flexrf_base_tx
 {
  public:
index 8611d4787debec97b1c56d03310d01bce1189cf5..9a7829278731f1d1fa06c8186131b4b9912379ed 100644 (file)
@@ -30,7 +30,7 @@ class adf4350;
 class wbxng_base : public db_base
 {
 public:
-  wbxng_base(usrp_basic_sptr usrp, int which, int _power_on=0);
+  wbxng_base(usrp_basic_sptr usrp, int which);
   ~wbxng_base();
 
   struct freq_result_t set_freq(double freq);
@@ -40,31 +40,30 @@ public:
   double freq_max();
 
 protected:
-  bool _lock_detect();
+  void _write_spi(std::string data);
+  int _refclk_divisor();
+  bool _get_locked();
   bool _set_pga(float pga_gain);
 
-  int power_on() { return d_power_on; }
-  int power_off() { return 0; }
-
   bool d_first;
   int  d_spi_format;
   int  d_spi_enable;
   int  d_power_on;
   int  d_PD;
 
-  adf4350 *d_common;
+  boost::shared_ptr<adf4350> d_common;
 };
 
 // ----------------------------------------------------------------
 
-class wbxng_base_tx : public wbxng_base
+class db_wbxng_tx : public wbxng_base
 {
 protected:
   void shutdown();
 
 public:
-  wbxng_base_tx(usrp_basic_sptr usrp, int which, int _power_on=0);
-  ~wbxng_base_tx();
+  db_wbxng_tx(usrp_basic_sptr usrp, int which);
+  ~db_wbxng_tx();
 
   float gain_min();
   float gain_max();
@@ -75,36 +74,20 @@ public:
   bool set_gain(float gain);
 };
 
-class wbxng_base_rx : public wbxng_base
+class db_wbxng_rx : public wbxng_base
 {
 protected:
   void shutdown();
   bool _set_attn(float attn);
 
 public:
-  wbxng_base_rx(usrp_basic_sptr usrp, int which, int _power_on=0);
-  ~wbxng_base_rx();
+  db_wbxng_rx(usrp_basic_sptr usrp, int which);
+  ~db_wbxng_rx();
 
   bool set_auto_tr(bool on);
   bool select_rx_antenna(int which_antenna);
   bool select_rx_antenna(const std::string &which_antenna);
   bool set_gain(float gain);
-};
-
-// ----------------------------------------------------------------
-
-class db_wbxng_tx : public wbxng_base_tx
-{
- public:
-  db_wbxng_tx(usrp_basic_sptr usrp, int which);
-  ~db_wbxng_tx();
-};
-
-class db_wbxng_rx : public wbxng_base_rx
-{
-public:
-  db_wbxng_rx(usrp_basic_sptr usrp, int which);
-  ~db_wbxng_rx();
 
   float gain_min();
   float gain_max();
index 23889fc85a25822b313dcb62883c0f08a684c028..b8b60fa98407ab4615ca24e0ce5b7ecacbd10c11 100644 (file)
@@ -33,7 +33,7 @@ libusrp_la_common_LIBADD =            \
 
 # darwin fusb requires gruel (for threading)
 if FUSB_TECH_darwin
-AM_CPPFLAGS = $(common_INCLUDES) $(GRUEL_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(GRUEL_INCLUDES) $(common_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES)
 libusrp_la_LIBADD = $(libusrp_la_common_LIBADD) $(GRUEL_LA)
 libusrp_la_LDFLAGS = $(libusrp_la_common_LDFLAGS) -framework CoreFoundation
 else
index 1cb4634296d8a5569adf071bbd7a9e01a6b92319..b4fb45c517a9a1fa1979fd0ffb8622e0039f2499 100644 (file)
@@ -238,7 +238,7 @@ int
 db_base::_refclk_divisor()
 {
   // Return value to stick in REFCLK_DIVISOR register
-  throw std::runtime_error("_reflck_divisor() called from base class\n");;
+  throw std::runtime_error("_refclk_divisor() called from base class\n");;
 }
 
 bool
index 07ac2be3bc22e1cafc1479e5dee61e2d31b9c245..2819c19bd79f73c443a3c0c13fd690e3b76f5947 100644 (file)
@@ -639,6 +639,38 @@ _AD4360_common::_prescaler()
 
 //----------------------------------------------------------------------
 
+_2200_common::_2200_common()
+  : _AD4360_common()
+{
+  // Band-specific R-Register Values
+  d_R_DIV = 16;  // bits 15:2
+   
+  // Band-specific C-Register values
+  d_P = 1;        // bits 23,22   Div by 16/17
+  d_CP2 = 7;      // bits 19:17
+  d_CP1 = 7;      // bits 16:14
+
+  // Band specifc N-Register Values
+  d_DIVSEL = 0;   // bit 23
+  d_DIV2 = 0;     // bit 22
+  d_CPGAIN = 0;   // bit 21
+  d_freq_mult = 1;
+}
+
+double
+_2200_common::freq_min()
+{
+  return 2000e6;
+}
+
+double
+_2200_common::freq_max()
+{
+  return 2400e6;
+}
+
+//----------------------------------------------------------------------
+
 _2400_common::_2400_common()
   : _AD4360_common()
 {
@@ -811,6 +843,72 @@ _400_rx::_400_rx()
 
 //------------------------------------------------------------    
 
+db_flexrf_2200_tx::db_flexrf_2200_tx(usrp_basic_sptr usrp, int which)
+  : flexrf_base_tx(usrp, which)
+{
+  d_common = new _2200_common();
+}
+
+db_flexrf_2200_tx::~db_flexrf_2200_tx()
+{
+}
+
+bool
+db_flexrf_2200_tx::_compute_regs(double freq, int &retR, int &retcontrol,
+                                int &retN, double &retfreq)
+{
+  return d_common->_compute_regs(_refclk_freq(), freq, retR,
+                                retcontrol, retN, retfreq);
+}
+
+
+
+db_flexrf_2200_rx::db_flexrf_2200_rx(usrp_basic_sptr usrp, int which)
+  : flexrf_base_rx(usrp, which)
+{
+  d_common = new _2200_common();
+  set_gain((gain_min() + gain_max()) / 2.0);  // initialize gain
+}
+
+db_flexrf_2200_rx::~db_flexrf_2200_rx()
+{
+}
+
+float
+db_flexrf_2200_rx::gain_min()
+{
+  return usrp()->pga_min();
+}
+
+float
+db_flexrf_2200_rx::gain_max()
+{
+  return usrp()->pga_max()+70;
+}
+
+float
+db_flexrf_2200_rx::gain_db_per_step()
+{
+  return 0.05;
+}
+
+
+bool
+db_flexrf_2200_rx::i_and_q_swapped()
+{
+  return true;
+}
+
+bool
+db_flexrf_2200_rx::_compute_regs(double freq, int &retR, int &retcontrol,
+                                int &retN, double &retfreq)
+{
+  return d_common->_compute_regs(_refclk_freq(), freq, retR,
+                                retcontrol, retN, retfreq);
+}
+
+//------------------------------------------------------------    
+
 db_flexrf_2400_tx::db_flexrf_2400_tx(usrp_basic_sptr usrp, int which)
   : flexrf_base_tx(usrp, which)
 {
index bd836dfe331090724a18c8c9f414ec274dd66032..89200653ea6f8e646ebe13c501870ba64963d871 100644 (file)
@@ -46,8 +46,8 @@
 #define ATTN_SHIFT     8
 #define ATTN_MASK      (63 << ATTN_SHIFT)
 
-wbxng_base::wbxng_base(usrp_basic_sptr _usrp, int which, int _power_on)
-  : db_base(_usrp, which), d_power_on(_power_on)
+wbxng_base::wbxng_base(usrp_basic_sptr _usrp, int which)
+  : db_base(_usrp, which)
 {
   /*
     @param usrp: instance of usrp.source_c
@@ -67,8 +67,12 @@ wbxng_base::wbxng_base(usrp_basic_sptr _usrp, int which, int _power_on)
 
 wbxng_base::~wbxng_base()
 {
-  if (d_common)
-    delete d_common;
+}
+
+int
+wbxng_base::_refclk_divisor()
+{
+  return 1;
 }
 
 struct freq_result_t
@@ -83,8 +87,19 @@ wbxng_base::set_freq(double freq)
   // clamp freq
   freq_t int_freq = freq_t(std::max(freq_min(), std::min(freq, freq_max())));
 
-  bool ok = d_common->_set_freq(int_freq*2);
-  double freq_result = (double) d_common->_get_freq()/2.0;
+  bool ok = d_common->_set_freq(int_freq*2, _refclk_freq());
+
+  _write_spi(d_common->compute_register(5));
+  _write_spi(d_common->compute_register(4));
+  _write_spi(d_common->compute_register(3));
+  /* load involved registers */
+  _write_spi(d_common->compute_register(2));
+  _write_spi(d_common->compute_register(1));
+  _write_spi(d_common->compute_register(0));
+
+  double freq_result = (double) d_common->_get_freq(_refclk_freq())/2.0;
+
+  //ok &= _get_locked();
   struct freq_result_t args = {ok, freq_result};
 
   /* Wait before reading Lock Detect*/
@@ -144,10 +159,22 @@ wbxng_base::freq_max()
   return (double) d_common->_get_max_freq()/2.0;
 }
 
+bool
+wbxng_base::_get_locked(void)
+{
+    return usrp()->read_io(d_which) & PLL_LOCK_DETECT;
+}
+
+void
+wbxng_base::_write_spi(std::string data)
+{
+    usrp()->_write_spi(0, d_spi_enable, d_spi_format, data);
+}
+
 // ----------------------------------------------------------------
 
-wbxng_base_tx::wbxng_base_tx(usrp_basic_sptr _usrp, int which, int _power_on)
-  : wbxng_base(_usrp, which, _power_on)
+db_wbxng_tx::db_wbxng_tx(usrp_basic_sptr _usrp, int which)
+  : wbxng_base(_usrp, which)
 {
   /*
     @param usrp: instance of usrp.sink_c
@@ -161,40 +188,48 @@ wbxng_base_tx::wbxng_base_tx(usrp_basic_sptr _usrp, int which, int _power_on)
     d_spi_enable = SPI_ENABLE_TX_B;
   }
 
-  d_common = new adf4350(_usrp, d_which, d_spi_enable);
+  d_common = boost::shared_ptr<adf4350> (new adf4350());
+
+  /* Initialize the registers. */
+  _write_spi(d_common->compute_register(5));
+  _write_spi(d_common->compute_register(4));
+  _write_spi(d_common->compute_register(3));
+  _write_spi(d_common->compute_register(2));
+  _write_spi(d_common->compute_register(1));
+  _write_spi(d_common->compute_register(0));
 
   // power up the transmit side, but don't enable the mixer
-  usrp()->_write_oe(d_which,(RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5), (RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5));
-  usrp()->write_io(d_which, (power_on()|RX_TXN|ENABLE_33|ENABLE_5), (RX_TXN|ENABLE_33|ENABLE_5));
+  usrp()->_write_oe(d_which,(PLL_CE|PLL_PDBRF|RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX_TXN|TXMOD_EN|ENABLE_33|ENABLE_5));
+  usrp()->write_io(d_which, (PLL_CE|RX_TXN|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX_TXN|ENABLE_33|ENABLE_5));
   //set_lo_offset(4e6);
   
   // Disable VCO/PLL
-  d_common->_enable(true);
+  //d_common->_enable(true);
+  usrp()->write_io(d_which, (PLL_PDBRF), (PLL_PDBRF));
 
-  set_gain((gain_min() + gain_max()) / 2.0);  // initialize gain
+  set_gain(gain_min());  // initialize gain
 }
 
-wbxng_base_tx::~wbxng_base_tx()
+db_wbxng_tx::~db_wbxng_tx()
 {
   shutdown();
 }
 
-
 void
-wbxng_base_tx::shutdown()
+db_wbxng_tx::shutdown()
 {
-  // fprintf(stderr, "wbxng_base_tx::shutdown  d_is_shutdown = %d\n", d_is_shutdown);
+  // fprintf(stderr, "db_wbxng_tx::shutdown  d_is_shutdown = %d\n", d_is_shutdown);
 
   if (!d_is_shutdown){
     d_is_shutdown = true;
     // do whatever there is to do to shutdown
 
     // Disable VCO/PLL
-    d_common->_enable(false);
+    //d_common->_enable(false);
+    usrp()->write_io(d_which, 0, (PLL_PDBRF));
 
     // Power down and leave the T/R switch in the R position
-    usrp()->write_io(d_which, (power_off()|RX_TXN), (RX_TXN|ENABLE_33|ENABLE_5));
-
+    usrp()->write_io(d_which, (RX_TXN), (PLL_CE|PLL_PDBRF|RX_TXN|ENABLE_33|ENABLE_5));
 
     /*
     _write_control(_compute_control_reg());
@@ -205,7 +240,7 @@ wbxng_base_tx::shutdown()
 }
 
 bool
-wbxng_base_tx::set_auto_tr(bool on)
+db_wbxng_tx::set_auto_tr(bool on)
 {
   bool ok = true;
   if(on) {
@@ -222,7 +257,7 @@ wbxng_base_tx::set_auto_tr(bool on)
 }
 
 bool
-wbxng_base_tx::set_enable(bool on)
+db_wbxng_tx::set_enable(bool on)
 {
   /*
     Enable transmitter if on is true
@@ -244,25 +279,25 @@ wbxng_base_tx::set_enable(bool on)
 }
 
 float
-wbxng_base_tx::gain_min()
+db_wbxng_tx::gain_min()
 {
   return 0.0;
 }
 
 float
-wbxng_base_tx::gain_max()
+db_wbxng_tx::gain_max()
 {
   return 25.0;
 }
 
 float
-wbxng_base_tx::gain_db_per_step()
+db_wbxng_tx::gain_db_per_step()
 {
   return gain_max()/(1+(1.4-0.5)*4096/3.3);
 }
 
 bool
-wbxng_base_tx::set_gain(float gain)
+db_wbxng_tx::set_gain(float gain)
 {
   /*
     Set the gain.
@@ -299,8 +334,8 @@ wbxng_base_tx::set_gain(float gain)
 /**************************************************************************/
 
 
-wbxng_base_rx::wbxng_base_rx(usrp_basic_sptr _usrp, int which, int _power_on)
-  : wbxng_base(_usrp, which, _power_on)
+db_wbxng_rx::db_wbxng_rx(usrp_basic_sptr _usrp, int which)
+  : wbxng_base(_usrp, which)
 {
   /*
     @param usrp: instance of usrp.source_c
@@ -314,15 +349,24 @@ wbxng_base_rx::wbxng_base_rx(usrp_basic_sptr _usrp, int which, int _power_on)
     d_spi_enable = SPI_ENABLE_RX_B;
   }
 
-  d_common = new adf4350(_usrp, d_which, d_spi_enable);
-  
-  // Disable VCO/PLL
-  d_common->_enable(true);
+  d_common = boost::shared_ptr<adf4350> (new adf4350());
 
-  usrp()->_write_oe(d_which, (RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5), (RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5));
-  usrp()->write_io(d_which,  (power_on()|RX2_RX1N|RXBB_EN|ENABLE_33|ENABLE_5), (RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5));
+  /* Initialize the registers. */
+  _write_spi(d_common->compute_register(5));
+  _write_spi(d_common->compute_register(4));
+  _write_spi(d_common->compute_register(3));
+  _write_spi(d_common->compute_register(2));
+  _write_spi(d_common->compute_register(1));
+  _write_spi(d_common->compute_register(0));
+  
+  usrp()->_write_oe(d_which, (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5));
+  usrp()->write_io(d_which,  (PLL_CE|RX2_RX1N|RXBB_EN|ENABLE_33|ENABLE_5), (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5));
   //fprintf(stderr,"Setting WBXNG RXBB on");
 
+  // Enable VCO/PLL
+  //d_common->_enable(true);
+  usrp()->write_io(d_which, (PLL_PDBRF), (PLL_PDBRF));
+
   // set up for RX on TX/RX port
   select_rx_antenna("TX/RX");
 
@@ -331,43 +375,46 @@ wbxng_base_rx::wbxng_base_rx(usrp_basic_sptr _usrp, int which, int _power_on)
   /*
   set_lo_offset(-4e6);
   */
+
+  set_gain(gain_min());  // initialize gain
 }
 
-wbxng_base_rx::~wbxng_base_rx()
+db_wbxng_rx::~db_wbxng_rx()
 {
   shutdown();
 }
 
 void
-wbxng_base_rx::shutdown()
+db_wbxng_rx::shutdown()
 {
-  // fprintf(stderr, "wbxng_base_rx::shutdown  d_is_shutdown = %d\n", d_is_shutdown);
+  // fprintf(stderr, "db_wbxng_rx::shutdown  d_is_shutdown = %d\n", d_is_shutdown);
 
   if (!d_is_shutdown){
     d_is_shutdown = true;
     // do whatever there is to do to shutdown
 
     // Power down VCO/PLL
-    d_common->_enable(false);
+    //d_common->_enable(false);
+    usrp()->write_io(d_which, 0, (PLL_PDBRF));
 
-    // fprintf(stderr, "wbxng_base_rx::shutdown  before _write_control\n");
+    // fprintf(stderr, "db_wbxng_rx::shutdown  before _write_control\n");
     //_write_control(_compute_control_reg());
 
-    // fprintf(stderr, "wbxng_base_rx::shutdown  before _enable_refclk\n");
+    // fprintf(stderr, "db_wbxng_rx::shutdown  before _enable_refclk\n");
     _enable_refclk(false);                       // turn off refclk
 
-    // fprintf(stderr, "wbxng_base_rx::shutdown  before set_auto_tr\n");
+    // fprintf(stderr, "db_wbxng_rx::shutdown  before set_auto_tr\n");
     set_auto_tr(false);
 
     // Power down
-    usrp()->write_io(d_which, power_off(), (RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5));
+    usrp()->write_io(d_which, 0, (PLL_CE|PLL_PDBRF|RX2_RX1N|RXBB_EN|ATTN_MASK|ENABLE_33|ENABLE_5));
 
-    // fprintf(stderr, "wbxng_base_rx::shutdown  after set_auto_tr\n");
+    // fprintf(stderr, "db_wbxng_rx::shutdown  after set_auto_tr\n");
   }
 }
 
 bool
-wbxng_base_rx::set_auto_tr(bool on)
+db_wbxng_rx::set_auto_tr(bool on)
 {
   bool ok = true;
   if(on) {
@@ -384,7 +431,7 @@ wbxng_base_rx::set_auto_tr(bool on)
 }
 
 bool
-wbxng_base_rx::select_rx_antenna(int which_antenna)
+db_wbxng_rx::select_rx_antenna(int which_antenna)
 {
   /*
     Specify which antenna port to use for reception.
@@ -404,7 +451,7 @@ wbxng_base_rx::select_rx_antenna(int which_antenna)
 }
 
 bool
-wbxng_base_rx::select_rx_antenna(const std::string &which_antenna)
+db_wbxng_rx::select_rx_antenna(const std::string &which_antenna)
 {
   /*
     Specify which antenna port to use for reception.
@@ -426,7 +473,7 @@ wbxng_base_rx::select_rx_antenna(const std::string &which_antenna)
 }
 
 bool
-wbxng_base_rx::set_gain(float gain)
+db_wbxng_rx::set_gain(float gain)
 {
   /*
     Set the gain.
@@ -441,7 +488,6 @@ wbxng_base_rx::set_gain(float gain)
   float pga_gain, agc_gain;
 
   float maxgain = gain_max() - usrp()->pga_max();
-  float mingain = gain_min();
   if(gain > maxgain) {
     pga_gain = gain-maxgain;
     assert(pga_gain <= usrp()->pga_max());
@@ -456,7 +502,7 @@ wbxng_base_rx::set_gain(float gain)
 }
 
 bool
-wbxng_base_rx::_set_attn(float attn)
+db_wbxng_rx::_set_attn(float attn)
 {
   int attn_code = int(floor(attn/0.5));
   unsigned int iobits = (~attn_code) << ATTN_SHIFT;
@@ -464,27 +510,6 @@ wbxng_base_rx::_set_attn(float attn)
   return usrp()->write_io(d_which, iobits, ATTN_MASK);
 }
 
-// ----------------------------------------------------------------
-
-db_wbxng_tx::db_wbxng_tx(usrp_basic_sptr usrp, int which)
-  : wbxng_base_tx(usrp, which)
-{
-}
-
-db_wbxng_tx::~db_wbxng_tx()
-{
-}
-
-db_wbxng_rx::db_wbxng_rx(usrp_basic_sptr usrp, int which)
-  : wbxng_base_rx(usrp, which)
-{
-  set_gain((gain_min() + gain_max()) / 2.0);  // initialize gain
-}
-
-db_wbxng_rx::~db_wbxng_rx()
-{
-}
-
 float
 db_wbxng_rx::gain_min()
 {
@@ -503,7 +528,6 @@ db_wbxng_rx::gain_db_per_step()
   return 0.05;
 }
 
-
 bool
 db_wbxng_rx::i_and_q_swapped()
 {
index c17e8d670faddaa04f89e8a8415c42a75c606dcc..f1ab63d821b4dacc81bcf9bf4b4fd3fa0a6dccb5 100644 (file)
@@ -27,9 +27,7 @@
 #include <stdio.h>
 
 #define FREQ_C(freq) uint64_t(freq)
-#define INPUT_REF_FREQ FREQ_C(64e6)
 #define DIV_ROUND(num, denom) (((num) + ((denom)/2))/(denom))
-#define INPUT_REF_FREQ_2X (2*INPUT_REF_FREQ)                            /* input ref freq with doubler turned on */
 #define MIN_INT_DIV uint16_t(23)                                        /* minimum int divider, prescaler 4/5 only */
 #define MAX_RF_DIV uint8_t(16)                                          /* max rf divider, divides rf output */
 #define MIN_VCO_FREQ FREQ_C(2.2e9)                                      /* minimum vco freq */
 #define MUX_PIN       (1 << 1)
 #define LD_PIN        (1 << 0)
 
-adf4350::adf4350(usrp_basic_sptr _usrp, int _which, int _spi_enable)
+adf4350::adf4350()
 {
-    /* Initialize the pin directions. */
-
-    d_usrp = _usrp;
-    d_which = _which;
-    d_spi_enable = _spi_enable;
-    d_spi_format = SPI_FMT_MSB | SPI_FMT_HDR_0;
-
-    d_regs = new adf4350_regs(this);
-
-    /* Outputs */
-    d_usrp->_write_oe(d_which, (CE_PIN | PDB_RF_PIN), (CE_PIN | PDB_RF_PIN));
-    d_usrp->write_io(d_which, (CE_PIN), (CE_PIN | PDB_RF_PIN));
-
-    /* Initialize the pin levels. */
-    _enable(true);
-    /* Initialize the registers. */
-    d_regs->_load_register(5);
-    d_regs->_load_register(4);
-    d_regs->_load_register(3);
-    d_regs->_load_register(2);
-    d_regs->_load_register(1);
-    d_regs->_load_register(0);
+    d_regs = new adf4350_regs();
 }
 
 adf4350::~adf4350()
 {
-    d_usrp->write_io(d_which, (0), (CE_PIN | PDB_RF_PIN));
     delete d_regs;
 }
 
-freq_t
-adf4350::_get_max_freq(void)
-{
-    return MAX_FREQ;
-}
-
-freq_t
-adf4350::_get_min_freq(void)
-{
-    return MIN_FREQ;
-}
-
-bool
-adf4350::_get_locked(void)
-{
-    return d_usrp->read_io(d_which) & LD_PIN;
-}
-
-void
-adf4350::_enable(bool enable)
+std::string
+adf4350::compute_register(uint8_t addr)
 {
-    if (enable){ /* chip enable */
-        d_usrp->write_io(d_which, (PDB_RF_PIN), (PDB_RF_PIN));
-    }else{
-        d_usrp->write_io(d_which, 0, (PDB_RF_PIN));
-    }
-}
+    uint32_t data = d_regs->compute_register(addr);
 
-void
-adf4350::_write(uint8_t addr, uint32_t data)
-{
     data |= addr;
 
-    // create str from data here
+    // create std::string from data here
     char s[4];
     s[0] = (char)((data >> 24) & 0xff);
     s[1] = (char)((data >> 16) & 0xff);
     s[2] = (char)((data >>  8) & 0xff);
     s[3] = (char)(data & 0xff);
-    std::string str(s, 4);
-
-    timespec t;
-    t.tv_sec = 0;
-    t.tv_nsec = 5e6;
+    return std::string(s, 4);
+}
 
-    nanosleep(&t, NULL);
-    d_usrp->_write_spi(0, d_spi_enable, d_spi_format, str);
-    nanosleep(&t, NULL);
+freq_t
+adf4350::_get_max_freq(void)
+{
+    return MAX_FREQ;
+}
 
-    //fprintf(stderr, "Wrote to WBXNG SPI address %d with data %8x\n", addr, data);
-    /* pulse latch */
-    //d_usrp->write_io(d_which, 1, LE_PIN);
-    //d_usrp->write_io(d_which, 0, LE_PIN);
+freq_t
+adf4350::_get_min_freq(void)
+{
+    return MIN_FREQ;
 }
 
 bool
-adf4350::_set_freq(freq_t freq)
+adf4350::_set_freq(freq_t freq, freq_t refclock_freq)
 {
     /* Set the frequency by setting int, frac, mod, r, div */
     if (freq > MAX_FREQ || freq < MIN_FREQ) return false;
@@ -147,7 +96,7 @@ adf4350::_set_freq(freq_t freq)
         d_regs->d_divider_select++; //double the divider
     }
     /* Ramp up the R divider until the N divider is at least the minimum. */
-    //d_regs->d_10_bit_r_counter = INPUT_REF_FREQ*MIN_INT_DIV/freq;
+    //d_regs->d_10_bit_r_counter = refclock_freq*MIN_INT_DIV/freq;
     d_regs->d_10_bit_r_counter = 2;
     uint64_t n_mod;
     do{
@@ -155,7 +104,7 @@ adf4350::_set_freq(freq_t freq)
         n_mod = freq;
         n_mod *= d_regs->d_10_bit_r_counter;
         n_mod *= d_regs->d_mod;
-        n_mod /= INPUT_REF_FREQ;
+        n_mod /= refclock_freq;
         /* calculate int and frac */
         d_regs->d_int = n_mod/d_regs->d_mod;
         d_regs->d_frac = (n_mod - (freq_t)d_regs->d_int*d_regs->d_mod) & uint16_t(0xfff);
@@ -169,38 +118,31 @@ adf4350::_set_freq(freq_t freq)
     }while(d_regs->d_int < min_int_div);
     /* calculate the band select so PFD is under 125 KHz */
     d_regs->d_8_bit_band_select_clock_divider_value = \
-        INPUT_REF_FREQ/(FREQ_C(30e3)*d_regs->d_10_bit_r_counter) + 1;
+        refclock_freq/(FREQ_C(30e3)*d_regs->d_10_bit_r_counter) + 1;
     /*
     fprintf(stderr, "Band Selection: Div %u, Freq %lu\n",
         d_regs->d_8_bit_band_select_clock_divider_value,
-        INPUT_REF_FREQ/(d_regs->d_8_bit_band_select_clock_divider_value * d_regs->d_10_bit_r_counter) + 1
+        refclock_freq/(d_regs->d_8_bit_band_select_clock_divider_value * d_regs->d_10_bit_r_counter) + 1
     );
     */
-    d_regs->_load_register(5);
-    d_regs->_load_register(3);
-    d_regs->_load_register(1);
-    /* load involved registers */
-    d_regs->_load_register(2);
-    d_regs->_load_register(4);
-    d_regs->_load_register(0); /* register 0 must be last */
     return true;
 }
 
 freq_t
-adf4350::_get_freq(void)
+adf4350::_get_freq(freq_t refclock_freq)
 {
     /* Calculate the freq from int, frac, mod, ref, r, div:
      *  freq = (int + frac/mod) * (ref/r)
      * Keep precision by doing multiplies first:
      *  freq = (((((((int)*mod) + frac)*ref)/mod)/r)/div)
      */
-    uint64_t temp;
-    temp = d_regs->d_int;
-    temp *= d_regs->d_mod;
-    temp += d_regs->d_frac;
-    temp *= INPUT_REF_FREQ;
-    temp /= d_regs->d_mod;
-    temp /= d_regs->d_10_bit_r_counter;
-    temp /= (1 << d_regs->d_divider_select);
-    return temp;
+    uint64_t freq;
+    freq = d_regs->d_int;
+    freq *= d_regs->d_mod;
+    freq += d_regs->d_frac;
+    freq *= refclock_freq;
+    freq /= d_regs->d_mod;
+    freq /= d_regs->d_10_bit_r_counter;
+    freq /= (1 << d_regs->d_divider_select);
+    return freq;
 }
index 2b0783c20719e0127eb414cb71f68d50f24eb85f..ce8cbf4b181d85cd3416da054bfcb25b8fed2438 100644 (file)
@@ -31,22 +31,16 @@ class adf4350_regs;
 class adf4350
 {
 public:
-    adf4350(usrp_basic_sptr _usrp, int _which, int _spi_enable);
+    adf4350();
     ~adf4350();
     void _update();
-    bool _get_locked();
-    void _enable(bool enable);
-    void _write(uint8_t addr, uint32_t data);
-    bool _set_freq(freq_t freq);
-    freq_t _get_freq();
+    std::string compute_register(uint8_t addr);
+    bool _set_freq(freq_t freq, freq_t refclock_freq);
+    freq_t _get_freq(freq_t refclock_freq);
     freq_t _get_max_freq();
     freq_t _get_min_freq();
 
 protected:
-    usrp_basic_sptr d_usrp;
-    int d_which;
-    int d_spi_enable;
-    int d_spi_format;
     adf4350_regs *d_regs;
 };
 
index 21d77dcce6d37764919a1e2b902501d21cfb2a76..c9707c3c68040e2f441bdf2ec41426c63251bfc9 100644 (file)
@@ -55,8 +55,7 @@ const uint8_t adf4350_regs::s_output_power = 3;
 /* reg 5 */
 const uint8_t adf4350_regs::s_ld_pin_mode = 1;
 
-adf4350_regs::adf4350_regs(adf4350* _adf4350){
-    d_adf4350 = _adf4350;
+adf4350_regs::adf4350_regs(){
 
     /* reg 0 */
     d_int = uint16_t(100);
@@ -79,19 +78,21 @@ adf4350_regs::~adf4350_regs(void){
 uint32_t
 adf4350_regs::_reg_shift(uint32_t data, uint32_t shift){
         return data << shift;
-    }
+}
 
-void
-adf4350_regs::_load_register(uint8_t addr){
-       uint32_t data;
+uint32_t
+adf4350_regs::compute_register(uint8_t addr){
+       uint32_t data = 0;
        switch (addr){
                case 0: data = (
                        _reg_shift(d_int, 15)                           |
-                       _reg_shift(d_frac, 3)); break;
+                       _reg_shift(d_frac, 3));
+                       break;
                case 1: data = (
                        _reg_shift(d_prescaler, 27)                     |
                        _reg_shift(s_phase, 15)                         |
-                       _reg_shift(d_mod, 3)); break;
+                       _reg_shift(d_mod, 3));
+                       break;
                case 2: data = (
                        _reg_shift(s_low_noise_and_low_spur_modes, 29)  |
                        _reg_shift(s_muxout, 26)                        |
@@ -105,11 +106,13 @@ adf4350_regs::_load_register(uint8_t addr){
                        _reg_shift(s_pd_polarity, 6)                    |
                        _reg_shift(s_power_down, 5)                     |
                        _reg_shift(s_cp_three_state, 4)                 |
-                       _reg_shift(s_counter_reset, 3)); break;
+                       _reg_shift(s_counter_reset, 3));
+                       break;
                case 3: data = (
                        _reg_shift(s_csr, 18)                           |
                        _reg_shift(s_clk_div_mode, 15)                  |
-                       _reg_shift(s_12_bit_clock_divider_value, 3)); break;
+                       _reg_shift(s_12_bit_clock_divider_value, 3));
+                       break;
                case 4: data = (
                        _reg_shift(s_feedback_select, 23)               |
                        _reg_shift(d_divider_select, 20)                |
@@ -120,11 +123,14 @@ adf4350_regs::_load_register(uint8_t addr){
                        _reg_shift(s_aux_output_enable, 8)              |
                        _reg_shift(s_aux_output_power, 6)               |
                        _reg_shift(s_rf_output_enable, 5)               |
-                       _reg_shift(s_output_power, 3)); break;
+                       _reg_shift(s_output_power, 3));
+                       break;
                case 5: data = (
-                       _reg_shift(s_ld_pin_mode, 22)); break;
-               default: return;
+                       _reg_shift(s_ld_pin_mode, 22));
+                       break;
+               default: return data;
        }
-       /* write the data out to spi */
-       d_adf4350->_write(addr, data);
+       /* return the data to write out to spi */
+    return data;
 }
+
index 0018aa07f5a6b1440932ac86ee0b5404fd4db812..33a548e85ba72db2beaefbeeb29bd5bf021b79ee 100644 (file)
@@ -29,13 +29,11 @@ class adf4350;
 class adf4350_regs
 {
 public:
-    adf4350_regs(adf4350* _adf4350);
+    adf4350_regs();
     ~adf4350_regs();
 
-    adf4350* d_adf4350;
-
     uint32_t _reg_shift(uint32_t data, uint32_t shift);
-    void _load_register(uint8_t addr);
+    uint32_t compute_register(uint8_t addr);
 
     /* reg 0 */
     uint16_t d_int;
@@ -75,6 +73,11 @@ public:
     static const uint8_t s_output_power;
     /* reg 5 */
     static const uint8_t s_ld_pin_mode;
+
+protected:
+    usrp_basic_sptr d_usrp;
+    int d_spi_enable;
+    int d_spi_format;
 };
 
 #endif /* ADF4350_REGS_H */
index 5193a5fa0ef18b66f13985864d229205471c3681..2548d737e5cf0d6c1485d362c62bedac3b9ba421 100644 (file)
@@ -61,6 +61,9 @@
 "Flex 1200 Tx MIMO B"  0x002a
 "Flex 2400 Tx MIMO B"  0x002b
 
+"Flex 2200 Rx MIMO B"  0x002c
+"Flex 2200 Tx MIMO B"  0x002d
+
 "Flex 1800 Rx"         0x0030
 "Flex 1800 Tx"         0x0031
 "Flex 1800 Rx MIMO A"  0x0032
index d2e6b8bc10be5e7c6b0f0bbd37b5b88e02456e81..c846f267bd9f7292d12e33439a4c394d71183dfe 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2001,2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc.
+# Copyright 2001,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,8 +23,8 @@ include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS =                  \
        $(USRP_INCLUDES)        \
-       $(PYTHON_CPPFLAGS)      \
        -I$(srcdir)             \
+       $(PYTHON_CPPFLAGS)      \
        $(USB_INCLUDES)         \
        $(WITH_INCLUDES)
 
index 546559010de4bc42a2b6236a77f9d3ebf8197b39..d07d3c1fb4c0a3cf7f9e3146c478cb83f23877ec 100644 (file)
@@ -120,6 +120,16 @@ struct db_rfx_1800_tx {
   struct db_rfx_common common;
 };
 
+struct db_rfx_2200_rx {
+  struct db_base       base;
+  struct db_rfx_common common;
+};
+
+struct db_rfx_2200_tx {
+  struct db_base       base;
+  struct db_rfx_common common;
+};
+
 struct db_rfx_2400_rx {
   struct db_base       base;
   struct db_rfx_common common;
@@ -387,6 +397,70 @@ struct db_rfx_1800_tx db_rfx_1800_tx = {
 };
 
 
+struct db_rfx_2200_rx db_rfx_2200_rx = {
+  .base.dbid = 0x002c,
+  .base.is_tx = false,
+  .base.output_enables = 0x00E0,
+  .base.used_pins = 0x00FF,
+  .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(2000e6),
+  .base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(2400e6),
+  .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+  .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(70),
+  .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0.034),
+  .base.is_quadrature = true,
+  .base.i_and_q_swapped = true,
+  .base.spectrum_inverted = false,
+  .base.default_lo_offset = U2_DOUBLE_TO_FXPT_FREQ(0),
+  .base.init = rfx_init_rx,
+  .base.set_freq = rfx_set_freq,
+  .base.set_gain = rfx_set_gain_rx,
+  .base.set_tx_enable = 0,
+  .base.atr_mask = 0x00E0,
+  .base.atr_txval = 0,
+  .base.atr_rxval = MIX_EN,
+  // .base.atr_tx_delay =
+  // .base.atr_rx_delay =
+  .base.set_antenna = 0,
+  .common.DIV2 = 0,
+  .common.CP1 = 7,
+  .common.CP2 = 7,
+  .common.spi_mask = SPI_SS_RX_DB,
+  .common.freq_mult = 1
+};
+
+
+struct db_rfx_2200_tx db_rfx_2200_tx = {
+  .base.dbid = 0x002d,
+  .base.is_tx = true,
+  .base.output_enables = 0x00E0,
+  .base.used_pins = 0x00FF,
+  .base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(2000e6),
+  .base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(2400e6),
+  //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+  //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+  //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+  .base.is_quadrature = true,
+  .base.i_and_q_swapped = false,
+  .base.spectrum_inverted = false,
+  .base.default_lo_offset = U2_DOUBLE_TO_FXPT_FREQ(12.5e6),
+  .base.init = rfx_init_tx,
+  .base.set_freq = rfx_set_freq,
+  .base.set_gain = rfx_set_gain_tx,
+  .base.set_tx_enable = rfx_set_tx_enable,
+  .base.atr_mask = 0x00E0,
+  .base.atr_txval = MIX_EN, 
+  .base.atr_rxval = ANT_SW,
+  // .base.atr_tx_delay =
+  // .base.atr_rx_delay =
+  .base.set_antenna = 0,
+  .common.DIV2 = 0,
+  .common.CP1 = 7,
+  .common.CP2 = 7,
+  .common.spi_mask = SPI_SS_TX_DB,
+  .common.freq_mult = 1
+};
+
+
 struct db_rfx_2400_rx db_rfx_2400_rx = {
   .base.dbid = 0x0027,
   .base.is_tx = false,
index 4a26898fa7d9f5303f7b3f91ec5bc648d79ff9ee..087ab9e311d96f46696cdcd30f89b8c9fbc72f7d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007, 2008 Free Software Foundation, Inc.
+# Copyright 2007,2008,2010 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,9 +19,9 @@ include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS = \
     $(USRP2_INCLUDES) \
+    $(GRUEL_INCLUDES) \
     $(STD_DEFINES_AND_INCLUDES) \
-    $(CPPUNIT_INCLUDES) \
-    $(GRUEL_INCLUDES)
+    $(CPPUNIT_INCLUDES)
 
 LDADD = \
     $(USRP2_LA) \
index 209cb70953d88886b2aa1759c88cde1f443c8cbd..85bec4673680f58bff173f95e8beae47ad38e6b2 100644 (file)
@@ -19,10 +19,10 @@ include $(top_srcdir)/Makefile.common
 
 AM_CPPFLAGS = \
     $(USRP2_INCLUDES) \
-    $(BOOST_CPPFLAGS) \
+    $(GRUEL_INCLUDES) \
     $(STD_DEFINES_AND_INCLUDES) \
-    $(CPPUNIT_INCLUDES) \
-    $(GRUEL_INCLUDES) 
+    $(BOOST_CPPFLAGS) \
+    $(CPPUNIT_INCLUDES)
 
 bin_PROGRAMS = usrp2_socket_opener
 usrp2_socket_opener_SOURCES = usrp2_socket_opener.cc
index f0ee564be002e6702c34019b3e030c8a305da442..0842482e40b37229c9ef832107fc250e771aba8e 100644 (file)
@@ -38,9 +38,9 @@ namespace usrp2 {
   struct usrp_table_entry {
     // inteface + normalized mac addr ("eth0:01:23:45:67:89:ab")
     std::string        key;
-    boost::weak_ptr<usrp2::usrp2>  value;
+    boost::weak_ptr<usrp2>  value;
 
-    usrp_table_entry(const std::string &_key, boost::weak_ptr<usrp2::usrp2> _value)
+    usrp_table_entry(const std::string &_key, boost::weak_ptr<usrp2> _value)
       : key(_key), value(_value) {}
   };
 
@@ -70,7 +70,7 @@ namespace usrp2 {
     // We don't have the USRP2 we're looking for
 
     // create a new one and stick it in the table.
-    usrp2::sptr r(new usrp2::usrp2(ifc, pr, rx_bufsize));
+    usrp2::sptr r(new usrp2(ifc, pr, rx_bufsize));
     usrp_table_entry t(key, r);
     s_table.push_back(t);
 
index 01a47b5d9233cedff83f6428b8f8d7130b2d4db2..724fe6c6145284e43195157ce4e58d62cc5a6fb3 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR_VERSION=3
 API_COMPAT=3
-MINOR_VERSION=0
+MINOR_VERSION=1
 MAINT_VERSION=0