commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 16/46: zeromq: removed feedback source


From: git
Subject: [Commit-gnuradio] [gnuradio] 16/46: zeromq: removed feedback source
Date: Fri, 16 May 2014 19:37:14 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 0bb6401641d5eb81cf31645e260e4cd8ad5447c0
Author: Johnathan Corgan <address@hidden>
Date:   Tue Apr 22 15:06:13 2014 -0700

    zeromq: removed feedback source
---
 gr-zeromq/examples/loop.py                         | 141 ---------------------
 gr-zeromq/grc/CMakeLists.txt                       |   2 +-
 gr-zeromq/grc/zeromq_pull_feedback_source.xml      |  38 ------
 gr-zeromq/include/gnuradio/zeromq/CMakeLists.txt   |   2 -
 .../include/gnuradio/zeromq/pull_feedback_source.h |  59 ---------
 gr-zeromq/lib/CMakeLists.txt                       |   1 -
 gr-zeromq/lib/pull_feedback_source_impl.cc         |  95 --------------
 gr-zeromq/lib/pull_feedback_source_impl.h          |  52 --------
 gr-zeromq/swig/zeromq_swig.i                       |   3 -
 9 files changed, 1 insertion(+), 392 deletions(-)

diff --git a/gr-zeromq/examples/loop.py b/gr-zeromq/examples/loop.py
deleted file mode 100755
index 6b9a3d1..0000000
--- a/gr-zeromq/examples/loop.py
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/usr/bin/env python
-# 
-# Copyright 2013 Institute for Theoretical Information Technology,
-#                RWTH Aachen University
-# 
-# Authors: Johannes Schmitz <address@hidden>
-# 
-# This 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.
-# 
-# This software is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this software; see the file COPYING.  If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-# 
-
-###############################################################################
-# Imports
-###############################################################################
-from gnuradio import zeromq
-from gnuradio import gr
-from gnuradio import blocks
-from gnuradio import analog
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import numpy
-import signal
-import gui
-from PyQt4 import QtGui
-import sys
-
-
-###############################################################################
-# GNU Radio top_block
-###############################################################################
-class top_block(gr.top_block):
-    def __init__(self, options):
-        gr.top_block.__init__(self)  
-
-        self.options = options
-
-        # create a QT application
-        self.qapp = QtGui.QApplication(sys.argv)
-        # give Ctrl+C back to system
-        signal.signal(signal.SIGINT, signal.SIG_DFL)
-
-        # socket addresses
-        rpc_adr_server = "tcp://localhost:6666"
-        rpc_adr_reply = "tcp://*:6666"
-        probe_adr_gui = "tcp://localhost:5556"
-        probe_adr_fg = "tcp://*:5556"
-        sink_adr = "tcp://*:5555"
-        source_adr = "tcp://localhost:5555"
-
-        # create the main window
-        self.ui = gui.gui("Loop",rpc_adr_server,rpc_adr_server,probe_adr_gui)
-        self.ui.show()
-
-        # the strange sampling rate gives a nice movement in the plot :P
-        self.samp_rate = samp_rate = 48200
-
-        # blocks
-        self.gr_sig_source = analog.sig_source_f(samp_rate, analog.GR_SIN_WAVE 
, 1000, 1, 0)
-        self.null_source = blocks.null_source(gr.sizeof_float)
-        self.throttle = blocks.throttle(gr.sizeof_float, samp_rate)
-        self.zmq_source = 
zeromq.pull_source_feedback(gr.sizeof_float,source_adr)
-        self.mult_a = blocks.multiply_const_ff(1)
-        self.mult_b = blocks.multiply_const_ff(0.5)
-        self.add = blocks.add_ff(1)
-        #self.zmq_sink = zeromq.sink_reqrep_nopoll(gr.sizeof_float, sink_adr)
-        #self.zmq_sink = zeromq.sink_reqrep(gr.sizeof_float, sink_adr)
-        self.zmq_sink = zeromq.push_sink(gr.sizeof_float, sink_adr)
-        self.zmq_probe = zeromq.push_sink(gr.sizeof_float, probe_adr_fg)
-        #self.null_sink = blocks.null_sink(gr.sizeof_float)
-
-        # connects
-        self.connect(self.gr_sig_source, self.mult_a)
-        self.connect(self.zmq_source, self.mult_b, (self.add,1))
-#        self.connect(self.null_source, (self.add,1))
-        self.connect(self.mult_a, (self.add, 0), self.throttle, self.zmq_sink)
-        self.connect(self.throttle, self.zmq_probe)
-
-        # ZeroMQ
-        self.rpc_manager = zeromq.rpc_manager()
-        self.rpc_manager.set_reply_socket(rpc_adr_reply)
-        self.rpc_manager.add_interface("start_fg",self.start_fg)
-        self.rpc_manager.add_interface("stop_fg",self.stop_fg)
-        self.rpc_manager.add_interface("set_waveform",self.set_waveform)
-        self.rpc_manager.add_interface("set_k",self.mult_a.set_k)
-        
self.rpc_manager.add_interface("get_sample_rate",self.throttle.sample_rate)
-        self.rpc_manager.start_watcher()
-
-    def start_fg(self):
-        print "Start Flowgraph"
-        try:
-            self.start()
-        except RuntimeError:
-            print "Can't start, flowgraph already running!"
-
-    def stop_fg(self):
-        print "Stop Flowgraph"
-        self.stop()
-        self.wait()
-
-    def set_waveform(self, waveform_str):
-        waveform = {'Constant' : analog.GR_CONST_WAVE,
-                    'Sine' : analog.GR_SIN_WAVE,
-                    'Cosine' : analog.GR_COS_WAVE,
-                    'Square' : analog.GR_SQR_WAVE,
-                    'Triangle' : analog.GR_TRI_WAVE,
-                    'Saw Tooth' : analog.GR_SAW_WAVE}[waveform_str]
-        self.gr_sig_source.set_waveform(waveform)
-
-
-###############################################################################
-# Options Parser
-###############################################################################
-def parse_options():
-    """ Options parser. """
-    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
-    (options, args) = parser.parse_args()
-    return options
-
-
-###############################################################################
-# Main
-###############################################################################
-if __name__ == "__main__":
-    options = parse_options()
-    tb = top_block(options)
-    tb.qapp.exec_()
-    tb.stop()
-    tb = None
diff --git a/gr-zeromq/grc/CMakeLists.txt b/gr-zeromq/grc/CMakeLists.txt
index 0829b54..8709511 100644
--- a/gr-zeromq/grc/CMakeLists.txt
+++ b/gr-zeromq/grc/CMakeLists.txt
@@ -29,4 +29,4 @@ install(FILES
 #    zeromq_sink_reqrep_nopoll.xml
 #    zeromq_source_reqrep_nopoll.xml
 #    zeromq_pull_source.xml
-#    zeromq_source_pushpull_feedback.xml
+
diff --git a/gr-zeromq/grc/zeromq_pull_feedback_source.xml 
b/gr-zeromq/grc/zeromq_pull_feedback_source.xml
deleted file mode 100644
index 6c5cd5b..0000000
--- a/gr-zeromq/grc/zeromq_pull_feedback_source.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<block>
-  <name>source_pushpull_feedback</name>
-  <key>zeromq_source_pushpull_feedback</key>
-  <category>zeromq</category>
-  <import>import zeromq</import>
-  <make>zeromq.source_pushpull_feedback($itemsize, $*address)</make>
-  <!-- Make one 'param' node for every Parameter you want settable from the 
GUI.
-       Sub-nodes:
-       * name
-       * key (makes the value accessible as $keyname, e.g. in the make node)
-       * type -->
-  <param>
-    <name>...</name>
-    <key>...</key>
-    <type>...</type>
-  </param>
-
-  <!-- Make one 'sink' node per input. Sub-nodes:
-       * name (an identifier for the GUI)
-       * type
-       * vlen
-       * optional (set to 1 for optional inputs) -->
-  <sink>
-    <name>in</name>
-    <type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
-  </sink>
-
-  <!-- Make one 'source' node per output. Sub-nodes:
-       * name (an identifier for the GUI)
-       * type
-       * vlen
-       * optional (set to 1 for optional inputs) -->
-  <source>
-    <name>out</name>
-    <type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
-  </source>
-</block>
diff --git a/gr-zeromq/include/gnuradio/zeromq/CMakeLists.txt 
b/gr-zeromq/include/gnuradio/zeromq/CMakeLists.txt
index ea18dd6..ec0f5f4 100644
--- a/gr-zeromq/include/gnuradio/zeromq/CMakeLists.txt
+++ b/gr-zeromq/include/gnuradio/zeromq/CMakeLists.txt
@@ -23,12 +23,10 @@
 install(FILES
   api.h
   pub_sink.h
-  pull_feedback_source.h
   pull_source.h
   push_sink.h
   sink_reqrep.h
   sink_reqrep_nopoll.h
-  source_pushpull_feedback.h
   source_reqrep.h
   source_reqrep_nopoll.h
 
diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_feedback_source.h 
b/gr-zeromq/include/gnuradio/zeromq/pull_feedback_source.h
deleted file mode 100644
index 3da27b6..0000000
--- a/gr-zeromq/include/gnuradio/zeromq/pull_feedback_source.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2013,2014 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio.
- *
- * This 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.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_ZEROMQ_PULL_FEEDBACK_SOURCE_H
-#define INCLUDED_ZEROMQ_PULL_FEEDBACK_SOURCE_H
-
-#include <gnuradio/zeromq/api.h>
-#include <gnuradio/sync_block.h>
-
-namespace gr {
-  namespace zeromq {
-
-    /*!
-     * \brief Receive messages on ZMQ PULL socket and source stream
-     * \ingroup zeromq
-     *
-     * \details
-     * This block will connect to a ZMQ PULL socket, then produce all
-     * incoming messages as streaming output.
-     */
-    class ZEROMQ_API pull_feedback_source : virtual public gr::sync_block
-    {
-    public:
-      typedef boost::shared_ptr<pull_feedback_source> sptr;
-
-      /*!
-       * \brief Return a shared_ptr to a new instance of 
gr::zeromq::pull_source.
-       *
-       * \param itemsize Size of a stream item in bytes
-       * \param address  ZMQ socket address specifier
-       * \param timeout  Receive timeout in seconds, default is 100ms, 1us 
increments
-       *
-       */
-      static sptr make(size_t itemsize, char *address, float timeout=0.1);
-    };
-
-  } // namespace zeromq
-} // namespace gr
-
-#endif /* INCLUDED_ZEROMQ_PULL_FEEDBACK_SOURCE_H */
diff --git a/gr-zeromq/lib/CMakeLists.txt b/gr-zeromq/lib/CMakeLists.txt
index e12e80d..d6c580e 100644
--- a/gr-zeromq/lib/CMakeLists.txt
+++ b/gr-zeromq/lib/CMakeLists.txt
@@ -39,7 +39,6 @@ endif(ENABLE_GR_CTRLPORT)
 ########################################################################
 list(APPEND zeromq_sources
   pub_sink_impl.cc
-  pull_feedback_source_impl.cc
   pull_source_impl.cc
   push_sink_impl.cc
   sink_reqrep_impl.cc
diff --git a/gr-zeromq/lib/pull_feedback_source_impl.cc 
b/gr-zeromq/lib/pull_feedback_source_impl.cc
deleted file mode 100644
index 87ae9bf..0000000
--- a/gr-zeromq/lib/pull_feedback_source_impl.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2013, 2014 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio.
- *
- * This 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.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; 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 <gnuradio/io_signature.h>
-#include "pull_feedback_source_impl.h"
-
-namespace gr {
-  namespace zeromq {
-
-    pull_feedback_source::sptr
-    pull_feedback_source::make(size_t itemsize, char *address, float timeout)
-    {
-      return gnuradio::get_initial_sptr
-        (new pull_feedback_source_impl(itemsize, address, timeout));
-    }
-
-    pull_feedback_source_impl::pull_feedback_source_impl(size_t itemsize, char 
*address, float timeout)
-      : gr::sync_block("pull_feedback_source",
-                       gr::io_signature::make(0, 0, 0),
-                       gr::io_signature::make(1, 1, itemsize)),
-        d_itemsize(itemsize), d_first_work(true)
-    {
-      d_timeout = timeout >= 0 ? (int)(timeout*1e6) : 0;
-      d_context = new zmq::context_t(1);
-      d_socket = new zmq::socket_t(*d_context, ZMQ_PULL);
-      d_socket->connect(address);
-    }
-
-    pull_feedback_source_impl::~pull_feedback_source_impl()
-    {
-      delete(d_socket);
-      delete(d_context);
-    }
-
-    int
-    pull_feedback_source_impl::work(int noutput_items,
-                                    gr_vector_const_void_star &input_items,
-                                    gr_vector_void_star &output_items)
-    {
-      char *out = (char*)output_items[0];
-
-      zmq::pollitem_t items[] = { { *d_socket, 0, ZMQ_POLLIN, 0 } };
-      zmq::poll (&items[0], 1, d_timeout);
-
-      //  If we got a reply, process
-      if (items[0].revents & ZMQ_POLLIN) {
-
-       // Receive data
-       zmq::message_t msg;
-       d_socket->recv(&msg);
-
-       // Copy to ouput buffer and return
-       if (msg.size() >= d_itemsize*noutput_items) {
-         memcpy(out, (void *)msg.data(), d_itemsize*noutput_items);
-
-         return noutput_items;
-       }
-       else {
-         memcpy(out, (void *)msg.data(), msg.size());
-
-         return msg.size()/d_itemsize;
-       }
-      }
-      else {
-       memset(out, 0, noutput_items);
-
-       return noutput_items;
-      }
-    }
-
-  } /* namespace zeromq */
-} /* namespace gr */
diff --git a/gr-zeromq/lib/pull_feedback_source_impl.h 
b/gr-zeromq/lib/pull_feedback_source_impl.h
deleted file mode 100644
index 38ab85e..0000000
--- a/gr-zeromq/lib/pull_feedback_source_impl.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2013,2014 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio.
- *
- * This 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.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_ZMQBLOCKS_PULL_FEEDBACK_SOURCE_IMPL_H
-#define INCLUDED_ZMQBLOCKS_PULL_FEEDBACK_SOURCE_IMPL_H
-
-#include <gnuradio/zeromq/pull_feedback_source.h>
-#include <zmq.hpp>
-
-namespace gr {
-  namespace zeromq {
-
-    class pull_feedback_source_impl : public pull_feedback_source
-    {
-    private:
-      size_t          d_itemsize;
-      int             d_timeout;
-      zmq::context_t  *d_context;
-      zmq::socket_t   *d_socket;
-      bool            d_first_work;
-
-    public:
-      pull_feedback_source_impl(size_t itemsize, char *address);
-      ~pull_feedback_source_impl();
-
-      int work(int noutput_items,
-               gr_vector_const_void_star &input_items,
-               gr_vector_void_star &output_items);
-    };
-  } // namespace zeromq
-} // namespace gr
-
-#endif /* INCLUDED_ZMQBLOCKS_PULL_FEEDBACK_SOURCE_IMPL_H */
diff --git a/gr-zeromq/swig/zeromq_swig.i b/gr-zeromq/swig/zeromq_swig.i
index 45c3485..8370ac6 100644
--- a/gr-zeromq/swig/zeromq_swig.i
+++ b/gr-zeromq/swig/zeromq_swig.i
@@ -32,7 +32,6 @@
 #include "gnuradio/zeromq/push_sink.h"
 #include "gnuradio/zeromq/sink_reqrep.h"
 #include "gnuradio/zeromq/sink_reqrep_nopoll.h"
-#include "gnuradio/zeromq/pull_feedback_source.h"
 #include "gnuradio/zeromq/pull_source.h"
 #include "gnuradio/zeromq/source_reqrep.h"
 #include "gnuradio/zeromq/source_reqrep_nopoll.h"
@@ -42,7 +41,6 @@
 %include "gnuradio/zeromq/push_sink.h"
 %include "gnuradio/zeromq/sink_reqrep.h"
 %include "gnuradio/zeromq/sink_reqrep_nopoll.h"
-%include "gnuradio/zeromq/pull_feedback_source.h"
 %include "gnuradio/zeromq/pull_source.h"
 %include "gnuradio/zeromq/source_reqrep.h"
 %include "gnuradio/zeromq/source_reqrep_nopoll.h"
@@ -51,7 +49,6 @@ GR_SWIG_BLOCK_MAGIC2(zeromq, pub_sink);
 GR_SWIG_BLOCK_MAGIC2(zeromq, push_sink);
 GR_SWIG_BLOCK_MAGIC2(zeromq, sink_reqrep);
 GR_SWIG_BLOCK_MAGIC2(zeromq, sink_reqrep_nopoll);
-GR_SWIG_BLOCK_MAGIC2(zeromq, pull_feedback_source);
 GR_SWIG_BLOCK_MAGIC2(zeromq, pull_source);
 GR_SWIG_BLOCK_MAGIC2(zeromq, source_reqrep);
 GR_SWIG_BLOCK_MAGIC2(zeromq, source_reqrep_nopoll);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]