[openrtm-commit:03342] r3420 - branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 10月 9日 (火) 09:25:52 JST
Author: miyamoto
Date: 2018-10-09 09:25:52 +0900 (Tue, 09 Oct 2018)
New Revision: 3420
Modified:
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/CORBA_RTCUtil.cpp
branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp
Log:
[merge] r3419 has been merged from trunk.
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/CORBA_RTCUtil.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/CORBA_RTCUtil.cpp 2018-10-09 00:24:33 UTC (rev 3419)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/CORBA_RTCUtil.cpp 2018-10-09 00:25:52 UTC (rev 3420)
@@ -781,9 +781,18 @@
std::string prof_name;
conn_prof->name = CORBA::string_dup(name.c_str());
conn_prof->connector_id = CORBA::string_dup("");
- conn_prof->ports.length(2);
- conn_prof->ports[0] = RTC::PortService::_duplicate(port0);
- conn_prof->ports[1] = RTC::PortService::_duplicate(port1);
+ if (CORBA::is_nil(port1))
+ {
+ conn_prof->ports.length(1);
+ conn_prof->ports[0] = RTC::PortService::_duplicate(port0);
+ }
+ else
+ {
+ conn_prof->ports.length(2);
+ conn_prof->ports[0] = RTC::PortService::_duplicate(port0);
+ conn_prof->ports[1] = RTC::PortService::_duplicate(port1);
+ }
+
if (prop["dataport.dataflow_type"].empty())
{
prop["dataport.dataflow_type"] = "push";
@@ -849,8 +858,10 @@
const RTC::PortService_ptr port1)
{
if (CORBA::is_nil(port0)) { return RTC::BAD_PARAMETER; }
- if (CORBA::is_nil(port1)) { return RTC::BAD_PARAMETER; }
- if (port0->_is_equivalent(port1)) { return RTC::BAD_PARAMETER; }
+ if (!CORBA::is_nil(port1)) {
+ if (port0->_is_equivalent(port1)) { return RTC::BAD_PARAMETER; }
+ }
+
RTC::ConnectorProfile_var cprof;
cprof = create_connector(name, prop, port0, port1);
return port0->connect(cprof);
Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp 2018-10-09 00:24:33 UTC (rev 3419)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Manager.cpp 2018-10-09 00:25:52 UTC (rev 3420)
@@ -2576,8 +2576,10 @@
}
std::string tmp = param_itr->first;
coil::replaceString(tmp, "port", "");
+ std::string::size_type pos = param_itr->first.find("port");
+
int val = 0;
- if (coil::stringTo<int>(val, tmp.c_str()))
+ if (coil::stringTo<int>(val, tmp.c_str()) && pos != std::string::npos)
{
ports.push_back(param_itr->second);
continue;
@@ -2586,7 +2588,7 @@
}
-
+ /*
if (ports.size() == 0)
{
RTC_ERROR(("Invalid format for pre-connection."));
@@ -2593,6 +2595,7 @@
RTC_ERROR(("Format must be Comp0.port0?port=Comp1.port1"));
continue;
}
+ */
if (configs.count("dataflow_type") == 0)
{
@@ -2645,6 +2648,25 @@
continue;
}
+ if (ports.size() == 0)
+ {
+ coil::Properties prop;
+
+ for (coil::mapstring::iterator config_itr = configs.begin(); config_itr != configs.end(); ++config_itr) {
+ std::string key = config_itr->first;
+ std::string value = config_itr->second;
+ coil::eraseBothEndsBlank(key);
+ coil::eraseBothEndsBlank(value);
+
+ prop["dataport." + key] = value;
+ }
+
+ if (RTC::RTC_OK != CORBA_RTCUtil::connect(connectors[i], prop, port0_var, RTC::PortService::_nil()))
+ {
+ RTC_ERROR(("Connection error: %s", connectors[i].c_str()));
+ }
+ }
+
for (coil::vstring::iterator port_itr = ports.begin(); port_itr != ports.end(); ++port_itr)
{
openrtm-commit メーリングリストの案内