Adds a new parameter "y_axis_label" to scopesink2 and the GRC .xml file that contains...
authorMarcus Leech <mleech@ripnet.com>
Sun, 17 Oct 2010 21:20:04 +0000 (17:20 -0400)
committerTom Rondeau <trondeau@vt.edu>
Sun, 17 Oct 2010 21:20:04 +0000 (17:20 -0400)
gr-wxgui/src/python/constants.py
gr-wxgui/src/python/scope_window.py
gr-wxgui/src/python/scopesink_gl.py
grc/blocks/wxgui_scopesink2.xml

index 9612f36ddec1f0679c72c8811181a45cd32582fe..070be0808bef962bf8abe2558497bf9ef6b6b090 100644 (file)
@@ -66,6 +66,7 @@ X_PER_DIV_KEY = 'x_per_div'
 Y_DIVS_KEY = 'y_divs'
 Y_OFF_KEY = 'y_off'
 Y_PER_DIV_KEY = 'y_per_div'
+Y_AXIS_LABEL = 'y_axis_label'
 MAXIMUM_KEY = 'maximum'
 MINIMUM_KEY = 'minimum'
 NUM_BINS_KEY = 'num_bins'
index a9917782f4f736b86f7cea5eaaa8cd327b638338..89a808cec055e9250ed2c0c46819747d5d69354c 100644 (file)
@@ -435,6 +435,7 @@ class scope_window(wx.Panel, pubsub.pubsub):
                 use_persistence,
                 persist_alpha,
                trig_mode,
+               y_axis_label,
        ):
                pubsub.pubsub.__init__(self)
                #check num inputs
@@ -471,6 +472,7 @@ class scope_window(wx.Panel, pubsub.pubsub):
                self[T_DIVS_KEY] = 8
                self[X_DIVS_KEY] = 8
                self[Y_DIVS_KEY] = 8
+               self[Y_AXIS_LABEL] = y_axis_label
                self[FRAME_RATE_KEY] = frame_rate
                self[TRIGGER_LEVEL_KEY] = 0
                self[TRIGGER_CHANNEL_KEY] = 0
@@ -676,7 +678,7 @@ class scope_window(wx.Panel, pubsub.pubsub):
                        self.plotter.set_x_label('Time', 's')
                        self.plotter.set_x_grid(self.get_t_min(), self.get_t_max(), self[T_PER_DIV_KEY], True)
                        #update the y axis
-                       self.plotter.set_y_label('Counts')
+                       self.plotter.set_y_label(self[Y_AXIS_LABEL])
                        self.plotter.set_y_grid(self.get_y_min(), self.get_y_max(), self[Y_PER_DIV_KEY])
                #redraw current sample
                self.handle_samples()
index 15be23d5aee8c0f865a7ebb3115fce8857ff7acb..5ae897400b8f683d88a27b49c936993bb4562f5a 100644 (file)
@@ -77,6 +77,7 @@ class _scope_sink_base(gr.hier_block2, common.wxgui_hb):
                ac_couple=False,
                num_inputs=1,
                trig_mode=scope_window.DEFAULT_TRIG_MODE,
+               y_axis_label='Counts',
                frame_rate=scope_window.DEFAULT_FRAME_RATE,
                 use_persistence=False,
                 persist_alpha=None,
@@ -134,6 +135,7 @@ class _scope_sink_base(gr.hier_block2, common.wxgui_hb):
                        v_offset=v_offset,
                        xy_mode=xy_mode,
                        trig_mode=trig_mode,
+                       y_axis_label=y_axis_label,
                        ac_couple_key=AC_COUPLE_KEY,
                        trigger_level_key=TRIGGER_LEVEL_KEY,
                        trigger_mode_key=TRIGGER_MODE_KEY,
index 50cd977be21c8ee3c0ef031e03fded2ad515609d..ef037737396bc3cf804a2f61ab85bee0f2c726a7 100644 (file)
@@ -21,6 +21,7 @@ scopesink2.$(type.fcn)(
        xy_mode=$xy_mode,
        num_inputs=$num_inputs,
        trig_mode=$trig_mode,
+       y_axis_label=$y_axis_label,
 #if $win_size()
        size=$win_size,
 #end if
@@ -156,6 +157,12 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
                        <key>gr.gr_TRIG_MODE_STRIPCHART</key>
                </option>
        </param>
+       <param>
+               <name>Y Axis Label</name>
+               <key>y_axis_label</key>
+               <value>Counts</value>
+               <type>string</type>
+       </param>
        <check>not $win_size or len($win_size) == 2</check>
        <check>not $xy_mode or '$type' == 'complex' or $num_inputs != 1</check>
        <sink>