diff options
Diffstat (limited to 'gr-wxgui/src')
-rw-r--r-- | gr-wxgui/src/python/constants.py | 4 | ||||
-rw-r--r-- | gr-wxgui/src/python/fft_window.py | 50 | ||||
-rw-r--r-- | gr-wxgui/src/python/fftsink_gl.py | 14 | ||||
-rw-r--r-- | gr-wxgui/src/python/fftsink_nongl.py | 70 | ||||
-rw-r--r-- | gr-wxgui/src/python/plot.py | 18 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/channel_plotter.py | 2 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/plotter_base.py | 18 | ||||
-rw-r--r-- | gr-wxgui/src/python/scope_window.py | 48 | ||||
-rw-r--r-- | gr-wxgui/src/python/scopesink_gl.py | 12 |
9 files changed, 118 insertions, 118 deletions
diff --git a/gr-wxgui/src/python/constants.py b/gr-wxgui/src/python/constants.py index 2e7f33a0c..93b281aa5 100644 --- a/gr-wxgui/src/python/constants.py +++ b/gr-wxgui/src/python/constants.py @@ -27,8 +27,8 @@ ALPHA_KEY = 'alpha' AUTORANGE_KEY = 'autorange' AVERAGE_KEY = 'average' AVG_ALPHA_KEY = 'avg_alpha' -EMULATE_ANALOG_KEY = 'emulate_analog' -ANALOG_ALPHA_KEY = 'analog_alpha' +USE_PERSISTENCE_KEY = 'use_persistence' +PERSIST_ALPHA_KEY = 'persist_alpha' BASEBAND_FREQ_KEY = 'baseband_freq' BETA_KEY = 'beta' COLOR_MODE_KEY = 'color_mode' diff --git a/gr-wxgui/src/python/fft_window.py b/gr-wxgui/src/python/fft_window.py index c56dbd7e6..a460fe995 100644 --- a/gr-wxgui/src/python/fft_window.py +++ b/gr-wxgui/src/python/fft_window.py @@ -37,7 +37,7 @@ import forms ################################################## SLIDER_STEPS = 100 AVG_ALPHA_MIN_EXP, AVG_ALPHA_MAX_EXP = -3, 0 -ANALOG_ALPHA_MIN_EXP, ANALOG_ALPHA_MAX_EXP = -2, 0 +PERSIST_ALPHA_MIN_EXP, PERSIST_ALPHA_MAX_EXP = -2, 0 DEFAULT_WIN_SIZE = (600, 300) DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'fft_rate', 30) DB_DIV_MIN, DB_DIV_MAX = 1, 20 @@ -105,30 +105,30 @@ class control_panel(wx.Panel): parent.subscribe(AVERAGE_KEY, self._update_layout) forms.check_box( - sizer=options_box, parent=self, label='Emulate Analog', - ps=parent, key=EMULATE_ANALOG_KEY, + sizer=options_box, parent=self, label='Persistence', + ps=parent, key=USE_PERSISTENCE_KEY, ) - #static text and slider for analog alpha - analog_alpha_text = forms.static_text( - sizer=options_box, parent=self, label='Analog Alpha', + #static text and slider for persist alpha + persist_alpha_text = forms.static_text( + sizer=options_box, parent=self, label='Persist Alpha', converter=forms.float_converter(lambda x: '%.4f'%x), - ps=parent, key=ANALOG_ALPHA_KEY, width=50, + ps=parent, key=PERSIST_ALPHA_KEY, width=50, ) - analog_alpha_slider = forms.log_slider( + persist_alpha_slider = forms.log_slider( sizer=options_box, parent=self, - min_exp=ANALOG_ALPHA_MIN_EXP, - max_exp=ANALOG_ALPHA_MAX_EXP, + min_exp=PERSIST_ALPHA_MIN_EXP, + max_exp=PERSIST_ALPHA_MAX_EXP, num_steps=SLIDER_STEPS, - ps=parent, key=ANALOG_ALPHA_KEY, + ps=parent, key=PERSIST_ALPHA_KEY, ) - for widget in (analog_alpha_text, analog_alpha_slider): - parent.subscribe(EMULATE_ANALOG_KEY, widget.Enable) - widget.Enable(parent[EMULATE_ANALOG_KEY]) - parent.subscribe(EMULATE_ANALOG_KEY, widget.ShowItems) + for widget in (persist_alpha_text, persist_alpha_slider): + parent.subscribe(USE_PERSISTENCE_KEY, widget.Enable) + widget.Enable(parent[USE_PERSISTENCE_KEY]) + parent.subscribe(USE_PERSISTENCE_KEY, widget.ShowItems) #allways show initially, so room is reserved for them - widget.ShowItems(True) # (parent[EMULATE_ANALOG_KEY]) + widget.ShowItems(True) # (parent[USE_PERSISTENCE_KEY]) - parent.subscribe(EMULATE_ANALOG_KEY, self._update_layout) + parent.subscribe(USE_PERSISTENCE_KEY, self._update_layout) #trace menu for trace in TRACES: @@ -224,8 +224,8 @@ class fft_window(wx.Panel, pubsub.pubsub): avg_alpha_key, peak_hold, msg_key, - emulate_analog, - analog_alpha, + use_persistence, + persist_alpha, ): pubsub.pubsub.__init__(self) @@ -248,8 +248,8 @@ class fft_window(wx.Panel, pubsub.pubsub): self[REF_LEVEL_KEY] = ref_level self[BASEBAND_FREQ_KEY] = baseband_freq self[RUNNING_KEY] = True - self[EMULATE_ANALOG_KEY] = emulate_analog - self[ANALOG_ALPHA_KEY] = analog_alpha + self[USE_PERSISTENCE_KEY] = use_persistence + self[PERSIST_ALPHA_KEY] = persist_alpha for trace in TRACES: #a function that returns a function #so the function wont use local trace @@ -278,8 +278,8 @@ class fft_window(wx.Panel, pubsub.pubsub): self.plotter.enable_legend(True) self.plotter.enable_point_label(True) self.plotter.enable_grid_lines(True) - self.plotter.set_emulate_analog(emulate_analog) - self.plotter.set_analog_alpha(analog_alpha) + self.plotter.set_use_persistence(use_persistence) + self.plotter.set_persist_alpha(persist_alpha) #setup the box with plot and controls self.control_panel = control_panel(self) main_box = wx.BoxSizer(wx.HORIZONTAL) @@ -295,8 +295,8 @@ class fft_window(wx.Panel, pubsub.pubsub): Y_PER_DIV_KEY, X_DIVS_KEY, Y_DIVS_KEY, REF_LEVEL_KEY, ): self.subscribe(key, self.update_grid) - self.subscribe(EMULATE_ANALOG_KEY, self.plotter.set_emulate_analog) - self.subscribe(ANALOG_ALPHA_KEY, self.plotter.set_analog_alpha) + self.subscribe(USE_PERSISTENCE_KEY, self.plotter.set_use_persistence) + self.subscribe(PERSIST_ALPHA_KEY, self.plotter.set_persist_alpha) #initial update self.update_grid() diff --git a/gr-wxgui/src/python/fftsink_gl.py b/gr-wxgui/src/python/fftsink_gl.py index 0d725ea14..e0306d919 100644 --- a/gr-wxgui/src/python/fftsink_gl.py +++ b/gr-wxgui/src/python/fftsink_gl.py @@ -1,5 +1,5 @@ # -# Copyright 2008,2009 Free Software Foundation, Inc. +# Copyright 2008,2009,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -54,20 +54,20 @@ class _fft_sink_base(gr.hier_block2, common.wxgui_hb): size=fft_window.DEFAULT_WIN_SIZE, peak_hold=False, win=None, - emulate_analog=False, - analog_alpha=None, + use_persistence=False, + persist_alpha=None, **kwargs #do not end with a comma ): #ensure avg alpha if avg_alpha is None: avg_alpha = 2.0/fft_rate #ensure analog alpha - if analog_alpha is None: + if persist_alpha is None: actual_fft_rate=float(sample_rate/fft_size)/float(max(1,int(float((sample_rate/fft_size)/fft_rate)))) #print "requested_fft_rate ",fft_rate #print "actual_fft_rate ",actual_fft_rate analog_cutoff_freq=0.5 # Hertz #calculate alpha from wanted cutoff freq - analog_alpha = 1.0 - math.exp(-2.0*math.pi*analog_cutoff_freq/actual_fft_rate) + persist_alpha = 1.0 - math.exp(-2.0*math.pi*analog_cutoff_freq/actual_fft_rate) #init gr.hier_block2.__init__( @@ -117,8 +117,8 @@ class _fft_sink_base(gr.hier_block2, common.wxgui_hb): avg_alpha_key=AVG_ALPHA_KEY, peak_hold=peak_hold, msg_key=MSG_KEY, - emulate_analog=emulate_analog, - analog_alpha=analog_alpha, + use_persistence=use_persistence, + persist_alpha=persist_alpha, ) common.register_access_methods(self, self.win) setattr(self.win, 'set_baseband_freq', getattr(self, 'set_baseband_freq')) #BACKWARDS diff --git a/gr-wxgui/src/python/fftsink_nongl.py b/gr-wxgui/src/python/fftsink_nongl.py index 8735e98ae..0854d6668 100644 --- a/gr-wxgui/src/python/fftsink_nongl.py +++ b/gr-wxgui/src/python/fftsink_nongl.py @@ -37,7 +37,7 @@ class fft_sink_base(object): y_divs=8, ref_level=50, sample_rate=1, fft_size=512, fft_rate=default_fft_rate, - average=False, avg_alpha=None, title='', peak_hold=False,emulate_analog=False,analog_alpha=0.2): + average=False, avg_alpha=None, title='', peak_hold=False,use_persistence=False,persist_alpha=0.2): # initialize common attributes self.baseband_freq = baseband_freq @@ -52,8 +52,8 @@ class fft_sink_base(object): self.avg_alpha = 2.0 / fft_rate else: self.avg_alpha = avg_alpha - self.emulate_analog = emulate_analog - self.analog_alpha = analog_alpha + self.use_persistence = use_persistence + self.persist_alpha = persist_alpha self.title = title self.peak_hold = peak_hold @@ -78,13 +78,13 @@ class fft_sink_base(object): self.peak_hold = enable self.win.set_peak_hold(enable) - def set_emulate_analog(self, enable): - self.emulate_analog = enable - self.win.set_emulate_analog(enable) + def set_use_persistence(self, enable): + self.use_persistence = enable + self.win.set_use_persistence(enable) - def set_analog_alpha(self, analog_alpha): - self.analog_alpha = analog_alpha - self.win.set_analog_alpha(analog_alpha) + def set_persist_alpha(self, persist_alpha): + self.persist_alpha = persist_alpha + self.win.set_persist_alpha(persist_alpha) def set_avg_alpha(self, avg_alpha): self.avg_alpha = avg_alpha @@ -104,7 +104,7 @@ class fft_sink_f(gr.hier_block2, fft_sink_base): def __init__(self, parent, baseband_freq=0, ref_scale=2.0, y_per_div=10, y_divs=8, ref_level=50, sample_rate=1, fft_size=512, fft_rate=default_fft_rate, average=False, avg_alpha=None, - title='', size=default_fftsink_size, peak_hold=False, emulate_analog=False,analog_alpha=0.2, **kwargs): + title='', size=default_fftsink_size, peak_hold=False, use_persistence=False,persist_alpha=0.2, **kwargs): gr.hier_block2.__init__(self, "fft_sink_f", gr.io_signature(1, 1, gr.sizeof_float), @@ -115,7 +115,7 @@ class fft_sink_f(gr.hier_block2, fft_sink_base): sample_rate=sample_rate, fft_size=fft_size, fft_rate=fft_rate, average=average, avg_alpha=avg_alpha, title=title, - peak_hold=peak_hold,emulate_analog=emulate_analog,analog_alpha=analog_alpha) + peak_hold=peak_hold,use_persistence=use_persistence,persist_alpha=persist_alpha) self.s2p = gr.stream_to_vector(gr.sizeof_float, self.fft_size) self.one_in_n = gr.keep_one_in_n(gr.sizeof_float * self.fft_size, @@ -142,14 +142,14 @@ class fft_sink_f(gr.hier_block2, fft_sink_base): self.win = fft_window(self, parent, size=size) self.set_average(self.average) self.set_peak_hold(self.peak_hold) - self.set_emulate_analog(self.emulate_analog) - self.set_analog_alpha(self.analog_alpha) + self.set_use_persistence(self.use_persistence) + self.set_persist_alpha(self.persist_alpha) class fft_sink_c(gr.hier_block2, fft_sink_base): def __init__(self, parent, baseband_freq=0, ref_scale=2.0, y_per_div=10, y_divs=8, ref_level=50, sample_rate=1, fft_size=512, fft_rate=default_fft_rate, average=False, avg_alpha=None, - title='', size=default_fftsink_size, peak_hold=False, emulate_analog=False,analog_alpha=0.2, **kwargs): + title='', size=default_fftsink_size, peak_hold=False, use_persistence=False,persist_alpha=0.2, **kwargs): gr.hier_block2.__init__(self, "fft_sink_c", gr.io_signature(1, 1, gr.sizeof_gr_complex), @@ -160,7 +160,7 @@ class fft_sink_c(gr.hier_block2, fft_sink_base): sample_rate=sample_rate, fft_size=fft_size, fft_rate=fft_rate, average=average, avg_alpha=avg_alpha, title=title, - peak_hold=peak_hold, emulate_analog=emulate_analog,analog_alpha=analog_alpha) + peak_hold=peak_hold, use_persistence=use_persistence,persist_alpha=persist_alpha) self.s2p = gr.stream_to_vector(gr.sizeof_gr_complex, self.fft_size) self.one_in_n = gr.keep_one_in_n(gr.sizeof_gr_complex * self.fft_size, @@ -186,8 +186,8 @@ class fft_sink_c(gr.hier_block2, fft_sink_base): self.win = fft_window(self, parent, size=size) self.set_average(self.average) - self.set_emulate_analog(self.emulate_analog) - self.set_analog_alpha(self.analog_alpha) + self.set_use_persistence(self.use_persistence) + self.set_persist_alpha(self.persist_alpha) self.set_peak_hold(self.peak_hold) @@ -251,9 +251,9 @@ class control_panel(wx.Panel): self.average_check_box = wx.CheckBox(parent=self, style=wx.CHK_2STATE, label="Average") self.average_check_box.Bind(wx.EVT_CHECKBOX, parent.on_average) control_box.Add(self.average_check_box, 0, wx.EXPAND) - self.emulate_analog_check_box = wx.CheckBox(parent=self, style=wx.CHK_2STATE, label="Emulate Analog") - self.emulate_analog_check_box.Bind(wx.EVT_CHECKBOX, parent.on_emulate_analog) - control_box.Add(self.emulate_analog_check_box, 0, wx.EXPAND) + self.use_persistence_check_box = wx.CheckBox(parent=self, style=wx.CHK_2STATE, label="Persistence") + self.use_persistence_check_box.Bind(wx.EVT_CHECKBOX, parent.on_use_persistence) + control_box.Add(self.use_persistence_check_box, 0, wx.EXPAND) self.peak_hold_check_box = wx.CheckBox(parent=self, style=wx.CHK_2STATE, label="Peak Hold") self.peak_hold_check_box.Bind(wx.EVT_CHECKBOX, parent.on_peak_hold) control_box.Add(self.peak_hold_check_box, 0, wx.EXPAND) @@ -294,7 +294,7 @@ class control_panel(wx.Panel): """ #update checkboxes self.average_check_box.SetValue(self.parent.fftsink.average) - self.emulate_analog_check_box.SetValue(self.parent.fftsink.emulate_analog) + self.use_persistence_check_box.SetValue(self.parent.fftsink.use_persistence) self.peak_hold_check_box.SetValue(self.parent.fftsink.peak_hold) #update radio buttons try: @@ -326,8 +326,8 @@ class fft_window (wx.Panel): self.peak_hold = False self.peak_vals = None - self.emulate_analog=False - self.analog_alpha=0.2 + self.use_persistence=False + self.persist_alpha=0.2 self.plot.SetEnableGrid (True) @@ -417,13 +417,13 @@ class fft_window (wx.Panel): y_range = ymin, ymax self.plot.Draw (graphics, xAxis=x_range, yAxis=y_range, step=self.fftsink.y_per_div) - def set_emulate_analog(self, enable): - self.emulate_analog = enable - self.plot.set_emulate_analog( enable) + def set_use_persistence(self, enable): + self.use_persistence = enable + self.plot.set_use_persistence( enable) - def set_analog_alpha(self, analog_alpha): - self.analog_alpha = analog_alpha - self.plot.set_analog_alpha(analog_alpha) + def set_persist_alpha(self, persist_alpha): + self.persist_alpha = persist_alpha + self.plot.set_persist_alpha(persist_alpha) def set_peak_hold(self, enable): self.peak_hold = enable @@ -434,9 +434,9 @@ class fft_window (wx.Panel): self.fftsink.set_average(evt.IsChecked()) self.control_panel.update() - def on_emulate_analog(self, evt): + def on_use_persistence(self, evt): # print "on_analog" - self.fftsink.set_emulate_analog(evt.IsChecked()) + self.fftsink.set_use_persistence(evt.IsChecked()) self.control_panel.update() def on_peak_hold(self, evt): @@ -522,11 +522,11 @@ class fft_window (wx.Panel): self.id_y_per_div_10 = wx.NewId() self.id_y_per_div_20 = wx.NewId() self.id_average = wx.NewId() - self.id_emulate_analog = wx.NewId() + self.id_use_persistence = wx.NewId() self.id_peak_hold = wx.NewId() self.plot.Bind(wx.EVT_MENU, self.on_average, id=self.id_average) - self.plot.Bind(wx.EVT_MENU, self.on_emulate_analog, id=self.id_emulate_analog) + self.plot.Bind(wx.EVT_MENU, self.on_use_persistence, id=self.id_use_persistence) self.plot.Bind(wx.EVT_MENU, self.on_peak_hold, id=self.id_peak_hold) self.plot.Bind(wx.EVT_MENU, self.on_incr_ref_level, id=self.id_incr_ref_level) self.plot.Bind(wx.EVT_MENU, self.on_decr_ref_level, id=self.id_decr_ref_level) @@ -542,7 +542,7 @@ class fft_window (wx.Panel): menu = wx.Menu() self.popup_menu = menu menu.AppendCheckItem(self.id_average, "Average") - menu.AppendCheckItem(self.id_emulate_analog, "Emulate Analog") + menu.AppendCheckItem(self.id_use_persistence, "Persistence") menu.AppendCheckItem(self.id_peak_hold, "Peak Hold") menu.Append(self.id_incr_ref_level, "Incr Ref Level") menu.Append(self.id_decr_ref_level, "Decr Ref Level") @@ -558,7 +558,7 @@ class fft_window (wx.Panel): self.checkmarks = { self.id_average : lambda : self.fftsink.average, - self.id_emulate_analog : lambda : self.fftsink.emulate_analog, + self.id_use_persistence : lambda : self.fftsink.use_persistence, self.id_peak_hold : lambda : self.fftsink.peak_hold, self.id_y_per_div_1 : lambda : self.fftsink.y_per_div == 1, self.id_y_per_div_2 : lambda : self.fftsink.y_per_div == 2, diff --git a/gr-wxgui/src/python/plot.py b/gr-wxgui/src/python/plot.py index c5557cb6b..35b7ea9d1 100644 --- a/gr-wxgui/src/python/plot.py +++ b/gr-wxgui/src/python/plot.py @@ -38,7 +38,7 @@ # - Converted from numarray to numpy # # Apr 23, 2010 Martin Dudok van Heel (http://www.olifantasia.com/gnuradio/contact_olifantasia.gif) -# - Added Emulate Analog option (emulate after glow of an analog CRT display using IIR) +# - Added Persistence option (emulate after glow of an analog CRT display using IIR) """ This is a simple light weight plotting module that can be used with @@ -426,7 +426,7 @@ class PlotCanvas(wx.Window): def __init__(self, parent, id = -1, pos=wx.DefaultPosition, size=wx.DefaultSize, style= wx.DEFAULT_FRAME_STYLE, name= ""): - self.emulate_analog=False + self.use_persistence=False self.alpha=0.3 self.decimation=10 self.decim_counter=0 @@ -498,11 +498,11 @@ class PlotCanvas(wx.Window): # UNCONDITIONAL, needed to create self._Buffer - def set_emulate_analog(self, enable): - self.emulate_analog = enable + def set_use_persistence(self, enable): + self.use_persistence = enable - def set_analog_alpha(self, analog_alpha): - self.alpha = analog_alpha + def set_persist_alpha(self, persist_alpha): + self.alpha = persist_alpha # SaveFile @@ -807,7 +807,7 @@ class PlotCanvas(wx.Window): if dc == None: # sets new dc and clears it - if self.emulate_analog: + if self.use_persistence: dc = wx.MemoryDC() dc.SelectObject(self._Buffer) dc.Clear() @@ -928,7 +928,7 @@ class PlotCanvas(wx.Window): dc.EndDrawing() - if self.emulate_analog: + if self.use_persistence: dc=None self._Buffer.CopyToBuffer(self._Bufferarray) #, format=wx.BitmapBufferFormat_RGB, stride=-1) ## do the IIR filter @@ -1114,7 +1114,7 @@ class PlotCanvas(wx.Window): self._Buffer = wx.EmptyBitmap(Size[0],Size[1],24) - if True: #self.emulate_analog: + if True: #self.use_persistence: #self._Bufferarray = _numpy.zeros((Size[0], Size[1],3), dtype=_numpy.uint8) self._Bufferarray = _numpy.zeros((Size[0]* Size[1]*3), dtype=_numpy.uint8) diff --git a/gr-wxgui/src/python/plotter/channel_plotter.py b/gr-wxgui/src/python/plotter/channel_plotter.py index f046ae5a9..cf38786f2 100644 --- a/gr-wxgui/src/python/plotter/channel_plotter.py +++ b/gr-wxgui/src/python/plotter/channel_plotter.py @@ -47,7 +47,7 @@ class channel_plotter(grid_plotter_base): """ #init grid_plotter_base.__init__(self, parent, MIN_PADDING) - self.set_emulate_analog(False) + self.set_use_persistence(False) #setup legend cache self._legend_cache = self.new_gl_cache(self._draw_legend, 50) self.enable_legend(False) diff --git a/gr-wxgui/src/python/plotter/plotter_base.py b/gr-wxgui/src/python/plotter/plotter_base.py index 2fbd5fb9d..73d697cfd 100644 --- a/gr-wxgui/src/python/plotter/plotter_base.py +++ b/gr-wxgui/src/python/plotter/plotter_base.py @@ -88,8 +88,8 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): """ attribList = (wx.glcanvas.WX_GL_DOUBLEBUFFER, wx.glcanvas.WX_GL_RGBA) wx.glcanvas.GLCanvas.__init__(self, parent, attribList=attribList); - self.emulate_analog=False - self.analog_alpha=2.0/15 + self.use_persistence=False + self.persist_alpha=2.0/15 self.clear_accum=True self._gl_init_flag = False self._resized_flag = True @@ -100,12 +100,12 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): self.Bind(wx.EVT_SIZE, self._on_size) self.Bind(wx.EVT_ERASE_BACKGROUND, lambda e: None) - def set_emulate_analog(self,enable): - self.emulate_analog=enable + def set_use_persistence(self,enable): + self.use_persistence=enable self.clear_accum=True - def set_analog_alpha(self,analog_alpha): - self.analog_alpha=analog_alpha + def set_persist_alpha(self,analog_alpha): + self.persist_alpha=analog_alpha def new_gl_cache(self, draw_fcn, draw_pri=50): """ @@ -186,14 +186,14 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): for fcn in self._draw_fcns: fcn[1]() - if self.emulate_analog: + if self.use_persistence: if self.clear_accum: #GL.glClear(GL.GL_ACCUM_BUFFER_BIT) GL.glAccum(GL.GL_LOAD, 1.0) self.clear_accum=False - GL.glAccum(GL.GL_MULT, 1.0-self.analog_alpha) - GL.glAccum(GL.GL_ACCUM, self.analog_alpha) + GL.glAccum(GL.GL_MULT, 1.0-self.persist_alpha) + GL.glAccum(GL.GL_ACCUM, self.persist_alpha) GL.glAccum(GL.GL_RETURN, 1.0) self.SwapBuffers() self.unlock() diff --git a/gr-wxgui/src/python/scope_window.py b/gr-wxgui/src/python/scope_window.py index aace8688f..db8ed8a94 100644 --- a/gr-wxgui/src/python/scope_window.py +++ b/gr-wxgui/src/python/scope_window.py @@ -36,7 +36,7 @@ import forms # Constants ################################################## DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'scope_rate', 30) -ANALOG_ALPHA_MIN_EXP, ANALOG_ALPHA_MAX_EXP = -2, 0 +PERSIST_ALPHA_MIN_EXP, PERSIST_ALPHA_MAX_EXP = -2, 0 SLIDER_STEPS = 100 DEFAULT_WIN_SIZE = (600, 300) COUPLING_MODES = ( @@ -92,34 +92,34 @@ class control_panel(wx.Panel): control_box = wx.BoxSizer(wx.VERTICAL) ################################################## - # Emulate Analog + # Persistence ################################################## forms.check_box( - sizer=control_box, parent=self, label='Emulate Analog', - ps=parent, key=EMULATE_ANALOG_KEY, + sizer=control_box, parent=self, label='Persistence', + ps=parent, key=USE_PERSISTENCE_KEY, ) #static text and slider for analog alpha - analog_alpha_text = forms.static_text( + persist_alpha_text = forms.static_text( sizer=control_box, parent=self, label='Analog Alpha', converter=forms.float_converter(lambda x: '%.4f'%x), - ps=parent, key=ANALOG_ALPHA_KEY, width=50, + ps=parent, key=PERSIST_ALPHA_KEY, width=50, ) - analog_alpha_slider = forms.log_slider( + persist_alpha_slider = forms.log_slider( sizer=control_box, parent=self, - min_exp=ANALOG_ALPHA_MIN_EXP, - max_exp=ANALOG_ALPHA_MAX_EXP, + min_exp=PERSIST_ALPHA_MIN_EXP, + max_exp=PERSIST_ALPHA_MAX_EXP, num_steps=SLIDER_STEPS, - ps=parent, key=ANALOG_ALPHA_KEY, + ps=parent, key=PERSIST_ALPHA_KEY, ) - for widget in (analog_alpha_text, analog_alpha_slider): - parent.subscribe(EMULATE_ANALOG_KEY, widget.Enable) - widget.Enable(parent[EMULATE_ANALOG_KEY]) - parent.subscribe(EMULATE_ANALOG_KEY, widget.ShowItems) + for widget in (persist_alpha_text, persist_alpha_slider): + parent.subscribe(USE_PERSISTENCE_KEY, widget.Enable) + widget.Enable(parent[USE_PERSISTENCE_KEY]) + parent.subscribe(USE_PERSISTENCE_KEY, widget.ShowItems) #allways show initially, so room is reserved for them - widget.ShowItems(True) # (parent[EMULATE_ANALOG_KEY]) + widget.ShowItems(True) # (parent[USE_PERSISTENCE_KEY]) - parent.subscribe(EMULATE_ANALOG_KEY, self._update_layout) + parent.subscribe(USE_PERSISTENCE_KEY, self._update_layout) ################################################## # Axes Options @@ -430,8 +430,8 @@ class scope_window(wx.Panel, pubsub.pubsub): trigger_channel_key, decimation_key, msg_key, - emulate_analog, - analog_alpha, + use_persistence, + persist_alpha, ): pubsub.pubsub.__init__(self) #check num inputs @@ -474,8 +474,8 @@ class scope_window(wx.Panel, pubsub.pubsub): self[TRIGGER_MODE_KEY] = gr.gr_TRIG_MODE_AUTO self[TRIGGER_SLOPE_KEY] = gr.gr_TRIG_SLOPE_POS self[T_FRAC_OFF_KEY] = 0.5 - self[EMULATE_ANALOG_KEY] = emulate_analog - self[ANALOG_ALPHA_KEY] = analog_alpha + self[USE_PERSISTENCE_KEY] = use_persistence + self[PERSIST_ALPHA_KEY] = persist_alpha for i in range(num_inputs): self.proxy(common.index_key(AC_COUPLE_KEY, i), controller, common.index_key(ac_couple_key, i)) #init panel and plot @@ -486,8 +486,8 @@ class scope_window(wx.Panel, pubsub.pubsub): self.plotter.enable_legend(True) self.plotter.enable_point_label(True) self.plotter.enable_grid_lines(True) - self.plotter.set_emulate_analog(emulate_analog) - self.plotter.set_analog_alpha(analog_alpha) + self.plotter.set_use_persistence(use_persistence) + self.plotter.set_persist_alpha(persist_alpha) #setup the box with plot and controls self.control_panel = control_panel(self) main_box = wx.BoxSizer(wx.HORIZONTAL) @@ -506,8 +506,8 @@ class scope_window(wx.Panel, pubsub.pubsub): TRIGGER_SHOW_KEY, XY_MARKER_KEY, X_CHANNEL_KEY, Y_CHANNEL_KEY, ]: self.subscribe(key, self.update_grid) #register events for plotter settings - self.subscribe(EMULATE_ANALOG_KEY, self.plotter.set_emulate_analog) - self.subscribe(ANALOG_ALPHA_KEY, self.plotter.set_analog_alpha) + self.subscribe(USE_PERSISTENCE_KEY, self.plotter.set_use_persistence) + self.subscribe(PERSIST_ALPHA_KEY, self.plotter.set_persist_alpha) #initial update self.update_grid() diff --git a/gr-wxgui/src/python/scopesink_gl.py b/gr-wxgui/src/python/scopesink_gl.py index a12517883..b3222b43b 100644 --- a/gr-wxgui/src/python/scopesink_gl.py +++ b/gr-wxgui/src/python/scopesink_gl.py @@ -77,16 +77,16 @@ class _scope_sink_base(gr.hier_block2, common.wxgui_hb): ac_couple=False, num_inputs=1, frame_rate=scope_window.DEFAULT_FRAME_RATE, - emulate_analog=False, - analog_alpha=None, + use_persistence=False, + persist_alpha=None, **kwargs #do not end with a comma ): #ensure analog alpha - if analog_alpha is None: + if persist_alpha is None: actual_frame_rate=float(frame_rate) analog_cutoff_freq=0.5 # Hertz #calculate alpha from wanted cutoff freq - analog_alpha = 1.0 - math.exp(-2.0*math.pi*analog_cutoff_freq/actual_frame_rate) + persist_alpha = 1.0 - math.exp(-2.0*math.pi*analog_cutoff_freq/actual_frame_rate) if not t_scale: t_scale = 10.0/sample_rate #init @@ -139,8 +139,8 @@ class _scope_sink_base(gr.hier_block2, common.wxgui_hb): trigger_channel_key=TRIGGER_CHANNEL_KEY, decimation_key=DECIMATION_KEY, msg_key=MSG_KEY, - emulate_analog=emulate_analog, - analog_alpha=analog_alpha, + use_persistence=use_persistence, + persist_alpha=persist_alpha, ) common.register_access_methods(self, self.win) #connect |