Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
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
ChimeraTK Mirror
ApplicationCore
Commits
83df8c81
Commit
83df8c81
authored
5 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
introduced oneUpAndHide in the StatusMonitor
parent
49390fac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/include/StatusMonitor.h
+14
-6
14 additions, 6 deletions
Modules/include/StatusMonitor.h
tests/executables_src/testStatusModule.cc
+5
-5
5 additions, 5 deletions
tests/executables_src/testStatusModule.cc
with
19 additions
and
11 deletions
Modules/include/StatusMonitor.h
+
14
−
6
View file @
83df8c81
...
...
@@ -42,7 +42,7 @@ namespace ChimeraTK {
StatusMonitor
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
HierarchyModifier
modifier
,
const
std
::
string
&
input
,
const
std
::
string
&
output
,
const
std
::
unordered_set
<
std
::
string
>&
tags
)
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
),
_parameterTags
(
tags
),
watch
(
this
,
input
,
""
,
""
,
tags
),
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
),
_parameterTags
(
tags
),
oneUp
(
this
,
input
,
tags
),
status
(
this
,
output
,
""
,
""
,
tags
)
{}
StatusMonitor
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
...
...
@@ -50,18 +50,18 @@ namespace ChimeraTK {
const
std
::
string
&
output
,
const
std
::
unordered_set
<
std
::
string
>&
outputTags
,
const
std
::
unordered_set
<
std
::
string
>&
parameterTags
)
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
),
_parameterTags
(
parameterTags
),
watch
(
this
,
input
,
""
,
""
,
inputTags
),
status
(
this
,
output
,
""
,
""
,
outputTags
)
{}
oneUp
(
this
,
input
,
inputTags
),
status
(
this
,
output
,
""
,
""
,
outputTags
)
{}
StatusMonitor
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
HierarchyModifier
modifier
,
const
std
::
string
&
input
,
const
std
::
unordered_set
<
std
::
string
>&
inputTags
,
const
std
::
string
&
output
,
const
std
::
unordered_set
<
std
::
string
>&
parameterTags
)
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
),
_parameterTags
(
parameterTags
),
watch
(
this
,
input
,
""
,
""
,
inputTags
),
status
(
this
,
output
,
""
,
""
,
{})
{}
oneUp
(
this
,
input
,
inputTags
),
status
(
this
,
output
,
""
,
""
,
{})
{}
StatusMonitor
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
description
,
HierarchyModifier
modifier
,
const
std
::
string
&
input
,
const
std
::
string
&
output
,
const
std
::
unordered_set
<
std
::
string
>&
inputTags
,
const
std
::
unordered_set
<
std
::
string
>&
outputTags
)
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
),
_parameterTags
({}),
watch
(
this
,
input
,
""
,
""
,
inputTags
),
:
ApplicationModule
(
owner
,
name
,
description
,
modifier
),
_parameterTags
({}),
oneUp
(
this
,
input
,
inputTags
),
status
(
this
,
output
,
""
,
""
,
outputTags
)
{}
~
StatusMonitor
()
override
{}
...
...
@@ -69,8 +69,16 @@ namespace ChimeraTK {
/**Tags for parameters. This makes it easier to connect them to e.g, to control system*/
std
::
unordered_set
<
std
::
string
>
_parameterTags
;
/**Input value that should be monitored*/
ScalarPushInput
<
T
>
watch
;
/**Input value that should be monitored. It is moved one level up, so it's parallel to this monitor object.*/
struct
OneUp
:
public
VariableGroup
{
OneUp
(
EntityOwner
*
owner
,
const
std
::
string
&
watchName
,
const
std
::
unordered_set
<
std
::
string
>&
tags
)
:
VariableGroup
(
owner
,
"hidden"
,
""
,
HierarchyModifier
::
oneUpAndHide
),
watch
(
this
,
watchName
,
""
,
""
,
tags
)
{}
ScalarPushInput
<
T
>
watch
;
}
oneUp
;
// Conveniance reference to avoid the "oneUp" in the code
ScalarPushInput
<
T
>&
watch
=
oneUp
.
watch
;
/**One of four possible states to be reported*/
ScalarOutput
<
uint16_t
>
status
;
};
...
...
This diff is collapsed.
Click to expand it.
tests/executables_src/testStatusModule.cc
+
5
−
5
View file @
83df8c81
...
...
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(testMaxMonitor) {
error
.
write
();
test
.
stepApplication
();
auto
watch
=
test
.
getScalar
<
double_t
>
(
std
::
string
(
"/
monitor/
watch"
));
auto
watch
=
test
.
getScalar
<
double_t
>
(
std
::
string
(
"/watch"
));
watch
=
40.1
;
watch
.
write
();
test
.
stepApplication
();
...
...
@@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE(testMinMonitor) {
error
.
write
();
test
.
stepApplication
();
auto
watch
=
test
.
getScalar
<
uint
>
(
std
::
string
(
"/
monitor/
watch"
));
auto
watch
=
test
.
getScalar
<
uint
>
(
std
::
string
(
"/watch"
));
watch
=
55
;
watch
.
write
();
test
.
stepApplication
();
...
...
@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE(testRangeMonitor) {
errorLowerLimit
.
write
();
test
.
stepApplication
();
auto
watch
=
test
.
getScalar
<
int
>
(
std
::
string
(
"/
monitor/
watch"
));
auto
watch
=
test
.
getScalar
<
int
>
(
std
::
string
(
"/watch"
));
watch
=
40
;
watch
.
write
();
test
.
stepApplication
();
...
...
@@ -338,7 +338,7 @@ BOOST_AUTO_TEST_CASE(testExactMonitor) {
requiredValue
.
write
();
test
.
stepApplication
();
auto
watch
=
test
.
getScalar
<
float
>
(
std
::
string
(
"/
monitor/
watch"
));
auto
watch
=
test
.
getScalar
<
float
>
(
std
::
string
(
"/watch"
));
watch
=
40.9
;
watch
.
write
();
test
.
stepApplication
();
...
...
@@ -396,7 +396,7 @@ BOOST_AUTO_TEST_CASE(testStateMonitor) {
stateValue
.
write
();
test
.
stepApplication
();
auto
watch
=
test
.
getScalar
<
uint8_t
>
(
std
::
string
(
"/
monitor/
watch"
));
auto
watch
=
test
.
getScalar
<
uint8_t
>
(
std
::
string
(
"/watch"
));
watch
=
1
;
watch
.
write
();
test
.
stepApplication
();
...
...
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