[openrtm-commit:02652] r850 - branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 6月 21日 (水) 13:47:04 JST


Author: kawauchi
Date: 2017-06-21 13:47:04 +0900 (Wed, 21 Jun 2017)
New Revision: 850

Modified:
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
Log:
[merge] r845-849 have been merged from trunk.

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -495,10 +495,55 @@
       connector_profile.properties.append(OpenRTM_aist.NVUtil.newNV("dataport.serializer.cdr.endian","little,big"))
 
     return OpenRTM_aist.PortBase.connect(self, connector_profile)
-        
+
+
+
+
   ##
   # @if jp
   #
+  # @brief
+  #
+  # @param self
+  # @param connector_profile
+  # @return
+  #
+  # @else
+  #
+  # @brief
+  #
+  # @param self
+  # @param connector_profile
+  # @return
+  #
+  # @endif
+  #
+  def notify_connect(self, connector_profile):
+
+    prop = OpenRTM_aist.Properties()
+    OpenRTM_aist.NVUtil.copyToProperties(prop, connector_profile.properties)
+
+    _str = self._properties.getProperty("dataport.fan_in")
+    _type = [int(100)]
+    
+    OpenRTM_aist.stringTo(_type, _str)
+    
+    
+
+    _str = prop.getProperty("dataport.fan_in")
+    OpenRTM_aist.stringTo(_type, _str)
+    
+    value =  _type[0]
+
+    if value <= len(self._connectors):
+      return (RTC.PRECONDITION_NOT_MET, connector_profile)
+    
+    return OpenRTM_aist.PortBase.notify_connect(self, connector_profile)
+
+
+  ##
+  # @if jp
+  #
   # @brief InPort¤ò activates ¤¹¤ë
   #
   # InPort¤ò activate ¤¹¤ë¡£

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -971,7 +971,8 @@
                     "sdo.service.provider.available_services",
                     "sdo.service.consumer.available_services",
                     "sdo.service.provider.enabled_services",
-                    "sdo.service.consumer.enabled_services"]
+                    "sdo.service.consumer.enabled_services",
+                    "manager.instance_name"]
 
     prop_ = prop.getNode("port")
     prop_.mergeProperties(self._config.getNode("port"))

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -352,8 +352,10 @@
     #module_name = module_name.split("&")[0]
     module_name = [module_name]
     self.get_parameter_by_modulename("manager_address",module_name)
-    self.get_parameter_by_modulename("manager_name",module_name)
+    manager_name = self.get_parameter_by_modulename("manager_name",module_name)
     module_name = module_name[0]
+    tmp = [module_name]
+    language = self.get_parameter_by_modulename("language",tmp)
     
     
     if self._isMaster:
@@ -360,20 +362,25 @@
       guard = OpenRTM_aist.ScopedLock(self._slaveMutex)
       for slave in self._slaves[:]:
         try:
-          rtc = slave.create_component(module_name)
-          if not CORBA.is_nil(rtc):
-            return rtc
+          prof = slave.get_configuration()
+          prop = OpenRTM_aist.Properties()
+          OpenRTM_aist.NVUtil.copyToProperties(prop, prof)
+          slave_lang = prop.getProperty("manager.language")
+          if slave_lang == language:
+            rtc = slave.create_component(module_name)
+            if not CORBA.is_nil(rtc):
+              return rtc
         except:
           self._rtcout.RTC_ERROR("Unknown exception cought.")
           self._rtcout.RTC_DEBUG(OpenRTM_aist.Logger.print_exception())
           self._slaves.remove(slave)
       del guard
+      if not manager_name:
+        module_name = module_name + "&manager_name=manager_%p"
+        
+        rtc = self.create_component_by_mgrname(module_name)
+        return rtc
 
-      module_name = module_name + "&manager_name=manager_%p"
-      
-      rtc = self.create_component_by_mgrname(module_name)
-      return rtc
-
     else:
       # create on this manager
       rtc = self._mgr.createComponent(module_name)

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/ModuleManager.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -637,7 +637,7 @@
               OpenRTM_aist.eraseHeadBlank(tmp)
               key = tmp[0]
               
-              value = r[pos:]
+              value = r[pos+1:]
               tmp = [value]
               OpenRTM_aist.eraseHeadBlank(tmp)
               value = tmp[0]

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -408,6 +408,48 @@
 
   ##
   # @if jp
+  #
+  # @brief
+  #
+  # @param self
+  # @param connector_profile
+  # @return
+  #
+  # @else
+  #
+  # @brief
+  #
+  # @param self
+  # @param connector_profile
+  # @return
+  #
+  # @endif
+  #
+  def notify_connect(self, connector_profile):
+    prop = OpenRTM_aist.Properties()
+    OpenRTM_aist.NVUtil.copyToProperties(prop, connector_profile.properties)
+
+    _str = self._properties.getProperty("dataport.fan_out")
+    _type = [int(100)]
+    
+    OpenRTM_aist.stringTo(_type, _str)
+    
+    
+
+    _str = prop.getProperty("dataport.fan_out")
+    OpenRTM_aist.stringTo(_type, _str)
+    
+    value =  _type[0]
+
+    if value <= len(self._connectors):
+      return (RTC.PRECONDITION_NOT_MET, connector_profile)
+
+
+    return OpenRTM_aist.PortBase.notify_connect(self, connector_profile)
+
+
+  ##
+  # @if jp
   # @brief ¥×¥í¥Ñ¥Æ¥£¤ò¼èÆÀ¤¹¤ë
   #
   # OutPort¤Î¥×¥í¥Ñ¥Æ¥£¤ò¼èÆÀ¤¹¤ë¡£

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -688,6 +688,21 @@
   def notify_connect(self, connector_profile):
     self._rtcout.RTC_TRACE("notify_connect()")
 
+
+    prop = OpenRTM_aist.Properties()
+    OpenRTM_aist.NVUtil.copyToProperties(prop, connector_profile.properties)
+    
+    default_value = OpenRTM_aist.toBool(self._properties.getProperty("dataport.allow_dup_connection"), "YES","NO",False)
+    
+    if not OpenRTM_aist.toBool(prop.getProperty("dataport.allow_dup_connection"), "YES","NO",default_value):
+      for port in connector_profile.ports:
+        if not port._is_equivalent(self._objref):
+          ret = OpenRTM_aist.CORBA_RTCUtil.already_connected(port, self._objref)
+          if ret:
+            return (RTC.PRECONDITION_NOT_MET, connector_profile)
+
+
+
     guard_connection = OpenRTM_aist.ScopedLock(self._connection_mutex)
 
     # publish owned interface information to the ConnectorProfile

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py	2017-06-21 04:38:40 UTC (rev 849)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py	2017-06-21 04:47:04 UTC (rev 850)
@@ -2793,7 +2793,7 @@
       self._rtcout.RTC_ERROR("addInPort() failed.")
       return ret
       
-    inport.init(self._properties.getNode(propkey))
+    inport.init(prop_)
     self._inports.append(inport)
     return ret
 
@@ -2837,7 +2837,7 @@
       self._rtcout.RTC_ERROR("addOutPort() failed.")
       return ret
 
-    outport.init(self._properties.getNode(propkey))
+    outport.init(prop_)
     self._outports.append(outport)
     return ret
 



More information about the openrtm-commit mailing list