Changeset 4007

Show
Ignore:
Timestamp:
05/30/07 11:07:17 (6 years ago)
Author:
DrewCormier
Message:

restructuring code to work without receiving data

Location:
experimental/components/image_capture/trunk/image_capture
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/image_capture/trunk/image_capture/WorkModule.py

    r3941 r4007  
    6363        while self.is_running: 
    6464            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     
    6977                                 
    7078                # TODO: add code for image capture 
    7179                # TODO: add code that will format image as char sequence                 
    7280  
    73                 bytesOut = ['t', 'e', 's', 't']  
    74                  
    75  
    76                 # Output the new data 
    77                 if self.image_capture_ref.outPort0_active: 
    78                     self.image_capture_ref.outPort0_servant.send_data(bytesOut) 
    79                 else: 
    80                     # reset the signal event variable 
    81                     self.data_signal.clear() 
    82                                  
    83  
  • experimental/components/image_capture/trunk/image_capture/image_capture.py

    r3941 r4007  
    112112 
    113113    def connectPort(self, connection, connectionId): 
     114        print "connectPort in image_capture called\n" 
    114115        port = connection._narrow(standardInterfaces__POA.realChar) 
    115116        self.outPorts[str(connectionId)] = port 
     
    127128 
    128129    def send_data(self, bytesOut): 
     130        print "send_data in image_capture called\n" 
    129131        self.data_buffer_lock.acquire() 
    130132        self.data_buffer.insert(0, bytesOut) 
     
    133135 
    134136    def Process(self): 
     137        print "Process in image_capture called\n" 
    135138        while self.is_running: 
    136139            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() 
    146161 
    147162