Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
ca542003
Commit
ca542003
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Moved slaveState() to Command::alStateString().
parent
46c4fa6c
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tool/Command.cpp
+13
-0
13 additions, 0 deletions
tool/Command.cpp
tool/Command.h
+2
-0
2 additions, 0 deletions
tool/Command.h
tool/CommandSlaves.cpp
+2
-15
2 additions, 15 deletions
tool/CommandSlaves.cpp
tool/CommandSlaves.h
+0
-2
0 additions, 2 deletions
tool/CommandSlaves.h
with
17 additions
and
17 deletions
tool/Command.cpp
+
13
−
0
View file @
ca542003
...
@@ -79,3 +79,16 @@ void Command::throwCommandException(const stringstream &s)
...
@@ -79,3 +79,16 @@ void Command::throwCommandException(const stringstream &s)
}
}
/****************************************************************************/
/****************************************************************************/
string
Command
::
alStateString
(
uint8_t
state
)
{
switch
(
state
)
{
case
1
:
return
"INIT"
;
case
2
:
return
"PREOP"
;
case
4
:
return
"SAFEOP"
;
case
8
:
return
"OP"
;
default:
return
"???"
;
}
}
/****************************************************************************/
This diff is collapsed.
Click to expand it.
tool/Command.h
+
2
−
0
View file @
ca542003
...
@@ -83,6 +83,8 @@ class Command
...
@@ -83,6 +83,8 @@ class Command
void
throwCommandException
(
const
stringstream
&
);
void
throwCommandException
(
const
stringstream
&
);
enum
{
BreakAfterBytes
=
16
};
enum
{
BreakAfterBytes
=
16
};
static
string
alStateString
(
uint8_t
);
private
:
private
:
string
name
;
string
name
;
...
...
This diff is collapsed.
Click to expand it.
tool/CommandSlaves.cpp
+
2
−
15
View file @
ca542003
...
@@ -126,7 +126,7 @@ void CommandSlaves::listSlaves(
...
@@ -126,7 +126,7 @@ void CommandSlaves::listSlaves(
info
.
relPos
=
str
.
str
();
info
.
relPos
=
str
.
str
();
str
.
str
(
""
);
str
.
str
(
""
);
info
.
state
=
slaveState
(
slave
.
state
);
info
.
state
=
alStateString
(
slave
.
state
);
info
.
flag
=
(
slave
.
error_flag
?
'E'
:
'+'
);
info
.
flag
=
(
slave
.
error_flag
?
'E'
:
'+'
);
if
(
strlen
(
slave
.
name
))
{
if
(
strlen
(
slave
.
name
))
{
...
@@ -186,7 +186,7 @@ void CommandSlaves::showSlave(
...
@@ -186,7 +186,7 @@ void CommandSlaves::showSlave(
cout
<<
"Alias: "
<<
slave
.
alias
<<
endl
;
cout
<<
"Alias: "
<<
slave
.
alias
<<
endl
;
cout
cout
<<
"State: "
<<
slaveState
(
slave
.
state
)
<<
endl
<<
"State: "
<<
alStateString
(
slave
.
state
)
<<
endl
<<
"Flag: "
<<
(
slave
.
error_flag
?
'E'
:
'+'
)
<<
endl
<<
"Flag: "
<<
(
slave
.
error_flag
?
'E'
:
'+'
)
<<
endl
<<
"Identity:"
<<
endl
<<
"Identity:"
<<
endl
<<
" Vendor Id: 0x"
<<
" Vendor Id: 0x"
...
@@ -274,17 +274,4 @@ void CommandSlaves::showSlave(
...
@@ -274,17 +274,4 @@ void CommandSlaves::showSlave(
}
}
}
}
/****************************************************************************/
string
CommandSlaves
::
slaveState
(
uint8_t
state
)
{
switch
(
state
)
{
case
1
:
return
"INIT"
;
case
2
:
return
"PREOP"
;
case
4
:
return
"SAFEOP"
;
case
8
:
return
"OP"
;
default:
return
"???"
;
}
}
/*****************************************************************************/
/*****************************************************************************/
This diff is collapsed.
Click to expand it.
tool/CommandSlaves.h
+
0
−
2
View file @
ca542003
...
@@ -32,8 +32,6 @@ class CommandSlaves:
...
@@ -32,8 +32,6 @@ class CommandSlaves:
void
listSlaves
(
MasterDevice
&
,
int
);
void
listSlaves
(
MasterDevice
&
,
int
);
void
showSlave
(
MasterDevice
&
,
uint16_t
);
void
showSlave
(
MasterDevice
&
,
uint16_t
);
static
string
slaveState
(
uint8_t
);
};
};
/****************************************************************************/
/****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment