Changeset 7536

Show
Ignore:
Timestamp:
02/01/08 09:48:00
Author:
jcorgan
Message:

Moved gnuradio-core/src/utils/ plotting scripts into gr-utils, with some rework.

The gr_plot_data.py class installs into the gnuradio namespace as
gnuradio.plot_data, and the remainder of the scripts install into
$prefix/bin.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/trunk/gr-utils/src/python

    • Property svn:ignore changed from Makefile Makefile.in to Makefile Makefile.in *.pyc
  • gnuradio/trunk/gr-utils/src/python/Makefile.am

    r6287 r7536  
    2020#  
    2121 
     22include $(top_srcdir)/Makefile.common 
     23 
    2224EXTRA_DIST = \ 
    23     $(bin_SCRIPTS) 
     25    $(bin_SCRIPTS) \ 
     26    README.plot 
     27 
     28ourpythondir = $(grpythondir) 
     29 
     30ourpython_PYTHON = \ 
     31    plot_data.py 
    2432 
    2533bin_SCRIPTS = \ 
     34    gr_plot_char.py \ 
     35    gr_plot_const.py \ 
     36    gr_plot_fft_c.py \ 
     37    gr_plot_fft_f.py \ 
     38    gr_plot_float.py \ 
     39    gr_plot_int.py \ 
     40    gr_plot_iq.py \ 
     41    gr_plot_short.py \ 
    2642    usrp_fft.py \ 
    2743    usrp_oscope.py \ 
     
    3248    usrp_test_counting.py \ 
    3349    usrp_test_loopback.py 
     50 
     51MOSTLYCLEANFILES = *~ *.pyc 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_char.py

    r7535 r7536  
    2828 
    2929from optparse import OptionParser 
    30 from gr_plot_data import plot_data 
     30from gnuradio.plot_data import plot_data 
    3131 
    3232def main(): 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_const.py

    r7535 r7536  
    172172         
    173173             
    174  
    175 #FIXME: there must be a way to do this with a Python builtin 
    176174def find(item_in, list_search): 
    177     for l in list_search: 
    178         if item_in == l: 
    179             return True 
    180     return False 
     175    try: 
     176        return list_search.index(item_in) != None 
     177    except ValueError: 
     178        return False 
     179         
    181180 
    182181def main(): 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_fft_c.py

    r7535 r7536  
    196196        self.update_plots() 
    197197         
    198              
    199  
    200 #FIXME: there must be a way to do this with a Python builtin 
    201198def find(item_in, list_search): 
    202     for l in list_search
    203         if item_in == l: 
    204             return True 
    205     return False 
     199    try
     200        return list_search.index(item_in) != None 
     201    except ValueError: 
     202       return False 
    206203 
    207204def main(): 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_fft_f.py

    r7535 r7536  
    199199         
    200200             
    201  
    202 #FIXME: there must be a way to do this with a Python builtin 
    203201def find(item_in, list_search): 
    204     for l in list_search
    205         if item_in == l: 
    206             return True 
    207     return False 
    208  
     202    try
     203        return list_search.index(item_in) != None 
     204    except ValueError: 
     205       return False 
     206                 
    209207def main(): 
    210208    usage="%prog: [options] input_filename" 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_float.py

    r7535 r7536  
    2828 
    2929from optparse import OptionParser 
    30 from gr_plot_data import plot_data 
     30from gnuradio.plot_data import plot_data 
    3131 
    3232def main(): 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_int.py

    r7535 r7536  
    2828 
    2929from optparse import OptionParser 
    30 from gr_plot_data import plot_data 
     30from gnuradio.plot_data import plot_data 
    3131 
    3232def main(): 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_iq.py

    r7535 r7536  
    144144        self.update_plots() 
    145145         
    146              
    147146 
    148 #FIXME: there must be a way to do this with a Python builtin 
    149147def find(item_in, list_search): 
    150     for l in list_search
    151         if item_in == l: 
    152             return True 
    153     return False 
    154  
     148    try
     149        return list_search.index(item_in) != None 
     150    except ValueError: 
     151       return False 
     152         
    155153def main(): 
    156154    usage="%prog: [options] input_filename" 
  • gnuradio/trunk/gr-utils/src/python/gr_plot_short.py

    r7535 r7536  
    2828 
    2929from optparse import OptionParser 
    30 from gr_plot_data import plot_data 
     30from gnuradio.plot_data import plot_data 
    3131 
    3232def main(): 
  • gnuradio/trunk/gr-utils/src/python/plot_data.py

    • Property svn:executable deleted
    r7535 r7536  
    1 #!/usr/bin/env python 
    21# 
    32# Copyright 2007,2008 Free Software Foundation, Inc. 
     
    162161        self.update_plots() 
    163162         
    164              
    165163 
    166 #FIXME: there must be a way to do this with a Python builtin 
    167164def find(item_in, list_search): 
    168     for l in list_search: 
    169         if item_in == l: 
    170             return True 
    171     return False 
    172  
    173 def main(): 
    174     usage="%prog: [options] input_filenames" 
    175     description = "This is just a test program for this class. It should really be called by gr_plot_<datatype>.py for a specific type of file data (float, int, byte, etc.)." 
    176  
    177     parser = OptionParser(conflict_handler="resolve", usage=usage, description=description) 
    178     parser.add_option("-B", "--block", type="int", default=1000, 
    179                       help="Specify the block size [default=%default]") 
    180     parser.add_option("-s", "--start", type="int", default=0, 
    181                       help="Specify where to start in the file [default=%default]") 
    182     parser.add_option("-R", "--sample-rate", type="float", default=1.0, 
    183                       help="Set the sampler rate of the data [default=%default]") 
    184      
    185     (options, args) = parser.parse_args () 
    186     if len(args) < 1: 
    187         parser.print_help() 
    188         raise SystemExit, 1 
    189     filenames = args 
    190               
    191     datatype=scipy.float32 
    192     dc = plot_data(datatype, filenames, options) 
    193  
    194 if __name__ == "__main__": 
    195165    try: 
    196         main() 
    197     except KeyboardInterrupt: 
    198         pass 
    199      
     166        return list_search.index(item_in) != None 
     167    except ValueError: 
     168        return False