From: Johnathan Corgan Date: Mon, 5 Jul 2010 17:43:40 +0000 (-0700) Subject: Merge branch 'patches/marcus/stripchart' X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=41c222c05eb0e3f36cf5a0e328eead58e77e3a8b;p=debian%2Fgnuradio Merge branch 'patches/marcus/stripchart' Conflicts: gr-wxgui/src/python/scope_window.py * Adds new scope window trigger, TRIG_MODE_STRIPCHART * Allows config file selection of whether background window sinks still run * Allows config file selection of default trigger mode * Allows config file selection of default waterfall sink color mode [wxgui] #Setting this to true prevents the window sinks from stopping when they #are not displayed, as when they are in a notebook with a hidden tab. run_always = False # Default scope trigger mode. # # 0 = Freerun # 1 = Auto (default) # 2 = Normal # 3 = Stripchart trig_mode = 1 # Default waterfall sink color mode. Valid choices are 'rgb1', 'rbg2', # 'rgb3', or 'gray' waterfall_color = rgb1 --- 41c222c05eb0e3f36cf5a0e328eead58e77e3a8b diff --cc gr-wxgui/src/python/scope_window.py index c03b71f1,e8c3a6ec..a9917782 --- a/gr-wxgui/src/python/scope_window.py +++ b/gr-wxgui/src/python/scope_window.py @@@ -36,8 -36,7 +36,9 @@@ import form # Constants ################################################## DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'scope_rate', 30) +PERSIST_ALPHA_MIN_EXP, PERSIST_ALPHA_MAX_EXP = -2, 0 +SLIDER_STEPS = 100 + DEFAULT_TRIG_MODE = gr.prefs().get_long('wxgui', 'trig_mode', gr.gr_TRIG_MODE_AUTO) DEFAULT_WIN_SIZE = (600, 300) COUPLING_MODES = ( ('DC', False), @@@ -430,8 -390,7 +432,9 @@@ class scope_window(wx.Panel, pubsub.pub trigger_channel_key, decimation_key, msg_key, + use_persistence, + persist_alpha, + trig_mode, ): pubsub.pubsub.__init__(self) #check num inputs @@@ -471,11 -430,14 +474,16 @@@ self[FRAME_RATE_KEY] = frame_rate self[TRIGGER_LEVEL_KEY] = 0 self[TRIGGER_CHANNEL_KEY] = 0 - self[TRIGGER_MODE_KEY] = gr.gr_TRIG_MODE_AUTO + self[TRIGGER_MODE_KEY] = trig_mode + self[TRIGGER_SLOPE_KEY] = gr.gr_TRIG_SLOPE_POS self[T_FRAC_OFF_KEY] = 0.5 + self[USE_PERSISTENCE_KEY] = use_persistence + self[PERSIST_ALPHA_KEY] = persist_alpha + + if self[TRIGGER_MODE_KEY] == gr.gr_TRIG_MODE_STRIPCHART: + self[T_FRAC_OFF_KEY] = 0.0 + 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 diff --cc gr-wxgui/src/python/scopesink_gl.py index ebf9b293,c7dbd4f7..15be23d5 --- a/gr-wxgui/src/python/scopesink_gl.py +++ b/gr-wxgui/src/python/scopesink_gl.py @@@ -76,18 -75,10 +76,19 @@@ class _scope_sink_base(gr.hier_block2, xy_mode=False, ac_couple=False, num_inputs=1, + trig_mode=scope_window.DEFAULT_TRIG_MODE, frame_rate=scope_window.DEFAULT_FRAME_RATE, + use_persistence=False, + persist_alpha=None, **kwargs #do not end with a comma ): + #ensure analog alpha + if persist_alpha is None: + actual_frame_rate=float(frame_rate) + analog_cutoff_freq=0.5 # Hertz + #calculate alpha from wanted cutoff freq + 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 gr.hier_block2.__init__(