Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
8936f108
Commit
8936f108
authored
Sep 01, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned
parent
971629e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
admin.cc
Utilities/Admin/admin.cc
+38
-5
No files found.
Utilities/Admin/admin.cc
View file @
8936f108
...
@@ -69,8 +69,8 @@ string conffile("configure.xml");
...
@@ -69,8 +69,8 @@ string conffile("configure.xml");
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
static
bool
commandToAll
(
const
string
section
,
ObjectRepository
*
rep
,
Command
cmd
);
static
bool
commandToAll
(
const
string
section
,
ObjectRepository
*
rep
,
Command
cmd
);
static
void
createSections
(
UniSetTypes
::
Configuration
*
c
);
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
omap
();
int
msgmap
();
int
msgmap
();
...
@@ -815,7 +815,8 @@ int saveValue(string args, UniversalInterface &ui)
...
@@ -815,7 +815,8 @@ int saveValue(string args, UniversalInterface &ui)
int
err
;
int
err
;
err
=
0
;
err
=
0
;
string
arg
;
string
arg
;
UniSetTypes
::
ObjectId
sid
(
DefaultObjectId
);
UniSetTypes
::
ObjectId
sid
=
DefaultObjectId
;
UniSetTypes
::
ObjectId
node
=
DefaultObjectId
;
long
val
;
long
val
;
cout
<<
"====== saveValue ======"
<<
endl
;
cout
<<
"====== saveValue ======"
<<
endl
;
...
@@ -823,7 +824,7 @@ int saveValue(string args, UniversalInterface &ui)
...
@@ -823,7 +824,7 @@ int saveValue(string args, UniversalInterface &ui)
{
{
if
(
isdigit
(
arg
[
0
]
)
)
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
;
cout
<<
i
<<
"
\t
------------------------"
<<
endl
;
cerr
<<
"!!!!!!!!! SensorId=Value #"
<<
i
<<
" '"
<<
arg
<<
"' !!!!!!
\n
"
<<
endl
;
cerr
<<
"!!!!!!!!! SensorId=Value #"
<<
i
<<
" '"
<<
arg
<<
"' !!!!!!
\n
"
<<
endl
;
...
@@ -855,7 +856,10 @@ int saveValue(string args, UniversalInterface &ui)
...
@@ -855,7 +856,10 @@ int saveValue(string args, UniversalInterface &ui)
cout
<<
" value: "
<<
val
<<
endl
;
cout
<<
" value: "
<<
val
<<
endl
;
cout
<<
" name: ("
<<
sid
<<
") "
<<
conf
->
oind
->
getMapName
(
sid
)
<<
endl
;
cout
<<
" name: ("
<<
sid
<<
") "
<<
conf
->
oind
->
getMapName
(
sid
)
<<
endl
;
cout
<<
" text: "
<<
conf
->
oind
->
getTextName
(
sid
)
<<
"
\n\n
"
;
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
)
catch
(
Exception
&
ex
)
{
{
...
@@ -1319,3 +1323,32 @@ int oinfo(string arg, UniversalInterface &ui )
...
@@ -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;
}
*/
// --------------------------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment