]> git.gag.com Git - debian/gnuradio/commitdiff
Merge branch 'patches/marcus/stripchart'
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 5 Jul 2010 17:43:40 +0000 (10:43 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 5 Jul 2010 17:43:40 +0000 (10:43 -0700)
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

1  2 
gr-wxgui/src/python/scope_window.py
gr-wxgui/src/python/scopesink_gl.py

index c03b71f1e0c84494791265be416f9eef29ea2d55,e8c3a6ecfe965b972ee76c62c89d2f2b17381b01..a9917782f4f736b86f7cea5eaaa8cd327b638338
@@@ -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
                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
index ebf9b29398479ff260b7f72b089f77571f1ca37e,c7dbd4f799089820f34afaf1a257571a5ec8bab6..15be23d5aee8c0f865a7ebb3115fce8857ff7acb
@@@ -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__(