21 from omniORB
import any
73 OpenRTM_aist.CorbaConsumer.__init__(self)
74 self.
_rtcout = OpenRTM_aist.Manager.instance().getLogbuf(
"OutPortCorbaCdrConsumer")
93 def __del__(self, CorbaConsumer=OpenRTM_aist.CorbaConsumer):
94 self._rtcout.RTC_PARANOID(
"~OutPortCorbaCdrConsumer()")
95 CorbaConsumer.__del__(self)
128 self._rtcout.RTC_TRACE(
"init()")
159 self._rtcout.RTC_TRACE(
"setBuffer()")
167 self._rtcout.RTC_TRACE(
"setListener()")
196 self._rtcout.RTC_PARANOID(
"get()")
199 outportcdr = self.
getObject()._narrow(OpenRTM.OutPortCdr)
200 ret,cdr_data = outportcdr.get()
202 if ret == OpenRTM.PORT_OK:
203 self._rtcout.RTC_DEBUG(
"get() successful")
208 if self._buffer.full():
209 self._rtcout.RTC_INFO(
"InPort buffer is full.")
213 self._buffer.put(data[0])
214 self._buffer.advanceWptr()
215 self._buffer.advanceRptr()
221 self._rtcout.RTC_WARN(
"Exception caught from OutPort.get().")
222 self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
225 self._rtcout.RTC_ERROR(
"get(): Never comes here.")
253 self._rtcout.RTC_TRACE(
"subscribeInterface()")
257 self._rtcout.RTC_DEBUG(
"dataport.corba_cdr.outport_ior not found.")
261 self._rtcout.RTC_DEBUG(
"dataport.corba_cdr.outport_ior found.")
264 ior = any.from_any(properties[index].value, keep_structs=
True)
266 self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
268 orb = OpenRTM_aist.Manager.instance().getORB()
269 obj = orb.string_to_object(ior)
272 self._rtcout.RTC_DEBUG(
"CorbaConsumer was set successfully.")
274 self._rtcout.RTC_ERROR(
"Invalid object reference.")
300 self._rtcout.RTC_TRACE(
"unsubscribeInterface()")
302 "dataport.corba_cdr.outport_ref")
304 self._rtcout.RTC_DEBUG(
"dataport.corba_cdr.outport_ior not found.")
309 ior = any.from_any(properties[index].value, keep_structs=
True)
312 self._rtcout.RTC_DEBUG(
"dataport.corba_cdr.outport_ior found.")
313 orb = OpenRTM_aist.Manager.instance().getORB()
314 obj = orb.string_to_object(ior)
315 if self.
_ptr()._is_equivalent(obj):
317 self._rtcout.RTC_DEBUG(
"CorbaConsumer's reference was released.")
320 self._rtcout.RTC_ERROR(
"hmm. Inconsistent object reference.")
323 self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
338 if status == OpenRTM.PORT_OK:
342 elif status == OpenRTM.PORT_ERROR:
346 elif status == OpenRTM.BUFFER_FULL:
350 elif status == OpenRTM.BUFFER_EMPTY:
354 elif status == OpenRTM.BUFFER_TIMEOUT:
358 elif status == OpenRTM.UNKNOWN_ERROR:
376 self._listeners.connectorData_[OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE].notify(self.
_profile, data)
384 self._listeners.connectorData_[OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_FULL].notify(self.
_profile, data)
392 self._listeners.connectorData_[OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVED].notify(self.
_profile, data)
400 self._listeners.connectorData_[OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_FULL].notify(self.
_profile, data)
411 self._listeners.connector_[OpenRTM_aist.ConnectorListenerType.ON_SENDER_EMPTY].notify(self.
_profile)
419 self._listeners.connector_[OpenRTM_aist.ConnectorListenerType.ON_SENDER_TIMEOUT].notify(self.
_profile)
427 self._listeners.connector_[OpenRTM_aist.ConnectorListenerType.ON_SENDER_ERROR].notify(self.
_profile)
433 factory = OpenRTM_aist.OutPortConsumerFactory.instance()
434 factory.addFactory(
"corba_cdr",
def onSenderTimeout(self)
def subscribeInterface(self, properties)
Subscribe the data receive notification.
def getObject(self)
Get CORBA Object.
def init(self, prop)
Initializing configuration.
OutPortCorbaCdrConsumer class.
def onSenderEmpty(self)
Connector listener functions.
def onReceived(self, data)
def onReceiverFull(self, data)
def OutPortCorbaCdrConsumerInit()
def setListener(self, info, listeners)
def get(self, data)
Read data.
def setBuffer(self, buffer)
Setting outside buffer's pointer.
def setObject(self, obj)
Set CORBA Object.
int PORT_OK
DataPortStatus return codes.
def __init__(self)
Constructor.
def convertReturn(self, status, data)
Return codes conversionReturnCode convertReturn(::OpenRTM::PortStatus status, const cdrMemoryStream& ...
def unsubscribeInterface(self, properties)
Unsubscribe the data receive notification.
def _ptr(self)
Get Object reference narrowed as ObjectType.
def onBufferFull(self, data)
def onBufferWrite(self, data)
Connector data listener functions.
def __del__(self, CorbaConsumer=OpenRTM_aist.CorbaConsumer)
Destructor.