[openrtm-commit:01703] r647 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 2月 1日 (月) 19:36:16 JST


Author: miyamoto
Date: 2016-02-01 19:36:16 +0900 (Mon, 01 Feb 2016)
New Revision: 647

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
Log:
[incompat,new_func,->RELENG_1_2] add initPreActivation() to Manager. refs #3403

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2016-02-01 10:35:19 UTC (rev 646)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2016-02-01 10:36:16 UTC (rev 647)
@@ -439,7 +439,7 @@
       self._initProc(self)
 
     self.initPreCreation()
-
+    self.initPreActivation()
     self.initPreConnection()
 
     return True
@@ -2463,6 +2463,38 @@
 
 
 
+  ##
+  # @if jp
+  # @brief 起動時にrtc.confで指定したRTCをアクティベーションする
+  # 例:
+  # manager.components.preactivate RTC1,RTC2~
+  # @param self
+  # @else
+  #
+  # @brief 
+  # @param self
+  # @endif
+  # void initPreActivation()
+  def initPreActivation(self):
+    
+    self._rtcout.RTC_TRACE("Components pre-activation: %s" % str(self._config.getProperty("manager.components.preactivate")))
+    comps = str(self._config.getProperty("manager.components.preactivate")).split(",")
+    for c in comps:
+      tmp = [c]
+      OpenRTM_aist.eraseHeadBlank(tmp)
+      OpenRTM_aist.eraseTailBlank(tmp)
+      c = tmp[0]
+      if c:
+        comp = self.getComponent(c)
+        
+        if comp is None:
+          self._rtcout.RTC_ERROR("%s not found." % c)
+          continue
+        ret = OpenRTM_aist.CORBA_RTCUtil.activate(comp.getObjRef())
+        if ret != RTC.RTC_OK:
+          self._rtcout.RTC_ERROR("%s activation filed." % c)
+        else:
+          self._rtcout.RTC_INFO("%s activated." % c)
 
 
   ##



More information about the openrtm-commit mailing list