Changeset 4007
- Timestamp:
- 05/30/07 11:07:17 (6 years ago)
- Location:
- experimental/components/image_capture/trunk/image_capture
- Files:
-
- 2 modified
-
WorkModule.py (modified) (1 diff)
-
image_capture.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/image_capture/trunk/image_capture/WorkModule.py
r3941 r4007 63 63 while self.is_running: 64 64 self.data_signal.wait() 65 while len(self.data_queue) > 0: 66 self.data_queue_lock.acquire() 67 new_data = self.data_queue.pop() 68 self.data_queue_lock.release() 65 66 bytesOut = ['t', 'e', 's', 't'] 67 68 # Output the new data 69 if self.image_capture_ref.outPort0_active: 70 print "attempting to send data in image_capture" 71 self.image_capture_ref.outPort0_servant.send_data(bytesOut) 72 else: 73 # reset the signal event variable 74 self.data_signal.clear() 75 76 69 77 70 78 # TODO: add code for image capture 71 79 # TODO: add code that will format image as char sequence 72 80 73 bytesOut = ['t', 'e', 's', 't']74 75 76 # Output the new data77 if self.image_capture_ref.outPort0_active:78 self.image_capture_ref.outPort0_servant.send_data(bytesOut)79 else:80 # reset the signal event variable81 self.data_signal.clear()82 83 -
experimental/components/image_capture/trunk/image_capture/image_capture.py
r3941 r4007 112 112 113 113 def connectPort(self, connection, connectionId): 114 print "connectPort in image_capture called\n" 114 115 port = connection._narrow(standardInterfaces__POA.realChar) 115 116 self.outPorts[str(connectionId)] = port … … 127 128 128 129 def send_data(self, bytesOut): 130 print "send_data in image_capture called\n" 129 131 self.data_buffer_lock.acquire() 130 132 self.data_buffer.insert(0, bytesOut) … … 133 135 134 136 def Process(self): 137 print "Process in image_capture called\n" 135 138 while self.is_running: 136 139 self.data_event.wait() 137 while len(self.data_buffer) > 0: 138 self.data_buffer_lock.acquire() 139 new_data = self.data_buffer.pop() 140 self.data_buffer_lock.release() 141 142 for port in self.outPorts.values(): 143 port.pushPacket(new_data[0], new_data[1]) 144 145 self.data_event.clear() 140 141 bytesOut = ['t', 'e', 's', 't'] 142 143 # Output the new data 144 if self.image_capture_ref.outPort0_active: 145 print "attempting to send data in image_capture" 146 self.image_capture_ref.outPort0_servant.send_data(bytesOut) 147 else: 148 # reset the signal event variable 149 self.data_signal.clear() 150 151 152 # while len(self.data_buffer) > 0: 153 # self.data_buffer_lock.acquire() 154 # new_data = self.data_buffer.pop() 155 # self.data_buffer_lock.release() 156 # 157 # for port in self.outPorts.values(): 158 # port.pushPacket(new_data[0], new_data[1]) 159 # 160 # self.data_event.clear() 146 161 147 162