Commit faec0cbb authored by Pavel Vainerman's avatar Pavel Vainerman

(Configuratrion): добавил возможность задать в конфигурационном файле,

параметры для omniORB. В секции: <omniORB> <option name="-ORBxxx" arg="..."/> <option name="-ORBxxx" arg="..."/> <option name="-ORBxxx" arg="..."/> </omniORB> Для возможности конфигурировать какие-либо параметры не влезая в /etc/omniORB.cfg (или определяя каждый раз аргументы командной строки)
parent 9fa2d839
......@@ -42,6 +42,8 @@ Version 2.0
- Перевести взаимодействие PassiveObject <--> ProxyManager на shared_ptr (или weak_ptr).
uniset-codegen: добавить ключ --gen-sensor-name для генерирования name_Item.. (чтобы можно было в логах использовать текстовые названия)
Version 2.1
============
......@@ -55,6 +57,7 @@ Version 2.1
version 3
=========
Перепроектировать классы [ObjectRepository, UInterface, ORepHelpers] с целью выработки абстрактного интерфейса
......
......@@ -2,7 +2,7 @@
ulimit -Sc 1000000
./uniset2-start.sh -f ./uniset2-nullController --name SharedMemory1 --confile test.xml --ulog-add-levels any
./uniset2-start.sh -f ./uniset2-nullController --name SharedMemory1 --confile test.xml --ulog-add-levels any $*
#info,warn,crit,system,level9 > 1.log
#--c-filter-field cfilter --c-filter-value test1 --s-filter-field io --s-filter-value 1
......@@ -12,7 +12,7 @@
Name: libuniset2
Version: 2.0
Release: alt15
Release: alt16
Summary: UniSet - library for building distributed industrial control systems
......@@ -406,6 +406,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet2.pc
%changelog
* Fri Feb 06 2015 Pavel Vainerman <pv@altlinux.ru> 2.0-alt16
- add <omniORB> section to configure.xml (for use in the ORB_init())
* Sun Feb 01 2015 Pavel Vainerman <pv@altlinux.ru> 2.0-alt15
- fixed minor bug in uniset2-smonit utility
- minor fixes
......
<?xml version="1.0" encoding="utf-8"?>
<UNISETPLC xmlns:xi="http://www.w3.org/2001/XInclude">
<UserData/>
<omniORB>
<option name="-ORBendPoint" arg="giop:tcp:localhost:"/>
</omniORB>
<!-- Общие(стартовые) параметры по UniSet -->
<UniSet>
<NameService host="localhost" port="2809"/>
......
......@@ -266,7 +266,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
}
// Настраиваем отладочные логи
initLogStream(ulog(),"UniSetDebug");
initLogStream(ulog(),"ulog");
// default init...
transientIOR = false;
......@@ -295,13 +295,35 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
// считываем список узлов
createNodesList();
std::list< std::pair<string,string> > omniParams;
// ---------------------------------------------------------------------------------
UniXML::iterator omniIt(unixml->findNode(unixml->getFirstNode(),"omniORB") );
if( omniIt && omniIt.goChildren() )
{
for(; omniIt.getCurrent(); omniIt++ )
{
std::string p(omniIt.getProp("name"));
if( p.empty() )
{
uwarn << "(Configuration::init): unknown omniORB param...name=''" << endl;
}
else
{
const string a(omniIt.getProp("arg"));
uinfo << "(Configuration): add omniORB param: " << p << " " << a << endl;
omniParams.push_back( std::make_pair(p,a) );
}
}
}
// ---------------------------------------------------------------------------------
// добавляем новые параметры в argv
// для передачи параметров orb по списку узлов
// взятому из configure.xml
// +N --> -ORBIniRef NodeName=
// +2 --> -ORBIniRef NameService=
_argc = argc+2*lnodes.size()+2;
// + --> -ORBxxxx from configure.xml (<omniORB>)
_argc = argc+2*lnodes.size() + 2 + 2*omniParams.size();
const char** new_argv = new const char*[_argc];
int i = 0;
......@@ -333,6 +355,14 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
assert( i < _argc );
}
for( auto& p: omniParams )
{
new_argv[i++] = uni_strdup(p.first);
new_argv[i++] = uni_strdup(p.second);
assert( i < _argc );
}
// т..к _argc уже изменился, то и _argv надо обновить
// чтобы вызов getArgParam не привел к SIGSEGV
_argv = new_argv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment