[openrtm-commit:03084] r3170 - branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 1月 19日 (金) 16:53:14 JST
Author: miyamoto
Date: 2018-01-19 16:53:14 +0900 (Fri, 19 Jan 2018)
New Revision: 3170
Modified:
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.cpp
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.h
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.h
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.cpp
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.h
Log:
[incompat,->RELENG_1_2] refs #4119, #4145
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.cpp 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.cpp 2018-01-19 07:53:14 UTC (rev 3170)
@@ -1032,4 +1032,36 @@
{
return m_listeners;
}
+
+ ReturnCode_t InPortBase::notify_connect(ConnectorProfile& connector_profile)
+ throw (CORBA::SystemException)
+ {
+ Properties prop;
+ NVUtil::copyToProperties(prop, connector_profile.properties);
+
+ Properties node = prop.getNode("dataport.inport");
+
+ Properties portprop(m_properties);
+
+ node << portprop;
+
+ NVUtil::copyFromProperties(connector_profile.properties, prop);
+
+ std::string _str = node["fan_in"];
+ unsigned int value = 100;
+
+ coil::stringTo<unsigned int>(value, _str.c_str());
+
+
+ if (value <= m_connectors.size())
+ {
+ return RTC::PRECONDITION_NOT_MET;
+ }
+
+
+
+
+
+ return PortBase::notify_connect(connector_profile);
+ }
};
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.h 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/InPortBase.h 2018-01-19 07:53:14 UTC (rev 3170)
@@ -622,6 +622,8 @@
* @endif
*/
virtual ConnectorListeners& getListeners();
+ virtual ReturnCode_t notify_connect(ConnectorProfile& connector_profile)
+ throw (CORBA::SystemException);
protected:
@@ -845,14 +847,6 @@
CdrBufferBase* m_thebuffer;
/*!
* @if jp
- * @brief ¥×¥í¥Ñ¥Æ¥£
- * @else
- * @brief Properties
- * @endif
- */
- coil::Properties m_properties;
- /*!
- * @if jp
* @brief ÍøÍѲÄǽprovider
* @else
* @brief Available providers
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp 2018-01-19 07:53:14 UTC (rev 3170)
@@ -777,6 +777,9 @@
"manager.instance_name",
""
};
+
+ coil::Properties &_prop = prop.getNode("port");
+ _prop << m_config.getNode("port");
RTObject_impl* comp;
comp = factory->create(this);
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp 2018-01-19 07:53:14 UTC (rev 3170)
@@ -1097,4 +1097,37 @@
return NULL;
}
+ ReturnCode_t OutPortBase::notify_connect(ConnectorProfile& connector_profile)
+ throw (CORBA::SystemException)
+ {
+ Properties prop;
+ NVUtil::copyToProperties(prop, connector_profile.properties);
+
+ Properties node = prop.getNode("dataport.outport");
+
+ Properties portprop(m_properties);
+
+ node << portprop;
+
+
+
+ NVUtil::copyFromProperties(connector_profile.properties, prop);
+
+ std::string _str = node["fan_out"];
+ unsigned int value = 100;
+
+ coil::stringTo<unsigned int>(value, _str.c_str());
+
+ if (value <= m_connectors.size())
+ {
+ return RTC::PRECONDITION_NOT_MET;
+ }
+
+
+
+
+
+ return PortBase::notify_connect(connector_profile);
+ }
+
}; // end of namespace RTM
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.h 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortBase.h 2018-01-19 07:53:14 UTC (rev 3170)
@@ -1018,6 +1018,9 @@
coil::Properties& prop,
OutPortProvider* provider);
+ virtual ReturnCode_t notify_connect(ConnectorProfile& connector_profile)
+ throw (CORBA::SystemException);
+
protected:
/*!
* @if jp
@@ -1028,16 +1031,9 @@
*/
InPortBase* getLocalInPort(const ConnectorInfo& profile);
+
/*!
* @if jp
- * @brief ¥×¥í¥Ñ¥Æ¥£
- * @else
- * @brief Properties
- * @endif
- */
- coil::Properties m_properties;
- /*!
- * @if jp
* @brief Àܳ¥ê¥¹¥È
* @else
* @brief Connection list
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.cpp 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.cpp 2018-01-19 07:53:14 UTC (rev 3170)
@@ -231,6 +231,30 @@
{
RTC_TRACE(("notify_connect()"));
Guard guard(m_connectorsMutex);
+
+
+
+ Properties prop;
+ NVUtil::copyToProperties(prop, connector_profile.properties);
+ bool default_value = coil::toBool(m_properties["allow_dup_connection"], "YES", "NO", false);
+
+ if (!coil::toBool(prop.getProperty("dataport.allow_dup_connection"), "YES", "NO", default_value))
+ {
+ for (int i = 0; i < connector_profile.ports.length(); i++)
+ {
+ if (!getPortRef()->_is_equivalent(connector_profile.ports[i]))
+ {
+ bool ret = CORBA_RTCUtil::already_connected(connector_profile.ports[i], m_objref);
+ if(ret)
+ {
+ return RTC::PRECONDITION_NOT_MET;
+ }
+ }
+ }
+ }
+
+
+
ReturnCode_t retval[] = {RTC::RTC_OK, RTC::RTC_OK, RTC::RTC_OK};
onNotifyConnect(getName(), connector_profile);
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.h 2018-01-19 07:46:37 UTC (rev 3169)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/PortBase.h 2018-01-19 07:53:14 UTC (rev 3170)
@@ -1908,7 +1908,14 @@
{
NVUtil::appendStringValue(m_profile.properties, key, value);
}
-
+ /*!
+ * @if jp
+ * @brief ¥×¥í¥Ñ¥Æ¥£
+ * @else
+ * @brief Properties
+ * @endif
+ */
+ coil::Properties m_properties;
protected:
/*!
* @if jp
More information about the openrtm-commit
mailing list