diff options
Diffstat (limited to 'gr-wxgui/src/python')
-rw-r--r-- | gr-wxgui/src/python/common.py | 68 | ||||
-rw-r--r-- | gr-wxgui/src/python/const_window.py | 8 | ||||
-rw-r--r-- | gr-wxgui/src/python/fft_window.py | 8 | ||||
-rw-r--r-- | gr-wxgui/src/python/forms/__init__.py | 37 | ||||
-rw-r--r-- | gr-wxgui/src/python/forms/forms.py | 296 | ||||
-rw-r--r-- | gr-wxgui/src/python/histo_window.py | 8 | ||||
-rw-r--r-- | gr-wxgui/src/python/number_window.py | 12 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/bar_plotter.py | 18 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/channel_plotter.py | 34 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/common.py | 34 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/grid_plotter_base.py | 106 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/plotter_base.py | 12 | ||||
-rw-r--r-- | gr-wxgui/src/python/plotter/waterfall_plotter.py | 38 | ||||
-rw-r--r-- | gr-wxgui/src/python/scope_window.py | 8 | ||||
-rw-r--r-- | gr-wxgui/src/python/slider.py | 9 | ||||
-rw-r--r-- | gr-wxgui/src/python/waterfall_window.py | 8 |
16 files changed, 437 insertions, 267 deletions
diff --git a/gr-wxgui/src/python/common.py b/gr-wxgui/src/python/common.py index 1410d29dfa..57fc530f88 100644 --- a/gr-wxgui/src/python/common.py +++ b/gr-wxgui/src/python/common.py @@ -64,8 +64,12 @@ class wxgui_hb(object): """ Create a function that will cache the visibility flag, and only call the handler when that flag changes. - @param handler the function to call on a change - @return a function of 1 argument + + Args: + handler: the function to call on a change + + Returns: + a function of 1 argument """ cache = [None] def callback(visible): @@ -84,8 +88,10 @@ class wxgui_hb(object): Bind a handler to a window when its visibility changes. Specifically, call the handler when the window visibility changes. This condition is checked on every update ui event. - @param win the wx window - @param handler a function of 1 param + + Args: + win: the wx window + handler: a function of 1 param """ #is the window visible in the hierarchy def is_wx_window_visible(my_win): @@ -126,8 +132,10 @@ def _register_access_method(destination, controller, key): def register_access_methods(destination, controller): """ Register setter and getter functions in the destination object for all keys in the controller. - @param destination the object to get new setter and getter methods - @param controller the pubsub controller + + Args: + destination: the object to get new setter and getter methods + controller: the pubsub controller """ for key in controller.keys(): _register_access_method(destination, controller, key) @@ -164,8 +172,12 @@ import math def get_exp(num): """ Get the exponent of the number in base 10. - @param num the floating point number - @return the exponent as an integer + + Args: + num: the floating point number + + Returns: + the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num)))) @@ -173,8 +185,12 @@ def get_exp(num): def get_clean_num(num): """ Get the closest clean number match to num with bases 1, 2, 5. - @param num the number - @return the closest number + + Args: + num: the number + + Returns: + the closest number """ if num == 0: return 0 sign = num > 0 and 1 or -1 @@ -185,8 +201,12 @@ def get_clean_num(num): def get_clean_incr(num): """ Get the next higher clean number with bases 1, 2, 5. - @param num the number - @return the next higher number + + Args: + num: the number + + Returns: + the next higher number """ num = get_clean_num(num) exp = get_exp(num) @@ -203,8 +223,12 @@ def get_clean_incr(num): def get_clean_decr(num): """ Get the next lower clean number with bases 1, 2, 5. - @param num the number - @return the next lower number + + Args: + num: the number + + Returns: + the next lower number """ num = get_clean_num(num) exp = get_exp(num) @@ -221,8 +245,12 @@ def get_clean_decr(num): def get_min_max(samples): """ Get the minimum and maximum bounds for an array of samples. - @param samples the array of real values - @return a tuple of min, max + + Args: + samples: the array of real values + + Returns: + a tuple of min, max """ factor = 2.0 mean = numpy.average(samples) @@ -235,8 +263,12 @@ def get_min_max(samples): def get_min_max_fft(fft_samps): """ Get the minimum and maximum bounds for an array of fft samples. - @param samples the array of real values - @return a tuple of min, max + + Args: + samples: the array of real values + + Returns: + a tuple of min, max """ #get the peak level (max of the samples) peak_level = numpy.max(fft_samps) diff --git a/gr-wxgui/src/python/const_window.py b/gr-wxgui/src/python/const_window.py index 2ad89b2a38..1295aff1fa 100644 --- a/gr-wxgui/src/python/const_window.py +++ b/gr-wxgui/src/python/const_window.py @@ -60,7 +60,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -174,7 +176,9 @@ class const_window(wx.Panel, pubsub.pubsub): def handle_msg(self, msg): """ Plot the samples onto the complex grid. - @param msg the array of complex samples + + Args: + msg: the array of complex samples """ if not self[RUNNING_KEY]: return #convert to complex floating point numbers diff --git a/gr-wxgui/src/python/fft_window.py b/gr-wxgui/src/python/fft_window.py index fac83a4a34..ada926c418 100644 --- a/gr-wxgui/src/python/fft_window.py +++ b/gr-wxgui/src/python/fft_window.py @@ -61,7 +61,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -324,7 +326,9 @@ class fft_window(wx.Panel, pubsub.pubsub): If real, keep take only the positive bins. Plot the samples onto the grid as channel 1. If peak hold is enabled, plot peak vals as channel 2. - @param msg the fft array as a character array + + Args: + msg: the fft array as a character array """ if not self[RUNNING_KEY]: return #convert to floating point numbers diff --git a/gr-wxgui/src/python/forms/__init__.py b/gr-wxgui/src/python/forms/__init__.py index 3068b18fe1..67d3b4a88a 100644 --- a/gr-wxgui/src/python/forms/__init__.py +++ b/gr-wxgui/src/python/forms/__init__.py @@ -48,13 +48,15 @@ import wx class static_box_sizer(wx.StaticBoxSizer): """ A box sizer with label and border. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param label title label for this widget (optional) - @param bold true to boldify the label - @param orient the sizer orientation wx.VERTICAL or wx.HORIZONTAL (default=wx.VERTICAL) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + label: title label for this widget (optional) + bold: true to boldify the label + orient: the sizer orientation wx.VERTICAL or wx.HORIZONTAL (default=wx.VERTICAL) """ def __init__(self, parent, label='', bold=False, sizer=None, orient=wx.VERTICAL, proportion=0, flag=wx.EXPAND): box = wx.StaticBox(parent=parent, label=label) @@ -65,20 +67,17 @@ class static_box_sizer(wx.StaticBoxSizer): class incr_decr_buttons(wx.BoxSizer): """ A horizontal box sizer with a increment and a decrement button. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param label title label for this widget (optional) - @param on_incr the callback for pressing the + button - @param on_decr the callback for pressing the - button + + Args: + parent: the parent widget + on_incr: the callback for pressing the + button + on_decr: the callback for pressing the - button + label: title label for this widget (optional) + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) """ def __init__(self, parent, on_incr, on_decr, label='', sizer=None, proportion=0, flag=wx.EXPAND): - """ - @param parent the parent window - @param on_incr the event handler for increment - @param on_decr the event handler for decrement - """ wx.BoxSizer.__init__(self, wx.HORIZONTAL) buttons_box = wx.BoxSizer(wx.HORIZONTAL) self._incr_button = wx.Button(parent, label='+', style=wx.BU_EXACTFIT) diff --git a/gr-wxgui/src/python/forms/forms.py b/gr-wxgui/src/python/forms/forms.py index f1d0038abd..6eee31585e 100644 --- a/gr-wxgui/src/python/forms/forms.py +++ b/gr-wxgui/src/python/forms/forms.py @@ -90,11 +90,13 @@ class _form_base(pubsub, wx.BoxSizer): Bind the update handler to the widget for data events. This ensures that the gui thread handles updating widgets. Setup the pusub triggers for external and internal. - @param widget the main widget - @param label the optional label - @param flag additional flags for widget - @param label_prop the proportion for the label - @param widget_prop the proportion for the widget + + Args: + widget: the main widget + label: the optional label + flag: additional flags for widget + label_prop: the proportion for the label + widget_prop: the proportion for the widget """ #setup data event widget.Bind(EVT_DATA, lambda x: self._update(x.data)) @@ -184,18 +186,20 @@ class _slider_base(_form_base): class static_text(_form_base): """ A text box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param width the width of the form in px - @param bold true to bold-ify the text (default=False) - @param units a suffix to add after the text - @param converter forms.str_converter(), int_converter(), float_converter()... + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + width: the width of the form in px + bold: true to bold-ify the text (default=False) + units: a suffix to add after the text + converter: forms.str_converter(), int_converter(), float_converter()... """ def __init__(self, label='', width=-1, bold=False, units='', converter=converters.str_converter(), **kwargs): self._units = units @@ -214,16 +218,18 @@ class static_text(_form_base): class text_box(_form_base): """ A text box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param width the width of the form in px - @param converter forms.str_converter(), int_converter(), float_converter()... + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + width: the width of the form in px + converter: forms.str_converter(), int_converter(), float_converter()... """ def __init__(self, label='', width=-1, converter=converters.eval_converter(), **kwargs): _form_base.__init__(self, converter=converter, **kwargs) @@ -249,21 +255,23 @@ class text_box(_form_base): class slider(_slider_base): """ A generic linear slider. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param style wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) - @param minimum the minimum value - @param maximum the maximum value - @param num_steps the number of slider steps (or specify step_size) - @param step_size the step between slider jumps (or specify num_steps) - @param cast a cast function, int, or float (default=float) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + length: the length of the slider in px (optional) + style: wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) + minimum: the minimum value + maximum: the maximum value + num_steps: the number of slider steps (or specify step_size) + step_size: the step between slider jumps (or specify num_steps) + cast: a cast function, int, or float (default=float) """ def __init__(self, minimum=-100, maximum=100, num_steps=100, step_size=None, cast=float, **kwargs): assert step_size or num_steps @@ -275,21 +283,23 @@ class log_slider(_slider_base): """ A generic logarithmic slider. The sliders min and max values are base**min_exp and base**max_exp. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param style wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) - @param min_exp the minimum exponent - @param max_exp the maximum exponent - @param base the exponent base in base**exp - @param num_steps the number of slider steps (or specify step_size) - @param step_size the exponent step size (or specify num_steps) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + length: the length of the slider in px (optional) + style: wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) + min_exp: the minimum exponent + max_exp: the maximum exponent + base: the exponent base in base**exp + num_steps: the number of slider steps (or specify step_size) + step_size: the exponent step size (or specify num_steps) """ def __init__(self, min_exp=0, max_exp=1, base=10, num_steps=100, step_size=None, **kwargs): assert step_size or num_steps @@ -304,20 +314,22 @@ class gauge(_form_base): """ A gauge bar. The gauge displays floating point values between the minimum and maximum. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param style wx.GA_HORIZONTAL or wx.GA_VERTICAL (default=horizontal) - @param minimum the minimum value - @param maximum the maximum value - @param num_steps the number of slider steps (or specify step_size) - @param step_size the step between slider jumps (or specify num_steps) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + length: the length of the slider in px (optional) + style: wx.GA_HORIZONTAL or wx.GA_VERTICAL (default=horizontal) + minimum: the minimum value + maximum: the maximum value + num_steps: the number of slider steps (or specify step_size) + step_size: the step between slider jumps (or specify num_steps) """ def __init__(self, label='', length=-1, minimum=-100, maximum=100, num_steps=100, step_size=None, style=wx.GA_HORIZONTAL, **kwargs): assert step_size or num_steps @@ -338,16 +350,18 @@ class gauge(_form_base): class check_box(_form_base): """ Create a check box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param true the value for form when checked (default=True) - @param false the value for form when unchecked (default=False) - @param label title label for this widget (optional) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + true: the value for form when checked (default=True) + false: the value for form when unchecked (default=False) + label: title label for this widget (optional) """ def __init__(self, label='', true=True, false=False, **kwargs): _form_base.__init__(self, converter=converters.bool_converter(true=true, false=false), **kwargs) @@ -364,17 +378,19 @@ class check_box(_form_base): class drop_down(_chooser_base): """ Create a drop down menu form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param choices list of possible values - @param labels list of labels for each choice (default=choices) - @param label title label for this widget (optional) - @param width the form width in px (optional) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + choices: list of possible values + labels: list of labels for each choice (default=choices) + label: title label for this widget (optional) + width: the form width in px (optional) """ def __init__(self, label='', width=-1, **kwargs): _chooser_base.__init__(self, **kwargs) @@ -394,18 +410,18 @@ class drop_down(_chooser_base): class button(_chooser_base): """ Create a multi-state button. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param choices list of possible values - @param labels list of labels for each choice (default=choices) - @param width the width of the button in pixels (optional) - @param style style arguments (optional) - @param label title label for this widget (optional) + parent the parent widget + sizer add this widget to sizer if provided (optional) + proportion the proportion when added to the sizer (default=0) + flag the flag argument when added to the sizer (default=wx.EXPAND) + ps the pubsub object (optional) + key the pubsub key (optional) + value the default value (optional) + choices list of possible values + labels list of labels for each choice (default=choices) + width the width of the button in pixels (optional) + style style arguments (optional) + label title label for this widget (optional) """ def __init__(self, label='', style=0, width=-1, **kwargs): _chooser_base.__init__(self, **kwargs) @@ -420,17 +436,19 @@ class toggle_button(button): """ Create a dual-state button. This button will alternate between True and False when clicked. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param width the width of the button in pixels (optional) - @param style style arguments (optional) - @param true_label the button's label in the true state - @param false_label the button's label in the false state + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + width: the width of the button in pixels (optional) + style: style arguments (optional) + true_label: the button's label in the true state + false_label: the button's label in the false state """ def __init__(self, true_label='On (click to stop)', false_label='Off (click to start)', **kwargs): button.__init__(self, choices=[True, False], labels=[true_label, false_label], **kwargs) @@ -440,16 +458,18 @@ class single_button(toggle_button): Create a single state button. This button will callback() when clicked. For use when state holding is not important. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param width the width of the button in pixels (optional) - @param style style arguments (optional) - @param label the button's label + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + width: the width of the button in pixels (optional) + style: style arguments (optional) + label: the button's label """ def __init__(self, label='click for callback', **kwargs): toggle_button.__init__(self, true_label=label, false_label=label, value=True, **kwargs) @@ -460,18 +480,20 @@ class single_button(toggle_button): class radio_buttons(_chooser_base): """ Create a radio button form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param choices list of possible values - @param labels list of labels for each choice (default=choices) - @param major_dimension the number of rows/cols (default=auto) - @param label title label for this widget (optional) - @param style useful style args: wx.RA_HORIZONTAL, wx.RA_VERTICAL, wx.NO_BORDER (default=wx.RA_HORIZONTAL) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value the default value (optional) + choices: list of possible values + labels: list of labels for each choice (default=choices) + major_dimension: the number of rows/cols (default=auto) + label: title label for this widget (optional) + style: useful style args: wx.RA_HORIZONTAL, wx.RA_VERTICAL, wx.NO_BORDER (default=wx.RA_HORIZONTAL) """ def __init__(self, style=wx.RA_HORIZONTAL, label='', major_dimension=0, **kwargs): _chooser_base.__init__(self, **kwargs) diff --git a/gr-wxgui/src/python/histo_window.py b/gr-wxgui/src/python/histo_window.py index a1b520f9c1..3e38fdcb64 100644 --- a/gr-wxgui/src/python/histo_window.py +++ b/gr-wxgui/src/python/histo_window.py @@ -48,7 +48,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -134,7 +136,9 @@ class histo_window(wx.Panel, pubsub.pubsub): def handle_msg(self, msg): """ Handle the message from the fft sink message queue. - @param msg the frame as a character array + + Args: + msg: the frame as a character array """ if not self[RUNNING_KEY]: return #convert to floating point numbers diff --git a/gr-wxgui/src/python/number_window.py b/gr-wxgui/src/python/number_window.py index ab9d1ebc00..751047db94 100644 --- a/gr-wxgui/src/python/number_window.py +++ b/gr-wxgui/src/python/number_window.py @@ -54,7 +54,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent) @@ -176,7 +178,9 @@ class number_window(wx.Panel, pubsub.pubsub): """ Show or hide the gauges. If this is real, never show the imaginary gauge. - @param show_gauge true to show + + Args: + show_gauge: true to show """ self.gauge_real.ShowItems(show_gauge) self.gauge_imag.ShowItems(show_gauge and not self.real) @@ -187,7 +191,9 @@ class number_window(wx.Panel, pubsub.pubsub): Convert the string based message into a float or complex. If more than one number was read, only take the last number. Perform peak hold operations, set the gauges and display. - @param event event.data is the number sample as a character array + + Args: + event: event.data is the number sample as a character array """ if not self[RUNNING_KEY]: return format_string = "%%.%df"%self.decimal_places diff --git a/gr-wxgui/src/python/plotter/bar_plotter.py b/gr-wxgui/src/python/plotter/bar_plotter.py index 3f9259e9df..487db66b64 100644 --- a/gr-wxgui/src/python/plotter/bar_plotter.py +++ b/gr-wxgui/src/python/plotter/bar_plotter.py @@ -108,9 +108,13 @@ class bar_plotter(grid_plotter_base): Get the text the will populate the point label. Give X and Y values for the current point. Give values for the channel at the X coordinate. - @param x_val the current x value - @param y_val the current y value - @return a string with newlines + + Args: + x_val: the current x value + y_val: the current y value + + Returns: + a string with newlines """ if len(self._bars) == 0: return '' scalar = float(len(self._bars)-1)/(self.x_max - self.x_min) @@ -130,9 +134,11 @@ class bar_plotter(grid_plotter_base): def set_bars(self, bars, bar_width, color_spec): """ Set the bars. - @param bars a list of bars - @param bar_width the fractional width of the bar, between 0 and 1 - @param color_spec the color tuple + + Args: + bars: a list of bars + bar_width: the fractional width of the bar, between 0 and 1 + color_spec: the color tuple """ self.lock() self._bars = bars diff --git a/gr-wxgui/src/python/plotter/channel_plotter.py b/gr-wxgui/src/python/plotter/channel_plotter.py index 4bcc36fd4c..1eac9f5f3a 100644 --- a/gr-wxgui/src/python/plotter/channel_plotter.py +++ b/gr-wxgui/src/python/plotter/channel_plotter.py @@ -67,8 +67,12 @@ class channel_plotter(grid_plotter_base): def enable_legend(self, enable=None): """ Enable/disable the legend. - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_legend self.lock() @@ -128,9 +132,13 @@ class channel_plotter(grid_plotter_base): Get the text the will populate the point label. Give X and Y values for the current point. Give values for the channel at the X coordinate. - @param x_val the current x value - @param y_val the current y value - @return a string with newlines + + Args: + x_val: the current x value + y_val: the current y value + + Returns: + a string with newlines """ #create text label_str = '%s: %s\n%s: %s'%( @@ -186,7 +194,9 @@ class channel_plotter(grid_plotter_base): def clear_waveform(self, channel): """ Remove a waveform from the list of waveforms. - @param channel the channel key + + Args: + channel: the channel key """ self.lock() if channel in self._channels.keys(): @@ -198,11 +208,13 @@ class channel_plotter(grid_plotter_base): def set_waveform(self, channel, samples=[], color_spec=(0, 0, 0), marker=None, trig_off=0): """ Set the waveform for a given channel. - @param channel the channel key - @param samples the waveform samples - @param color_spec the 3-tuple for line color - @param marker None for line - @param trig_off fraction of sample for trigger offset + + Args: + channel: the channel key + samples: the waveform samples + color_spec: the 3-tuple for line color + marker: None for line + trig_off: fraction of sample for trigger offset """ self.lock() if channel not in self._channels.keys(): self._legend_cache.changed(True) diff --git a/gr-wxgui/src/python/plotter/common.py b/gr-wxgui/src/python/plotter/common.py index 88215e039a..9af636245d 100644 --- a/gr-wxgui/src/python/plotter/common.py +++ b/gr-wxgui/src/python/plotter/common.py @@ -30,8 +30,12 @@ import wx def get_exp(num): """ Get the exponent of the number in base 10. - @param num the floating point number - @return the exponent as an integer + + Args: + num: the floating point number + + Returns: + the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num)))) @@ -41,8 +45,12 @@ def get_si_components(num): Get the SI units for the number. Extract the coeff and exponent of the number. The exponent will be a multiple of 3. - @param num the floating point number - @return the tuple coeff, exp, prefix + + Args: + num: the floating point number + + Returns: + the tuple coeff, exp, prefix """ num = float(num) exp = get_exp(num) @@ -65,8 +73,12 @@ def get_si_components(num): def sci_format(num): """ Format a floating point number into scientific notation. - @param num the number to format - @return a label string + + Args: + num: the number to format + + Returns: + a label string """ coeff, exp, prefix = get_si_components(num) if -3 <= exp < 3: return '%g'%num @@ -75,9 +87,13 @@ def sci_format(num): def eng_format(num, units=''): """ Format a floating point number into engineering notation. - @param num the number to format - @param units the units to append - @return a label string + + Args: + num: the number to format + units: the units to append + + Returns: + a label string """ coeff, exp, prefix = get_si_components(num) if -3 <= exp < 3: return '%g'%num diff --git a/gr-wxgui/src/python/plotter/grid_plotter_base.py b/gr-wxgui/src/python/plotter/grid_plotter_base.py index f1bc8f546d..a492539575 100644 --- a/gr-wxgui/src/python/plotter/grid_plotter_base.py +++ b/gr-wxgui/src/python/plotter/grid_plotter_base.py @@ -78,7 +78,9 @@ class grid_plotter_base(plotter_base): def set_point_label_coordinate(self, coor): """ Set the point label coordinate. - @param coor the coordinate x, y tuple or None + + Args: + coor: the coordinate x, y tuple or None """ self.lock() self._point_label_coordinate = coor @@ -103,8 +105,12 @@ class grid_plotter_base(plotter_base): Enable/disable the grid aspect ratio. If enabled, enforce the aspect ratio on the padding: horizontal_padding:vertical_padding == width:height - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_grid_aspect_ratio self.lock() @@ -115,8 +121,12 @@ class grid_plotter_base(plotter_base): def enable_point_label(self, enable=None): """ Enable/disable the point label. - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_point_label self.lock() @@ -127,7 +137,9 @@ class grid_plotter_base(plotter_base): def set_title(self, title): """ Set the title. - @param title the title string + + Args: + title the title string """ self.lock() self.title = title @@ -137,8 +149,10 @@ class grid_plotter_base(plotter_base): def set_x_label(self, x_label, x_units=''): """ Set the x label and units. - @param x_label the x label string - @param x_units the x units string + + Args: + x_label: the x label string + x_units: the x units string """ self.lock() self.x_label = x_label @@ -149,8 +163,10 @@ class grid_plotter_base(plotter_base): def set_y_label(self, y_label, y_units=''): """ Set the y label and units. - @param y_label the y label string - @param y_units the y units string + + Args: + y_label: the y label string + y_units: the y units string """ self.lock() self.y_label = y_label @@ -161,10 +177,12 @@ class grid_plotter_base(plotter_base): def set_x_grid(self, minimum, maximum, step, scale=False): """ Set the x grid parameters. - @param minimum the left-most value - @param maximum the right-most value - @param step the grid spacing - @param scale true to scale the x grid + + Args: + minimum: the left-most value + maximum: the right-most value + step: the grid spacing + scale: true to scale the x grid """ self.lock() self.x_min = float(minimum) @@ -183,10 +201,12 @@ class grid_plotter_base(plotter_base): def set_y_grid(self, minimum, maximum, step, scale=False): """ Set the y grid parameters. - @param minimum the bottom-most value - @param maximum the top-most value - @param step the grid spacing - @param scale true to scale the y grid + + Args: + minimum: the bottom-most value + maximum: the top-most value + step: the grid spacing + scale: true to scale the y grid """ self.lock() self.y_min = float(minimum) @@ -305,9 +325,13 @@ class grid_plotter_base(plotter_base): def _get_tick_label(self, tick, unit): """ Format the tick value and create a gl text. - @param tick the floating point tick value - @param unit the axis unit - @return the tick label text + + Args: + tick: the floating point tick value + unit: the axis unit + + Returns: + the tick label text """ if unit: tick_str = common.sci_format(tick) else: tick_str = common.eng_format(tick) @@ -316,11 +340,15 @@ class grid_plotter_base(plotter_base): def _get_ticks(self, min, max, step, scalar): """ Determine the positions for the ticks. - @param min the lower bound - @param max the upper bound - @param step the grid spacing - @param scalar the grid scaling - @return a list of tick positions between min and max + + Args: + min: the lower bound + max: the upper bound + step: the grid spacing + scalar: the grid scaling + + Returns: + a list of tick positions between min and max """ #cast to float min = float(min) @@ -340,8 +368,12 @@ class grid_plotter_base(plotter_base): def enable_grid_lines(self, enable=None): """ Enable/disable the grid lines. - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_grid_lines self.lock() @@ -352,8 +384,10 @@ class grid_plotter_base(plotter_base): def _draw_grid_line(self, coor1, coor2): """ Draw a dashed line from coor1 to coor2. - @param corr1 a tuple of x, y - @param corr2 a tuple of x, y + + Args: + corr1: a tuple of x, y + corr2: a tuple of x, y """ if not self.enable_grid_lines(): return length = math.sqrt((coor1[0] - coor2[0])**2 + (coor1[1] - coor2[1])**2) @@ -372,11 +406,13 @@ class grid_plotter_base(plotter_base): """ Draw a rectangle on the x, y plane. X and Y are the top-left corner. - @param x the left position of the rectangle - @param y the top position of the rectangle - @param width the width of the rectangle - @param height the height of the rectangle - @param fill true to color inside of rectangle + + Args: + x: the left position of the rectangle + y: the top position of the rectangle + width: the width of the rectangle + height: the height of the rectangle + fill: true to color inside of rectangle """ GL.glBegin(fill and GL.GL_QUADS or GL.GL_LINE_LOOP) GL.glVertex2f(x, y) diff --git a/gr-wxgui/src/python/plotter/plotter_base.py b/gr-wxgui/src/python/plotter/plotter_base.py index 2fdd0f20ab..3ad1e81582 100644 --- a/gr-wxgui/src/python/plotter/plotter_base.py +++ b/gr-wxgui/src/python/plotter/plotter_base.py @@ -37,7 +37,9 @@ class gl_cache(object): def __init__(self, draw): """ Create a new cache. - @param draw a function to draw gl stuff + + Args: + draw: a function to draw gl stuff """ self.changed(True) self._draw = draw @@ -84,7 +86,9 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): Initialize the GLCanvas with double buffering. Initialize various plotter flags. Bind the paint and size events. - @param parent the parent widgit + + Args: + parent: the parent widgit """ attribList = (wx.glcanvas.WX_GL_DOUBLEBUFFER, wx.glcanvas.WX_GL_RGBA) wx.glcanvas.GLCanvas.__init__(self, parent, attribList=attribList); @@ -111,7 +115,9 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): """ Create a new gl cache. Register its draw and init function. - @return the new cache object + + Returns: + the new cache object """ cache = gl_cache(draw_fcn) self.register_init(cache.init) diff --git a/gr-wxgui/src/python/plotter/waterfall_plotter.py b/gr-wxgui/src/python/plotter/waterfall_plotter.py index 6a6bf6330e..02ec67ee4c 100644 --- a/gr-wxgui/src/python/plotter/waterfall_plotter.py +++ b/gr-wxgui/src/python/plotter/waterfall_plotter.py @@ -49,8 +49,12 @@ def _get_rbga(red_pts, green_pts, blue_pts, alpha_pts=[(0, 0), (1, 0)]): The x and y values of the coordinates range from 0 to 1. The coordinates must be specified so that x increases with the index value. Resulting values are calculated along the line formed between 2 coordinates. - @param *_pts an array of x,y coordinates for each color element - @return array of rbga values (4 bytes) each + + Args: + red_pts, green_pts, blue_pts, alpha_pts: an array of x,y coordinates for each color element + + Returns: + array of rbga values (4 bytes) each """ def _fcn(x, pw): for (x1, y1), (x2, y2) in zip(pw, pw[1:]): @@ -167,9 +171,13 @@ class waterfall_plotter(grid_plotter_base): """ Get the text the will populate the point label. Give the X value for the current point. - @param x_val the current x value - @param y_val the current y value - @return a value string with units + + Args: + x_val: the current x value + y_val: the current y value + + Returns: + a value string with units """ return '%s: %s'%(self.x_label, common.eng_format(x_val, self.x_units)) @@ -210,7 +218,9 @@ class waterfall_plotter(grid_plotter_base): def _resize_texture(self, flag=None): """ Create the texture to fit the fft_size X num_lines. - @param flag the set/unset or update flag + + Args: + flag: the set/unset or update flag """ if flag is not None: self._resize_texture_flag = flag @@ -229,7 +239,9 @@ class waterfall_plotter(grid_plotter_base): Set the color mode. New samples will be converted to the new color mode. Old samples will not be recolorized. - @param color_mode the new color mode string + + Args: + color_mode: the new color mode string """ self.lock() if color_mode in COLORS.keys(): @@ -242,7 +254,9 @@ class waterfall_plotter(grid_plotter_base): """ Set number of lines. Powers of two only. - @param num_lines the new number of lines + + Args: + num_lines: the new number of lines """ self.lock() self._num_lines = num_lines @@ -254,9 +268,11 @@ class waterfall_plotter(grid_plotter_base): """ Set the samples to the waterfall. Convert the samples to color data. - @param samples the array of floats - @param minimum the minimum value to scale - @param maximum the maximum value to scale + + Args: + samples: the array of floats + minimum: the minimum value to scale + maximum: the maximum value to scale """ self.lock() #set the min, max values diff --git a/gr-wxgui/src/python/scope_window.py b/gr-wxgui/src/python/scope_window.py index dc90a60459..306e1757f1 100644 --- a/gr-wxgui/src/python/scope_window.py +++ b/gr-wxgui/src/python/scope_window.py @@ -84,7 +84,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ WIDTH = 90 self.parent = parent @@ -526,7 +528,9 @@ class scope_window(wx.Panel, pubsub.pubsub): Handle the message from the scope sink message queue. Plot the list of arrays of samples onto the grid. Each samples array gets its own channel. - @param msg the time domain data as a character array + + Args: + msg: the time domain data as a character array """ if not self[RUNNING_KEY]: return #check time elapsed diff --git a/gr-wxgui/src/python/slider.py b/gr-wxgui/src/python/slider.py index e8cdcfcaca..7194de47c2 100644 --- a/gr-wxgui/src/python/slider.py +++ b/gr-wxgui/src/python/slider.py @@ -6,11 +6,10 @@ def slider(parent, min, max, callback): """ Return a wx.Slider object. - @param min: minimum slider value - @type min: float - @param max: maximum slider value - @type max: float - @param callback: function of one arg invoked when slider moves. + Args: + min: minimum slider value (float) + max: maximum slider value (float) + callback: function of one arg invoked when slider moves. @rtype: wx.Slider """ new_id = wx.NewId() diff --git a/gr-wxgui/src/python/waterfall_window.py b/gr-wxgui/src/python/waterfall_window.py index cd60104d7a..7d401223c2 100644 --- a/gr-wxgui/src/python/waterfall_window.py +++ b/gr-wxgui/src/python/waterfall_window.py @@ -61,7 +61,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -259,7 +261,9 @@ class waterfall_window(wx.Panel, pubsub.pubsub): If complex, reorder the fft samples so the negative bins come first. If real, keep take only the positive bins. Send the data to the plotter. - @param msg the fft array as a character array + + Args: + msg: the fft array as a character array """ if not self[RUNNING_KEY]: return #convert to floating point numbers |