def api(self, showComponentName=True, showInterfaces=True, showProperties=True, externalPropInfo=None, destfile=None): ''' Inspect interfaces and properties for the component ''' localdef_dest = False if destfile == None: localdef_dest = True destfile = cStringIO.StringIO() className = self.__class__.__name__ if showComponentName == True: print >> destfile, className + " [" + str(self.name) + "]:" if showInterfaces == True: PortSupplier.api(self, destfile=destfile) if showProperties == True and self._properties != None: PropertySet.api(self, externalPropInfo, destfile=destfile) if localdef_dest: pydoc.pager(destfile.getvalue()) destfile.close()
def api(self): ''' Inspect interfaces and properties for the component ''' print "Component [" + str(self._componentName) + "]:" PortSupplier.api(self) PropertySet.api(self)
def api(self, showComponentName=True, showInterfaces=True, showProperties=True, externalPropInfo=None): ''' Inspect interfaces and properties for the component ''' className = self.__class__.__name__ if showComponentName == True: print className+" [" + str(self.name) + "]:" if showInterfaces == True: PortSupplier.api(self) if showProperties == True and self._properties != None: PropertySet.api(self, externalPropInfo)
def api(self, showComponentName=True, showInterfaces=True, showProperties=True, externalPropInfo=None): ''' Inspect interfaces and properties for the component ''' className = self.__class__.__name__ if showComponentName == True: print className+" [" + str(self.name) + "]:" if showInterfaces == True: PortSupplier.api(self) if showProperties == True and self._propertySet != None: PropertySet.api(self, externalPropInfo)
def api(self, destfile=None): ''' Inspect interfaces and properties for the component ''' localdef_dest = False if destfile == None: localdef_dest = True destfile = cStringIO.StringIO() print >>destfile, "Component [" + str(self._componentName) + "]:\n" PortSupplier.api(self, destfile=destfile) PropertySet.api(self, destfile=destfile) if localdef_dest: pydoc.pager(destfile.getvalue()) destfile.close()
def __init__(self): _deferred_imports() helperBase.__init__(self) PortSupplier.__init__(self) # Create provides port dictionary. self._providesPortDict = {} for interface in ('Char', 'Short', 'Long', 'Float', 'Ulong', 'Double', 'LongLong', 'Octet', 'UlongLong', 'Ushort'): name = '%sIn' % interface.lower() self._providesPortDict[name] = { 'Port Interface': 'IDL:BULKIO/data%s:1.0' % interface, 'Port Name': name } self.breakBlock = False self._thread = None # Create a new figure and axes. self._figure = pyplot.figure() self._plot = self._figure.add_subplot(1, 1, 1) self._canvas = self._figure.canvas self._figure.show(False) # Let subclasses set up the axes. self._configureAxes() # Matplotlib 0.99 does not give an easy way to listen for window close # events; as a result, we have to get the underlying backend-specific # window. This is course, somewhat fragile. Furthermore, QMainWindow # does not provide a signal on close that would allow us to stop the # rendering loop before the objects are destroyed, so we dynamically # override the closeEvent method on this particular instance. window = self._getWindow() oldClose = window.closeEvent def closeEvent(event): self.stop() oldClose(event) window.closeEvent = closeEvent # Add thread synchronization to the draw and paintEvent methods on # FigureCanvasQTAgg, so that we can do drawing updates in the reader # thread at the same time that the main thread might traw to redraw. # Without synchronization, this leads to exceptions and flickering. lock = threading.Lock() oldDraw = self._canvas.draw def draw(): lock.acquire() try: oldDraw() finally: lock.release() self._canvas.draw = draw oldPaint = self._canvas.paintEvent def paintEvent(e): lock.acquire() try: oldPaint(e) finally: lock.release() self._canvas.paintEvent = paintEvent self._renderLock = lock
def __init__(self): PortSupplier.__init__(self) self._refid = str(uuid4()) self._port = None self._started = False