Changeset 4819
- Timestamp:
- 08/25/07 11:04:25 (6 years ago)
- Location:
- experimental/components/rc2007_gui
- Files:
-
- 2 modified
-
WorkModule.py (modified) (2 diffs)
-
rc2007_gui.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/rc2007_gui/WorkModule.py
r4815 r4819 33 33 component to reside.""" 34 34 35 def __init__(self, USRP_Commander_GUI_ref):35 def __init__(self, rc2007_gui_ref): 36 36 '''Initialization. Sets a reference to parent. 37 37 Initializes the buffer. Starts the Process data 38 38 thread, which waits for data to be added to the buffer''' 39 39 40 self. USRP_Commander_GUI_ref = USRP_Commander_GUI_ref40 self.rc2007_gui_ref = rc2007_gui_ref 41 41 42 42 self.data_queue = [] … … 76 76 self.data_queue_lock.release() 77 77 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" 92 80 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]) 97 84 98 85 self.data_signal.clear() # done reading the buffer -
experimental/components/rc2007_gui/rc2007_gui.py
r4816 r4819 171 171 def Process(self): 172 172 while self.is_running: 173 173 174 self.data_event.wait() 174 if self.parent.talk_flag: 175 176 while len(self.data_buffer) > 0: 175 177 self.data_buffer_lock.acquire() 176 178 new_data = self.data_buffer.pop() 177 179 self.data_buffer_lock.release() 178 180 181 # send the data to all outPort connections 179 182 for port in self.outPorts.values(): 180 183 port.pushPacket(new_data[0], new_data[1]) 181 184 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 188 187 189 188