diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 11:56:47 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 11:57:13 -0500 |
commit | 0e51289eb2ac5aa0089c8f38b69f966e69fe28d8 (patch) | |
tree | cddae3f1de5412d1bea61f6345b63155f2753f7c | |
parent | 18b20e591ffb20951605dfc4b7cbe5964b5159fa (diff) |
qtgui: improved handling of static plot tools.
-rwxr-xr-x | gr-qtgui/apps/gr_constellation_plot | 2 | ||||
-rwxr-xr-x | gr-qtgui/apps/gr_time_plot_c | 2 | ||||
-rwxr-xr-x | gr-qtgui/apps/gr_time_plot_f | 2 | ||||
-rw-r--r-- | gr-qtgui/apps/plot_constellation_form.py | 10 | ||||
-rw-r--r-- | gr-qtgui/apps/plot_form.py | 22 | ||||
-rw-r--r-- | gr-qtgui/apps/plot_time_form.py | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/gr-qtgui/apps/gr_constellation_plot b/gr-qtgui/apps/gr_constellation_plot index 92c4e3be15..0687443218 100755 --- a/gr-qtgui/apps/gr_constellation_plot +++ b/gr-qtgui/apps/gr_constellation_plot @@ -171,7 +171,7 @@ def main(): tb = my_top_block(filelist, options.start, nsamples, max_nsamples); - main_box = plot_constellation_form(tb, 'GNU Radio Constellation Plot') + main_box = plot_constellation_form(tb, 'GNU Radio Constellation Plot', 10000.0) for n in xrange(tb._nsigs): main_box._style_edit[n].setCurrentIndex(0) main_box.show() diff --git a/gr-qtgui/apps/gr_time_plot_c b/gr-qtgui/apps/gr_time_plot_c index 4450a2074c..a7c39a24b9 100755 --- a/gr-qtgui/apps/gr_time_plot_c +++ b/gr-qtgui/apps/gr_time_plot_c @@ -62,7 +62,7 @@ def main(): options.start, options.nsamples, max_nsamples, not options.no_auto_scale) - main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot') + main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot', 10000.0) main_box.show() tb.run() diff --git a/gr-qtgui/apps/gr_time_plot_f b/gr-qtgui/apps/gr_time_plot_f index 4cac6e9323..9b29709b10 100755 --- a/gr-qtgui/apps/gr_time_plot_f +++ b/gr-qtgui/apps/gr_time_plot_f @@ -61,7 +61,7 @@ def main(): options.start, options.nsamples, max_nsamples, not options.no_auto_scale) - main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot') + main_box = plot_base.plot_time_form(tb, 'GNU Radio Time Plot', 10000.0) main_box.show() tb.run() diff --git a/gr-qtgui/apps/plot_constellation_form.py b/gr-qtgui/apps/plot_constellation_form.py index 9a4aa3d463..d5e37bb33c 100644 --- a/gr-qtgui/apps/plot_constellation_form.py +++ b/gr-qtgui/apps/plot_constellation_form.py @@ -36,8 +36,8 @@ except ImportError: from plot_form import plot_form class plot_constellation_form(plot_form): - def __init__(self, top_block, title=''): - plot_form.__init__(self, top_block, title) + def __init__(self, top_block, title='', scale=1): + plot_form.__init__(self, top_block, title, scale) self.right_col_layout = QtGui.QVBoxLayout() self.right_col_form = QtGui.QFormLayout() @@ -47,9 +47,9 @@ class plot_constellation_form(plot_form): # Constellation resizing scales x and y together. # Set the bar to go from 0.001 to max self.ybar.setMinimum(1) - self.ybar.setMaximum(1000*self.top_block._y_max) - self.ybar.setSingleStep(1000*(max(self.top_block._y_range/10, 0.010))) - self.ybar.setPageStep(1000*(max(self.top_block._y_range/2, 0.010))) + self.ybar.setMaximum(self._pos_scale*self.top_block._y_max) + self.ybar.setSingleStep(self._pos_scale*(max(self.top_block._y_range/10, 0.010))) + self.ybar.setPageStep(self._pos_scale*(max(self.top_block._y_range/2, 0.010))) self.auto_scale = QtGui.QCheckBox("Auto Scale", self) if(self.top_block._auto_scale): diff --git a/gr-qtgui/apps/plot_form.py b/gr-qtgui/apps/plot_form.py index 6a5d2266ed..2e1a6c5f77 100644 --- a/gr-qtgui/apps/plot_form.py +++ b/gr-qtgui/apps/plot_form.py @@ -30,14 +30,14 @@ except ImportError: import numpy class plot_form(QtGui.QWidget): - def __init__(self, top_block, title=''): + def __init__(self, top_block, title='', scale=1): QtGui.QWidget.__init__(self, None) self._start = 0 self._end = 0 self._y_min = 0 self._y_max = 0 - self._pos_scale = 1 + self._pos_scale = scale self.top_block = top_block self.top_block.gui_y_axis = self.gui_y_axis @@ -131,7 +131,7 @@ class plot_form(QtGui.QWidget): self.ybar.setMaximum(self._pos_scale*_ymax) self.ybar.setSingleStep(self._pos_scale*(_yrng/10)) self.ybar.setPageStep(self._pos_scale*(_yrng/2)) - self.ybar.setValue(self._pos_scale*_yval) + self.ybar.setValue(self._pos_scale*_ymax) self.connect(self.ybar, QtCore.SIGNAL("valueChanged(int)"), self.update_yaxis_slider) self.layout.addWidget(self.ybar, 1,1,1,1) @@ -316,7 +316,7 @@ class plot_form(QtGui.QWidget): self.posbar.setValue(self._start) def update_xaxis_slider(self, value): - self._start = value/self._pos_scale + self._start = value self._end = value + self.posbar.pageStep() self.start_edit.setText("{0}".format(self._start)) @@ -334,10 +334,10 @@ class plot_form(QtGui.QWidget): self._y_max = newmax self.top_block._y_range = newmax - newmin self.top_block.set_y_axis(self._y_min, self._y_max) - self.ybar.setValue(self._y_max) + self.ybar.setValue(self._y_max*self._pos_scale) else: - self.y_min_edit.setText("{0:.4f}".format(self._y_min)) - self.y_max_edit.setText("{0:.4f}".format(self._y_max)) + self.y_min_edit.setText("{0:.2f}".format(self._y_min)) + self.y_max_edit.setText("{0:.2f}".format(self._y_max)) def update_yaxis_slider(self, value): if(not self.top_block._auto_scale): @@ -353,7 +353,7 @@ class plot_form(QtGui.QWidget): self.gui_y_axis(self._y_min, self._y_max) else: - self.ybar.setValue(self._y_max) + self.ybar.setValue(self._y_max*self._pos_scale) def update_samp_rate(self): sr = self.samp_rate_edit.text().toDouble()[0] @@ -363,11 +363,11 @@ class plot_form(QtGui.QWidget): self.top_block._nsamps) def gui_y_axis(self, ymin, ymax): - self.y_min_edit.setText("{0:.4f}".format(ymin)) - self.y_max_edit.setText("{0:.4f}".format(ymax)) + self.y_min_edit.setText("{0:.2f}".format(ymin)) + self.y_max_edit.setText("{0:.2f}".format(ymax)) self._y_min = ymin self._y_max = ymax - self.ybar.setValue(ymax) + self.ybar.setValue(self._pos_scale*ymax) def set_grid_check(self, state): if(state): diff --git a/gr-qtgui/apps/plot_time_form.py b/gr-qtgui/apps/plot_time_form.py index dbdf4a464c..30701c8d37 100644 --- a/gr-qtgui/apps/plot_time_form.py +++ b/gr-qtgui/apps/plot_time_form.py @@ -36,8 +36,8 @@ except ImportError: from plot_form import plot_form class plot_time_form(plot_form): - def __init__(self, top_block, title=''): - plot_form.__init__(self, top_block, title) + def __init__(self, top_block, title='', scale=1): + plot_form.__init__(self, top_block, title, scale) self.right_col_layout = QtGui.QVBoxLayout() self.right_col_form = QtGui.QFormLayout() |