I am attempting to build modified versions of gr_file_source, and
gr_file_sink outside of gnuradio-core. I have successfully built, and
used my version of file_source (called rad_wvfm_source). However, I
cannot get my version of file_sink (called rad_wvfm_sink) to build into
a module so that it is callable from python. My python QA script fails
with an AttributeError: 'module' object has no attribute 'wvfm_sink'.
I've attached my swig files. Any help is appreciated.
Thanks,
- Lee
P.S.
You can browse all the code at http://svn.pattoncentral.org, just click
gr_radar. If it is easier, you can check out the code with
$] svn co http://svn.pattoncentral.org/gr_radar --username=anon
and empty password.
/* -*- c++ -*- */
/*
* Copyright 2004 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 2, 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
%feature("autodoc", "1"); // generate python docstrings
%include "exception.i"
%import "gnuradio.i" // the common stuff
%{
#include "gnuradio_swig_bug_workaround.h" // mandatory bug fix
#include <stdexcept>
%}
%{
#include <rad_wvfm_sink.h>
#include <rad_wvfm_source.h>
%}
%include "rad_wvfm_sink.i"
%include "rad_wvfm_source.i"
GR_SWIG_BLOCK_MAGIC(rad,wvfm_sink)
rad_wvfm_sink_sptr
gr_make_wvfm_sink (size_t itemsize, const char *filename);
class rad_wvfm_sink : public gr_sync_block
{
protected:
rad_wvfm_sink (size_t itemsize, const char *filename);
public:
~rad_wvfm_sink ();
/*!
* \brief open filename and begin output to it.
*/
bool open(const char *filename);
/*!
* \brief close current output file.
*/
void close();
};
%constant int SEEK_SET = 0; /* Seek from beginning of file. */
%constant int SEEK_CUR = 1; /* Seek from current position. */
%constant int SEEK_END = 2; /* Seek from end of file. */
GR_SWIG_BLOCK_MAGIC(rad,wvfm_source)
rad_wvfm_source_sptr
rad_make_wvfm_source (size_t itemsize, const char *filename, bool repeat=false);
class rad_wvfm_source : public gr_sync_block
{
protected:
rad_wvfm_source (size_t itemsize, const char *filename, bool repeat);
public:
~rad_wvfm_source ();
bool seek (long seek_point, int whence);
};
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio