commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 24/50: controlport: adding performance and


From: git
Subject: [Commit-gnuradio] [gnuradio] 24/50: controlport: adding performance and controlport monitor GRC blocks.
Date: Wed, 15 Apr 2015 21:07:54 +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 636c1557936ca004dce4c905eb7f337ad5677c60
Author: Tom Rondeau <address@hidden>
Date:   Mon Mar 2 19:29:37 2015 -0500

    controlport: adding performance and controlport monitor GRC blocks.
    
    Updated thrift server conf to set an endpoint
     -- need to get host address instead of hardcoding to 127.0.0.1.
---
 .../include/gnuradio/thrift_server_template.h      | 14 +++++--
 .../python/gnuradio/ctrlport/monitor.py            |  6 +--
 gr-blocks/grc/blocks_block_tree.xml                |  2 +
 gr-blocks/grc/blocks_ctrlport_performance.xml      | 48 ++++++++++++++++++++++
 gr-blocks/grc/blocks_ctrlport_viewer.xml           | 48 ++++++++++++++++++++++
 5 files changed, 111 insertions(+), 7 deletions(-)

diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h 
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index 0676826..5b97b0a 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -100,8 +100,6 @@ thrift_server_template<TserverBase, TserverClass, 
TImplClass, TThriftClass>::thr
   gr::logger_ptr logger, debug_logger;
   gr::configure_default_loggers(logger, debug_logger, "controlport");
 
-  //GR_LOG_DEBUG(debug_logger, "thrift_server_template: ctor");
-
   unsigned int port, nthreads, buffersize;
   std::string thrift_config_file = 
gr::prefs::singleton()->get_string("ControlPort", "config", "");
 
@@ -156,9 +154,9 @@ thrift_server_template<TserverBase, TserverClass, 
TImplClass, TThriftClass>::thr
                                             threadManager);
   }
 
-  // Define the endpoint
   int used_port = 
((thrift::transport::TServerSocket*)serverTransport.get())->getPort();
-  GR_LOG_INFO(logger, boost::format("Apache Thrift Endpoint on port %1%") % 
used_port);
+  std::string endpoint = boost::str(boost::format("%1% -p %2%") % "127.0.0.1" 
% used_port);
+  GR_LOG_INFO(logger, "Apache Thrift: " + endpoint);
 
   d_server = handler.get();
 }
@@ -172,6 +170,14 @@ template<typename TserverBase, typename TserverClass, 
typename TImplClass, typen
 TserverBase* thrift_server_template<TserverBase, TserverClass, TImplClass, 
TThriftClass>::i_impl()
 {
   //std::cerr << "thrift_server_template: i_impl" << std::endl;
+
+  // Define the endpoint
+  thrift::transport::TServerTransport *thetransport =
+    thrift_application_base<TserverBase, 
TImplClass>::d_thriftserver->getServerTransport().get();
+  int used_port = ((thrift::transport::TServerSocket*)thetransport)->getPort();
+  std::string endpoint = boost::str(boost::format("%1% -p %2%") % "127.0.0.1" 
% used_port);
+  thrift_application_base<TserverBase, 
TImplClass>::d_this->set_endpoint(endpoint);
+
   return d_server;
 }
 
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py 
b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
index 8bb26d9..712137f 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
@@ -48,9 +48,9 @@ class monitor:
         print "monitor::endpoints() = %s" % (gr.rpcmanager_get().endpoints())
         try:
             cmd = map(lambda a: [self.tool,
-                                                        
re.search("\d+\.\d+\.\d+\.\d+",a).group(0),
-                                                        re.search("-p 
(\d+)",a).group(1)],
-                                             
gr.rpcmanager_get().endpoints())[0]
+                                 re.search("\d+\.\d+\.\d+\.\d+",a).group(0),
+                                 re.search("-p (\d+)",a).group(1)],
+                      gr.rpcmanager_get().endpoints())[0]
             print "running: %s"%(str(cmd))
             self.proc = subprocess.Popen(cmd);
             self.started = True
diff --git a/gr-blocks/grc/blocks_block_tree.xml 
b/gr-blocks/grc/blocks_block_tree.xml
index 383ec87..0aab2ea 100644
--- a/gr-blocks/grc/blocks_block_tree.xml
+++ b/gr-blocks/grc/blocks_block_tree.xml
@@ -51,6 +51,8 @@
    </cat>
    <cat>
       <name>Control Port</name>
+      <block>blocks_ctrlport_monitor</block>
+      <block>blocks_ctrlport_monitor_performance</block>
       <block>blocks_ctrlport_probe2_x</block>
       <block>blocks_ctrlport_probe2_c</block>
       <block>blocks_ctrlport_probe_c</block>
diff --git a/gr-blocks/grc/blocks_ctrlport_performance.xml 
b/gr-blocks/grc/blocks_ctrlport_performance.xml
new file mode 100644
index 0000000..ab17c9e
--- /dev/null
+++ b/gr-blocks/grc/blocks_ctrlport_performance.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2012 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.
+-->
+
+<block>
+  <name>CtrlPort Performance Monitor</name>
+  <key>blocks_ctrlport_monitor_performance</key>
+  <import>from gnuradio.ctrlport.monitor import *</import>
+  <make>not $en or monitor("gr-perf-monitorx")</make>
+  <param>
+    <name>Enabled</name>
+    <key>en</key>
+    <value></value>
+    <type>enum</type>
+        <option>
+            <name>True</name>
+            <key>True</key>
+        </option>
+        <option>
+            <name>False</name>
+            <key>False</key>
+      </option>
+  </param>
+
+  <doc>
+    Place this in a graph to launch a QtPy GR CtrlPort Performance Monitor app.
+  </doc>
+
+</block>
diff --git a/gr-blocks/grc/blocks_ctrlport_viewer.xml 
b/gr-blocks/grc/blocks_ctrlport_viewer.xml
new file mode 100644
index 0000000..1d5a2e5
--- /dev/null
+++ b/gr-blocks/grc/blocks_ctrlport_viewer.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2012 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.
+-->
+
+<block>
+  <name>CtrlPort Monitor</name>
+  <key>blocks_ctrlport_monitor</key>
+  <import>from gnuradio.ctrlport.monitor import *</import>
+  <make>not $en or monitor()</make>
+  <param>
+    <name>Enabled</name>
+    <key>en</key>
+    <value></value>
+    <type>enum</type>
+        <option>
+            <name>True</name>
+            <key>True</key>
+        </option>
+        <option>
+            <name>False</name>
+            <key>False</key>
+      </option>
+  </param>
+
+  <doc>
+    Place this in a graph to launch a QtPy GR CtrlPort Monitor app.
+  </doc>
+
+</block>



reply via email to

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