[openrtm-commit:01766] r666 - trunk/OpenRTM-aist-Python/OpenRTM_aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 2月 26日 (金) 19:23:02 JST
Author: miyamoto
Date: 2016-02-26 19:23:02 +0900 (Fri, 26 Feb 2016)
New Revision: 666
Modified:
trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/NodeNumberingPolicy.py
Log:
[compat,->RELENG_1_2]The processing in NamingOnManager.string_to_component() method has been changed. refs #3411
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py 2016-02-26 10:11:15 UTC (rev 665)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py 2016-02-26 10:23:02 UTC (rev 666)
@@ -258,6 +258,8 @@
+
+
##
# @if jp
#
@@ -290,13 +292,14 @@
# @else
#
# @endif
- def __init__(self, orb):
+ def __init__(self, orb, mgr):
self._rtcout = OpenRTM_aist.Manager.instance().getLogbuf('manager.namingonmanager')
self._cosnaming = None
#self.isMaster = isMaster
#self.masters = masters
#self.slaves = slaves
self._orb = orb
+ self._mgr = mgr
##
@@ -400,23 +403,25 @@
def string_to_component(self, name):
rtc_list = []
tmp = name.split("//")
+
if len(tmp) > 1:
- tag = tmp[0]
- url = tmp[1]
- r = url.split("/")
- if len(r) > 1:
- host = r[0]
- rtc_name = url.replace(host+"/","")
-
- mgr = self.getManager(host)
- if mgr:
- rtc_list = mgr.get_components_by_name(rtc_name)
+ if tmp[0] == "rtcloc:":
+ tag = tmp[0]
+ url = tmp[1]
+ r = url.split("/")
+ if len(r) > 1:
+ host = r[0]
+ rtc_name = url.replace(host+"/","")
+
+ mgr = self.getManager(host)
+ if mgr:
+ rtc_list = mgr.get_components_by_name(rtc_name)
- slaves = mgr.get_slave_managers()
- for ms in slaves:
- rtc_list.extend(ms.get_components_by_name(rtc_name))
+ slaves = mgr.get_slave_managers()
+ for ms in slaves:
+ rtc_list.extend(ms.get_components_by_name(rtc_name))
- return rtc_list
+ return rtc_list
return rtc_list
##
@@ -436,6 +441,17 @@
#
# virtual Manager_ptr getManager(string name);
def getManager(self, name):
+ if name == "*":
+ mgr_sev = self._mgr._mgrservant
+ if mgr_sev.is_master():
+ mgr = mgr_sev.getObjRef()
+ else:
+ masters = mgr_sev.get_master_managers()
+ if len(masters) > 0:
+ mgr = masters[0]
+ else:
+ mgr = mgr_sev.getObjRef()
+ return mgr
try:
mgrloc = "corbaloc:iiop:"
@@ -762,8 +778,7 @@
elif mth == "manager":
-
- name = OpenRTM_aist.NamingOnManager(self._manager.getORB())
+ name = OpenRTM_aist.NamingOnManager(self._manager.getORB(), self._manager)
return name
return None
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/NodeNumberingPolicy.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/NodeNumberingPolicy.py 2016-02-26 10:11:15 UTC (rev 665)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/NodeNumberingPolicy.py 2016-02-26 10:23:02 UTC (rev 666)
@@ -115,29 +115,16 @@
# @endif
def find(self, name):
rtcs = []
- mgr_servant = self._mgr._mgrservant
- master_mgr = None
- if mgr_servant.is_master():
- master_mgr = mgr_servant.getObjRef()
- else:
- masters = mgr_servant.get_master_managers()
- if len(masters) > 0:
- master_mgr = masters[0]
- else:
- master_mgr = mgr_servant.getObjRef()
+ rtc_name = "rtcloc://*/*/"
+ rtc_name += name
- rtcs = master_mgr.get_components_by_name(name)
+ rtcs = self._mgr._namingManager.string_to_component(rtc_name)
+
if len(rtcs) > 0:
return True
- slaves = master_mgr.get_slave_managers()
- for ms in slaves:
- rtcs = ms.get_components_by_name(name)
- if len(rtcs) > 0:
- return True
+ else:
+ return False
-
-
- return False
More information about the openrtm-commit
mailing list