Changeset 4856

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

need to distinguish this method for voice data

Location:
experimental/components/rc2007_gui
Files:
2 modified

Legend:

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

    r4855 r4856  
    5353        pass 
    5454         
    55     def AddData(self, data): 
     55    def AddVoiceData(self, data): 
    5656        '''Generally called by parent.  Adds data to a buffer. 
    5757        The Process() method will wait for this buffer to be set. 
     
    6969        while self.is_running: 
    7070            self.data_signal.wait()  # wait for data to be aded to the  
    71                                      # buffer in self.AddData() 
     71                                     # buffer in self.AddVoiceData() 
    7272            while len(self.data_queue) > 0: 
    7373                # get the data from the buffer: 
     
    7676                self.data_queue_lock.release() 
    7777                                 
     78                # forwarding voice data: 
    7879                if self.rc2007_gui_ref.talk_flag: 
    7980                    if self.rc2007_gui_ref.outPort0_active: 
     81                        # TODO: send voice metadata  
    8082                        self.rc2007_gui_ref.outPort0_servant.send_data(data)     
    8183 
  • experimental/components/rc2007_gui/rc2007_gui.py

    r4819 r4856  
    120120 
    121121#------------------------------------------------------------------ 
    122 # dataIn_complexShort_i class definition 
    123 #------------------------------------------------------------------ 
    124 class dataIn_complexShort_i(standardInterfaces__POA.complexShort): 
     122# dataIn_realChar_i class definition 
     123#------------------------------------------------------------------ 
     124class dataIn_realChar_i(standardInterfaces__POA.realChar): 
    125125    def __init__(self, parent, name): 
    126126        self.parent = parent 
    127127        self.name = name 
    128128 
    129     def pushPacket(self, I, Q): 
    130         self.parent.work_mod.AddData(I, Q) 
    131  
    132  
    133 #------------------------------------------------------------------ 
    134 # dataOut_complexShort_i class definition 
    135 #------------------------------------------------------------------ 
    136 class dataOut_complexShort_i(CF__POA.Port): 
     129    def pushPacket(self, data): 
     130        self.parent.work_mod.AddVoiceData(data) 
     131 
     132 
     133#------------------------------------------------------------------ 
     134# dataOut_realChar_i class definition 
     135#------------------------------------------------------------------ 
     136class dataOut_realChar_i(CF__POA.Port): 
    137137    def __init__(self, parent, name): 
    138138        self.parent = parent 
     
    149149 
    150150    def connectPort(self, connection, connectionId): 
    151         port = connection._narrow(standardInterfaces__POA.complexShort) 
     151        port = connection._narrow(standardInterfaces__POA.realChar) 
    152152        self.outPorts[str(connectionId)] = port 
    153153        self.parent.outPort0_active = True 
     
    163163        self.data_event.set() 
    164164 
    165     def send_data(self, I, Q): 
     165    def send_data(self, data): 
    166166        self.data_buffer_lock.acquire() 
    167         self.data_buffer.insert(0, (I,Q)) 
     167        self.data_buffer.insert(0, data) 
    168168        self.data_buffer_lock.release() 
    169169        self.data_event.set() 
     
    176176            while len(self.data_buffer) > 0: 
    177177                self.data_buffer_lock.acquire() 
    178                 new_data = self.data_buffer.pop() 
     178                data = self.data_buffer.pop() 
    179179                self.data_buffer_lock.release() 
    180180                
    181181                # send the data to all outPort connections  
    182182                for port in self.outPorts.values(): 
    183                     port.pushPacket(new_data[0], new_data[1]) 
     183                    port.pushPacket(data) 
    184184             
    185185                self.data_event.clear()