Changeset 9745

Show
Ignore:
Timestamp:
10/07/08 23:18:19
Author:
jblum
Message:

probe function block

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/trunk/grc/data/platforms/python/block_tree.xml

    r9741 r9745  
    242242                <block>gr_probe_density_b</block> 
    243243                <block>gr_probe_mpsk_snr_c</block> 
     244                <block>probe_function</block> 
    244245        </cat> 
    245246        <cat> 
  • gnuradio/trunk/grc/data/platforms/python/blocks/Makefile.am

    r9741 r9745  
    185185        parameter.xml \ 
    186186        preferences.xml \ 
     187        probe_function.xml \ 
    187188        random_source_x.xml \ 
    188189        trellis_encoder_xx.xml \ 
  • gnuradio/trunk/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml

    r9741 r9745  
    1010        <import>from grc_gnuradio import blks2 as grc_blks2</import> 
    1111        <make>grc_blks2.probe_mpsk_snr_c( 
    12         type="$type"
     12        type=&quot;$type&quot;
    1313        alpha=$alpha, 
    1414        probe_rate=$probe_rate, 
  • gnuradio/trunk/grc/src/grc_gnuradio/blks2/__init__.py

    r9741 r9745  
    2626from packet import packet_encoder, packet_decoder 
    2727from error_rate import error_rate 
    28 from probe import probe_avg_mag_sqrd_c, probe_avg_mag_sqrd_f, probe_density_b, probe_mpsk_snr_c 
     28from probe import probe_function, probe_avg_mag_sqrd_c, probe_avg_mag_sqrd_f, probe_density_b, probe_mpsk_snr_c 
  • gnuradio/trunk/grc/src/grc_gnuradio/blks2/probe.py

    r9741 r9745  
    2525import time 
    2626 
    27 class _probe_base(gr.hier_block2, threading.Thread): 
     27####################################################################################### 
     28## Probe: Function 
     29####################################################################################### 
     30class probe_function(gr.hier_block2, threading.Thread): 
    2831        """ 
    29         A hier2 block with float output and probe input. 
    30         The thread polls the prope for values and writes to a message source. 
     32        The thread polls the function for values and writes to a message source. 
    3133        """ 
    3234 
    33         def __init__(self, probe_block, probe_callback, probe_rate): 
     35        def __init__(self, probe_callback, probe_rate): 
    3436                #init hier block 
    3537                gr.hier_block2.__init__( 
    36                         self, 'probe', 
    37                         gr.io_signature(1, 1, probe_block.input_signature().sizeof_stream_items()[0]), 
     38                        self, 'probe_function', 
     39                        gr.io_signature(0, 0, 0), 
    3840                        gr.io_signature(1, 1, gr.sizeof_float), 
    3941                ) 
     
    4446                self._msgq = message_source.msgq() 
    4547                #connect 
    46                 self.connect(self, probe_block) 
    4748                self.connect(message_source, self) 
    4849                #setup thread 
     
    6364        def set_probe_rate(self, probe_rate): 
    6465                self._probe_rate = probe_rate 
     66 
     67class _probe_base(gr.hier_block2): 
     68        def __init__(self, probe_block, probe_callback, probe_rate): 
     69                #init hier block 
     70                gr.hier_block2.__init__( 
     71                        self, 'probe', 
     72                        gr.io_signature(1, 1, probe_block.input_signature().sizeof_stream_items()[0]), 
     73                        gr.io_signature(1, 1, gr.sizeof_float), 
     74                ) 
     75                probe_function_block = probe_function(probe_callback, probe_rate) 
     76                #forward callbacks 
     77                self.set_probe_rate = probe_function_block.set_probe_rate 
     78                #connect 
     79                self.connect(self, probe_block) 
     80                self.connect(probe_function_block, self) 
    6581 
    6682####################################################################################### 
  • gnuradio/trunk/grc/src/platforms/python/Generator.py

    r9525 r9745  
    8282                #list of blocks not including variables and imports and parameters and disabled 
    8383                blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) 
    84                 blocks = filter(lambda b: b not in (imports + parameters + variables), blocks) 
     84                probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list 
     85                blocks = filter(lambda b: b not in (imports + parameters + variables + probes), blocks) + probes 
    8586                #list of connections where each endpoint is enabled 
    8687                connections = self._flow_graph.get_enabled_connections() 
  • gnuradio/trunk/grc/todo.txt

    r9741 r9745  
    77-throttle with sink only (source is nulled) 
    88-simplify simple usrp 
     9-numbersink: update wrapper for newer api 
     10-probe: also non-float outputs 
    911 
    1012##################################################