[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 18/46: Add vlen
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 18/46: Add vlen |
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 edd1405c7f2bcd79e8fb5aa72189e13a37c1ed02
Author: Camilo Solano <address@hidden>
Date: Tue May 6 18:38:43 2014 +0200
Add vlen
---
gr-zeromq/examples/client.py | 5 +-
gr-zeromq/examples/run_app.sh | 4 +-
gr-zeromq/examples/server.py | 4 +-
gr-zeromq/grc/zeromq_pull_source.xml | 9 ++-
gr-zeromq/grc/zeromq_push_sink.xml | 9 ++-
gr-zeromq/grc/zeromq_rep_sink.xml | 9 ++-
gr-zeromq/grc/zeromq_source_reqrep.xml | 74 ++++++++++++++---------
gr-zeromq/include/gnuradio/zeromq/pull_source.h | 2 +-
gr-zeromq/include/gnuradio/zeromq/push_sink.h | 2 +-
gr-zeromq/include/gnuradio/zeromq/rep_sink.h | 2 +-
gr-zeromq/include/gnuradio/zeromq/source_reqrep.h | 2 +-
gr-zeromq/lib/pull_source_impl.cc | 8 +--
gr-zeromq/lib/pull_source_impl.h | 2 +-
gr-zeromq/lib/push_sink_impl.cc | 8 +--
gr-zeromq/lib/push_sink_impl.h | 2 +-
gr-zeromq/lib/rep_sink_impl.cc | 8 +--
gr-zeromq/lib/rep_sink_impl.h | 2 +-
gr-zeromq/lib/source_reqrep_impl.cc | 8 +--
gr-zeromq/lib/source_reqrep_impl.h | 2 +-
19 files changed, 102 insertions(+), 60 deletions(-)
diff --git a/gr-zeromq/examples/client.py b/gr-zeromq/examples/client.py
index 9ae57f7..a892273 100755
--- a/gr-zeromq/examples/client.py
+++ b/gr-zeromq/examples/client.py
@@ -26,6 +26,7 @@
# Imports
###############################################################################
from gnuradio import zeromq
+#import zeromq
from gnuradio import gr
from gnuradio import blocks
from gnuradio import analog
@@ -53,8 +54,8 @@ class top_block(gr.top_block):
# blocks
#self.zmq_source =
zeromq.source_reqrep_nopoll(gr.sizeof_float,source_adr)
- self.zmq_source = zeromq.source_reqrep(gr.sizeof_float,source_adr)
- #self.zmq_source = zeromq.pull_source(gr.sizeof_float,source_adr)
+ self.zmq_source = zeromq.source_reqrep(gr.sizeof_float, 1, source_adr)
+ #self.zmq_source = zeromq.pull_source(gr.sizeof_float, 1, source_adr)
#self.zmq_probe = zeromq.push_sink(gr.sizeof_float,probe_adr)
self.zmq_probe = zeromq.pub_sink(gr.sizeof_float,probe_adr)
diff --git a/gr-zeromq/examples/run_app.sh b/gr-zeromq/examples/run_app.sh
index 59370d0..4af936c 100755
--- a/gr-zeromq/examples/run_app.sh
+++ b/gr-zeromq/examples/run_app.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-export LD_LIBRARY_PATH="$PWD/../build/gr-zeromq/lib"
-export PYTHONPATH="$PWD/../build/gr-zeromq/swig:$PWD/../python"
+export LD_LIBRARY_PATH="$PWD/../../build/gr-zeromq/lib"
+export PYTHONPATH="$PWD/../../build/gr-zeromq/swig:$PWD/../../python"
/usr/bin/python $1 $2 $3 $4 $5 $6 $7 $8 $9
diff --git a/gr-zeromq/examples/server.py b/gr-zeromq/examples/server.py
index 4750df9..49640f8 100755
--- a/gr-zeromq/examples/server.py
+++ b/gr-zeromq/examples/server.py
@@ -59,8 +59,8 @@ class top_block(gr.top_block):
self.throttle = blocks.throttle(gr.sizeof_float, samp_rate)
self.mult = blocks.multiply_const_ff(1)
#self.zmq_sink = zeromq.rep_sink_nopoll(gr.sizeof_float, sink_adr)
- self.zmq_sink = zeromq.rep_sink(gr.sizeof_float, sink_adr)
- #self.zmq_sink = zeromq.push_sink(gr.sizeof_float, sink_adr)
+ self.zmq_sink = zeromq.rep_sink(gr.sizeof_float, 1, sink_adr)
+ #self.zmq_sink = zeromq.push_sink(gr.sizeof_float, 1, sink_adr)
#self.zmq_probe = zeromq.push_sink(gr.sizeof_float, probe_adr)
self.zmq_probe = zeromq.pub_sink(gr.sizeof_float, probe_adr)
#self.null_sink = blocks.null_sink(gr.sizeof_float)
diff --git a/gr-zeromq/grc/zeromq_pull_source.xml
b/gr-zeromq/grc/zeromq_pull_source.xml
index 7ca14fc..72625ee 100644
--- a/gr-zeromq/grc/zeromq_pull_source.xml
+++ b/gr-zeromq/grc/zeromq_pull_source.xml
@@ -4,7 +4,7 @@
<key>zeromq_pull_source</key>
<category>ZeroMQ Interfaces</category>
<import>from gnuradio import zeromq</import>
- <make>zeromq.pull_source($type.itemsize, $address, $timeout)</make>
+ <make>zeromq.pull_source($type.itemsize, $vlen, $address, $timeout)</make>
<param>
<name>IO Type</name>
@@ -38,6 +38,13 @@
</param>
<param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
<name>Address</name>
<key>address</key>
<type>string</type>
diff --git a/gr-zeromq/grc/zeromq_push_sink.xml
b/gr-zeromq/grc/zeromq_push_sink.xml
index 15069c7..e106389 100644
--- a/gr-zeromq/grc/zeromq_push_sink.xml
+++ b/gr-zeromq/grc/zeromq_push_sink.xml
@@ -4,7 +4,7 @@
<key>zeromq_push_sink</key>
<category>ZeroMQ Interfaces</category>
<import>from gnuradio import zeromq</import>
- <make>zeromq.push_sink($type.itemsize, $address, $blocking)</make>
+ <make>zeromq.push_sink($type.itemsize, $vlen, $address, $blocking)</make>
<param>
<name>IO Type</name>
@@ -38,6 +38,13 @@
</param>
<param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
<name>Address</name>
<key>address</key>
<type>string</type>
diff --git a/gr-zeromq/grc/zeromq_rep_sink.xml
b/gr-zeromq/grc/zeromq_rep_sink.xml
index a630794..21fe8c1 100644
--- a/gr-zeromq/grc/zeromq_rep_sink.xml
+++ b/gr-zeromq/grc/zeromq_rep_sink.xml
@@ -4,7 +4,7 @@
<key>zeromq_rep_sink</key>
<category>ZeroMQ Interfaces</category>
<import>from gnuradio import zeromq</import>
- <make>zeromq.rep_sink($type.itemsize, $address, $blocking)</make>
+ <make>zeromq.rep_sink($type.itemsize, $vlen, $address, $blocking)</make>
<param>
<name>IO Type</name>
@@ -38,6 +38,13 @@
</param>
<param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
<name>Address</name>
<key>address</key>
<type>string</type>
diff --git a/gr-zeromq/grc/zeromq_source_reqrep.xml
b/gr-zeromq/grc/zeromq_source_reqrep.xml
index 56ac787..1a1a7b0 100644
--- a/gr-zeromq/grc/zeromq_source_reqrep.xml
+++ b/gr-zeromq/grc/zeromq_source_reqrep.xml
@@ -1,38 +1,58 @@
<?xml version="1.0"?>
<block>
- <name>source_reqrep</name>
+ <name>ZMQ REQ Source</name>
<key>zeromq_source_reqrep</key>
- <category>zeromq</category>
- <import>import zeromq</import>
- <make>zeromq.source_reqrep($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 -->
+ <category>ZeroMQ Interfaces</category>
+ <import>from gnuradio import zeromq</import>
+ <make>zeromq.source_reqrep($type.itemsize, $vlen, $address)</make>
+
<param>
- <name>...</name>
- <key>...</key>
- <type>...</type>
+ <name>IO Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>itemsize:gr.sizeof_gr_complex</opt>
+ </option>
+ <option>
+ <name>Float</name>
+ <key>float</key>
+ <opt>itemsize:gr.sizeof_float</opt>
+ </option>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>itemsize:gr.sizeof_int</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>itemsize:gr.sizeof_short</opt>
+ </option>
+ <option>
+ <name>Byte</name>
+ <key>byte</key>
+ <opt>itemsize:gr.sizeof_char</opt>
+ </option>
</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>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Address</name>
+ <key>address</key>
+ <type>string</type>
+ </param>
- <!-- 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>
+ <type>$type</type>
</source>
+
</block>
diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_source.h
b/gr-zeromq/include/gnuradio/zeromq/pull_source.h
index 46d861b..12c1005 100644
--- a/gr-zeromq/include/gnuradio/zeromq/pull_source.h
+++ b/gr-zeromq/include/gnuradio/zeromq/pull_source.h
@@ -50,7 +50,7 @@ namespace gr {
* \param timeout Receive timeout in seconds, default is 100ms, 1us
increments
*
*/
- static sptr make(size_t itemsize, char *address, float timeout=0.1);
+ static sptr make(size_t itemsize, size_t vlen, char *address, float
timeout=0.1);
};
} // namespace zeromq
diff --git a/gr-zeromq/include/gnuradio/zeromq/push_sink.h
b/gr-zeromq/include/gnuradio/zeromq/push_sink.h
index cffe2d3..2f68e44 100644
--- a/gr-zeromq/include/gnuradio/zeromq/push_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/push_sink.h
@@ -54,7 +54,7 @@ namespace gr {
* \param blocking Indicate whether blocking sends should be used,
default true.
*
*/
- static sptr make(size_t itemsize, char *address, bool blocking=true);
+ static sptr make(size_t itemsize, size_t vlen, char *address, bool
blocking=true);
};
} // namespace zeromq
diff --git a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
index dcae967..9c2cafb 100644
--- a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
+++ b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h
@@ -53,7 +53,7 @@ namespace gr {
* \param blocking Indicate whether blocking sends should be used,
default true.
*
*/
- static sptr make(size_t itemsize, char *address, float timeout=0.1, bool
blocking=true);
+ static sptr make(size_t itemsize, size_t vlen, char *address, float
timeout=0.1, bool blocking=true);
};
} // namespace zeromq
diff --git a/gr-zeromq/include/gnuradio/zeromq/source_reqrep.h
b/gr-zeromq/include/gnuradio/zeromq/source_reqrep.h
index f0b9c3a..54d4b8d 100644
--- a/gr-zeromq/include/gnuradio/zeromq/source_reqrep.h
+++ b/gr-zeromq/include/gnuradio/zeromq/source_reqrep.h
@@ -47,7 +47,7 @@ namespace gr {
* class. zeromq::source_reqrep::make is the public interface for
* creating new instances.
*/
- static sptr make(size_t itemsize, char *address);
+ static sptr make(size_t itemsize, size_t vlen, char *address);
};
} // namespace zeromq
diff --git a/gr-zeromq/lib/pull_source_impl.cc
b/gr-zeromq/lib/pull_source_impl.cc
index d5b815e..9b9e50a 100644
--- a/gr-zeromq/lib/pull_source_impl.cc
+++ b/gr-zeromq/lib/pull_source_impl.cc
@@ -31,16 +31,16 @@ namespace gr {
namespace zeromq {
pull_source::sptr
- pull_source::make(size_t itemsize, char *address, float timeout)
+ pull_source::make(size_t itemsize, size_t vlen, char *address, float
timeout)
{
return gnuradio::get_initial_sptr
- (new pull_source_impl(itemsize, address, timeout));
+ (new pull_source_impl(itemsize, vlen, address, timeout));
}
- pull_source_impl::pull_source_impl(size_t itemsize, char *address, float
timeout)
+ pull_source_impl::pull_source_impl(size_t itemsize, size_t vlen, char
*address, float timeout)
: gr::sync_block("pull_source",
gr::io_signature::make(0, 0, 0),
- gr::io_signature::make(1, 1, itemsize)),
+ gr::io_signature::make(1, 1, itemsize * vlen)),
d_itemsize(itemsize)
{
d_timeout = timeout >= 0 ? (int)(timeout*1e6) : 0;
diff --git a/gr-zeromq/lib/pull_source_impl.h b/gr-zeromq/lib/pull_source_impl.h
index ff15e19..3e56bdc 100644
--- a/gr-zeromq/lib/pull_source_impl.h
+++ b/gr-zeromq/lib/pull_source_impl.h
@@ -38,7 +38,7 @@ namespace gr {
zmq::socket_t *d_socket;
public:
- pull_source_impl(size_t itemsize, char *address, float timeout);
+ pull_source_impl(size_t itemsize, size_t vlen, char *address, float
timeout);
~pull_source_impl();
int work(int noutput_items,
diff --git a/gr-zeromq/lib/push_sink_impl.cc b/gr-zeromq/lib/push_sink_impl.cc
index 461ed6f..43ccd9d 100644
--- a/gr-zeromq/lib/push_sink_impl.cc
+++ b/gr-zeromq/lib/push_sink_impl.cc
@@ -31,15 +31,15 @@ namespace gr {
namespace zeromq {
push_sink::sptr
- push_sink::make(size_t itemsize, char *address, bool blocking)
+ push_sink::make(size_t itemsize, size_t vlen, char *address, bool blocking)
{
return gnuradio::get_initial_sptr
- (new push_sink_impl(itemsize, address, blocking));
+ (new push_sink_impl(itemsize, vlen, address, blocking));
}
- push_sink_impl::push_sink_impl(size_t itemsize, char *address, bool
blocking)
+ push_sink_impl::push_sink_impl(size_t itemsize, size_t vlen, char
*address, bool blocking)
: gr::sync_block("push_sink",
- gr::io_signature::make(1, 1, itemsize),
+ gr::io_signature::make(1, 1, itemsize * vlen),
gr::io_signature::make(0, 0, 0)),
d_itemsize(itemsize)
{
diff --git a/gr-zeromq/lib/push_sink_impl.h b/gr-zeromq/lib/push_sink_impl.h
index 0102618..77f1f60 100644
--- a/gr-zeromq/lib/push_sink_impl.h
+++ b/gr-zeromq/lib/push_sink_impl.h
@@ -38,7 +38,7 @@ namespace gr {
zmq::socket_t *d_socket;
public:
- push_sink_impl(size_t itemsize, char *address, bool blocking);
+ push_sink_impl(size_t itemsize, size_t vlen, char *address, bool
blocking);
~push_sink_impl();
int work(int noutput_items,
diff --git a/gr-zeromq/lib/rep_sink_impl.cc b/gr-zeromq/lib/rep_sink_impl.cc
index abd4e6d..38bb7d7 100644
--- a/gr-zeromq/lib/rep_sink_impl.cc
+++ b/gr-zeromq/lib/rep_sink_impl.cc
@@ -31,15 +31,15 @@ namespace gr {
namespace zeromq {
rep_sink::sptr
- rep_sink::make(size_t itemsize, char *address, float timeout, bool
blocking)
+ rep_sink::make(size_t itemsize, size_t vlen, char *address, float timeout,
bool blocking)
{
return gnuradio::get_initial_sptr
- (new rep_sink_impl(itemsize, address, timeout, blocking));
+ (new rep_sink_impl(itemsize, vlen, address, timeout, blocking));
}
- rep_sink_impl::rep_sink_impl(size_t itemsize, char *address, float
timeout, bool blocking)
+ rep_sink_impl::rep_sink_impl(size_t itemsize, size_t vlen, char *address,
float timeout, bool blocking)
: gr::sync_block("rep_sink",
- gr::io_signature::make(1, 1, itemsize),
+ gr::io_signature::make(1, 1, itemsize * vlen),
gr::io_signature::make(0, 0, 0)),
d_itemsize(itemsize), d_blocking(blocking)
{
diff --git a/gr-zeromq/lib/rep_sink_impl.h b/gr-zeromq/lib/rep_sink_impl.h
index ad2db2a..0996d53 100644
--- a/gr-zeromq/lib/rep_sink_impl.h
+++ b/gr-zeromq/lib/rep_sink_impl.h
@@ -39,7 +39,7 @@ namespace gr {
bool d_blocking;
public:
- rep_sink_impl(size_t itemsize, char *address, float timeout, bool
blocking);
+ rep_sink_impl(size_t itemsize, size_t vlen, char *address, float
timeout, bool blocking);
~rep_sink_impl();
int work(int noutput_items,
diff --git a/gr-zeromq/lib/source_reqrep_impl.cc
b/gr-zeromq/lib/source_reqrep_impl.cc
index 1674955..c6aee7c 100644
--- a/gr-zeromq/lib/source_reqrep_impl.cc
+++ b/gr-zeromq/lib/source_reqrep_impl.cc
@@ -31,16 +31,16 @@ namespace gr {
namespace zeromq {
source_reqrep::sptr
- source_reqrep::make(size_t itemsize, char *address)
+ source_reqrep::make(size_t itemsize, size_t vlen, char *address)
{
return gnuradio::get_initial_sptr
- (new source_reqrep_impl(itemsize, address));
+ (new source_reqrep_impl(itemsize, vlen, address));
}
- source_reqrep_impl::source_reqrep_impl(size_t itemsize, char *address)
+ source_reqrep_impl::source_reqrep_impl(size_t itemsize, size_t vlen, char
*address)
: gr::sync_block("source_reqrep",
gr::io_signature::make(0, 0, 0),
- gr::io_signature::make(1, 1, itemsize)),
+ gr::io_signature::make(1, 1, itemsize * vlen)),
d_itemsize(itemsize)
{
d_context = new zmq::context_t(1);
diff --git a/gr-zeromq/lib/source_reqrep_impl.h
b/gr-zeromq/lib/source_reqrep_impl.h
index a1e3bc6..544549f 100644
--- a/gr-zeromq/lib/source_reqrep_impl.h
+++ b/gr-zeromq/lib/source_reqrep_impl.h
@@ -37,7 +37,7 @@ namespace gr {
zmq::socket_t *d_socket;
public:
- source_reqrep_impl(size_t itemsize, char *address);
+ source_reqrep_impl(size_t itemsize, size_t vlen, char *address);
~source_reqrep_impl();
int work(int noutput_items,
- [Commit-gnuradio] [gnuradio] branch master updated (432e3b7 -> 5974a3e), git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 04/46: zeromq: first cut at compiling lib/ directory, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 17/46: wip, renaming and implementing rep_sink, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 11/46: zeromq: Rename "zmqblocks" to zeromq in examples, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 14/46: zeromq: renamed source_pushpull to pull_source, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 15/46: zeromq: renamed sink_pubsub to pub_sink, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 09/46: Fix callback function to work with multiple arguments and return None in case of error., git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 06/46: zeromq: converted SWIG to in-tree build, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 18/46: Add vlen,
git <=
- [Commit-gnuradio] [gnuradio] 16/46: zeromq: removed feedback source, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 03/46: zeromq: Initial conversion of include/gnuradio/zeromq files, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 19/46: zeromq: renamed source_reqrep to req_source, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 20/46: zeromq: remove nopoll req/rep blocks, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 21/46: zeromq: cleanup copyright, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 13/46: zeromq: renamed sink_pushpull push_sink, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 08/46: Fix ZeroMQ cmake module., git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 10/46: zeromq: Fix typo in CMakeLists to link against libzmq, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 07/46: zeromq: first try at enabling Python. Segfaults in SWIG code., git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 05/46: zeromq: cleanup and reformatting, git, 2014/05/16