Changeset 4856
- Timestamp:
- 08/27/07 11:23:25 (6 years ago)
- Location:
- experimental/components/rc2007_gui
- Files:
-
- 2 modified
-
WorkModule.py (modified) (3 diffs)
-
rc2007_gui.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/rc2007_gui/WorkModule.py
r4855 r4856 53 53 pass 54 54 55 def Add Data(self, data):55 def AddVoiceData(self, data): 56 56 '''Generally called by parent. Adds data to a buffer. 57 57 The Process() method will wait for this buffer to be set. … … 69 69 while self.is_running: 70 70 self.data_signal.wait() # wait for data to be aded to the 71 # buffer in self.Add Data()71 # buffer in self.AddVoiceData() 72 72 while len(self.data_queue) > 0: 73 73 # get the data from the buffer: … … 76 76 self.data_queue_lock.release() 77 77 78 # forwarding voice data: 78 79 if self.rc2007_gui_ref.talk_flag: 79 80 if self.rc2007_gui_ref.outPort0_active: 81 # TODO: send voice metadata 80 82 self.rc2007_gui_ref.outPort0_servant.send_data(data) 81 83 -
experimental/components/rc2007_gui/rc2007_gui.py
r4819 r4856 120 120 121 121 #------------------------------------------------------------------ 122 # dataIn_ complexShort_i class definition123 #------------------------------------------------------------------ 124 class dataIn_ complexShort_i(standardInterfaces__POA.complexShort):122 # dataIn_realChar_i class definition 123 #------------------------------------------------------------------ 124 class dataIn_realChar_i(standardInterfaces__POA.realChar): 125 125 def __init__(self, parent, name): 126 126 self.parent = parent 127 127 self.name = name 128 128 129 def pushPacket(self, I, Q):130 self.parent.work_mod.Add Data(I, Q)131 132 133 #------------------------------------------------------------------ 134 # dataOut_ complexShort_i class definition135 #------------------------------------------------------------------ 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 #------------------------------------------------------------------ 136 class dataOut_realChar_i(CF__POA.Port): 137 137 def __init__(self, parent, name): 138 138 self.parent = parent … … 149 149 150 150 def connectPort(self, connection, connectionId): 151 port = connection._narrow(standardInterfaces__POA. complexShort)151 port = connection._narrow(standardInterfaces__POA.realChar) 152 152 self.outPorts[str(connectionId)] = port 153 153 self.parent.outPort0_active = True … … 163 163 self.data_event.set() 164 164 165 def send_data(self, I, Q):165 def send_data(self, data): 166 166 self.data_buffer_lock.acquire() 167 self.data_buffer.insert(0, (I,Q))167 self.data_buffer.insert(0, data) 168 168 self.data_buffer_lock.release() 169 169 self.data_event.set() … … 176 176 while len(self.data_buffer) > 0: 177 177 self.data_buffer_lock.acquire() 178 new_data = self.data_buffer.pop()178 data = self.data_buffer.pop() 179 179 self.data_buffer_lock.release() 180 180 181 181 # send the data to all outPort connections 182 182 for port in self.outPorts.values(): 183 port.pushPacket( new_data[0], new_data[1])183 port.pushPacket(data) 184 184 185 185 self.data_event.clear()