[openrtm-commit:02651] r849 - trunk/OpenRTM-aist-Python/OpenRTM_aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 6月 21日 (水) 13:38:40 JST
Author: miyamoto
Date: 2017-06-21 13:38:40 +0900 (Wed, 21 Jun 2017)
New Revision: 849
Modified:
trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
Log:
[compat,->RELENG_1_2] refs #4118
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py 2017-06-21 00:08:57 UTC (rev 848)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortBase.py 2017-06-21 04:38:40 UTC (rev 849)
@@ -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: trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py 2017-06-21 00:08:57 UTC (rev 848)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortBase.py 2017-06-21 04:38:40 UTC (rev 849)
@@ -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: trunk/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py 2017-06-21 00:08:57 UTC (rev 848)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/PortBase.py 2017-06-21 04:38:40 UTC (rev 849)
@@ -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: trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py 2017-06-21 00:08:57 UTC (rev 848)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py 2017-06-21 04:38:40 UTC (rev 849)
@@ -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