def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) self.threadControlLock = threading.RLock() self.process_thread = None # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) ThreadedComponent.__init__(self) # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False
def start(self): self.threadControlLock.acquire() try: Device.start(self) if self.process_thread == None: self.process_thread = ProcessThread(target=self.process, pause=self.PAUSE) self.process_thread.start() finally: self.threadControlLock.release()
def releaseObject(self): try: self.stop() except Exception: self._log.exception("Error stopping") self.threadControlLock.acquire() try: Device.releaseObject(self) finally: self.threadControlLock.release()
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) ThreadedComponent.__init__(self) # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False # Instantiate the default implementations for all ports on this device self.port_prop_out = PortCFPropertySetOut_i(self, "prop_out")
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) # video_allocation_ids is exclusively paired with property frontend_video_status. # video_allocation_ids tracks allocation ids while frontend_video_status provides video device information. self.video_allocation_ids = [] # Provides mapping from unique allocation ID to internal video (channel) number self.allocation_id_to_video_device_id = {} self.allocation_id_mapping_lock = threading.Lock()
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) ThreadedComponent.__init__(self) # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False # Instantiate the default implementations for all ports on this device self.port_message = MessageConsumerPort(thread_sleep=0.1, parent = self) self.port_dataFloat_out = bulkio.OutFloatPort("dataFloat_out")
def stop(self): # Technically not thread-safe but close enough for now process_thread = self.process_thread self.process_thread = None if process_thread != None: process_thread.stop() process_thread.join(self.TIMEOUT) if process_thread.isAlive(): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die") Device.stop(self)
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) ThreadedComponent.__init__(self) # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False # Instantiate the default implementations for all ports on this device self.port_message_out = MessageSupplierPort()
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) ThreadedComponent.__init__(self) # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False # Instantiate the default implementations for all ports on this device self.port_dataDouble_in = bulkio.InDoublePort("dataDouble_in", maxsize=self.DEFAULT_QUEUE_SIZE) self.port_dataFloat_in = bulkio.InFloatPort("dataFloat_in", maxsize=self.DEFAULT_QUEUE_SIZE) self.port_dataFloat_out = bulkio.OutFloatPort("dataFloat_out") self.port_dataDouble_out = bulkio.OutDoublePort("dataDouble_out")
def stop(self): self.threadControlLock.acquire() try: process_thread = self.process_thread self.process_thread = None if process_thread != None: process_thread.stop() process_thread.join(self.TIMEOUT) if process_thread.isAlive(): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die") Device.stop(self) finally: self.threadControlLock.release()
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) ThreadedComponent.__init__(self) # self.auto_start is deprecated and is only kept for API compatibility # with 1.7.X and 1.8.0 devices. This variable may be removed # in future releases self.auto_start = False # Instantiate the default implementations for all ports on this device self.port_dataFloat_in = bulkio.InFloatPort( "dataFloat_in", maxsize=self.DEFAULT_QUEUE_SIZE) self.port_dataFloat_out = bulkio.OutFloatPort("dataFloat_out")
class simpleseqdev_python_impl1_base(CF__POA.Device, Device): # These values can be altered in the __init__ of your derived class PAUSE = 0.0125 # The amount of time to sleep if process return NOOP TIMEOUT = 5.0 # The amount of time to wait for the process thread to die when stop() is called DEFAULT_QUEUE_SIZE = 100 # The number of BulkIO packets that can be in the queue before pushPacket will block def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) self.process_thread = None self.auto_start = False def initialize(self): Device.initialize(self) # Instantiate the default implementations for all ports on this component def start(self): Device.start(self) if self.process_thread == None: self.process_thread = ProcessThread(target=self.process, pause=self.PAUSE) self.process_thread.start() def process(self): """The process method should process a single "chunk" of data and then return. This method will be called from the processing thread again, and again, and again until it returns FINISH or stop() is called on the component. If no work is performed, then return NOOP""" raise NotImplementedError def stop(self): # Technically not thread-safe but close enough for now process_thread = self.process_thread self.process_thread = None if process_thread != None: process_thread.stop() process_thread.join(self.TIMEOUT) if process_thread.isAlive(): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die") Device.stop(self) def releaseObject(self): try: self.stop() except Exception, e: self._log.exception("Error stopping: " + str(e)) Device.releaseObject(self)
def initialize(self): Device.initialize(self) # Instantiate the default implementations for all ports on this device self.port_GPS_idl = PortFRONTENDGPSIn_i(self, "GPS_idl")
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams) self.process_thread = None self.auto_start = False
def __init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams): Device.__init__(self, devmgr, uuid, label, softwareProfile, compositeDevice, execparams, PROPERTIES)
def stop(self): Device.stop(self) if not ThreadedComponent.stopThread(self, self.TIMEOUT): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die")
def initialize(self): Device.initialize(self)
def initialize(self): Device.initialize(self) # Instantiate the default implementations for all ports on this device self.port_dataFloat_out = bulkio.OutFloatPort("dataFloat_out") self.port_GPS_uses = PortFRONTENDGPSOut_i(self, "GPS_uses")
def releaseObject(self): try: self.stop() except Exception: self._log.exception("Error stopping") Device.releaseObject(self)
def start(self): Device.start(self) ThreadedComponent.startThread(self, pause=self.PAUSE)
def start(self): Device.start(self) if self.process_thread == None: self.process_thread = ProcessThread(target=self.process, pause=self.PAUSE) self.process_thread.start()