[openrtm-commit:00277] r424 - branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 7月 29日 (金) 17:39:10 JST
Author: kurihara
Date: 2011-07-29 17:39:09 +0900 (Fri, 29 Jul 2011)
New Revision: 424
Modified:
branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/test_RTObject.py
Log:
Added processing to set the rate of EC.
Modified: branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/test_RTObject.py
===================================================================
--- branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/test_RTObject.py 2011-07-28 03:03:26 UTC (rev 423)
+++ branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/test/test_RTObject.py 2011-07-29 08:39:09 UTC (rev 424)
@@ -329,7 +329,7 @@
ec_args = "PeriodicExecutionContext"+"?" + "rate=1000"
ec=OpenRTM_aist.Manager.instance().createContext(ec_args)
ec.bindComponent(rtobj)
- self.assertNotEqual(rtobj.getExecutionRate(0),1000)
+ self.assertEqual(rtobj.getExecutionRate(0),1000.0)
return
def test_setExecutionRate(self):
@@ -353,11 +353,14 @@
rtobj = TestComp(self._orb, self._poa)
ec_args = "PeriodicExecutionContext"+"?" + "rate=1000"
ec=OpenRTM_aist.Manager.instance().createContext(ec_args)
+ ec.set_rate(1000.0)
ec.bindComponent(rtobj)
self.assertEqual(rtobj.activate(0),RTC.RTC_OK)
ec.start()
time.sleep(0.1)
- self.assertEqual(rtobj.deactivate(0),RTC.RTC_OK)
+ ret = rtobj.deactivate(0)
+ time.sleep(0.1)
+ self.assertEqual(ret,RTC.RTC_OK)
ec.stop()
return
@@ -405,13 +408,13 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addPreComponentActionListener(OpenRTM_aist.PreComponentActionListenerType.PRE_ON_INITIALIZE,
- self, self.prelistenerFunc)
+ self.prelistenerFunc)
rtobj.removePreComponentActionListener(OpenRTM_aist.PreComponentActionListenerType.PRE_ON_INITIALIZE,
self.prelistenerFunc)
rtobj.addPreComponentActionListener(OpenRTM_aist.PreComponentActionListenerType.PRE_ON_FINALIZE,
- self, self.prelistenerFunc)
+ self.prelistenerFunc)
rtobj.removePreComponentActionListener(OpenRTM_aist.PreComponentActionListenerType.PRE_ON_FINALIZE,
self.prelistenerFunc)
@@ -425,7 +428,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addPostComponentActionListener(OpenRTM_aist.PostComponentActionListenerType.POST_ON_FINALIZE,
- self, self.postlistenerFunc)
+ self.postlistenerFunc)
rtobj.removePostComponentActionListener(OpenRTM_aist.PostComponentActionListenerType.POST_ON_FINALIZE,
self.postlistenerFunc)
@@ -435,7 +438,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addPortActionListener(OpenRTM_aist.PortActionListenerType.ADD_PORT,
- self, self.prelistenerFunc)
+ self.prelistenerFunc)
rtobj.removePortActionListener(OpenRTM_aist.PortActionListenerType.ADD_PORT,
self.prelistenerFunc)
@@ -445,7 +448,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addExecutionContextActionListener(OpenRTM_aist.ExecutionContextActionListenerType.EC_ATTACHED,
- self, self.prelistenerFunc)
+ self.prelistenerFunc)
rtobj.removeExecutionContextActionListener(OpenRTM_aist.ExecutionContextActionListenerType.EC_ATTACHED,
self.prelistenerFunc)
@@ -455,7 +458,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addPortConnectListener(OpenRTM_aist.PortConnectListenerType.ON_NOTIFY_CONNECT,
- self, self.postlistenerFunc)
+ self.postlistenerFunc)
rtobj.removePortConnectListener(OpenRTM_aist.PortConnectListenerType.ON_NOTIFY_CONNECT,
self.postlistenerFunc)
@@ -469,7 +472,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addPortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_CONNECTED,
- self, self.portconretlistenerFunc)
+ self.portconretlistenerFunc)
rtobj.removePortConnectRetListener(OpenRTM_aist.PortConnectRetListenerType.ON_CONNECTED,
self.portconretlistenerFunc)
@@ -483,7 +486,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addConfigurationParamListener(OpenRTM_aist.ConfigurationParamListenerType.ON_UPDATE_CONFIG_PARAM,
- self, self.configparamlistenerFunc)
+ self.configparamlistenerFunc)
rtobj.removeConfigurationParamListener(OpenRTM_aist.ConfigurationParamListenerType.ON_UPDATE_CONFIG_PARAM,
self.configparamlistenerFunc)
@@ -493,7 +496,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addConfigurationSetListener(OpenRTM_aist.ConfigurationSetListenerType.ON_SET_CONFIG_SET,
- self, self.prelistenerFunc)
+ self.prelistenerFunc)
rtobj.removeConfigurationSetListener(OpenRTM_aist.ConfigurationSetListenerType.ON_SET_CONFIG_SET,
self.prelistenerFunc)
@@ -503,7 +506,7 @@
rtobj = TestComp(self._orb, self._poa)
rtobj.addConfigurationSetNameListener(OpenRTM_aist.ConfigurationSetNameListenerType.ON_UPDATE_CONFIG_SET,
- self, self.prelistenerFunc)
+ self.prelistenerFunc)
rtobj.removeConfigurationSetNameListener(OpenRTM_aist.ConfigurationSetNameListenerType.ON_UPDATE_CONFIG_SET,
self.prelistenerFunc)
openrtm-commit メーリングリストの案内