Commit 70196012 authored by Pavel Vainerman's avatar Pavel Vainerman

UniNework debugging

parent ecc4f4ec
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.96 Version: 0.96
Release: eter58 Release: eter59
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: GPL License: GPL
Group: Development/C++ Group: Development/C++
...@@ -167,6 +167,7 @@ rm -f %buildroot%_libdir/*.la ...@@ -167,6 +167,7 @@ rm -f %buildroot%_libdir/*.la
%_libdir/libUniSetMB*.so %_libdir/libUniSetMB*.so
%_libdir/libUniSetRT*.so %_libdir/libUniSetRT*.so
%_libdir/libUniSetShared*.so %_libdir/libUniSetShared*.so
%_libdir/libUniSetNetwork.so
%_pkgconfigdir/*Extensions.pc %_pkgconfigdir/*Extensions.pc
%_pkgconfigdir/libUniSetIO*.pc %_pkgconfigdir/libUniSetIO*.pc
%_pkgconfigdir/libUniSetLog*.pc %_pkgconfigdir/libUniSetLog*.pc
...@@ -178,6 +179,9 @@ rm -f %buildroot%_libdir/*.la ...@@ -178,6 +179,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Wed Sep 09 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter58
- UniNetwork debugging
* Wed Sep 09 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter57 * Wed Sep 09 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter57
- new build - new build
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</SharedMemory> </SharedMemory>
<UniExchange name="UniExchange"> <UniExchange name="UniExchange">
<item name="UniExchange2" node_id="Node2" sid_connection=""/> <item name="UniExchange2" node="Node2" sid_connection=""/>
<item id="3001" node_id="Node2" sid_connection=""/> <item id="3001" node_id="Node2" sid_connection=""/>
</UniExchange> </UniExchange>
......
...@@ -38,6 +38,12 @@ polltime(200) ...@@ -38,6 +38,12 @@ polltime(200)
dlog[Debug::INFO] << myname << "(init): read fileter-field='" << s_field dlog[Debug::INFO] << myname << "(init): read fileter-field='" << s_field
<< "' filter-value='" << s_fvalue << "'" << endl; << "' filter-value='" << s_fvalue << "'" << endl;
polltime = conf->getArgInt("--" + prefix + "-polltime",it.getProp("polltime"));
if( polltime <= 0 )
polltime = 200;
dlog[Debug::INFO] << myname << "(init): polltime=" << polltime << endl;
if( it.goChildren() ) if( it.goChildren() )
{ {
for( ; it.getCurrent(); it.goNext() ) for( ; it.getCurrent(); it.goNext() )
...@@ -48,14 +54,13 @@ polltime(200) ...@@ -48,14 +54,13 @@ polltime(200)
if( !n.empty() ) if( !n.empty() )
id = it.getIntProp("id"); id = it.getIntProp("id");
else else
{
id = conf->getControllerID( it.getProp("name") ); id = conf->getControllerID( it.getProp("name") );
n = it.getProp("name");
}
if( id == DefaultObjectId ) if( id == DefaultObjectId )
{
if( n.empty() )
n = it.getProp("name");
throw SystemError("(UniExchange): Uknown ID for " + n ); throw SystemError("(UniExchange): Uknown ID for " + n );
}
UniSetTypes::ObjectId node; UniSetTypes::ObjectId node;
...@@ -63,8 +68,11 @@ polltime(200) ...@@ -63,8 +68,11 @@ polltime(200)
if( !n1.empty() ) if( !n1.empty() )
node = it.getIntProp("node_id"); node = it.getIntProp("node_id");
else else
{
n1 = it.getProp("node");
node = conf->getNodeID(n1); node = conf->getNodeID(n1);
}
if( id == DefaultObjectId ) if( id == DefaultObjectId )
throw SystemError("(UniExchange): Uknown ID for node=" + n1 ); throw SystemError("(UniExchange): Uknown ID for node=" + n1 );
...@@ -102,8 +110,14 @@ void UniExchange::execute() ...@@ -102,8 +110,14 @@ void UniExchange::execute()
bool ok = false; bool ok = false;
try try
{ {
if( dlog.debugging(Debug::INFO) )
dlog[Debug::INFO] << myname << ": connect to id=" << it->id << " node=" << it->node << endl;
IOController_i::ShortMapSeq_var sseq = ui.getSensors( it->id, it->node ); IOController_i::ShortMapSeq_var sseq = ui.getSensors( it->id, it->node );
ok = true; ok = true;
if( dlog.debugging(Debug::INFO) )
dlog[Debug::INFO] << myname << " update sensors from id=" << it->id << " node=" << it->node << endl;
it->update(sseq,shm); it->update(sseq,shm);
} }
catch( Exception& ex ) catch( Exception& ex )
...@@ -129,8 +143,8 @@ void UniExchange::execute() ...@@ -129,8 +143,8 @@ void UniExchange::execute()
} }
} }
if( !ok ) if( !ok && dlog.debugging(Debug::INFO) )
dlog[Debug::INFO] << "****** cannot connect with node=" << it->node << endl; dlog[Debug::INFO] << myname << ": ****** cannot connect with node=" << it->node << endl;
} }
msleep(polltime); msleep(polltime);
...@@ -262,7 +276,7 @@ UniExchange* UniExchange::init_exchange( int argc, const char* const* argv, ...@@ -262,7 +276,7 @@ UniExchange* UniExchange::init_exchange( int argc, const char* const* argv,
UniSetTypes::ObjectId icID, SharedMemory* ic, UniSetTypes::ObjectId icID, SharedMemory* ic,
const std::string prefix ) const std::string prefix )
{ {
string p("--" + prefix + "-id"); string p("--" + prefix + "-name");
string nm(UniSetTypes::getArgParam(p,argc,argv,"UniExchange")); string nm(UniSetTypes::getArgParam(p,argc,argv,"UniExchange"));
UniSetTypes::ObjectId ID = conf->getControllerID(nm); UniSetTypes::ObjectId ID = conf->getControllerID(nm);
......
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