Commit 8936f108 authored by Pavel Vainerman's avatar Pavel Vainerman

cleaned

parent 971629e9
......@@ -69,8 +69,8 @@ string conffile("configure.xml");
// --------------------------------------------------------------------------
static bool commandToAll(const string section, ObjectRepository *rep, Command cmd);
static void createSections(UniSetTypes::Configuration* c);
bool separateArgs(string &args, string &arg);
static bool separateArgs(string &args, string &arg);
//static bool getID( const string arg, ObjectId id, ObjectId node );
// --------------------------------------------------------------------------
int omap();
int msgmap();
......@@ -815,7 +815,8 @@ int saveValue(string args, UniversalInterface &ui)
int err;
err=0;
string arg;
UniSetTypes::ObjectId sid(DefaultObjectId);
UniSetTypes::ObjectId sid = DefaultObjectId;
UniSetTypes::ObjectId node = DefaultObjectId;
long val;
cout << "====== saveValue ======" << endl;
......@@ -823,7 +824,7 @@ int saveValue(string args, UniversalInterface &ui)
{
if( isdigit( arg[0] ) )
{
if( sscanf( arg.c_str(),"%ld=%ld",&sid,&val ) < 2 )
if( sscanf( arg.c_str(),"%ld:%ld=%ld",&sid,&node,&val ) < 2 )
{
cout << i <<"\t------------------------"<< endl;
cerr << "!!!!!!!!! SensorId=Value #"<<i<<" '"<<arg<<"' !!!!!!\n"<< endl;
......@@ -855,7 +856,10 @@ int saveValue(string args, UniversalInterface &ui)
cout << " value: " << val << endl;
cout << " name: (" << sid << ") " << conf->oind->getMapName(sid) << endl;
cout << " text: " << conf->oind->getTextName(sid) << "\n\n";
ui.saveValue(sid,val,UniversalIO::AnalogInput);
if( node == DefaultObjectId )
node = conf->getLocalNode();
ui.saveValue(sid,val,UniversalIO::AnalogInput,node);
}
catch(Exception& ex)
{
......@@ -1319,3 +1323,32 @@ int oinfo(string arg, UniversalInterface &ui )
}
// --------------------------------------------------------------------------------------
/*
bool getID( const string arg, ObjectId id, ObjectId node )
{
if( isdigit( arg[0] ) )
{
if( sscanf( arg.c_str(),"%ld",&id ) < 1 )
{
cout << i <<"\t------------------------"<< endl;
cerr << "!!!!!!!! SensorID #"<<i<<" '"<<arg<<"' !!!!!!!\n"<< endl;
err = 1;
vout<<"| "<<arg<<"\t| ?\t| SensorID !!!\n-----------------\n";
continue;
}
}
string::size_type pos = arg.find_first_of(":");
if( pos == string::npos )
{
id = uni_atoi(arg);
return true;
}
id = uni_atoi(name.substr(0,pos-1));
node = uni_atoi( name.substr(pos+1,name.size()) );
return true;
}
*/
// --------------------------------------------------------------------------------------
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