commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: git
Subject: [Commit-gnuradio] [gnuradio] 10/57: controlport: in gr-perf-monitorx, if all work times returned are 0, avoid a divide-by-zero fault.
Date: Wed, 21 May 2014 03:10:25 +0000 (UTC)

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

trondeau pushed a commit to branch master
in repository gnuradio.

commit 6ce85e06aec7b481c5ab2438e78f70982a0c9022
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 14c0f0b..369922c 100755
--- a/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/gr-perf-monitorx
@@ -410,6 +410,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())))
@@ -487,6 +489,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]