[openrtm-commit:00344] r452 - branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test

openrtm @ openrtm.org openrtm @ openrtm.org
2011年 8月 11日 (木) 18:39:06 JST


Author: kurihara
Date: 2011-08-11 18:39:06 +0900 (Thu, 11 Aug 2011)
New Revision: 452

Modified:
   branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/ComponentActionListenerTestComp.py
Log:
The test case for ConnectionListener has been added.

Modified: branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/ComponentActionListenerTestComp.py
===================================================================
--- branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/ComponentActionListenerTestComp.py	2011-08-11 07:56:39 UTC (rev 451)
+++ branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/ComponentActionListenerTestComp.py	2011-08-11 09:39:06 UTC (rev 452)
@@ -176,6 +176,44 @@
     print "onDetachExecutionContextFunc"
     return
 
+
+  def onNotifyConnectFunc(self, pname, prof):
+    print "onNotifyConnectFunc pname: ",pname
+    return
+
+  def onNotifyDisconnectFunc(self, pname, prof):
+    print "onNotifyDisconnectFunc pname: ",pname
+    return
+
+  def onUnsubscribeInterfacesFunc(self, pname, profile):
+    print "onUnsubscribeInterfacesFunc pname: ", pname
+    return
+
+  def onPublishInterfacesFunc(self, portname, profile, ret):
+    print "onPublishInterfacesFunc pname: ", portname, " ret: ", ret
+    return
+
+  def onConnectNextportFunc(self, portname, profile, ret):
+    print "onConnectNextportFunc pname: ", portname, " ret: ", ret
+    return
+
+  def onSubscribeInterfacesFunc(self, portname, profile, ret):
+    print "onSubscribeInterfacesFunc pname: ", portname, " ret: ", ret
+    return
+
+  def onConnectedFunc(self, portname, profile, ret):
+    print "onConnectedFunc pname: ", portname, " ret: ", ret
+    return
+
+  def onDisconnectNextportFunc(self, portname, profile, ret):
+    print "onDisconnectNextportFunc pname: ", portname, " ret: ", ret
+    return
+
+  def onDisconnectedFunc(self, portname, profile, ret):
+    print "onDisconnectedFunc pname: ", portname, " ret: ", ret
+    return
+
+
   def onInitialize(self):
     self.addPreComponentActionListener(OpenRTM_aist.PreComponentActionListenerType.PRE_ON_FINALIZE,
                                        self.preOnFinalizeFunc)
@@ -231,6 +269,27 @@
                                self.onRemovePortFunc)
 
 
+    self.addPortConnectListener(OpenRTM_aist.PortConnectListenerType.ON_NOTIFY_CONNECT,
+                                self.onNotifyConnectFunc)
+    self.addPortConnectListener(OpenRTM_aist.PortConnectListenerType.ON_NOTIFY_DISCONNECT,
+                                self.onNotifyDisconnectFunc)
+    self.addPortConnectListener(OpenRTM_aist.PortConnectListenerType.ON_UNSUBSCRIBE_INTERFACES,
+                                self.onUnsubscribeInterfacesFunc)
+
+    self.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_PUBLISH_INTERFACES,
+                                   self.onPublishInterfacesFunc)
+    self.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_CONNECT_NEXTPORT,
+                                   self.onConnectNextportFunc)
+    self.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_SUBSCRIBE_INTERFACES,
+                                   self.onSubscribeInterfacesFunc)
+    self.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_CONNECTED,
+                                   self.onConnectedFunc)
+    self.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_DISCONNECT_NEXT,
+                                   self.onDisconnectNextportFunc)
+    self.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_DISCONNECTED,
+                                   self.onDisconnectedFunc)
+
+
     self._data = RTC.TimedLong(RTC.Time(0,0),0)
     self._outport = OpenRTM_aist.OutPort("out", self._data)
     # Set OutPort buffer



openrtm-commit メーリングリストの案内