[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3920 - in gnuradio/branches/developers/jcorgan/hier/g
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r3920 - in gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++: dialtone usrp_wfm_rcv |
Date: |
Thu, 2 Nov 2006 17:08:39 -0700 (MST) |
Author: jcorgan
Date: 2006-11-02 17:08:39 -0700 (Thu, 02 Nov 2006)
New Revision: 3920
Added:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.h
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/main.cc
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/main.cc
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.h
Modified:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/Makefile.am
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.cc
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/Makefile.am
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.cc
Log:
Broke up C++ examples into individual files for clarity.
Modified:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/Makefile.am
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/Makefile.am
2006-11-02 23:38:10 UTC (rev 3919)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/Makefile.am
2006-11-03 00:08:39 UTC (rev 3920)
@@ -34,7 +34,9 @@
noinst_PROGRAMS = dialtone
-dialtone_SOURCES = dialtone.cc
+dialtone_SOURCES = \
+ dialtone.cc \
+ main.cc
dialtone_LDADD = \
$(GNURADIO_CORE_LIBS) \
Modified:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.cc
2006-11-02 23:38:10 UTC (rev 3919)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.cc
2006-11-03 00:08:39 UTC (rev 3920)
@@ -19,34 +19,20 @@
* Boston, MA 02110-1301, USA.
*/
+#include <dialtone.h>
+#include <gr_io_signature.h>
#include <gr_sig_source_f.h>
#include <audio_alsa_sink.h>
-#include <gr_hier_block2.h>
-#include <gr_io_signature.h>
-#include <gr_runtime.h>
-// Dial tone hierarchical block
-
-class dial_tone;
-typedef boost::shared_ptr<dial_tone> dial_tone_sptr;
-dial_tone_sptr make_dial_tone();
-
-class dial_tone : public gr_hier_block2
+// Shared pointer constructor
+dialtone_sptr make_dialtone()
{
-private:
- dial_tone();
- friend dial_tone_sptr make_dial_tone();
-
- bool update_connections(int inputs, int outputs);
-};
-
-dial_tone_sptr make_dial_tone()
-{
- return dial_tone_sptr(new dial_tone());
+ return dialtone_sptr(new dialtone());
}
-dial_tone::dial_tone() :
-gr_hier_block2("dial_tone",
+// Hierarchical block constructor, with no inputs or outputs
+dialtone::dialtone() :
+gr_hier_block2("dialtone",
gr_make_io_signature(0,0,0),
gr_make_io_signature(0,0,0))
{
@@ -55,7 +41,9 @@
define_component("sink", audio_alsa_make_sink(48000));
}
-bool dial_tone::update_connections(int ninputs, int noutputs)
+// Called by runtime whenever connectivity changes, at least once
+// on startup.
+bool dialtone::update_connections(int ninputs, int noutputs)
{
if (ninputs || noutputs) // Top-level blocks have no external connections
return false;
@@ -65,14 +53,3 @@
return true;
}
-
-// Main loop
-
-int main()
-{
- dial_tone_sptr top_block = make_dial_tone();
- gr_runtime_sptr runtime = gr_make_runtime(top_block);
-
- runtime->run();
- return 0;
-}
Added:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.h
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.h
(rev 0)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.h
2006-11-03 00:08:39 UTC (rev 3920)
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 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., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <gr_hier_block2.h>
+
+class dialtone;
+typedef boost::shared_ptr<dialtone> dialtone_sptr;
+dialtone_sptr make_dialtone();
+
+class dialtone : public gr_hier_block2
+{
+private:
+ dialtone();
+ friend dialtone_sptr make_dialtone();
+
+ bool update_connections(int inputs, int outputs);
+};
Property changes on:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/dialtone.h
___________________________________________________________________
Name: svn:eol-style
+ native
Added:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/main.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/main.cc
(rev 0)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/main.cc
2006-11-03 00:08:39 UTC (rev 3920)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 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., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+// GNU Radio C++ application
+//
+// Instantiate a top block
+// Instantiate a runtime, passing it the top block
+// Tell the runtime to go...
+
+#include <dialtone.h>
+#include <gr_runtime.h>
+
+int main()
+{
+ dialtone_sptr top_block = make_dialtone();
+ gr_runtime_sptr runtime = gr_make_runtime(top_block);
+
+ runtime->run();
+ return 0;
+}
Property changes on:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/dialtone/main.cc
___________________________________________________________________
Name: svn:eol-style
+ native
Modified:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/Makefile.am
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/Makefile.am
2006-11-02 23:38:10 UTC (rev 3919)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/Makefile.am
2006-11-03 00:08:39 UTC (rev 3920)
@@ -36,9 +36,13 @@
# GR_AUDIO_ALSA_LIBS = -lgr_audio_alsa
noinst_PROGRAMS = usrp_wfm_rcv
+
+noinst_HEADERS = usrp_wfm_rcv.h
+
+usrp_wfm_rcv_SOURCES = \
+ usrp_wfm_rcv.cc \
+ main.cc
-usrp_wfm_rcv_SOURCES = usrp_wfm_rcv.cc
-
usrp_wfm_rcv_LDADD = \
$(GNURADIO_CORE_LIBS) \
$(GR_USRP_LIBS) \
Added:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/main.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/main.cc
(rev 0)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/main.cc
2006-11-03 00:08:39 UTC (rev 3920)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 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., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+// GNU Radio C++ application
+//
+// Instantiate a top block
+// Instantiate a runtime, passing it the top block
+// Tell the runtime to go...
+
+#include <usrp_wfm_rcv.h>
+#include <gr_runtime.h>
+
+int main()
+{
+ usrp_wfm_rcv_sptr top_block = usrp_make_wfm_rcv();
+ gr_runtime_sptr runtime = gr_make_runtime(top_block);
+
+ runtime->run();
+ return 0;
+}
Property changes on:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/main.cc
___________________________________________________________________
Name: svn:eol-style
+ native
Modified:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.cc
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.cc
2006-11-02 23:38:10 UTC (rev 3919)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.cc
2006-11-03 00:08:39 UTC (rev 3920)
@@ -19,14 +19,6 @@
* Boston, MA 02110-1301, USA.
*/
-#include <usrp1_source_c.h>
-#include <gr_quadrature_demod_cf.h>
-#include <gr_null_sink.h>
-#include <audio_alsa_sink.h>
-#include <gr_hier_block2.h>
-#include <gr_io_signature.h>
-#include <gr_runtime.h>
-
#define RX_BOARD 0
#define USRP_DECIM 200
#define USRP_NCHAN 1
@@ -34,21 +26,13 @@
#define USRP_FPGA_FILENAME "std_2rxhb_2tx.rbf"
#define USRP_FIRMWARE_FILENAME "std.ihx"
-// *** THIS IS NOT SUPPOSED TO WORK YET, INTENTIONALLY BROKEN ***
+#include <usrp_wfm_rcv.h>
+#include <gr_io_signature.h>
+#include <usrp1_source_c.h>
+#include <gr_null_sink.h>
+#include <audio_alsa_sink.h>
+#include <gr_quadrature_demod_cf.h>
-class usrp_wfm_rcv;
-typedef boost::shared_ptr<usrp_wfm_rcv> usrp_wfm_rcv_sptr;
-usrp_wfm_rcv_sptr usrp_make_wfm_rcv();
-
-class usrp_wfm_rcv : public gr_hier_block2
-{
-private:
- usrp_wfm_rcv();
- friend usrp_wfm_rcv_sptr usrp_make_wfm_rcv();
-
- bool update_connections(int ninputs, int noutputs);
-};
-
usrp_wfm_rcv_sptr usrp_make_wfm_rcv()
{
return usrp_wfm_rcv_sptr(new usrp_wfm_rcv());
@@ -87,12 +71,3 @@
return true;
}
-
-int main()
-{
- usrp_wfm_rcv_sptr top_block = usrp_make_wfm_rcv();
- gr_runtime_sptr runtime = gr_make_runtime(top_block);
-
- runtime->run();
- return 0;
-}
Added:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.h
===================================================================
---
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.h
(rev 0)
+++
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.h
2006-11-03 00:08:39 UTC (rev 3920)
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 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., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <gr_hier_block2.h>
+
+class usrp_wfm_rcv;
+typedef boost::shared_ptr<usrp_wfm_rcv> usrp_wfm_rcv_sptr;
+usrp_wfm_rcv_sptr usrp_make_wfm_rcv();
+
+class usrp_wfm_rcv : public gr_hier_block2
+{
+private:
+ usrp_wfm_rcv();
+ friend usrp_wfm_rcv_sptr usrp_make_wfm_rcv();
+
+ bool update_connections(int ninputs, int noutputs);
+};
Property changes on:
gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++/usrp_wfm_rcv/usrp_wfm_rcv.h
___________________________________________________________________
Name: svn:eol-style
+ native
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3920 - in gnuradio/branches/developers/jcorgan/hier/gnuradio-examples/c++: dialtone usrp_wfm_rcv,
jcorgan <=