diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/blocks/wxgui_constellationsink2.xml | 13 | ||||
-rw-r--r-- | grc/blocks/wxgui_fftsink2.xml | 13 | ||||
-rw-r--r-- | grc/blocks/wxgui_histosink2.xml | 13 | ||||
-rw-r--r-- | grc/blocks/wxgui_numbersink2.xml | 13 | ||||
-rw-r--r-- | grc/blocks/wxgui_scopesink2.xml | 13 | ||||
-rw-r--r-- | grc/blocks/wxgui_waterfallsink2.xml | 13 | ||||
-rw-r--r-- | grc/python/Param.py | 28 |
7 files changed, 95 insertions, 11 deletions
diff --git a/grc/blocks/wxgui_constellationsink2.xml b/grc/blocks/wxgui_constellationsink2.xml index 5969d8405..598b55064 100644 --- a/grc/blocks/wxgui_constellationsink2.xml +++ b/grc/blocks/wxgui_constellationsink2.xml @@ -23,6 +23,9 @@ constsink_gl.const_sink_c( gain_mu=$gain_mu, symbol_rate=$symbol_rate, omega_limit=$omega_limit, +#if $win_size() + size=$win_size, +#end if ) #if not $grid_pos() $(parent).Add(self.$(id).win) @@ -103,6 +106,13 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <type>real</type> </param> <param> + <name>Window Size</name> + <key>win_size</key> + <value></value> + <type>int_vector</type> + <hide>#if $win_size() then 'none' else 'part'#</hide> + </param> + <param> <name>Grid Position</name> <key>grid_pos</key> <value></value> @@ -114,11 +124,14 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <value></value> <type>notebook</type> </param> + <check>not $win_size or len($win_size) == 2</check> <sink> <name>in</name> <type>complex</type> </sink> <doc> +Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. + Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. diff --git a/grc/blocks/wxgui_fftsink2.xml b/grc/blocks/wxgui_fftsink2.xml index 6f19f1aa4..42bca5ccf 100644 --- a/grc/blocks/wxgui_fftsink2.xml +++ b/grc/blocks/wxgui_fftsink2.xml @@ -23,6 +23,9 @@ fftsink2.$(type.fcn)( avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#, title=$title, peak_hold=$peak_hold, +#if $win_size() + size=$win_size, +#end if ) #if not $grid_pos() $(parent).Add(self.$(id).win) @@ -159,6 +162,13 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <hide>#if $average() == 'True' then 'none' else 'all'#</hide> </param> <param> + <name>Window Size</name> + <key>win_size</key> + <value></value> + <type>int_vector</type> + <hide>#if $win_size() then 'none' else 'part'#</hide> + </param> + <param> <name>Grid Position</name> <key>grid_pos</key> <value></value> @@ -170,6 +180,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <value></value> <type>notebook</type> </param> + <check>not $win_size or len($win_size) == 2</check> <sink> <name>in</name> <type>$type</type> @@ -177,6 +188,8 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <doc> Set Average Alpha to 0 for automatic setting. +Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. + Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. diff --git a/grc/blocks/wxgui_histosink2.xml b/grc/blocks/wxgui_histosink2.xml index 454a4932c..9edf9650d 100644 --- a/grc/blocks/wxgui_histosink2.xml +++ b/grc/blocks/wxgui_histosink2.xml @@ -14,6 +14,9 @@ histosink_gl.histo_sink_f( title=$title, num_bins=$num_bins, frame_size=$frame_size, +#if $win_size() + size=$win_size, +#end if ) #if not $grid_pos() $(parent).Add(self.$(id).win) @@ -41,6 +44,13 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <type>int</type> </param> <param> + <name>Window Size</name> + <key>win_size</key> + <value></value> + <type>int_vector</type> + <hide>#if $win_size() then 'none' else 'part'#</hide> + </param> + <param> <name>Grid Position</name> <key>grid_pos</key> <value></value> @@ -52,11 +62,14 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <value></value> <type>notebook</type> </param> + <check>not $win_size or len($win_size) == 2</check> <sink> <name>in</name> <type>float</type> </sink> <doc> +Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. + Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. diff --git a/grc/blocks/wxgui_numbersink2.xml b/grc/blocks/wxgui_numbersink2.xml index cc66cdcb0..5289db8af 100644 --- a/grc/blocks/wxgui_numbersink2.xml +++ b/grc/blocks/wxgui_numbersink2.xml @@ -24,6 +24,9 @@ numbersink2.$(type.fcn)( label=$title, peak_hold=$peak_hold, show_gauge=$show_gauge, +#if $win_size() + size=$win_size, +#end if ) #if not $grid_pos() $(parent).Add(self.$(id).win) @@ -152,6 +155,13 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) </option> </param> <param> + <name>Window Size</name> + <key>win_size</key> + <value></value> + <type>int_vector</type> + <hide>#if $win_size() then 'none' else 'part'#</hide> + </param> + <param> <name>Grid Position</name> <key>grid_pos</key> <value></value> @@ -163,6 +173,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <value></value> <type>notebook</type> </param> + <check>not $win_size or len($win_size) == 2</check> <sink> <name>in</name> <type>$type</type> @@ -170,6 +181,8 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <doc> Set Average Alpha to 0 for automatic setting. +Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. + Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. diff --git a/grc/blocks/wxgui_scopesink2.xml b/grc/blocks/wxgui_scopesink2.xml index 503d52972..07d29ce8f 100644 --- a/grc/blocks/wxgui_scopesink2.xml +++ b/grc/blocks/wxgui_scopesink2.xml @@ -19,6 +19,9 @@ scopesink2.$(type.fcn)( ac_couple=$ac_couple, xy_mode=$xy_mode, num_inputs=$num_inputs, +#if $win_size() + size=$win_size, +#end if ) #if not $grid_pos() $(parent).Add(self.$(id).win) @@ -103,6 +106,13 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <type>int</type> </param> <param> + <name>Window Size</name> + <key>win_size</key> + <value></value> + <type>int_vector</type> + <hide>#if $win_size() then 'none' else 'part'#</hide> + </param> + <param> <name>Grid Position</name> <key>grid_pos</key> <value></value> @@ -114,6 +124,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <value></value> <type>notebook</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> <name>in</name> @@ -127,6 +138,8 @@ Set the T Scale to 0 for automatic setting. XY Mode allows the scope to initialize as an XY plotter. +Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. + Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. diff --git a/grc/blocks/wxgui_waterfallsink2.xml b/grc/blocks/wxgui_waterfallsink2.xml index 35790f820..cee598990 100644 --- a/grc/blocks/wxgui_waterfallsink2.xml +++ b/grc/blocks/wxgui_waterfallsink2.xml @@ -21,6 +21,9 @@ waterfallsink2.$(type.fcn)( average=$options.average, avg_alpha=#if $avg_alpha() then $avg_alpha else 'None'#, title=$title, +#if $win_size() + size=$win_size, +#end if ) #if not $grid_pos() $(parent).Add(self.$(id).win) @@ -116,6 +119,13 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) </option> </param> <param> + <name>Window Size</name> + <key>win_size</key> + <value></value> + <type>int_vector</type> + <hide>#if $win_size() then 'none' else 'part'#</hide> + </param> + <param> <name>Grid Position</name> <key>grid_pos</key> <value></value> @@ -127,6 +137,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <value></value> <type>notebook</type> </param> + <check>not $win_size or len($win_size) == 2</check> <sink> <name>in</name> <type>$type</type> @@ -134,6 +145,8 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos())))) <doc> Set Average Alpha to 0 for automatic setting. +Leave the window blank for the default size, otherwise enter a tuple of (width, height) pixels. + Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page. diff --git a/grc/python/Param.py b/grc/python/Param.py index 34d5ab116..81fb6ba7a 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -251,7 +251,7 @@ class Param(_Param, _GUIParam): ######################### # Numeric Types ######################### - elif t in ('raw', 'complex', 'real', 'int', 'complex_vector', 'real_vector', 'int_vector', 'hex', 'bool'): + elif t in ('raw', 'complex', 'real', 'int', 'hex', 'bool'): #raise exception if python cannot evaluate this value try: e = self.get_parent().get_parent().evaluate(v) except Exception, e: raise Exception, 'Value "%s" cannot be evaluated:\n%s'%(v, e) @@ -269,10 +269,22 @@ class Param(_Param, _GUIParam): try: assert isinstance(e, INT_TYPES) except AssertionError: raise Exception, 'Expression "%s" is invalid for type integer.'%str(e) return e - ######################### - # Numeric Vector Types - ######################### - elif t == 'complex_vector': + elif t == 'hex': return hex(e) + elif t == 'bool': + try: assert isinstance(e, bool) + except AssertionError: raise Exception, 'Expression "%s" is invalid for type bool.'%str(e) + return e + else: raise TypeError, 'Type "%s" not handled'%t + ######################### + # Numeric Vector Types + ######################### + elif t in ('complex_vector', 'real_vector', 'int_vector'): + if not v: v = '()' #turn a blank string into an empty list, so it will eval + #raise exception if python cannot evaluate this value + try: e = self.get_parent().get_parent().evaluate(v) + except Exception, e: raise Exception, 'Value "%s" cannot be evaluated:\n%s'%(v, e) + #raise an exception if the data is invalid + if t == 'complex_vector': if not isinstance(e, VECTOR_TYPES): self._lisitify_flag = True e = [e] @@ -296,12 +308,6 @@ class Param(_Param, _GUIParam): for ei in e: assert isinstance(ei, INT_TYPES) except AssertionError: raise Exception, 'Expression "%s" is invalid for type integer vector.'%str(e) return e - elif t == 'hex': return hex(e) - elif t == 'bool': - try: assert isinstance(e, bool) - except AssertionError: raise Exception, 'Expression "%s" is invalid for type bool.'%str(e) - return e - else: raise TypeError, 'Type "%s" not handled'%t ######################### # String Types ######################### |