Commit 180c78b0 authored by Pavel Vaynerman's avatar Pavel Vaynerman

fixed bug in admin --saveValue

parent 9dff12fc
......@@ -824,10 +824,10 @@ int saveValue(string args, UniversalInterface &ui)
{
if( isdigit( arg[0] ) )
{
if( sscanf( arg.c_str(),"%ld:%ld=%ld",&sid,&node,&val ) < 2 )
if( sscanf( arg.c_str(),"%ld=%ld",&sid,&val ) < 2 )
{
cout << i <<"\t------------------------"<< endl;
cerr << "!!!!!!!!! SensorId=Value #"<<i<<" '"<<arg<<"' !!!!!!\n"<< endl;
cerr << "(digit): !!! SensorId=Value #"<<i<<" '"<<arg<<"' !!!!!!\n"<< endl;
err=1;
continue;
}
......@@ -835,16 +835,16 @@ int saveValue(string args, UniversalInterface &ui)
else
{
int ind;
string name,strval;
string strval;
ind = arg.find_first_of("=");
name = conf->getSensorsSection()+"/"+arg.substr(0,ind);
string name(arg.substr(0,ind));
strval = arg.substr( ind + 1, arg.length() );
sid = conf->oind->getIdByName(name);
sid = conf->getSensorID(name);
if( sid == UniSetTypes::DefaultObjectId || (sscanf( strval.c_str(),"%ld",&val ) < 1) )
{
cout << i <<"\t------------------------"<< endl;
cerr << "!!!!!!!!! SensorName=Value #"<<i<<" '"<<arg<<"' !!!!!!\n"<< endl;
cerr << "(name): !!! SensorName=Value #"<<i<<" '"<<arg<<"' !!!!!!\n"<< endl;
err=1;
continue;
}
......@@ -896,11 +896,11 @@ int saveState(string args, UniversalInterface &ui)
else
{
int ind;
string name,strval;
string strval;
ind = arg.find_first_of("=");
name = conf->getSensorsSection()+"/"+arg.substr(0,ind);
string name(arg.substr(0,ind));
strval = arg.substr( ind + 1, arg.length() );
sid = conf->oind->getIdByName(name);
sid = conf->getSensorID(name);
if( sid == UniSetTypes::DefaultObjectId || (sscanf( strval.c_str(),"%ld",&inval ) < 1) )
{
......@@ -965,11 +965,11 @@ int setValue(string args, UniversalInterface &ui)
else
{
int ind;
string name,strval;
string strval;
ind = arg.find_first_of("=");
name = conf->getSensorsSection()+"/"+arg.substr(0,ind);
string name(arg.substr(0,ind));
strval = arg.substr( ind + 1, arg.length() );
sid = conf->oind->getIdByName(name);
sid = conf->getSensorID(name);
if( sid == UniSetTypes::DefaultObjectId || (sscanf( strval.c_str(),"%ld",&val ) < 1) )
{
......@@ -1025,15 +1025,15 @@ int setState(string args, UniversalInterface &ui)
else
{
int ind;
string name,strval;
string strval;
ind = arg.find_first_of("=");
name = conf->getSensorsSection()+"/"+arg.substr(0,ind);
string name(arg.substr(0,ind));
strval = arg.substr( ind + 1, arg.length() );
sid = conf->oind->getIdByName(name);
sid = conf->getSensorID(name);
if( sid == UniSetTypes::DefaultObjectId || (sscanf( strval.c_str(),"%ld",&inval ) < 1) )
{
cout << i <<"\t------------------------"<< endl;
cout << i <<"\t------------------------"<< endl;
cerr << "!!!!!!!!! SensorName=State #"<<i<<" '"<<arg<<"' !!!!!!\n"<< endl;
err=1;
continue;
......@@ -1097,9 +1097,7 @@ int getState(string args, UniversalInterface &ui)
}
else
{
string name;
name = conf->getSensorsSection()+"/"+arg;
sid = conf->oind->getIdByName(name);
sid = conf->getSensorID(arg);
if( sid == UniSetTypes::DefaultObjectId )
{
......@@ -1161,9 +1159,7 @@ int getValue(string args, UniversalInterface &ui )
}
else
{
string name;
name = conf->getSensorsSection()+"/"+arg;
sid = conf->oind->getIdByName(name);
sid = conf->getSensorID(arg);
if( sid == UniSetTypes::DefaultObjectId )
{
......
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.96
Release: eter60
Release: eter61
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -179,6 +179,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Thu Sep 10 2009 Pavel Vainerman <pv@etersoft.ru> 0.96-eter60
- rebuild for eterbook
* Thu Sep 10 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter59
- UniNetwork debugging
......
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