Changeset 9514

Show
Ignore:
Timestamp:
09/06/08 22:13:30
Author:
jblum
Message:

source code cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/branches/developers/jblum/grc_reorganize/grc/src/grc_gnuradio/blks2/__init__.py

    r9378 r9514  
    11# Copyright 2008 Free Software Foundation, Inc. 
    2 #  
     2# 
    33# This file is part of GNU Radio 
    4 #  
     4# 
    55# GNU Radio is free software; you can redistribute it and/or modify 
    66# it under the terms of the GNU General Public License as published by 
    77# the Free Software Foundation; either version 3, or (at your option) 
    88# any later version. 
    9 #  
     9# 
    1010# GNU Radio is distributed in the hope that it will be useful, 
    1111# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1212# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1313# GNU General Public License for more details. 
    14 #  
     14# 
    1515# You should have received a copy of the GNU General Public License 
    1616# along with GNU Radio; see the file COPYING.  If not, write to 
    1717# the Free Software Foundation, Inc., 51 Franklin Street, 
    1818# Boston, MA 02110-1301, USA. 
    19 #  
     19# 
    2020 
    2121from queue import queue_sink_thread 
     
    2626from packet import packet_encoder, packet_decoder 
    2727from error_rate import error_rate 
    28  
  • gnuradio/branches/developers/jblum/grc_reorganize/grc/src/grc_gnuradio/blks2/error_rate.py

    r9378 r9514  
    11# Copyright 2008 Free Software Foundation, Inc. 
    2 #  
     2# 
    33# This file is part of GNU Radio 
    4 #  
     4# 
    55# GNU Radio is free software; you can redistribute it and/or modify 
    66# it under the terms of the GNU General Public License as published by 
    77# the Free Software Foundation; either version 3, or (at your option) 
    88# any later version. 
    9 #  
     9# 
    1010# GNU Radio is distributed in the hope that it will be useful, 
    1111# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1212# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1313# GNU General Public License for more details. 
    14 #  
     14# 
    1515# You should have received a copy of the GNU General Public License 
    1616# along with GNU Radio; see the file COPYING.  If not, write to 
    1717# the Free Software Foundation, Inc., 51 Franklin Street, 
    1818# Boston, MA 02110-1301, USA. 
    19 #  
     19# 
    2020 
    2121default_win_size = 1000 
     
    3232        Read samples from the message queue and hand them to the callback. 
    3333        """ 
    34          
     34 
    3535        def __init__(self, msgq, callback): 
    3636                self._msgq = msgq 
     
    4040                self.keep_running = True 
    4141                self.start() 
    42                  
     42 
    4343        def run(self): 
    4444                r = '' 
     
    5050                        i = (nitems-nitems%2)*itemsize 
    5151                        r = s[i:] 
    52                         s = s[:i]                       
     52                        s = s[:i] 
    5353                        samples = numpy.fromstring(s, numpy.int8) 
    54                         self._callback(samples)                 
    55                  
     54                        self._callback(samples) 
     55 
    5656class error_rate(gr.hier_block2): 
    5757        """ 
     
    5959        Write the running rate to the output data stream (float). 
    6060        """ 
    61          
    62         def __init__(self, type='BER', win_size=default_win_size, bits_per_symbol=2):   
    63                 """! 
     61 
     62        def __init__(self, type='BER', win_size=default_win_size, bits_per_symbol=2): 
     63                """ 
    6464                Error rate constructor. 
    6565                @param type a string 'BER' or 'SER' 
    6666                @param win_size the number of samples to calculate over 
    6767                @param bits_per_symbol the number of information bits per symbol (BER only) 
    68                 """     
     68                """ 
    6969                #init 
    7070                gr.hier_block2.__init__( 
    71                         self, 'error_rate',  
    72                         gr.io_signature(2, 2, gr.sizeof_char),  
     71                        self, 'error_rate', 
     72                        gr.io_signature(2, 2, gr.sizeof_char), 
    7373                        gr.io_signature(1, 1, gr.sizeof_float), 
    7474                ) 
     
    9696                self.connect((self, 1), (inter, 1)) 
    9797                self.connect(inter, msg_sink) 
    98                  
     98 
    9999        def _handler_ber(self, samples): 
    100100                num = len(samples)/2 
    101101                arr = numpy.zeros(num, numpy.float32) 
    102102                for i in range(num): 
    103                         old_err = self._err_array[self._err_index]                                                                      
     103                        old_err = self._err_array[self._err_index] 
    104104                        #record error 
    105105                        self._err_array[self._err_index] = _1s_counts[samples[i*2] ^ samples[i*2 + 1]] 
     
    112112                #write message 
    113113                msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, num) 
    114                 self._msgq_source.insert_tail(msg)                      
    115                  
     114                self._msgq_source.insert_tail(msg) 
     115 
    116116        def _handler_ser(self, samples): 
    117117                num = len(samples)/2 
    118118                arr = numpy.zeros(num, numpy.float32) 
    119119                for i in range(num): 
    120                         old_err = self._err_array[self._err_index]                                                                      
     120                        old_err = self._err_array[self._err_index] 
    121121                        #record error 
    122122                        ref = samples[i*2] 
     
    135135                #write message 
    136136                msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, num) 
    137                 self._msgq_source.insert_tail(msg)               
    138                  
     137                self._msgq_source.insert_tail(msg) 
  • gnuradio/branches/developers/jblum/grc_reorganize/grc/src/grc_gnuradio/blks2/packet.py

    r9378 r9514  
    11# Copyright 2008 Free Software Foundation, Inc. 
    2 #  
     2# 
    33# This file is part of GNU Radio 
    4 #  
     4# 
    55# GNU Radio is free software; you can redistribute it and/or modify 
    66# it under the terms of the GNU General Public License as published by 
    77# the Free Software Foundation; either version 3, or (at your option) 
    88# any later version. 
    9 #  
     9# 
    1010# GNU Radio is distributed in the hope that it will be useful, 
    1111# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1212# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1313# GNU General Public License for more details. 
    14 #  
     14# 
    1515# You should have received a copy of the GNU General Public License 
    1616# along with GNU Radio; see the file COPYING.  If not, write to 
    1717# the Free Software Foundation, Inc., 51 Franklin Street, 
    1818# Boston, MA 02110-1301, USA. 
    19 #  
     19# 
    2020 
    2121from gnuradio import gr, packet_utils 
     
    3232 
    3333####################################################################################### 
    34 ##     Packet Encoder 
     34## Packet Encoder 
    3535####################################################################################### 
    3636 
    3737class _packet_encoder_thread(_threading.Thread): 
    38          
     38 
    3939        def __init__(self, msgq, payload_length, send): 
    4040                self._msgq = msgq 
     
    4545                self.keep_running = True 
    4646                self.start() 
    47                  
     47 
    4848        def run(self): 
    4949                sample = '' #residual sample 
    5050                while self.keep_running: 
    5151                        msg = self._msgq.delete_head() #blocking read of message queue 
    52                         sample = sample + msg.to_string() #get the body of the msg as a string  
    53                         while len(sample) >= self._payload_length:              
     52                        sample = sample + msg.to_string() #get the body of the msg as a string 
     53                        while len(sample) >= self._payload_length: 
    5454                                payload = sample[0:self._payload_length] 
    55                                 sample = sample[self._payload_length:]                  
    56                                 self._send(payload)     
     55                                sample = sample[self._payload_length:] 
     56                                self._send(payload) 
    5757 
    5858class packet_encoder(gr.hier_block2): 
     
    6060        Hierarchical block for wrapping packet-based modulators. 
    6161        """ 
    62          
     62 
    6363        def __init__(self, item_size_in, samples_per_symbol, bits_per_symbol, access_code='', pad_for_usrp=True, payload_length=-1): 
    64                 """! 
     64                """ 
    6565                packet_mod constructor. 
    6666                @param item_size_in the size of the input data stream in bytes 
     
    8080                if not packet_utils.is_1_0_string(access_code): 
    8181                        raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,) 
    82                 self._access_code = access_code                 
    83                 self._pad_for_usrp = pad_for_usrp               
     82                self._access_code = access_code 
     83                self._pad_for_usrp = pad_for_usrp 
    8484                if payload_length < 0: #get payload length 
    8585                        payload_length = DEFAULT_PAYLOAD_LEN 
     
    8989                #create blocks 
    9090                msg_source = gr.message_source(gr.sizeof_char, DEFAULT_MSGQ_LIMIT) 
    91                 self._msgq_out = msg_source.msgq()              
     91                self._msgq_out = msg_source.msgq() 
    9292                self._msgq_in = gr.msg_queue(DEFAULT_MSGQ_LIMIT) 
    93                 msg_sink = gr.message_sink(self._item_size_in, self._msgq_in, False) #False -> blocking                 
     93                msg_sink = gr.message_sink(self._item_size_in, self._msgq_in, False) #False -> blocking 
    9494                #initialize hier2 
    9595                gr.hier_block2.__init__( 
    96                         self,  
     96                        self, 
    9797                        "packet_encoder", 
    9898                        gr.io_signature(1, 1, self._item_size_in), # Input signature 
     
    104104                #start thread 
    105105                _packet_encoder_thread(self._msgq_in, self._payload_length, self._send_packet) 
    106                  
     106 
    107107        def _send_packet(self, payload): 
    108                 """! 
     108                """ 
    109109                Wrap the payload in a packet and push onto the message queue. 
    110110                @param payload string, data to send 
    111                 """     
     111                """ 
    112112                packet = packet_utils.make_packet( 
    113113                        payload, 
     
    119119                msg = gr.message_from_string(packet) 
    120120                self._msgq_out.insert_tail(msg) 
    121          
     121 
    122122####################################################################################### 
    123 ##     Packet Decoder 
     123## Packet Decoder 
    124124####################################################################################### 
    125125 
    126126class _packet_decoder_thread(_threading.Thread): 
    127      
     127 
    128128    def __init__(self, msgq, callback): 
    129129        _threading.Thread.__init__(self) 
     
    145145        Hierarchical block for wrapping packet-based demodulators. 
    146146        """ 
    147          
     147 
    148148        def __init__(self, item_size_out, access_code='', threshold=-1): 
    149                 """! 
     149                """ 
    150150                packet_demod constructor. 
    151151                @param item_size_out the size of the output data stream in bytes 
     
    160160                if not packet_utils.is_1_0_string(access_code): 
    161161                        raise ValueError, "Invalid access_code %r. Must be string of 1's and 0's" % (access_code,) 
    162                 self._access_code = access_code                 
     162                self._access_code = access_code 
    163163                #threshold 
    164                 if threshold < 0: threshold = DEFAULT_THRESHOLD  
    165                 self._threshold = threshold   
     164                if threshold < 0: threshold = DEFAULT_THRESHOLD 
     165                self._threshold = threshold 
    166166                #blocks 
    167167                self._msgq_in = gr.msg_queue(DEFAULT_MSGQ_LIMIT) #holds packets from the PHY 
    168168                correlator = gr.correlate_access_code_bb(self._access_code, self._threshold) 
    169                 framer_sink = gr.framer_sink_1(self._msgq_in)           
     169                framer_sink = gr.framer_sink_1(self._msgq_in) 
    170170                msg_source = gr.message_source(self._item_size_out, DEFAULT_MSGQ_LIMIT) 
    171                 self._msgq_out = msg_source.msgq()              
     171                self._msgq_out = msg_source.msgq() 
    172172                #initialize hier2 
    173173                gr.hier_block2.__init__( 
    174                         self,  
     174                        self, 
    175175                        "packet_decoder", 
    176176                        gr.io_signature(1, 1, gr.sizeof_char), # Input signature 
     
    184184 
    185185        def _recv_packet(self, ok, payload): 
    186                 """! 
     186                """ 
    187187                Extract the payload from the packet and push onto message queue. 
    188188                @param ok boolean ok 
     
    190190                """ 
    191191                msg = gr.message_from_string(payload, 0, self._item_size_out, len(payload)/self._item_size_out) 
    192                 if ok: self._msgq_out.insert_tail(msg)                   
    193  
    194  
     192                if ok: self._msgq_out.insert_tail(msg) 
  • gnuradio/branches/developers/jblum/grc_reorganize/grc/src/grc_gnuradio/blks2/queue.py

    r9378 r9514  
    11# Copyright 2008 Free Software Foundation, Inc. 
    2 #  
     2# 
    33# This file is part of GNU Radio 
    4 #  
     4# 
    55# GNU Radio is free software; you can redistribute it and/or modify 
    66# it under the terms of the GNU General Public License as published by 
    77# the Free Software Foundation; either version 3, or (at your option) 
    88# any later version. 
    9 #  
     9# 
    1010# GNU Radio is distributed in the hope that it will be useful, 
    1111# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1212# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1313# GNU General Public License for more details. 
    14 #  
     14# 
    1515# You should have received a copy of the GNU General Public License 
    1616# along with GNU Radio; see the file COPYING.  If not, write to 
    1717# the Free Software Foundation, Inc., 51 Franklin Street, 
    1818# Boston, MA 02110-1301, USA. 
    19 #  
     19# 
    2020 
    2121from gnuradio import gr 
     
    2424 
    2525####################################################################################### 
    26 ##     Queue Sink Thread 
     26## Queue Sink Thread 
    2727####################################################################################### 
    2828class queue_sink_thread(_threading.Thread): 
    29         """! 
     29        """ 
    3030        Read samples from the queue sink and execute the callback. 
    3131        """ 
    32          
     32 
    3333        def __init__(self, queue_sink, callback): 
    34                 """! 
     34                """ 
    3535                Queue sink thread contructor. 
    3636                @param queue_sink the queue to pop messages from 
     
    4343                self.keep_running = True 
    4444                self.start() 
    45                  
     45 
    4646        def run(self): 
    4747                while self.keep_running: 
     
    4949 
    5050####################################################################################### 
    51 ##     Queue Sink 
     51## Queue Sink 
    5252####################################################################################### 
    5353class _queue_sink_base(gr.hier_block2): 
    54         """! 
     54        """ 
    5555        Queue sink base, a queue sink for any size queue. 
    5656        Easy read access to a gnuradio data stream from python. 
     
    5858        Samples are cast as python data types, complex, float, or int. 
    5959        """ 
    60          
     60 
    6161        def __init__(self, vlen=1): 
    62                 """! 
     62                """ 
    6363                Queue sink base contructor. 
    6464                @param vlen the vector length 
     
    6767                #initialize hier2 
    6868                gr.hier_block2.__init__( 
    69                         self,  
     69                        self, 
    7070                        "queue_sink", 
    7171                        gr.io_signature(1, 1, self._item_size*self._vlen), # Input signature 
     
    7878                self.connect(self, message_sink) 
    7979                self.arr = '' 
    80                  
     80 
    8181        def pop(self): 
    82                 """! 
     82                """ 
    8383                Pop a new sample off the front of the queue. 
    8484                @return a new sample 
     
    9696        _item_size = gr.sizeof_gr_complex 
    9797        _numpy = numpy.complex64 
    98         def _cast(self, arg): return complex(arg.real, arg.imag)                
    99          
     98        def _cast(self, arg): return complex(arg.real, arg.imag) 
     99 
    100100class queue_sink_f(_queue_sink_base): 
    101101        _item_size = gr.sizeof_float 
    102102        _numpy = numpy.float32 
    103103        _cast = float 
    104          
     104 
    105105class queue_sink_i(_queue_sink_base): 
    106106        _item_size = gr.sizeof_int 
    107107        _numpy = numpy.int32 
    108108        _cast = int 
    109          
     109 
    110110class queue_sink_s(_queue_sink_base): 
    111111        _item_size = gr.sizeof_short 
    112112        _numpy = numpy.int16 
    113113        _cast = int 
    114          
     114 
    115115class queue_sink_b(_queue_sink_base): 
    116116        _item_size = gr.sizeof_char 
    117117        _numpy = numpy.int8 
    118118        _cast = int 
    119          
     119 
    120120####################################################################################### 
    121 ##     Queue Source 
     121## Queue Source 
    122122####################################################################################### 
    123123class _queue_source_base(gr.hier_block2): 
    124         """! 
     124        """ 
    125125        Queue source base, a queue source for any size queue. 
    126126        Easy write access to a gnuradio data stream from python. 
    127127        Call push to to write a sample into the gnuradio data stream. 
    128128        """ 
    129          
     129 
    130130        def __init__(self, vlen=1): 
    131                 """! 
     131                """ 
    132132                Queue source base contructor. 
    133133                @param vlen the vector length 
     
    136136                #initialize hier2 
    137137                gr.hier_block2.__init__( 
    138                         self,  
     138                        self, 
    139139                        "queue_source", 
    140140                        gr.io_signature(0, 0, 0), # Input signature 
     
    142142                ) 
    143143                #create message sink 
    144                 message_source = gr.message_source(self._item_size*self._vlen, 1)  
     144                message_source = gr.message_source(self._item_size*self._vlen, 1) 
    145145                self._msgq = message_source.msgq() 
    146146                #connect 
    147147                self.connect(message_source, self) 
    148                  
     148 
    149149        def push(self, item): 
    150                 """! 
     150                """ 
    151151                Push an item into the back of the queue. 
    152152                @param item the item 
     
    160160        _item_size = gr.sizeof_gr_complex 
    161161        _numpy = numpy.complex64 
    162          
     162 
    163163class queue_source_f(_queue_source_base): 
    164164        _item_size = gr.sizeof_float 
    165165        _numpy = numpy.float32 
    166          
     166 
    167167class queue_source_i(_queue_source_base): 
    168168        _item_size = gr.sizeof_int 
    169169        _numpy = numpy.int32 
    170          
     170 
    171171class queue_source_s(_queue_source_base): 
    172172        _item_size = gr.sizeof_short 
    173173        _numpy = numpy.int16 
    174          
     174 
    175175class queue_source_b(_queue_source_base): 
    176176        _item_size = gr.sizeof_char 
    177177        _numpy = numpy.int8 
    178  
  • gnuradio/branches/developers/jblum/grc_reorganize/grc/src/grc_gnuradio/blks2/selector.py

    r9378 r9514  
    22# 
    33# Copyright 2008 Free Software Foundation, Inc. 
    4 #  
     4# 
    55# This file is part of GNU Radio 
    6 #  
     6# 
    77# GNU Radio is free software; you can redistribute it and/or modify 
    88# it under the terms of the GNU General Public License as published by 
    99# the Free Software Foundation; either version 3, or (at your option) 
    1010# any later version. 
    11 #  
     11# 
    1212# GNU Radio is distributed in the hope that it will be useful, 
    1313# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1414# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1515# GNU General Public License for more details. 
    16 #  
     16# 
    1717# You should have received a copy of the GNU General Public License 
    1818# along with GNU Radio; see the file COPYING.  If not, write to 
    1919# the Free Software Foundation, Inc., 51 Franklin Street, 
    2020# Boston, MA 02110-1301, USA. 
    21 #  
     21# 
    2222 
    2323from gnuradio import gr 
    24                  
     24 
    2525class selector(gr.hier_block2): 
    2626        """A hier2 block with N inputs and M outputs, where data is only forwarded through input n to output m.""" 
    27         def __init__(self, item_size, num_inputs, num_outputs, input_index, output_index):      
    28                 """! 
     27        def __init__(self, item_size, num_inputs, num_outputs, input_index, output_index): 
     28                """ 
    2929                SelectorHelper constructor. 
    3030                @param item_size the size of the gr data stream in bytes 
     
    3333                @param input_index the index for the source data 
    3434                @param output_index the index for the destination data 
    35                 """     
     35                """ 
    3636                gr.hier_block2.__init__( 
    37                         self, 'selector',  
    38                         gr.io_signature(num_inputs, num_inputs, item_size),  
     37                        self, 'selector', 
     38                        gr.io_signature(num_inputs, num_inputs, item_size), 
    3939                        gr.io_signature(num_outputs, num_outputs, item_size), 
    4040                ) 
    41                 #terminator blocks for unused inputs and outputs        
     41                #terminator blocks for unused inputs and outputs 
    4242                self.input_terminators = [gr.null_sink(item_size)] * num_inputs 
    4343                self.output_terminators = [gr.head(item_size, 0)] * num_outputs 
    4444                self.copy = None 
    45                 #connections            
     45                #connections 
    4646                for i in range(num_inputs): self.connect((self, i), self.input_terminators[i]) 
    47                 for i in range(num_outputs): self.connect(gr.null_source(item_size), self.output_terminators[i], (self, i))     
    48                 self.item_size = item_size              
     47                for i in range(num_outputs): self.connect(gr.null_source(item_size), self.output_terminators[i], (self, i)) 
     48                self.item_size = item_size 
    4949                self.input_index = input_index 
    50                 self.output_index = output_index        
     50                self.output_index = output_index 
    5151                self.num_inputs = num_inputs 
    5252                self.num_outputs = num_outputs 
    5353                self._connect_current() 
    54                  
     54 
    5555        def _indexes_valid(self): 
    56                 """! 
     56                """ 
    5757                Are the input and output indexes within range of the number of inputs and outputs? 
    5858                @return true if input index and output index are in range 
    5959                """ 
    6060                return self.input_index in range(self.num_inputs) and self.output_index in range(self.num_outputs) 
    61                  
     61 
    6262        def _connect_current(self): 
    63                 """If the input and output indexes are valid:  
    64                 disconnect the blocks at the input and output index from their terminators,  
     63                """If the input and output indexes are valid: 
     64                disconnect the blocks at the input and output index from their terminators, 
    6565                and connect them to one another. Then connect the terminators to one another.""" 
    6666                if self._indexes_valid(): 
    67                         self.disconnect((self, self.input_index), self.input_terminators[self.input_index])                             
     67                        self.disconnect((self, self.input_index), self.input_terminators[self.input_index]) 
    6868                        self.disconnect(self.output_terminators[self.output_index], (self, self.output_index)) 
    6969                        self.copy = gr.skiphead(self.item_size, 0) 
    7070                        self.connect((self, self.input_index), self.copy) 
    71                         self.connect(self.copy, (self, self.output_index))              
    72                         self.connect(self.output_terminators[self.output_index], self.input_terminators[self.input_index])      
    73                  
     71                        self.connect(self.copy, (self, self.output_index)) 
     72                        self.connect(self.output_terminators[self.output_index], self.input_terminators[self.input_index]) 
     73 
    7474        def _disconnect_current(self): 
    75                 """If the input and output indexes are valid:  
    76                 disconnect the blocks at the input and output index from one another,  
     75                """If the input and output indexes are valid: 
     76                disconnect the blocks at the input and output index from one another, 
    7777                and the terminators at the input and output index from one another. 
    7878                Reconnect the blocks to the terminators.""" 
     
    8181                        self.disconnect(self.copy, (self, self.output_index)) 
    8282                        self.disconnect(self.output_terminators[self.output_index], self.input_terminators[self.input_index]) 
    83                         del self.copy                   
    84                         self.copy = None                        
     83                        del self.copy 
     84                        self.copy = None 
    8585                        self.connect((self, self.input_index), self.input_terminators[self.input_index]) 
    8686                        self.connect(self.output_terminators[self.output_index], (self, self.output_index)) 
    87                  
     87 
    8888        def set_input_index(self, input_index): 
    89                 """! 
     89                """ 
    9090                Change the block to the new input index if the index changed. 
    9191                @param input_index the new input index 
     
    9696                        self.input_index = input_index 
    9797                        self._connect_current() 
    98                         self.unlock()           
    99                  
     98                        self.unlock() 
     99 
    100100        def set_output_index(self, output_index): 
    101                 """! 
     101                """ 
    102102                Change the block to the new output index if the index changed. 
    103103                @param output_index the new output index 
    104                 """             
    105                 if self.output_index != output_index:   
     104                """ 
     105                if self.output_index != output_index: 
    106106                        self.lock() 
    107107                        self._disconnect_current() 
    108108                        self.output_index = output_index 
    109                         self._connect_current()                         
    110                         self.unlock()   
     109                        self._connect_current() 
     110                        self.unlock() 
    111111 
    112112class valve(selector): 
    113113        """Wrapper for selector with 1 input and 1 output.""" 
    114          
     114 
    115115        def __init__(self, item_size, open): 
    116                 """! 
     116                """ 
    117117                Constructor for valve. 
    118118                @param item_size the size of the gr data stream in bytes 
     
    122122                else: output_index = 0 
    123123                selector.__init__(self, item_size, 1, 1, 0, output_index) 
    124                  
     124 
    125125        def set_open(self, open): 
    126                 """! 
     126                """ 
    127127                Callback to set open state. 
    128128                @param open true to set valve state to open 
     
    131131                else: output_index = 0 
    132132                self.set_output_index(output_index) 
    133  
  • gnuradio/branches/developers/jblum/grc_reorganize/grc/src/grc_gnuradio/usrp/__init__.py

    r9378 r9514  
    11# Copyright 2008 Free Software Foundation, Inc. 
    2 #  
     2# 
    33# This file is part of GNU Radio 
    4 #  
     4# 
    55# GNU Radio is free software; you can redistribute it and/or modify 
    66# it under the terms of the GNU General Public License as published by 
    77# the Free Software