Changeset 4194

Show
Ignore:
Timestamp:
06/18/07 16:03:14 (7 years ago)
Author:
DrewCormier
Message:

starting to restructure code so that each source-type method has the same API

Location:
experimental/AWG/trunk/AWG
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • experimental/AWG/trunk/AWG/AWG.py

    r3721 r4194  
    2828        delimiter = ',' 
    2929 
    30         my_signal = sources.sources()    #instance of signals class 
     30        my_signal = sources.sources(self)    #instance of signals class 
    3131 
    3232        self.signal_type = self.signal_type.lower()  #makes comparison case insesitive 
     
    5858    def __init__(self, parent, id, title, namespace, interface, component_name, port_name): 
    5959 
    60         #TODO: get this from the sources class 
    61         tmp_sources_instance = sources.sources() 
     60        tmp_sources_instance = sources.sources(self) 
    6261        self.available_sources = tmp_sources_instance.get_sources_list() 
    6362 
  • experimental/AWG/trunk/AWG/sources.py

    r4193 r4194  
    55 
    66class sources: 
    7     def __init__(self): 
     7    def __init__(self,parent): 
     8        self.parent = parent 
    89        self.available_sources = ['file', 'sine', 'cosine', 'random', 'zeros'] 
    910        self.corresponding_methods = ['read_file','gen_sine', 'gen_cosine', 'gen_random_data', 'gen_zeros'] 
     
    1314        return self.available_sources 
    1415 
     16 
     17    def gen_signal(self): 
     18        pass 
    1519 
    1620    def read_file(self, file_name, delimiter):