commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 01/01: controlport: in gr-perf-monitorx, if


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/01: controlport: in gr-perf-monitorx, if all work times returned are 0, avoid a divide-by-zero fault.
Date: Mon, 21 Apr 2014 22:30:42 +0000 (UTC)

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

trondeau pushed a commit to branch maint
in repository gnuradio.

commit f1075bab714eb95afb1c68e8733dc5bab9df730a
Author: Tom Rondeau <address@hidden>
Date:   Mon Apr 21 18:29:44 2014 -0400

    controlport: in gr-perf-monitorx, if all work times returned are 0, avoid a 
divide-by-zero fault.
---
 gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx 
b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
index 1c6e074..5d9cdd1 100755
--- a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
@@ -412,6 +412,8 @@ class DataTableRuntimes(DataTable):
 
         # strip values out of ctrlport response
         total_work = sum(map(lambda x: x.value, wrk_knobs.values()))
+        if(total_work == 0):
+            total_work = 1
         work_times = dict(zip(
                     map(lambda x: x.split("::")[0], wrk_knobs.keys()),
                     map(lambda x: x.value/total_work, wrk_knobs.values())))
@@ -489,6 +491,8 @@ class MForm(QtGui.QWidget):
 
             # strip values out of ctrlport response
             total_work = sum(map(lambda x: x.value, wrk_knobs.values()))
+            if(total_work == 0):
+                total_work = 1
             work_times = dict(zip(
                         map(lambda x: x.split("::")[0], wrk_knobs.keys()),
                         map(lambda x: x.value/total_work, wrk_knobs.values())))



reply via email to

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