summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-02-20 14:11:24 -0500
committerTom Rondeau <trondeau@vt.edu>2013-02-20 14:11:24 -0500
commit68fbb9eb29d23dd1a177a1205152635d564f992a (patch)
tree2850a2a231307515d1c7ce9785a2d1e4a40a308b
parentf104d4b100c9b7aa4e3011777989ad6b8951ddef (diff)
qtgui: fixed bounds checking and a typo.
-rwxr-xr-xgr-qtgui/apps/gr_time_plot_b2
-rw-r--r--gr-qtgui/apps/plot_form.py16
2 files changed, 12 insertions, 6 deletions
diff --git a/gr-qtgui/apps/gr_time_plot_b b/gr-qtgui/apps/gr_time_plot_b
index 0d5ce5e501..20522095de 100755
--- a/gr-qtgui/apps/gr_time_plot_b
+++ b/gr-qtgui/apps/gr_time_plot_b
@@ -24,7 +24,7 @@ from gnuradio import gr
import scipy
try:
- import gnuradio.qtgui.plot_tiome_base as plot_base
+ import gnuradio.qtgui.plot_time_base as plot_base
except ImportError:
import plot_time_base as plot_base
diff --git a/gr-qtgui/apps/plot_form.py b/gr-qtgui/apps/plot_form.py
index 3b477d516f..87c3da416f 100644
--- a/gr-qtgui/apps/plot_form.py
+++ b/gr-qtgui/apps/plot_form.py
@@ -27,6 +27,8 @@ except ImportError:
print "Error: Program requires PyQt4."
sys.exit(1)
+import numpy
+
class plot_form(QtGui.QWidget):
def __init__(self, top_block, title=''):
QtGui.QWidget.__init__(self, None)
@@ -127,12 +129,16 @@ class plot_form(QtGui.QWidget):
self.gui_y_axis(top_block._y_value-top_block._y_range, top_block._y_value)
# Create a slider to move the plot's y-axis offset
+ _ymax = numpy.int32(min(numpy.iinfo(numpy.int32).max, self.top_block._y_max))
+ _ymin = numpy.int32(max(numpy.iinfo(numpy.int32).min, self.top_block._y_min))
+ _yrng = numpy.int32(min(numpy.iinfo(numpy.int32).max, self.top_block._y_range))
+ _yval = numpy.int32(min(numpy.iinfo(numpy.int32).max, self.top_block._y_value))
self.ybar = QtGui.QSlider(QtCore.Qt.Vertical, self)
- self.ybar.setMinimum(1000*self.top_block._y_min)
- self.ybar.setMaximum(1000*self.top_block._y_max)
- self.ybar.setSingleStep(1000*(self.top_block._y_range/10))
- self.ybar.setPageStep(1000*(self.top_block._y_range/2))
- self.ybar.setValue(1000*self.top_block._y_value)
+ self.ybar.setMinimum(1000*_ymin)
+ self.ybar.setMaximum(1000*_ymax)
+ self.ybar.setSingleStep(1000*(_yrng/10))
+ self.ybar.setPageStep(1000*(_yrng/2))
+ self.ybar.setValue(1000*_yval)
self.connect(self.ybar, QtCore.SIGNAL("valueChanged(int)"),
self.update_yaxis_slider)
self.layout.addWidget(self.ybar, 1,1,1,1)