Changeset 4819

Show
Ignore:
Timestamp:
08/25/07 11:04:25 (6 years ago)
Author:
DrewCormier
Message:

basic functionality now works. had to change the way I implemented my buffering a little

Location:
experimental/components/rc2007_gui
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/rc2007_gui/WorkModule.py

    r4815 r4819  
    3333    component to reside.""" 
    3434 
    35     def __init__(self, USRP_Commander_GUI_ref): 
     35    def __init__(self, rc2007_gui_ref): 
    3636        '''Initialization.  Sets a reference to parent.   
    3737        Initializes the buffer.  Starts the Process data 
    3838        thread, which waits for data to be added to the buffer''' 
    3939 
    40         self.USRP_Commander_GUI_ref = USRP_Commander_GUI_ref 
     40        self.rc2007_gui_ref = rc2007_gui_ref 
    4141         
    4242        self.data_queue = [] 
     
    7676                self.data_queue_lock.release() 
    7777                                 
    78                 # get data out of tuple 
    79                 I = new_data[0] 
    80                 Q = new_data[1] 
    81                                  
    82                 newI = [0 for x in range(len(I))] 
    83                 newQ = [0 for x in range(len(Q))] 
    84                  
    85                  
    86                 # Insert code here to do work 
    87                 # Example: 
    88                 #for x in range(len(I)): 
    89                 #    newI[x] = I[x] 
    90                 #    newQ[x] = Q[x] 
    91  
     78                if self.rc2007_gui_ref.talk_flag: 
     79                    print "attempting to pass data"      
    9280                                         
    93                 # Output the new data 
    94                 # TODO: autogenerate code that will send data to all existing uses ports 
    95                 if self.USRP_Commander_GUI_ref.outPort0_active: 
    96                     self.USRP_Commander_GUI_ref.outPort0_servant.send_data(newI, newQ) 
     81                    if self.rc2007_gui_ref.outPort0_active: 
     82                        self.rc2007_gui_ref.outPort0_servant.send_data( 
     83                                                   new_data[0], new_data[1]) 
    9784 
    9885            self.data_signal.clear()  # done reading the buffer 
  • experimental/components/rc2007_gui/rc2007_gui.py

    r4816 r4819  
    171171    def Process(self): 
    172172        while self.is_running: 
     173 
    173174            self.data_event.wait() 
    174             if self.parent.talk_flag: 
     175 
     176            while len(self.data_buffer) > 0: 
    175177                self.data_buffer_lock.acquire() 
    176178                new_data = self.data_buffer.pop() 
    177179                self.data_buffer_lock.release() 
    178                  
     180                
     181                # send the data to all outPort connections  
    179182                for port in self.outPorts.values(): 
    180183                    port.pushPacket(new_data[0], new_data[1]) 
    181184             
    182             # if the push to talk button is not depressed, don't do anything 
    183             # with the data, even if it is there 
    184             # alternatively, if the button is down, i just sent the packet 
    185             self.data_event.clear() 
    186  
    187             # TODO: make sure the buffer is empty 
     185                self.data_event.clear() 
     186 
    188187 
    189188