[openrtm-commit:00009] r404 - branches/RELENG_1_0/OpenRTM-aist-Python/OpenRTM_aist
openrtm at openrtm.org
openrtm at openrtm.org
Tue Apr 12 11:15:19 JST 2011
Author: kurihara
Date: 2011-04-12 11:15:19 +0900 (Tue, 12 Apr 2011)
New Revision: 404
Modified:
branches/RELENG_1_0/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py
Log:
PortConnectListeners has been added. refs 2049
Modified: branches/RELENG_1_0/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py
===================================================================
--- branches/RELENG_1_0/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py 2011-04-08 15:43:56 UTC (rev 403)
+++ branches/RELENG_1_0/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py 2011-04-12 02:15:19 UTC (rev 404)
@@ -693,10 +693,12 @@
# publish owned interface information to the ConnectorProfile
retval = [RTC.RTC_OK for i in range(3)]
+ self.onNotifyConnect(self.getName(),connector_profile)
retval[0] = self.publishInterfaces(connector_profile)
if retval[0] != RTC.RTC_OK:
self._rtcout.RTC_ERROR("publishInterfaces() in notify_connect() failed.")
+ self.onPublishInterfaces(self.getName(), connector_profile, retval[0])
if self._onPublishInterfaces:
self._onPublishInterfaces(connector_profile)
@@ -705,14 +707,18 @@
if retval[1] != RTC.RTC_OK:
self._rtcout.RTC_ERROR("connectNext() in notify_connect() failed.")
+ self.onConnectNextport(self.getName(), connector_profile, retval[1])
# subscribe interface from the ConnectorProfile's information
if self._onSubscribeInterfaces:
self._onSubscribeInterfaces(connector_profile)
+
retval[2] = self.subscribeInterfaces(connector_profile)
if retval[2] != RTC.RTC_OK:
self._rtcout.RTC_ERROR("subscribeInterfaces() in notify_connect() failed.")
#self.notify_disconnect(connector_profile.connector_id)
+ self.onSubscribeInterfaces(self.getName(), connector_profile, retval[2])
+
self._rtcout.RTC_PARANOID("%d connectors are existing",
len(self._profile.connector_profiles))
@@ -730,12 +736,13 @@
for ret in retval:
if ret != RTC.RTC_OK:
+ self.onConnected(self.getName(), connector_profile, ret)
return (ret, connector_profile)
# connection established without errors
if self._onConnected:
self._onConnected(connector_profile)
-
+ self.onConnected(self.getName(), connector_profile, RTC.RTC_OK)
return (RTC.RTC_OK, connector_profile)
@@ -946,11 +953,14 @@
self._profile.connector_profiles[index].connector_id,
self._profile.connector_profiles[index].ports,
self._profile.connector_profiles[index].properties)
+ self.onNotifyDisconnect(self.getName(), prof)
retval = self.disconnectNext(prof)
+ self.onDisconnectNextport(self.getName(), prof, retval)
if self._onUnsubscribeInterfaces:
self._onUnsubscribeInterfaces(prof)
+ self.onUnsubscribeInterfaces(self.getName(), prof)
self.unsubscribeInterfaces(prof)
if self._onDisconnected:
@@ -958,6 +968,7 @@
OpenRTM_aist.CORBA_SeqUtil.erase(self._profile.connector_profiles, index)
+ self.onDisconnected(self.getName(), prof, retval)
return retval
@@ -1449,6 +1460,7 @@
#
# void setPortConnectListenerHolder(PortConnectListeners* portconnListeners);
def setPortConnectListenerHolder(self, portconnListeners):
+ self._portconnListeners = portconnListeners
return
More information about the openrtm-commit
mailing list